Skip to content

Commit

Permalink
NewTemp has to be matched with AddTempCertToPerm
Browse files Browse the repository at this point in the history
  • Loading branch information
ian.mcgreer%sun.com committed Apr 22, 2002
1 parent bfcafb0 commit b131678
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 6 additions & 8 deletions security/nss/lib/certdb/certdb.c
Expand Up @@ -2029,10 +2029,10 @@ CERT_ImportCerts(CERTCertDBHandle *certdb, SECCertUsage usage,
/* decode all of the certs into the temporary DB */
for ( i = 0, fcerts= 0; i < ncerts; i++) {
certs[fcerts] = CERT_NewTempCertificate(certdb,
derCerts[i],
NULL,
PR_FALSE,
PR_TRUE);
derCerts[i],
NULL,
PR_FALSE,
PR_TRUE);
if (certs[fcerts]) fcerts++;
}

Expand All @@ -2046,11 +2046,9 @@ CERT_ImportCerts(CERTCertDBHandle *certdb, SECCertUsage usage,
* otherwise if there are more than one cert, we don't
* know which cert it belongs to.
*/
rv = PK11_ImportCert(intSlot,certs[i],
CK_INVALID_HANDLE,NULL,PR_TRUE);
rv = CERT_AddTempCertToPerm(certs[i], NULL, NULL);
} else {
rv = PK11_ImportCert(intSlot,certs[i],
CK_INVALID_HANDLE,nickname,PR_TRUE);
rv = CERT_AddTempCertToPerm(certs[i], nickname, NULL);
}
if (rv == SECSuccess) {
CERT_SaveImportedCert(certs[i], usage, caOnly, NULL);
Expand Down
3 changes: 3 additions & 0 deletions security/nss/lib/certdb/stanpcertdb.c
Expand Up @@ -180,6 +180,9 @@ __CERT_AddTempCertToPerm(CERTCertificate *cert, char *nickname,
cert = STAN_GetCERTCertificate(c); /* will return same pointer */
cert->istemp = PR_FALSE;
cert->isperm = PR_TRUE;
if (!trust) {
return PR_SUCCESS;
}
return (STAN_ChangeCertTrust(cert, trust) == PR_SUCCESS) ?
SECSuccess: SECFailure;
}
Expand Down

0 comments on commit b131678

Please sign in to comment.