- actually honor the use_cache config option

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@855 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2003-01-09 12:31:03 +00:00
parent 1aa5e6161c
commit 373de3ed87
1 changed files with 12 additions and 2 deletions

View File

@ -456,6 +456,8 @@ int sc_pkcs15_bind(struct sc_card *card,
struct sc_pkcs15_card *p15card = NULL;
struct sc_path tmppath;
struct sc_context *ctx;
scconf_block *conf_block = NULL, **blocks;
int i;
assert(sc_card_valid(card) && p15card_out != NULL);
ctx = card->ctx;
@ -465,8 +467,16 @@ int sc_pkcs15_bind(struct sc_card *card,
return SC_ERROR_OUT_OF_MEMORY;
p15card->card = card;
/* FIXME: parse config file */
p15card->opts.use_cache = 1;
for (i = 0; ctx->conf_blocks[i] != NULL; i++) {
blocks = scconf_find_blocks(ctx->conf, ctx->conf_blocks[i],
"framework", "pkcs15");
conf_block = blocks[0];
free(blocks);
if (conf_block != NULL)
break;
}
if (conf_block)
p15card->opts.use_cache = scconf_get_bool(conf_block, "use_caching", 0);
err = sc_lock(card);
if (err) {