- 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:
parent
1aa5e6161c
commit
373de3ed87
|
@ -456,6 +456,8 @@ int sc_pkcs15_bind(struct sc_card *card,
|
||||||
struct sc_pkcs15_card *p15card = NULL;
|
struct sc_pkcs15_card *p15card = NULL;
|
||||||
struct sc_path tmppath;
|
struct sc_path tmppath;
|
||||||
struct sc_context *ctx;
|
struct sc_context *ctx;
|
||||||
|
scconf_block *conf_block = NULL, **blocks;
|
||||||
|
int i;
|
||||||
|
|
||||||
assert(sc_card_valid(card) && p15card_out != NULL);
|
assert(sc_card_valid(card) && p15card_out != NULL);
|
||||||
ctx = card->ctx;
|
ctx = card->ctx;
|
||||||
|
@ -465,8 +467,16 @@ int sc_pkcs15_bind(struct sc_card *card,
|
||||||
return SC_ERROR_OUT_OF_MEMORY;
|
return SC_ERROR_OUT_OF_MEMORY;
|
||||||
p15card->card = card;
|
p15card->card = card;
|
||||||
|
|
||||||
/* FIXME: parse config file */
|
for (i = 0; ctx->conf_blocks[i] != NULL; i++) {
|
||||||
p15card->opts.use_cache = 1;
|
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);
|
err = sc_lock(card);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in New Issue