From: Nikos Mavrogiannopoulos Date: Wed, 12 Oct 2011 18:35:35 +0000 (+0200) Subject: Added a test for servers not accepting small records. X-Git-Tag: gnutls_3_0_4~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85945e245f6582fdbba2c5813c71c2d014b51420;p=thirdparty%2Fgnutls.git Added a test for servers not accepting small records. --- diff --git a/src/tests.c b/src/tests.c index af5eec1edb..4d3d37284b 100644 --- a/src/tests.c +++ b/src/tests.c @@ -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); 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"},