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: Certificate Subject UID not being parsed #25667

Closed
taraspos opened this issue May 31, 2018 · 4 comments
Closed

crypto/x509: Certificate Subject UID not being parsed #25667

taraspos opened this issue May 31, 2018 · 4 comments
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@taraspos
Copy link

What version of Go are you using (go version)?

1.10.2

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"

What did you do?

Trying to get the UID from certificate attributes.

What did you expect to see?

pkix.Name object with the UID field in it.

What did you see instead?

OID for the UserID http://www.alvestrand.no/objectid/0.9.2342.19200300.100.1.1.html is not defined in the https://golang.org/src/crypto/x509/pkix/pkix.go, so it is not being parsed.

@adamdecaf
Copy link
Contributor

cc @FiloSottile

@bradfitz bradfitz added this to the Go1.12 milestone May 31, 2018
@bradfitz bradfitz changed the title x509 Certificate Subject UID not being parsed crypto/x509: Certificate Subject UID not being parsed May 31, 2018
@bradfitz bradfitz added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. FeatureRequest labels May 31, 2018
@odeke-em
Copy link
Member

odeke-em commented Jun 1, 2018

/cc @agl too

@FiloSottile
Copy link
Contributor

It should still be accessible unparsed in the Names field.

If you think we should add an entry to the struct for it, we'll need example certificates and the use cases of it. We intentionally only parse the most popular OIDs, and leave the rest to be parsed by applications in Names.

@FiloSottile FiloSottile modified the milestones: Go1.12, Unplanned Jun 1, 2018
@taraspos
Copy link
Author

taraspos commented Jun 1, 2018

Yeah, I was able to get it this way: https://stackoverflow.com/questions/39125873/golang-subject-dn-from-x509-cert/50640119#50640119, but thanks for your reply, it is simple to get it from Names field (I will update my SO reply with this approach).

I'm using this to get the UID from Apple Push Notifications Certificates since app bundle id is stored there. But I think reading it from Names field is enough for my use case and I can close this issue. Let's reopen if there is more demand for this field.

@taraspos taraspos closed this as completed Jun 1, 2018
@golang golang locked and limited conversation to collaborators Jun 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants