]> Cypherpunks repositories - gostls13.git/commit
encoding/asn1: respect “explicit” and “tag” when unmarshaling RawValues.
authorAdam Langley <agl@golang.org>
Thu, 15 Dec 2016 23:02:03 +0000 (15:02 -0800)
committerAdam Langley <agl@golang.org>
Sat, 30 Sep 2017 17:01:26 +0000 (17:01 +0000)
commita82ee9c76d979f8ea713caa13023dcfd747b433a
treea64d17c38b6e292519534bfa716fcbccd4e04308
parentee4fbbc6211cd978f199dd26ab73ff72cc8d95fd
encoding/asn1: respect “explicit” and “tag” when unmarshaling RawValues.

Previously, any “explicit” and/or “tag” decorations on a RawValue would
be ignored when unmarshaling. The RawValue would swallow whatever
element was encountered.

This change causes these decorations to be respected. Thus a field like:
  Foo asn1.RawValue `asn1:"explicit,tag:1,optional"`
will only match if an explicit tag with value one is encountered.
Otherwise the RawValue will get the default value and parsing will move
onto the next element.

Thanks to Martin Kreichgauer for reporting the issue.

Change-Id: If6c4488685b9bd039cb5e352d6d75744f98dbb1f
Reviewed-on: https://go-review.googlesource.com/34503
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
src/encoding/asn1/asn1.go
src/encoding/asn1/asn1_test.go
src/encoding/asn1/common.go
src/encoding/asn1/marshal.go