Commit a324e506cb for openssl.org
commit a324e506cbafbd08563ffaae8e5ef21a580c7382
Author: slontis <shane.lontis@oracle.com>
Date: Fri Dec 12 13:58:32 2025 +1100
Added additional TRACE information to Decoders.
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)
diff --git a/crypto/encode_decode/decoder_lib.c b/crypto/encode_decode/decoder_lib.c
index e827659c9a..90053dc5cc 100644
--- a/crypto/encode_decode/decoder_lib.c
+++ b/crypto/encode_decode/decoder_lib.c
@@ -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;
diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c
index 2704ad2656..1b2cc04699 100644
--- a/crypto/encode_decode/decoder_pkey.c
+++ b/crypto/encode_decode/decoder_pkey.c
@@ -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;