summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-10-28 07:57:34 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2018-10-29 10:20:40 +0100
commit6e236f362ec9484b53532f696c08208101c62db9 (patch)
tree0565e206209ad803171a5d41a81bbe02203c90c2
parent66ff2535625e8f5e9ceabde96f80d5c979c928a2 (diff)
downloadgnutls-tmp-0rtt-test.tar.gz
session_pack: record max_early_data_size in session datatmp-0rtt-test
max_early_data_size sent as part of NST should be recorded and restored when the session data is set back on the session. Signed-off-by: Daiki Ueno <dueno@redhat.com>
-rw-r--r--lib/session_pack.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/session_pack.c b/lib/session_pack.c
index b83c9c7440..54c1c15d5a 100644
--- a/lib/session_pack.c
+++ b/lib/session_pack.c
@@ -311,8 +311,7 @@ _gnutls_session_unpack(gnutls_session_t session,
* 1 bytes the resumption master secret length
* x bytes the resumption master secret
* 12 bytes the ticket arrival time
- *
- * WE DON'T STORE NewSessionTicket EXTENSIONS, as we don't support them yet.
+ * 4 bytes the max early data size
*
* We only store that info if we received a TLS 1.3 NewSessionTicket at some point.
* If we didn't receive any NST then we cannot resume a TLS 1.3 session and hence
@@ -348,6 +347,10 @@ tls13_pack_security_parameters(gnutls_session_t session, gnutls_buffer_st *ps)
length += (1 + ticket->prf->output_size);
BUFFER_APPEND_TS(ps, ticket->arrival_time);
length += 12;
+ BUFFER_APPEND_NUM(ps,
+ session->security_parameters.
+ max_early_data_size);
+ length += 4;
/* Overwrite the length field */
_gnutls_write_uint32(length, ps->data + length_pos);
@@ -396,6 +399,9 @@ tls13_unpack_security_parameters(gnutls_session_t session, gnutls_buffer_st *ps)
ticket->prf = session->internals.resumed_security_parameters.prf;
BUFFER_POP_TS(ps, ticket->arrival_time);
+ BUFFER_POP_NUM(ps,
+ session->security_parameters.
+ max_early_data_size);
}
error: