Don't overwrite the alert value if there is no alert to send
authorMatt Caswell <matt@openssl.org>
Wed, 26 Apr 2017 08:08:00 +0000 (09:08 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 26 Apr 2017 13:13:26 +0000 (14:13 +0100)
commitbf846a6d47a0f94b9771ead5ce52786045e58f49
treeebcc3f256a51ad04354f345a324f4b2ac6d59410
parentd91b7423af79447df90cc0245b6944fce93302d1
Don't overwrite the alert value if there is no alert to send

The function tls_early_post_process_client_hello() was overwriting the
passed "al" parameter even if it was successful. The caller of that
function, tls_post_process_client_hello(), sets "al" to a sensible default
(HANDSHAKE_FAILURE), but this was being overwritten to be INTERNAL_ERROR.
The result is a "no shared cipher" error (and probably other similar errors)
were being reported back to the client with an incorrect INTERNAL_ERROR
alert.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3314)
ssl/statem/statem_srvr.c