diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2012-06-30 00:07:49 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-06-30 18:36:45 +0200 |
commit | d2e9c28db1e26f296789af6c7bad176cfda708fc (patch) | |
tree | 700bb249dbd27edffff1fb5175a67c2cfb737f92 | |
parent | b9762f94d922d3afe37682ff9bd74906c7d1e106 (diff) | |
download | gnutls-d2e9c28db1e26f296789af6c7bad176cfda708fc.tar.gz |
Return GNUTLS_E_LARGE_PACKET instead of truncating when sending DTLS record
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r-- | lib/gnutls_record.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index e6250f84f1..fbb84a1447 100644 --- a/lib/gnutls_record.c +++ b/lib/gnutls_record.c @@ -384,7 +384,14 @@ _gnutls_send_int (gnutls_session_t session, content_type_t type, _gnutls_packet2str (type), type, (int) data_size); if (data_size > MAX_RECORD_SEND_SIZE(session)) - send_data_size = MAX_RECORD_SEND_SIZE(session); + { + if (IS_DTLS(session)) + { + gnutls_assert (); + return GNUTLS_E_LARGE_PACKET; + } + send_data_size = MAX_RECORD_SEND_SIZE(session); + } else send_data_size = data_size; |