]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Added additional TRACE information to Decoders.
authorslontis <shane.lontis@oracle.com>
Fri, 12 Dec 2025 02:58:32 +0000 (13:58 +1100)
committerMatt Caswell <matt@openssl.org>
Fri, 27 Feb 2026 14:39:57 +0000 (14:39 +0000)
This outputs the description field which is easier to understand than a
pointer.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
MergeDate: Fri Feb 27 14:40:27 2026
(Merged from https://github.com/openssl/openssl/pull/29381)

crypto/encode_decode/decoder_lib.c
crypto/encode_decode/decoder_pkey.c

index e827659c9aa847d7423ec1610b3d20908022aa81..90053dc5cc834f0ea55b406a946fe599898ce64d 100644 (file)
@@ -383,10 +383,11 @@ int ossl_decoder_ctx_add_decoder_inst(OSSL_DECODER_CTX *ctx,
         {
             BIO_printf(trc_out,
                 "(ctx %p) Added decoder instance %p for decoder %p\n"
-                "    %s with %s\n",
+                "    %s with %s (%s)\n",
                 (void *)ctx, (void *)di, (void *)di->decoder,
                 OSSL_DECODER_get0_name(di->decoder),
-                OSSL_DECODER_get0_properties(di->decoder));
+                OSSL_DECODER_get0_properties(di->decoder),
+                OSSL_DECODER_get0_description(di->decoder));
         }
         OSSL_TRACE_END(DECODER);
     }
@@ -471,10 +472,11 @@ static void collect_extra_decoder(OSSL_DECODER *decoder, void *arg)
         {
             BIO_printf(trc_out,
                 "(ctx %p) [%d] Checking out decoder %p:\n"
-                "    %s with %s\n",
+                "    %s with %s (%s)\n",
                 (void *)data->ctx, data->type_check, (void *)decoder,
                 OSSL_DECODER_get0_name(decoder),
-                OSSL_DECODER_get0_properties(decoder));
+                OSSL_DECODER_get0_properties(decoder),
+                OSSL_DECODER_get0_description(decoder));
         }
         OSSL_TRACE_END(DECODER);
 
@@ -984,9 +986,10 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
         OSSL_TRACE_BEGIN(DECODER)
         {
             BIO_printf(trc_out,
-                "(ctx %p) %s incoming from previous decoder (%p):\n"
+                "(ctx %p) %s incoming from previous decoder (%p %s):\n"
                 "    data type: %s, data structure: %s%s\n",
                 (void *)new_data.ctx, LEVEL, (void *)decoder,
+                OSSL_DECODER_get0_description(decoder),
                 data_type, trace_data_structure,
                 (trace_data_structure == data_structure
                         ? ""
@@ -1026,10 +1029,11 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
         {
             new_decoder_name = OSSL_DECODER_get0_name(new_decoder);
             BIO_printf(trc_out,
-                "(ctx %p) %s [%u] Considering decoder instance %p (decoder %p):\n"
+                "(ctx %p) %s [%u] Considering decoder instance %p (decoder %p %s):\n"
                 "    %s with %s\n",
                 (void *)new_data.ctx, LEVEL, (unsigned int)i,
                 (void *)new_decoder_inst, (void *)new_decoder,
+                OSSL_DECODER_get0_description(new_decoder),
                 new_decoder_name,
                 OSSL_DECODER_get0_properties(new_decoder));
         }
@@ -1063,9 +1067,10 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
             OSSL_TRACE_BEGIN(DECODER)
             {
                 BIO_printf(trc_out,
-                    "(ctx %p) %s [%u] the input type doesn't match the name of the previous decoder (%p), skipping...\n",
+                    "(ctx %p) %s [%u] the input type doesn't match the name of the previous decoder (%p %s), skipping...\n",
                     (void *)new_data.ctx, LEVEL, (unsigned int)i,
-                    (void *)decoder);
+                    (void *)decoder,
+                    OSSL_DECODER_get0_description(decoder));
             }
             OSSL_TRACE_END(DECODER);
             continue;
index 2704ad26563ecf545701693b4b91eb9bf2b61a74..1b2cc046992b49569fc5339c98240be0dac96cb0 100644 (file)
@@ -276,9 +276,10 @@ static int collect_decoder_keymgmt(EVP_KEYMGMT *keymgmt, OSSL_DECODER *decoder,
     OSSL_TRACE_BEGIN(DECODER)
     {
         BIO_printf(trc_out,
-            "(ctx %p) Checking out decoder %p:\n"
+            "(ctx %p) Checking out decoder %p (%s):\n"
             "    %s with %s\n",
             (void *)data->ctx, (void *)decoder,
+            OSSL_DECODER_get0_description(decoder),
             OSSL_DECODER_get0_name(decoder),
             OSSL_DECODER_get0_properties(decoder));
     }
@@ -337,9 +338,10 @@ static void collect_decoder(OSSL_DECODER *decoder, void *arg)
     OSSL_TRACE_BEGIN(DECODER)
     {
         BIO_printf(trc_out,
-            "(ctx %p) Checking out decoder %p:\n"
+            "(ctx %p) Checking out decoder %p (%s):\n"
             "    %s with %s\n",
             (void *)data->ctx, (void *)decoder,
+            OSSL_DECODER_get0_description(decoder),
             OSSL_DECODER_get0_name(decoder),
             OSSL_DECODER_get0_properties(decoder));
     }
@@ -417,6 +419,13 @@ static void collect_keymgmt(EVP_KEYMGMT *keymgmt, void *arg)
     if (!EVP_KEYMGMT_up_ref(keymgmt))
         return;
 
+    OSSL_TRACE_BEGIN(DECODER)
+    {
+        BIO_printf(trc_out,
+            "(Collecting KeyManager %s %s [id %d]:\n",
+            keymgmt->description, keymgmt->type_name, keymgmt->id);
+    }
+    OSSL_TRACE_END(DECODER);
     if (sk_EVP_KEYMGMT_push(data->keymgmts, keymgmt) <= 0) {
         EVP_KEYMGMT_free(keymgmt);
         data->error_occurred = 1;