Refactor evp_pkey_make_provided() to do legacy to provider export
authorRichard Levitte <levitte@openssl.org>
Wed, 12 Feb 2020 13:28:50 +0000 (14:28 +0100)
committerRichard Levitte <levitte@openssl.org>
Sat, 22 Feb 2020 00:19:54 +0000 (01:19 +0100)
commit3f7ce7f1029c01c2c4d00e14ffc9630d26f485a4
treeb9256d3cf61c639bb444c04e52ebff524fcba07c
parent8e90e3d53665854d76d6d46491b38f0e2a802428
Refactor evp_pkey_make_provided() to do legacy to provider export

Previously, evp-keymgmt_util_export_to_provider() took care of all
kinds of exports of EVP_PKEYs to provider side keys, be it from its
legacy key or from another provider side key.  This works most of the
times, but there may be cases where the caller wants to be a bit more
in control of what sort of export happens when.

Also, when it's time to remove all legacy stuff, that job will be much
easier if we have a better separation between legacy support and
support of provided stuff, as far as we can take it.

This changes moves the support of legacy key to provider side key
export from evp-keymgmt_util_export_to_provider() to
evp_pkey_make_provided(), and makes sure the latter is called from all
EVP_PKEY functions that handle legacy stuff.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11074)
crypto/evp/evp_fetch.c
crypto/evp/evp_local.h
crypto/evp/exchange.c
crypto/evp/keymgmt_lib.c
crypto/evp/p_lib.c
doc/internal/man3/evp_keymgmt_util_export_to_provider.pod
doc/internal/man3/evp_pkey_make_provided.pod
include/crypto/evp.h
test/keymgmt_internal_test.c