Detect if we are processing a plaintext alert

This commit is contained in:
Juliusz Sosinowicz
2022-02-16 10:50:44 +01:00
parent df0b516c68
commit c5875cfc5a

View File

@ -16542,6 +16542,7 @@ static int DoAlert(WOLFSSL* ssl, byte* input, word32* inOutIdx, int* type)
READ_PROTO, ssl->heap);
#endif
if (IsEncryptionOn(ssl, 0)) {
#ifndef WOLFSSL_AEAD_ONLY
if (ssl->specs.cipher_type == block) {
if (ssl->options.tls1_1)
@ -16554,8 +16555,6 @@ static int DoAlert(WOLFSSL* ssl, byte* input, word32* inOutIdx, int* type)
ivExtra = AESGCM_EXP_IV_SZ;
}
dataSz -= ivExtra;
if (IsEncryptionOn(ssl, 0)) {
dataSz -= ssl->keys.padSz;
#if defined(HAVE_ENCRYPT_THEN_MAC) && !defined(WOLFSSL_AEAD_ONLY)
if (ssl->options.startedETMRead)