diff options
author | Richard Levitte <levitte@openssl.org> | 2020-10-28 10:13:24 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-11 11:42:06 +0100 |
commit | de5008a4076e36f7038180d60ae1521afb524d68 (patch) | |
tree | 80039a3b1d068a6f3ab62470a11c36db269dc431 /crypto/encode_decode/decoder_pkey.c | |
parent | df65c06b59f0ccd06398c0ff3034371fdefd8e70 (diff) | |
download | openssl-new-de5008a4076e36f7038180d60ae1521afb524d68.tar.gz |
DECODER: Add tracing
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13248)
Diffstat (limited to 'crypto/encode_decode/decoder_pkey.c')
-rw-r--r-- | crypto/encode_decode/decoder_pkey.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c index 1835106b95..3a765c5986 100644 --- a/crypto/encode_decode/decoder_pkey.c +++ b/crypto/encode_decode/decoder_pkey.c @@ -14,6 +14,7 @@ #include <openssl/ui.h> #include <openssl/decoder.h> #include <openssl/safestack.h> +#include <openssl/trace.h> #include "crypto/evp.h" #include "crypto/decoder.h" #include "encoder_local.h" @@ -388,13 +389,27 @@ OSSL_DECODER_CTX_new_by_EVP_PKEY(EVP_PKEY **pkey, ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_MALLOC_FAILURE); return NULL; } + + OSSL_TRACE_BEGIN(DECODER) { + BIO_printf(trc_out, + "(ctx %p) Looking for %s decoders with selection %d\n", + (void *)ctx, keytype, selection); + BIO_printf(trc_out, " input type: %s, input structure: %s\n", + input_type, input_structure); + } OSSL_TRACE_END(DECODER); + if (OSSL_DECODER_CTX_set_input_type(ctx, input_type) && OSSL_DECODER_CTX_set_input_structure(ctx, input_structure) && OSSL_DECODER_CTX_set_selection(ctx, selection) && ossl_decoder_ctx_setup_for_EVP_PKEY(ctx, pkey, keytype, libctx, propquery) - && OSSL_DECODER_CTX_add_extra(ctx, libctx, propquery)) + && OSSL_DECODER_CTX_add_extra(ctx, libctx, propquery)) { + OSSL_TRACE_BEGIN(DECODER) { + BIO_printf(trc_out, "(ctx %p) Got %d decoders\n", + (void *)ctx, OSSL_DECODER_CTX_get_num_decoders(ctx)); + } OSSL_TRACE_END(DECODER); return ctx; + } OSSL_DECODER_CTX_free(ctx); return NULL; |