From b7ff8a1ee39fce0fe5c4de912b452238252ae317 Mon Sep 17 00:00:00 2001 From: David Cooper Date: Thu, 29 Dec 2016 16:45:46 -0500 Subject: [PATCH] Add extra check --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 18204e2..4a71070 100755 --- a/testssl.sh +++ b/testssl.sh @@ -9386,7 +9386,7 @@ run_logjam() { server_key_exchange="${server_key_exchange%%[!0-9A-F]*}" server_key_exchange_len=${#server_key_exchange} [[ $server_key_exchange_len -gt 8 ]] && [[ "${server_key_exchange:0:2}" == "0C" ]] && ephemeral_pub_len=$(hex2dec "${server_key_exchange:2:6}") - [[ $ephemeral_pub_len -le $server_key_exchange_len ]] && key_bitstring="$(get_dh_ephemeralkey "${server_key_exchange:8}")" + [[ $ephemeral_pub_len -ne 0 ]] && [[ $ephemeral_pub_len -le $server_key_exchange_len ]] && key_bitstring="$(get_dh_ephemeralkey "${server_key_exchange:8}")" fi fi if [[ -n "$key_bitstring" ]]; then