Skip to content

Commit

Permalink
Fix compatibility with openssl 3
Browse files Browse the repository at this point in the history
Passing the `-SHA1` flag instead of `-sha1` for these commands preserves
the expected capitalization of the output for later processing.

Signed-off-by: Patrick McCarty <[email protected]>
  • Loading branch information
phmccarty authored and bryteise committed Oct 21, 2022
1 parent f24e620 commit c757135
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clrtrust.in
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ $1"
1>&2 echo "$f must contain single certificate. Skipping..."
continue
fi
finger=$(openssl x509 -in "${f}" -noout -fingerprint -sha1 2>$tmp)
finger=$(openssl x509 -in "${f}" -noout -fingerprint -SHA1 2>$tmp)
if [ $? -ne 0 ]; then
1>&2 echo "$f is not a PEM-encoded X.509 certificate. Skipping..."
cat $tmp
Expand Down Expand Up @@ -719,7 +719,7 @@ cmd_list() {
fi

echo "$certs" | while read f; do
info=$(openssl x509 -in "${f}" -noout -fingerprint -sha1 -issuer -enddate)
info=$(openssl x509 -in "${f}" -noout -fingerprint -SHA1 -issuer -enddate)
if [ $? -ne 0 ]; then
1>&2 echo "${f} is not an X.509 certificate."
fi
Expand Down Expand Up @@ -799,7 +799,7 @@ $1"
files=$(echo "$files" | sed -e '1d')

test -n "$files" && echo "$files" | while read f; do
finger=$(openssl x509 -in "${f}" -noout -fingerprint -sha1 2>/dev/null)
finger=$(openssl x509 -in "${f}" -noout -fingerprint -SHA1 2>/dev/null)
if [ $? -ne 0 ]; then
1>&2 echo "${f} is not an X.509 certificate."
continue
Expand Down

0 comments on commit c757135

Please sign in to comment.