BIO_FIND_TYPE(3ossl)
π BIO_FIND_TYPE β bestie edition π
okay so this is the BIO_FIND_TYPE(3ossl) page from the OpenSSL manual, and it's literally all about walking a BIO chain like it's a group chat and you're scrolling for the one message that matters. no cap.
β¨ NAME β¨
BIO_find_type, BIO_next, BIO_method_type β BIO chain traversal, aka "how do I find my fave in a whole crowd of BIOs" π¦
β¨ SYNOPSIS β¨
#include <openssl/bio.h>
BIO *BIO_find_type(BIO *b, int bio_type);
BIO *BIO_next(BIO *b);
int BIO_method_type(const BIO *b);
β¨ DESCRIPTION β¨
so BIO_find_type() is the search bestie π β it hunts for a BIO of a given type in a chain, and it starts the hunt at BIO b.
if type is a specific type (think something like BIO_TYPE_MEM), then it goes looking for a BIO of exactly that type. if type is a general type (think something like BIO_TYPE_SOURCE_SINK), then it goes looking for the next matching BIO of that general type instead.
BIO_find_type() hands you back the next matching BIO, or NULL if there's just... nothing there π. and heads up β if type is BIO_TYPE_NONE, it will not find a match. like, at all. it's giving "searching for the void."
the general types that are defined are: BIO_TYPE_DESCRIPTOR, BIO_TYPE_FILTER, and BIO_TYPE_SOURCE_SINK. π
for the full list of specific types, go peek at the <openssl/bio.h> header file β that's where they all live.
BIO_next() returns the next BIO in a chain. you can use it to walk through every BIO in a chain, or you can team it up with BIO_find_type() to catch all the BIOs of a certain type. dynamic duo energy fr fr π«Ά
BIO_method_type() returns the type of a BIO.
β¨ RETURN VALUES β¨
BIO_find_type()β returns a matching BIO, orNULLfor no match. no match = no vibe πBIO_next()β returns the next BIO in a chain.BIO_method_type()β returns the type of the BIOb.
β¨ EXAMPLES β¨
here's us traversing a chain, looking for digest BIOs (the main characters, obviously π):
BIO *btmp;
btmp = in_bio; /* in_bio is chain to search through */
do {
btmp = BIO_find_type(btmp, BIO_TYPE_MD);
if (btmp == NULL)
break; /* Not found */
/* btmp is a digest BIO, do something with it ...*/
...
btmp = BIO_next(btmp);
} while (btmp);
β¨ COPYRIGHT β¨
Copyright 2000-2024 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>.
lowkey important: that license thing is not a suggestion bestie, actually comply with it π
and that's the whole page!! this was OpenSSL 3.5.9, dated 2026-09-29, and honestly? iconic. slay, go traverse your chains responsibly πβ¨
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms