diff --git a/crypto/context.c b/crypto/context.c index 9bb0577adfd8a..5ff8b069080e6 100644 --- a/crypto/context.c +++ b/crypto/context.c @@ -9,6 +9,7 @@ #include "crypto/cryptlib.h" #include +#include #include "internal/thread_once.h" #include "internal/property.h" #include "internal/cryptlib.h" @@ -107,6 +108,7 @@ static int context_init(OSSL_LIB_CTX *ctx) ctx->evp_method_store = ossl_method_store_new(ctx); if (ctx->evp_method_store == NULL) goto err; + OSSL_TRACE1(QUERY, "context_init: allocating store %p\n", ctx->evp_method_store); #ifndef FIPS_MODULE /* P2. Must be freed before the provider store is freed */ diff --git a/crypto/core_fetch.c b/crypto/core_fetch.c index 70715e7d6a99c..553ba77a52f1a 100644 --- a/crypto/core_fetch.c +++ b/crypto/core_fetch.c @@ -10,6 +10,7 @@ #include #include +#include #include "internal/cryptlib.h" #include "internal/core.h" #include "internal/property.h" @@ -110,6 +111,9 @@ static void ossl_method_construct_this(OSSL_PROVIDER *provider, == NULL) return; + OSSL_TRACE2(QUERY, + "ossl_method_construct_this: putting an algo to the store %p with no_store %d\n", + data->store, no_store); /* * Note regarding putting the method in stores: * diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c index 408b3897c994a..915d55c983022 100644 --- a/crypto/evp/evp_fetch.c +++ b/crypto/evp/evp_fetch.c @@ -48,13 +48,18 @@ static void *get_tmp_evp_method_store(void *data) { struct evp_method_data_st *methdata = data; - if (methdata->tmp_store == NULL) + if (methdata->tmp_store == NULL) { methdata->tmp_store = ossl_method_store_new(methdata->libctx); + OSSL_TRACE1(QUERY, "Allocating a new tmp_store %p\n", (void *)methdata->tmp_store); + } else { + OSSL_TRACE1(QUERY, "Using the existing tmp_store %p\n", (void *)methdata->tmp_store); + } return methdata->tmp_store; } static void dealloc_tmp_evp_method_store(void *store) { + OSSL_TRACE1(QUERY, "Deallocating the tmp_store %p\n", store); if (store != NULL) ossl_method_store_free(store); } @@ -184,10 +189,15 @@ static int put_evp_method_in_store(void *store, void *method, || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0) return 0; + OSSL_TRACE1(QUERY, "put_evp_method_in_store: original store: %p\n", store); if (store == NULL && (store = get_evp_method_store(methdata->libctx)) == NULL) return 0; + OSSL_TRACE5(QUERY, + "put_evp_method_in_store: " + "store: %p, names: %s, operation_id %d, method_id: %d, properties: %s\n", + store, names, methdata->operation_id, meth_id, propdef ? propdef : ""); return ossl_method_store_add(store, prov, meth_id, propdef, method, methdata->refcnt_up_method, methdata->destruct_method); @@ -357,6 +367,11 @@ inner_evp_generic_fetch(struct evp_method_data_st *methdata, ossl_lib_ctx_get_descriptor(methdata->libctx), name == NULL ? "" : name, name_id, properties == NULL ? "" : properties); + } else { + OSSL_TRACE4(QUERY, "%s, Algorithm (%s : %d), Properties (%s)\n", + ossl_lib_ctx_get_descriptor(methdata->libctx), + name == NULL ? "" : name, name_id, + properties == NULL ? "" : properties); } return method; diff --git a/crypto/property/property.c b/crypto/property/property.c index 4916ea450d277..c91eac2c0680b 100644 --- a/crypto/property/property.c +++ b/crypto/property/property.c @@ -394,6 +394,7 @@ int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov, alg->nid = nid; if (!ossl_method_store_insert(store, alg)) goto err; + OSSL_TRACE2(QUERY, "Inserted an alg with nid %d into the store %p\n", nid, store); } /* Push onto stack if there isn't one there already */ @@ -639,11 +640,14 @@ int ossl_method_store_fetch(OSSL_METHOD_STORE *store, if (!ossl_property_read_lock(store)) return 0; + OSSL_TRACE2(QUERY, "Retrieving by nid %d from store %p\n", nid, store); alg = ossl_method_store_retrieve(store, nid); if (alg == NULL) { ossl_property_unlock(store); + OSSL_TRACE2(QUERY, "Failed to retrieve by nid %d from store %p\n", nid, store); return 0; } + OSSL_TRACE2(QUERY, "Retrieved by nid %d from store %p\n", nid, store); /* * If a property query string is provided, convert it to an