summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2009-10-28 10:44:18 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2009-10-28 10:46:16 +0200
commit6b4c3dc567fb1435c8392ec2160fdffc236f6b37 (patch)
treeee8d53857eea153d3b8ea861e14e4e3c8a9ff6bf
parent1b98628dfbecc2b6ad6f4c04181956176506cd1e (diff)
downloadgnutls-6b4c3dc567fb1435c8392ec2160fdffc236f6b37.tar.gz
When resuming a session do not overwrite the initial session data with resumed
session data. Discovered on discussion at help-gnutls with Sebastien Decugis.
-rw-r--r--NEWS3
-rw-r--r--lib/gnutls_handshake.c13
2 files changed, 11 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 223066e4c0..644c2e9424 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ See the end for copying conditions.
* Version 2.9.8 (unreleased)
+** libgnutls: In server side when resuming a session do not overwrite the
+initial session data with the resumed session data.
+
** libgnutls: Added support for AES-128,AES-192 and AES-256 in PKCS #8
encryption. This affects also PKCS #12 encoded files.
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 4183122f9d..7423f2737c 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -2841,6 +2841,13 @@ _gnutls_handshake_common (gnutls_session_t session)
ret = _gnutls_send_handshake_final (session, FALSE);
IMED_RET ("send handshake final", ret, 0);
+
+ /* only store if we are not resuming */
+ if (session->security_parameters.entity == GNUTLS_SERVER)
+ {
+ /* in order to support session resuming */
+ _gnutls_server_register_current_session (session);
+ }
}
else
{ /* if we are a client not resuming - or we are a server resuming */
@@ -2867,14 +2874,10 @@ _gnutls_handshake_common (gnutls_session_t session)
ret = _gnutls_recv_handshake_final (session, FALSE);
IMED_RET ("recv handshake final 2", ret, 1);
- }
- if (session->security_parameters.entity == GNUTLS_SERVER)
- {
- /* in order to support session resuming */
- _gnutls_server_register_current_session (session);
}
+
/* clear handshake buffer */
_gnutls_handshake_hash_buffers_clear (session);
return ret;