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:24 +0200 |
commit | 4d36d74d99bfc0f12fcd34d093d3c035743e0038 (patch) | |
tree | 7c6f947ca29fd54ca15e1af9fe974fd0efbc2ae2 | |
parent | 817238eb03b3a38acbb349d4401b9fc4a48db914 (diff) | |
download | gnutls-4d36d74d99bfc0f12fcd34d093d3c035743e0038.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; |