From 373de3ed8728d2696fb997875e4298b7d6a5bf1b Mon Sep 17 00:00:00 2001 From: okir Date: Thu, 9 Jan 2003 12:31:03 +0000 Subject: [PATCH] - actually honor the use_cache config option git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@855 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/libopensc/pkcs15.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libopensc/pkcs15.c b/src/libopensc/pkcs15.c index 19d747e2..fe9db437 100644 --- a/src/libopensc/pkcs15.c +++ b/src/libopensc/pkcs15.c @@ -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) {