Fix weak digest in TLS 1.2 with SNI.
authorDavid Benjamin <davidben@google.com>
Mon, 23 Oct 2017 23:13:05 +0000 (19:13 -0400)
committerMatt Caswell <matt@openssl.org>
Wed, 1 Nov 2017 12:35:19 +0000 (12:35 +0000)
commita92ca561bc91f4ebd2f53578e82058efcde61aed
treea25b87aca2769e6e376dbc410a4d3e68f55e5069
parent217534323ec4917c754fb454bf77b6d2ff551e23
Fix weak digest in TLS 1.2 with SNI.

1ce95f19601bbc6bfd24092c76c8f8105124e857 was incomplete and did not
handle the case when SSL_set_SSL_CTX was called from the cert_cb
callback rather than the SNI callback. The consequence is any server
using OpenSSL 1.0.2 and the cert_cb callback for SNI only ever signs a
weak digest, SHA-1, even when connecting to clients which use secure
ones.

Fix this and add regression tests for both this and the original issue.

Fixes #4554.

Reviewed-by: Emilia Käsper <emilia@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4577)
ssl/ssl_lib.c
ssl/ssltest.c
test/testssl