[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Sun Jun 21 14:30:25 UTC 2015


The branch master has been updated
       via  d480e182fe20fcaeca7817a4693eeaf594bb1a32 (commit)
       via  85fb6fdaed74d6091817ce5da17fcc737f36a51f (commit)
      from  bc9567cdc9a56b5c904e075e3b929076c1e7583c (commit)


- Log -----------------------------------------------------------------
commit d480e182fe20fcaeca7817a4693eeaf594bb1a32
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Sat Jun 20 15:44:03 2015 +0100

    Avoid duplication.
    
    We always free the handshake buffer when digests are freed so move
    it into ssl_free_digest_list()
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 85fb6fdaed74d6091817ce5da17fcc737f36a51f
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Sat Jun 20 15:37:22 2015 +0100

    remove unnecessary NULL checks
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 ssl/s3_enc.c | 11 ++++++++---
 ssl/s3_lib.c | 10 ++--------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index dd93e25..eedf74d 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -476,16 +476,21 @@ void ssl3_cleanup_key_block(SSL *s)
 
 void ssl3_init_finished_mac(SSL *s)
 {
-    BIO_free(s->s3->handshake_buffer);
-    if (s->s3->handshake_dgst)
-        ssl3_free_digest_list(s);
+    ssl3_free_digest_list(s);
     s->s3->handshake_buffer = BIO_new(BIO_s_mem());
     (void)BIO_set_close(s->s3->handshake_buffer, BIO_CLOSE);
 }
 
+/*
+ * Free digest list. Also frees handshake buffer since they are always freed
+ * together.
+ */
+
 void ssl3_free_digest_list(SSL *s)
 {
     int i;
+    BIO_free(s->s3->handshake_buffer);
+    s->s3->handshake_buffer = NULL;
     if (!s->s3->handshake_dgst)
         return;
     for (i = 0; i < SSL_MAX_DIGEST; i++) {
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 8784642..36b5f0d 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -2905,9 +2905,7 @@ void ssl3_free(SSL *s)
     OPENSSL_free(s->s3->tmp.ciphers_raw);
     OPENSSL_clear_free(s->s3->tmp.pms, s->s3->tmp.pmslen);
     OPENSSL_free(s->s3->tmp.peer_sigalgs);
-    BIO_free(s->s3->handshake_buffer);
-    if (s->s3->handshake_dgst)
-        ssl3_free_digest_list(s);
+    ssl3_free_digest_list(s);
     OPENSSL_free(s->s3->alpn_selected);
 
 #ifndef OPENSSL_NO_SRP
@@ -2941,11 +2939,7 @@ void ssl3_clear(SSL *s)
 #endif                         /* !OPENSSL_NO_EC */
 
     init_extra = s->s3->init_extra;
-    BIO_free(s->s3->handshake_buffer);
-    s->s3->handshake_buffer = NULL;
-    if (s->s3->handshake_dgst) {
-        ssl3_free_digest_list(s);
-    }
+    ssl3_free_digest_list(s);
 
     if (s->s3->alpn_selected) {
         OPENSSL_free(s->s3->alpn_selected);


More information about the openssl-commits mailing list