[pkg-opensc-commit] [libp11] 107/239: "frain" reported: libp11 fails at enumerating tokens if a PKCS#11 library returns CKR_TOKEN_NOT_RECOGNIZED on a C_GetTokenInfo call. The attached patch causes libp11 to treat slots containing unrecognized tokens as empty slots during token enumeration, letting the enumeration succeed even if unrecognized tokens are present.

Eric Dorland eric at moszumanska.debian.org
Sat Oct 17 06:21:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libp11.

commit 4be38fa4e3e6ee9c70ecaef9727dd0e0d38fa39b
Author: Andreas Jellinghaus <andreas at ionisiert.de>
Date:   Tue Jul 3 14:23:16 2007 +0000

    "frain" reported:  libp11 fails at enumerating tokens if a PKCS#11 library
    returns CKR_TOKEN_NOT_RECOGNIZED on a C_GetTokenInfo call. The attached patch
    causes libp11 to treat slots containing unrecognized tokens as empty slots
    during token enumeration, letting the enumeration succeed even if unrecognized
    tokens are present.
    
    applied his patch.
---
 src/p11_slot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/p11_slot.c b/src/p11_slot.c
index 0ebaf8a..ea542fa 100644
--- a/src/p11_slot.c
+++ b/src/p11_slot.c
@@ -353,7 +353,7 @@ static int pkcs11_check_token(PKCS11_CTX * ctx, PKCS11_SLOT * slot)
 	token = slot->token;
 
 	rv = CRYPTOKI_call(ctx, C_GetTokenInfo(priv->id, &info));
-	if (rv == CKR_TOKEN_NOT_PRESENT) {
+	if (rv == CKR_TOKEN_NOT_PRESENT || rv == CKR_TOKEN_NOT_RECOGNIZED) {
 		OPENSSL_free(token);
 		slot->token = NULL;
 		return 0;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git



More information about the pkg-opensc-commit mailing list