This fell through the cracks from the CL 229917 comments.
Change-Id: I22584107f1e8111f9c523f45307dd50e1e5f4b8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/268339
Trust: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
if s == nil {
return false
}
- candidates := s.byName[string(cert.RawSubject)]
- for _, i := range candidates {
- c, err := s.cert(i)
- if err != nil {
- return false
- }
- if c.Equal(cert) {
- return true
- }
- }
-
- return false
+ return s.haveSum[sha256.Sum224(cert.Raw)]
}
// AddCert adds a certificate to a pool.