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

Export PKCS: Expand usage for incomplete PKI #991

Merged
merged 3 commits into from Jul 25, 2023

Conversation

TinCanTech
Copy link
Collaborator

The current export functions only allow use on a complete PKI, with CA.

This change allows the following:

  • Server - Export P12/P7 without client key
  • Client - Export P12/P7 without CA, P8/P1 without PKI

Due to the relative obscurity of the command options 'noca' and 'nokey', exporting P12/P7 with incorrect options can be adjusted on-the-fly with confirmation from the user.

Correct behaviour of export-p1 with OpenSSL v3 by using -legacy option. Otherwise, OpenSSL v3 outputs a PKCS#8 format file.

Minor improvements to comments.

The current export functions only allow use on a complete PKI, with CA.

This change allows the following:
* Server - Export P12/P7 without client key
* Client - Export P12/P7 without CA, P8/P1 without PKI

Due to the relative obscurity of the command options 'noca' and 'nokey',
exporting P12/P7 with incorrect options can be adjusted on-the-fly with
confirmation from the user.

Correct behaviour of export-p1 with OpenSSL v3 by using -legacy option.
Otherwise, OpenSSL v3 outputs a PKCS#8 format file.

Minor improvements to comments.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
Re-arranging the p12 command to follow the standard:
- In file
- out file

Followed by
- Conditional: -nokeys
- Unconditional: -inkey file

This is a reminder that '-inkey' is subordinate to '-nokeys' but
is ALWAYS required.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
@TinCanTech
Copy link
Collaborator Author

TinCanTech commented Jul 25, 2023

Note: The unit-test does exercise export-p12 foo nokey.

Option nokey was previously under suspicion.

@TinCanTech TinCanTech merged commit 0f5689f into OpenVPN:master Jul 25, 2023
3 checks passed
@TinCanTech
Copy link
Collaborator Author

The unit test now includes a test for export-p12 with and without a key.

Manually kicked off Test has also successfully completed.

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.

EasyRSA export-p1 behaviour is OpenSSL version dependent
1 participant