EVP_KEYEXCH_FREE(3ossl)
π EVP_KEYEXCH_FREE(3ossl) β the OpenSSL keyexch management glow-up π
okay bestie, sit down, hydrate, and let me tell you about the EVP_KEYEXCH family of functions. this is the EVP_KEYEXCH_FREE page from the OpenSSL 3ossl manuals, and it's basically the whole "manage your key exchange algorithm objects" friend group. no cap, every single one of them is here.
β¨ NAME β¨
EVP_KEYEXCH_fetch, EVP_KEYEXCH_free, EVP_KEYEXCH_up_ref, EVP_KEYEXCH_get0_provider, EVP_KEYEXCH_is_a, EVP_KEYEXCH_do_all_provided, EVP_KEYEXCH_names_do_all, EVP_KEYEXCH_get0_name, EVP_KEYEXCH_get0_description, EVP_KEYEXCH_gettable_ctx_params, EVP_KEYEXCH_settable_ctx_params β these are the functions to manage EVP_KEYEXCH algorithm objects. π
πΈ SYNOPSIS πΈ
#include <openssl/evp.h>
EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange);
int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange);
OSSL_PROVIDER *EVP_KEYEXCH_get0_provider(const EVP_KEYEXCH *exchange);
int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *exchange, const char *name);
const char *EVP_KEYEXCH_get0_name(const EVP_KEYEXCH *exchange);
void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEYEXCH *exchange, void *arg),
void *arg);
int EVP_KEYEXCH_names_do_all(const EVP_KEYEXCH *exchange,
void (*fn)(const char *name, void *data),
void *data);
const char *EVP_KEYEXCH_get0_description(const EVP_KEYEXCH *keyexch);
const OSSL_PARAM *EVP_KEYEXCH_gettable_ctx_params(const EVP_KEYEXCH *keyexch);
const OSSL_PARAM *EVP_KEYEXCH_settable_ctx_params(const EVP_KEYEXCH *keyexch);
π¦ DESCRIPTION π¦
EVP_KEYEXCH_fetch()β bestie, this one fetches the key exchange implementation for the given algorithm from any provider offering it, filtered by the criteria in properties. wanna know more? go read "ALGORITHM FETCHING" in crypto(7). π
β οΈ the value it hands you back must eventually be freed with EVP_KEYEXCH_free(). that's not a suggestion, that's the law. π
EVP_KEYEXCH_free()β decrements the reference count on thatEVP_KEYEXCHstructure. usually you got this thing from an earlierEVP_KEYEXCH_fetch()call. the second the ref count hits 0, the structure gets freed. and if the argument isNULL? nothing happens. we love a low-stakes no-op. πEVP_KEYEXCH_up_ref()β increments the reference count for anEVP_KEYEXCHstructure. glow up, stay a while. β¨EVP_KEYEXCH_get0_provider()β returns the provider that exchange was fetched from. it's giving "where do you come from, king?" πEVP_KEYEXCH_is_a()β checks whether exchange is an implementation of an algorithm that's identifiable with name. vibe check: algorithm edition. πEVP_KEYEXCH_get0_name()β returns the algorithm name from the provided implementation for the given exchange. heads up though: the exchange may have multiple synonyms attached to it, and in that case you get the first name from the algorithm definition. also β ownership of the returned string stays with the exchange object, so do NOT free it yourself. it's not yours, bestie, don't touch it. π ββοΈEVP_KEYEXCH_names_do_all()β traverses all names for the exchange, and calls fn with each name and data. a whole little roll call. πEVP_KEYEXCH_get0_description()β returns a description of the keyexch, and it's meant for display and human consumption (yes, actual humans π«Ά). the description itself is at the discretion of the keyexch implementation, so it's giving whatever it feels like giving.EVP_KEYEXCH_do_all_provided()β traverses all key exchange implementations by all activated providers in the library context libctx, and for each of those implementations it calls fn with the implementation method and data as arguments. full sweep. no one gets left out. π§Ήβ¨EVP_KEYEXCH_gettable_ctx_params()andEVP_KEYEXCH_settable_ctx_params()β both return a constantOSSL_PARAM(3)array that describes the names and types of key parameters that can be retrieved or set by a key exchange algorithm usingEVP_PKEY_CTX_get_params(3)andEVP_PKEY_CTX_set_params(3). gettable = can get, settable = can set. iconic symmetry, periodt. β
π RETURN VALUES π
EVP_KEYEXCH_fetch()β returns a pointer to aEVP_KEYEXCHon success, orNULLon failure. πEVP_KEYEXCH_up_ref()β returns1for success or0otherwise.EVP_KEYEXCH_names_do_all()β returns1if the callback was called for all names. a return value of0means the callback was not called for any names.EVP_KEYEXCH_is_a()β returns1if exchange was identifiable, otherwise0. (yes the original says "1 of exchange was identifiable", we're being nice about it π)EVP_KEYEXCH_gettable_ctx_params()andEVP_KEYEXCH_settable_ctx_params()β return a constantOSSL_PARAM(3)array, orNULLon error.
π SEE ALSO π
"ALGORITHM FETCHING" in crypto(7), OSSL_PROVIDER(3). go read them, iykyk. π
π HISTORY π
the functions described here were added in OpenSSL 3.0. glow-up era. β¨
π COPYRIGHT π
Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.
fr fr, read the license, bestie. it's literally right there. π«Ά
and that's the whole page, no crumbs left. π this was OpenSSL 3.5.9, dated 2026-09-29, straight from the EVP_KEYEXCH_FREE(3ossl) manual. slay, hydrate, and always up_ref responsibly. π
β¨
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms