BIO_FIND_TYPE(3ossl)
π BIO_FIND_TYPE(3ossl) β the OpenSSL glow-up edition π¦
okay so bestie, you know how a BIO chain is basically a little friend group of BIOs all linked together? this page is literally the manual for walking down that group chat and finding the right person. it's BIO_find_type, BIO_next, and BIO_method_type β BIO chain traversal, periodt. β¨
πΈ 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);
like, copy it exactly, don't be cute with it π
π DESCRIPTION π
π BIO_find_type() β the "where's my bestie" function
so BIO_find_type() goes hunting for a BIO of a given type inside a chain, starting at BIO b. and here's the tea on how the search behaves:
- if type is a specific type (like
BIO_TYPE_MEM), it searches for a BIO of that exact type π - if type is a general type (like
BIO_TYPE_SOURCE_SINK), it searches for the next matching BIO of that general type - it returns the next matching BIO, or
NULLif there's literally none to be found π - and if type is
BIO_TYPE_NONE, it will not find a match β no cap, that's a dead end π
the general types that are defined are, and I quote:
BIO_TYPE_DESCRIPTORBIO_TYPE_FILTERBIO_TYPE_SOURCE_SINK
for the whole list of the specific types, go look at the <openssl/bio.h> header file β that's where they all live π«Ά
π¦ BIO_next() β the one that keeps it moving
BIO_next() returns the next BIO in a chain. you can use it to stroll through all the BIOs in a chain, or you can team it up with BIO_find_type() to find literally every BIO of a certain type. iconic duo behavior, honestly π
β BIO_method_type() β the vibe check
BIO_method_type() returns the type of a BIO. that's it, that's the function. short and slay π
β¨ RETURN VALUES β¨
BIO_find_type()β returns a matching BIO, orNULLfor no match πBIO_next()β returns the next BIO in a chainBIO_method_type()β returns the type of the BIOb
π₯ EXAMPLES π₯
here's you traversing a chain looking for digest BIOs β main character energy fr fr:
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);
the way this loop just keeps finding them and moving on β obsessed π§
π 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>.
so yeah, that's the whole page π this was OpenSSL 3.5.6, dated 2026-04-07, and the man page is BIO_FIND_TYPE(3ossl) β go forth and traverse those chains, bestie, you've got this ππβ
π¦ 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