From 7f43d15942c35853dcb7604e97b0c20360279855 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 20 Aug 2021 13:18:11 +0100 Subject: [PATCH] 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. --- src/yubikey.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yubikey.rs b/src/yubikey.rs index 101b0b5..1a15eaa 100644 --- a/src/yubikey.rs +++ b/src/yubikey.rs @@ -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)), })); }