[openssl] master update

Richard Levitte levitte at openssl.org
Fri Apr 5 10:52:24 UTC 2019


The branch master has been updated
       via  bc362b9b72021c2a066102f4f6bee5afc981e07a (commit)
       via  0196ad63d385bcf4382266268d5be074461d3739 (commit)
       via  71849dff56d62802bef11b0643446588ae25122e (commit)
      from  e3af453baceee7401ba0c5044a4c3aeaf246406f (commit)


- Log -----------------------------------------------------------------
commit bc362b9b72021c2a066102f4f6bee5afc981e07a
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Apr 5 11:20:28 2019 +0200

    Convert the ENGINE_CONF trace calls to use CONF instead
    
    Additionally, merge ENGINE_CONF into CONF.
    
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
    (Merged from https://github.com/openssl/openssl/pull/8680)

commit 0196ad63d385bcf4382266268d5be074461d3739
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Apr 5 11:02:17 2019 +0200

    Add a bit of tracing in the core conf module runner
    
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
    (Merged from https://github.com/openssl/openssl/pull/8680)

commit 71849dff56d62802bef11b0643446588ae25122e
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Apr 5 10:58:16 2019 +0200

    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 at oracle.com>
    Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
    (Merged from https://github.com/openssl/openssl/pull/8680)

-----------------------------------------------------------------------

Summary of changes:
 crypto/conf/conf_mod.c  |  4 ++++
 crypto/engine/eng_cnf.c |  6 +++---
 crypto/provider_conf.c  | 19 ++++++++++++-------
 crypto/trace.c          |  3 +--
 include/openssl/trace.h |  5 ++---
 5 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c
index 3ad09a7..56b1946 100644
--- a/crypto/conf/conf_mod.c
+++ b/crypto/conf/conf_mod.c
@@ -14,6 +14,7 @@
 #include "internal/conf.h"
 #include "internal/dso.h"
 #include <openssl/x509.h>
+#include <openssl/trace.h>
 
 #define DSO_mod_init_name "OPENSSL_init"
 #define DSO_mod_finish_name "OPENSSL_finish"
@@ -92,6 +93,7 @@ int CONF_modules_load(const CONF *cnf, const char *appname,
         return 1;
     }
 
+    OSSL_TRACE1(CONF, "Configuration in section %s\n", vsection);
     values = NCONF_get_section(cnf, vsection);
 
     if (!values)
@@ -100,6 +102,8 @@ int CONF_modules_load(const CONF *cnf, const char *appname,
     for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
         vl = sk_CONF_VALUE_value(values, i);
         ret = module_run(cnf, vl->name, vl->value, flags);
+        OSSL_TRACE3(CONF, "Running module %s (%s) returned %d\n",
+                    vl->name, vl->value, ret);
         if (ret <= 0)
             if (!(flags & CONF_MFLAGS_IGNORE_ERRORS))
                 return ret;
diff --git a/crypto/engine/eng_cnf.c b/crypto/engine/eng_cnf.c
index c87a8a1..9f647c4 100644
--- a/crypto/engine/eng_cnf.c
+++ b/crypto/engine/eng_cnf.c
@@ -49,7 +49,7 @@ static int int_engine_configure(const char *name, const char *value, const CONF
     int soft = 0;
 
     name = skip_dot(name);
-    OSSL_TRACE1(ENGINE_CONF, "Configuring engine %s\n", name);
+    OSSL_TRACE1(CONF, "Configuring engine %s\n", name);
     /* Value is a section containing ENGINE commands */
     ecmds = NCONF_get_section(cnf, value);
 
@@ -63,7 +63,7 @@ static int int_engine_configure(const char *name, const char *value, const CONF
         ecmd = sk_CONF_VALUE_value(ecmds, i);
         ctrlname = skip_dot(ecmd->name);
         ctrlvalue = ecmd->value;
-        OSSL_TRACE2(ENGINE_CONF, "ENGINE conf: doing ctrl(%s,%s)\n",
+        OSSL_TRACE2(CONF, "ENGINE: doing ctrl(%s,%s)\n",
                     ctrlname, ctrlvalue);
 
         /* First handle some special pseudo ctrls */
@@ -148,7 +148,7 @@ static int int_engine_module_init(CONF_IMODULE *md, const CONF *cnf)
     STACK_OF(CONF_VALUE) *elist;
     CONF_VALUE *cval;
     int i;
-    OSSL_TRACE2(ENGINE_CONF, "Called engine module: name %s, value %s\n",
+    OSSL_TRACE2(CONF, "Called engine module: name %s, value %s\n",
                 CONF_imodule_get_name(md), CONF_imodule_get_value(md));
     /* Value is a section containing ENGINEs to configure */
     elist = NCONF_get_section(cnf, CONF_imodule_get_value(md));
diff --git a/crypto/provider_conf.c b/crypto/provider_conf.c
index 9d9b7a1..74162a8 100644
--- a/crypto/provider_conf.c
+++ b/crypto/provider_conf.c
@@ -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);
 }
diff --git a/crypto/trace.c b/crypto/trace.c
index c9623b0..ecfc6d4 100644
--- a/crypto/trace.c
+++ b/crypto/trace.c
@@ -124,7 +124,7 @@ static const struct trace_category_st trace_categories[] = {
     TRACE_CATEGORY_(INIT),
     TRACE_CATEGORY_(TLS),
     TRACE_CATEGORY_(TLS_CIPHER),
-    TRACE_CATEGORY_(ENGINE_CONF),
+    TRACE_CATEGORY_(CONF),
     TRACE_CATEGORY_(ENGINE_TABLE),
     TRACE_CATEGORY_(ENGINE_REF_COUNT),
     TRACE_CATEGORY_(PKCS5V2),
@@ -132,7 +132,6 @@ static const struct trace_category_st trace_categories[] = {
     TRACE_CATEGORY_(PKCS12_DECRYPT),
     TRACE_CATEGORY_(X509V3_POLICY),
     TRACE_CATEGORY_(BN_CTX),
-    TRACE_CATEGORY_(PROVIDER_CONF),
 };
 
 const char *OSSL_trace_get_category_name(int num)
diff --git a/include/openssl/trace.h b/include/openssl/trace.h
index aff1a32..79598ab 100644
--- a/include/openssl/trace.h
+++ b/include/openssl/trace.h
@@ -41,7 +41,7 @@ extern "C" {
 # define OSSL_TRACE_CATEGORY_INIT                2
 # define OSSL_TRACE_CATEGORY_TLS                 3
 # define OSSL_TRACE_CATEGORY_TLS_CIPHER          4
-# define OSSL_TRACE_CATEGORY_ENGINE_CONF         5
+# define OSSL_TRACE_CATEGORY_CONF                5
 # define OSSL_TRACE_CATEGORY_ENGINE_TABLE        6
 # define OSSL_TRACE_CATEGORY_ENGINE_REF_COUNT    7
 # define OSSL_TRACE_CATEGORY_PKCS5V2             8
@@ -49,8 +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_NUM                14
+# define OSSL_TRACE_CATEGORY_NUM                13
 
 /* Returns the trace category number for the given |name| */
 int OSSL_trace_get_category_num(const char *name);


More information about the openssl-commits mailing list