gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_2_9_8-5-g7c69ef1


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_9_8-5-g7c69ef1
Date: Thu, 05 Nov 2009 22:11:28 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=7c69ef158d8e2c7136c8363661a858baaf15155b

The branch, master has been updated
       via  7c69ef158d8e2c7136c8363661a858baaf15155b (commit)
      from  63ebfa84b197d481ab88ff94b8cfc56fca1d5301 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7c69ef158d8e2c7136c8363661a858baaf15155b
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Nov 5 23:42:22 2009 +0200

    Simplified code which was based on older version of internal structures.
    Based on observations by Steve Grubb and Tomas Mraz.

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

Summary of changes:
 lib/gnutls_handshake.c |   33 ++++++++++++---------------------
 1 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 6c2787d..aca1aab 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -1830,20 +1830,14 @@ _gnutls_send_client_hello (gnutls_session_t session, 
int again)
   gnutls_protocol_t hver;
   opaque *extdata = NULL;
   int rehandshake = 0;
-
-  opaque *SessionID =
-    session->internals.resumed_security_parameters.session_id;
   uint8_t session_id_len =
     session->internals.resumed_security_parameters.session_id_size;
 
+  /* note that rehandshake is different than resuming
+   */
   if (session->security_parameters.session_id_size)
     rehandshake = 1;
 
-  if (SessionID == NULL)
-    session_id_len = 0;
-  else if (session_id_len == 0)
-    SessionID = NULL;
-
   if (again == 0)
     {
 
@@ -1873,15 +1867,16 @@ _gnutls_send_client_hello (gnutls_session_t session, 
int again)
       /* if we are resuming a session then we set the
        * version number to the previously established.
        */
-      if (SessionID == NULL)
+      if (session_id_len == 0)
        {
-         if (rehandshake)      /* already negotiated version thus version_max 
== negotiated version */
-           hver = session->security_parameters.version;
-         else
-           hver = _gnutls_version_max (session);
+          if (rehandshake) /* already negotiated version thus version_max == 
negotiated version */
+            hver = session->security_parameters.version;
+          else /* new handshake. just get the max */
+            hver = _gnutls_version_max (session);
        }
       else
-       {                       /* we are resuming a session */
+       {
+         /* we are resuming a session */
          hver = session->internals.resumed_security_parameters.version;
        }
 
@@ -1938,7 +1933,7 @@ _gnutls_send_client_hello (gnutls_session_t session, int 
again)
 
       if (session_id_len > 0)
        {
-         memcpy (&data[pos], SessionID, session_id_len);
+         memcpy (&data[pos], 
session->internals.resumed_security_parameters.session_id, session_id_len);
          pos += session_id_len;
        }
 
@@ -2047,13 +2042,9 @@ _gnutls_send_server_hello (gnutls_session_t session, int 
again)
   int pos = 0;
   int datalen, ret = 0;
   uint8_t comp;
-  opaque *SessionID = session->security_parameters.session_id;
   uint8_t session_id_len = session->security_parameters.session_id_size;
   opaque buf[2 * TLS_MAX_SESSION_ID_SIZE + 1];
 
-  if (SessionID == NULL)
-    session_id_len = 0;
-
   datalen = 0;
 
 #ifdef ENABLE_SRP
@@ -2117,12 +2108,12 @@ _gnutls_send_server_hello (gnutls_session_t session, 
int again)
       data[pos++] = session_id_len;
       if (session_id_len > 0)
        {
-         memcpy (&data[pos], SessionID, session_id_len);
+         memcpy (&data[pos], session->security_parameters.session_id, 
session_id_len);
        }
       pos += session_id_len;
 
       _gnutls_handshake_log ("HSK[%p]: SessionID: %s\n", session,
-                            _gnutls_bin2hex (SessionID, session_id_len,
+                            _gnutls_bin2hex 
(session->security_parameters.session_id, session_id_len,
                                              buf, sizeof (buf)));
 
       memcpy (&data[pos],


hooks/post-receive
-- 
GNU gnutls




reply via email to

[Prev in Thread] Current Thread [Next in Thread]