diff options
author | Richard Levitte <levitte@openssl.org> | 2015-12-13 22:08:41 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-01-12 13:52:22 +0100 |
commit | 846ec07d904f9cc81d486db0db14fb84f61ff6e5 (patch) | |
tree | 95f8e06e1e66296e20ade5ce79e098216ddbdf99 /ssl/s3_enc.c | |
parent | 936166aff21dafed33aeb92bad0a5b46d730221d (diff) |
Adapt all EVP_CIPHER_CTX users for it becoming opaque
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/s3_enc.c')
-rw-r--r-- | ssl/s3_enc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index c20bff2e75..7a1e201cf4 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -228,14 +228,13 @@ int ssl3_change_cipher_state(SSL *s, int which) if (which & SSL3_CC_READ) { if (s->enc_read_ctx != NULL) reuse_dd = 1; - else if ((s->enc_read_ctx = - OPENSSL_malloc(sizeof(*s->enc_read_ctx))) == NULL) + else if ((s->enc_read_ctx = EVP_CIPHER_CTX_new()) == NULL) goto err; else /* * make sure it's intialized in case we exit later with an error */ - EVP_CIPHER_CTX_init(s->enc_read_ctx); + EVP_CIPHER_CTX_reset(s->enc_read_ctx); dd = s->enc_read_ctx; if (ssl_replace_hash(&s->read_hash, m) == NULL) { @@ -262,14 +261,13 @@ int ssl3_change_cipher_state(SSL *s, int which) } else { if (s->enc_write_ctx != NULL) reuse_dd = 1; - else if ((s->enc_write_ctx = - OPENSSL_malloc(sizeof(*s->enc_write_ctx))) == NULL) + else if ((s->enc_write_ctx = EVP_CIPHER_CTX_new()) == NULL) goto err; else /* * make sure it's intialized in case we exit later with an error */ - EVP_CIPHER_CTX_init(s->enc_write_ctx); + EVP_CIPHER_CTX_reset(s->enc_write_ctx); dd = s->enc_write_ctx; if (ssl_replace_hash(&s->write_hash, m) == NULL) { SSLerr(SSL_F_SSL3_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR); @@ -293,7 +291,7 @@ int ssl3_change_cipher_state(SSL *s, int which) } if (reuse_dd) - EVP_CIPHER_CTX_cleanup(dd); + EVP_CIPHER_CTX_reset(dd); p = s->s3->tmp.key_block; i = EVP_MD_size(m); |