summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-10-12 20:35:35 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-10-12 20:35:35 +0200
commit85945e245f6582fdbba2c5813c71c2d014b51420 (patch)
tree6aa47344b41a7fa48f3bf62f2257a4005c4c2472 /src
parent7441316a38a03003aea456449d5f809ae57209b1 (diff)
downloadgnutls-85945e245f6582fdbba2c5813c71c2d014b51420.tar.gz
Added a test for servers not accepting small records.
Diffstat (limited to 'src')
-rw-r--r--src/tests.c16
-rw-r--r--src/tests.h1
-rw-r--r--src/tls_test.c2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/tests.c b/src/tests.c
index af5eec1edb..4d3d37284b 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -867,6 +867,22 @@ test_hello_extension (gnutls_session_t session)
":" ALL_KX ":%s", protocol_str, rest);
_gnutls_priority_set_direct (session, prio_str);
gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, xcred);
+ gnutls_record_set_max_size (session, 4096);
+
+ ret = do_handshake (session);
+ return ret;
+}
+
+test_code_t
+test_small_records (gnutls_session_t session)
+{
+ int ret;
+
+ sprintf (prio_str,
+ INIT_STR ALL_CIPHERS ":" ALL_COMP ":" ALL_CERTTYPES ":%s:" ALL_MACS
+ ":" ALL_KX ":%s", protocol_str, rest);
+ _gnutls_priority_set_direct (session, prio_str);
+ gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, xcred);
gnutls_record_set_max_size (session, 512);
ret = do_handshake (session);
diff --git a/src/tests.h b/src/tests.h
index e63c31b9f2..41dd35e722 100644
--- a/src/tests.h
+++ b/src/tests.h
@@ -8,6 +8,7 @@ test_code_t test_record_padding (gnutls_session_t state);
test_code_t test_export (gnutls_session_t state);
test_code_t test_export_info (gnutls_session_t state);
test_code_t test_hello_extension (gnutls_session_t state);
+test_code_t test_small_records (gnutls_session_t state);
test_code_t test_dhe (gnutls_session_t state);
test_code_t test_dhe_group (gnutls_session_t state);
test_code_t test_ssl3 (gnutls_session_t state);
diff --git a/src/tls_test.c b/src/tls_test.c
index 207bbbcb56..ace79da2ce 100644
--- a/src/tls_test.c
+++ b/src/tls_test.c
@@ -106,6 +106,8 @@ static const TLS_TEST tls_tests[] = {
test_rsa_pms_version_check, "yes", "no", "dunno"},
{"whether the server can accept Hello Extensions",
test_hello_extension, "yes", "no", "dunno"},
+ {"whether the server can accept small records (512 bytes)",
+ test_small_records, "yes", "no", "dunno"},
{"whether the server can accept cipher suites not in SSL 3.0 spec",
test_unknown_ciphersuites, "yes", "no", "dunno"},
{"whether the server can accept a bogus TLS record version in the client hello", test_version_oob, "yes", "no", "dunno"},