EVP_CIPHER_CT...T_CIPHER_DATA(3SSL)
π EVP_CIPHER_CTX_get_cipher_data, EVP_CIPHER_CTX_set_cipher_data β a lil' peek at your cipher's private diary π
okay bestie, so this is EVP_CIPHER_CT...T_CIPHER_DATA(3SSL) β the OpenSSL manual for two little functions that let you inspect and modify EVP_CIPHER_CTX objects. yes, "inspect and modify", we're nosy and we're proud of it. no cap. β¨
πΈ 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);
like, two lines, one include, that's the whole vibe. π
β¨ DESCRIPTION β¨
so the way that EVP_CIPHER_CTX_get_cipher_data() works is β it hands you back a pointer to the cipher data that's relevant to the EVP_CIPHER_CTX. and like, what's inside that data? that's giving "it depends" energy, because the contents are specific to the particular implementation of the cipher. literally every cipher keeps its own lil' treasure chest. π
now, the important part: this data is automatically allocated and freed by OpenSSL, so applications should not normally free this directly. do not come for it, it's not yours, it's OpenSSL's. (but see below π β there's a plot twist.)
then we have EVP_CIPHER_CTX_set_cipher_data(), and this one lets an application replace the cipher data with new data. it's giving main character takeover. a pointer to any existing cipher data gets returned from this function, and β hear me out β if the old data is no longer required, then it should be freed through a call to OPENSSL_free(). like yes, now it is your problem, bestie. π
π RETURN VALUES π
EVP_CIPHER_CTX_get_cipher_data()returns a pointer to the current cipher data for theEVP_CIPHER_CTX. iconic, straightforward, no drama. β¨EVP_CIPHER_CTX_set_cipher_data()returns a pointer to the old cipher data for theEVP_CIPHER_CTX. the old one, yes. the one you just displaced. poor thing. π₯²
π°οΈ HISTORY π°οΈ
so the EVP_CIPHER_CTX_get_cipher_data() and EVP_CIPHER_CTX_set_cipher_data() functions were added in OpenSSL 1.1.0. like, this is a legacy icon at this point. ate. π₯
π COPYRIGHT π
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>.
like, fr fr, read the license before you do anything. it's not a suggestion, bestie. π«Ά
and that's the whole page, babes π this was EVP_CIPHER_CT...T_CIPHER_DATA(3SSL) from OpenSSL 4.0.3, dated 2026-09-2. go forth and inspect those cipher data objects responsibly, mwah ππ¦β¨
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms