@@ -207,7 +207,7 @@ MAX_HEADER_FAIL=${MAX_HEADER_FAIL:-2} # If this many failures for HTTP GET are
207207MAX_WAITSOCK=${MAX_WAITSOCK:-10} # waiting at max 10 seconds for socket reply. There shouldn't be any reason to change this.
208208CCS_MAX_WAITSOCK=${CCS_MAX_WAITSOCK:-5} # for the two CCS payload (each). There shouldn't be any reason to change this.
209209HEARTBLEED_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
211211STARTTLS_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)
212212FAST_STARTTLS=${FAST_STARTTLS:-true} # at the cost of reliability decrease the handshakes for STARTTLS
213213USLEEP_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
2148621487MAX_WAITSOCK: $MAX_WAITSOCK
2148721488HEARTBLEED_MAX_WAITSOCK: $HEARTBLEED_MAX_WAITSOCK
2148821489CCS_MAX_WAITSOCK: $CCS_MAX_WAITSOCK
21490+ ROBOT_TIMEOUT: $ROBOT_TIMEOUT
2148921491USLEEP_SND $USLEEP_SND
2149021492USLEEP_REC $USLEEP_REC
2149121493
0 commit comments