[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Fri Nov 6 15:37:04 UTC 2015


The branch master has been updated
       via  8d16c58fa4d4ef1d6394c2a6ad5ca93c095808e6 (commit)
       via  e6575156204dfd50a63f6afbe98f6714d0799764 (commit)
      from  b8fb59897b707d53137a66ec054173c161a9f0ae (commit)


- Log -----------------------------------------------------------------
commit 8d16c58fa4d4ef1d6394c2a6ad5ca93c095808e6
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Nov 6 09:54:39 2015 +0000

    Remove some redundant assignments
    
    We were setting |s->renegotiate| and |s->new_session| to 0 twice in
    tls_finish_handshake. This is redundant so now we just do it once!
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

commit e6575156204dfd50a63f6afbe98f6714d0799764
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Nov 6 09:47:18 2015 +0000

    Don't finish the handshake twice
    
    We finish the handshake when we move into the TLS_ST_OK state. At various
    points we were also unnecessarily finishing it when we were reading/writing
    the Finished message. It's much simpler just to do it in TLS_ST_OK, so
    remove the other calls.
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

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

Summary of changes:
 ssl/statem/statem_clnt.c | 8 --------
 ssl/statem/statem_lib.c  | 5 +----
 ssl/statem/statem_srvr.c | 6 ------
 3 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c
index c9d760f..4684098 100644
--- a/ssl/statem/statem_clnt.c
+++ b/ssl/statem/statem_clnt.c
@@ -622,9 +622,6 @@ WORK_STATE ossl_statem_client_post_work(SSL *s, WORK_STATE wst)
 #endif
         if (statem_flush(s) != 1)
             return WORK_MORE_B;
-
-        if (s->hit && tls_finish_handshake(s, WORK_MORE_A) != 1)
-                return WORK_ERROR;
         break;
 
     default:
@@ -801,11 +798,6 @@ WORK_STATE ossl_statem_client_post_process_message(SSL *s, WORK_STATE wst)
         return WORK_FINISHED_STOP;
 #endif
 
-    case TLS_ST_CR_FINISHED:
-        if (!s->hit)
-            return tls_finish_handshake(s, wst);
-        else
-            return WORK_FINISHED_STOP;
     default:
         break;
     }
diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c
index 2c100dc..2f13e92 100644
--- a/ssl/statem/statem_lib.c
+++ b/ssl/statem/statem_lib.c
@@ -331,7 +331,7 @@ MSG_PROCESS_RETURN tls_process_finished(SSL *s, PACKET *pkt)
         s->s3->previous_server_finished_len = i;
     }
 
-    return MSG_PROCESS_CONTINUE_PROCESSING;
+    return MSG_PROCESS_FINISHED_READING;
  f_err:
     ssl3_send_alert(s, SSL3_AL_FATAL, al);
     ossl_statem_set_error(s);
@@ -405,9 +405,6 @@ WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst)
         s->new_session = 0;
 
         if (s->server) {
-            s->renegotiate = 0;
-            s->new_session = 0;
-
             ssl_update_cache(s, SSL_SESS_CACHE_SERVER);
 
             s->ctx->stats.sess_accept_good++;
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index 6f51d5d..0689da0 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -876,12 +876,6 @@ WORK_STATE ossl_statem_server_post_process_message(SSL *s, WORK_STATE wst)
 #endif
         return WORK_FINISHED_CONTINUE;
 
-
-    case TLS_ST_SR_FINISHED:
-        if (s->hit)
-            return tls_finish_handshake(s, wst);
-        else
-            return WORK_FINISHED_STOP;
     default:
         break;
     }


More information about the openssl-commits mailing list