diff --git a/src/internal.c b/src/internal.c index 067b7a6c08..0995bcb645 100644 --- a/src/internal.c +++ b/src/internal.c @@ -23005,9 +23005,7 @@ default: } if (IsEncryptionOn(ssl, 0)) { -#if defined(WOLFSSL_TLS13) || defined(WOLFSSL_EXTRA_ALERTS) int tooLong = 0; -#endif #ifdef WOLFSSL_TLS13 if (IsAtLeastTLSv1_3(ssl->version)) { @@ -23017,18 +23015,16 @@ default: MAX_TLS13_PLAIN_SZ; } } + else #endif -#ifdef WOLFSSL_EXTRA_ALERTS - if (!IsAtLeastTLSv1_3(ssl->version)) + { tooLong = ssl->curSize > MAX_TLS_CIPHER_SZ; -#endif -#if defined(WOLFSSL_TLS13) || defined(WOLFSSL_EXTRA_ALERTS) + } if (tooLong) { WOLFSSL_MSG("Encrypted data too long"); SendAlert(ssl, alert_fatal, record_overflow); return BUFFER_ERROR; } -#endif } ssl->keys.padSz = 0;