]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: return correct hash function when using client certificates in handshake
authorJoël Stemmer <stemmertech@gmail.com>
Fri, 6 Mar 2015 13:08:55 +0000 (14:08 +0100)
committerAdam Langley <agl@golang.org>
Mon, 16 Mar 2015 23:38:51 +0000 (23:38 +0000)
commitebe3d693d472f69cb68d945466eac0f770abf29b
treef15685ae306bf2d7644711fcd9d351e9ce95ad43
parent0a048ce5e9b599912872c4d8865e8f5beceb04ff
crypto/tls: return correct hash function when using client certificates in handshake

Commit f1d669aee994b28e1afcfe974680565932d25b70 added support for
AES_256_GCM_SHA384 cipher suites as specified in RFC5289. However, it
did not take the arbitrary hash function into account in the TLS client
handshake when using client certificates.

The hashForClientCertificate method always returned SHA256 as its
hashing function, even if it actually used a different one to calculate
its digest. Setting up the connection would eventually fail with the
error "tls: failed to sign handshake with client certificate:
crypto/rsa: input must be hashed message".

Included is an additional test for this specific situation that uses the
SHA384 hash.

Fixes #9808

Change-Id: Iccbf4ab225633471ef897907c208ad31f92855a3
Reviewed-on: https://go-review.googlesource.com/7040
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
src/crypto/tls/common.go
src/crypto/tls/handshake_client_test.go
src/crypto/tls/prf.go
src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384 [new file with mode: 0644]