Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11158)
return keydata;
}
+
+int evp_keymgmt_util_has(EVP_PKEY *pk, int selection)
+{
+ /* Check if key is even assigned */
+ if (pk->keymgmt == NULL)
+ return 0;
+
+ return evp_keymgmt_has(pk->keymgmt, pk->keydata, selection);
+}
int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey)
{
- if (pkey != NULL && pkey->ameth && pkey->ameth->param_missing)
- return pkey->ameth->param_missing(pkey);
+ if (pkey != NULL) {
+ if (pkey->keymgmt != NULL)
+ return !evp_keymgmt_util_has((EVP_PKEY *)pkey,
+ OSSL_KEYMGMT_SELECT_ALL_PARAMETERS);
+ else if (pkey->ameth != NULL && pkey->ameth->param_missing != NULL)
+ return pkey->ameth->param_missing(pkey);
+ }
return 0;
}
void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk);
void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
int selection, const OSSL_PARAM params[]);
+int evp_keymgmt_util_has(EVP_PKEY *pk, int selection);
/*