diff options
Diffstat (limited to 'apps/openssl.c')
-rw-r--r-- | apps/openssl.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/apps/openssl.c b/apps/openssl.c index 7a490cc455..d6820a191e 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -130,11 +130,8 @@ static size_t internal_trace_cb(const char *buf, size_t cnt, { int ret = 0; tracedata *trace_data = vdata; - union { - CRYPTO_THREAD_ID tid; - unsigned long ltid; - } tid; - char buffer[256]; + char buffer[256], *hex; + CRYPTO_THREAD_ID tid; switch (cmd) { case OSSL_TRACE_CTRL_BEGIN: @@ -142,11 +139,11 @@ static size_t internal_trace_cb(const char *buf, size_t cnt, return 0; trace_data->ingroup = 1; - tid.ltid = 0; - tid.tid = CRYPTO_THREAD_get_current_id(); - - BIO_snprintf(buffer, sizeof(buffer), "TRACE[%lx]:%s: ", tid.ltid, - OSSL_trace_get_category_name(category)); + tid = CRYPTO_THREAD_get_current_id(); + hex = OPENSSL_buf2hexstr((const unsigned char *)&tid, sizeof(tid)); + 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); break; |