Skip to content

Commit

Permalink
build-ca: Do not export CA password to environment
Browse files Browse the repository at this point in the history
In default mode, build-ca exports the CA password to the environment,
via function force_set_var().

Replace use of force_set_var() with a here-doc.

Also, make verbose openssl command output debug only.

Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Dec 14, 2023
1 parent 784ad81 commit 009ea1f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,8 @@ easyrsa_openssl() {
fi

# Execute command - Return on success
verbose "> easyrsa_openssl - EXEC $openssl_command $*"
[ -z "$EASYRSA_DEBUG" ] || \
verbose "> easyrsa_openssl - EXEC $openssl_command $*"

case "$openssl_command" in
makesafeconf)
Expand Down Expand Up @@ -1449,7 +1450,10 @@ get_passphrase() {
printf '\n%s\n' \
"Passphrase must be at least 4 characters!"
else
force_set_var "$t" "$r" || die "Passphrase error!"
read -r "$t" <<- SECRET
$r
SECRET

unset -v r t
print
return 0
Expand Down

0 comments on commit 009ea1f

Please sign in to comment.