From 191d19be323b573c35d2451fd9673b42b0c1e792 Mon Sep 17 00:00:00 2001 From: David Cooper Date: Tue, 21 Feb 2017 15:47:59 -0500 Subject: [PATCH] Use egrep -v to remove unwanted lines --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index b57664d..f7ba8df 100755 --- a/testssl.sh +++ b/testssl.sh @@ -10218,7 +10218,7 @@ run_logjam() { # now the final test for common primes if [[ -n "$key_bitstring" ]]; then - dh_p="$($OPENSSL pkey -pubin -text -noout <<< "$key_bitstring" | awk '/prime:/,/generator:/' | tail -n +2 | sed -e 's/generator: .*//')" + dh_p="$($OPENSSL pkey -pubin -text -noout <<< "$key_bitstring" | awk '/prime:/,/generator:/' | egrep -v "prime|generator")" dh_p="$(strip_spaces "$(colon_to_spaces "$(newline_to_spaces "$dh_p")")")" [[ "${dh_p:0:2}" == "00" ]] && dh_p="${dh_p:2}" len_dh_p="$((4*${#dh_p}))"