mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
RSA: cast bitwise negate value to byte before converting to int
This commit is contained in:
@ -1720,7 +1720,7 @@ static int RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
|
||||
word16 j;
|
||||
word16 pastSep = 0;
|
||||
|
||||
i = 0;
|
||||
i = 0;
|
||||
/* Decrypted with private key - unpad must be constant time. */
|
||||
for (j = 2; j < pkcsBlockLen; j++) {
|
||||
/* Update i if not passed the separator and at separator. */
|
||||
@ -1738,7 +1738,7 @@ static int RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
|
||||
invalid |= ctMaskNotEq(pkcsBlock[1], padValue);
|
||||
|
||||
*output = (byte *)(pkcsBlock + i);
|
||||
ret = ((int)~invalid) & (pkcsBlockLen - i);
|
||||
ret = ((int)(byte)~invalid) & (pkcsBlockLen - i);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user