mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Change the calculation for the extra data size in a DTLS message when checking to see if it'll fit in an MTU. (ZD12983)
This commit is contained in:
@ -18530,10 +18530,24 @@ int CreateOcspResponse(WOLFSSL* ssl, OcspRequest** ocspRequest,
|
|||||||
|
|
||||||
static int cipherExtraData(WOLFSSL* ssl)
|
static int cipherExtraData(WOLFSSL* ssl)
|
||||||
{
|
{
|
||||||
|
int cipherExtra;
|
||||||
/* Cipher data that may be added by BuildMessage */
|
/* Cipher data that may be added by BuildMessage */
|
||||||
return ssl->specs.hash_size + ssl->specs.block_size +
|
/* There is always an IV. For AEAD ciphers, there is the
|
||||||
ssl->specs.aead_mac_size + ssl->specs.iv_size +
|
* authentication tag (aead_mac_size). For block ciphers
|
||||||
ssl->specs.pad_size;
|
* we have the hash_size MAC on the message, and one
|
||||||
|
* block size for possible padding. */
|
||||||
|
if (ssl->specs.cipher_type == aead) {
|
||||||
|
cipherExtra = ssl->specs.aead_mac_size;
|
||||||
|
/* CHACHA does not have an explicit IV. */
|
||||||
|
if (ssl->specs.bulk_cipher_algorithm != wolfssl_chacha) {
|
||||||
|
cipherExtra += ssl->specs.iv_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cipherExtra = ssl->specs.iv_size + ssl->specs.block_size +
|
||||||
|
ssl->specs.hash_size;
|
||||||
|
}
|
||||||
|
return cipherExtra;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WOLFSSL_NO_TLS12
|
#ifndef WOLFSSL_NO_TLS12
|
||||||
|
Reference in New Issue
Block a user