[pkg-opensc-commit] [pkcs11-helper] 235/253: certificate: ignore certificates without CKA_ID

Eric Dorland eric at moszumanska.debian.org
Fri Jan 6 23:39:23 UTC 2017


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

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

commit 8d81cf6b460c0443c64605fe9ab0137c12c1ccba
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date:   Mon Dec 30 20:17:13 2013 +0200

    certificate: ignore certificates without CKA_ID
    
    we won't be able to retrieve them anyway.
    
    Signed-off-by: Alon Bar-Lev <alon.barlev at gmail.com>
---
 ChangeLog                 |  1 +
 lib/pkcs11h-certificate.c | 19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index db8a25a..f430053 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@ $Id$
 ????-??-?? - Version 1.12
 
  * polarssl: support polarssl-1.3, thanks to Steffan Karger.
+ * certificate: ignore certificate object without CKA_ID.
 
 2013-10-11 - Version 1.11
 
diff --git a/lib/pkcs11h-certificate.c b/lib/pkcs11h-certificate.c
index 086e22d..6eb95e2 100644
--- a/lib/pkcs11h-certificate.c
+++ b/lib/pkcs11h-certificate.c
@@ -2383,7 +2383,24 @@ _pkcs11h_certificate_enumSessionCertificates (
 					objects[i],
 					attrs,
 					sizeof (attrs) / sizeof (CK_ATTRIBUTE)
-				)) != CKR_OK ||
+				)) != CKR_OK
+			) {
+				goto retry1;
+			}
+
+			/*
+			 * skip objects without CKA_ID as we
+			 * won't be able to retrieve them.
+			 */
+			if (
+				attrs[0].pValue == NULL ||
+				attrs[0].ulValueLen == 0
+			) {
+				rv = CKR_OK;
+				goto retry1;
+			}
+
+			if (
 				(rv = _pkcs11h_certificate_newCertificateId (&certificate_id)) != CKR_OK ||
 				(rv = pkcs11h_token_duplicateTokenId (
 					&certificate_id->token_id,

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



More information about the pkg-opensc-commit mailing list