EVP_CIPHER_C..._CIPHER_DATA(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… NAME πŸ’…

okay so bestie, welcome to the <EVP_CIPHER_C..._CIPHER_DATA(3ossl)> OpenSSL manual page β€” it's giving β€œroutines to inspect and modify <EVP_CIPHER_CTX> objects,” and honestly? iconic. ✨

This page covers <EVP_CIPHER_CTX_get_cipher_data> and <EVP_CIPHER_CTX_set_cipher_data>, aka the little functions that peek at and swap out cipher data. no cap, that's the whole vibe. 🫢


πŸ“œ SYNOPSIS πŸ“œ

#include <openssl/evp.h>

void *EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx);
void *EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data);

🌸 DESCRIPTION 🌸

πŸŽ€ <EVP_CIPHER_CTX_get_cipher_data()> πŸŽ€

so <EVP_CIPHER_CTX_get_cipher_data()> returns a pointer to the cipher data relevant to <EVP_CIPHER_CTX>. literally just hands you the pointer. 🫴✨

the contents of this data are specific to the particular implementation of the cipher. for example, this data can be used by engines to store engine specific information. very β€œmy data, my rules” energy. πŸ’…

the data is automatically allocated and freed by OpenSSL, so applications and engines should not normally free this directly β€” but see below πŸ‘€ (yes, that's foreshadowing).

πŸ¦‹ <EVP_CIPHER_CTX_set_cipher_data()> πŸ¦‹

the <EVP_CIPHER_CTX_set_cipher_data()> function lets an application or engine replace the cipher data with new data. main character move: out with the old, in with the new. πŸ”₯

a pointer to any existing cipher data is returned from this function. if the old data is no longer required, then it should be freed through a call to <OPENSSL_free()>. yes, bestie, actually free it properly β€” don't just ghost it. 😭


⭐ RETURN VALUES ⭐

  • <EVP_CIPHER_CTX_get_cipher_data()> β€” returns a pointer to the current cipher data for the <EVP_CIPHER_CTX>. πŸ’–
  • <EVP_CIPHER_CTX_set_cipher_data()> β€” returns a pointer to the old cipher data for the <EVP_CIPHER_CTX>. πŸŽ€

🌈 HISTORY 🌈

the <EVP_CIPHER_CTX_get_cipher_data()> and <EVP_CIPHER_CTX_set_cipher_data()> functions were added in OpenSSL <1.1.0>. vintage-ish, but make it slay. πŸ‘‘


Copyright <2016> 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 β€” from OpenSSL <3.5.0>, dated <2026-09-25>, signing off as <EVP_CIPHER_C..._CIPHER_DATA(3ossl)>. bye diva, go inspect those cipher contexts responsibly πŸ’…πŸ«ΆπŸŒΈ

πŸ“¦ where this page comes from