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

Integrate Easy-RSA TLS-Key for use with 'init-pki soft' #1220

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

TinCanTech
Copy link
Collaborator

The primary use of 'init-pki soft' is to present a simple way to renew an expired CA Certificate. The method Easy-RSA uses is to create a new CA and sign old Requests.

Key(1): pki/private/easyrsa-tls.key - Singular Easy-RSA TLS key.
Key(2): pki/easyrsa-keepsafe-tls.key - Created by 'init-pki soft'.

The Easy-RSA TLS Key(1) in use is not changed by this method. Also, this TLS Key(1) is private data, therefore, it is not added to new inline files. This allows the new inline files to be easily distrubuted, without leaking security data.

All members of the VPN in use have a local copy of the TLS Key(1). This key(1) can either be added to the OpenVPN config file, using option '--tls-auth/--tls-crypt ', or be pasted into the inline file locally.

This patch integrates the Easy-RSA TLS Key into 'init-pki soft' by recreating the key(2) after the PKI has been reset. However, the key(2) is recreated by a different file-name, to ensure that it is not included with newly generated inline files.

After building a new CA, the TLS key(2) is copied to the original key(1). However, these TLS keys will be omitted from new inline files until the key(2), created by 'init-pki soft', is deleted.

All inline files that contain private keys are written to sub-dir 'pki/inline/private'. All inline files that do NOT contain any private keys are written to 'pki/inline'.

Also, minimise some 'case' statements and minor improvements.

The primary use of 'init-pki soft' is to present a simple way
to renew an expired CA Certificate. The method Easy-RSA uses
is to create a new CA and sign old Requests.

Key(1): pki/private/easyrsa-tls.key - Singular Easy-RSA TLS key.
Key(2): pki/easyrsa-keepsafe-tls.key - Created by 'init-pki soft'.

The Easy-RSA TLS Key(1) in use is not changed by this method.
Also, this TLS Key(1) is private data, therefore, it is not
added to new inline files. This allows the new inline files
to be easily distrubuted, without leaking security data.

All members of the VPN in use have a local copy of the TLS Key(1).
This key(1) can either be added to the OpenVPN config file, using
option '--tls-auth/--tls-crypt <key-file>', or be pasted into
the inline file locally.

This patch integrates the Easy-RSA TLS Key into 'init-pki soft'
by recreating the key(2) after the PKI has been reset. However,
the key(2) is recreated by a different file-name, to ensure that
it is not included with newly generated inline files.

After building a new CA, the TLS key(2) is copied to the original
key(1). However, these TLS keys will be omitted from new inline
files until the key(2), created by 'init-pki soft', is deleted.

All inline files that contain private keys are written to sub-dir
'pki/inline/private'. All inline files that do NOT contain any
private keys are written to 'pki/inline'.

Also, minimise some 'case' statements and minor improvements.

Signed-off-by: Richard T Bonhomme <[email protected]>
@TinCanTech TinCanTech self-assigned this Aug 30, 2024
@TinCanTech TinCanTech added enhancement development Possible changes ChangeLog Item easyrsa-tools.lib Version 3.2.1-Release renew I cannot go back; No. But if you could, would you really want to? labels Aug 30, 2024
@TinCanTech TinCanTech added this to the v3.2.1 milestone Aug 30, 2024
@TinCanTech TinCanTech linked an issue Aug 30, 2024 that may be closed by this pull request
Remove checks that an SSL Config file exists, after completion of
write_easyrsa_ssl_cnf_tmp()

Change warnings to fatal errors, when checking SSL Config file hash.

Signed-off-by: Richard T Bonhomme <[email protected]>
@TinCanTech TinCanTech merged commit 445a61e into OpenVPN:master Sep 2, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangeLog Item development Possible changes easyrsa-tools.lib enhancement renew I cannot go back; No. But if you could, would you really want to? Version 3.2.1-Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renew CA
1 participant