mirror of https://github.com/wolfSSL/wolfssl.git
Moved infinite loop check to the other bad func arg check.
parent
1b13178182
commit
6f3623f220
|
@ -1596,7 +1596,7 @@ static int RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
|
||||||
byte invalid = 0;
|
byte invalid = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (output == NULL || pkcsBlockLen == 0) {
|
if (output == NULL || pkcsBlockLen == 0 || pkcsBlockLen > 0xFFFF) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1624,9 +1624,6 @@ static int RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
|
||||||
word16 j;
|
word16 j;
|
||||||
word16 pastSep = 0;
|
word16 pastSep = 0;
|
||||||
|
|
||||||
if (pkcsBlockLen > 0xFFFF)
|
|
||||||
return RSA_PAD_E;
|
|
||||||
|
|
||||||
/* Decrypted with private key - unpad must be constant time. */
|
/* Decrypted with private key - unpad must be constant time. */
|
||||||
for (i = 0, j = 2; j < pkcsBlockLen; j++) {
|
for (i = 0, j = 2; j < pkcsBlockLen; j++) {
|
||||||
/* Update i if not passed the separator and at separator. */
|
/* Update i if not passed the separator and at separator. */
|
||||||
|
|
Loading…
Reference in New Issue