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

encoding/asn1: Unmarshal rejects PrintableString containing ampersand #22970

Closed
christopher-henderson opened this issue Dec 1, 2017 · 2 comments
Closed
Assignees
Milestone

Comments

@christopher-henderson
Copy link
Contributor

@christopher-henderson christopher-henderson commented Dec 1, 2017

Ampersands are not technically allowed in an ASN.1 PrintableString. However, DigiCert has (recently)(for example) issued a number of intermediate certificates to Wells Fargo & Company (crt.sh).

A handful such CA certs include...

-----BEGIN CERTIFICATE-----
MIIEuDCCA6CgAwIBAgIQDn3kbM04dGYpYMWEN9lNFzANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
MjAeFw0xNzExMDIxMjI1MzJaFw0yNzExMDIxMjI1MzJaMHwxCzAJBgNVBAYTAlVT
MR4wHAYDVQQKExVXZWxscyBGYXJnbyAmIENvbXBhbnkxIzAhBgNVBAsTGk9yZ2Fu
aXphdGlvbiBWYWxpZGF0ZWQgVExTMSgwJgYDVQQDEx9XZWxscyBGYXJnbyBUTFMg
UHVibGljIFRydXN0IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
xSzZ8LuvWrH7dHSc4Ll91HkTMGimX77axiq5jgTZbfKekmQ85vJbwg/6/Z97qoF+
9r0HcY9NOJj/GJwR35z9F5OHog6+XRxL6rKpAJ1+QcCdAGszzE0viMSt3iSTtu17
5AHCNQvwtkYanMi0pECsKzytijqWbRHZkQsbNnvI3EEU7347B1zm7t8A4snb89du
1PGNFpYA1nlQAOUvndCisxpBvvKcZEk4LlDRpE+fmhYTHtHTEeuFuo/+3dQ+zjPS
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G9ay9CUxr8ol
-----END CERTIFICATE-----
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 1, 2017

Change https://golang.org/cl/81635 mentions this issue: encoding/asn1: allow '&' in PrintableString fields

@bradfitz bradfitz added this to the Go1.11 milestone Dec 2, 2017
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Dec 2, 2017

Leaving for @agl to decide.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.