Skip to content

Commit 03b0f48

Browse files
committed
Finalize the renaming MAX_WAITSOCK --> ROBOT_TIMEOUT (3.2)
The commit 6753a95c939359f9e06fb9f3dd199a0 changed some variables however for consistency MAX_WAITSOCK should have been completely changed to ROBOT_TIMEOUT . This PR suggests that. Moreover it changes the local variable robottimeout to robot_timeout. This fixes #2983 for 3.2 .
1 parent 40c1edb commit 03b0f48

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

testssl.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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)