From b1b30b3fb8988e56855475f662cab411dda4d18b Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 1 Mar 2018 16:01:05 +0100 Subject: [PATCH] better matching of empty server banners .. which could have led to borken JSON too --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 3bcd2ec..8305d9e 100755 --- a/testssl.sh +++ b/testssl.sh @@ -2161,7 +2161,7 @@ run_server_banner() { grep -ai '^Server' $HEADERFILE >$TMPFILE if [[ $? -eq 0 ]]; then serverbanner=$(sed -e 's/^Server: //' -e 's/^server: //' $TMPFILE) - if [[ x"$serverbanner" == "x\n" ]] || [[ x"$serverbanner" == "x\n\r" ]] || [[ -z "$serverbanner" ]]; then + if [[ "$serverbanner" == $'\n' ]] || [[ "$serverbanner" == $'\r' ]] || [[ "$serverbanner" == $'\n\r' ]] || [[ -z "$serverbanner" ]]; then outln "banner exists but empty string" fileout "$jsonID" "INFO" "Server banner is empty" else