Thanks to Marc Haber <mh+debian-bugs@zugschlus.de> and "Marc F.
Clemente" <marc@mclemente.net> for reporting and providing test servers.
* Version 2.3.8 (unreleased)
+** Increase default handshake packet size limit to 48kb.
+The old limit was 16kb and some servers send huge list of trusted CAs,
+thus running into the limit. FYI, applications can further increase
+this limit using gnutls_handshake_set_max_packet_length. Thanks to
+Marc Haber <mh+debian-bugs@zugschlus.de> and "Marc F. Clemente"
+<marc@mclemente.net> for reporting and providing test servers.
+
+** Add new error code when handshake is too large: GNUTLS_E_HANDSHAKE_TOO_LARGE
+Before GNUTLS_E_MEMORY_ERROR was used, which could be confused with
+other error situations.
+
** Hide definitions in crypto.h.
We have decided that the APIs defined in crypto.h are not stable
enough for v2.4, so don't use any of those functions.
** Update of gnulib files.
** API and ABI modifications:
-No changes since last version.
+GNUTLS_E_HANDSHAKE_TOO_LARGE: ADDED.
* Version 2.3.7 (released 2008-04-21)
#define GNUTLS_E_CRYPTO_ALREADY_REGISTERED -209
+#define GNUTLS_E_HANDSHAKE_TOO_LARGE -210
+
#define GNUTLS_E_UNIMPLEMENTED_FEATURE -1250
#define GNUTLS_E_APPLICATION_ERROR_MAX -65000
session->internals.max_handshake_data_buffer_size))
{
gnutls_assert ();
- return GNUTLS_E_MEMORY_ERROR;
+ return GNUTLS_E_HANDSHAKE_TOO_LARGE;
}
_gnutls_buffers_log ("BUF[HSK]: Inserted %d bytes of Data\n", length);
/*
- * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
+ * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation
*
* Author: Nikos Mavrogiannopoulos
*
ERROR_ENTRY (N_("The specified algorithm or protocol is unknown."),
GNUTLS_E_UNKNOWN_ALGORITHM, 1),
+ ERROR_ENTRY (N_("The handshake data size is too large (DoS?), "
+ "check gnutls_handshake_set_max_packet_length()."),
+ GNUTLS_E_HANDSHAKE_TOO_LARGE, 1),
+
{NULL, NULL, 0, 0}
};
*
* This function will set the maximum size of a handshake message.
* Handshake messages over this size are rejected. The default value
- * is 16kb which is large enough. Set this to 0 if you do not want to
- * set an upper limit.
+ * is 48kb which is typically large enough. Set this to 0 if you do
+ * not want to set an upper limit.
*
+ * The reason for restricting the handshake message sizes are to
+ * limit Denial of Service attacks.
**/
void
gnutls_handshake_set_max_packet_length (gnutls_session_t session, size_t max)
/*
- * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
+ * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation
*
* Author: Nikos Mavrogiannopoulos
*
/* The size of a handshake message should not
* be larger than this value.
*/
-#define MAX_HANDSHAKE_PACKET_SIZE 16*1024
+#define MAX_HANDSHAKE_PACKET_SIZE 48*1024
#define TLS_RANDOM_SIZE 32
#define TLS_MAX_SESSION_ID_SIZE 32