From: Aki Tuomi Date: Sun, 29 Mar 2015 15:57:23 +0000 (+0300) Subject: Ask for all slots before asking for slot X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~98^2~33^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96ac321da76ceda894adbb7d9a506b1fb256e207;p=thirdparty%2Fpdns.git Ask for all slots before asking for slot OpenSC with certain card(s) requires this call to make slots visible. --- diff --git a/pdns/pkcs11signers.cc b/pdns/pkcs11signers.cc index 52bc44616f..fababbcd4e 100644 --- a/pdns/pkcs11signers.cc +++ b/pdns/pkcs11signers.cc @@ -643,6 +643,11 @@ boost::shared_ptr Pkcs11Token::GetToken(const std::string& module, _CK_SLOT_INFO info; unsigned long slots; + // this is required by certain tokens, otherwise C_GetSlotInfo will not return a token + err = functions->C_GetSlotList(CK_FALSE, NULL_PTR, &slots); + if (err) + L<(slotId) + std::string(" on module ") + module + std::string(": error code ") + boost::lexical_cast(err)); }