summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrelyea%netscape.com <devnull@localhost>2002-04-29 23:54:07 +0000
committerrelyea%netscape.com <devnull@localhost>2002-04-29 23:54:07 +0000
commit74e4e1914cf0ba885baeeef75aec2d62a85a6046 (patch)
treee525c9471e9bf074167f8020f4a6e33d7c5546e0
parentef8a9682c914f18cdf240432042c676397de605d (diff)
downloadnss-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.c7
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 ) {