]> Cypherpunks repositories - gostls13.git/commit
encoding/asn1: be stricter by reserialising parsed times.
authorAdam Langley <agl@golang.org>
Sun, 14 Jun 2015 17:48:13 +0000 (10:48 -0700)
committerRuss Cox <rsc@golang.org>
Mon, 29 Jun 2015 02:50:41 +0000 (02:50 +0000)
commitfdd921c9f40f75843838d8f0218106cf078810ed
tree14bb698b6892ff9cb26b08e8c8146e18c019d7c8
parent85d4d46f3cefceb87924ad1b0acec9f753413736
encoding/asn1: be stricter by reserialising parsed times.

The time package does normalisation of times: for example day zero is
converted to the last day of the previous month and the 31st of February
is moved into March etc. This makes the ASN.1 parsing a little
worryingly lax.

This change causes the parser to reserialise parsed times to ensure that
they round-trip correctly and thus were not normalised.

Fixes #11134.

Change-Id: I3988bb95153a7b33d64ab861fbe51b1a34a359e9
Reviewed-on: https://go-review.googlesource.com/11094
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/encoding/asn1/asn1.go
src/encoding/asn1/asn1_test.go