Replace NSS with Pale Moon's

This commit is contained in:
wuggy 2026-06-29 21:29:25 +01:00
commit 8c2e376f94
2870 changed files with 1762232 additions and 1374220 deletions

View file

@ -337,11 +337,7 @@ sec_pkcs12_decoder_safe_bag_update(void *arg, const char *data,
SEC_PKCS12DecoderContext *p12dcx;
SECStatus rv;
/* make sure that we are not skipping the current safeBag,
* and that there are no errors. If so, just return rather
* than continuing to process.
*/
if (!safeContentsCtx || !safeContentsCtx->p12dcx || safeContentsCtx->skipCurrentSafeBag) {
if (!safeContentsCtx || !safeContentsCtx->p12dcx || !safeContentsCtx->currentSafeBagA1Dcx) {
return;
}
p12dcx = safeContentsCtx->p12dcx;
@ -1365,32 +1361,10 @@ sec_pkcs12_decoder_verify_mac(SEC_PKCS12DecoderContext *p12dcx)
iteration);
algtag = SECOID_GetAlgorithmTag(&p12dcx->macData.safeMac.digestAlgorithm);
switch (algtag) {
case SEC_OID_SHA1:
integrityMech = CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN;
break;
case SEC_OID_MD5:
integrityMech = CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN;
break;
case SEC_OID_MD2:
integrityMech = CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN;
break;
case SEC_OID_SHA224:
integrityMech = CKM_NSS_PKCS12_PBE_SHA224_HMAC_KEY_GEN;
break;
case SEC_OID_SHA256:
integrityMech = CKM_NSS_PKCS12_PBE_SHA256_HMAC_KEY_GEN;
break;
case SEC_OID_SHA384:
integrityMech = CKM_NSS_PKCS12_PBE_SHA384_HMAC_KEY_GEN;
break;
case SEC_OID_SHA512:
integrityMech = CKM_NSS_PKCS12_PBE_SHA512_HMAC_KEY_GEN;
break;
default:
goto loser;
integrityMech = sec_pkcs12_algtag_to_keygen_mech(algtag);
if (integrityMech == CKM_INVALID_MECHANISM) {
goto loser;
}
symKey = PK11_KeyGen(NULL, integrityMech, params, 0, NULL);
PK11_DestroyPBEParams(params);
params = NULL;
@ -2804,7 +2778,7 @@ SEC_PKCS12DecoderValidateBags(SEC_PKCS12DecoderContext *p12dcx,
SEC_PKCS12NicknameCollisionCallback nicknameCb)
{
SECStatus rv;
int i, noInstallCnt, probCnt, bagCnt, errorVal = 0;
int i, probCnt, errorVal = 0;
if (!p12dcx || p12dcx->error || !p12dcx->safeBags) {
PORT_SetError(SEC_ERROR_INVALID_ARGS);
return SECFailure;
@ -2815,12 +2789,9 @@ SEC_PKCS12DecoderValidateBags(SEC_PKCS12DecoderContext *p12dcx,
p12dcx->bagsVerified = PR_TRUE;
}
noInstallCnt = probCnt = bagCnt = 0;
probCnt = 0;
i = 0;
while (p12dcx->safeBags[i]) {
bagCnt++;
if (p12dcx->safeBags[i]->noInstall)
noInstallCnt++;
if (p12dcx->safeBags[i]->problem) {
probCnt++;
errorVal = p12dcx->safeBags[i]->error;
@ -2828,15 +2799,6 @@ SEC_PKCS12DecoderValidateBags(SEC_PKCS12DecoderContext *p12dcx,
i++;
}
/* formerly was erroneous code here that assumed that if all bags
* failed to import, then the problem was duplicated data;
* that is, it assume that the problem must be that the file had
* previously been successfully imported. But importing a
* previously imported file causes NO ERRORS at all, and this
* false assumption caused real errors to be hidden behind false
* errors about duplicated data.
*/
if (probCnt) {
PORT_SetError(errorVal);
return SECFailure;
@ -3416,8 +3378,7 @@ sec_pkcs12_decoder_create_cert(SEC_PKCS12DecoderContext *p12dcx,
oid = SECOID_FindOIDByTag(SEC_OID_PKCS12_V1_CERT_BAG_ID);
certBag = PORT_ArenaZNew(p12dcx->arena, sec_PKCS12SafeBag);
if (!certBag || !oid || (SECITEM_CopyItem(p12dcx->arena,
&certBag->safeBagType, &oid->oid) != SECSuccess)) {
if (!certBag || !oid || (SECITEM_CopyItem(p12dcx->arena, &certBag->safeBagType, &oid->oid) != SECSuccess)) {
return NULL;
}