summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-10-02 14:55:01 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-10-10 09:56:20 +0200
commita5146fffeb5922ceee20a46291a55ffeb2f7b838 (patch)
treec8952a3f275d1bb5868ec0617cc88d06c60b7b60
parent29286e4d1b9b71866f78b1353c9fb91076474f52 (diff)
downloadgnutls-a5146fffeb5922ceee20a46291a55ffeb2f7b838.tar.gz
use wait and retransmit when receiving session tickets
-rw-r--r--lib/ext/session_ticket.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ext/session_ticket.c b/lib/ext/session_ticket.c
index af965ee20d..b6a04f0f7a 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>
#define KEY_NAME_SIZE SESSION_TICKET_KEY_NAME_SIZE
#define KEY_SIZE SESSION_TICKET_KEY_SIZE
@@ -642,6 +643,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);