EVP_CIPHER_CTX_BUF_NOCONST(3ssl)

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

πŸ’… 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 by ctx.
  • EVP_CIPHER_CTX_set_cipher_data() β€” returns a pointer to the old cipher data of ctx and transfers ownership to the caller. 🫢
  • EVP_CIPHER_CTX_buf_noconst() β€” returns a pointer to an internal buffer owned by ctx.

πŸ‘‘ 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