Fix for checking of TLS padding when padding byte value > msg len

This commit is contained in:
Sean Parkinson
2018-11-12 17:37:34 +10:00
parent 39506e61d1
commit 61c7be669b

View File

@ -12417,8 +12417,8 @@ static byte MaskMac(const byte* data, int sz, int macSz, byte* expMac)
unsigned char started, notEnded; unsigned char started, notEnded;
unsigned char good = 0; unsigned char good = 0;
if (scanStart < 0) scanStart &= (~scanStart) >> (sizeof(int) * 8 - 1);
scanStart = 0; macStart &= (~macStart) >> (sizeof(int) * 8 - 1);
/* Div on Intel has different speeds depending on value. /* Div on Intel has different speeds depending on value.
* Use a bitwise AND or mod a specific value (converted to mul). */ * Use a bitwise AND or mod a specific value (converted to mul). */