Skip to content

Commit

Permalink
Merge branch 'pillarsdotnet-v3.0.4' into v3.0.4
Browse files Browse the repository at this point in the history
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
  • Loading branch information
ecrist committed Jan 3, 2018
2 parents 0933b89 + 482b3e7 commit 5eb5eec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
7 changes: 4 additions & 3 deletions ChangeLog
@@ -1,12 +1,13 @@
Easy-RSA 3 ChangeLog

3.0.x (TBD)
3.0.4 (TBD)
* Remove use of egrep (#154)
* Integrate with Travis-CI (#165)
* Remove "local" from variable assignment (#165)
* Other changes related to Travis-CI fixes
* Assign values (even empty ones) to variables defined previously with
"local"
* Assign values to variables defined previously w/local
* Finally(?) fix the subjectAltName issues I presented earlier (really
fixes #168

3.0.3 (2017-08-22)
* Include mktemp windows binary
Expand Down
22 changes: 13 additions & 9 deletions easyrsa3/easyrsa
Expand Up @@ -279,7 +279,7 @@ Type the word '$value' to continue, or any other input to abort."

# remove temp files
clean_temp() {
for f in "$EASYRSA_TEMP_FILE" "$EASYRSA_TEMP_FILE_2" "$EASYRSA_TEMP_FILE_3"
for f in "$EASYRSA_TEMP_CONF" "$EASYRSA_TEMP_EXT" "$EASYRSA_TEMP_FILE_2" "$EASYRSA_TEMP_FILE_3"
do [ -f "$f" ] && rm "$f" 2>/dev/null
done
} # => clean_temp()
Expand Down Expand Up @@ -546,10 +546,10 @@ $EASYRSA_EXTRA_EXTS"
}'
print "$extra_exts" | \
awk "$awkscript" "$EASYRSA_SSL_CONF" \
> "$EASYRSA_TEMP_FILE" \
> "$EASYRSA_TEMP_CONF" \
|| die "Copying SSL config to temp file failed"
# Use this new SSL config for the rest of this function
EASYRSA_SSL_CONF="$EASYRSA_TEMP_FILE"
EASYRSA_SSL_CONF="$EASYRSA_TEMP_CONF"
fi

key_out_tmp="$(mktemp "$key_out.XXXXXXXXXX")"; EASYRSA_TEMP_FILE_2="$key_out_tmp"
Expand Down Expand Up @@ -652,24 +652,26 @@ $(display_dn req "$req_in")

# If type is server and no subjectAltName was requested,
# add one to the extensions file
if [ "$crt_type" = 'server' ]; then
if [ "$crt_type" = 'server' ];
then
sname=$(basename $req_in | cut -d. -f1)
echo "$EASYRSA_EXTRA_EXTS" |
grep -q subjectAltName ||
print "default_server_san $req_in"
default_server_san $req_in
fi

# Add any advanced extensions supplied by env-var:
[ -n "$EASYRSA_EXTRA_EXTS" ] && print "$EASYRSA_EXTRA_EXTS"

: # needed to keep die from inherting the above test
} > "$EASYRSA_TEMP_FILE" || die "\
} > "$EASYRSA_TEMP_EXT" || die "\
Failed to create temp extension file (bad permissions?) at:
$EASYRSA_TEMP_FILE"
$EASYRSA_TEMP_EXT"

# sign request
crt_out_tmp="$(mktemp "$crt_out.XXXXXXXXXX")"; EASYRSA_TEMP_FILE_2="$crt_out_tmp"
"$EASYRSA_OPENSSL" ca -utf8 -in "$req_in" -out "$crt_out_tmp" -config "$EASYRSA_SSL_CONF" \
-extfile "$EASYRSA_TEMP_FILE" -days $EASYRSA_CERT_EXPIRE -batch $opts \
-extfile "$EASYRSA_TEMP_EXT" -days $EASYRSA_CERT_EXPIRE -batch $opts \
|| die "signing failed (openssl output above may have more detail)"
mv "$crt_out_tmp" "$crt_out"; EASYRSA_TEMP_FILE_2=
notice "\
Expand Down Expand Up @@ -1077,7 +1079,8 @@ Note: using Easy-RSA configuration from: $vars"
set_var EASYRSA_CRL_DAYS 180
set_var EASYRSA_NS_SUPPORT no
set_var EASYRSA_NS_COMMENT "Easy-RSA Generated Certificate"
set_var EASYRSA_TEMP_FILE "$EASYRSA_PKI/extensions.temp"
set_var EASYRSA_TEMP_CONF "$EASYRSA_PKI/openssl-easyrsa.temp"
set_var EASYRSA_TEMP_EXT "$EASYRSA_PKI/extensions.temp"
set_var EASYRSA_TEMP_FILE_2 ""
set_var EASYRSA_TEMP_FILE_3 ""
set_var EASYRSA_REQ_CN ChangeMe
Expand Down Expand Up @@ -1185,6 +1188,7 @@ while :; do
--vars)
export EASYRSA_VARS_FILE="$val" ;;
--copy-ext)
empty_ok=1
export EASYRSA_CP_EXT=1 ;;
--subject-alt-name)
export EASYRSA_EXTRA_EXTS="\
Expand Down

0 comments on commit 5eb5eec

Please sign in to comment.