From 72768a2b51cf008d24a89a8d7908cb47057f9d50 Mon Sep 17 00:00:00 2001 From: "relyea%netscape.com" Date: Thu, 15 Nov 2001 23:06:10 +0000 Subject: [PATCH] Add issuer/SN to the search criteria --- security/nss/lib/pki/certificate.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/security/nss/lib/pki/certificate.c b/security/nss/lib/pki/certificate.c index 664c8bc76d52..f22c3b45e25b 100644 --- a/security/nss/lib/pki/certificate.c +++ b/security/nss/lib/pki/certificate.c @@ -32,7 +32,7 @@ */ #ifdef DEBUG -static const char CVS_ID[] = "@(#) $RCSfile: certificate.c,v $ $Revision: 1.14 $ $Date: 2001/11/08 20:46:08 $ $Name: $"; +static const char CVS_ID[] = "@(#) $RCSfile: certificate.c,v $ $Revision: 1.15 $ $Date: 2001/11/15 23:06:10 $ $Name: $"; #endif /* DEBUG */ #ifndef NSSPKI_H @@ -175,7 +175,9 @@ get_cert_trust_handle CK_OBJECT_CLASS tobjc = CKO_NETSCAPE_TRUST; CK_ATTRIBUTE tobj_template[] = { { CKA_CLASS, NULL, 0 }, - { CKA_CERT_SHA1_HASH, NULL, 0 } + { CKA_CERT_SHA1_HASH, NULL, 0 }, + { CKA_ISSUER, NULL, 0 }, + { CKA_SERIAL_NUMBER, NULL, 0 } }; unsigned char sha1_hash[SHA1_LENGTH]; tobj_size = sizeof(tobj_template) / sizeof(tobj_template[0]); @@ -185,6 +187,13 @@ get_cert_trust_handle PK11_HashBuf(SEC_OID_SHA1, sha1_hash, c->encoding.data, c->encoding.size); tobj_template[1].pValue = (CK_VOID_PTR)sha1_hash; tobj_template[1].ulValueLen = (CK_ULONG)SHA1_LENGTH; + NSS_CK_SET_ATTRIBUTE_ITEM(tobj_template, 2, &c->issuer); + NSS_CK_SET_ATTRIBUTE_ITEM(tobj_template, 3, &c->serial); + + /* + * we need to arrange for the built-in token to loose the bottom 2 + * attributes so that old built-in tokens will continue to work. + */ return nssToken_FindObjectByTemplate(c->token, session, tobj_template, tobj_size); }