[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Tue Jul 19 23:07:56 UTC 2016


The branch master has been updated
       via  fb9339827bfba3e70719d245e905a22101010678 (commit)
      from  2a5f907edf6887ddccaec22607f82e8577c36091 (commit)


- Log -----------------------------------------------------------------
commit fb9339827bfba3e70719d245e905a22101010678
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Tue Jul 19 16:53:26 2016 +0100

    Send alert on CKE error.
    
    RT#4610
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 ssl/statem/statem_srvr.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index b5cfc4f..07a80f9 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -2355,16 +2355,12 @@ static int tls_process_cke_ecdhe(SSL *s, PACKET *pkt, int *al)
          */
 
         /* Get encoded point length */
-        if (!PACKET_get_1(pkt, &i)) {
+        if (!PACKET_get_1(pkt, &i) || !PACKET_get_bytes(pkt, &data, i)
+            || PACKET_remaining(pkt) != 0) {
             *al = SSL_AD_DECODE_ERROR;
             SSLerr(SSL_F_TLS_PROCESS_CKE_ECDHE, SSL_R_LENGTH_MISMATCH);
             goto err;
         }
-        if (!PACKET_get_bytes(pkt, &data, i)
-                || PACKET_remaining(pkt) != 0) {
-            SSLerr(SSL_F_TLS_PROCESS_CKE_ECDHE, ERR_R_EC_LIB);
-            goto err;
-        }
         ckey = EVP_PKEY_new();
         if (ckey == NULL || EVP_PKEY_copy_parameters(ckey, skey) <= 0) {
             SSLerr(SSL_F_TLS_PROCESS_CKE_ECDHE, ERR_R_EVP_LIB);
@@ -2372,6 +2368,7 @@ static int tls_process_cke_ecdhe(SSL *s, PACKET *pkt, int *al)
         }
         if (EC_KEY_oct2key(EVP_PKEY_get0_EC_KEY(ckey), data, i,
                            NULL) == 0) {
+            *al = SSL_AD_HANDSHAKE_FAILURE;
             SSLerr(SSL_F_TLS_PROCESS_CKE_ECDHE, ERR_R_EC_LIB);
             goto err;
         }


More information about the openssl-commits mailing list