Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
NAME
BIO_push, BIO_pop, BIO_set_next — manipulate BIO chainsSYNOPSIS
#include <openssl/bio.h>BIO_push(BIO *b, BIO *new_tail);
BIO_pop(BIO *b);
BIO_set_next(BIO *b, BIO *new_tail);
DESCRIPTION
BIOs can be joined together to form chains. A chain normally consists of one or more filter BIOs and one source/sink BIO at the end. Data read from or written to the first BIO traverses the chain to the end.RETURN VALUES
BIO_push() returns b if it is not NULL or new_tail if it is.EXAMPLES
For these examples suppose md1 and md2 are digest BIOs, b64 is a Base64 BIO and f is a file BIO (see BIO_f_md(3), BIO_f_base64(3), and BIO_s_file(3), respectively).BIO_push(b64, f);
BIO_push(md2, b64); BIO_push(md1, md2);
BIO_pop(md2);
HISTORY
BIO_push() first appeared in SSLeay 0.6.0. BIO_pop() first appeared in SSLeay 0.6.4. Both functions have been available since OpenBSD 2.4.CAVEATS
Creating a cyclic chain results in undefined behavior. For example, infinite recursion or infinite loops may ensue.BIO *btest; for (btest = new_tail; btest != NULL; btest = BIO_next(btest)) if (btest == b) /* Bail out because this would create a cycle. */ BIO_push(b, new_tail); /* This is now safe. */