From 75c8d873539797c3fd1ee32012b8441e8a2b9850 Mon Sep 17 00:00:00 2001 From: Kareem Date: Tue, 13 Jun 2023 14:20:34 -0700 Subject: [PATCH] Fix trusted_ca_keys extension allowed logic. --- src/tls.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tls.c b/src/tls.c index 656a337ff..1be158e6b 100644 --- a/src/tls.c +++ b/src/tls.c @@ -13203,15 +13203,16 @@ int TLSX_Parse(WOLFSSL* ssl, const byte* input, word16 length, byte msgType, #endif #ifdef WOLFSSL_TLS13 + /* RFC 8446 4.2.4 states trusted_ca_keys is not used + in TLS 1.3. */ if (IsAtLeastTLSv1_3(ssl->version)) { - if (msgType != client_hello && - msgType != encrypted_extensions) - return EXT_NOT_ALLOWED; + return EXT_NOT_ALLOWED; } else #endif { - if (msgType != client_hello) + if (msgType != client_hello && + msgType != server_hello) return EXT_NOT_ALLOWED; } ret = TCA_PARSE(ssl, input + offset, size, isRequest);