]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: replace custom equal implementations with reflect.DeepEqual
authorFilippo Valsorda <filippo@golang.org>
Wed, 24 Oct 2018 17:16:04 +0000 (13:16 -0400)
committerFilippo Valsorda <filippo@golang.org>
Thu, 25 Oct 2018 19:07:36 +0000 (19:07 +0000)
commitf6b554fec75ff1a36c6204755db8c1f638255b64
treead4e0378bfedb3c3f1bd26ebb5d2699341f7e9b9
parenta7fb5e1bd2d655c275fdf513fe0ea7ea7517e675
crypto/tls: replace custom equal implementations with reflect.DeepEqual

The equal methods were only there for testing, and I remember regularly
getting them wrong while developing tls-tris. Replace them with simple
reflect.DeepEqual calls.

The only special thing that equal() would do is ignore the difference
between a nil and a zero-length slice. Fixed the Generate methods so
that they create the same value that unmarshal will decode. The
difference is not important: it wasn't tested, all checks are
"len(slice) > 0", and all cases in which presence matters are
accompanied by a boolean.

Change-Id: Iaabf56ea17c2406b5107c808c32f6c85b611aaa8
Reviewed-on: https://go-review.googlesource.com/c/144114
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
src/crypto/tls/handshake_messages.go
src/crypto/tls/handshake_messages_test.go
src/crypto/tls/ticket.go