Skip to content

Commit 947b256

Browse files
authored
Merge pull request #2363 from teki69/patch-1
Fix CRL conversion issue when already in PEM format
2 parents f716193 + eb76fd0 commit 947b256

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

testssl.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,9 +1981,13 @@ check_revocation_crl() {
19811981
# -crl_download could be more elegant but is supported from 1.0.2 onwards only
19821982
$OPENSSL crl -inform DER -in "$tmpfile" -outform PEM -out "${tmpfile%%.crl}.pem" &>$ERRFILE
19831983
if [[ $? -ne 0 ]]; then
1984-
pr_warning "conversion of \"$tmpfile\" failed"
1985-
fileout "$jsonID" "WARN" "conversion of CRL to PEM format failed"
1986-
return 1
1984+
if grep -qe 'BEGIN X509 CRL' "$tmpfile"; then
1985+
mv "$tmpfile" "${tmpfile%%.crl}.pem"
1986+
else
1987+
pr_warning "conversion of \"$tmpfile\" failed"
1988+
fileout "$jsonID" "WARN" "conversion of CRL to PEM format failed"
1989+
return 1
1990+
fi
19871991
fi
19881992
if grep -qe '-----BEGIN CERTIFICATE-----' $TEMPDIR/intermediatecerts.pem; then
19891993
$OPENSSL verify -crl_check -CAfile <(cat $ADDTL_CA_FILES "$GOOD_CA_BUNDLE" "${tmpfile%%.crl}.pem") -untrusted $TEMPDIR/intermediatecerts.pem $HOSTCERT &> "${tmpfile%%.crl}.err"

0 commit comments

Comments
 (0)