[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Fri Jul 1 18:28:47 UTC 2016


The branch master has been updated
       via  1e16987fc18cce9420dd3b76326b8d25746fa258 (commit)
      from  43cb309053ed3518bdd75dbf05ee96485ea57742 (commit)


- Log -----------------------------------------------------------------
commit 1e16987fc18cce9420dd3b76326b8d25746fa258
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Jul 1 11:58:05 2016 +0100

    Avoid an overflow in constructing the ServerKeyExchange message
    
    We calculate the size required for the ServerKeyExchange message and then
    call BUF_MEM_grow_clean() on the buffer. However we fail to take account of
    2 bytes required for the signature algorithm and 2 bytes for the signature
    length, i.e. we could overflow by 4 bytes. In reality this won't happen
    because the buffer is pre-allocated to a large size that means it should be
    big enough anyway.
    
    Addresses an OCAP Audit issue.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 ssl/statem/statem_srvr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index a88b321..773591c 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -1792,6 +1792,11 @@ int tls_construct_server_key_exchange(SSL *s)
             goto f_err;
         }
         kn = EVP_PKEY_size(pkey);
+        /* Allow space for signature algorithm */
+        if (SSL_USE_SIGALGS(s))
+            kn += 2;
+        /* Allow space for signature length */
+        kn += 2;
     } else {
         pkey = NULL;
         kn = 0;


More information about the openssl-commits mailing list