EVP_PKEY_CTX_GET_ALGOR(3ossl)
π EVP_PKEY_CTX_GET_ALGOR(3ossl) π
okay so this is the OpenSSL manual page for EVP_PKEY_CTX_GET_ALGOR, and honestly? it's giving "short but mighty" β¨ no cap, it's all about passing AlgorithmIdentifier (and its params) to and from algorithm implementations. bestie, let's get into it π«Ά
πΈ NAME πΈ
EVP_CIPHER_CTX_get_algor, EVP_CIPHER_CTX_get_algor_params, EVP_CIPHER_CTX_set_algor_params, EVP_PKEY_CTX_get_algor, EVP_PKEY_CTX_get_algor_params, EVP_PKEY_CTX_set_algor_params β literally the whole girlie squad whose job is passing AlgorithmIdentifier and its params to/from algorithm implementations π«
π SYNOPSIS π
int EVP_TYPE_CTX_get_algor(EVP_TYPE_CTX *ctx, X509_ALGOR **alg);
int EVP_TYPE_CTX_get_algor_params(EVP_TYPE_CTX *ctx, X509_ALGOR *alg);
int EVP_TYPE_CTX_set_algor_params(EVP_TYPE_CTX *ctx, const X509_ALGOR *alg);
like, that's it. that's the whole vibe. π
π¦ DESCRIPTION π¦
okay so first thing, bestie β in this whole description and in the SYNOPSIS up there, TYPE is just a placeholder standing in for any EVP operation type. so whenever you see EVP_TYPE_CTX, just mentally slot in your fave π iykyk.
EVP_TYPE_CTX_get_algor()β she attempts to retrieve a completeAlgorithmIdentifierfrom theEVP_TYPEimplementation, and populates*algwith it. ifalgisNULL, calling this function will serve to see if calling this function is supported at all by theEVP_TYPEimplementation π. and if*algisNULL, space will be allocated automatically, and assigned to*algβ she provides β¨EVP_TYPE_CTX_get_algor_params()β she attempts to retrieve the parameters part of anAlgorithmIdentifierfrom theEVP_TYPEimplementation, and populatesalg-parameters>with it. ifalgisNULL, calling this function will serve to see if calling this function is supported at all by theEVP_TYPEimplementation π. ifalg->parametersisNULL, space will be allocated automatically, and assigned toalg->parameters. but ifalg->parametersis notNULL, its previous contents will be overwritten with the retrievedAlgorithmIdentifierparameters. Beware! π that's the "not me accidentally yeeting your old data" moment, fr frEVP_TYPE_CTX_set_algor_params()β she attempts to passalg->parametersto theEVP_TYPEimplementation. ifalgisNULL, calling this function will serve to see if calling this function is supported at all by theEVP_TYPEimplementation π
π«Ά friendly reminder: those alg is NULL calls are literally just vibe checks β a way to ask "is this even supported?" without doing the real work.
β RETURN VALUES β
all three functions return 1 for success π, and 0 or a negative number if an error occurs π. and specifically β <rainbow>-2is returned when the function isn't supported by theEVP_TYPEimplementation. so if you get a-2`, that's not a bug, that's the implementation saying "ma'am, not today" π
π HISTORY π
these functions were added in OpenSSL 3.4 π like, they're new-new. treat them with main character energy π
πΈ COPYRIGHT πΈ
Copyright 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>.
and that's the page, bestie π¦β¨ this was OpenSSL 3.5.0, dated 2026-09-25 β signed, sealed, delivered, and living rent free in EVP_PKEY_CTX_GET_ALGOR(3ossl) π periodt.
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms