-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: invalid RDNSequence: invalid attribute value: unsupported string type: 4 #48371
Comments
This seems like a variation of #48171 cc @FiloSottile |
Hey @seankhliao - can you recall why this ticket was marked "Unplanned" whilst the other ticket #48171 was resolved ? |
The problem is the x509 https://github.com/golang/go/blob/e8d9561/src/crypto/x509/parser.go#L139-L142 However, this isn't the case. Looking at the spec:
So, assuming that the parser doesn't know what the correct ASN.1 type is for the current The reporter reported this for the ASN.1 type OCTET STRING (type 4), which is unusual to see in a X.509 Name. For example, OpenSSL and MbedTLS also don't support parsing an OCTET STRING as part of a Name (this should also be considered a bug in those libraries, I might add). However, both of them do support BITSTRING (type 3). So this certificate works perfectly fine with OpenSSL and MbedTLS, but not in Go:
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/lJBj4om1QJ7
What did you expect to see?
No error - with go 1.16.8, this works
What did you see instead?
x509: invalid RDNSequence: invalid attribute value: unsupported string type: 4
The text was updated successfully, but these errors were encountered: