{
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;
goto end;
}
- memset(&fixture, 0, sizeof(fixture));
fixture.test_case_name = test_case_name;
fixture.ctlog_store = ctlog_store;
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;
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;
int result = 0;
char *tmp_env = NULL;
+ tmp_env = getenv("OPENSSL_DEBUG_MEMORY");
+ if (tmp_env != NULL && strcmp(tmp_env, "on") == 0)
+ CRYPTO_set_mem_debug(1);
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
+
tmp_env = getenv("CT_DIR");
ct_dir = OPENSSL_strdup(tmp_env != NULL ? tmp_env : "ct");
tmp_env = getenv("CERTS_DIR");
OPENSSL_free(ct_dir);
OPENSSL_free(certs_dir);
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
+ if (CRYPTO_mem_leaks_fp(stderr) <= 0)
+ result = 1;
+#endif
+
return result;
}