]> Cypherpunks.ru repositories - gostls13.git/commit
crypto/tls: don't modify Config.Certificates in BuildNameToCertificate
authorFilippo Valsorda <filippo@golang.org>
Mon, 12 Nov 2018 21:04:07 +0000 (16:04 -0500)
committerFilippo Valsorda <filippo@golang.org>
Mon, 12 Nov 2018 23:25:21 +0000 (23:25 +0000)
commit70e3b1df4a5d5b91f6c0e7bd4f7879d6ae95fc12
tree11d20973482735a9b095e34fd121a0242bd39c17
parent595bc63e8fb9636bb89c0cff3f879467d3c06988
crypto/tls: don't modify Config.Certificates in BuildNameToCertificate

The Config does not own the memory pointed to by the Certificate slice.
Instead, opportunistically use Certificate.Leaf and let the application
set it if it desires the performance gain.

This is a partial rollback of CL 107627. See the linked issue for the
full explanation.

Fixes #28744

Change-Id: I33ce9e6712e3f87939d9d0932a06d24e48ba4567
Reviewed-on: https://go-review.googlesource.com/c/149098
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/crypto/tls/common.go
src/crypto/tls/tls_test.go