diff options
Diffstat (limited to 'src/lib/libcrypto/bio/bio_lib.c')
-rw-r--r-- | src/lib/libcrypto/bio/bio_lib.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index 4e5405d6af..b2acd01342 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bio_lib.c,v 1.24 2018/02/18 12:58:25 tb Exp $ */ | 1 | /* $OpenBSD: bio_lib.c,v 1.25 2018/02/20 17:15:27 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -64,6 +64,20 @@ | |||
64 | #include <openssl/err.h> | 64 | #include <openssl/err.h> |
65 | #include <openssl/stack.h> | 65 | #include <openssl/stack.h> |
66 | 66 | ||
67 | int | ||
68 | BIO_get_new_index(void) | ||
69 | { | ||
70 | static int bio_type_index = BIO_TYPE_START; | ||
71 | int index; | ||
72 | |||
73 | /* The index will collide with the BIO flag bits if it exceeds 255. */ | ||
74 | index = CRYPTO_add(&bio_type_index, 1, CRYPTO_LOCK_BIO); | ||
75 | if (index > 255) | ||
76 | return -1; | ||
77 | |||
78 | return index; | ||
79 | } | ||
80 | |||
67 | BIO * | 81 | BIO * |
68 | BIO_new(BIO_METHOD *method) | 82 | BIO_new(BIO_METHOD *method) |
69 | { | 83 | { |