-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: error when unmarshalling SEQUENCE OF SET #27426
Comments
I'm encountering a similar issue. |
Change https://golang.org/cl/160819 mentions this issue: |
Reverted as it caused crypto/tls failures. You can try again when the Go 1.15 dev tree opens in Feb. |
@bradfitz How do I use the Go 1.15 dev build to see if this issue is fixed or not? I'm facing a similar problem when I'm trying to read a certificate using tls.loadx509keypair. |
@shefalikamal For my scenario, I was the one who was generating the self signed certificate using a dotnet core executable. On removing the following lines of code from the certificate I was generating //certificateGenerator.AddExtension(X509Extensions.ExtendedKeyUsage.Id, false, So I did work around the issue but I'm still unsure as to what the exact problem was! :( |
This is an interesting one,
The confusing part here is what This behavior is currently relied on, e.g. for the previously mentioned In order to support SEQUENCE of SET it seems like the approach suggested in CL 160819 is appropriate. The failures that change caused seem mainly due to existing usage of the SET suffix in The only other solution to this problem that I can think of is to add a new |
What version of Go are you using (
go version
)?go1.11 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
play link:
https://play.golang.org/p/V-za5Cu1wkr
What did you expect to see?
SEQUENCE OF SET should be properly unmarshalled into a slice of structs. Documentation says that SET can be unmarshalled into a struct. So I believe a SEQUENCE OF SET is expected to be properly unmarshalled into a slice of structs.
What did you see instead?
asn1: structure error: sequence tag mismatch.
The problem might be in getUniversalTag function when it is called from
parseSequenceOf
. E.g.When struct is an element of slice there is no possibility to tag a struct as a SET (17) , it's always tagged as a SEQUENCE (16).
The text was updated successfully, but these errors were encountered: