Skip to content

Commit 9823f63

Browse files
committed
Merge branch 'remove-escape-hazard' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-remove-escape-hazard
Signed-off-by: Richard T Bonhomme <[email protected]>
2 parents c0c9a3b + 476a408 commit 9823f63

File tree

2 files changed

+1
-61
lines changed

2 files changed

+1
-61
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Easy-RSA 3 ChangeLog
22

33
3.2.0 (TBD)
44

5+
* Remove escape_hazard(), obsolete (ca76697)
56
* Remove command and function display_cn(), unused (be8f400) (#1114)
67
* Introduce Options to edit Request Subject during command 'sign-req'
78
Global Option: --new-subject -- Command 'sign-req' option: 'newsubj'

easyrsa3/easyrsa

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,63 +1014,6 @@ Temporary session not preserved."
10141014
exit 1
10151015
} # => cleanup()
10161016

1017-
# Escape hazardous characters
1018-
# Auto-escape hazardous characters:
1019-
# '&' - Workaround 'sed' behavior
1020-
# '$' - Workaround 'easyrsa' based limitation
1021-
# This is required for all SSL libs, otherwise,
1022-
# there are unacceptable differences in behavior
1023-
escape_hazard() {
1024-
if [ "$EASYRSA_FORCE_SAFE_SSL" ] || \
1025-
[ "$makesafeconf" ]
1026-
then
1027-
# Always run
1028-
verbose "escape_hazard: FORCED"
1029-
elif [ "$working_safe_org_conf" ]; then
1030-
# Has run once
1031-
verbose "escape_hazard: BYPASSED"
1032-
return
1033-
else
1034-
# Run once
1035-
verbose "escape_hazard: RUN-ONCE"
1036-
fi
1037-
1038-
# Only use if old 'sed' version is requested
1039-
if [ "$EASYRSA_LEGACY_SAFE_SSL" ]; then
1040-
: # ok
1041-
else
1042-
verbose "escape_hazard: REPLACED by heredoc expansion"
1043-
verbose "escape_hazard: ABANDONED"
1044-
return
1045-
fi
1046-
1047-
# Set run once
1048-
working_safe_org_conf=1
1049-
1050-
# Assign temp-file
1051-
escape_hazard_tmp=""
1052-
easyrsa_mktemp escape_hazard_tmp || die \
1053-
"escape_hazard - easyrsa_mktemp escape_hazard_tmp"
1054-
1055-
# write org fields to org temp-file and escape '&' and '$'
1056-
print "\
1057-
export EASYRSA_REQ_COUNTRY=\"$EASYRSA_REQ_COUNTRY\"
1058-
export EASYRSA_REQ_PROVINCE=\"$EASYRSA_REQ_PROVINCE\"
1059-
export EASYRSA_REQ_CITY=\"$EASYRSA_REQ_CITY\"
1060-
export EASYRSA_REQ_ORG=\"$EASYRSA_REQ_ORG\"
1061-
export EASYRSA_REQ_OU=\"$EASYRSA_REQ_OU\"
1062-
export EASYRSA_REQ_EMAIL=\"$EASYRSA_REQ_EMAIL\"
1063-
export EASYRSA_REQ_SERIAL=\"$EASYRSA_REQ_SERIAL\"\
1064-
" | sed -e s\`'\&'\`'\\\&'\`g \
1065-
-e s\`'\$'\`'\\\$'\`g \
1066-
> "$escape_hazard_tmp" || die "\
1067-
escape_hazard - Failed to write temp-file"
1068-
1069-
# Reload fields from fully escaped temp-file
1070-
source_vars "$escape_hazard_tmp"
1071-
verbose "escape_hazard: COMPLETED"
1072-
} # => escape_hazard()
1073-
10741017
# Replace environment variable names with current value
10751018
# and write to temp-file or return error from sed
10761019
expand_ssl_config() {
@@ -1188,10 +1131,6 @@ easyrsa_openssl() {
11881131
die "easyrsa_openssl: Illegal SSL command: rand"
11891132
esac
11901133

1191-
# Auto-escape hazardous characters
1192-
escape_hazard || \
1193-
die "easyrsa_openssl - escape_hazard failed"
1194-
11951134
# Rewrite SSL config
11961135
expand_ssl_config || \
11971136
die "easyrsa_openssl - expand_ssl_config failed"

0 commit comments

Comments
 (0)