[pkg-opensc-commit] [libp11] 70/86: CKA_ALWAYS_AUTHENTICATE cleanup
Eric Dorland
eric at moszumanska.debian.org
Sun Jul 24 21:40:24 UTC 2016
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libp11.
commit 5bec31725bf95e9530b26c80d5c93ad6a41817ea
Author: MichaĆ Trojnara <Michal.Trojnara at stunnel.org>
Date: Sat Mar 12 08:32:56 2016 +0100
CKA_ALWAYS_AUTHENTICATE cleanup
- Allowed NULL PIN used with CKF_PROTECTED_AUTHENTICATION_PATH
- Removed debugging output
---
src/p11_key.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/p11_key.c b/src/p11_key.c
index 5d9efa3..5247cab 100644
--- a/src/p11_key.c
+++ b/src/p11_key.c
@@ -296,10 +296,6 @@ EVP_PKEY *pkcs11_get_key(PKCS11_KEY *key, int isPrivate)
if(key_getattr_val(key, CKA_ALWAYS_AUTHENTICATE,
&kpriv->always_authenticate, sizeof(CK_BBOOL)))
fprintf(stderr, "Missing CKA_ALWAYS_AUTHENTICATE attribute\n");
- else if (kpriv->always_authenticate)
- fprintf(stderr, "CKA_ALWAYS_AUTHENTICATE attribute set\n");
- else
- fprintf(stderr, "CKA_ALWAYS_AUTHENTICATE attribute not set\n");
}
}
return key->evp_key;
@@ -316,11 +312,12 @@ int pkcs11_authenticate(PKCS11_KEY *key)
PKCS11_CTX *ctx = SLOT2CTX(slot);
int rv;
- if (!kpriv->always_authenticate || spriv->prev_pin == NULL)
+ if (!kpriv->always_authenticate)
return 0;
rv = CRYPTOKI_call(ctx,
C_Login(spriv->session, CKU_CONTEXT_SPECIFIC,
- (CK_UTF8CHAR *)spriv->prev_pin, strlen(spriv->prev_pin)));
+ (CK_UTF8CHAR *)spriv->prev_pin,
+ spriv->prev_pin ? strlen(spriv->prev_pin) : 0));
if (rv == CKR_USER_ALREADY_LOGGED_IN) /* ignore */
rv = 0;
return rv;
--
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