keymgr: Import internal!.

This commit is contained in:
Gabriela Moldovan 2023-07-25 11:53:44 +01:00
parent 9d8c28c639
commit 0b109f3ee8
No known key found for this signature in database
GPG Key ID: 3946E0ADE72BAC99
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ use ssh_key::Algorithm;
use crate::{ErasedKey, KeyType, KeystoreError, Result};
use tor_error::{ErrorKind, HasKind};
use tor_error::{ErrorKind, HasKind, internal};
use tor_llcrypto::pk::{curve25519, ed25519};
use zeroize::Zeroizing;
@ -166,7 +166,7 @@ impl KeyType {
match sk.key_data() {
KeypairData::Ed25519(key) => Ok(ed25519::Keypair::from_bytes(&key.to_bytes())
.map_err(|_| {
tor_error::internal!("failed to build ed25519 key out of ed25519 OpenSSH key")
internal!("failed to build ed25519 key out of ed25519 OpenSSH key")
})
.map(Box::new)?),
KeypairData::Other(key)
@ -176,7 +176,7 @@ impl KeyType {
.private
.as_ref()
.try_into()
.map_err(|_| tor_error::internal!("invalid x25519 private key"))?;
.map_err(|_| internal!("invalid x25519 private key"))?;
Ok(Box::new(curve25519::StaticSecret::from(key)))
}