Commit b2b0992b authored by Than McIntosh's avatar Than McIntosh Committed by Brad Fitzpatrick

Revert "encoding/asn1: fix unmarshalling SEQUENCE OF SET"

This reverts CL 160819 (commit 4692343c)

Reason for revert: causing lots of failures on master

Change-Id: I96fd39ae80fe350ba8b3aa310443d41daec38093
Reviewed-on: https://go-review.googlesource.com/c/go/+/206146Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent cb47edc0
...@@ -1129,22 +1129,3 @@ func TestBMPString(t *testing.T) { ...@@ -1129,22 +1129,3 @@ func TestBMPString(t *testing.T) {
} }
} }
} }
func TestSequenceOfSet(t *testing.T) {
type someSetSET struct {
A int `asn1:"tag:0"`
}
type someStruct struct {
B int `asn1:"tag:0"`
C []someSetSET `asn1:"tag:1"`
}
der := []byte{0x30, 0x0F, 0x80, 0x01, 0x01, 0xA1, 0x0A, 0x31, 0x03, 0x80, 0x01, 0x01, 0x31, 0x03, 0x80, 0x01, 0x02}
var b someStruct
if _, err := Unmarshal(der, &b); err != nil {
t.Errorf("Unmarshal failed: %v", err)
}
}
...@@ -167,9 +167,6 @@ func getUniversalType(t reflect.Type) (matchAny bool, tagNumber int, isCompound, ...@@ -167,9 +167,6 @@ func getUniversalType(t reflect.Type) (matchAny bool, tagNumber int, isCompound,
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return false, TagInteger, false, true return false, TagInteger, false, true
case reflect.Struct: case reflect.Struct:
if strings.HasSuffix(t.Name(), "SET") {
return false, TagSet, true, true
}
return false, TagSequence, true, true return false, TagSequence, true, true
case reflect.Slice: case reflect.Slice:
if t.Elem().Kind() == reflect.Uint8 { if t.Elem().Kind() == reflect.Uint8 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment