]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Added a test for servers not accepting small records.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 12 Oct 2011 18:35:35 +0000 (20:35 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 12 Oct 2011 18:35:35 +0000 (20:35 +0200)
src/tests.c
src/tests.h
src/tls_test.c

index af5eec1edb9cddf06880cf0917949136e0c779b0..4d3d37284b3881ad17607d5270b78533a47b6292 100644 (file)
@@ -862,6 +862,22 @@ test_hello_extension (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, 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);
index e63c31b9f2796826b2951ec51fd35419ddc3ce06..41dd35e72251fb0033ddf603375f352375c9c5c9 100644 (file)
@@ -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);
index 207bbbcb562d309749055ddcae26ab2a6fb523f9..ace79da2ceccd773c3c4c7a0c7104958a3a50fba 100644 (file)
@@ -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"},