[pkg-opensc-commit] [libp11] 98/239: Risto Laanoja: Make ..USER_ALREADY_LOGGED_IN nonfatal. (There is long comment in engine_pkcs11.c about this topic). I think it is correct way to deal with multiple logins and possibility of token replacement.

Eric Dorland eric at moszumanska.debian.org
Sat Oct 17 06:21:13 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 94774d6ed9f07930213f06281ebcbfcc95c66141
Author: Andreas Jellinghaus <andreas at ionisiert.de>
Date:   Fri Jun 29 06:22:32 2007 +0000

    Risto Laanoja:
    Make ..USER_ALREADY_LOGGED_IN nonfatal. (There is long comment in
    engine_pkcs11.c about this topic). I think it is correct way to deal
    with multiple logins and possibility of token replacement.
---
 src/p11_slot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/p11_slot.c b/src/p11_slot.c
index 50418fc..d30335f 100644
--- a/src/p11_slot.c
+++ b/src/p11_slot.c
@@ -141,7 +141,8 @@ int PKCS11_login(PKCS11_SLOT * slot, int so, const char *pin)
 					so ? CKU_SO : CKU_USER,
 					(CK_UTF8CHAR *) pin,
 					pin ? strlen(pin) : 0));
-	CRYPTOKI_checkerr(PKCS11_F_PKCS11_LOGIN, rv);
+	if (rv && rv != CKR_USER_ALREADY_LOGGED_IN)  /* logged in -> OK   */
+		CRYPTOKI_checkerr(PKCS11_F_PKCS11_LOGIN, rv);
 	priv->loggedIn = 1;
 	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