Skip to content

Commit

Permalink
Remove calls to dbg!() (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicEric authored and Eugeny committed Dec 20, 2024
1 parent cb5d3ba commit 97ec468
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 34 deletions.
53 changes: 23 additions & 30 deletions russh-keys/src/format/pkcs8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,39 +47,32 @@ fn pkcs8_pki_into_keypair_data(pki: PrivateKeyInfo<'_>) -> Result<KeypairData, E
)?;
Ok(KeypairData::Rsa(pk.try_into()?))
}
sec1::ALGORITHM_OID => {
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)),
}
}
Expand Down
2 changes: 0 additions & 2 deletions russh-keys/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -87,7 +86,6 @@ mod signature_workarounds {
key: &PrivateKeyWithHashAlg,
data: &[u8],
) -> ssh_key::Result<Vec<u8>> {
dbg!(&key);
Ok(match key.key_data() {
ssh_key::private::KeypairData::Rsa(rsa_keypair) => {
let pk = rsa::RsaPrivateKey::from_components(
Expand Down
3 changes: 1 addition & 2 deletions russh/examples/echoserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ impl server::Handler for Server {
async fn auth_openssh_certificate(
&mut self,
_user: &str,
certificate: &Certificate,
_certificate: &Certificate,
) -> Result<server::Auth, Self::Error> {
dbg!(certificate);
Ok(server::Auth::Accept)
}

Expand Down

0 comments on commit 97ec468

Please sign in to comment.