Lines Matching refs:exchange

23     EVP_KEYEXCH *exchange = OPENSSL_zalloc(sizeof(EVP_KEYEXCH));
25 if (exchange == NULL) {
30 exchange->lock = CRYPTO_THREAD_lock_new();
31 if (exchange->lock == NULL) {
33 OPENSSL_free(exchange);
36 exchange->prov = prov;
38 exchange->refcnt = 1;
40 return exchange;
48 EVP_KEYEXCH *exchange = NULL;
51 if ((exchange = evp_keyexch_new(prov)) == NULL) {
56 exchange->name_id = name_id;
57 if ((exchange->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
59 exchange->description = algodef->algorithm_description;
64 if (exchange->newctx != NULL)
66 exchange->newctx = OSSL_FUNC_keyexch_newctx(fns);
70 if (exchange->init != NULL)
72 exchange->init = OSSL_FUNC_keyexch_init(fns);
76 if (exchange->set_peer != NULL)
78 exchange->set_peer = OSSL_FUNC_keyexch_set_peer(fns);
81 if (exchange->derive != NULL)
83 exchange->derive = OSSL_FUNC_keyexch_derive(fns);
87 if (exchange->freectx != NULL)
89 exchange->freectx = OSSL_FUNC_keyexch_freectx(fns);
93 if (exchange->dupctx != NULL)
95 exchange->dupctx = OSSL_FUNC_keyexch_dupctx(fns);
98 if (exchange->get_ctx_params != NULL)
100 exchange->get_ctx_params = OSSL_FUNC_keyexch_get_ctx_params(fns);
104 if (exchange->gettable_ctx_params != NULL)
106 exchange->gettable_ctx_params
111 if (exchange->set_ctx_params != NULL)
113 exchange->set_ctx_params = OSSL_FUNC_keyexch_set_ctx_params(fns);
117 if (exchange->settable_ctx_params != NULL)
119 exchange->settable_ctx_params
130 * a complete set of "exchange" functions: init, derive, newctx,
140 return exchange;
143 EVP_KEYEXCH_free(exchange);
147 void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange)
151 if (exchange == NULL)
153 CRYPTO_DOWN_REF(&exchange->refcnt, &i, exchange->lock);
156 OPENSSL_free(exchange->type_name);
157 ossl_provider_free(exchange->prov);
158 CRYPTO_THREAD_lock_free(exchange->lock);
159 OPENSSL_free(exchange);
162 int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange)
166 CRYPTO_UP_REF(&exchange->refcnt, &ref, exchange->lock);
170 OSSL_PROVIDER *EVP_KEYEXCH_get0_provider(const EVP_KEYEXCH *exchange)
172 return exchange->prov;
204 EVP_KEYEXCH *exchange = NULL;
262 * 1. Do the normal exchange fetch, using the fetching data given by
264 * 2. Do the provider specific exchange fetch, from the same provider
268 * exchange, and try to export |ctx->pkey| to that keymgmt (when
284 EVP_KEYEXCH_free(exchange);
289 exchange =
291 if (exchange != NULL)
292 tmp_prov = EVP_KEYEXCH_get0_provider(exchange);
296 exchange =
299 if (exchange == NULL)
303 if (exchange == NULL)
309 * |ctx->keymgmt|, but from the provider of the exchange method, using
310 * the same property query as when fetching the exchange method.
327 EVP_KEYEXCH_free(exchange);
335 ctx->op.kex.exchange = exchange;
336 ctx->op.kex.algctx = exchange->newctx(ossl_provider_ctx(exchange->prov));
342 ret = exchange->init(ctx->op.kex.algctx, provkey, params);
393 if (ctx->op.kex.exchange->set_peer == NULL) {
411 * |ctx->keymgmt|, but from the provider of the exchange method, using
412 * the same property query as when fetching the exchange method.
419 EVP_KEYEXCH_get0_provider(ctx->op.kex.exchange),
433 return ctx->op.kex.exchange->set_peer(ctx->op.kex.algctx, provkey);
522 ret = ctx->op.kex.exchange->derive(ctx->op.kex.algctx, key, pkeylen,