__CERT_AddTempCertToPerm will now set error SEC_ERROR_ADDING_CERT
authornelsonb%netscape.com
Sat, 06 Dec 2003 06:46:27 +0000
changeset 4919 c772c03f94917fca65f2a8f5b491efa1483eb4f3
parent 4918 411ec7050ebf530fdb873cd08fdd55fae95deb1f
child 4920 6377ea8d364304b41904f87099b708cb33b232e4
push idunknown
push userunknown
push dateunknown
bugs227559
__CERT_AddTempCertToPerm will now set error SEC_ERROR_ADDING_CERT when attempting to make a cert perm that is already permanent. Bugzilla bug 227559. r=wtc
security/nss/lib/certdb/stanpcertdb.c
--- a/security/nss/lib/certdb/stanpcertdb.c
+++ b/security/nss/lib/certdb/stanpcertdb.c
@@ -149,16 +149,17 @@ SECStatus
     NSSUTF8 *stanNick;
     PK11SlotInfo *slot;
     NSSToken *internal;
     NSSCryptoContext *context;
     nssCryptokiObject *permInstance;
     NSSCertificate *c = STAN_GetNSSCertificate(cert);
     context = c->object.cryptoContext;
     if (!context) {
+	PORT_SetError(SEC_ERROR_ADDING_CERT); 
 	return SECFailure; /* wasn't a temp cert */
     }
     stanNick = nssCertificate_GetNickname(c, NULL);
     if (stanNick && nickname && strcmp(nickname, stanNick) != 0) {
 	/* take the new nickname */
 	cert->nickname = NULL;
 	stanNick = NULL;
     }