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

Introduce 'rewind-renew' - Recover "guineapig" renewed certificates #579

Merged
merged 3 commits into from May 22, 2022
Merged

Introduce 'rewind-renew' - Recover "guineapig" renewed certificates #579

merged 3 commits into from May 22, 2022

Conversation

TinCanTech
Copy link
Collaborator

The original version of EasyRSA command 'renew', leaves the certificate
without a method to be revoked.

This is due to 'renew' moving files OUT of the PKI, which means they cannot
be targeted by command 'revoke'.

Additionally, 'renew' renames the files to an unfriendly serial-number.

--

Command 'rewind-renew' restores the original commonName as file-name-base.
And moves these files to renewed folders which are targeted by 'revoke-renewed'.

Closes: #578 (Thoroughly tested)

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

The original version of EasyRSA command 'renew', leaves the certificate
without a method to be revoked.

This is due to 'renew' moving files OUT of the PKI, which means they cannot
be targeted by command 'revoke'.

Additionally, 'renew' renames the files to an unfriendly serial-number.

--

Command 'rewind-renew' restores the original commonName as file-name-base.
And moves these files to renewed folders which are targeted by 'revoke-renewed'.

Closes: #578 (Thoroughly tested)

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
@TinCanTech TinCanTech self-assigned this May 21, 2022
@TinCanTech TinCanTech added this to the v3.1.1 milestone May 21, 2022
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Use move not copy (copy was used in development).

Corrections to help and error messages.

Re-arrange "hand-off" 'case'; group renew functions together.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
@TinCanTech TinCanTech added the conflicts Conflicts with current label May 21, 2022
@TinCanTech TinCanTech merged commit 1fea2b5 into OpenVPN:master May 22, 2022
TinCanTech referenced this pull request Aug 20, 2022
When easyrsa "renews" a certificate, the current certificate is moved
to a sub-directory for renewed certificates and renamed to the serial
number of the certificate.

This makes it difficult to subsequently revoke the old certificate.

The new behaviour is for easyrsa to move the certificate without
renaming the file.  This means the certificate can be revoked by name.

Once a renewed certificate is revoked, it is moved to the 'revoked'
sub-directory, along with all other revoked certificates.

The same mechanism also manages keys, requests, PKCS and inline files.

Behaviour summary:

* revoke moves certificates to 'revoked' - Unchanged
  Rename the certificate to its serial number - Unchanged

* renew moves certificates to 'renewed' - Unchanged
  renew does not rename the certificate to its serial number - Changed

  Important:
  Only one certificate of a specific name (eg. john) can be renewed
  at the same time.
  To renew another certificate called 'john' the first MUST be revoked.

* revoke-renewed:
  takes the certificate from 'renewed' - Changed
  moves the certifiate to 'revoked' - Changed
  renames the certificate to its serial number - Unchanged

* All revoked certificates are moved to the 'revoked' sub-directory.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
@TinCanTech TinCanTech mentioned this pull request Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG-FIX conflicts Conflicts with current
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New renewal mechanism is not backward compatible
1 participant