[pkg-opensc-commit] [opensc] 164/295: Revert "pkcs11-tool: re-login if pincache is disabled or expired"

Eric Dorland eric at moszumanska.debian.org
Sat Jun 24 21:11:27 UTC 2017


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

eric pushed a commit to branch master
in repository opensc.

commit 37844fc6c3a609750591917e2bb1924bb066a9fc
Author: Nuno Goncalves <nunojpg at gmail.com>
Date:   Thu Jan 26 14:23:40 2017 +0100

    Revert "pkcs11-tool: re-login if pincache is disabled or expired"
    
    This reverts commit 1bc09ddafa7e7c44a62226b2c2380e558bee9360.
    
    This commit had totally wrong.
    
    Signed-off-by: Nuno Goncalves <nunojpg at gmail.com>
---
 src/tools/pkcs11-tool.c | 41 +++++++----------------------------------
 1 file changed, 7 insertions(+), 34 deletions(-)

diff --git a/src/tools/pkcs11-tool.c b/src/tools/pkcs11-tool.c
index 99758dc..38551f0 100644
--- a/src/tools/pkcs11-tool.c
+++ b/src/tools/pkcs11-tool.c
@@ -305,7 +305,6 @@ static char *		opt_key_type = NULL;
 static char *		opt_sig_format = NULL;
 static int		opt_is_private = 0;
 static int		opt_test_hotplug = 0;
-static int		opt_login = 0;
 static int		opt_login_type = -1;
 static int		opt_key_usage_sign = 0;
 static int		opt_key_usage_decrypt = 0;
@@ -449,6 +448,7 @@ int main(int argc, char * argv[])
 	int do_test_fork = 0;
 #endif
 	int need_session = 0;
+	int opt_login = 0;
 	int do_init_token = 0;
 	int do_init_pin = 0;
 	int do_change_pin = 0;
@@ -4128,17 +4128,8 @@ static int test_signature(CK_SESSION_HANDLE sess)
 	if (rv != CKR_OK)
 		p11_fatal("C_OpenSession", rv);
 	if ((sessionInfo.state & CKS_RO_USER_FUNCTIONS) == 0) {
-		if (opt_login) {
-			int r;
-			r = login(sess, CKU_CONTEXT_SPECIFIC);
-			if (r != 0){
-				printf("Signatures: failed to login, skipping signature tests\n");
-				return errors;
-			}
-		} else {
-			printf("Signatures: not logged in, skipping signature tests\n");
-			return errors;
-		}
+		printf("Signatures: not logged in, skipping signature tests\n");
+		return errors;
 	}
 
 	if (!find_mechanism(sessionInfo.slotID, CKF_SIGN | CKF_HW, mechTypes, mechTypes_num, &firstMechType)) {
@@ -4450,17 +4441,8 @@ static int test_verify(CK_SESSION_HANDLE sess)
 	if (rv != CKR_OK)
 		p11_fatal("C_OpenSession", rv);
 	if ((sessionInfo.state & CKS_RO_USER_FUNCTIONS) == 0) {
-		if (opt_login) {
-			int r;
-			r = login(sess, CKU_CONTEXT_SPECIFIC);
-			if (r != 0){
-				printf("Verify: failed to login, skipping verify tests\n");
-				return errors;
-			}
-		} else {
-			printf("Verify: not logged in, skipping verify tests\n");
-			return errors;
-		}
+		printf("Verify: not logged in, skipping verify tests\n");
+		return errors;
 	}
 
 	if (!find_mechanism(sessionInfo.slotID, CKF_VERIFY, NULL, 0, &first_mech_type)) {
@@ -4790,17 +4772,8 @@ static int test_decrypt(CK_SESSION_HANDLE sess)
 	if (rv != CKR_OK)
 		p11_fatal("C_OpenSession", rv);
 	if ((sessionInfo.state & CKS_RO_USER_FUNCTIONS) == 0) {
-		if (opt_login) {
-			int r;
-			r = login(sess, CKU_CONTEXT_SPECIFIC);
-			if (r != 0){
-				printf("Decryption: failed to login, skipping decryption tests\n");
-				return errors;
-			}
-		} else {
-			printf("Decryption: not logged in, skipping decryption tests\n");
-			return errors;
-		}
+		printf("Decryption: not logged in, skipping decryption tests\n");
+		return errors;
 	}
 
 	num_mechs = get_mechanisms(sessionInfo.slotID, &mechs, CKF_DECRYPT);

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



More information about the pkg-opensc-commit mailing list