From bcef13cfd2724d65b2a4372959d21494c1fd785c Mon Sep 17 00:00:00 2001 From: andre Date: Thu, 18 Nov 2010 14:56:26 +0000 Subject: [PATCH] In login() the flag CKF_LOGIN_REQUIRED is now ignored. This makes the behaviour of login() more predictable. If parameter --login is specified on the command line, then C_Login() is always called.fixes #220 git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4875 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/tools/pkcs11-tool.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/tools/pkcs11-tool.c b/src/tools/pkcs11-tool.c index dd925094..68cba8b8 100644 --- a/src/tools/pkcs11-tool.c +++ b/src/tools/pkcs11-tool.c @@ -908,9 +908,6 @@ static int login(CK_SESSION_HANDLE session, int login_type) get_token_info(opt_slot, &info); - if (!(info.flags & CKF_LOGIN_REQUIRED)) - return 0; - /* Identify which pin to enter */ if (login_type == CKU_SO) @@ -920,8 +917,7 @@ static int login(CK_SESSION_HANDLE session, int login_type) else if (login_type == CKU_CONTEXT_SPECIFIC) pin = opt_pin ? opt_pin : opt_puk; - if (!pin && (info.flags & CKF_LOGIN_REQUIRED) - && !(info.flags & CKF_PROTECTED_AUTHENTICATION_PATH)) { + if (!pin && !(info.flags & CKF_PROTECTED_AUTHENTICATION_PATH)) { printf("Logging in to \"%s\".\n", p11_utf8_to_local(info.label, sizeof(info.label))); if (login_type == CKU_SO) printf("Please enter SO PIN: ");