Pass an EVP_PKEY for SSL_SECOP_TMP_DH in the security callback
authorMatt Caswell <matt@openssl.org>
Wed, 14 Oct 2020 14:13:28 +0000 (15:13 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 16 Oct 2020 13:58:44 +0000 (14:58 +0100)
commit47e81a1bfa5ebd21f23c19745c7f5f93d141b02f
treeb61878cd47bbe3ab0aa70180b79dc7a3c6fd8fc8
parent301fcb284328902842ff363e6ad3a4144dae928c
Pass an EVP_PKEY for SSL_SECOP_TMP_DH in the security callback

The security operation SSL_SECOP_TMP_DH is defined to take an EVP_PKEY
in the "other" parameter:

 /* Temporary DH key */
 # define SSL_SECOP_TMP_DH                (7 | SSL_SECOP_OTHER_PKEY)

In most places this is what is passed. All these places occur server side.
However there is one client side call of this security operation and it
passes a DH object instead. This is incorrect according to the
definition of SSL_SECOP_TMP_DH, and is inconsistent with all of the other
locations.

Our own default security callback, and the debug callback in the apps,
never look at this value and therefore this issue was never noticed
previously. In theory a client side application could be relying on this
behaviour and could be broken by this change. This is probably fairly
unlikely but can't be ruled out.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/13136)
ssl/statem/statem_clnt.c