From 11d74d2f6e66e665111469440ed9afe3a7df2baf Mon Sep 17 00:00:00 2001 From: Dirk Date: Sat, 22 Sep 2018 09:50:15 +0200 Subject: [PATCH] Remove the cat in get_cipher() and get_protocol() See #1129 --- testssl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testssl.sh b/testssl.sh index c5345b4..4252657 100755 --- a/testssl.sh +++ b/testssl.sh @@ -1226,7 +1226,7 @@ strip_trailing_space() { # retrieve cipher from ServerHello (via openssl) get_cipher() { local cipher="" - local server_hello="$(cat "$1")" + local server_hello="$(< "$1")" if [[ "$server_hello" =~ Cipher\ *:\ ([A-Z0-9]+-[A-Z0-9\-]+|TLS_[A-Z0-9_]+) ]]; then cipher="${BASH_REMATCH##* }" @@ -1239,7 +1239,7 @@ get_cipher() { # retrieve protocol from ServerHello (via openssl) get_protocol() { local protocol="" - local server_hello="$(cat "$1")" + local server_hello="$(< "$1")" if [[ "$server_hello" =~ Protocol\ *:\ (SSLv[23]|TLSv1(\.[0-3])?) ]]; then protocol="${BASH_REMATCH##* }"