BIO_GET_DATA(3ossl)
π BIO_GET_DATA(3ossl) β bestie, it's an OpenSSL situation
okay so this is the OpenSSL manual page for a little bundle of functions that let you poke at a BIO's internal state π. Six functions, all about data / init / shutdown flags. Grab a snack, we're getting into it.
β¨ NAME β¨
BIO_set_data, BIO_get_data, BIO_set_init, BIO_get_init, BIO_set_shutdown, BIO_get_shutdown β literally the functions for managing BIO state information π
β¨ SYNOPSIS β¨
#include <openssl/bio.h>
void BIO_set_data(BIO *a, void *ptr);
void *BIO_get_data(BIO *a);
void BIO_set_init(BIO *a, int init);
int BIO_get_init(BIO *a);
void BIO_set_shutdown(BIO *a, int shut);
int BIO_get_shutdown(BIO *a);
πΈ DESCRIPTION πΈ
So here's the vibe: these functions are mainly useful when you're implementing a custom BIO π§. Like, if you're building your own BIO from scratch, this is your little toolkit.
BIO_set_data() associates the custom data pointed to by ptr with the BIO. Later on you can snatch that data back with a call to BIO_get_data(). Custom BIOs use this to stash their implementation-specific info β very "my private little pocket" energy π
.
BIO_set_init() sets the value of the BIO's "init" flag, which tells you whether initialisation has been completed for this BIO or not. A nonzero value = init is done β
. Zero = not done yet π. Often initialisation finishes during the initial construction of the BIO. But for some BIOs, init might not complete until after some extra steps have happened (for example, through calling custom ctrls). BIO_get_init() just returns whatever the "init" flag is currently set to.
BIO_set_shutdown() and BIO_get_shutdown() set and get the state of this BIO's shutdown (i.e. BIO_CLOSE) flag. It's giving "close the door behind you" πͺ. If it's set, then the underlying resource also gets closed when the BIO is freed.
no cap: remember the shutdown flag is basically the BIO_CLOSE flag. Same thing, different name, iykyk.
π¦ RETURN VALUES π¦
BIO_get_data()returns a pointer to the implementation-specific custom data associated with this BIO β orNULLif none has been set π«₯BIO_get_init()returns the state of the BIO's init flag βBIO_get_shutdown()returns the state of the BIO's shutdown (i.e.BIO_CLOSE) flag π₯
π SEE ALSO π
go read those too, bestie, they're iconic π
π HISTORY π
The functions described here were added in OpenSSL 1.1.0. so like, they've been serving for a minute π
π 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>.
that's the whole page, periodt π this was version 3.5.0, dated 2026-09-25 β go forth and manage your BIO state, main character π§β¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms