From f30dab9e2f02b868849d9da9c2dfdb07eb99eafa Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 13 Dec 2016 12:38:20 +0100 Subject: [PATCH] cosmetic improvement to #551 --- testssl.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/testssl.sh b/testssl.sh index 8f47044..585e062 100755 --- a/testssl.sh +++ b/testssl.sh @@ -6490,14 +6490,17 @@ parse_sslv2_serverhello() { # [cipher spec length] ==> ciphers GOOD: HERE ARE ALL CIPHERS ALREADY! local ret=3 + local parse_complete="false" + if [[ "$2" == "true" ]]; then - echo "======================================" > $TMPFILE + parse_complete=true fi + "$parse_complete" && echo "======================================" > $TMPFILE v2_hello_ascii=$(hexdump -v -e '16/1 "%02X"' $1) [[ "$DEBUG" -ge 5 ]] && echo "$v2_hello_ascii" if [[ -z "$v2_hello_ascii" ]]; then - ret=0 # 1 line without any blanks: no server hello received + ret=0 # 1 line without any blanks: no server hello received debugme echo "server hello empty" else # now scrape two bytes out of the reply per byte @@ -6528,7 +6531,8 @@ parse_sslv2_serverhello() { fi fi - [[ "$2" == "true" ]] || return $ret + "$parse_complete" || return $ret + rm -f $HOSTCERT $TEMPDIR/intermediatecerts.pem if [[ $ret -eq 3 ]]; then certificate_len=2*$(hex2dec "$v2_hello_cert_length")