Make the pcsc pinpad option work.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2503 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
martin 2005-08-21 18:44:07 +00:00
parent 924a118501
commit 7ffd68a9ee
3 changed files with 9 additions and 3 deletions

View File

@ -1122,7 +1122,7 @@ int _sc_check_forced_protocol(sc_context_t *ctx, u8 *atr, size_t atr_len, unsign
return ok; return ok;
} }
scconf_block *_get_conf_block(sc_context_t *ctx, const char *name1, const char *name2) scconf_block *_get_conf_block(sc_context_t *ctx, const char *name1, const char *name2, u8 priority)
{ {
int i; int i;
scconf_block *conf_block = NULL; scconf_block *conf_block = NULL;
@ -1133,7 +1133,7 @@ scconf_block *_get_conf_block(sc_context_t *ctx, const char *name1, const char *
blocks = scconf_find_blocks(ctx->conf, ctx->conf_blocks[i], name1, name2); blocks = scconf_find_blocks(ctx->conf, ctx->conf_blocks[i], name1, name2);
conf_block = blocks[0]; conf_block = blocks[0];
free(blocks); free(blocks);
if (conf_block != NULL) if (conf_block != NULL && priority)
break; break;
} }
return conf_block; return conf_block;

View File

@ -87,7 +87,7 @@ struct sc_algorithm_info * _sc_card_find_rsa_alg(struct sc_card *card,
int sc_asn1_read_tag(const u8 ** buf, size_t buflen, unsigned int *cla_out, int sc_asn1_read_tag(const u8 ** buf, size_t buflen, unsigned int *cla_out,
unsigned int *tag_out, size_t *taglen); unsigned int *tag_out, size_t *taglen);
scconf_block *_get_conf_block(sc_context_t *ctx, const char *name1, const char *name2); scconf_block *_get_conf_block(sc_context_t *ctx, const char *name1, const char *name2, u8 priority);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -547,6 +547,12 @@ static int pcsc_init(sc_context_t *ctx, void **reader_data)
return SC_ERROR_OUT_OF_MEMORY; return SC_ERROR_OUT_OF_MEMORY;
} }
gpriv->pcsc_ctx = pcsc_ctx; gpriv->pcsc_ctx = pcsc_ctx;
conf_block = _get_conf_block(ctx, "reader_driver", "pcsc", 1);
if (conf_block) {
gpriv->enable_pinpad =
scconf_get_bool(conf_block, "enable_pinpad", 0);
}
*reader_data = gpriv; *reader_data = gpriv;
reader_buf = (char *) malloc(sizeof(char) * reader_buf_size); reader_buf = (char *) malloc(sizeof(char) * reader_buf_size);