diff options
author | slontis <shane.lontis@oracle.com> | 2024-03-04 13:08:08 +1100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2024-03-11 11:34:25 +0000 |
commit | d60b37506da65f3aebc5043984b3ec78fd53f75f (patch) | |
tree | ce52cc280c0364565853767cf3e2af69e5f3ac74 /doc | |
parent | 53a8728686663f4fe044cd1a5757f6fcfd777317 (diff) |
Fix BIO_get_new_index() to return an error when it is exhausted.
Fixes #23655
BIO_get_new_index() returns a range of 129..255.
It is set to BIO_TYPE_START (128) initially and is incremented on each
call.
>= 256 is reserved for the class type flags (BIO_TYPE_DESCRIPTOR) so it
should error if it reaches the upper bound.
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23732)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/man3/BIO_find_type.pod | 14 | ||||
-rw-r--r-- | doc/man3/BIO_meth_new.pod | 10 |
2 files changed, 14 insertions, 10 deletions
diff --git a/doc/man3/BIO_find_type.pod b/doc/man3/BIO_find_type.pod index 99bab8cce8..452c29c1bf 100644 --- a/doc/man3/BIO_find_type.pod +++ b/doc/man3/BIO_find_type.pod @@ -14,12 +14,12 @@ BIO_find_type, BIO_next, BIO_method_type - BIO chain traversal =head1 DESCRIPTION -The BIO_find_type() searches for a BIO of a given type in a chain, starting -at BIO B<b>. If B<type> is a specific type (such as B<BIO_TYPE_MEM>) then a search -is made for a BIO of that type. If B<type> is a general type (such as -B<BIO_TYPE_SOURCE_SINK>) then the next matching BIO of the given general type is -searched for. BIO_find_type() returns the next matching BIO or NULL if none is -found. +The BIO_find_type() searches for a B<BIO> of a given type in a chain, starting +at B<BIO> I<b>. If I<type> is a specific type (such as B<BIO_TYPE_MEM>) then a +search is made for a B<BIO> of that type. If I<type> is a general type (such as +B<BIO_TYPE_SOURCE_SINK>) then the next matching B<BIO> of the given general type is +searched for. BIO_find_type() returns the next matching B<BIO> or NULL if none is +found. If I<type> is B<BIO_TYPE_NONE> it will not find a match. The following general types are defined: B<BIO_TYPE_DESCRIPTOR>, B<BIO_TYPE_FILTER>, and B<BIO_TYPE_SOURCE_SINK>. @@ -38,7 +38,7 @@ BIO_find_type() returns a matching BIO or NULL for no match. BIO_next() returns the next BIO in a chain. -BIO_method_type() returns the type of the BIO B<b>. +BIO_method_type() returns the type of the BIO I<b>. =head1 EXAMPLES diff --git a/doc/man3/BIO_meth_new.pod b/doc/man3/BIO_meth_new.pod index 5be14b2a28..589c1b18fc 100644 --- a/doc/man3/BIO_meth_new.pod +++ b/doc/man3/BIO_meth_new.pod @@ -82,9 +82,13 @@ The B<BIO_METHOD> type is a structure used for the implementation of new BIO types. It provides a set of functions used by OpenSSL for the implementation of the various BIO capabilities. See the L<bio(7)> page for more information. -BIO_meth_new() creates a new B<BIO_METHOD> structure. It should be given a -unique integer B<type> and a string that represents its B<name>. -Use BIO_get_new_index() to get the value for B<type>. +BIO_meth_new() creates a new B<BIO_METHOD> structure that contains a type +identifier I<type> and a string that represents its B<name>. +B<type> can be set to either B<BIO_TYPE_NONE> or via BIO_get_new_index() if +a unique type is required for searching (See L<BIO_find_type(3)>) + +Note that BIO_get_new_index() can only be used 127 times before it returns an +error. The set of standard OpenSSL provided BIO types is provided in F<< <openssl/bio.h> >>. |