]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Detect whether token has been logged in properly 2536/head
authorAki Tuomi <cmouse@cmouse.fi>
Sun, 17 May 2015 17:57:18 +0000 (20:57 +0300)
committerAki Tuomi <cmouse@cmouse.fi>
Sun, 17 May 2015 17:57:18 +0000 (20:57 +0300)
pdns/pkcs11signers.cc

index f36b3fd42e25486914a0f68c92d40057808efff9..d1f9bb08882ebbc995c4bad9abaee811ed762117 100644 (file)
@@ -231,7 +231,7 @@ class Pkcs11Slot {
       }
       // check if we need to login
       if ((d_err = d_functions->C_GetTokenInfo(d_slot, &tokenInfo)) == 0) {
-        d_logged_in = ((tokenInfo.flags && CKF_LOGIN_REQUIRED) == CKF_LOGIN_REQUIRED);
+        d_logged_in = !((tokenInfo.flags & CKF_LOGIN_REQUIRED) == CKF_LOGIN_REQUIRED);
       } else {
         logError("C_GetTokenInfo");
         throw PDNSException("Cannot get token info for slot " + boost::lexical_cast<std::string>(slot));