Skip to content

Commit c8ae6e3

Browse files
committed
build-ca: If specified, prioritise 'raw' method over all others
Signed-off-by: Richard T Bonhomme <[email protected]>
1 parent 5747111 commit c8ae6e3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

easyrsa3/easyrsa

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ install_data_to_pki() {
13591359

13601360
# Short circuit for x509-types-only
13611361
if [ "$context" = x509-types-only ]; then
1362-
verbose "install_data_to_pki x509-types-only COMPLETED"
1362+
verbose "install_data_to_pki: x509-types-only COMPLETED"
13631363
return
13641364
fi
13651365

@@ -1485,11 +1485,17 @@ build_ca() {
14851485
x509=1
14861486
fi
14871487

1488-
# If encrypted then create the CA key with AES256 cipher
1489-
if [ "$EASYRSA_NO_PASS" ]; then
1490-
unset -v cipher
1488+
# RAW mode must take priority
1489+
if [ "$EASYRSA_RAW_CA" ]; then
1490+
unset -v EASYRSA_NO_PASS EASYRSA_PASSOUT EASYRSA_PASSIN
1491+
verbose "build-ca: CA password RAW method"
14911492
else
1492-
unset -v no_password
1493+
# If encrypted then create the CA key with AES256 cipher
1494+
if [ "$EASYRSA_NO_PASS" ]; then
1495+
unset -v cipher
1496+
else
1497+
unset -v no_password
1498+
fi
14931499
fi
14941500

14951501
# Test for existing CA, and complain if already present
@@ -1744,7 +1750,6 @@ build_ca: CA key password created via temp-files"
17441750
if easyrsa_openssl req -utf8 -new \
17451751
-key "$out_key_tmp" \
17461752
-out "$out_file_tmp" \
1747-
${ssl_batch:+ -batch} \
17481753
${x509:+ -x509} \
17491754
${date_stamp:+ -days "$EASYRSA_CA_EXPIRE"} \
17501755
${EASYRSA_DIGEST:+ -"$EASYRSA_DIGEST"}

0 commit comments

Comments
 (0)