From c72f4061b40350ca835f5692bf9a5bfefe5624b7 Mon Sep 17 00:00:00 2001 From: David Cooper Date: Thu, 13 Jun 2024 05:53:50 -0700 Subject: [PATCH] Fix #2502 This commit fixes #2502 in the 3.2 branch by checking that the key_share extension is at least 4 bytes long (8 in ASCII-HEX). These 4 bytes encode the group value (2 bytes) and the length of the key (2 bytes). --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index fdaea4e..08c38c9 100755 --- a/testssl.sh +++ b/testssl.sh @@ -14455,7 +14455,7 @@ parse_tls_serverhello() { tls_extensions+=" (id=51), len=$extension_len\n" fi if [[ "$process_full" =~ all ]] || [[ "$process_full" == ephemeralkey ]]; then - if [[ $extension_len -lt 4 ]]; then + if [[ $extension_len -lt 8 ]]; then debugme tmln_warning "Malformed key share extension." [[ $DEBUG -ge 1 ]] && tmpfile_handle ${FUNCNAME[0]}.txt return 1