summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2002-01-12 19:04:16 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2002-01-12 19:04:16 +0000
commitfef071f888426e86a265ec6a778f58a007a55ea0 (patch)
tree1da837c27744960e9264c76207bcdc0b05952a53
parent0212d7a723c49b29ec489522a50d2c6c588dad9a (diff)
downloadgnutls-fef071f888426e86a265ec6a778f58a007a55ea0.tar.gz
better length checking in the record layer.
-rw-r--r--lib/gnutls_alert.h2
-rw-r--r--lib/gnutls_int.h3
-rw-r--r--lib/gnutls_record.c1
3 files changed, 4 insertions, 2 deletions
diff --git a/lib/gnutls_alert.h b/lib/gnutls_alert.h
index bc3247843a..869f03fd67 100644
--- a/lib/gnutls_alert.h
+++ b/lib/gnutls_alert.h
@@ -1,2 +1,2 @@
AlertDescription gnutls_alert_get_last( GNUTLS_STATE state);
-int gnutls_send_alert( GNUTLS_STATE state, AlertLevel level, AlertDescription desc);
+int gnutls_alert_send( GNUTLS_STATE state, AlertLevel level, AlertDescription desc);
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index e68f6799c5..855d769fcc 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -80,7 +80,8 @@ typedef const int* GNUTLS_LIST;
#define DEFAULT_MAX_RECORD_SIZE 16384
#define RECORD_HEADER_SIZE 5
#define MAX_RECORD_SIZE state->security_parameters.max_record_size
-#define MAX_RECV_SIZE 2048+MAX_RECORD_SIZE+RECORD_HEADER_SIZE /* 2^14+2048+RECORD_HEADER_SIZE */
+#define MAX_PAD_SIZE 255
+#define MAX_RECV_SIZE 2048+MAX_PAD_SIZE+MAX_RECORD_SIZE+RECORD_HEADER_SIZE /* MAX_RECORD_SIZE+MAX_PAD+2048+RECORD_HEADER_SIZE */
#define HANDSHAKE_HEADER_SIZE 4
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 3f846f2a08..1e8c3aaba3 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -35,6 +35,7 @@
#include "gnutls_record.h"
#include "gnutls_datum.h"
#include "ext_max_record.h"
+#include <gnutls_alert.h>
/**
* gnutls_protocol_get_version - Returns the version of the currently used protocol