Skip to content

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

Open
@tijmenr

Description

@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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions