Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Subject alternative name extension must be marked critical if the "subject" field is empty #310

Open
howardjohn opened this issue Jan 17, 2025 · 0 comments · May be fixed by #311
Open

Subject alternative name extension must be marked critical if the "subject" field is empty #310

howardjohn opened this issue Jan 17, 2025 · 0 comments · May be fixed by #311

Comments

@howardjohn
Copy link

Per https://tools.ietf.org/html/rfc5280#section-4.1.2.6 :

If subject
naming information is present only in the subjectAltName extension
(e.g., a key bound only to an email address or URI), then the subject
name MUST be an empty sequence and the subjectAltName extension MUST
be critical.

However, currently rcgen hardcodes SANs as non-critical:

write_x509_extension(writer, oid::SUBJECT_ALT_NAME, false, |writer| {

It would be nice to have this either automatically detect empty subject and mark it as critical, or have a way to indicate the extension as critical.

If I understand right, the only way to do this currently would be with a custom extension which seems like a lot of work.

I am willing to work on a fix for this

howardjohn added a commit to howardjohn/rcgen that referenced this issue Jan 17, 2025
@howardjohn howardjohn linked a pull request Jan 17, 2025 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant