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 <agl@google.com>
This commit is contained in:
David Benjamin 2015-04-15 16:47:17 -04:00 committed by Adam Langley
parent 546f1a59ef
commit 1004b9564a
3 changed files with 1 additions and 15 deletions

View File

@ -64,8 +64,6 @@
#include <openssl/mem.h>
#include <openssl/thread.h>
#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);
}

View File

@ -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,

View File

@ -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