keymgr: Import internal! (fmt).
This commit is contained in:
parent
0b109f3ee8
commit
abf83ecfa6
|
@ -8,7 +8,7 @@ use ssh_key::Algorithm;
|
||||||
|
|
||||||
use crate::{ErasedKey, KeyType, KeystoreError, Result};
|
use crate::{ErasedKey, KeyType, KeystoreError, Result};
|
||||||
|
|
||||||
use tor_error::{ErrorKind, HasKind, internal};
|
use tor_error::{internal, ErrorKind, HasKind};
|
||||||
use tor_llcrypto::pk::{curve25519, ed25519};
|
use tor_llcrypto::pk::{curve25519, ed25519};
|
||||||
use zeroize::Zeroizing;
|
use zeroize::Zeroizing;
|
||||||
|
|
||||||
|
@ -165,9 +165,7 @@ impl KeyType {
|
||||||
// we're using internally).
|
// we're using internally).
|
||||||
match sk.key_data() {
|
match sk.key_data() {
|
||||||
KeypairData::Ed25519(key) => Ok(ed25519::Keypair::from_bytes(&key.to_bytes())
|
KeypairData::Ed25519(key) => Ok(ed25519::Keypair::from_bytes(&key.to_bytes())
|
||||||
.map_err(|_| {
|
.map_err(|_| 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)?),
|
.map(Box::new)?),
|
||||||
KeypairData::Other(key)
|
KeypairData::Other(key)
|
||||||
if SshKeyAlgorithm::from(key.algorithm()) == SshKeyAlgorithm::X25519 =>
|
if SshKeyAlgorithm::from(key.algorithm()) == SshKeyAlgorithm::X25519 =>
|
||||||
|
|
Loading…
Reference in New Issue