Skip to content

Commit

Permalink
self-sign: simplify required curve EASYRSA_CURVE
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Apr 21, 2024
1 parent 22fd055 commit 48c0fb4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -1900,27 +1900,30 @@ Conflicting certificate exists at:

# params-file
if [ "$EASYRSA_CURVE" ]; then
user_error "Only EC Curve 'secp384r1' is suported."
[ "$EASYRSA_CURVE" = secp384r1 ] || \
user_error "Only EC Curve 'secp384r1' is supported."
else
export EASYRSA_CURVE=secp384r1
"${EASYRSA_OPENSSL}" ecparam \
-name "${EASYRSA_CURVE}" \
-out "${selfsign_params_file}" || \
die "build_self_sign - params-file failed"
fi

"${EASYRSA_OPENSSL}" ecparam \
-name "${EASYRSA_CURVE}" \
-out "${selfsign_params_file}" || \
die "build_self_sign - params-file failed"

# create self-signed key pair
easyrsa_openssl req -x509 -utf8 -sha256 -text \
easyrsa_openssl req -x509 -utf8 -sha256 -text \
-newkey ec:"${selfsign_params_file}" \
-keyout "${key_out}" \
-out "${crt_out}" \
-subj "/CN=${file_name_base}" \
-addext extendedKeyUsage="${selfsign_eku}" \
${EASYRSA_NO_PASS:+ "$no_password"} \
${EASYRSA_PASSIN:+ -passin "$EASYRSA_PASSIN"} \
${EASYRSA_PASSOUT:+ -passout "$EASYRSA_PASSOUT"} \
${EASYRSA_CERT_EXPIRE:+ -days "$EASYRSA_CERT_EXPIRE"} \
${EASYRSA_START_DATE:+ -startdate "$EASYRSA_START_DATE"} \
${EASYRSA_END_DATE:+ -enddate "$EASYRSA_END_DATE"} \
${EASYRSA_END_DATE:+ -enddate "$EASYRSA_END_DATE"}

# Generate fingerprint for inline file
crt_fingerprint="$(
Expand Down

0 comments on commit 48c0fb4

Please sign in to comment.