Latest update.
This commit is contained in:
@@ -81,22 +81,6 @@ int subtest_level(void)
|
||||
return level;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
|
||||
static int should_report_leaks(void)
|
||||
{
|
||||
/*
|
||||
* When compiled with enable-crypto-mdebug, OPENSSL_DEBUG_MEMORY=0
|
||||
* can be used to disable leak checking at runtime.
|
||||
* Note this only works when running the test binary manually;
|
||||
* the test harness always enables OPENSSL_DEBUG_MEMORY.
|
||||
*/
|
||||
char *mem_debug_env = getenv("OPENSSL_DEBUG_MEMORY");
|
||||
|
||||
return mem_debug_env == NULL
|
||||
|| (strcmp(mem_debug_env, "0") && strcmp(mem_debug_env, ""));
|
||||
}
|
||||
#endif
|
||||
|
||||
static int gcd(int a, int b)
|
||||
{
|
||||
while (b != 0) {
|
||||
@@ -128,13 +112,6 @@ int setup_test_framework(int argc, char *argv[])
|
||||
if (test_seed != NULL)
|
||||
set_seed(atoi(test_seed));
|
||||
|
||||
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
|
||||
if (should_report_leaks()) {
|
||||
CRYPTO_set_mem_debug(1);
|
||||
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
|
||||
argv = copy_argv(&argc, argv);
|
||||
#elif defined(_WIN32)
|
||||
@@ -256,11 +233,6 @@ end:
|
||||
int pulldown_test_framework(int ret)
|
||||
{
|
||||
set_test_title(NULL);
|
||||
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
|
||||
if (should_report_leaks()
|
||||
&& CRYPTO_mem_leaks_cb(openssl_error_cb, NULL) <= 0)
|
||||
return EXIT_FAILURE;
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,7 @@ static size_t internal_trace_cb(const char *buf, size_t cnt,
|
||||
BIO_snprintf(buffer, sizeof(buffer), "TRACE[%s]:%s: ",
|
||||
hex, OSSL_trace_get_category_name(category));
|
||||
OPENSSL_free(hex);
|
||||
BIO_ctrl(trace_data->bio, PREFIX_CTRL_SET_PREFIX,
|
||||
strlen(buffer), buffer);
|
||||
BIO_set_prefix(trace_data->bio, buffer);
|
||||
break;
|
||||
case OSSL_TRACE_CTRL_WRITE:
|
||||
ret = BIO_write(trace_data->bio, buf, cnt);
|
||||
@@ -45,7 +44,7 @@ static size_t internal_trace_cb(const char *buf, size_t cnt,
|
||||
case OSSL_TRACE_CTRL_END:
|
||||
trace_data->ingroup = 0;
|
||||
|
||||
BIO_ctrl(trace_data->bio, PREFIX_CTRL_SET_PREFIX, 0, NULL);
|
||||
BIO_set_prefix(trace_data->bio, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -76,7 +75,7 @@ static void setup_trace_category(int category)
|
||||
if (OSSL_trace_enabled(category))
|
||||
return;
|
||||
|
||||
channel = BIO_push(BIO_new(apps_bf_prefix()),
|
||||
channel = BIO_push(BIO_new(BIO_f_prefix()),
|
||||
BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT));
|
||||
trace_data = OPENSSL_zalloc(sizeof(*trace_data));
|
||||
|
||||
Reference in New Issue
Block a user