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

Rename 'renew' to 'rebuild' - Introduce 'renew' version 3 #688

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

TinCanTech
Copy link
Collaborator

The old 'renew' always created a new private key at the CA signing side.
This forces the entity private key to be exposed, unnecessarily.

Only certificates expire, therefore, only certificates can be renewed.

For those reasons, the old 'renew' has been renamed to 'rebuild'.

The new 'renew' creates a new certificate only from the existing CSR.
The existing CSR will always exist, allowing a certificate to be renewed
indefinitely.

Both 'rebuild' and 'renew' use the renewed/ folders to temporarily store
the old certificate, where it can be revoked with 'revoke-renewed' command.

Manually tested.

Closes: #684

Notes:

  • renew version 1 did not have a command to revoke old certificates.
  • renew version 2 allowed old certificates to be revoked via command
    'revoke-renewed'.
  • renew version 3 only renews the certificate.

Signed-off-by: Richard T Bonhomme [email protected]

The old 'renew' always created a new private key at the CA signing side.
This forces the entity private key to be exposed, unnecessarily.

Only certificates expire, therefore, only certificates can be renewed.

For those reasons, the old 'renew' has been renamed to 'rebuild'.

The new 'renew' creates a new certificate only from the existing CSR.
The existing CSR will always exist, allowing a certificate to be renewed
indefinitely.

Both 'rebuild' and 'renew' use the renewed/ folders to temporarily store
the old certificate, where it can be revoked with 'revoke-renewed' command.

Manually tested.

Closes: OpenVPN#684

Notes:
* renew version 1 did not have a command to revoke old certificates.
* renew version 2 allowed old certificates to be revoked via command
  'revoke-renewed'.
* renew version 3 only renews the certificate.

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

The renew() backend still has the second major problem the (renamed) rebuild() backend has: lack of generic certificate type support - only server / client / serverClient types are currently supported.

I suggest that renew() should be renamed something like renew_as() and take an additional mandatory argument of crt_type.
The renew() would then be a new function that attempts to guess the cert type and calls renew_as() with that x509-type or error out and inform the user of the x509-types that matched (or all of them if none matched). It would also direct the user to rerun easyrsa as easyrsa renew-as [crt_type] given_basename

else
san="$(
easyrsa_openssl x509 -in "$crt_in" -noout -text | sed -n \
"/X509v3 Subject Alternative Name:/{n;s/IP Address:/IP:/g;s/ //g;p;}"
Copy link

@dekeonus dekeonus Sep 17, 2022

Choose a reason for hiding this comment

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

this (and the same in renew() above) should be updated to include the 's/RegisteredID/RID/;' sed substitution as seen in display_san()

Copy link
Collaborator Author

@TinCanTech TinCanTech Sep 21, 2022

Choose a reason for hiding this comment

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

Resolved: lack of generic certificate type support via #694

include the 's/RegisteredID/RID will require a new issue.

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.

Replace renew
2 participants