From 1004b9564aa2a2f58b721e0ee46bbe9479778357 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 15 Apr 2015 16:47:17 -0400 Subject: [PATCH] Remove BIO's ex_data. No wrappers were ever added and codesearch confirms no one ever added to it manually. Probably anyone doing complex things with BIOs just made a custom BIO_METHOD. We can put it back with proper functions if the need ever arises. Change-Id: Icb5da7ceeb8f1da6d08f4a8854d53dfa75827d9c Reviewed-on: https://boringssl-review.googlesource.com/4373 Reviewed-by: Adam Langley --- crypto/bio/bio.c | 13 +------------ crypto/internal.h | 1 - include/openssl/bio.h | 2 -- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/crypto/bio/bio.c b/crypto/bio/bio.c index 9b7120b8..b1e79dcc 100644 --- a/crypto/bio/bio.c +++ b/crypto/bio/bio.c @@ -64,8 +64,6 @@ #include #include -#include "../internal.h" - /* BIO_set initialises a BIO structure to have the given type and sets the * reference count to one. It returns one on success or zero on error. */ @@ -78,17 +76,10 @@ static int bio_set(BIO *bio, const BIO_METHOD *method) { bio->method = method; bio->shutdown = 1; - if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data)) { + if (method->create != NULL && !method->create(bio)) { return 0; } - if (method->create != NULL) { - if (!method->create(bio)) { - CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data); - return 0; - } - } - return 1; } @@ -120,8 +111,6 @@ int BIO_free(BIO *bio) { next_bio = BIO_pop(bio); - CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data); - if (bio->method != NULL && bio->method->destroy != NULL) { bio->method->destroy(bio); } diff --git a/crypto/internal.h b/crypto/internal.h index 2dab634e..101f7a86 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -484,7 +484,6 @@ OPENSSL_EXPORT void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int index); * * TODO(fork): WARNING: these are called "INDEX", but they aren't! */ enum { - CRYPTO_EX_INDEX_BIO, CRYPTO_EX_INDEX_SSL, CRYPTO_EX_INDEX_SSL_CTX, CRYPTO_EX_INDEX_SSL_SESSION, diff --git a/include/openssl/bio.h b/include/openssl/bio.h index 7b5232cb..2eabc525 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -789,8 +789,6 @@ struct bio_st { * to |next_bio|. */ struct bio_st *next_bio; /* used by filter BIOs */ size_t num_read, num_write; - - CRYPTO_EX_DATA ex_data; }; #define BIO_C_SET_CONNECT 100