summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorslontis <shane.lontis@oracle.com>2024-03-04 13:08:08 +1100
committerMatt Caswell <matt@openssl.org>2024-03-11 11:34:25 +0000
commitd60b37506da65f3aebc5043984b3ec78fd53f75f (patch)
treece52cc280c0364565853767cf3e2af69e5f3ac74 /include
parent53a8728686663f4fe044cd1a5757f6fcfd777317 (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 'include')
-rw-r--r--include/openssl/bio.h.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/openssl/bio.h.in b/include/openssl/bio.h.in
index d1a29bee32..a118aeeece 100644
--- a/include/openssl/bio.h.in
+++ b/include/openssl/bio.h.in
@@ -71,7 +71,10 @@ extern "C" {
# define BIO_TYPE_DGRAM_PAIR (26|BIO_TYPE_SOURCE_SINK)
# define BIO_TYPE_DGRAM_MEM (27|BIO_TYPE_SOURCE_SINK)
+/* Custom type starting index returned by BIO_get_new_index() */
#define BIO_TYPE_START 128
+/* Custom type maximum index that can be returned by BIO_get_new_index() */
+#define BIO_TYPE_MASK 0xFF
/*
* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.