sanity check on block size with block cipher type

This commit is contained in:
Jacob Barthelmeh
2021-06-07 23:28:14 +07:00
parent 8b456b90e0
commit 13478a94a8

View File

@ -17850,6 +17850,12 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
#ifndef WOLFSSL_AEAD_ONLY
if (ssl->specs.cipher_type == block) {
word32 blockSz = ssl->specs.block_size;
if (blockSz == 0) {
WOLFSSL_MSG("Invalid block size with block cipher type");
ERROR_OUT(BAD_STATE_E, exit_buildmsg);
}
if (ssl->options.tls1_1) {
args->ivSz = blockSz;
args->sz += args->ivSz;