mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-03 23:39:45 +01:00
compare_server_name_to_cert(): Fix unassigned vars.
Two instances of referenced but not assigned variables ('req' instead of 'ret'). In testssl.sh line 4130: if [[ $req -eq 0 ]]; then ^-- SC2154: req is referenced but not assigned. Found by ShellCheck.
This commit is contained in:
parent
f0132dcb7f
commit
7dbbe42ea0
@ -4127,7 +4127,7 @@ compare_server_name_to_cert()
|
||||
[[ $(toupper "$san") == "$servername" ]] && ret=1 && break
|
||||
done
|
||||
|
||||
if [[ $req -eq 0 ]]; then
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
# Check whether any of the IP addresses in the certificate match the servername
|
||||
ip_sans=$($OPENSSL x509 -in "$cert" -noout -text 2>>$ERRFILE | grep -A2 "Subject Alternative Name" | \
|
||||
tr ',' '\n' | grep "IP Address:" | sed -e 's/IP Address://g' -e 's/ //g')
|
||||
@ -4138,7 +4138,7 @@ compare_server_name_to_cert()
|
||||
|
||||
# Check whether any of the DNS names in the certificate are wildcard names
|
||||
# that match the servername
|
||||
if [[ $req -eq 0 ]]; then
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
for san in $dns_sans; do
|
||||
wildcard_match "$servername" "$san"
|
||||
[[ $? -eq 0 ]] && ret=2 && break
|
||||
|
Loading…
Reference in New Issue
Block a user