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

easyrsa_openssl: Replace variable 'has_config' with OPENSSL_CONF #987

Merged
merged 3 commits into from
Jul 19, 2023

Conversation

TinCanTech
Copy link
Collaborator

Variable 'has_config' was a way to minimize the need to fully expand the SSL config file (ENV:OPENSSL_CONF) for use by LibreSSL. IE. Only expand the SSL config file when the SSL command requires a config file.

LibreSSL Always requires the config file to be expanded, even when it is Not used.

OpenSSL Never requires the config file to be expanded.

Changes follow.

The first part:

  • Disable expanding the SSL config file for OpenSSL.
  • Require expanding the SSL config file for LibreSSL.

LibreSSL will use the run-once mechanism to expand the SSL config file.

The second part:
Replace the use of SSL option '-config', by Always configuring the SSL environment variable OPENSSL_CONF to point to the Easy-RSA generated config file. This is supported by LibreSSL and OpenSSL.

Variable 'has_config' was a way to minimize the need to fully expand the
SSL config file (ENV:OPENSSL_CONF) for use by LibreSSL. IE. Only expand
the SSL config file when the SSL command requires a config file.

LibreSSL Always requires the config file to be expanded, even when it
is Not used.

OpenSSL Never requires the config file to be expanded.

Changes follow.

The first part:
* Disable expanding the SSL config file for OpenSSL.
* Require expanding the SSL config file for LibreSSL.

LibreSSL will use the run-once mechanism to expand the SSL config file.

The second part:
Replace the use of SSL option '-config', by Always configuring the SSL
environment variable OPENSSL_CONF to point to the Easy-RSA generated
config file. This is supported by LibreSSL and OpenSSL.

Signed-off-by: Richard T Bonhomme <[email protected]>
@TinCanTech
Copy link
Collaborator Author

This could be a mainframe glitch but that test just shaved off over three seconds of the Linux test. And changed the Windows test from ~2mins to ~1min. Local testing showed a possible minuscule improvement, so maybe this has improved efficiency ..

LibreSSL use remains the same, which is expected.

@TinCanTech
Copy link
Collaborator Author

This change looks very invasive. Looks can be deceptive..

All this change does is to allow OpenSSL to use the Easy-RSA generated SSL config file, commonly known as OPENSSL_CONF, as-is, un-expanded.

LibreSSL use will continue to expand the SSL config file.

And the SSL config file is ALWAYS configured via OPENSSL_CONF.

@TinCanTech TinCanTech added this to the v3.1.6 milestone Jul 19, 2023
@TinCanTech TinCanTech linked an issue Jul 19, 2023 that may be closed by this pull request
@TinCanTech
Copy link
Collaborator Author

I must thank the original author of easyrsa_openssl().

Luiz, many thanks.

This applies to all direct calls using EASYRSA_OPENSSL (Default: 'openssl'),
which bypass using easyrsa_openssl() wrapper function.

Signed-off-by: Richard T Bonhomme <[email protected]>
@TinCanTech TinCanTech merged commit 135d3da into OpenVPN:master Jul 19, 2023
3 checks passed
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.

Only LibreSSL requires a safe SSL config file
1 participant