diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-10-02 14:55:01 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-10-10 09:26:57 +0200 |
commit | a0322116bf1ce5640947e961c1b37dca770806ca (patch) | |
tree | f9119a5688c6bb3f2a4df045da767b837aac705f | |
parent | 74344ab30e166fc83fe21cbb671aef745a310259 (diff) | |
download | gnutls-a0322116bf1ce5640947e961c1b37dca770806ca.tar.gz |
use wait and retransmit when receiving session tickets
-rw-r--r-- | lib/ext/session_ticket.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ext/session_ticket.c b/lib/ext/session_ticket.c index 35bad36f12..a51402bef0 100644 --- a/lib/ext/session_ticket.c +++ b/lib/ext/session_ticket.c @@ -33,6 +33,7 @@ #include <gnutls_mbuffers.h> #include <gnutls_extensions.h> #include <gnutls_constate.h> +#include <gnutls_dtls.h> #ifdef ENABLE_SESSION_TICKETS @@ -644,6 +645,17 @@ int _gnutls_recv_new_session_ticket(gnutls_session_t session) if (!priv->session_ticket_renew) return 0; + /* This is the last flight and peer cannot be sure + * we have received it unless we notify him. So we + * wait for a message and retransmit if needed. */ + if (IS_DTLS(session) && !_dtls_is_async(session) && + (gnutls_record_check_pending(session) + + record_check_unprocessed(session)) == 0) { + ret = _dtls_wait_and_retransmit(session); + if (ret < 0) + return gnutls_assert_val(ret); + } + ret = _gnutls_recv_handshake(session, GNUTLS_HANDSHAKE_NEW_SESSION_TICKET, 0, &buf); |