diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2009-10-28 10:44:18 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2009-10-28 10:46:16 +0200 |
commit | 6b4c3dc567fb1435c8392ec2160fdffc236f6b37 (patch) | |
tree | ee8d53857eea153d3b8ea861e14e4e3c8a9ff6bf /lib | |
parent | 1b98628dfbecc2b6ad6f4c04181956176506cd1e (diff) | |
download | gnutls-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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gnutls_handshake.c | 13 |
1 files changed, 8 insertions, 5 deletions
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; |