From 2932e1f29e73a5c0ba96ddb45237d749e4dcc3bc Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 26 Jul 2017 09:55:49 +0200 Subject: [PATCH] FIX #798 --- testssl.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index e5beaf9..d3fdea4 100755 --- a/testssl.sh +++ b/testssl.sh @@ -1689,7 +1689,11 @@ run_hpkp() { fi # print key=value pair with awk, then strip non-numbers, to be improved with proper parsing of key-value with awk - hpkp_age_sec=$(awk -F= '/max-age/{max_age=$2; print max_age}' $TMPFILE | sed -E 's/[^[:digit:]]//g') + if "$HAS_SED_E"; then + hpkp_age_sec=$(awk -F= '/max-age/{max_age=$2; print max_age}' $TMPFILE | sed -E 's/[^[:digit:]]//g') + else + hpkp_age_sec=$(awk -F= '/max-age/{max_age=$2; print max_age}' $TMPFILE | sed -r 's/[^[:digit:]]//g') + fi hpkp_age_days=$((hpkp_age_sec / 86400)) if [[ $hpkp_age_sec -ge $HPKP_MIN ]]; then pr_done_good "$hpkp_age_days days" ; out "=$hpkp_age_sec s"