import from UXP: [NSS] Fix use of uninitialized length after failed PK11_SignWithMechanism/SymKey. (2a26d950)

This commit is contained in:
2026-05-26 10:17:58 +08:00
parent 25cfe00f92
commit 8bc7cd06a2
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -840,11 +840,11 @@ PK11_SignWithMechanism(SECKEYPrivateKey *key, CK_MECHANISM_TYPE mechanism,
if (haslock)
PK11_ExitSlotMonitor(slot);
pk11_CloseSession(slot, session, owner);
sig->len = len;
if (crv != CKR_OK) {
PORT_SetError(PK11_MapError(crv));
return SECFailure;
}
sig->len = len;
return SECSuccess;
}
@@ -888,11 +888,11 @@ PK11_SignWithSymKey(PK11SymKey *symKey, CK_MECHANISM_TYPE mechanism,
if (haslock)
PK11_ExitSlotMonitor(slot);
pk11_CloseSession(slot, session, owner);
sig->len = len;
if (crv != CKR_OK) {
PORT_SetError(PK11_MapError(crv));
return SECFailure;
}
sig->len = len;
return SECSuccess;
}
+1 -1
View File
@@ -3111,7 +3111,7 @@ NSC_SignFinal(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature,
{
SFTKSession *session;
SFTKSessionContext *context;
unsigned int outlen;
unsigned int outlen = 0;
unsigned int maxoutlen = *pulSignatureLen;
CK_RV crv;