Skip to content

crypto/x509/pkix: reorder Name.String to reduce visual noise [freeze exception] #39924

Closed
@FiloSottile

Description

@FiloSottile

In Go 1.15 we fixed a bug in Name.String that would hide any non-standard attributes from the output.

Unfortunately, we are bound to the RFC 2253 format by the docs (#27401) and that format requires any non-standard attribute to be printed as a dotted OID and hex-encoded value (#33093). To reduce the disruption of these entries appearing in the output, we could put them at the end of the string so the human-readable part is at the beginning.

RFC 2253 lets us pick any order we like.

When converting from an ASN.1 RelativeDistinguishedName to a string, the output consists of the string encodings of each AttributeTypeAndValue (according to 2.3), in any order.

I'd like to ask for a freeze exception, as this is a small change based on feedback on the beta to reduce the disruption of a Go 1.15 change. /cc @rsc @golang/osp-team

Example

RFC 4514

C = US, ST = CO, L = Boulder, O = Acme, OU = Eng, CN = eng.acme.com, emailAddress = [email protected]

Go 1.14

CN=eng.acme.com,OU=Eng,O=Acme,L=Boulder,ST=CO,C=US

Go 1.15 (now)

1.2.840.113549.1.9.1=#0c0c656e674061636d652e636f6d,CN=eng.acme.com,OU=Eng,O=Acme,L=Boulder,ST=CO,C=US

Go 1.15 (proposed)

CN=eng.acme.com,OU=Eng,O=Acme,L=Boulder,ST=CO,C=US,1.2.840.113549.1.9.1=#0c0c656e674061636d652e636f6d

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions