cert_validityPeriod is wrong.

This commit is contained in:
Fabrice Bacchella 2020-01-03 16:30:40 +01:00
parent 1bc50bb7d3
commit 0e5376042b
1 changed files with 3 additions and 3 deletions

View File

@ -8740,14 +8740,14 @@ certificate_info() {
# certificate is valid >= 10 years # certificate is valid >= 10 years
out "$spaces" out "$spaces"
prln_svrty_high ">= 10 years is way too long" prln_svrty_high ">= 10 years is way too long"
fileout "cert_validityPeriod${json_postfix}" "HIGH" "$((diffseconds / 3600 * 24 )) days" fileout "cert_validityPeriod${json_postfix}" "HIGH" "$((diffseconds / (3600 * 24) )) days"
elif [[ $diffseconds -ge $((3600 * 24 * 365 * 5)) ]]; then elif [[ $diffseconds -ge $((3600 * 24 * 365 * 5)) ]]; then
out "$spaces" out "$spaces"
prln_svrty_medium ">= 5 years is too long" prln_svrty_medium ">= 5 years is too long"
fileout "cert_validityPeriod${json_postfix}" "MEDIUM" "$((diffseconds / 3600 * 24 )) days" fileout "cert_validityPeriod${json_postfix}" "MEDIUM" "$((diffseconds / (3600 * 24) )) days"
else else
[[ "$DEBUG" -ge 1 ]] && outln "${spaces}OK: below 5 years certificate life time" [[ "$DEBUG" -ge 1 ]] && outln "${spaces}OK: below 5 years certificate life time"
fileout "cert_validityPeriod${json_postfix}" "INFO" "$((diffseconds / 3600 * 24 )) days" fileout "cert_validityPeriod${json_postfix}" "INFO" "$((diffseconds / (3600 * 24) )) days"
fi fi
certificates_provided=1+$(grep -c "\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-" $TEMPDIR/intermediatecerts.pem) certificates_provided=1+$(grep -c "\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-" $TEMPDIR/intermediatecerts.pem)