EVP_PKEY_CTX_GET0_LIBCTX(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’… EVP_PKEY_CTX_GET0_LIBCTX πŸ’…

okay so bestie, welcome to the 3ossl girlies club β€” today we're talking about EVP_PKEY_CTX_get0_libctx, EVP_PKEY_CTX_get0_propq, and EVP_PKEY_CTX_get0_provider, aka the three little functions that just get diverse information from an EVP_PKEY_CTX for you. no cap, they're peek-only, they don't change anything, they just tell you what's up 🫢


✨ NAME ✨

EVP_PKEY_CTX_get0_libctx, EVP_PKEY_CTX_get0_propq, EVP_PKEY_CTX_get0_provider β€” functions for getting diverse information from an EVP_PKEY_CTX. it's giving "just vibes, but make them queryable" πŸ’–


🌸 SYNOPSIS 🌸

#include <openssl/evp.h>

OSSL_LIB_CTX *EVP_PKEY_CTX_get0_libctx(EVP_PKEY_CTX *ctx);
const char *EVP_PKEY_CTX_get0_propq(const EVP_PKEY_CTX *ctx);
const OSSL_PROVIDER *EVP_PKEY_CTX_get0_provider(const EVP_PKEY_CTX *ctx);

like, copy-paste this exactly, don't retype it from memory bestie, i'm begging 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

so EVP_PKEY_CTX_get0_libctx() and EVP_PKEY_CTX_get0_propq() obtain the OSSL_LIB_CTX and property query string values respectively β€” yes, in that order, keep up β€” that were associated with the EVP_PKEY_CTX when it was constructed. like, whenever your ctx was born, these are the library context and property query string it came into the world with. baby pictures, basically πŸ“Έ

and then EVP_PKEY_CTX_get0_provider() returns the provider associated with the ongoing EVP_PKEY_CTX operation. that's the one currently doing the work, main character energy πŸ‘‘

⚠️ BUT β€” plot twist β€” if the operation is performed by an ENGINE, this function returns NULL. not a bug, that's just how it is, the ENGINE girlies live in a different house πŸ’€

πŸ’œ RETURN VALUES πŸ’œ

EVP_PKEY_CTX_get0_libctx() and EVP_PKEY_CTX_get0_propq() functions return the OSSL_LIB_CTX and property query string associated with the EVP_PKEY_CTX, or NULL if they are not set.

🚨 IMPORTANT: the returned values should not be freed by the caller. do not free() them. do not OPENSSL_free() them. do not pass go. they are borrowed β€” the "get0" in the name is literally the whole hint, iykyk πŸ™ˆ

EVP_PKEY_CTX_get0_provider() returns a provider if an operation performed by a provider is ongoing, otherwise NULL. slay ✨


πŸŽ€ SEE ALSO πŸŽ€

  • EVP_PKEY_CTX_new(3) β€” the origin story, go read it if you wanna know how the ctx got here in the first place πŸ’«

🌈 HISTORY 🌈

all functions were added in OpenSSL 3.0. vintage but make it modern πŸ•°οΈ


Copyright 2020-2021 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 not optional, respecting licenses is the most iconic thing you can do 🫢

and that's the whole page, bestie!! this was EVP_PKEY_CTX_GET0_LIBCTX(3ossl) from the OpenSSL fam, version 3.5.6, dated 2026-04-07. go forth, get your libctx, don't free it, ily bye πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from