Rename the PROVIDER_CONF trace to CONF

Other configuration modules may have use for tracing, and having one
tracing category for each of them is a bit much.  Instead, we make one
category for them all.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/8680)
This commit is contained in:
Richard Levitte 2019-04-05 10:58:16 +02:00
parent e3af453bac
commit 71849dff56
3 changed files with 14 additions and 9 deletions

View File

@ -35,14 +35,14 @@ static int provider_conf_params(OSSL_PROVIDER *prov,
STACK_OF(CONF_VALUE) *sect;
int ok = 1;
OSSL_TRACE2(PROVIDER_CONF, "PROVIDER conf: %s = %s\n", name, value);
sect = NCONF_get_section(cnf, value);
if (sect != NULL) {
int i;
char buffer[512];
size_t buffer_len = 0;
OSSL_TRACE1(CONF, "Provider params: start section %s\n", value);
if (name != NULL) {
OPENSSL_strlcpy(buffer, name, sizeof(buffer));
OPENSSL_strlcat(buffer, ".", sizeof(buffer));
@ -59,7 +59,10 @@ static int provider_conf_params(OSSL_PROVIDER *prov,
if (!provider_conf_params(prov, buffer, sectconf->value, cnf))
return 0;
}
OSSL_TRACE1(CONF, "Provider params: finish section %s\n", value);
} else {
OSSL_TRACE2(CONF, "Provider params: %s = %s\n", name, value);
ok = ossl_provider_add_parameter(prov, name, value);
}
@ -78,7 +81,7 @@ static int provider_conf_load(OPENSSL_CTX *libctx, const char *name,
int ok = 0;
name = skip_dot(name);
OSSL_TRACE1(PROVIDER_CONF, "Configuring provider %s\n", name);
OSSL_TRACE1(CONF, "Configuring provider %s\n", name);
/* Value is a section containing PROVIDER commands */
ecmds = NCONF_get_section(cnf, value);
@ -93,7 +96,7 @@ static int provider_conf_load(OPENSSL_CTX *libctx, const char *name,
const char *confname = skip_dot(ecmd->name);
const char *confvalue = ecmd->value;
OSSL_TRACE2(PROVIDER_CONF, "PROVIDER conf: %s = %s\n",
OSSL_TRACE2(CONF, "Provider command: %s = %s\n",
confname, confvalue);
/* First handle some special pseudo confs */
@ -145,8 +148,9 @@ static int provider_conf_init(CONF_IMODULE *md, const CONF *cnf)
CONF_VALUE *cval;
int i;
OSSL_TRACE2(PROVIDER_CONF, "Loading provider module: name %s, value %s\n",
CONF_imodule_get_name(md), CONF_imodule_get_value(md));
OSSL_TRACE1(CONF, "Loading providers module: section %s\n",
CONF_imodule_get_value(md));
/* Value is a section containing PROVIDERs to configure */
elist = NCONF_get_section(cnf, CONF_imodule_get_value(md));
@ -170,10 +174,11 @@ static void provider_conf_deinit(CONF_IMODULE *md)
{
sk_OSSL_PROVIDER_pop_free(activated_providers, ossl_provider_free);
activated_providers = NULL;
OSSL_TRACE(PROVIDER_CONF, "Cleaned up providers\n");
OSSL_TRACE(CONF, "Cleaned up providers\n");
}
void ossl_provider_add_conf_module(void)
{
OSSL_TRACE(CONF, "Adding config module 'providers'\n");
CONF_module_add("providers", provider_conf_init, provider_conf_deinit);
}

View File

@ -132,7 +132,7 @@ static const struct trace_category_st trace_categories[] = {
TRACE_CATEGORY_(PKCS12_DECRYPT),
TRACE_CATEGORY_(X509V3_POLICY),
TRACE_CATEGORY_(BN_CTX),
TRACE_CATEGORY_(PROVIDER_CONF),
TRACE_CATEGORY_(CONF),
};
const char *OSSL_trace_get_category_name(int num)

View File

@ -49,7 +49,7 @@ extern "C" {
# define OSSL_TRACE_CATEGORY_PKCS12_DECRYPT 10
# define OSSL_TRACE_CATEGORY_X509V3_POLICY 11
# define OSSL_TRACE_CATEGORY_BN_CTX 12
# define OSSL_TRACE_CATEGORY_PROVIDER_CONF 13
# define OSSL_TRACE_CATEGORY_CONF 13
# define OSSL_TRACE_CATEGORY_NUM 14
/* Returns the trace category number for the given |name| */