libopensc: procedure to log the card's cache

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5069 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
vtarasov 2011-01-09 09:32:34 +00:00
parent 8ee55a38b3
commit 2244d0c96f
2 changed files with 26 additions and 0 deletions

View File

@ -961,3 +961,28 @@ scconf_block *sc_get_conf_block(sc_context_t *ctx, const char *name1, const char
return conf_block;
}
void sc_print_cache(struct sc_card *card) {
struct sc_context *ctx = NULL;
assert(card != NULL);
ctx = card->ctx;
if (!card->cache.valid || (!card->cache.current_ef && !card->cache.current_df)) {
sc_debug(ctx, SC_LOG_DEBUG_NORMAL, "card cache invalid");
return;
}
if (card->cache.current_ef) {
sc_debug(ctx, SC_LOG_DEBUG_NORMAL, "current_ef(type=%i) %s",
card->cache.current_ef->path.type,
sc_print_path(&card->cache.current_ef->path));
}
if (card->cache.current_df) {
sc_debug(ctx, SC_LOG_DEBUG_NORMAL, "current_df(type=%i, aid_len=%i) %s",
card->cache.current_df->path.type,
card->cache.current_df->path.aid.len,
sc_print_path(&card->cache.current_df->path));
}
}

View File

@ -288,3 +288,4 @@ sc_pkcs15init_update_file
sc_pkcs15init_verify_secret
sc_pkcs15init_sanity_check
sc_card_find_rsa_alg
sc_print_cache