BIO_GET_DATA(3ossl)
π
bestie's guide to BIO_GET_DATA(3ossl) π
okay so this is the OpenSSL manual page BIO_GET_DATA(3ossl), and it's literally about a whole little squad of functions for managing BIO state information. If you're implementing a custom BIO, this is your group chat. If you're not, bestie, read the warnings first. π«Ά
β¨ NAME β¨
BIO_set_data, BIO_get_data, BIO_set_init, BIO_get_init, BIO_set_shutdown, BIO_get_shutdown β functions for managing BIO state information. Periodt. π
πΈ 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 π¦
These functions are for when you're implementing a custom BIO. That's the vibe. β¨
BIO_set_data()β associates the custom data pointed to byptrwith theBIO. You can get it back later withBIO_get_data(). Custom BIOs use this for storing implementation specific information. iykyk.BIO_set_init()β sets the value of theBIO's"init"flag to say whether initialisation has been completed for thisBIOor not. A nonzero value means initialisation is complete; zero means it's not. Often initialisation finishes during the initial construction of theBIO. For some BIOs, though, initialisation may not complete until after additional steps have happened (for example, through calling custom ctrls). TheBIO_get_init()function returns the value of the"init"flag.BIO_set_shutdown()andBIO_get_shutdown()β set and get the state of thisBIO's shutdown (i.e.BIO_CLOSE) flag. If it's set, then the underlying resource is also closed when theBIOis freed. π
π¨ WARNINGS π¨
Do not useBIO_set_data(),BIO_get_data(),BIO_set_init(), orBIO_get_init()outside the implementation of a customBIO. That's the rule, no cap.
Calling BIO_set_data() on an existing BIO implementation with data that it does not expect will lead to unexpected results. π
π RETURN VALUES π
BIO_get_data()β returns a pointer to the implementation specific custom data associated with thisBIO, orNULLif none has been set.BIO_get_init()β returns the state of theBIO's init flag.BIO_get_shutdown()β returns the stat of theBIO's shutdown (i.e.BIO_CLOSE) flag. Yes, the original really says "stat" π keep the sacred text.
π SEE ALSO π
π HISTORY π
The functions described here were added in OpenSSL 1.1.0.
π COPYRIGHT π
Copyright 2016-2026 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>.
okay bestie, that's the whole BIO_GET_DATA(3ossl) era. This manual page is from OpenSSL 3.5.6, dated 2026-04-07. Go manage your BIO state responsibly, mwah πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms