[NSS] revert "sync with https://github.com/roytam1/NSS/tree/NSS_3_48_UXP_BRANCH", this should fix a crash when browsing

This commit is contained in:
roytam1 2023-11-17 14:29:07 +08:00
commit 24413daff9
23 changed files with 275 additions and 134 deletions

View file

@ -13,6 +13,7 @@
#include "pki3hack.h"
#include "secerr.h"
#include "dev.h"
#include "dev3hack.h"
#include "utilpars.h"
#include "pkcs11uri.h"
@ -1266,8 +1267,14 @@ SECMOD_WaitForAnyTokenEvent(SECMODModule *mod, unsigned long flags,
}
/* if we are in the delay period for the "isPresent" call, reset
* the delay since we know things have probably changed... */
if (slot && slot->nssToken && slot->nssToken->slot) {
nssSlot_ResetDelay(slot->nssToken->slot);
if (slot) {
NSSToken *nssToken = PK11Slot_GetNSSToken(slot);
if (nssToken) {
if (nssToken->slot) {
nssSlot_ResetDelay(nssToken->slot);
}
(void)nssToken_Destroy(nssToken);
}
}
return slot;
@ -1500,8 +1507,12 @@ SECMOD_OpenNewSlot(SECMODModule *mod, const char *moduleSpec)
if (slot) {
/* if we are in the delay period for the "isPresent" call, reset
* the delay since we know things have probably changed... */
if (slot->nssToken && slot->nssToken->slot) {
nssSlot_ResetDelay(slot->nssToken->slot);
NSSToken *nssToken = PK11Slot_GetNSSToken(slot);
if (nssToken) {
if (nssToken->slot) {
nssSlot_ResetDelay(nssToken->slot);
}
(void)nssToken_Destroy(nssToken);
}
/* force the slot info structures to properly reset */
(void)PK11_IsPresent(slot);
@ -1631,8 +1642,12 @@ SECMOD_CloseUserDB(PK11SlotInfo *slot)
PR_smprintf_free(sendSpec);
/* if we are in the delay period for the "isPresent" call, reset
* the delay since we know things have probably changed... */
if (slot->nssToken && slot->nssToken->slot) {
nssSlot_ResetDelay(slot->nssToken->slot);
NSSToken *nssToken = PK11Slot_GetNSSToken(slot);
if (nssToken) {
if (nssToken->slot) {
nssSlot_ResetDelay(nssToken->slot);
}
(void)nssToken_Destroy(nssToken);
/* force the slot info structures to properly reset */
(void)PK11_IsPresent(slot);
}