This is already correct in the rsa_kmgmt.c but other
implementations are wrong.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/21519)
(cherry picked from commit
1ae4678cebaa13604c0f31bdf2c64cd28bdaf287)
if (!ossl_prov_is_running() || dh == NULL)
return 0;
+ if ((selection & DH_POSSIBLE_SELECTIONS) == 0)
+ return 0;
+
tmpl = OSSL_PARAM_BLD_new();
if (tmpl == NULL)
return 0;
if (!ossl_prov_is_running() || dsa == NULL)
return 0;
+ if ((selection & DSA_POSSIBLE_SELECTIONS) == 0)
+ return 0;
+
tmpl = OSSL_PARAM_BLD_new();
if (tmpl == NULL)
return 0;
if (!ossl_prov_is_running() || key == NULL)
return 0;
+ if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
+ return 0;
+
tmpl = OSSL_PARAM_BLD_new();
if (tmpl == NULL)
return 0;
if (!ossl_prov_is_running() || key == NULL)
return 0;
+ if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) == 0)
+ return 0;
+
tmpl = OSSL_PARAM_BLD_new();
if (tmpl == NULL)
return 0;