summaryrefslogtreecommitdiff
path: root/lib/session_pack.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2019-01-30 10:21:07 +0100
committerDaiki Ueno <dueno@redhat.com>2019-02-14 13:23:09 +0100
commitf1d654af712ef0776cb00825dbe8bf4e7e1c71a4 (patch)
treee76a7557ca8d52c918c6f05ba149fff7380e70c8 /lib/session_pack.c
parent914f6fc1ae4953db7a02e7290db67a33f1b48689 (diff)
downloadgnutls-f1d654af712ef0776cb00825dbe8bf4e7e1c71a4.tar.gz
session_pack: reset max_record_recv_size when packing
Signed-off-by: Daiki Ueno <dueno@redhat.com>
Diffstat (limited to 'lib/session_pack.c')
-rw-r--r--lib/session_pack.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/session_pack.c b/lib/session_pack.c
index eec594e38e..da74f45e0c 100644
--- a/lib/session_pack.c
+++ b/lib/session_pack.c
@@ -923,9 +923,18 @@ pack_security_parameters(gnutls_session_t session, gnutls_buffer_st * ps)
BUFFER_APPEND_NUM(ps,
session->security_parameters.
max_record_send_size);
- BUFFER_APPEND_NUM(ps,
- session->security_parameters.
- max_record_recv_size);
+
+ /* reset max_record_recv_size if it was negotiated
+ * using the record_size_limit extension */
+ if (session->internals.hsk_flags & HSK_RECORD_SIZE_LIMIT_NEGOTIATED) {
+ BUFFER_APPEND_NUM(ps,
+ session->security_parameters.
+ max_record_send_size);
+ } else {
+ BUFFER_APPEND_NUM(ps,
+ session->security_parameters.
+ max_record_recv_size);
+ }
if (session->security_parameters.grp) {
BUFFER_APPEND_NUM(ps, session->security_parameters.grp->id);