EVP_PKEY_CTX_GET0_LIBCTX(3ossl)
π EVP_PKEY_CTX_GET0_LIBCTX π
okay bestie so this is the 3ossl girlies' manual β the OpenSSL one β and today we're talking about three lil getter functions that pull the tea out of an EVP_PKEY_CTX. They live in <openssl/evp.h>, they're nosy in the best way, and honestly? They ate. π«Ά
β¨ NAME β¨
EVP_PKEY_CTX_get0_libctx, EVP_PKEY_CTX_get0_propq, EVP_PKEY_CTX_get0_provider β the trio of functions for getting diverse information out of an EVP_PKEY_CTX. It's giving "tell me everything you know about yourself, babe." π
πΈ 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);
no cap, that's the whole vibe. three one-liners. β¨
π¦ DESCRIPTION π¦
So EVP_PKEY_CTX_get0_libctx() and EVP_PKEY_CTX_get0_propq() are the little archivists of the group. They hand you back the OSSL_LIB_CTX and the property query string values respectively β the exact ones that got associated with the EVP_PKEY_CTX back when it was constructed. Like, they're just reminding you what you signed up for. π
Then there's EVP_PKEY_CTX_get0_provider(), which returns the provider associated with the ongoing EVP_PKEY_CTX operation. Very main character, very "who's running this show rn."
but bestie, listen β if the operation is performed by an ENGINE, this function returns NULL. π that's the whole thing. ENGINE girlies don't get a provider. periodt.
π RETURN VALUES π
EVP_PKEY_CTX_get0_libctx()andEVP_PKEY_CTX_get0_propq()β they return theOSSL_LIB_CTXand property query string associated with theEVP_PKEY_CTX, orNULLif they're not set.EVP_PKEY_CTX_get0_provider()β returns a provider if an operation performed by a provider is ongoing, otherwiseNULL.
β οΈ super important, don't skip this: the values returned should not be freed by the caller. like, hands off, they're not yours to free(). the ctx is holding them, you're just borrowing a peek. π
π SEE ALSO π
EVP_PKEY_CTX_new(3)β go read that one too, it's the prequel bestie πΈ
π HISTORY π
All functions were added in OpenSSL 3.0. iconic debut, no notes. β
π COPYRIGHT π
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>.
and that's the whole page, bestie!! π₯³ this was the 3ossl manual, version 3.5.9, dated 2026-09-29, filed under EVP_PKEY_CTX_GET0_LIBCTX(3ossl). go forth and get those zero-copy pointers, but do NOT free them, i'm literally begging you πβ¨π§πΈπ
π¦ 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