forked from wolfSSL/wolfssl
sanity check on hashing size
This commit is contained in:
@ -12242,6 +12242,11 @@ static INLINE int VerifyMac(WOLFSSL* ssl, const byte* input, word32 msgSz,
|
|||||||
padByte = 1;
|
padByte = 1;
|
||||||
|
|
||||||
if (ssl->options.tls) {
|
if (ssl->options.tls) {
|
||||||
|
/* Sanity check for underflow, TimingPadVerify performs hash on size
|
||||||
|
* (msgSz - ivExtra) - digestSz - pad - 1 */
|
||||||
|
if (digestSz + pad + 1 > (msgSz - ivExtra)) {
|
||||||
|
return BUFFER_E;
|
||||||
|
}
|
||||||
ret = TimingPadVerify(ssl, input, pad, digestSz, msgSz - ivExtra,
|
ret = TimingPadVerify(ssl, input, pad, digestSz, msgSz - ivExtra,
|
||||||
content);
|
content);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
Reference in New Issue
Block a user