Skip to content

Commit f84e8c0

Browse files
authored
Merge pull request #2470 from Tazmaniac/renego_timing_fix
Correct client_renego timing bug.
2 parents 32a2797 + 6277613 commit f84e8c0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

testssl.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -17080,7 +17080,13 @@ run_renego() {
1708017080
pr_svrty_medium "VULNERABLE (NOT ok)"; outln ", potential DoS threat"
1708117081
fileout "$jsonID" "MEDIUM" "VULNERABLE, potential DoS threat" "$cve" "$cwe" "$hint"
1708217082
else
17083-
(for ((i=0; i < ssl_reneg_attempts; i++ )); do echo R; sleep $ssl_reneg_wait; done) | \
17083+
# Clear the log to not get the content of previous run before the execution of the new one.
17084+
echo -n > $TMPFILE
17085+
# If we dont wait for the session to be established on slow server, we will try to re-negotiate
17086+
# too early losing all the attempts before the session establishment as OpenSSL will not buffer them
17087+
# (only the first will be till the establishement of the session).
17088+
(while [[ $(grep -ac '^SSL-Session:' $TMPFILE) -ne 1 ]]; do sleep 1; done; \
17089+
for ((i=0; i < ssl_reneg_attempts; i++ )); do echo R; sleep $ssl_reneg_wait; done) | \
1708417090
$OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") >$TMPFILE 2>>$ERRFILE &
1708517091
pid=$!
1708617092
( sleep $(($ssl_reneg_attempts*3)) && pkill -HUP -P $pid && wait $pid && touch $TEMPDIR/was_killed ) >&2 2>/dev/null &

0 commit comments

Comments
 (0)