Hello,

the attached patch fixes #220. Now the login function does what its name
promises. If user-login is not desired, then simply don't call login()!

(remove pkcs11/framework-pkcs15.c#L792, for testing the patch)

Regards
Andre

Index: tools/pkcs11-tool.c
===================================================================
--- tools/pkcs11-tool.c	(revision 4829)
+++ tools/pkcs11-tool.c	(working copy)
@@ -908,9 +908,6 @@
 
 	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 @@
 	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: ");
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to