Skip to content

Commit 3430bd9

Browse files
authored
Merge pull request #2965 from testssl/fix_2944
Add missing LF after pwnkeys DB check
2 parents 651ddc1 + eeb8e7d commit 3430bd9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

testssl.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10106,16 +10106,19 @@ certificate_info() {
1010610106
check_pwnedkeys "$HOSTCERT" "$cert_key_algo" "$cert_keysize"
1010710107
case "$?" in
1010810108
0) outln "not checked"; fileout "pwnedkeys${json_postfix}" "INFO" "not checked" ;;
10109-
1) pr_svrty_good "not in database"; fileout "pwnedkeys${json_postfix}" "OK" "not in database" ;;
10110-
2) pr_svrty_critical "NOT ok --"; outln " key appears in database"; fileout "pwnedkeys${json_postfix}" "CRITICAL" "private key is known" ;;
10109+
1) prln_svrty_good "not in database"; fileout "pwnedkeys${json_postfix}" "OK" "not in database" ;;
10110+
2) pr_svrty_critical "NOT ok --"; outln " key appears in database"
10111+
fileout "pwnedkeys${json_postfix}" "CRITICAL" "private key is known" ;;
1011110112
7) prln_warning "error querying https://v1.pwnedkeys.com"; fileout "pwnedkeys${json_postfix}" "WARN" "connection error" ;;
1011210113
esac
1011310114
fi
1011410115

1011510116
out "$indent"; pr_bold " Certificate Revocation List "
1011610117
jsonID="cert_crlDistributionPoints"
1011710118
# ~ get next 50 lines after pattern , strip until Signature Algorithm and retrieve URIs
10118-
crl="$(awk '/X509v3 CRL Distribution/{i=50} i&&i--' <<< "$cert_txt" | awk '/^$|^.*Name.*$|^.*Reasons.*$|^.*CRL Issuer.*$/,/^ [a-zA-Z0-9]+|^ Signature Algorithm:/' | awk -F'URI:' '/URI/ { print $2 }')"
10119+
crl="$(awk '/X509v3 CRL Distribution/{i=50} i&&i--' <<< "$cert_txt" | \
10120+
awk '/^$|^.*Name.*$|^.*Reasons.*$|^.*CRL Issuer.*$/,/^ [a-zA-Z0-9]+|^ Signature Algorithm:/' | \
10121+
awk -F'URI:' '/URI/ { print $2 }')"
1011910122
if [[ -z "$crl" ]] ; then
1012010123
fileout "${jsonID}${json_postfix}" "INFO" "--"
1012110124
outln "--"

0 commit comments

Comments
 (0)