Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-order easyrsa_openssl() temp-file assignment #807

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -797,20 +797,22 @@ easyrsa_openssl() {
has_config=1
fi

# Make LibreSSL safe config file from OpenSSL config file
# Assign safe temp file to create, may not be used
easyrsa_safe_ssl_conf="$(easyrsa_mktemp)" || \
die "easyrsa_openssl - easyrsa_mktemp failed"

# Auto-escape hazardous characters:
# '&' - Workaround 'sed' behavior
# '$' - Workaround 'easyrsa' based limitation
# This is required for all SSL libs, otherwise,
# there are unacceptable differences in behavior
escape_hazard

# Currently, $require_safe_ssl_conf is ALWAYS set by verify_ssl_lib()
# Make LibreSSL safe config file from OpenSSL config file
# $require_safe_ssl_conf is ALWAYS set by verify_ssl_lib()
# Can be over-ruled for OpenSSL by option --no-safe-ssl
if [ "$require_safe_ssl_conf" ]; then

# Assign safe temp file
easyrsa_safe_ssl_conf="$(easyrsa_mktemp)" || \
die "easyrsa_openssl - easyrsa_mktemp failed"

# Break indentation for long lines
# Make a safe SSL config file
# shellcheck disable=SC2016 # No expansion inside ' single quote
Expand All @@ -835,11 +837,11 @@ easyrsa_openssl() {

# Restore standard indentation
else
# Assign safe temp file - Use original EasyRSA-OpenSSL conf
# Assign safe temp file as: Use original EasyRSA-OpenSSL conf
easyrsa_safe_ssl_conf="$EASYRSA_SSL_CONF"
fi

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

# Execute command
Expand Down