summaryrefslogtreecommitdiff
path: root/security/nss/lib
diff options
context:
space:
mode:
authorrelyea%netscape.com <devnull@localhost>2001-11-15 23:06:10 +0000
committerrelyea%netscape.com <devnull@localhost>2001-11-15 23:06:10 +0000
commit70aeebb23f0c9629cecfbfa112443113bc724910 (patch)
tree268daf621119ad506e0d24d87d45cd03a63825fc /security/nss/lib
parent325cf7205da02f4bfc76eb64bce27163b53d6068 (diff)
downloadnss-hg-70aeebb23f0c9629cecfbfa112443113bc724910.tar.gz
Add issuer/SN to the search criteria
Diffstat (limited to 'security/nss/lib')
-rw-r--r--security/nss/lib/pki/certificate.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/security/nss/lib/pki/certificate.c b/security/nss/lib/pki/certificate.c
index 5fcb31c93..7e2f60a77 100644
--- a/security/nss/lib/pki/certificate.c
+++ b/security/nss/lib/pki/certificate.c
@@ -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);
}