Merge branch 'easyrsa_openssl-style' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-easyrsa_openssl-style
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
commit
e1dfacef6b
@ -362,22 +362,18 @@ easyrsa_openssl() {
|
|||||||
openssl_command="$1"; shift
|
openssl_command="$1"; shift
|
||||||
|
|
||||||
case "$openssl_command" in
|
case "$openssl_command" in
|
||||||
makesafeconf) has_config=true ;;
|
makesafeconf) has_config=1 ;;
|
||||||
ca|req|srp|ts) has_config=true ;;
|
ca|req|srp|ts) has_config=1 ;;
|
||||||
*) has_config=false
|
*) unset -v has_config
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# OpenSSL 1x genpkey does not support -config - Not as documented:
|
# OpenSSL 1x genpkey does not support -config - Not as documented:
|
||||||
# https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html
|
# https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html
|
||||||
if [ "$osslv_major" = 3 ] && [ "$openssl_command" = genpkey ]; then
|
if [ "$osslv_major" = 3 ] && [ "$openssl_command" = genpkey ]; then
|
||||||
has_config=true
|
has_config=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$has_config" in
|
if [ "$has_config" ]; then
|
||||||
false)
|
|
||||||
"$EASYRSA_OPENSSL" "$openssl_command" "$@" || return
|
|
||||||
;;
|
|
||||||
true)
|
|
||||||
# Make LibreSSL safe config file from OpenSSL config file
|
# Make LibreSSL safe config file from OpenSSL config file
|
||||||
easyrsa_openssl_conf="$(easyrsa_mktemp)" || \
|
easyrsa_openssl_conf="$(easyrsa_mktemp)" || \
|
||||||
die "easyrsa_openssl - Failed to create temporary file"
|
die "easyrsa_openssl - Failed to create temporary file"
|
||||||
@ -411,9 +407,10 @@ easyrsa_openssl() {
|
|||||||
"$EASYRSA_OPENSSL" "$openssl_command" \
|
"$EASYRSA_OPENSSL" "$openssl_command" \
|
||||||
-config "$easyrsa_openssl_conf" "$@" || return
|
-config "$easyrsa_openssl_conf" "$@" || return
|
||||||
fi
|
fi
|
||||||
;;
|
else
|
||||||
*) die "Undefined state: has_config is $has_config"
|
# Exec SSL without -config temp-file
|
||||||
esac
|
"$EASYRSA_OPENSSL" "$openssl_command" "$@" || return
|
||||||
|
fi
|
||||||
} # => easyrsa_openssl
|
} # => easyrsa_openssl
|
||||||
|
|
||||||
# Verify supplied curve exists and generate curve file if needed
|
# Verify supplied curve exists and generate curve file if needed
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user