give better exception; refs #30

master
Marc Wäckerlin 11 years ago
parent 75a0ca9684
commit b997767160
  1. 14
      src/cryptoki.hxx

@ -1867,11 +1867,15 @@ namespace cryptoki {
CK_USER_TYPE userType=CKU_USER): _session(session) {
CRYPTOLOG("log");
//! calls @c C_Login
_session.check(_session._slot.library()->C_Login
(_session._session, userType,
const_cast<CK_CHAR*>((const CK_CHAR*)pin.c_str()),
(int)pin.size()),
CRYPTOKI_FN_LOG("C_Login"));
try {
_session.check(_session._slot.library()->C_Login
(_session._session, userType,
const_cast<CK_CHAR*>((const CK_CHAR*)pin.c_str()),
(int)pin.size()),
CRYPTOKI_FN_LOG("C_Login"));
} catch (std::exception& x) {
throw wrong_pin(x.what());
}
}
~Login() {

Loading…
Cancel
Save