From 5ccd6be1bb003f277a9d76e5fcea45102af4c1ff Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Mon, 6 Sep 2021 12:27:44 +0200 Subject: [PATCH] Remove asserts for password lengths (running the command and returning the card's error, if any, seems more appropriate) --- openpgp-card/src/card_app.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/openpgp-card/src/card_app.rs b/openpgp-card/src/card_app.rs index 54ec2fc..68b33c2 100644 --- a/openpgp-card/src/card_app.rs +++ b/openpgp-card/src/card_app.rs @@ -295,9 +295,6 @@ impl CardApp { let resp = apdu::send_command(&mut self.card_client, act, false)?; resp.check_ok()?; - // FIXME: does the connection need to be re-opened on some cards, - // after reset?! - Ok(()) } @@ -311,8 +308,6 @@ impl CardApp { &mut self, pin: &str, ) -> Result { - assert!(pin.len() >= 6); // FIXME: Err - let verify = commands::verify_pw1_81(pin.as_bytes().to_vec()); apdu::send_command(&mut self.card_client, verify, false)?.try_into() } @@ -331,8 +326,6 @@ impl CardApp { /// Verify PW1 (user) and set an appropriate access status. /// (For operations except signing, mode 82). pub fn verify_pw1(&mut self, pin: &str) -> Result { - assert!(pin.len() >= 6); // FIXME: Err - let verify = commands::verify_pw1_82(pin.as_bytes().to_vec()); apdu::send_command(&mut self.card_client, verify, false)?.try_into() } @@ -351,8 +344,6 @@ impl CardApp { /// Verify PW3 (admin) and set an appropriate access status. pub fn verify_pw3(&mut self, pin: &str) -> Result { - assert!(pin.len() >= 8); // FIXME: Err - let verify = commands::verify_pw3(pin.as_bytes().to_vec()); apdu::send_command(&mut self.card_client, verify, false)?.try_into() }