1
0
mirror of https://github.com/drwetter/testssl.sh.git synced 2025-05-18 22:26:04 +02:00

Fix check for self-signed certificate

The check for whether a certificate is self-signed was using the undefined variable $CN rather than $cn.
This commit is contained in:
David Cooper 2016-07-22 12:06:52 -04:00 committed by GitHub
parent ddead05825
commit ae38670067

@ -4151,7 +4151,7 @@ certificate_info() {
issuer_C="$(awk -F'=' '/ C=/ { print $2 }' <<< "$issuer")"
issuer_DC="$(awk -F'=' '/DC=/ { print $2 }' <<< "$issuer")"
if [[ "$issuer_O" == "issuer=" ]] || [[ "$issuer_O" == "issuer= " ]] || [[ "$issuer_CN" == "$CN" ]]; then
if [[ "$issuer_O" == "issuer=" ]] || [[ "$issuer_O" == "issuer= " ]] || [[ "$issuer_CN" == "$cn" ]]; then
pr_svrty_criticalln "self-signed (NOT ok)"
fileout "${json_prefix}issuer" "NOT ok" "Issuer: selfsigned (NOT ok)"
else