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

PKI: T6259: Support RFC822 names in certificate generation #3345

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

Embezzle
Copy link
Contributor

Change Summary

Add the ability to specific RFC822 (email) names as Subject Alternative Names in x509 certificates generated via the PKI system.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T6259

Related PR(s)

Component(s) name

PKI

Proposed changes

How to test

  1. Generate a new certificate using the PKI system that contains an RFC822 SAN:
vyos@vyos:~$ generate pki certificate self-signed file test-t6259
Enter private key type: [rsa, dsa, ec] (Default: rsa) rsa
Enter private key bits: (Default: 2048) 2048
Enter country code: (Default: GB) GB
Enter state: (Default: Some-State) Some-State
Enter locality: (Default: Some-City) Some-City
Enter organization name: (Default: VyOS) VyOS
Enter common name: (Default: vyos.io) vyos.net
Do you want to configure Subject Alternative Names? [y/N] y
Enter alternative names in a comma separate list, example: ipv4:1.1.1.1,ipv6:fe80::1,dns:vyos.net,rfc822:user@vyos.net
Enter Subject Alternative Names: dns:vyos.net,rfc822:exampleuser@vyos.net
Enter how many days certificate will be valid: (Default: 365) 365
Enter certificate type: (client, server) (Default: server) server
Note: If you plan to use the generated key on this router, do not encrypt the private key.
Do you want to encrypt the private key with a passphrase? [y/N] n
File written to /config/auth/test-t6259.pem
File written to /config/auth/test-t6259.key
  1. Validate that the SAN extension contains the requested names:
vyos@vyos:~$ openssl x509 -inform pem -noout -text -in "/config/auth/test-t6259.pem" | grep "Subject Alternative Name" -A 1
            X509v3 Subject Alternative Name:
                DNS:vyos.net, email:exampleuser@vyos.net

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team April 22, 2024 21:17
@c-po
Copy link
Member

c-po commented Apr 23, 2024

Please give the documentation an update, too. Other then that LGTM

@dmbaturin dmbaturin merged commit a63e934 into vyos:current Apr 24, 2024
9 checks passed
@Embezzle Embezzle deleted the T6259 branch April 24, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants