mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-31 21:21:08 +00:00
Use NewTempCert and AddTempCert when importing because the cert may already exist
in the cache.
This commit is contained in:
parent
1bbd2fb18b
commit
cec43732fb
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user