From 96ac321da76ceda894adbb7d9a506b1fb256e207 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Sun, 29 Mar 2015 18:57:23 +0300 Subject: [PATCH] Ask for all slots before asking for slot OpenSC with certain card(s) requires this call to make slots visible. --- pdns/pkcs11signers.cc | 5 +++++ 1 file changed, 5 insertions(+) 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)); } -- 2.47.2