Skip to content

Commit c01ff1f

Browse files
authored
Merge pull request #2984 from testssl/fix_2983_robot_vars_3.2
Finalize renaming MAX_WAITSOCK --> ROBOT_TIMEOUT (3.2)
2 parents 40c1edb + 0c92842 commit c01ff1f

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
@@ -79,6 +79,10 @@ $cat_csvfile2 =~ s/HTTP_headerTime.*\n//g;
7979
$cat_csvfile =~ s/"engine_problem.*\n//g;
8080
$cat_csvfile2 =~ s/"engine_problem.*\n//g;
8181

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

testssl.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ MAX_HEADER_FAIL=${MAX_HEADER_FAIL:-2} # If this many failures for HTTP GET are
207207
MAX_WAITSOCK=${MAX_WAITSOCK:-10} # waiting at max 10 seconds for socket reply. There shouldn't be any reason to change this.
208208
CCS_MAX_WAITSOCK=${CCS_MAX_WAITSOCK:-5} # for the two CCS payload (each). There shouldn't be any reason to change this.
209209
HEARTBLEED_MAX_WAITSOCK=${HEARTBLEED_MAX_WAITSOCK:-8} # for the heartbleed payload. There shouldn't be any reason to change this.
210-
ROBOT_TIMEOUT=${ROBOT_TIMEOUT:10} # Initial timeout for ROBOT check
210+
ROBOT_TIMEOUT=${ROBOT_TIMEOUT:-10} # Initial timeout for ROBOT check
211211
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)
212212
FAST_STARTTLS=${FAST_STARTTLS:-true} # at the cost of reliability decrease the handshakes for STARTTLS
213213
USLEEP_SND=${USLEEP_SND:-0.1} # sleep time for general socket send
@@ -20401,7 +20401,7 @@ run_robot() {
2040120401
local -i i subret len iteration testnum pubkeybytes
2040220402
local pubkeybits
2040320403
local vulnerable=false send_ccs_finished=true
20404-
local -i start_time end_time robottimeout=$ROBOT_TIMEOUT
20404+
local -i start_time end_time robot_timeout=$ROBOT_TIMEOUT
2040520405
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"
2040620406
local cwe="CWE-203"
2040720407
local jsonID="ROBOT"
@@ -20566,7 +20566,7 @@ run_robot() {
2056620566
fi
2056720567
debugme echo "reading server error response..."
2056820568
start_time=$(LC_ALL=C date "+%s")
20569-
sockread 32768 $robottimeout
20569+
sockread 32768 $robot_timeout
2057020570
subret=$?
2057120571
if [[ $subret -eq 0 ]]; then
2057220572
end_time=$(LC_ALL=C date "+%s")
@@ -20581,9 +20581,9 @@ run_robot() {
2058120581
# exchange message, measure the amount of time it took to
2058220582
# receive a response and set the timeout value for future
2058320583
# tests to 2 seconds longer than it took to receive a response.
20584-
[[ $iteration -ne 2 ]] && [[ $robottimeout -eq $MAX_WAITSOCK ]] && \
20585-
[[ $((end_time-start_time)) -lt $((MAX_WAITSOCK-2)) ]] && \
20586-
robottimeout=$((end_time-start_time+2))
20584+
[[ $iteration -ne 2 ]] && [[ $robot_timeout -eq $ROBOT_TIMEOUT ]] && \
20585+
[[ $((end_time-start_time)) -lt $((ROBOT_TIMEOUT-2)) ]] && \
20586+
robot_timeout=$((end_time-start_time+2))
2058720587
else
2058820588
response[testnum]="Timeout waiting for alert"
2058920589
fi
@@ -20622,14 +20622,15 @@ run_robot() {
2062220622
# If the test was run with a short timeout and was found to be
2062320623
# potentially vulnerable due to some tests timing out, then
2062420624
# verify the results by rerunning with a longer timeout.
20625-
if [[ $robottimeout -eq $MAX_WAITSOCK ]]; then
20625+
if [[ $robot_timeout -eq $ROBOT_TIMEOUT ]]; then
2062620626
break
2062720627
elif [[ "${response[0]}" == "Timeout waiting for alert" ]] || \
2062820628
[[ "${response[1]}" == "Timeout waiting for alert" ]] || \
2062920629
[[ "${response[2]}" == "Timeout waiting for alert" ]] || \
2063020630
[[ "${response[3]}" == "Timeout waiting for alert" ]] || \
2063120631
[[ "${response[4]}" == "Timeout waiting for alert" ]]; then
20632-
robottimeout=10
20632+
[[ "$DEBUG" -ge 3 ]] && echo "5x Timeout waiting for alert, $robot_timeout increasing to 10"
20633+
robot_timeout=10
2063320634
else
2063420635
break
2063520636
fi
@@ -21486,6 +21487,7 @@ HEADER_MAXSLEEP: $HEADER_MAXSLEEP
2148621487
MAX_WAITSOCK: $MAX_WAITSOCK
2148721488
HEARTBLEED_MAX_WAITSOCK: $HEARTBLEED_MAX_WAITSOCK
2148821489
CCS_MAX_WAITSOCK: $CCS_MAX_WAITSOCK
21490+
ROBOT_TIMEOUT: $ROBOT_TIMEOUT
2148921491
USLEEP_SND $USLEEP_SND
2149021492
USLEEP_REC $USLEEP_REC
2149121493

0 commit comments

Comments
 (0)