]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: consolidate signatures handling in SKE and CV
authorPeter Wu <pwu@cloudflare.com>
Wed, 22 Nov 2017 18:25:20 +0000 (18:25 +0000)
committerFilippo Valsorda <filippo@golang.org>
Wed, 20 Jun 2018 17:15:50 +0000 (17:15 +0000)
commitc89d75f981a64a3c87abb13d62cb44a0b55389e0
treec0bd4e7c7c088eee2fb5e1c0751fcd84ad1baba4
parent3ca5b7c5b21574da0b29ea1d2d53ffce8711d225
crypto/tls: consolidate signatures handling in SKE and CV

ServerKeyExchange and CertificateVerify can share the same logic for
picking a signature algorithm (based on the certificate public key and
advertised algorithms), selecting a hash algorithm (depending on TLS
version) and signature verification.

Refactor the code to achieve code reuse, have common error checking
(especially for intersecting supported signature algorithms) and to
prepare for addition of new signature algorithms. Code should be easier
to read since version-dependent logic is concentrated at one place.

Change-Id: I978dec3815d28e33c3cfbc85f0c704b1894c25a3
Reviewed-on: https://go-review.googlesource.com/79735
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/crypto/tls/auth.go [new file with mode: 0644]
src/crypto/tls/auth_test.go [new file with mode: 0644]
src/crypto/tls/handshake_client.go
src/crypto/tls/handshake_server.go
src/crypto/tls/key_agreement.go
src/crypto/tls/prf.go