Skip to content

Commit e9cd8c3

Browse files
authored
Merge pull request #2391 from Tazmaniac/Renego-backport-patch
Backport pull request #2360 to fix #2389
2 parents 5cb30aa + eb006e4 commit e9cd8c3

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

testssl.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14540,7 +14540,8 @@ run_renego() {
1454014540
local cwe="CWE-310"
1454114541
local hint=""
1454214542
local jsonID=""
14543-
# No SNI needed here as there won't be two different SSL stacks for one IP
14543+
# In cases where there's no default host configured we need SNI here as openssl then would return otherwise an error and the test will fail
14544+
# And for the secure_client_renego, the config could be per vhost
1454414545

1454514546
"$HAS_TLS13" && [[ -z "$proto" ]] && proto="-no_tls1_3"
1454614547

@@ -14557,7 +14558,7 @@ run_renego() {
1455714558
fileout "$jsonID" "OK" "TLS 1.3 only server" "$cve" "$cwe"
1455814559
else
1455914560
# first fingerprint for the Line "Secure Renegotiation IS NOT" or "Secure Renegotiation IS "
14560-
$OPENSSL s_client $(s_client_options "$proto $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY") 2>&1 </dev/null >$TMPFILE 2>$ERRFILE
14561+
$OPENSSL s_client $(s_client_options "$proto $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") 2>&1 </dev/null >$TMPFILE 2>$ERRFILE
1456114562
if sclient_connect_successful $? $TMPFILE; then
1456214563
grep -iaq "Secure Renegotiation IS NOT" $TMPFILE
1456314564
sec_renego=$? # 0= Secure Renegotiation IS NOT supported
@@ -14625,15 +14626,15 @@ run_renego() {
1462514626
else
1462614627
# We need up to two tries here, as some LiteSpeed servers don't answer on "R" and block. Thus first try in the background
1462714628
# msg enables us to look deeper into it while debugging
14628-
echo R | $OPENSSL s_client $(s_client_options "$proto $BUGS $legacycmd $STARTTLS -connect $NODEIP:$PORT $PROXY") >$TMPFILE 2>>$ERRFILE &
14629+
echo R | $OPENSSL s_client $(s_client_options "$proto $BUGS $legacycmd $STARTTLS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE &
1462914630
wait_kill $! $HEADER_MAXSLEEP
1463014631
if [[ $? -eq 3 ]]; then
1463114632
pr_svrty_good "likely not vulnerable (OK)"; outln ", timed out" # it hung
1463214633
fileout "$jsonID" "OK" "likely not vulnerable (timed out)" "$cve" "$cwe"
1463314634
sec_client_renego=1
1463414635
else
1463514636
# second try in the foreground as we are sure now it won't hang
14636-
echo R | $OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY") >$TMPFILE 2>>$ERRFILE
14637+
echo R | $OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE
1463714638
sec_client_renego=$?
1463814639
# 0 means client is renegotiating & doesn't return an error --> vuln!
1463914640
# 1 means client tried to renegotiating but the server side errored then. You still see RENEGOTIATING in the output
@@ -14651,7 +14652,7 @@ run_renego() {
1465114652
fileout "$jsonID" "MEDIUM" "VULNERABLE, potential DoS threat" "$cve" "$cwe" "$hint"
1465214653
else
1465314654
(for i in {1..4}; do echo R; sleep 1; done) | \
14654-
$OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY") >$TMPFILE 2>>$ERRFILE
14655+
$OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE
1465514656
case $? in
1465614657
0) pr_svrty_high "VULNERABLE (NOT ok)"; outln ", DoS threat"
1465714658
fileout "$jsonID" "HIGH" "VULNERABLE, DoS threat" "$cve" "$cwe" "$hint"

0 commit comments

Comments
 (0)