From 8e7bac695df546189c447b66b1a95c1de36919cf Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Mon, 21 Mar 2022 15:57:03 +0000 Subject: [PATCH] Quote $algo_opts When EasyRSA is installed to a path with a space in it, gen_req() fails for EC and ED crypto. This is caused by the space in the file-name for the parameters file $EASYRSA_CURVE. To resolve this, '-newkey' must be removed from $algo_opts and inserted into the OpenSSL command. And $algo_opts must be quoted. (#494) Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 5b0ff56..2250477 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -908,11 +908,11 @@ $EASYRSA_EXTRA_EXTS" # shellcheck disable=2086,2148 algo_opts="" if [ "ed" = "$EASYRSA_ALGO" ]; then - algo_opts=" -newkey $EASYRSA_CURVE " + algo_opts="$EASYRSA_CURVE" else - algo_opts=" -newkey $EASYRSA_ALGO:$EASYRSA_ALGO_PARAMS " + algo_opts="$EASYRSA_ALGO:$EASYRSA_ALGO_PARAMS" fi - easyrsa_openssl req -utf8 -new $algo_opts \ + easyrsa_openssl req -utf8 -new -newkey "$algo_opts" \ -keyout "$key_out_tmp" -out "$req_out_tmp" $opts ${EASYRSA_PASSOUT:+-passout "$EASYRSA_PASSOUT"} \ || die "Failed to generate request" mv "$key_out_tmp" "$key_out"