EVP_KEYEXCH_FREE(3ossl)
π EVP_KEYEXCH_FREE π
ok so quick vibe check: this is a page from the OpenSSL manual, bestie β specifically the 3ossl girlies. it's literally all about managing EVP_KEYEXCH algorithm objects and honestly? once you get it, it slaps. let's go π
β¨ 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 that manage EVP_KEYEXCH algorithm objects. that's the whole assignment. periodt. π
πΈ 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);
copy these exactly, i'm so serious, no typos bestie π
π¦ DESCRIPTION π¦
so EVP_KEYEXCH_fetch() goes and fetches you the key exchange implementation for whatever algorithm you asked for, from any provider that's offering it, all within the criteria you set in properties. it's giving personal shopper. you want more deets? peek at "ALGORITHM FETCHING" in crypto(7) β that's where the lore lives.
the value it hands back must eventually be freed with EVP_KEYEXCH_free(). don't ghost your memory like that, it's not cute π
EVP_KEYEXCH_free() decrements the reference count on the EVP_KEYEXCH structure. usually you got this structure from an earlier EVP_KEYEXCH_fetch() call β classic. if the reference count drops all the way to 0, the structure gets freed. and if the argument is NULL? nothing happens. she simply doesn't engage. π
EVP_KEYEXCH_up_ref() increments the reference count for an EVP_KEYEXCH structure. the opposite energy. iconic, balanced, as all things should be β¨
EVP_KEYEXCH_get0_provider() returns the provider that exchange was fetched from. receipts!
EVP_KEYEXCH_is_a() checks if exchange is an implementation of an algorithm that's identifiable with name. basically a "do i know her?" check π
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 associated with it, and in that case, the first name from the algorithm definition is what you get back. ownership of the returned string stays with the exchange object β so do not free it yourself, bestie, that's not your string to end π₯
EVP_KEYEXCH_names_do_all() traverses all the names for the exchange, and calls fn with each name and data. a full tour of the name cinematic universe π
EVP_KEYEXCH_get0_description() returns a description of the keyexch, meant for display and human consumption. and what does it say? entirely at the discretion of the keyexch implementation. mystery. main character energy. she contains multitudes π
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, calls fn with the implementation method and data as arguments. it's a whole group chat roll call π«Ά
EVP_KEYEXCH_gettable_ctx_params() and EVP_KEYEXCH_settable_ctx_params() return a constant OSSL_PARAM(3) array that describes the names and types of key parameters that can be retrieved or set by a key exchange algorithm using EVP_PKEY_CTX_get_params(3) and EVP_PKEY_CTX_set_params(3). yes those are the real function names, no i did not make them up π
β RETURN VALUES β
EVP_KEYEXCH_fetch()β returns a pointer to anEVP_KEYEXCHon success, orNULLon failure. win or flop, no in between πEVP_KEYEXCH_up_ref()β returns1for success or0otherwise.EVP_KEYEXCH_names_do_all()β returns1if the callback was called for all names. a return of0means the callback was not called for any names. π¬EVP_KEYEXCH_is_a()β returns1if exchange was identifiable, otherwise0.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), and OSSL_PROVIDER(3). go read them, i believe in you π«Ά
π HISTORY π
the functions described here were added in OpenSSL 3.0. so they're not new new, but they're not ancient either. the sweet spot β
π 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, it's the whole point of the vibe check π
and that's the page, bestie!! πβ¨ signed, sealed, delivered by 3.5.6, dated 2026-04-07, on the EVP_KEYEXCH_FREE(3ossl) page β go forth and manage those algorithm objects, you absolute icon π¦ππΈ
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms