give better exception; refs #30

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

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

Loading…
Cancel
Save