Use CLI error type to render errors from yubikey.verify_pin()

This ensures that the attempts-before-blocked counter is displayed to
users during the plugin protocol.
This commit is contained in:
Jack Grigg
2021-08-20 13:18:11 +01:00
parent 0bbea83abf
commit 7f43d15942
+2 -2
View File
@@ -328,10 +328,10 @@ impl Stub {
}))
}
};
if yubikey.verify_pin(pin.expose_secret().as_bytes()).is_err() {
if let Err(e) = yubikey.verify_pin(pin.expose_secret().as_bytes()) {
return Ok(Err(identity::Error::Identity {
index: self.identity_index,
message: "Invalid YubiKey PIN".to_owned(),
message: format!("{:?}", Error::YubiKey(e)),
}));
}