Skip to content

Commit

Permalink
Rename $raw_ssl_cnf_tmp, SSL config temp file, for clarity
Browse files Browse the repository at this point in the history
Rename $raw_ssl_cnf_tmp to $adjusted_ssl_cnf_tmp, to clarify that this
is the EasyRSA edited SSL config file.

Also, avoid confusion with 'build-ca raw' mode.

Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Dec 4, 2023
1 parent fd13e6b commit 324db55
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -1701,9 +1701,9 @@ Raw CA mode
fi

# Assign tmp-file for config
raw_ssl_cnf_tmp=""
easyrsa_mktemp raw_ssl_cnf_tmp || \
die "build_ca - easyrsa_mktemp raw_ssl_cnf_tmp"
adjusted_ssl_cnf_tmp=""
easyrsa_mktemp adjusted_ssl_cnf_tmp || \
die "build_ca - easyrsa_mktemp adjusted_ssl_cnf_tmp"

# Assign awkscript to insert EASYRSA_EXTRA_EXTS
# shellcheck disable=SC2016 # vars don't expand in ''
Expand Down Expand Up @@ -1734,12 +1734,12 @@ Raw CA mode
print "$EASYRSA_EXTRA_EXTS"

} | awk "$awkscript" "$EASYRSA_SSL_CONF" \
> "$raw_ssl_cnf_tmp" || \
> "$adjusted_ssl_cnf_tmp" || \
die "Copying X509_TYPES to config file failed"
verbose "build-ca: insert x509 and extensions OK"

# Use this new SSL config for the rest of this function
EASYRSA_SSL_CONF="$raw_ssl_cnf_tmp"
EASYRSA_SSL_CONF="$adjusted_ssl_cnf_tmp"

# Generate CA Key
case "$EASYRSA_ALGO" in
Expand Down Expand Up @@ -1969,18 +1969,18 @@ $EASYRSA_EXTRA_EXTS"
{print}
}'
# Assign temp-file for confg
raw_ssl_cnf_tmp=""
easyrsa_mktemp raw_ssl_cnf_tmp || \
die "gen_req - easyrsa_mktemp raw_ssl_cnf_tmp"
adjusted_ssl_cnf_tmp=""
easyrsa_mktemp adjusted_ssl_cnf_tmp || \
die "gen_req - easyrsa_mktemp adjusted_ssl_cnf_tmp"

# Insert $extra_exts @ %EXTRA_EXTS% in SSL Config
print "$extra_exts" | \
awk "$awkscript" "$EASYRSA_SSL_CONF" \
> "$raw_ssl_cnf_tmp" || \
> "$adjusted_ssl_cnf_tmp" || \
die "Writing SSL config to temp file failed"

# Use this SSL config for the rest of this function
EASYRSA_SSL_CONF="$raw_ssl_cnf_tmp"
EASYRSA_SSL_CONF="$adjusted_ssl_cnf_tmp"
fi

# Name temp files
Expand Down Expand Up @@ -2138,17 +2138,17 @@ to the latest Easy-RSA release."
{print}
}'
# Assign temp-file for confg
raw_ssl_cnf_tmp=""
easyrsa_mktemp raw_ssl_cnf_tmp || \
die "sign_req - easyrsa_mktemp raw_ssl_cnf_tmp"
adjusted_ssl_cnf_tmp=""
easyrsa_mktemp adjusted_ssl_cnf_tmp || \
die "sign_req - easyrsa_mktemp adjusted_ssl_cnf_tmp"

print "$copy_exts" | \
awk "$awkscript" "$EASYRSA_SSL_CONF" \
> "$raw_ssl_cnf_tmp" || die "\
> "$adjusted_ssl_cnf_tmp" || die "\
Writing 'copy_exts' to SSL config temp-file failed"

# Use this SSL config for the rest of this function
EASYRSA_SSL_CONF="$raw_ssl_cnf_tmp"
EASYRSA_SSL_CONF="$adjusted_ssl_cnf_tmp"
verbose "sign_req: Using '$copy_exts'"
fi

Expand Down

0 comments on commit 324db55

Please sign in to comment.