diff options
author | David Benjamin <davidben@chromium.org> | 2014-12-23 19:41:02 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-01-15 00:05:41 +0300 |
commit | b8a56f112f9a1963654796ce76ea3fd9a1e3336f (patch) | |
tree | 803c4971b0bd83f2d1a6a47786bac9d620a2b98d /ssl/ssl_lib.c | |
parent | e95d20dcb80523bf9bc6a9c5682856c8371e0a96 (diff) |
Remove dead code from EVP_CIPHER codepaths.
Everything is an AEAD now.
Change-Id: Ib47638e128843fc8299c3dbf9bd60c01eb5afa16
Reviewed-on: https://boringssl-review.googlesource.com/2700
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r-- | ssl/ssl_lib.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 9e5af760..d179dc85 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -208,8 +208,6 @@ int SSL_clear(SSL *s) { s->packet_length = 0; ssl_clear_cipher_ctx(s); - ssl_clear_hash_ctx(&s->read_hash); - ssl_clear_hash_ctx(&s->write_hash); if (s->next_proto_negotiated) { OPENSSL_free(s->next_proto_negotiated); @@ -607,8 +605,6 @@ void SSL_free(SSL *s) { } ssl_clear_cipher_ctx(s); - ssl_clear_hash_ctx(&s->read_hash); - ssl_clear_hash_ctx(&s->write_hash); if (s->cert != NULL) { ssl_cert_free(s->cert); @@ -2365,8 +2361,6 @@ void SSL_set_accept_state(SSL *s) { s->handshake_func = s->method->ssl_accept; /* clear the current cipher */ ssl_clear_cipher_ctx(s); - ssl_clear_hash_ctx(&s->read_hash); - ssl_clear_hash_ctx(&s->write_hash); } void SSL_set_connect_state(SSL *s) { @@ -2376,8 +2370,6 @@ void SSL_set_connect_state(SSL *s) { s->handshake_func = s->method->ssl_connect; /* clear the current cipher */ ssl_clear_cipher_ctx(s); - ssl_clear_hash_ctx(&s->read_hash); - ssl_clear_hash_ctx(&s->write_hash); } int ssl_undefined_function(SSL *s) { @@ -2426,18 +2418,6 @@ const char *SSL_SESSION_get_version(const SSL_SESSION *sess) { } void ssl_clear_cipher_ctx(SSL *s) { - if (s->enc_read_ctx != NULL) { - EVP_CIPHER_CTX_cleanup(s->enc_read_ctx); - OPENSSL_free(s->enc_read_ctx); - s->enc_read_ctx = NULL; - } - - if (s->enc_write_ctx != NULL) { - EVP_CIPHER_CTX_cleanup(s->enc_write_ctx); - OPENSSL_free(s->enc_write_ctx); - s->enc_write_ctx = NULL; - } - if (s->aead_read_ctx != NULL) { EVP_AEAD_CTX_cleanup(&s->aead_read_ctx->ctx); OPENSSL_free(s->aead_read_ctx); @@ -3186,27 +3166,6 @@ uint16_t ssl3_version_from_wire(SSL *s, uint16_t wire_version) { return version; } -/* Allocates new EVP_MD_CTX and sets pointer to it into given pointer vairable, - * freeing EVP_MD_CTX previously stored in that variable, if any. If EVP_MD - * pointer is passed, initializes ctx with this md Returns newly allocated - * ctx. */ -EVP_MD_CTX *ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md) { - ssl_clear_hash_ctx(hash); - *hash = EVP_MD_CTX_create(); - if (md != NULL && *hash != NULL && !EVP_DigestInit_ex(*hash, md, NULL)) { - EVP_MD_CTX_destroy(*hash); - *hash = NULL; - } - return *hash; -} - -void ssl_clear_hash_ctx(EVP_MD_CTX **hash) { - if (*hash) { - EVP_MD_CTX_destroy(*hash); - } - *hash = NULL; -} - int SSL_cache_hit(SSL *s) { return s->hit; } int SSL_is_server(SSL *s) { return s->server; } |