Merge pull request #3066 from logopk/fix/issuer-cn-linecount

[Bug] FIXME: issuer_CN error with more than 5 lines in Issuer #3065
This commit is contained in:
Dirk Wetter
2026-06-18 11:29:47 +02:00
committed by GitHub
+1 -1
View File
@@ -10432,7 +10432,7 @@ certificate_info() {
out " ($enddate). " out " ($enddate). "
# Match Subject/Issuer on next 5 lines, where the CN is (4 lines is fine in most cases, 5 should suffice for all certs) # Match Subject/Issuer on next 5 lines, where the CN is (4 lines is fine in most cases, 5 should suffice for all certs)
cn="$(awk '/Subject:/{stop=NR+5}; NR<=stop' <<< "${intermediate_certs_txt[i]}" | awk -F= '/CN/ { print $NF }')" cn="$(awk '/Subject:/{stop=NR+5}; NR<=stop' <<< "${intermediate_certs_txt[i]}" | awk -F= '/CN/ { print $NF }')"
issuer_CN="$(awk '/Issuer:/{stop=NR+5}; NR<=stop' <<< "${intermediate_certs_txt[i]}" | awk -F= '/CN/ { print $NF }')" issuer_CN="$(awk '/Issuer:/{stop=NR+7}; NR<=stop' <<< "${intermediate_certs_txt[i]}" | awk -F= '/CN/ { print $NF }')"
# to catch errors like #2789 during unit test: # to catch errors like #2789 during unit test:
[[ -z "$cn" ]] && cn="FIXME: cn error" [[ -z "$cn" ]] && cn="FIXME: cn error"
[[ -z "$issuer_CN" ]] && issuer_CN="FIXME: issuer_CN error" [[ -z "$issuer_CN" ]] && issuer_CN="FIXME: issuer_CN error"