- Bug 1665715 - (1/2) revert e8f2720c8254 (bug 1593141) because it's no longer necessary r=jcj (a9bca998)
- Bug 1665715 - (2/2) pass encoded signed certificate timestamp extension (if present) in CheckRevocation r=jcj (429f9ef9)
This commit is contained in:
roytam1 2023-11-17 11:01:12 +08:00
commit 4e45ee69e0
22 changed files with 130 additions and 272 deletions

View file

@ -72,16 +72,12 @@ STAN_InitTokenForSlotInfo(NSSTrustDomain *td, PK11SlotInfo *slot)
}
}
token = nssToken_CreateFromPK11SlotInfo(td, slot);
PK11Slot_SetNSSToken(slot, token);
/* Don't add nonexistent token to TD's token list */
if (token) {
/* PK11Slot_SetNSSToken increments the refcount on |token| to 2 */
PK11Slot_SetNSSToken(slot, token);
/* we give our reference to |td->tokenList| */
NSSRWLock_LockWrite(td->tokensLock);
nssList_Add(td->tokenList, token);
NSSRWLock_UnlockWrite(td->tokensLock);
} else {
PK11Slot_SetNSSToken(slot, NULL);
}
return PR_SUCCESS;
}
@ -192,8 +188,7 @@ STAN_RemoveModuleFromDefaultTrustDomain(
nssList_Remove(td->tokenList, token);
NSSRWLock_UnlockWrite(td->tokensLock);
PK11Slot_SetNSSToken(module->slots[i], NULL);
(void)nssToken_Destroy(token); /* for the |td->tokenList| reference */
(void)nssToken_Destroy(token); /* for our PK11Slot_GetNSSToken reference */
nssToken_Destroy(token);
}
}
NSSRWLock_LockWrite(td->tokensLock);
@ -1081,11 +1076,7 @@ STAN_GetNSSCertificate(CERTCertificate *cc)
nssArena_Destroy(arena);
return NULL;
}
instance->token = PK11Slot_GetNSSToken(cc->slot);
if (!instance->token) {
nssArena_Destroy(arena);
return NULL;
}
instance->token = nssToken_AddRef(PK11Slot_GetNSSToken(cc->slot));
instance->handle = cc->pkcs11ID;
instance->isTokenObject = PR_TRUE;
if (cc->nickname) {
@ -1278,10 +1269,6 @@ STAN_ChangeCertTrust(CERTCertificate *cc, CERTCertTrust *trust)
NSSASCII7 *email = c->email;
tok = PK11Slot_GetNSSToken(slot);
PK11_FreeSlot(slot);
if (!tok) {
nssrv = PR_FAILURE;
goto done;
}
newInstance = nssToken_ImportCertificate(tok, NULL,
NSSCertificateType_PKIX,
@ -1296,7 +1283,6 @@ STAN_ChangeCertTrust(CERTCertificate *cc, CERTCertTrust *trust)
nss_ZFreeIf(nickname);
nickname = NULL;
if (!newInstance) {
(void)nssToken_Destroy(tok);
nssrv = PR_FAILURE;
goto done;
}
@ -1308,7 +1294,6 @@ STAN_ChangeCertTrust(CERTCertificate *cc, CERTCertTrust *trust)
nssTrust->codeSigning,
nssTrust->emailProtection,
nssTrust->stepUpApproved, PR_TRUE);
(void)nssToken_Destroy(tok);
}
if (newInstance) {
nssCryptokiObject_Destroy(newInstance);