• Home
  • Raw
  • Download

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()
30 exchange->lock = CRYPTO_THREAD_lock_new(); in evp_keyexch_new()
31 if (exchange->lock == NULL) { in evp_keyexch_new()
33 OPENSSL_free(exchange); in evp_keyexch_new()
36 exchange->prov = prov; in evp_keyexch_new()
38 exchange->refcnt = 1; in evp_keyexch_new()
40 return exchange; in evp_keyexch_new()
48 EVP_KEYEXCH *exchange = NULL; in evp_keyexch_from_algorithm() local
51 if ((exchange = evp_keyexch_new(prov)) == NULL) { in evp_keyexch_from_algorithm()
56 exchange->name_id = name_id; in evp_keyexch_from_algorithm()
57 if ((exchange->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) in evp_keyexch_from_algorithm()
59 exchange->description = algodef->algorithm_description; in evp_keyexch_from_algorithm()
64 if (exchange->newctx != NULL) in evp_keyexch_from_algorithm()
66 exchange->newctx = OSSL_FUNC_keyexch_newctx(fns); in evp_keyexch_from_algorithm()
70 if (exchange->init != NULL) in evp_keyexch_from_algorithm()
72 exchange->init = OSSL_FUNC_keyexch_init(fns); in evp_keyexch_from_algorithm()
76 if (exchange->set_peer != NULL) in evp_keyexch_from_algorithm()
78 exchange->set_peer = OSSL_FUNC_keyexch_set_peer(fns); in evp_keyexch_from_algorithm()
81 if (exchange->derive != NULL) in evp_keyexch_from_algorithm()
83 exchange->derive = OSSL_FUNC_keyexch_derive(fns); in evp_keyexch_from_algorithm()
87 if (exchange->freectx != NULL) in evp_keyexch_from_algorithm()
89 exchange->freectx = OSSL_FUNC_keyexch_freectx(fns); in evp_keyexch_from_algorithm()
93 if (exchange->dupctx != NULL) in evp_keyexch_from_algorithm()
95 exchange->dupctx = OSSL_FUNC_keyexch_dupctx(fns); in evp_keyexch_from_algorithm()
98 if (exchange->get_ctx_params != NULL) in evp_keyexch_from_algorithm()
100 exchange->get_ctx_params = OSSL_FUNC_keyexch_get_ctx_params(fns); in evp_keyexch_from_algorithm()
104 if (exchange->gettable_ctx_params != NULL) in evp_keyexch_from_algorithm()
106 exchange->gettable_ctx_params in evp_keyexch_from_algorithm()
111 if (exchange->set_ctx_params != NULL) in evp_keyexch_from_algorithm()
113 exchange->set_ctx_params = OSSL_FUNC_keyexch_set_ctx_params(fns); in evp_keyexch_from_algorithm()
117 if (exchange->settable_ctx_params != NULL) in evp_keyexch_from_algorithm()
119 exchange->settable_ctx_params in evp_keyexch_from_algorithm()
140 return exchange; in evp_keyexch_from_algorithm()
143 EVP_KEYEXCH_free(exchange); in evp_keyexch_from_algorithm()
147 void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange) in EVP_KEYEXCH_free() argument
151 if (exchange == NULL) in EVP_KEYEXCH_free()
153 CRYPTO_DOWN_REF(&exchange->refcnt, &i, exchange->lock); in EVP_KEYEXCH_free()
156 OPENSSL_free(exchange->type_name); in EVP_KEYEXCH_free()
157 ossl_provider_free(exchange->prov); in EVP_KEYEXCH_free()
158 CRYPTO_THREAD_lock_free(exchange->lock); in EVP_KEYEXCH_free()
159 OPENSSL_free(exchange); in EVP_KEYEXCH_free()
162 int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange) in EVP_KEYEXCH_up_ref() argument
166 CRYPTO_UP_REF(&exchange->refcnt, &ref, exchange->lock); in EVP_KEYEXCH_up_ref()
170 OSSL_PROVIDER *EVP_KEYEXCH_get0_provider(const EVP_KEYEXCH *exchange) in EVP_KEYEXCH_get0_provider() argument
172 return exchange->prov; in EVP_KEYEXCH_get0_provider()
204 EVP_KEYEXCH *exchange = NULL; in EVP_PKEY_derive_init_ex() local
284 EVP_KEYEXCH_free(exchange); in EVP_PKEY_derive_init_ex()
289 exchange = in EVP_PKEY_derive_init_ex()
291 if (exchange != NULL) in EVP_PKEY_derive_init_ex()
292 tmp_prov = EVP_KEYEXCH_get0_provider(exchange); in EVP_PKEY_derive_init_ex()
296 exchange = in EVP_PKEY_derive_init_ex()
299 if (exchange == NULL) in EVP_PKEY_derive_init_ex()
303 if (exchange == NULL) in EVP_PKEY_derive_init_ex()
327 EVP_KEYEXCH_free(exchange); in EVP_PKEY_derive_init_ex()
335 ctx->op.kex.exchange = exchange; in EVP_PKEY_derive_init_ex()
336 ctx->op.kex.algctx = exchange->newctx(ossl_provider_ctx(exchange->prov)); in EVP_PKEY_derive_init_ex()
342 ret = exchange->init(ctx->op.kex.algctx, provkey, params); in EVP_PKEY_derive_init_ex()
393 if (ctx->op.kex.exchange->set_peer == NULL) { in EVP_PKEY_derive_set_peer_ex()
419 EVP_KEYEXCH_get0_provider(ctx->op.kex.exchange), in EVP_PKEY_derive_set_peer_ex()
433 return ctx->op.kex.exchange->set_peer(ctx->op.kex.algctx, provkey); in EVP_PKEY_derive_set_peer_ex()
522 ret = ctx->op.kex.exchange->derive(ctx->op.kex.algctx, key, pkeylen, in EVP_PKEY_derive()