[pkg-opensc-commit] [engine-pkcs11] 27/152: allow giving slot only.

Eric Dorland eric at moszumanska.debian.org
Mon Oct 19 03:11:10 UTC 2015


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

eric pushed a commit to branch master
in repository engine-pkcs11.

commit f5b686d7b8f9b7ac7e68dfe82f171a5fcd3c2986
Author: Andreas Jellinghaus <andreas at ionisiert.de>
Date:   Thu Nov 3 19:16:30 2005 +0000

    allow giving slot only.
---
 src/engine_pkcs11.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/engine_pkcs11.c b/src/engine_pkcs11.c
index 226ca2c..d8d05db 100644
--- a/src/engine_pkcs11.c
+++ b/src/engine_pkcs11.c
@@ -240,6 +240,11 @@ int parse_slot_id_string(const char *slot_id, int *slot,
 			return 0;
 		}
 		i++;
+		if (slot_id[i] == 0) {
+			*slot = n;
+			*id_len = 0;
+			return 1;
+		}
 		if (strspn(slot_id+i,"0123456789")+i != strlen(slot_id)) {
 			fprintf(stderr,"could not parse string!\n");
 			return 0;
@@ -282,6 +287,12 @@ int parse_slot_id_string(const char *slot_id, int *slot,
 	} 
 
 	i = strspn(slot_id+5,"0123456789");
+
+	if (slot_id[i+5] == 0) {
+		*slot = n;
+		*id_len = 0;
+		return 1;
+	}
 		
 	if (slot_id[i+5] != '-') {
 		fprintf(stderr,"could not parse string!\n");
@@ -411,7 +422,7 @@ X509 *pkcs11_load_cert(ENGINE * e, const char *s_slot_cert_id)
 	if(verbose) {
 		fprintf(stderr,"Found %u cert%s:\n", count, (count <= 1) ? "" : "s");
 	}
-	if (s_slot_cert_id && *s_slot_cert_id) {
+	if ((s_slot_cert_id && *s_slot_cert_id) || (cert_id_len == 0)) {
 		for (n = 0; n < count; n++) {
 			PKCS11_CERT *k = certs + n;
 

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



More information about the pkg-opensc-commit mailing list