]> Cypherpunks repositories - gostls13.git/commit
encoding/asn1: fix explicitly tagged Times.
authorAdam Langley <agl@golang.org>
Fri, 10 Oct 2014 00:37:40 +0000 (17:37 -0700)
committerAdam Langley <agl@golang.org>
Fri, 10 Oct 2014 00:37:40 +0000 (17:37 -0700)
commit1fd042c9aa84cc20f02974c69202df919cf1ff00
tree9687bf0d0fadf33979997f866bfce7ec34b8c4e8
parenteeb2211a5b88ae0774fbfd5bccc1de329e7663f7
encoding/asn1: fix explicitly tagged Times.

https://golang.org/cl/153770043/ tried to fix the case where a
implicitly tagged Time, that happened to have the same tag as
GENERALIZEDTIME, shouldn't be parsed as a GENERALIZEDTIME.

It did so, mistakenly, by testing whether params.tag != nil. But
explicitly tagged values also have a non-nil tag and there the inner
tag actually does encode the type of the value.

This change instead tests whether the tag class is UNIVERSAL before
assuming that the tag contains type information.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/152380044
src/encoding/asn1/asn1.go
src/encoding/asn1/asn1_test.go