Skip to content

Commit

Permalink
Reorder functions: Move display_dn() above display_san()
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Nov 2, 2023
1 parent 4fec8a7 commit 4d31728
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -4153,6 +4153,31 @@ display_cn - Type '$format', missing: '$path'"
def_dir dot_3 path format internal_batch
} # => display_cn()

# display cert DN info on a req/X509, passed by full pathname
display_dn() {
[ "$#" = 2 ] || die "\
display_dn - input error"

format="$1"
path="$2"
shift 2

# Display DN
name_opts="utf8,sep_multiline,space_eq,lname,align"
print "$(
easyrsa_openssl "$format" -in "$path" -noout -subject \
-nameopt "$name_opts"
)"

# Display SAN, if present
san="$(display_san "$format" "$path")"
if [ "$san" ]; then
print ""
print "X509v3 Subject Alternative Name:"
print " $san"
fi
} # => display_dn()

# Display subjectAltName
display_san() {
[ "$#" = 2 ] || die "\
Expand Down Expand Up @@ -4184,31 +4209,6 @@ display_san - input error"
fi
} # => display_san()

# display cert DN info on a req/X509, passed by full pathname
display_dn() {
[ "$#" = 2 ] || die "\
display_dn - input error"

format="$1"
path="$2"
shift 2

# Display DN
name_opts="utf8,sep_multiline,space_eq,lname,align"
print "$(
easyrsa_openssl "$format" -in "$path" -noout -subject \
-nameopt "$name_opts"
)"

# Display SAN, if present
san="$(display_san "$format" "$path")"
if [ "$san" ]; then
print ""
print "X509v3 Subject Alternative Name:"
print " $san"
fi
} # => display_dn()

# generate default SAN from req/X509, passed by full pathname
default_server_san() {
[ "$#" = 1 ] || die "\
Expand Down

0 comments on commit 4d31728

Please sign in to comment.