Skip to content

fix(x509): mark dirNameTag as constructed in parseNameConstraintsExtension#54

Merged
hdm merged 1 commit intomainfrom
bug/nameConstraints-dirName
Oct 21, 2025
Merged

fix(x509): mark dirNameTag as constructed in parseNameConstraintsExtension#54
hdm merged 1 commit intomainfrom
bug/nameConstraints-dirName

Conversation

@MichaelWaters001
Copy link
Contributor

@MichaelWaters001 MichaelWaters001 commented Oct 21, 2025

Issue:
Fails to parse the dirName from a valid cert with a name constraint.

Testing:
created a valid cert with openssl v3.5.2
config something like this

nameConstraints = critical, \
    excluded;DNS:bad.example.com, \
    excluded;email:bad@example.com, \
    excluded;URI:.bad.example.com, \
    excluded;IP:192.168.1.0/255.255.255.255, \
    excluded;dirName:excluded_dn

[ excluded_dn ]
C=US
O=AllowedOrg

gen the cert
openssl req -x509 -new -key ca.key -days 365 -out ca.crt -config openssl_ca.cnf -extensions v3_ca

Parse the resulting cert text with excrypto inspecting the structure.
Parsing this cert previously hit the default unhandled case, this fix adjusts the case to 0xA4 and now properly parses the dirName.

@MichaelWaters001 MichaelWaters001 self-assigned this Oct 21, 2025
@MichaelWaters001 MichaelWaters001 added bug Something isn't working go Pull requests that update go code labels Oct 21, 2025
@hdm hdm merged commit 5c2b17f into main Oct 21, 2025
@hdm hdm deleted the bug/nameConstraints-dirName branch October 21, 2025 16:29
hdm pushed a commit that referenced this pull request Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants