Handle multi-line "written by/for" comments.
[openssl.git] / test / ct_test.c
index 5446f9d0da06d5d3e6915fb093ca551aecd57bb9..8175d16c92453cf3c34d806a815011269ebe2aba 100644 (file)
@@ -101,7 +101,11 @@ static CT_TEST_FIXTURE set_up(const char *const test_case_name)
 {
     CT_TEST_FIXTURE fixture;
     int setup_ok = 1;
-    CTLOG_STORE *ctlog_store = CTLOG_STORE_new();
+    CTLOG_STORE *ctlog_store;
+
+    memset(&fixture, 0, sizeof(fixture));
+
+    ctlog_store = CTLOG_STORE_new();
 
     if (ctlog_store == NULL) {
         setup_ok = 0;
@@ -115,7 +119,6 @@ static CT_TEST_FIXTURE set_up(const char *const test_case_name)
         goto end;
     }
 
-    memset(&fixture, 0, sizeof(fixture));
     fixture.test_case_name = test_case_name;
     fixture.ctlog_store = ctlog_store;
 
@@ -402,6 +405,17 @@ static int execute_cert_test(CT_TEST_FIXTURE fixture)
             goto end;
         }
 
+        if (fixture.test_validity && cert != NULL) {
+            int is_sct_validated = SCT_validate(sct, ct_policy_ctx);
+            if (is_sct_validated < 0) {
+                fprintf(stderr, "Error validating SCT\n");
+                goto end;
+            } else if (!is_sct_validated) {
+                fprintf(stderr, "SCT failed verification\n");
+                goto end;
+            }
+        }
+
         if (fixture.sct_text_file
             && compare_sct_printout(sct, expected_sct_text)) {
                 goto end;
@@ -413,17 +427,6 @@ static int execute_cert_test(CT_TEST_FIXTURE fixture)
             fprintf(stderr, "Failed to encode SCT into TLS format correctly\n");
             goto end;
         }
-
-        if (fixture.test_validity && cert != NULL) {
-            int is_sct_validated = SCT_validate(sct, ct_policy_ctx);
-            if (is_sct_validated < 0) {
-                fprintf(stderr, "Error validating SCT\n");
-                goto end;
-            } else if (!is_sct_validated) {
-                fprintf(stderr, "SCT failed verification\n");
-                goto end;
-            }
-        }
     }
     success = 1;