EVP: Implement data-driven translation between known ctrl and OSSL_PARAMs
authorRichard Levitte <levitte@openssl.org>
Wed, 20 Jan 2021 22:04:53 +0000 (23:04 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 23 Feb 2021 12:41:48 +0000 (13:41 +0100)
commit9a1c4e41e8d3fd8fe9d1bd8eeb8b1e1df21da37f
treee7e936eba2359e076f5c73c6b8b24ab22b934386
parent4d4928edd0758753e43294816ae6095975a6e5fa
EVP: Implement data-driven translation between known ctrl and OSSL_PARAMs

The idea is to make it as transparent as possible to call things like
EVP_PKEY_CTX_ctrl() with a provider backed EVP_PKEY_CTX, or things
like EVP_PKEY_get_bn_param() with a legacy EVP_PKEY.

All these sorts of calls demand that we translate between ctrl
commands and OSSL_PARAM keys, and treat the arguments appropriately.

This implementation has it being as data driven as possible, thereby
centralizing everything into one table of translation data, which
supports both directions.

Fixes #13528

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13913)
crypto/evp/build.info
crypto/evp/ctrl_params_translate.c [new file with mode: 0644]
include/crypto/evp.h