Skip to content

Commit 97ec468

Browse files
EpicEricEugeny
authored andcommitted
Remove calls to dbg!() (#414)
1 parent cb5d3ba commit 97ec468

File tree

3 files changed

+24
-34
lines changed

3 files changed

+24
-34
lines changed

russh-keys/src/format/pkcs8.rs

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,39 +47,32 @@ fn pkcs8_pki_into_keypair_data(pki: PrivateKeyInfo<'_>) -> Result<KeypairData, E
4747
)?;
4848
Ok(KeypairData::Rsa(pk.try_into()?))
4949
}
50-
sec1::ALGORITHM_OID => {
51-
let sk = &sec1::EcPrivateKey::try_from(pki.private_key)?;
52-
dbg!(sk.private_key);
53-
dbg!(sk.public_key);
54-
dbg!(sk.parameters);
55-
dbg!(sk.parameters.and_then(|x| x.named_curve()));
56-
Ok(KeypairData::Ecdsa(
57-
match pki.algorithm.parameters_oid()? {
58-
NistP256::OID => {
59-
let sk = p256::SecretKey::try_from(pki)?;
60-
EcdsaKeypair::NistP256 {
61-
public: sk.public_key().into(),
62-
private: sk.into(),
63-
}
50+
sec1::ALGORITHM_OID => Ok(KeypairData::Ecdsa(
51+
match pki.algorithm.parameters_oid()? {
52+
NistP256::OID => {
53+
let sk = p256::SecretKey::try_from(pki)?;
54+
EcdsaKeypair::NistP256 {
55+
public: sk.public_key().into(),
56+
private: sk.into(),
6457
}
65-
NistP384::OID => {
66-
let sk = p384::SecretKey::try_from(pki)?;
67-
EcdsaKeypair::NistP384 {
68-
public: sk.public_key().into(),
69-
private: sk.into(),
70-
}
58+
}
59+
NistP384::OID => {
60+
let sk = p384::SecretKey::try_from(pki)?;
61+
EcdsaKeypair::NistP384 {
62+
public: sk.public_key().into(),
63+
private: sk.into(),
7164
}
72-
NistP521::OID => {
73-
let sk = p521::SecretKey::try_from(pki)?;
74-
EcdsaKeypair::NistP521 {
75-
public: sk.public_key().into(),
76-
private: sk.into(),
77-
}
65+
}
66+
NistP521::OID => {
67+
let sk = p521::SecretKey::try_from(pki)?;
68+
EcdsaKeypair::NistP521 {
69+
public: sk.public_key().into(),
70+
private: sk.into(),
7871
}
79-
oid => return Err(Error::UnknownAlgorithm(oid)),
80-
},
81-
))
82-
}
72+
}
73+
oid => return Err(Error::UnknownAlgorithm(oid)),
74+
},
75+
)),
8376
oid => Err(Error::UnknownAlgorithm(oid)),
8477
}
8578
}

russh-keys/src/helpers.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ mod signature_workarounds {
7777
let mut buf = Vec::new();
7878
Algorithm::Rsa { hash: hash_alg }.encode(&mut buf)?;
7979
signature.to_vec().encode(&mut buf)?;
80-
dbg!(&buf);
8180
Ok(buf)
8281
}
8382

@@ -87,7 +86,6 @@ mod signature_workarounds {
8786
key: &PrivateKeyWithHashAlg,
8887
data: &[u8],
8988
) -> ssh_key::Result<Vec<u8>> {
90-
dbg!(&key);
9189
Ok(match key.key_data() {
9290
ssh_key::private::KeypairData::Rsa(rsa_keypair) => {
9391
let pk = rsa::RsaPrivateKey::from_components(

russh/examples/echoserver.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ impl server::Handler for Server {
9292
async fn auth_openssh_certificate(
9393
&mut self,
9494
_user: &str,
95-
certificate: &Certificate,
95+
_certificate: &Certificate,
9696
) -> Result<server::Auth, Self::Error> {
97-
dbg!(certificate);
9897
Ok(server::Auth::Accept)
9998
}
10099

0 commit comments

Comments
 (0)