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 <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-03-21 15:57:03 +00:00
parent f64fef9af2
commit 8e7bac695d
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -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"