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

Auto-escape '&' and '$' in 'org' mode fields - Other minor tweaks #590

Merged
merged 2 commits into from
Jun 3, 2022
Merged

Auto-escape '&' and '$' in 'org' mode fields - Other minor tweaks #590

merged 2 commits into from
Jun 3, 2022

Conversation

TinCanTech
Copy link
Collaborator

@TinCanTech TinCanTech commented Jun 3, 2022

Auto-escape '&' ampersand explanation:
'easyrsa' uses 'sed' to build a safe SSL config file, which means
that an unescaped '&' ampersand cannot be used in the 'vars' file.
This is due to 'sed' treating '&' as a special character.

Rather than expect users to know all this and use extended escaping,
to get around 'easyrsa' set_var(), use auto-escape. This allows use
of unescaped '&' in vars file. Like any other character.

Auto-escape '$' dollar-sign explanation:
Using '$' in the 'vars' file MUST be escaped. Escaping '$' to stop
expansion is common knowledge and the first thing a user will try.
Using an escaped '$' in the 'vars' file results in an unescaped '$'
being written to the SSL config file, which is then expanded by
OpenSSL or choked on by LibreSSL. Auto-escaping '$' fixes this.

Add SSL library name to die().

Allow verify_ssl_lib() to run ONLY once.

Improve comments.

Re-order the areas searched for data files to prioritise preferred
locations over old defaults.

Tested-with: OpenSSL and LibreSSL and on Windows and FreeBSD.

Signed-off-by: Richard T Bonhomme tincantech@protonmail.com

Auto-escape '&' ampersand explanation:
'easyrsa' uses 'sed' to build a safe SSL config file, which means
that an unescaped '&' ampersand cannot be used in the 'vars' file.
This is due to 'sed' treating '&' as a special character.

Rather than expect users to know all this and use extended escaping,
to get around 'easyrsa' set_var(), use auto-escape. This allows use
of unescaped '&' in vars file. Like any other character.

Auto-escape '$' dollar-sign explanation:
Using '$' in the 'vars' file MUST be escaped. Escaping '$' to stop
expansion is common knowledge and the first thing a user will try.
Using an escaped '$' in the 'vars' file results in an unescaped '$'
being written to the SSL config file, which is then expanded by
OpenSSL or choked on by LibreSSL. Auto-escaping '$' fixes this.

Add SSL library name to die().

Allow verify_ssl_lib() to run ONLY once.

Improve comments.

Re-order the areas searched for data files to prioritise preferred
locations over old defaults.

Tested-with: OpenSSL and LibreSSL and on Windows and FreeBSD.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
@TinCanTech TinCanTech self-assigned this Jun 3, 2022
@TinCanTech TinCanTech added this to the v3.1.1 milestone Jun 3, 2022
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
@TinCanTech TinCanTech merged commit 64828d2 into OpenVPN:master Jun 3, 2022
@TinCanTech
Copy link
Collaborator Author

Linking: #587 #364

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant