We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 062b57b commit 3611ab1Copy full SHA for 3611ab1
russh-keys/src/format/openssh.rs
@@ -120,7 +120,10 @@ fn decrypt_secret_key(
120
let rounds = kdfopts.read_u32()?;
121
#[allow(clippy::unwrap_used)] // parameters are static
122
#[allow(clippy::indexing_slicing)] // output length is static
123
- bcrypt_pbkdf::bcrypt_pbkdf(password, salt, rounds, &mut key[..n]).unwrap();
+ match bcrypt_pbkdf::bcrypt_pbkdf(password, salt, rounds, &mut key[..n]) {
124
+ Err(bcrypt_pbkdf::Error::InvalidParamLen) => return Err(Error::KeyIsEncrypted),
125
+ e => e.unwrap()
126
+ }
127
}
128
_kdfname => {
129
return Err(Error::CouldNotReadKey);
0 commit comments