mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +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 j;
|
||||||
word16 pastSep = 0;
|
word16 pastSep = 0;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
/* Decrypted with private key - unpad must be constant time. */
|
/* Decrypted with private key - unpad must be constant time. */
|
||||||
for (j = 2; j < pkcsBlockLen; j++) {
|
for (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. */
|
||||||
@ -1738,7 +1738,7 @@ static int RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
|
|||||||
invalid |= ctMaskNotEq(pkcsBlock[1], padValue);
|
invalid |= ctMaskNotEq(pkcsBlock[1], padValue);
|
||||||
|
|
||||||
*output = (byte *)(pkcsBlock + i);
|
*output = (byte *)(pkcsBlock + i);
|
||||||
ret = ((int)~invalid) & (pkcsBlockLen - i);
|
ret = ((int)(byte)~invalid) & (pkcsBlockLen - i);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user