Skip to content

Commit

Permalink
Rename variable easyrsa_safe_ssl_conf -> safe_ssl_cnf_tmp
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Jul 16, 2023
1 parent 4bde482 commit 22ff0ea
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ secure_session() {
if mkdir "$secured_session"; then
# New session requires safe-ssl conf
unset -v mktemp_counter \
OPENSSL_CONF easyrsa_safe_ssl_conf \
OPENSSL_CONF safe_ssl_cnf_tmp \
working_safe_ssl_conf
easyrsa_err_log="$secured_session/error.log"
verbose "\
Expand All @@ -716,7 +716,7 @@ remove_secure_session() {
verbose "\
remove_secure_session: DELETED: $secured_session"
unset -v secured_session mktemp_counter \
OPENSSL_CONF easyrsa_safe_ssl_conf \
OPENSSL_CONF safe_ssl_cnf_tmp \
working_safe_ssl_conf
return
fi
Expand Down Expand Up @@ -903,7 +903,7 @@ make_safe_ssl() {
Safe SSL config file created at:
* $EASYRSA_SAFE_CONF"
verbose "\
make_safe_ssl: NEW SSL cnf file: $easyrsa_safe_ssl_conf"
make_safe_ssl: NEW SSL cnf file: $safe_ssl_cnf_tmp"
} # => make_safe_ssl_copy()

# Escape hazardous characters
Expand Down Expand Up @@ -977,11 +977,11 @@ expand_ssl_config() {
working_safe_ssl_conf=1
fi

# Assign easyrsa_safe_ssl_conf temp-file
easyrsa_safe_ssl_conf=""
easyrsa_mktemp easyrsa_safe_ssl_conf || die "\
# Assign safe_ssl_cnf_tmp temp-file
safe_ssl_cnf_tmp=""
easyrsa_mktemp safe_ssl_cnf_tmp || die "\
expand_ssl_config - \
easyrsa_mktemp easyrsa_safe_ssl_conf"
easyrsa_mktemp safe_ssl_cnf_tmp"

# Rewrite
# shellcheck disable=SC2016 # No expansion inside ''
Expand Down Expand Up @@ -1032,7 +1032,7 @@ easyrsa_mktemp easyrsa_safe_ssl_conf"
-e s\`'$ENV::EASYRSA_REQ_SERIAL'\`\
\""$EASYRSA_REQ_SERIAL"\"\`g \
\
"$EASYRSA_SSL_CONF" > "$easyrsa_safe_ssl_conf"
"$EASYRSA_SSL_CONF" > "$safe_ssl_cnf_tmp"
then
verbose "expand_ssl_config: COMPLETED"
else
Expand Down Expand Up @@ -1076,39 +1076,39 @@ easyrsa_openssl() {
# Support --no-safe-ssl
if [ "$EASYRSA_NO_SAFE_SSL" ]; then
# Assign safe temp file as Original openssl-easyrsa.conf
easyrsa_safe_ssl_conf="$EASYRSA_SSL_CONF"
safe_ssl_cnf_tmp="$EASYRSA_SSL_CONF"
verbose "easyrsa_openssl: No SAFE SSL config"
fi

# VERIFY safe temp-file exists
if [ -e "$easyrsa_safe_ssl_conf" ]; then
if [ -e "$safe_ssl_cnf_tmp" ]; then
verbose "\
easyrsa_openssl: Safe SSL conf OK: $easyrsa_safe_ssl_conf"
easyrsa_openssl: Safe SSL conf OK: $safe_ssl_cnf_tmp"
else
die "\
easyrsa_openssl - Safe SSL conf MISSING: $easyrsa_safe_ssl_conf"
easyrsa_openssl - Safe SSL conf MISSING: $safe_ssl_cnf_tmp"
fi

# set $OPENSSL_CONF - Use which-ever file is assigned above
export OPENSSL_CONF="$easyrsa_safe_ssl_conf"
export OPENSSL_CONF="$safe_ssl_cnf_tmp"

# Execute command - Return on success
if [ "$openssl_command" = "makesafeconf" ]; then
# COPY temp-file to safessl-easyrsa.cnf
cp -f "$easyrsa_safe_ssl_conf" "$EASYRSA_SAFE_CONF" && \
cp -f "$safe_ssl_cnf_tmp" "$EASYRSA_SAFE_CONF" && \
return

elif [ "$has_config" ]; then
# Exec SSL with -config temp-file
if [ "$EASYRSA_SILENT_SSL" ] && [ "$EASYRSA_BATCH" ]
then
"$EASYRSA_OPENSSL" "$openssl_command" \
-config "$easyrsa_safe_ssl_conf" "$@" \
-config "$safe_ssl_cnf_tmp" "$@" \
2>/dev/null && \
return
else
"$EASYRSA_OPENSSL" "$openssl_command" \
-config "$easyrsa_safe_ssl_conf" "$@" && \
-config "$safe_ssl_cnf_tmp" "$@" && \
return
fi

Expand All @@ -1129,7 +1129,7 @@ easyrsa_openssl - Safe SSL conf MISSING: $easyrsa_safe_ssl_conf"
die "\
easyrsa_openssl - Command has failed:
* $EASYRSA_OPENSSL $openssl_command \
${has_config:+-config $easyrsa_safe_ssl_conf }$*"
${has_config:+-config $safe_ssl_cnf_tmp }$*"
} # => easyrsa_openssl()

# Verify the SSL library is functional
Expand Down

0 comments on commit 22ff0ea

Please sign in to comment.