]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: allow nil Certificates to be compared in Equal
authorempijei <RobClap8@gmail.com>
Tue, 12 Mar 2019 19:35:35 +0000 (20:35 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 28 Aug 2019 17:13:49 +0000 (17:13 +0000)
commit89865f8ba64ccb27f439cce6daaa37c9aa38f351
treefa5933028b8af7c40e80186092b3176bfa5705f5
parent84198445d4d7d264dc3e1b66194d378b590aaee0
crypto/x509: allow nil Certificates to be compared in Equal

The current implementation panics on nil certificates,
so introduce a nil check and early return true if both
are nil, false if only one is.

Fixes #28743

Change-Id: I71b0dee3e505d3ad562a4470ccc22c3a2579bc52
Reviewed-on: https://go-review.googlesource.com/c/go/+/167118
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
src/crypto/x509/x509.go
src/crypto/x509/x509_test.go