Skip to content

Commit 9346680

Browse files
committed
Added SNI to openssl call for testing secure client-initiated renegotiation
1 parent f0f6b1a commit 9346680

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

testssl.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16982,15 +16982,15 @@ run_renego() {
1698216982
else
1698316983
# We need up to two tries here, as some LiteSpeed servers don't answer on "R" and block. Thus first try in the background
1698416984
# msg enables us to look deeper into it while debugging
16985-
echo R | $OPENSSL s_client $(s_client_options "$proto $BUGS $legacycmd $STARTTLS -connect $NODEIP:$PORT $PROXY") >$TMPFILE 2>>$ERRFILE &
16985+
echo R | $OPENSSL s_client $(s_client_options "$proto $BUGS $legacycmd $STARTTLS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE &
1698616986
wait_kill $! $HEADER_MAXSLEEP
1698716987
if [[ $? -eq 3 ]]; then
1698816988
pr_svrty_good "likely not vulnerable (OK)"; outln ", timed out" # it hung
1698916989
fileout "$jsonID" "OK" "likely not vulnerable (timed out)" "$cve" "$cwe"
1699016990
sec_client_renego=1
1699116991
else
1699216992
# second try in the foreground as we are sure now it won't hang
16993-
echo R | $OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY") >$TMPFILE 2>>$ERRFILE
16993+
echo R | $OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE
1699416994
sec_client_renego=$?
1699516995
# 0 means client is renegotiating & doesn't return an error --> vuln!
1699616996
# 1 means client tried to renegotiating but the server side errored then. You still see RENEGOTIATING in the output
@@ -17011,7 +17011,7 @@ run_renego() {
1701117011
fileout "$jsonID" "MEDIUM" "VULNERABLE, potential DoS threat" "$cve" "$cwe" "$hint"
1701217012
else
1701317013
(for ((i=0; i < ssl_reneg_attempts; i++ )); do echo R; sleep 1; done) | \
17014-
$OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY") >$TMPFILE 2>>$ERRFILE
17014+
$OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE
1701517015
case $? in
1701617016
0) pr_svrty_high "VULNERABLE (NOT ok)"; outln ", DoS threat ($ssl_reneg_attempts attempts)"
1701717017
fileout "$jsonID" "HIGH" "VULNERABLE, DoS threat" "$cve" "$cwe" "$hint"

0 commit comments

Comments
 (0)