From: Aki Tuomi Date: Sun, 17 May 2015 17:57:18 +0000 (+0300) Subject: Detect whether token has been logged in properly X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~28^2~43^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2536%2Fhead;p=thirdparty%2Fpdns.git Detect whether token has been logged in properly --- diff --git a/pdns/pkcs11signers.cc b/pdns/pkcs11signers.cc index f36b3fd42e..d1f9bb0888 100644 --- a/pdns/pkcs11signers.cc +++ b/pdns/pkcs11signers.cc @@ -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(slot));