Update the BoringSSL suppressions file based on the latest shim
[openssl.git] / test / ssl_test_ctx_test.c
index 479bda4d587a82a092be160ff6294ed11e8380d2..0f321c60f3332910cbeed6adac8f12257a1abd05 100644 (file)
@@ -83,6 +83,12 @@ static int SSL_TEST_SERVER_CONF_equal(SSL_TEST_SERVER_CONF *server,
                 server->broken_session_ticket, server2->broken_session_ticket);
         return 0;
     }
+    if (server->cert_status != server2->cert_status) {
+        fprintf(stderr, "CertStatus mismatch: %s vs %s.\n",
+                ssl_certstatus_name(server->cert_status),
+                ssl_certstatus_name(server2->cert_status));
+        return 0;
+    }
     return 1;
 }
 
@@ -109,6 +115,17 @@ static int SSL_TEST_CTX_equal(SSL_TEST_CTX *ctx, SSL_TEST_CTX *ctx2)
                 ssl_handshake_mode_name(ctx2->handshake_mode));
         return 0;
     }
+    if (ctx->app_data_size != ctx2->app_data_size) {
+        fprintf(stderr, "ApplicationData mismatch: %d vs %d.\n",
+                ctx->app_data_size, ctx2->app_data_size);
+        return 0;
+    }
+
+    if (ctx->max_fragment_size != ctx2->max_fragment_size) {
+        fprintf(stderr, "MaxFragmentSize mismatch: %d vs %d.\n",
+                ctx->max_fragment_size, ctx2->max_fragment_size);
+        return 0;
+    }
 
     if (!SSL_TEST_EXTRA_CONF_equal(&ctx->extra, &ctx2->extra)) {
         fprintf(stderr, "Extra conf mismatch.\n");
@@ -174,7 +191,7 @@ static SSL_TEST_CTX_TEST_FIXTURE set_up(const char *const test_case_name)
     SSL_TEST_CTX_TEST_FIXTURE fixture;
     fixture.test_case_name = test_case_name;
     fixture.expected_ctx = SSL_TEST_CTX_new();
-    OPENSSL_assert(fixture.expected_ctx != NULL);
+    TEST_check(fixture.expected_ctx != NULL);
     return fixture;
 }
 
@@ -240,6 +257,8 @@ static int test_good_configuration()
     fixture.test_section = "ssltest_good";
     fixture.expected_ctx->method = SSL_TEST_METHOD_DTLS;
     fixture.expected_ctx->handshake_mode = SSL_TEST_HANDSHAKE_RESUME;
+    fixture.expected_ctx->app_data_size = 1024;
+    fixture.expected_ctx->max_fragment_size = 2048;
 
     fixture.expected_ctx->expected_result = SSL_TEST_SERVER_FAIL;
     fixture.expected_ctx->expected_client_alert = SSL_AD_UNKNOWN_CA;
@@ -254,7 +273,7 @@ static int test_good_configuration()
     fixture.expected_ctx->extra.client.servername = SSL_TEST_SERVERNAME_SERVER2;
     fixture.expected_ctx->extra.client.npn_protocols =
         OPENSSL_strdup("foo,bar");
-    OPENSSL_assert(fixture.expected_ctx->extra.client.npn_protocols != NULL);
+    TEST_check(fixture.expected_ctx->extra.client.npn_protocols != NULL);
 
     fixture.expected_ctx->extra.server.servername_callback =
         SSL_TEST_SERVERNAME_IGNORE_MISMATCH;
@@ -262,7 +281,7 @@ static int test_good_configuration()
 
     fixture.expected_ctx->resume_extra.server2.alpn_protocols =
         OPENSSL_strdup("baz");
-    OPENSSL_assert(
+    TEST_check(
         fixture.expected_ctx->resume_extra.server2.alpn_protocols != NULL);
 
     fixture.expected_ctx->resume_extra.client.ct_validation =
@@ -302,11 +321,10 @@ int main(int argc, char **argv)
         return 1;
 
     conf = NCONF_new(NULL);
-    OPENSSL_assert(conf != NULL);
+    TEST_check(conf != NULL);
 
     /* argv[1] should point to test/ssl_test_ctx_test.conf */
-    OPENSSL_assert(NCONF_load(conf, argv[1], NULL) > 0);
-
+    TEST_check(NCONF_load(conf, argv[1], NULL) > 0);
 
     ADD_TEST(test_empty_configuration);
     ADD_TEST(test_good_configuration);