diff --git a/russh-keys/src/format/pkcs8.rs b/russh-keys/src/format/pkcs8.rs index e1b83b85..9fd269e7 100644 --- a/russh-keys/src/format/pkcs8.rs +++ b/russh-keys/src/format/pkcs8.rs @@ -47,39 +47,32 @@ fn pkcs8_pki_into_keypair_data(pki: PrivateKeyInfo<'_>) -> Result { - let sk = &sec1::EcPrivateKey::try_from(pki.private_key)?; - dbg!(sk.private_key); - dbg!(sk.public_key); - dbg!(sk.parameters); - dbg!(sk.parameters.and_then(|x| x.named_curve())); - Ok(KeypairData::Ecdsa( - match pki.algorithm.parameters_oid()? { - NistP256::OID => { - let sk = p256::SecretKey::try_from(pki)?; - EcdsaKeypair::NistP256 { - public: sk.public_key().into(), - private: sk.into(), - } + sec1::ALGORITHM_OID => Ok(KeypairData::Ecdsa( + match pki.algorithm.parameters_oid()? { + NistP256::OID => { + let sk = p256::SecretKey::try_from(pki)?; + EcdsaKeypair::NistP256 { + public: sk.public_key().into(), + private: sk.into(), } - NistP384::OID => { - let sk = p384::SecretKey::try_from(pki)?; - EcdsaKeypair::NistP384 { - public: sk.public_key().into(), - private: sk.into(), - } + } + NistP384::OID => { + let sk = p384::SecretKey::try_from(pki)?; + EcdsaKeypair::NistP384 { + public: sk.public_key().into(), + private: sk.into(), } - NistP521::OID => { - let sk = p521::SecretKey::try_from(pki)?; - EcdsaKeypair::NistP521 { - public: sk.public_key().into(), - private: sk.into(), - } + } + NistP521::OID => { + let sk = p521::SecretKey::try_from(pki)?; + EcdsaKeypair::NistP521 { + public: sk.public_key().into(), + private: sk.into(), } - oid => return Err(Error::UnknownAlgorithm(oid)), - }, - )) - } + } + oid => return Err(Error::UnknownAlgorithm(oid)), + }, + )), oid => Err(Error::UnknownAlgorithm(oid)), } } diff --git a/russh-keys/src/helpers.rs b/russh-keys/src/helpers.rs index cdeff1c1..ef8b330a 100644 --- a/russh-keys/src/helpers.rs +++ b/russh-keys/src/helpers.rs @@ -77,7 +77,6 @@ mod signature_workarounds { let mut buf = Vec::new(); Algorithm::Rsa { hash: hash_alg }.encode(&mut buf)?; signature.to_vec().encode(&mut buf)?; - dbg!(&buf); Ok(buf) } @@ -87,7 +86,6 @@ mod signature_workarounds { key: &PrivateKeyWithHashAlg, data: &[u8], ) -> ssh_key::Result> { - dbg!(&key); Ok(match key.key_data() { ssh_key::private::KeypairData::Rsa(rsa_keypair) => { let pk = rsa::RsaPrivateKey::from_components( diff --git a/russh/examples/echoserver.rs b/russh/examples/echoserver.rs index 26618d19..79487891 100644 --- a/russh/examples/echoserver.rs +++ b/russh/examples/echoserver.rs @@ -92,9 +92,8 @@ impl server::Handler for Server { async fn auth_openssh_certificate( &mut self, _user: &str, - certificate: &Certificate, + _certificate: &Certificate, ) -> Result { - dbg!(certificate); Ok(server::Auth::Accept) }