Skip to content

Commit

Permalink
Merge branch 'TinCanTech-libressl-x509-no-ext-opt'
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Jan 24, 2024
2 parents 5218e7d + 3a0df21 commit 42e43ad
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -3929,12 +3929,19 @@ ssl_cert_x509v3_eku() {
unset -v __known

# Extract certificate Extended Key Usage
__eku="$(
OPENSSL_CONF=/dev/null
"$EASYRSA_OPENSSL" x509 -in "${__crt}" -noout \
-ext extendedKeyUsage | \
sed -e /"${__pattern}"/d -e s/^\ *//
)"
if [ "$ssl_lib" = libressl ]; then
__eku="$(
easyrsa_openssl x509 -in "${__crt}" -noout -text | \
sed -n "/${__pattern}/{n;s/^ *//g;p;}"
)"
else
__eku="$(
OPENSSL_CONF=/dev/null
"$EASYRSA_OPENSSL" x509 -in "${__crt}" -noout \
-ext extendedKeyUsage | \
sed -e /"${__pattern}"/d -e s/^\ *//
)"
fi

# Match EKU with supported usage
case "$__eku" in
Expand Down

0 comments on commit 42e43ad

Please sign in to comment.