Lines Matching refs:exchange

23     EVP_KEYEXCH *exchange = OPENSSL_zalloc(sizeof(EVP_KEYEXCH));  in evp_keyexch_new()  local
25 if (exchange == NULL) in evp_keyexch_new()
28 if (!CRYPTO_NEW_REF(&exchange->refcnt, 1)) { in evp_keyexch_new()
29 OPENSSL_free(exchange); in evp_keyexch_new()
32 exchange->prov = prov; in evp_keyexch_new()
35 return exchange; in evp_keyexch_new()
43 EVP_KEYEXCH *exchange = NULL; in evp_keyexch_from_algorithm() local
46 if ((exchange = evp_keyexch_new(prov)) == NULL) { in evp_keyexch_from_algorithm()
51 exchange->name_id = name_id; in evp_keyexch_from_algorithm()
52 if ((exchange->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) in evp_keyexch_from_algorithm()
54 exchange->description = algodef->algorithm_description; in evp_keyexch_from_algorithm()
59 if (exchange->newctx != NULL) in evp_keyexch_from_algorithm()
61 exchange->newctx = OSSL_FUNC_keyexch_newctx(fns); in evp_keyexch_from_algorithm()
65 if (exchange->init != NULL) in evp_keyexch_from_algorithm()
67 exchange->init = OSSL_FUNC_keyexch_init(fns); in evp_keyexch_from_algorithm()
71 if (exchange->set_peer != NULL) in evp_keyexch_from_algorithm()
73 exchange->set_peer = OSSL_FUNC_keyexch_set_peer(fns); in evp_keyexch_from_algorithm()
76 if (exchange->derive != NULL) in evp_keyexch_from_algorithm()
78 exchange->derive = OSSL_FUNC_keyexch_derive(fns); in evp_keyexch_from_algorithm()
82 if (exchange->freectx != NULL) in evp_keyexch_from_algorithm()
84 exchange->freectx = OSSL_FUNC_keyexch_freectx(fns); in evp_keyexch_from_algorithm()
88 if (exchange->dupctx != NULL) in evp_keyexch_from_algorithm()
90 exchange->dupctx = OSSL_FUNC_keyexch_dupctx(fns); in evp_keyexch_from_algorithm()
93 if (exchange->get_ctx_params != NULL) in evp_keyexch_from_algorithm()
95 exchange->get_ctx_params = OSSL_FUNC_keyexch_get_ctx_params(fns); in evp_keyexch_from_algorithm()
99 if (exchange->gettable_ctx_params != NULL) in evp_keyexch_from_algorithm()
101 exchange->gettable_ctx_params in evp_keyexch_from_algorithm()
106 if (exchange->set_ctx_params != NULL) in evp_keyexch_from_algorithm()
108 exchange->set_ctx_params = OSSL_FUNC_keyexch_set_ctx_params(fns); in evp_keyexch_from_algorithm()
112 if (exchange->settable_ctx_params != NULL) in evp_keyexch_from_algorithm()
114 exchange->settable_ctx_params in evp_keyexch_from_algorithm()
135 return exchange; in evp_keyexch_from_algorithm()
138 EVP_KEYEXCH_free(exchange); in evp_keyexch_from_algorithm()
142 void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange) in EVP_KEYEXCH_free() argument
146 if (exchange == NULL) in EVP_KEYEXCH_free()
148 CRYPTO_DOWN_REF(&exchange->refcnt, &i); in EVP_KEYEXCH_free()
151 OPENSSL_free(exchange->type_name); in EVP_KEYEXCH_free()
152 ossl_provider_free(exchange->prov); in EVP_KEYEXCH_free()
153 CRYPTO_FREE_REF(&exchange->refcnt); in EVP_KEYEXCH_free()
154 OPENSSL_free(exchange); in EVP_KEYEXCH_free()
157 int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange) in EVP_KEYEXCH_up_ref() argument
161 CRYPTO_UP_REF(&exchange->refcnt, &ref); in EVP_KEYEXCH_up_ref()
165 OSSL_PROVIDER *EVP_KEYEXCH_get0_provider(const EVP_KEYEXCH *exchange) in EVP_KEYEXCH_get0_provider() argument
167 return exchange->prov; in EVP_KEYEXCH_get0_provider()
199 EVP_KEYEXCH *exchange = NULL; in EVP_PKEY_derive_init_ex() local
279 EVP_KEYEXCH_free(exchange); in EVP_PKEY_derive_init_ex()
284 exchange = in EVP_PKEY_derive_init_ex()
286 if (exchange != NULL) in EVP_PKEY_derive_init_ex()
287 tmp_prov = EVP_KEYEXCH_get0_provider(exchange); in EVP_PKEY_derive_init_ex()
291 exchange = in EVP_PKEY_derive_init_ex()
294 if (exchange == NULL) in EVP_PKEY_derive_init_ex()
298 if (exchange == NULL) in EVP_PKEY_derive_init_ex()
322 EVP_KEYEXCH_free(exchange); in EVP_PKEY_derive_init_ex()
332 ctx->op.kex.exchange = exchange; in EVP_PKEY_derive_init_ex()
335 ctx->op.kex.algctx = exchange->newctx(ossl_provider_ctx(exchange->prov)); in EVP_PKEY_derive_init_ex()
341 ret = exchange->init(ctx->op.kex.algctx, provkey, params); in EVP_PKEY_derive_init_ex()
392 if (ctx->op.kex.exchange->set_peer == NULL) { in EVP_PKEY_derive_set_peer_ex()
418 EVP_KEYEXCH_get0_provider(ctx->op.kex.exchange), in EVP_PKEY_derive_set_peer_ex()
434 return ctx->op.kex.exchange->set_peer(ctx->op.kex.algctx, provkey); in EVP_PKEY_derive_set_peer_ex()
523 ret = ctx->op.kex.exchange->derive(ctx->op.kex.algctx, key, pkeylen, in EVP_PKEY_derive()