EVP_CIPHER_CTX_BUF_NOCONST(3ssl)
π EVP_CIPHER_CTX_GET_CIPHE(3) β the inspect-and-poke-the-cipher-context page
okay bestie, welcome to the glow-up of EVP_CIPHER_CTX_GET_CIPHE(3) from the Library Functions Manual (yes the title got clipped mid-word, she's iconic like that, don't come for her π). This is the page for EVP_CIPHER_CTX_get_cipher_data, EVP_CIPHER_CTX_set_cipher_data and EVP_CIPHER_CTX_buf_noconst β the little trio that lets you peek at and mess with EVP_CIPHER_CTX objects. Let's get into it π
β¨ NAME β¨
EVP_CIPHER_CTX_get_cipher_data, EVP_CIPHER_CTX_set_cipher_data, EVP_CIPHER_CTX_buf_noconst β inspect and modify EVP_CIPHER_CTX objects π«Ά
πΈ 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);
unsigned char *
EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx);
π¦ DESCRIPTION π¦
π EVP_CIPHER_CTX_get_cipher_data()
She returns a pointer to the cipher data of ctx. π« And what's in there? Literally depends β the format and content of this data is specific to the algorithm and to the particular implementation of the cipher. For example, this data can be used by engines to store engine specific information. The data is automatically allocated and freed by OpenSSL, so applications and engines should not normally free this directly β but keep reading, there's a "(but see below)" situation going on π.
π EVP_CIPHER_CTX_set_cipher_data()
This one lets an application or engine replace the existing cipher data with new data, transferring ownership of cipher_data to the ctx object. π«± And what do you get back? A pointer to any existing cipher data β returned from this function. So if the old data is no longer required, it should be freed through a call to free(3). Don't just leave her hanging π.
π EVP_CIPHER_CTX_buf_noconst()
This is the backstage pass, ngl β¨ β it provides engines and custom cipher implementations with access to the internal buffer that EVP_EncryptUpdate(3) copies input data into before encrypting it. This function can for example be used inside callback functions installed with EVP_CIPHER_meth_set_do_cipher(3). main character energy fr fr π
π₯ RETURN VALUES π₯
EVP_CIPHER_CTX_get_cipher_data()β returns an internal pointer owned byctx.EVP_CIPHER_CTX_set_cipher_data()β returns a pointer to the old cipher data ofctxand transfers ownership to the caller. π«ΆEVP_CIPHER_CTX_buf_noconst()β returns a pointer to an internal buffer owned byctx.
π SEE ALSO π
evp(3), EVP_CIPHER_meth_new(3), EVP_EncryptInit(3)
β HISTORY β
EVP_CIPHER_CTX_get_cipher_data(), EVP_CIPHER_CTX_set_cipher_data(), and EVP_CIPHER_CTX_buf_noconst() first appeared in OpenSSL 1.1.0 and have been available since OpenBSD 7.1. π§
and that's the whole page, bestie, no cap π β this lil beauty ships from Debian, dated August 26 (the year got chopped off in the footer, so we're not gonna pretend we know it π) and the footer's landing spot reads EVP_CIPHER_CTX_GET_CIPHER_DATA(3). slay, go call your ciphers π
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· OpenSSL
- Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org>
- Copyright (c) 2016 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms