Remove hard-coded unit-test password from build-ca

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2023-01-24 16:05:02 +00:00
parent 6fe973a548
commit 81ab139ebb
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -1401,26 +1401,15 @@ Unable to create necessary PKI files (permissions?)"
out_key_pass_tmp="$(easyrsa_mktemp)" || \
die "out_key_pass_tmp: create"
# Dirty way to unit-test default behavior
if [ "$ERSA_UTEST_VERSION" ]; then
# Prove this works by changing passwords
# use: ERSA_UTEST_VERSION=9 easyrsa build-ca
p="EasyRSA"
q="EasyRSA"
unset -v EASYRSA_PASSIN EASYRSA_PASSOUT
warn "SPECIAL unit-test CA password!"
p=""
q=""
# Get passphrase p
get_passphrase p \
"Enter New CA Key Passphrase: "
else
p=""
q=""
# Get passphrase p
get_passphrase p \
"Enter New CA Key Passphrase: "
# Confirm passphrase q
get_passphrase q \
"Confirm New CA Key Passphrase: "
fi
# Confirm passphrase q
get_passphrase q \
"Confirm New CA Key Passphrase: "
# Validate passphrase
if [ "$p" ] && [ "$p" = "$q" ]; then