Remove a TODO(3.0) from EVP_PKEY_derive_set_peer()
authorMatt Caswell <matt@openssl.org>
Mon, 15 Mar 2021 16:21:45 +0000 (16:21 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 17 Mar 2021 09:56:33 +0000 (09:56 +0000)
commit19ad1e9d3737f48c0e1c5cc5397ff1827b6946b8
tree571d2603c99d18fbecd52ff258fcfad457faca2f
parentd11f644ba5f5c7a6e925e625899589d0cdd2c84b
Remove a TODO(3.0) from EVP_PKEY_derive_set_peer()

The TODO described a case where a legacy derive operation is called, but
the peer key is provider based. In practice this will almost never be a
problem. We should never end up in our own legacy EVP_PKEY_METHOD
implementations if no ENGINE has been configured. If an ENGINE has been
configured then we we will be using a third party EVP_PKEY_METHOD
implementation and public APIs will be used to obtain the key data from the
peer key so there will be no "reaching inside" the pkey.

There is a theoretical case where a third party ENGINE wraps our own
internal EVP_PKEY_METHODs using EVP_PKEY_meth_find() or
EVP_PKEY_meth_get0(). For these cases we just ensure all our
EVP_PKEY_METHODs never reach "inside" the implementation of a peer key. We
can never assume that it is a legacy key.

Fixes #14399

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14555)
crypto/dh/dh_pmeth.c
crypto/ec/ec_pmeth.c
crypto/ec/ecx_meth.c
crypto/evp/exchange.c