diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-10-28 07:57:34 +0100 |
---|---|---|
committer | Daiki Ueno <dueno@redhat.com> | 2018-11-11 07:03:43 +0100 |
commit | f39af59c4e7f7062b548c6c97e785bb6b6284371 (patch) | |
tree | 12a3f44d5b74eb55e55d12d69af6d83e9f78a849 | |
parent | 18ae87bb085df1caf2a81b1cd3e81b69e9fb0c45 (diff) | |
download | gnutls-f39af59c4e7f7062b548c6c97e785bb6b6284371.tar.gz |
session_pack: record max_early_data_size in session data
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.c | 10 |
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: |