From 245dde6f5bd91a8ef7e5fe770d11bf10a416334f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Fri, 9 May 2014 11:21:04 +0000 Subject: [PATCH] puk-unlock forgotten - added; refs #30 --- src/cardos.hxx | 96 ++++++++++++++++++++++++++++++++++-------------- src/suisseid.hxx | 8 ++-- 2 files changed, 73 insertions(+), 31 deletions(-) diff --git a/src/cardos.hxx b/src/cardos.hxx index a217a49..3f139c6 100644 --- a/src/cardos.hxx +++ b/src/cardos.hxx @@ -50,15 +50,14 @@ namespace cardos { wrong_pin(const std::string& s) throw(): exception("wrong pin "+s) {} }; //---------------------------------------------------------------------------- - class user_pin_locked: public exception { + class pin_locked: public exception { public: - user_pin_locked(const std::string& s) throw(): - exception("user pin locked "+s) {} + pin_locked() throw(): exception("pin is locked and cannot be changed") {} }; //---------------------------------------------------------------------------- - class wrong_puk: public exception { + class wrong_puk: public wrong_pin { public: - wrong_puk(const std::string& s) throw(): exception("wrong puk "+s) {} + wrong_puk(const std::string& s) throw(): wrong_pin("wrong puk "+s) {} }; //---------------------------------------------------------------------------- class wrong_result: public exception { @@ -116,11 +115,6 @@ namespace cardos { +"; length: "+mrw::string(j)) { } }; - //---------------------------------------------------------------------------- - class pin_locked: public exception { - public: - pin_locked() throw(): exception("pin is locked and cannot be changed") {} - }; //@} //============================================================================ @@ -1088,7 +1082,7 @@ namespace cardos { //! Performs a PIN test (CHV test) void verify(std::string pin, unsigned char id, VerifyMode mode = SEARCH_FROM_DF) { - CRYPTOLOG("log"); + CRYPTOLOG("log pin=\""<changePins(pins.newpin, pins.oldpin); + _card->unlock(pins.newpin, pins.oldpin); return start(); }