Lines Matching refs:keymgmt

36         if ((data->keydata = evp_keymgmt_newdata(data->keymgmt)) == NULL) {  in evp_keymgmt_util_try_import()
50 if (evp_keymgmt_import(data->keymgmt, data->keydata, data->selection, in evp_keymgmt_util_try_import()
54 evp_keymgmt_freedata(data->keymgmt, data->keydata); in evp_keymgmt_util_try_import()
60 int evp_keymgmt_util_assign_pkey(EVP_PKEY *pkey, EVP_KEYMGMT *keymgmt, in evp_keymgmt_util_assign_pkey() argument
63 if (pkey == NULL || keymgmt == NULL || keydata == NULL in evp_keymgmt_util_assign_pkey()
64 || !EVP_PKEY_set_type_by_keymgmt(pkey, keymgmt)) { in evp_keymgmt_util_assign_pkey()
73 EVP_PKEY *evp_keymgmt_util_make_pkey(EVP_KEYMGMT *keymgmt, void *keydata) in evp_keymgmt_util_make_pkey() argument
77 if (keymgmt == NULL in evp_keymgmt_util_make_pkey()
80 || !evp_keymgmt_util_assign_pkey(pkey, keymgmt, keydata)) { in evp_keymgmt_util_make_pkey()
92 return evp_keymgmt_export(pk->keymgmt, pk->keydata, selection, in evp_keymgmt_util_export()
96 void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt, in evp_keymgmt_util_export_to_provider() argument
103 if (keymgmt == NULL) in evp_keymgmt_util_export_to_provider()
117 if (pk->keymgmt == keymgmt in evp_keymgmt_util_export_to_provider()
118 || (pk->keymgmt->name_id == keymgmt->name_id in evp_keymgmt_util_export_to_provider()
119 && pk->keymgmt->prov == keymgmt->prov)) in evp_keymgmt_util_export_to_provider()
131 op = evp_keymgmt_util_find_operation_cache(pk, keymgmt, selection); in evp_keymgmt_util_export_to_provider()
132 if (op != NULL && op->keymgmt != NULL) { in evp_keymgmt_util_export_to_provider()
142 if (pk->keymgmt->export == NULL) in evp_keymgmt_util_export_to_provider()
149 if (!ossl_assert(match_type(pk->keymgmt, keymgmt))) in evp_keymgmt_util_export_to_provider()
160 import_data.keymgmt = keymgmt; in evp_keymgmt_util_export_to_provider()
173 evp_keymgmt_freedata(keymgmt, import_data.keydata); in evp_keymgmt_util_export_to_provider()
177 op = evp_keymgmt_util_find_operation_cache(pk, keymgmt, selection); in evp_keymgmt_util_export_to_provider()
187 evp_keymgmt_freedata(keymgmt, import_data.keydata); in evp_keymgmt_util_export_to_provider()
200 if (!evp_keymgmt_util_cache_keydata(pk, keymgmt, import_data.keydata, in evp_keymgmt_util_export_to_provider()
203 evp_keymgmt_freedata(keymgmt, import_data.keydata); in evp_keymgmt_util_export_to_provider()
217 evp_keymgmt_freedata(e->keymgmt, e->keydata); in op_cache_free()
218 EVP_KEYMGMT_free(e->keymgmt); in op_cache_free()
233 EVP_KEYMGMT *keymgmt, in evp_keymgmt_util_find_operation_cache() argument
248 && (keymgmt == p->keymgmt in evp_keymgmt_util_find_operation_cache()
249 || (keymgmt->name_id == p->keymgmt->name_id in evp_keymgmt_util_find_operation_cache()
250 && keymgmt->prov == p->keymgmt->prov))) in evp_keymgmt_util_find_operation_cache()
256 int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt, in evp_keymgmt_util_cache_keydata() argument
272 p->keymgmt = keymgmt; in evp_keymgmt_util_cache_keydata()
275 if (!EVP_KEYMGMT_up_ref(keymgmt)) { in evp_keymgmt_util_cache_keydata()
281 EVP_KEYMGMT_free(keymgmt); in evp_keymgmt_util_cache_keydata()
307 if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) { in evp_keymgmt_util_cache_keyinfo()
315 void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt, in evp_keymgmt_util_fromdata() argument
320 if ((keydata = evp_keymgmt_newdata(keymgmt)) == NULL in evp_keymgmt_util_fromdata()
321 || !evp_keymgmt_import(keymgmt, keydata, selection, params) in evp_keymgmt_util_fromdata()
322 || !evp_keymgmt_util_assign_pkey(target, keymgmt, keydata)) { in evp_keymgmt_util_fromdata()
323 evp_keymgmt_freedata(keymgmt, keydata); in evp_keymgmt_util_fromdata()
332 if (pk->keymgmt == NULL) in evp_keymgmt_util_has()
335 return evp_keymgmt_has(pk->keymgmt, pk->keydata, selection); in evp_keymgmt_util_has()
362 keymgmt1 = pk1->keymgmt; in evp_keymgmt_util_match()
364 keymgmt2 = pk2->keymgmt; in evp_keymgmt_util_match()
448 EVP_KEYMGMT *to_keymgmt = to->keymgmt; in evp_keymgmt_util_copy()
461 to_keymgmt = from->keymgmt; in evp_keymgmt_util_copy()
463 if (to_keymgmt == from->keymgmt && to_keymgmt->dup != NULL in evp_keymgmt_util_copy()
470 } else if (match_type(to_keymgmt, from->keymgmt)) { in evp_keymgmt_util_copy()
473 import_data.keymgmt = to_keymgmt; in evp_keymgmt_util_copy()
502 if (to->keymgmt == NULL in evp_keymgmt_util_copy()
513 void *evp_keymgmt_util_gen(EVP_PKEY *target, EVP_KEYMGMT *keymgmt, in evp_keymgmt_util_gen() argument
518 if ((keydata = evp_keymgmt_gen(keymgmt, genctx, cb, cbarg)) == NULL in evp_keymgmt_util_gen()
519 || !evp_keymgmt_util_assign_pkey(target, keymgmt, keydata)) { in evp_keymgmt_util_gen()
520 evp_keymgmt_freedata(keymgmt, keydata); in evp_keymgmt_util_gen()
533 int evp_keymgmt_util_get_deflt_digest_name(EVP_KEYMGMT *keymgmt, in evp_keymgmt_util_get_deflt_digest_name() argument
552 if (!evp_keymgmt_get_params(keymgmt, keydata, params)) in evp_keymgmt_util_get_deflt_digest_name()
578 const char *evp_keymgmt_util_query_operation_name(EVP_KEYMGMT *keymgmt, in evp_keymgmt_util_query_operation_name() argument
583 if (keymgmt != NULL) { in evp_keymgmt_util_query_operation_name()
584 if (keymgmt->query_operation_name != NULL) in evp_keymgmt_util_query_operation_name()
585 name = keymgmt->query_operation_name(op_id); in evp_keymgmt_util_query_operation_name()
587 name = EVP_KEYMGMT_get0_name(keymgmt); in evp_keymgmt_util_query_operation_name()