Skip to content

Commit 18a1264

Browse files
authored
Merge pull request #2985 from testssl/fix_2983_robot_timeout
Finalize renaming MAX_WAITSOCK --> ROBOT_TIMEOUT
2 parents 79db276 + ee316ef commit 18a1264

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

t/12_diff_opensslversions.t

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ $cat_csvfile2 =~ s/HTTP_headerTime.*\n//g;
8282
$cat_csvfile =~ s/"engine_problem.*\n//g;
8383
$cat_csvfile2 =~ s/"engine_problem.*\n//g;
8484

85+
# Google has KEMs for TLS 1.3 which the local openssl has not - yet
86+
$cat_csvfile =~ s/MLKEM1024 AESGCM/ECDH 253 AESGCM/g;
87+
$cat_csvfile =~ s/MLKEM1024 ChaCha20/ECDH 253 ChaCha20/g;
88+
8589
# PR #2628. TL:DR; make the kx between tls_sockets() and openssl the same for this CI run
8690
$cat_csvfile =~ s/ECDH 256/ECDH 253/g;
8791
$cat_csvfile =~ s/ECDH\/MLKEM/ECDH 253 /g;

testssl.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ MAX_WAITSOCK=${MAX_WAITSOCK:-5} # waiting at max 5 seconds for socket re
209209
QUIC_WAIT=${QUIC_WAIT:-3} # QUIC is UDP. Thus we run the connect in the background. This is how long in sec to wait
210210
CCS_MAX_WAITSOCK=${CCS_MAX_WAITSOCK:-5} # for the two CCS payload (each). There shouldn't be any reason to change this.
211211
HEARTBLEED_MAX_WAITSOCK=${HEARTBLEED_MAX_WAITSOCK:-8} # for the heartbleed payload. There shouldn't be any reason to change this.
212-
ROBOT_TIMEOUT=${ROBOT_TIMEOUT:5} # Initial timeout for ROBOT check
212+
ROBOT_TIMEOUT=${ROBOT_TIMEOUT:-1} # Initial timeout for ROBOT check
213213
STARTTLS_SLEEP=${STARTTLS_SLEEP:-10} # max time wait on a socket for STARTTLS. MySQL has a fixed value of 1 which can't be overwritten (#914)
214214
FAST_STARTTLS=${FAST_STARTTLS:-true} # at the cost of reliability decrease the handshakes for STARTTLS
215215
USLEEP_SND=${USLEEP_SND:-0.1} # sleep time for general socket send
@@ -20690,7 +20690,7 @@ run_robot() {
2069020690
local -i i subret len iteration testnum pubkeybytes
2069120691
local pubkeybits
2069220692
local vulnerable=false send_ccs_finished=true
20693-
local -i start_time end_time robottimeout=$ROBOT_TIMEOUT
20693+
local -i start_time end_time robot_timeout=$ROBOT_TIMEOUT
2069420694
local cve="CVE-2017-17382 CVE-2017-17427 CVE-2017-17428 CVE-2017-13098 CVE-2017-1000385 CVE-2017-13099 CVE-2016-6883 CVE-2012-5081 CVE-2017-6168"
2069520695
local cwe="CWE-203"
2069620696
local jsonID="ROBOT"
@@ -20854,7 +20854,7 @@ run_robot() {
2085420854
fi
2085520855
debugme echo "reading server error response..."
2085620856
start_time=$(LC_ALL=C date "+%s")
20857-
sockread 32768 $robottimeout
20857+
sockread 32768 $robot_timeout
2085820858
subret=$?
2085920859
if [[ $subret -eq 0 ]]; then
2086020860
end_time=$(LC_ALL=C date "+%s")
@@ -20869,9 +20869,9 @@ run_robot() {
2086920869
# exchange message, measure the amount of time it took to
2087020870
# receive a response and set the timeout value for future
2087120871
# tests to 2 seconds longer than it took to receive a response.
20872-
[[ $iteration -ne 2 ]] && [[ $robottimeout -eq $MAX_WAITSOCK ]] && \
20873-
[[ $((end_time-start_time)) -lt $((MAX_WAITSOCK-2)) ]] && \
20874-
robottimeout=$((end_time-start_time+2))
20872+
[[ $iteration -ne 2 ]] && [[ $robot_timeout -eq $ROBOT_TIMEOUT ]] && \
20873+
[[ $((end_time-start_time)) -lt $((ROBOT_TIMEOUT-2)) ]] && \
20874+
robot_timeout=$((end_time-start_time+2))
2087520875
else
2087620876
response[testnum]="Timeout waiting for alert"
2087720877
fi
@@ -20910,14 +20910,15 @@ run_robot() {
2091020910
# If the test was run with a short timeout and was found to be
2091120911
# potentially vulnerable due to some tests timing out, then
2091220912
# verify the results by rerunning with a longer timeout.
20913-
if [[ $robottimeout -eq $MAX_WAITSOCK ]]; then
20913+
if [[ $robot_timeout -eq $ROBOT_TIMEOUT ]]; then
2091420914
break
2091520915
elif [[ "${response[0]}" == "Timeout waiting for alert" ]] || \
2091620916
[[ "${response[1]}" == "Timeout waiting for alert" ]] || \
2091720917
[[ "${response[2]}" == "Timeout waiting for alert" ]] || \
2091820918
[[ "${response[3]}" == "Timeout waiting for alert" ]] || \
2091920919
[[ "${response[4]}" == "Timeout waiting for alert" ]]; then
20920-
robottimeout=10
20920+
[[ "$DEBUG" -ge 3 ]] && echo "5x Timeout waiting for alert, $robot_timeout increasing to 8"
20921+
robot_timeout=8
2092120922
else
2092220923
break
2092320924
fi
@@ -21795,6 +21796,7 @@ IPv6_OK: $IPv6_OK
2179521796
MAX_WAITSOCK: $MAX_WAITSOCK
2179621797
HEARTBLEED_MAX_WAITSOCK: $HEARTBLEED_MAX_WAITSOCK
2179721798
CCS_MAX_WAITSOCK: $CCS_MAX_WAITSOCK
21799+
ROBOT_TIMEOUT: $ROBOT_TIMEOUT
2179821800
USLEEP_SND $USLEEP_SND
2179921801
USLEEP_REC $USLEEP_REC
2180021802
HEADER_MAXSLEEP: $HEADER_MAXSLEEP

0 commit comments

Comments
 (0)