[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Thu May 26 15:49:38 UTC 2016


The branch master has been updated
       via  ea32151f7b9353f8906188d007c6893704ac17bb (commit)
      from  1d00db6b5a50950c6b516688040de4e6da32dd4d (commit)


- Log -----------------------------------------------------------------
commit ea32151f7b9353f8906188d007c6893704ac17bb
Author: Matt Caswell <matt at openssl.org>
Date:   Thu May 26 15:45:14 2016 +0100

    The ssl3_digest_cached_records() function does not handle errors properly
    
    The ssl3_digest_cached_records() function was failing to handle errors
    that might be returned from EVP_DigestSignInit() and
    EVP_DigestSignUpdate().
    
    RT#4180
    
    Reviewed-by: Stephen Henson <steve at openssl.org>

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

Summary of changes:
 ssl/s3_enc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index c1222a7..cb571c1 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -374,14 +374,13 @@ int ssl3_digest_cached_records(SSL *s, int keep)
         }
 
         md = ssl_handshake_md(s);
-        if (md == NULL) {
+        if (   md == NULL
+            || !EVP_DigestInit_ex(s->s3->handshake_dgst, md, NULL)
+            || !EVP_DigestUpdate(s->s3->handshake_dgst, hdata, hdatalen))
+        {
             SSLerr(SSL_F_SSL3_DIGEST_CACHED_RECORDS, ERR_R_INTERNAL_ERROR);
             return 0;
         }
-
-        EVP_DigestInit_ex(s->s3->handshake_dgst, md, NULL);
-        EVP_DigestUpdate(s->s3->handshake_dgst, hdata, hdatalen);
-
     }
     if (keep == 0) {
         BIO_free(s->s3->handshake_buffer);


More information about the openssl-commits mailing list