testutil_init.c: fix compilation error with enable-trace
In commite79ae962fb
the tests were adapted to use the new BIO_f_prefix() API which was introduced in319cee9e2f
. This location was missed, because it is compiled only when tracing is enabled. Fixes #10731 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10732)
This commit is contained in:
parent
11b4435986
commit
7671420d9e
1 changed files with 3 additions and 4 deletions
|
@ -36,8 +36,7 @@ static size_t internal_trace_cb(const char *buf, size_t cnt,
|
||||||
BIO_snprintf(buffer, sizeof(buffer), "TRACE[%s]:%s: ",
|
BIO_snprintf(buffer, sizeof(buffer), "TRACE[%s]:%s: ",
|
||||||
hex, OSSL_trace_get_category_name(category));
|
hex, OSSL_trace_get_category_name(category));
|
||||||
OPENSSL_free(hex);
|
OPENSSL_free(hex);
|
||||||
BIO_ctrl(trace_data->bio, PREFIX_CTRL_SET_PREFIX,
|
BIO_set_prefix(trace_data->bio, buffer);
|
||||||
strlen(buffer), buffer);
|
|
||||||
break;
|
break;
|
||||||
case OSSL_TRACE_CTRL_WRITE:
|
case OSSL_TRACE_CTRL_WRITE:
|
||||||
ret = BIO_write(trace_data->bio, buf, cnt);
|
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:
|
case OSSL_TRACE_CTRL_END:
|
||||||
trace_data->ingroup = 0;
|
trace_data->ingroup = 0;
|
||||||
|
|
||||||
BIO_ctrl(trace_data->bio, PREFIX_CTRL_SET_PREFIX, 0, NULL);
|
BIO_set_prefix(trace_data->bio, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +75,7 @@ static void setup_trace_category(int category)
|
||||||
if (OSSL_trace_enabled(category))
|
if (OSSL_trace_enabled(category))
|
||||||
return;
|
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));
|
BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT));
|
||||||
trace_data = OPENSSL_zalloc(sizeof(*trace_data));
|
trace_data = OPENSSL_zalloc(sizeof(*trace_data));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue