From 074bab321e34867feade8358abdad5b0a6fb5503 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Mon, 21 Feb 2022 17:22:18 +0100 Subject: [PATCH] Add notes that "check_pw1 causes the error counter to decrease" (see #23) on some cards --- openpgp-card/src/lib.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/openpgp-card/src/lib.rs b/openpgp-card/src/lib.rs index a4ac3e6..f0de92e 100644 --- a/openpgp-card/src/lib.rs +++ b/openpgp-card/src/lib.rs @@ -431,8 +431,10 @@ pub trait CardTransaction { /// /// If verification is not required, an empty Ok Response is returned. /// - /// (Note: some cards don't correctly implement this feature, - /// e.g. YubiKey 5) + /// (Note: + /// - some cards don't correctly implement this feature, e.g. YubiKey 5 + /// - some cards that don't support this instruction may decrease the pin's error count, + /// eventually requiring the user to reset the pin) fn check_pw1_for_signing(&mut self) -> Result<(), Error> { let verify = commands::verify_pw1_81(vec![]); apdu::send_command(self, verify, false)?.try_into() @@ -459,8 +461,10 @@ pub trait CardTransaction { /// /// If verification is not required, an empty Ok Response is returned. /// - /// (Note: some cards don't correctly implement this feature, - /// e.g. YubiKey 5) + /// (Note: + /// - some cards don't correctly implement this feature, e.g. YubiKey 5 + /// - some cards that don't support this instruction may decrease the pin's error count, + /// eventually requiring the user to reset the pin) fn check_pw1(&mut self) -> Result<(), Error> { let verify = commands::verify_pw1_82(vec![]); apdu::send_command(self, verify, false)?.try_into() @@ -483,8 +487,10 @@ pub trait CardTransaction { /// /// If verification is not required, an empty Ok Response is returned. /// - /// (Note: some cards don't correctly implement this feature, - /// e.g. YubiKey 5) + /// (Note: + /// - some cards don't correctly implement this feature, e.g. YubiKey 5 + /// - some cards that don't support this instruction may decrease the pin's error count, + /// eventually requiring the user to reset the pin) fn check_pw3(&mut self) -> Result<(), Error> { let verify = commands::verify_pw3(vec![]); apdu::send_command(self, verify, false)?.try_into()