diff options
author | relyea%netscape.com <devnull@localhost> | 2002-04-29 23:54:07 +0000 |
---|---|---|
committer | relyea%netscape.com <devnull@localhost> | 2002-04-29 23:54:07 +0000 |
commit | 74e4e1914cf0ba885baeeef75aec2d62a85a6046 (patch) | |
tree | e525c9471e9bf074167f8020f4a6e33d7c5546e0 | |
parent | ef8a9682c914f18cdf240432042c676397de605d (diff) | |
download | nss-hg-74e4e1914cf0ba885baeeef75aec2d62a85a6046.tar.gz |
Use NewTempCert and AddTempCert when importing because the cert may already exist
in the cache.
-rw-r--r-- | security/nss/lib/certhigh/certhigh.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/security/nss/lib/certhigh/certhigh.c b/security/nss/lib/certhigh/certhigh.c index f5d24c326..d4c432a48 100644 --- a/security/nss/lib/certhigh/certhigh.c +++ b/security/nss/lib/certhigh/certhigh.c @@ -915,7 +915,8 @@ cert_ImportCAChain(SECItem *certs, int numcerts, SECCertUsage certUsage, PRBool } } - cert = CERT_DecodeDERCertificate(derCert, PR_FALSE, NULL); + cert = CERT_NewTempCertificate(handle, derCert, NULL, + PR_FALSE, PR_FALSE); if ( cert == NULL ) { goto loser; } @@ -923,9 +924,7 @@ cert_ImportCAChain(SECItem *certs, int numcerts, SECCertUsage certUsage, PRBool /* get a default nickname for it */ nickname = CERT_MakeCANickname(cert); - cert->trust = &trust; - rv = PK11_ImportCert(PK11_GetInternalKeySlot(), cert, - CK_INVALID_HANDLE, nickname, PR_TRUE); + rv = CERT_AddTempCertToPerm(cert, nickname, &trust); /* free the nickname */ if ( nickname ) { |