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

Move SSL config file creation and/or expansion to write_easyrsa_ssl_cnf_tmp() #1154

Closed
wants to merge 4 commits into from

Conversation

TinCanTech
Copy link
Collaborator

No description provided.

This change moves the expansion of openssl-easyrsa.cnf to the
same code where the file is either found or created.

The high level requirements are:
* OpenSSL does not require exanding the SSL config file.
* LibreSSL requires expanding the SSL config file.
* EASYRSA_FORCE_SAFE_SSL forces expanding the SSL config file.

The specific requirements are:

1.
Expanding openssl-easyrsa.cnf MUST be done after EASYRSA_REQ_CN is set.
Thus, it cannot be done Globally, one time, at the start of execution.
This is required by commands: build-ca, gen-req and sign-req.

Change: Create the required OpenSSL:Unexpanded / LibreSSL:Expanded
SSL config file for the commands above, after setting EASYRSA_REQ_CN.

2.
check_serial_unique(): $check_serial (SSL command: ca) does not require
an SSL config file, the error message for it being 'missing' is ignored.

Change: check_serial_unique(), call $EASYRSA_OPENSSL directly.

3.
verify_file() does require openssl-easyrsa.cnf - Follow-up change.

Other changes are:
* verify_working_env(): Do not create openssl-easyrsa.cnf temp-file.
* Minor comments and verbose message improvements

Signed-off-by: Richard T Bonhomme <[email protected]>
@TinCanTech TinCanTech self-assigned this May 31, 2024
@TinCanTech TinCanTech added the development Possible changes label May 31, 2024
This guarantees that a working EasyRSA SSL config file exists and that
both $EASYRSA_SSL_CONF and $OPENSSL_CONF are set to that file.

If the initial file has been user, or by EasyRSA internally, edited
then that file is used, in place.

With these expanson rules applied:
This file will be OpenSSL:Un-expanded, LibreSSL:Expanded or expanded
by global option --force-safe-ssl or $EASYRSA_FORCE_SAFE_SSL.

If the file in place is absent or recognised by SHA256 hash then
it will be replaced by here-doc expansion, including SSL Lib expansion
as required.

The effected code here is verify_file(), which now calls $EASYRSA_OPENSSL
directly. Submitting to $OPENSSL_CONF place, or error.

Improve comments in the code.

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

@TinCanTech TinCanTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9966676 superseded-by: #1157

e95cda9: The commit message is missing some details..

@TinCanTech
Copy link
Collaborator Author

Superseded-by: #1163

@TinCanTech TinCanTech closed this Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Possible changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant