X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Fssl_test_ctx_test.c;h=70ebb2a0bd2df88e06fa9a56d68353cd01cf05a2;hp=193a3937d6f52497c0184f9f7b7932d373167fe2;hb=cbe2964821bb063f61ed2544cfce196ec1c0d62b;hpb=2326bba0e5cbe98f4d00855a6909b1f14b6f5427 diff --git a/test/ssl_test_ctx_test.c b/test/ssl_test_ctx_test.c index 193a3937d6..70ebb2a0bd 100644 --- a/test/ssl_test_ctx_test.c +++ b/test/ssl_test_ctx_test.c @@ -15,7 +15,7 @@ #include #include -#include "e_os.h" +#include "internal/nelem.h" #include "ssl_test_ctx.h" #include "testutil.h" #include @@ -40,7 +40,9 @@ static int clientconf_eq(SSL_TEST_CLIENT_CONF *conf1, || !TEST_int_eq(conf1->servername, conf2->servername) || !TEST_str_eq(conf1->npn_protocols, conf2->npn_protocols) || !TEST_str_eq(conf1->alpn_protocols, conf2->alpn_protocols) - || !TEST_int_eq(conf1->ct_validation, conf2->ct_validation)) + || !TEST_int_eq(conf1->ct_validation, conf2->ct_validation) + || !TEST_int_eq(conf1->max_fragment_len_mode, + conf2->max_fragment_len_mode)) return 0; return 1; } @@ -91,8 +93,12 @@ static int testctx_eq(SSL_TEST_CTX *ctx, SSL_TEST_CTX *ctx2) ctx2->expected_npn_protocol) || !TEST_str_eq(ctx->expected_alpn_protocol, ctx2->expected_alpn_protocol) + || !TEST_str_eq(ctx->expected_cipher, + ctx2->expected_cipher) || !TEST_int_eq(ctx->resumption_expected, - ctx2->resumption_expected)) + ctx2->resumption_expected) + || !TEST_int_eq(ctx->session_id_expected, + ctx2->session_id_expected)) return 0; return 1; } @@ -133,23 +139,26 @@ static void tear_down(SSL_TEST_CTX_TEST_FIXTURE *fixture) } #define SETUP_SSL_TEST_CTX_TEST_FIXTURE() \ - SETUP_TEST_FIXTURE(SSL_TEST_CTX_TEST_FIXTURE *, set_up); \ - if (fixture == NULL) \ - return 0 + SETUP_TEST_FIXTURE(SSL_TEST_CTX_TEST_FIXTURE, set_up); #define EXECUTE_SSL_TEST_CTX_TEST() \ EXECUTE_TEST(execute_test, tear_down) -static int test_empty_configuration() +static int test_empty_configuration(void) { SETUP_SSL_TEST_CTX_TEST_FIXTURE(); + if (fixture == NULL) + return 0; fixture->test_section = "ssltest_default"; fixture->expected_ctx->expected_result = SSL_TEST_SUCCESS; EXECUTE_SSL_TEST_CTX_TEST(); + return result; } -static int test_good_configuration() +static int test_good_configuration(void) { SETUP_SSL_TEST_CTX_TEST_FIXTURE(); + if (fixture == NULL) + return 0; fixture->test_section = "ssltest_good"; fixture->expected_ctx->method = SSL_TEST_METHOD_DTLS; fixture->expected_ctx->handshake_mode = SSL_TEST_HANDSHAKE_RESUME; @@ -163,6 +172,7 @@ static int test_good_configuration() fixture->expected_ctx->expected_servername = SSL_TEST_SERVERNAME_SERVER2; fixture->expected_ctx->session_ticket_expected = SSL_TEST_SESSION_TICKET_YES; fixture->expected_ctx->compression_expected = SSL_TEST_COMPRESSION_NO; + fixture->expected_ctx->session_id_expected = SSL_TEST_SESSION_ID_IGNORE; fixture->expected_ctx->resumption_expected = 1; fixture->expected_ctx->extra.client.verify_callback = @@ -172,6 +182,7 @@ static int test_good_configuration() OPENSSL_strdup("foo,bar"); if (!TEST_ptr(fixture->expected_ctx->extra.client.npn_protocols)) goto err; + fixture->expected_ctx->extra.client.max_fragment_len_mode = 0; fixture->expected_ctx->extra.server.servername_callback = SSL_TEST_SERVERNAME_IGNORE_MISMATCH; @@ -186,6 +197,7 @@ static int test_good_configuration() SSL_TEST_CT_VALIDATION_STRICT; EXECUTE_SSL_TEST_CTX_TEST(); + return result; err: tear_down(fixture); @@ -203,10 +215,12 @@ static const char *bad_configurations[] = { "ssltest_unknown_servername_callback", "ssltest_unknown_session_ticket_expected", "ssltest_unknown_compression_expected", + "ssltest_unknown_session_id_expected", "ssltest_unknown_method", "ssltest_unknown_handshake_mode", "ssltest_unknown_resumption_expected", "ssltest_unknown_ct_validation", + "ssltest_invalid_max_fragment_len", }; static int test_bad_configuration(int idx)