From 3a8269b3194f7528e3657cef70fe2db1ed38b755 Mon Sep 17 00:00:00 2001 From: "Dr. Matthias St. Pierre" Date: Thu, 21 Mar 2019 18:59:13 +0100 Subject: [PATCH] trace: rename the default trace category from 'ANY' to 'ALL' It seems more intuitive to set `OPENSSL_TRACE=all` instead of `OPENSSL_TRACE=any` to obtain trace output for all categories. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/8552) --- apps/openssl.c | 2 +- crypto/trace.c | 4 ++-- doc/man3/OSSL_trace_enabled.pod | 2 +- doc/man3/OSSL_trace_set_channel.pod | 2 +- include/openssl/trace.h | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/openssl.c b/apps/openssl.c index a63f82b15b..9c0d933d7b 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -226,7 +226,7 @@ static void setup_trace(const char *str) for (valp = val; (item = strtok(valp, ",")) != NULL; valp = NULL) { int category = OSSL_trace_get_category_num(item); - if (category == OSSL_TRACE_CATEGORY_ANY) { + if (category == OSSL_TRACE_CATEGORY_ALL) { while (++category < OSSL_TRACE_CATEGORY_NUM) setup_trace_category(category); break; diff --git a/crypto/trace.c b/crypto/trace.c index 70e93c292d..efcf8be76c 100644 --- a/crypto/trace.c +++ b/crypto/trace.c @@ -119,7 +119,7 @@ struct trace_category_st { #define TRACE_CATEGORY_(name) { #name, OSSL_TRACE_CATEGORY_##name } static const struct trace_category_st trace_categories[] = { - TRACE_CATEGORY_(ANY), + TRACE_CATEGORY_(ALL), TRACE_CATEGORY_(TRACE), TRACE_CATEGORY_(INIT), TRACE_CATEGORY_(TLS), @@ -422,7 +422,7 @@ static int ossl_trace_get_category(int category) return -1; if (trace_channels[category].bio != NULL) return category; - return OSSL_TRACE_CATEGORY_ANY; + return OSSL_TRACE_CATEGORY_ALL; } #endif diff --git a/doc/man3/OSSL_trace_enabled.pod b/doc/man3/OSSL_trace_enabled.pod index 98e3bd6356..e26dee5370 100644 --- a/doc/man3/OSSL_trace_enabled.pod +++ b/doc/man3/OSSL_trace_enabled.pod @@ -40,7 +40,7 @@ The tracing output is divided into types which are enabled individually by the application. The tracing types are described in detail in L. -The fallback type C should I be used +The fallback type C should I be used with the functions described here. Tracing for a specific category is enabled if a so called diff --git a/doc/man3/OSSL_trace_set_channel.pod b/doc/man3/OSSL_trace_set_channel.pod index 0fb7d06a6b..46e248f45d 100644 --- a/doc/man3/OSSL_trace_set_channel.pod +++ b/doc/man3/OSSL_trace_set_channel.pod @@ -178,7 +178,7 @@ Traces BIGNUM context operations. =back -There is also C, which works as a fallback +There is also C, which works as a fallback and can be used to get I trace output. Note, however, that in this case all trace output will effectively be diff --git a/include/openssl/trace.h b/include/openssl/trace.h index 13cd2dd6f3..48c98ca396 100644 --- a/include/openssl/trace.h +++ b/include/openssl/trace.h @@ -30,13 +30,13 @@ extern "C" { * BIO which sends all trace output it receives to the registered application * callback. * - * The ANY category can be used as a fallback category to register a single + * The ALL category can be used as a fallback category to register a single * channel which receives the output from all categories. However, if the * application intends to print the trace channel name in the line prefix, * it is better to register channels for all categories separately. * (This is how the openssl application does it.) */ -# define OSSL_TRACE_CATEGORY_ANY 0 /* The fallback */ +# define OSSL_TRACE_CATEGORY_ALL 0 /* The fallback */ # define OSSL_TRACE_CATEGORY_TRACE 1 # define OSSL_TRACE_CATEGORY_INIT 2 # define OSSL_TRACE_CATEGORY_TLS 3