Skip to content

Commit

Permalink
Integrate automatic TLS Key use into inline files
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 6, 2024
1 parent 588042b commit dadf1ad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -2952,6 +2952,7 @@ inline_creds() {
crt_source="${EASYRSA_PKI}/issued/${1}.crt"
key_source="${EASYRSA_PKI}/private/${1}.key"
ca_source="$EASYRSA_PKI/ca.crt"
tls_source="${EASYRSA_PKI}"/inline/easyrsa-tls.inline
incomplete=0

# Generate data
Expand Down Expand Up @@ -3036,6 +3037,18 @@ $(cat "$ca_source")
fi
fi

# TLS auth|crypt key
if [ "$EASYRSA_AUTO_TLS_CRYPT" ] || \
[ "$EASYRSA_AUTO_TLS_CRYPT" ]
then
if [ -f "$tls_source" ]; then
tls_data="$(cat "$tls_source")"
else
incomplete=1
tls_data="# Easy-RSA TLS Key not found!"
fi
else
fi
# Print data
print "\
# Easy-RSA Type: $type_data
Expand All @@ -3047,6 +3060,8 @@ $crt_data
$key_data

$ca_data

$tls_data
"
# If inline file is incomplete then return error
return "$incomplete"
Expand Down

0 comments on commit dadf1ad

Please sign in to comment.