Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ssl_cert_x509v3_eku() #1125

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -3557,12 +3557,11 @@ ssl_cert_x509v3_eku() {
# Extract certificate Extended Key Usage
if [ "$ssl_lib" = libressl ]; then
__eku="$(
easyrsa_openssl x509 -in "${__crt}" -noout -text | \
"$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/^\ *//
Expand Down Expand Up @@ -3614,6 +3613,8 @@ ssl_cert_x509v3_eku() {
return
fi

# Also, catch errors from SSL x509 command
# for '__eku' subshell+pipe
return 1
} # => ssl_cert_x509v3_eku()

Expand Down