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

X509 Subject name parsing incorrect if attribute value is a single character #95

Open
tijmenr opened this issue Dec 9, 2024 · 0 comments

Comments

@tijmenr
Copy link

tijmenr commented Dec 9, 2024

@peculiar/x509 version: 1.12.3

The parsing of X509 subject names in Name.fromString does not correctly handle attribute values with length 1:

> import { Name } from '@peculiar/x509';

> new Name('CN=t,OU=x,O=y').toJSON()
[ { CN: [ 't,OU=x' ] }, { O: [ '' ] } ]

> new Name('CN=t,OU=x,O=y,C=z').toJSON()
[ { CN: [ 't,OU=x' ] }, { O: [ 'y,C=z' ] } ]

This results for example in incorrect information in CSRs generated by Pkcs10CertificateRequestGenerator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant