From 7a03f1883bdb69790bfe5ec9264d3204e3f01a31 Mon Sep 17 00:00:00 2001 From: Viktor Tarasov Date: Wed, 4 Dec 2013 09:43:32 +0100 Subject: [PATCH] libopensc: create and export 'sc_match_atr_block' --- src/libopensc/card.c | 5 +++++ src/libopensc/cardctl.h | 6 +++--- src/libopensc/libopensc.exports | 1 + src/libopensc/opensc.h | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/libopensc/card.c b/src/libopensc/card.c index 6543c00d..9a331728 100644 --- a/src/libopensc/card.c +++ b/src/libopensc/card.c @@ -1075,6 +1075,11 @@ void sc_print_cache(struct sc_card *card) { sc_print_path(&card->cache.current_df->path)); } +scconf_block * +sc_match_atr_block(sc_context_t *ctx, struct sc_card_driver *driver, struct sc_atr *atr) +{ + return _sc_match_atr_block(ctx, driver, atr); +} #ifdef ENABLE_SM static int diff --git a/src/libopensc/cardctl.h b/src/libopensc/cardctl.h index 1184f8b0..3c426ed6 100644 --- a/src/libopensc/cardctl.h +++ b/src/libopensc/cardctl.h @@ -280,16 +280,16 @@ struct sc_cardctl_default_key { * Generic cardctl - initialize token using PKCS#11 style */ typedef struct sc_cardctl_pkcs11_init_token { - const char * so_pin; + const unsigned char * so_pin; size_t so_pin_len; - const char * label; + const char * label; } sc_cardctl_pkcs11_init_token_t; /* * Generic cardctl - set pin using PKCS#11 style */ typedef struct sc_cardctl_pkcs11_init_pin { - const char * pin; + const unsigned char * pin; size_t pin_len; } sc_cardctl_pkcs11_init_pin_t; diff --git a/src/libopensc/libopensc.exports b/src/libopensc/libopensc.exports index c61ede46..a35c26d4 100644 --- a/src/libopensc/libopensc.exports +++ b/src/libopensc/libopensc.exports @@ -123,6 +123,7 @@ sc_logout sc_make_cache_dir sc_mem_clear sc_mem_reverse +sc_match_atr_block sc_path_print sc_path_set sc_pin_cmd diff --git a/src/libopensc/opensc.h b/src/libopensc/opensc.h index 5de4c125..9b393a9f 100644 --- a/src/libopensc/opensc.h +++ b/src/libopensc/opensc.h @@ -1283,6 +1283,7 @@ struct sc_algorithm_info * sc_card_find_ec_alg(struct sc_card *card, struct sc_algorithm_info * sc_card_find_gostr3410_alg(struct sc_card *card, unsigned int key_length); +scconf_block *sc_match_atr_block(sc_context_t *ctx, struct sc_card_driver *driver, struct sc_atr *atr); /** * Get CRC-32 digest * @param value pointer to data used for CRC calculation