Skip to content

Commit f2b9e3d

Browse files
committed
Unconditionally validate TLS 1.2 ciphertext size in ProcessReply F-1476
1 parent f28fd37 commit f2b9e3d

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/internal.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23005,9 +23005,7 @@ static int DoProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
2300523005
}
2300623006

2300723007
if (IsEncryptionOn(ssl, 0)) {
23008-
#if defined(WOLFSSL_TLS13) || defined(WOLFSSL_EXTRA_ALERTS)
2300923008
int tooLong = 0;
23010-
#endif
2301123009

2301223010
#ifdef WOLFSSL_TLS13
2301323011
if (IsAtLeastTLSv1_3(ssl->version)) {
@@ -23017,18 +23015,16 @@ static int DoProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
2301723015
MAX_TLS13_PLAIN_SZ;
2301823016
}
2301923017
}
23018+
else
2302023019
#endif
23021-
#ifdef WOLFSSL_EXTRA_ALERTS
23022-
if (!IsAtLeastTLSv1_3(ssl->version))
23020+
{
2302323021
tooLong = ssl->curSize > MAX_TLS_CIPHER_SZ;
23024-
#endif
23025-
#if defined(WOLFSSL_TLS13) || defined(WOLFSSL_EXTRA_ALERTS)
23022+
}
2302623023
if (tooLong) {
2302723024
WOLFSSL_MSG("Encrypted data too long");
2302823025
SendAlert(ssl, alert_fatal, record_overflow);
2302923026
return BUFFER_ERROR;
2303023027
}
23031-
#endif
2303223028
}
2303323029
ssl->keys.padSz = 0;
2303423030

0 commit comments

Comments
 (0)