From 7d5185f52c3bafbd7b5a9ff1551993d2871899ab Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Tue, 12 Apr 2022 14:01:42 +0100 Subject: [PATCH] easyrsa_openssl() - Minor syle changes Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 154bd9b..4d0a4d7 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -362,22 +362,18 @@ easyrsa_openssl() { openssl_command="$1"; shift case "$openssl_command" in - makesafeconf) has_config=true ;; - ca|req|srp|ts) has_config=true ;; - *) has_config=false + makesafeconf) has_config=1 ;; + ca|req|srp|ts) has_config=1 ;; + *) unset -v has_config esac # OpenSSL 1x genpkey does not support -config - Not as documented: # https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html if [ "$osslv_major" = 3 ] && [ "$openssl_command" = genpkey ]; then - has_config=true + has_config=1 fi - case "$has_config" in - false) - "$EASYRSA_OPENSSL" "$openssl_command" "$@" || return - ;; - true) + if [ "$has_config" ]; then # Make LibreSSL safe config file from OpenSSL config file easyrsa_openssl_conf="$(easyrsa_mktemp)" || \ die "easyrsa_openssl - Failed to create temporary file" @@ -411,9 +407,10 @@ easyrsa_openssl() { "$EASYRSA_OPENSSL" "$openssl_command" \ -config "$easyrsa_openssl_conf" "$@" || return fi - ;; - *) die "Undefined state: has_config is $has_config" - esac + else + # Exec SSL without -config temp-file + "$EASYRSA_OPENSSL" "$openssl_command" "$@" || return + fi } # => easyrsa_openssl # Verify supplied curve exists and generate curve file if needed