EVP_PKEY_CTX_GET_ALGOR(3ossl)
π 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 β bestie, these are the little messengers that pass an AlgorithmIdentifier and its params back and forth between you and the 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);
πΈ DESCRIPTION πΈ
okay so first thing, real quick β in this description and in the "SYNOPSIS" above, TYPE is just a placeholder for any EVP operation type. like, whichever one you're actually using, that's what goes there π«Ά
EVP_TYPE_CTX_get_algor()β this one tries to pull a whole entire complete AlgorithmIdentifier out of theEVP_TYPEimplementation, and it populates*algwith it. IfalgisNULL, calling this function is basically a vibe check: it just tells you whether calling this function is supported at all by theEVP_TYPEimplementation. And if*algisNULL, space gets allocated automatically and assigned to*alg. free real estate, we love to see it β¨EVP_TYPE_CTX_get_algor_params()β this one goes for just the parameters part of an AlgorithmIdentifier from theEVP_TYPEimplementation, and populatesalg->parameterswith it. IfalgisNULL, again it's the support-check move: it tells you whether 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 retrieved AlgorithmIdentifier parameters. Beware! π your old data is literally gone, no cap.EVP_TYPE_CTX_set_algor_params()β the giving one π it attempts to passalg->parametersto theEVP_TYPEimplementation. And yes, ifalgisNULL, calling this function serves to see if calling this function is supported at all by theEVP_TYPEimplementation. same energy every time, iconic.
π RETURN VALUES π
All of these functions return 1 for success, and 0 or a negative number if an error occurs. And specifically: -2 gets returned when the function isn't supported by the EVP_TYPE implementation. so if you see a -2, that's not a you problem, that's a "this implementation doesn't do that" problem π
β HISTORY β
These functions were added in OpenSSL 3.4. newer than new π
π 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 whole page, bestie π§π this was OpenSSL 3.5.9, dated 2026-09-29, and the manual page is EVP_PKEY_CTX_GET_ALGOR(3ossl). go forth and pass those AlgorithmIdentifiers around responsibly, mwah ππ
π¦ 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