#include <openssl/crypto.h>
#include <openssl/err.h>
+#include <openssl/trace.h>
#include <openssl/store.h>
#include "internal/thread_once.h"
#include "crypto/store.h"
/* Try each scheme until we find one that could open the URI */
for (i = 0; loader_ctx == NULL && i < schemes_n; i++) {
- if ((loader = ossl_store_get0_loader_int(schemes[i])) != NULL)
+ OSSL_TRACE1(STORE, "Looking up scheme %s\n", schemes[i]);
+ if ((loader = ossl_store_get0_loader_int(schemes[i])) != NULL) {
+ OSSL_TRACE1(STORE, "Found loader for scheme %s\n", schemes[i]);
loader_ctx = loader->open(loader, uri, ui_method, ui_data);
+ OSSL_TRACE2(STORE, "Opened %s => %p\n", uri, (void *)loader_ctx);
+ }
}
+
if (loader_ctx == NULL)
goto err;
if (OSSL_STORE_eof(ctx))
return NULL;
+ OSSL_TRACE(STORE, "Loading next object\n");
v = ctx->loader->load(ctx->loader_ctx, ctx->ui_method, ctx->ui_data);
if (ctx->post_process != NULL && v != NULL) {
}
}
+ if (v != NULL)
+ OSSL_TRACE1(STORE, "Got a %s\n",
+ OSSL_STORE_INFO_type_string(OSSL_STORE_INFO_get_type(v)));
+
return v;
}
int OSSL_STORE_close(OSSL_STORE_CTX *ctx)
{
- int loader_ret = ctx->loader->close(ctx->loader_ctx);
+ int loader_ret;
+
+ OSSL_TRACE1(STORE, "Closing %p\n", (void *)ctx->loader_ctx);
+ loader_ret = ctx->loader->close(ctx->loader_ctx);
OPENSSL_free(ctx);
return loader_ret;
TRACE_CATEGORY_(PKCS12_DECRYPT),
TRACE_CATEGORY_(X509V3_POLICY),
TRACE_CATEGORY_(BN_CTX),
+ TRACE_CATEGORY_(STORE),
};
const char *OSSL_trace_get_category_name(int num)
# define OSSL_TRACE_CATEGORY_X509V3_POLICY 11
# define OSSL_TRACE_CATEGORY_BN_CTX 12
# define OSSL_TRACE_CATEGORY_CMP 13
-# define OSSL_TRACE_CATEGORY_NUM 14
+# define OSSL_TRACE_CATEGORY_STORE 14
+# define OSSL_TRACE_CATEGORY_NUM 15
/* Returns the trace category number for the given |name| */
int OSSL_trace_get_category_num(const char *name);