summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/freebl/rsapkcs.c
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-12-23 19:02:52 +0000
committerMoonchild <moonchild@palemoon.org>2020-12-23 19:02:52 +0000
commit029bcfe189eae5eebbaf58ccff4e1200dd78b228 (patch)
tree1c226a334ea1a88e2d1c6f949c9320eb0c3bff59 /security/nss/lib/freebl/rsapkcs.c
parent149d2ffa779826cb48a381099858e76e4624d471 (diff)
downloadUXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.tar
UXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.tar.gz
UXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.tar.lz
UXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.tar.xz
UXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.zip
Issue #1693 - Update NSS to 3.59.1.1
This updates to MoonchildProductions/NSS@bd49b2b88 in the repo created for our consumption of the library.
Diffstat (limited to 'security/nss/lib/freebl/rsapkcs.c')
-rw-r--r--security/nss/lib/freebl/rsapkcs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/security/nss/lib/freebl/rsapkcs.c b/security/nss/lib/freebl/rsapkcs.c
index f26cd2954..73d40909d 100644
--- a/security/nss/lib/freebl/rsapkcs.c
+++ b/security/nss/lib/freebl/rsapkcs.c
@@ -116,7 +116,7 @@ rsa_FormatOneBlock(unsigned modulusLen,
unsigned char *block;
unsigned char *bp;
unsigned int padLen;
- int i, j;
+ unsigned int i, j;
SECStatus rv;
block = (unsigned char *)PORT_Alloc(modulusLen);
@@ -1409,6 +1409,7 @@ RSA_CheckSignRecover(RSAPublicKey *key,
unsigned int modulusLen = rsa_modulusLen(&key->modulus);
unsigned int i;
unsigned char *buffer = NULL;
+ unsigned int padLen;
if (sigLen != modulusLen) {
PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
@@ -1446,6 +1447,11 @@ RSA_CheckSignRecover(RSAPublicKey *key,
goto done;
}
}
+ padLen = i - 2;
+ if (padLen < RSA_BLOCK_MIN_PAD_LEN) {
+ PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
+ goto done;
+ }
if (*outputLen == 0) {
PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
goto done;