Fix BIO_get_new_index() to return an error when it is exhausted.
authorslontis <shane.lontis@oracle.com>
Mon, 4 Mar 2024 02:08:08 +0000 (13:08 +1100)
committerMatt Caswell <matt@openssl.org>
Mon, 11 Mar 2024 11:34:25 +0000 (11:34 +0000)
commitd60b37506da65f3aebc5043984b3ec78fd53f75f
treece52cc280c0364565853767cf3e2af69e5f3ac74
parent53a8728686663f4fe044cd1a5757f6fcfd777317
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)
CHANGES.md
crypto/bio/bio_lib.c
crypto/bio/bio_meth.c
doc/man3/BIO_find_type.pod
doc/man3/BIO_meth_new.pod
include/openssl/bio.h.in
test/bio_meth_test.c [new file with mode: 0644]
test/build.info
test/recipes/61-test_bio_meth.t [new file with mode: 0644]