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

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

Closed
FiloSottile opened this issue Jun 29, 2020 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@FiloSottile
Copy link
Contributor

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 = eng@acme.com

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

@FiloSottile FiloSottile added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. release-blocker labels Jun 29, 2020
@FiloSottile FiloSottile added this to the Go1.15 milestone Jun 29, 2020
@FiloSottile FiloSottile changed the title crypto/x509/pkix: reorder Name.String to reduce visual noise (freeze exception) crypto/x509/pkix: reorder Name.String to reduce visual noise [freeze exception] Jun 30, 2020
@andybons
Copy link
Member

Sounds good to me. Approved.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Jun 30, 2020
@gopherbot
Copy link

Change https://golang.org/cl/240543 mentions this issue: crypto/x509/pkix: print non-standard parsed Names at the end

@golang golang locked and limited conversation to collaborators Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants