EVP_PKEY_CTX_GET_ALGOR(3ossl)

πŸ“¦ version 15.1, in freebsd 15.1

okay so, bestie, welcome to EVP_PKEY_CTX_GET_ALGOR(3ossl) from OpenSSL β€” this one is literally all about passing AlgorithmIdentifier and its params to/from algorithm implementations. no cap, it’s giving very specific crypto-plumbing main character energy πŸ’…

✨ NAME ✨

Here are the function besties on this page, exactly as listed:

  • 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

They’re all about 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);

πŸ’– DESCRIPTION πŸ’–

Quick vocab check, because the page says it and it matters: in this description and in the SYNOPSIS above, TYPE is used as a placeholder for any EVP operation type. iykyk πŸ¦‹

  • EVP_TYPE_CTX_get_algor() β€” attempts to retrieve a complete AlgorithmIdentifier from the EVP_TYPE implementation, and populates *alg with it. If alg is NULL, calling this function will serve to see if calling this function is supported at all by the EVP_TYPE implementation. If *alg is NULL, space will be allocated automatically, and assigned to *alg.
  • EVP_TYPE_CTX_get_algor_params() β€” attempts to retrieve the parameters part of an AlgorithmIdentifier from the EVP_TYPE implementation, and populates alg-parameters> with it. If alg is NULL, calling this function will serve to see if calling this function is supported at all by the EVP_TYPE implementation. If alg->parameters is NULL, space will be allocated automatically, and assigned to alg->parameters. If alg->parameters is not NULL, its previous contents will be overwritten with the retrieved AlgorithmIdentifier parameters. Beware! 😭
  • EVP_TYPE_CTX_set_algor_params() β€” attempts to pass alg->parameters to the EVP_TYPE implementation. If alg is NULL, calling this function will serve to see if calling this function is supported at all by the EVP_TYPE implementation.

πŸ’€ RETURN VALUES πŸ’€

All functions return 1 for success, and 0 or a negative number if an error occurs. In particular, -2 is returned when the function isn't supported by the EVP_TYPE implementation. So if you see -2, it’s not a skill issue β€” it’s an unsupported-implementation issue, fr fr. πŸ™ˆ

πŸ¦‹ HISTORY πŸ¦‹

These functions were added in OpenSSL 3.4. slay ✨

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>.

πŸ’… later, bestie β€” this page is from OpenSSL 3.5.6, dated 2026-04-07. πŸ“

πŸ“¦ where this page comes from