mirror of
https://github.com/drwetter/testssl.sh.git
synced 2026-04-21 10:23:31 +02:00
Address missing extended_master secret extension properly
This PR "fixes feature" #2809 which was formerly not properly implemented in #2982, see comment https://github.com/testssl/testssl.sh/issues/2806#issuecomment-4164847538. Now TLS 1.3.-only servers won't get penalized when the master secret extension is missing.
This commit is contained in:
47
testssl.sh
47
testssl.sh
@@ -10693,8 +10693,9 @@ run_server_defaults() {
|
|||||||
outln "(none)"
|
outln "(none)"
|
||||||
fileout "TLS_extensions" "INFO" "(none)"
|
fileout "TLS_extensions" "INFO" "(none)"
|
||||||
else
|
else
|
||||||
#FIXME: we rather want to have the chance to print each ext in italics or another format.
|
#FIXME: we rather want to print each ext in italics or another format.
|
||||||
# Atm is a string of quoted strings -- that needs to be fixed at the root then
|
# Atm it's a string of quoted strings -- that needs to be fixed at the
|
||||||
|
# the root then.
|
||||||
# out_row_aligned_max_width() places line breaks at space characters.
|
# out_row_aligned_max_width() places line breaks at space characters.
|
||||||
# So, in order to prevent the text for an extension from being broken
|
# So, in order to prevent the text for an extension from being broken
|
||||||
# across lines, temporarily replace space characters within the text
|
# across lines, temporarily replace space characters within the text
|
||||||
@@ -10707,32 +10708,36 @@ run_server_defaults() {
|
|||||||
tls_extensions="${tls_extensions:1}"
|
tls_extensions="${tls_extensions:1}"
|
||||||
fileout "TLS_extensions" "INFO" "$tls_extensions"
|
fileout "TLS_extensions" "INFO" "$tls_extensions"
|
||||||
tls_extensions="${tls_extensions// /{}"
|
tls_extensions="${tls_extensions// /{}"
|
||||||
tls_extensions="${tls_extensions//\"{\"/\" \"}"
|
tls_extensions="${tls_extensions//'{\"'/'" "'}"
|
||||||
tls_extensions="$(out_row_aligned_max_width "$tls_extensions" " " $TERM_WIDTH)"
|
#tls_extensions="${tls_extensions//\"{\"/\" \"}" # blank command for deconfusing vim's syntax hiliting
|
||||||
tls_extensions="${tls_extensions//{/ }"
|
tls_extensions="$(out_row_aligned_max_width "$tls_extensions" ' ' $TERM_WIDTH)"
|
||||||
|
tls_extensions="${tls_extensions//\{/ }"
|
||||||
outln "$tls_extensions"
|
outln "$tls_extensions"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We want to check whether the (for >=TLS 1.2) mandatory "extended master secret" extension is supported by
|
# We want to check whether the (for <=TLS 1.2) mandatory "extended master secret" extension is supported by
|
||||||
# the server. Otherwise it would violate RFC 9325 https://www.rfc-editor.org/rfc/rfc9325#section-3.5
|
# the server. Otherwise it would violate RFC 9325 https://www.rfc-editor.org/rfc/rfc9325#section-3.5. Also:
|
||||||
# and cause connection problems.
|
# "If a server implementing this document receives the "extended_master_secret" extension, it MUST
|
||||||
|
# include the extension in its ServerHello message". (https://www.rfc-editor.org/rfc/rfc7627.html#section-5.2).
|
||||||
|
|
||||||
jsonID="TLS_misses_extension_23"
|
jsonID="TLS_misses_extension_23"
|
||||||
if [[ $(has_server_protocol "tls1_2") -eq 1 ]] && [[ $(has_server_protocol "tls1_3") -eq 1 ]] ; then
|
if [[ $tls_extensions =~ \#23 ]]; then
|
||||||
:
|
if "$TLS13_ONLY"; then
|
||||||
elif [[ $tls_extensions =~ \#23 ]]; then
|
# this shouldn't happen
|
||||||
# Was the last handshake >= TLS 1.2 ?
|
fileout "$jsonID" "LOW" "Misconfiguration: Extended master secret extension detected for TLS 1.3 only"
|
||||||
if grep -qE 'Protocol.*(TLSv1.3|TLSv1.2)' $TEMPDIR/$NODEIP.parse_tls_serverhello.txt ; then
|
debugme outln "${spaces}Misconfiguration: Extended master secret extension detected for TLS 1.3 only"
|
||||||
fileout "$jsonID" "INFO" "Extended master secret extension detected"
|
|
||||||
debugme outln "${spaces}Extended master secret extension detected"
|
|
||||||
else
|
else
|
||||||
out "$spaces"
|
if grep -qE 'Protocol.*(TLSv1.)' $TEMPDIR/$NODEIP.parse_tls_serverhello.txt ; then
|
||||||
prln_warning "Fixme: Server supports TLS 1.2 or 1.3 but last ServerHello was < TLS 1.2"
|
fileout "$jsonID" "INFO" "Extended master secret extension detected"
|
||||||
fileout "$jsonID" "WARN" "Server supports TLS 1.2 or 1.3 but last ServerHello was < TLS 1.2"
|
debugme outln "${spaces}Extended master secret extension detected"
|
||||||
|
fi
|
||||||
|
# We don't worry about SSL3.0 here. It should have been tested before withg testssl.sh --
|
||||||
|
# though it's mentioned in https://www.rfc-editor.org/rfc/rfc7627.html#section-6.4
|
||||||
fi
|
fi
|
||||||
else
|
elif ! "$TLS13_ONLY"; then
|
||||||
out "$spaces"
|
out "$spaces"
|
||||||
prln_svrty_medium "No extended master secret extension, violates RFC 9325 & may cause connection problems"
|
prln_svrty_medium "No extended master secret extension, violates RFC 7627/9325 & may cause connection problems"
|
||||||
fileout "$jsonID" "MEDIUM" "No extended master secret extension, violates RFC 9325 & may cause connection problems"
|
fileout "$jsonID" "MEDIUM" "No extended master secret extension, violates RFC 7627/9325 & may cause connection problems"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pr_bold " Session Ticket RFC 5077 hint "
|
pr_bold " Session Ticket RFC 5077 hint "
|
||||||
|
|||||||
Reference in New Issue
Block a user