diff --git a/src/libopensc/card-authentic.c b/src/libopensc/card-authentic.c index 5d924db5..4afbae4b 100644 --- a/src/libopensc/card-authentic.c +++ b/src/libopensc/card-authentic.c @@ -485,8 +485,6 @@ static int authentic_erase_binary(struct sc_card *card, unsigned int offs, size_t count, unsigned long flags) { struct sc_context *ctx = card->ctx; - struct sc_apdu *apdus = NULL, *cur_apdu = NULL; - size_t sz, rest; int rv; unsigned char *buf_zero = NULL; @@ -1375,7 +1373,7 @@ authentic_pin_verify(struct sc_card *card, struct sc_pin_cmd_data *pin_cmd) if (pin_cmd->pin1.data) SHA1(pin_cmd->pin1.data, pin_cmd->pin1.len, pin_sha1); else - SHA1("", 0, pin_sha1); + SHA1((unsigned char *)"", 0, pin_sha1); if (!memcmp(pin_sha1, prv_data->pins_sha1[pin_cmd->pin_reference], SHA_DIGEST_LENGTH)) { sc_log(ctx, "Already verified"); @@ -1953,7 +1951,6 @@ authentic_manage_sdo(struct sc_card *card, struct sc_authentic_sdo *sdo, unsigne { struct sc_context *ctx = card->ctx; struct sc_apdu apdu; - unsigned char rbuf[0x400]; unsigned char *data = NULL; size_t data_len = 0, save_max_send = card->max_send_size; int rv; diff --git a/src/libopensc/pkcs15.c b/src/libopensc/pkcs15.c index 9d1c8298..8208073a 100644 --- a/src/libopensc/pkcs15.c +++ b/src/libopensc/pkcs15.c @@ -18,7 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif #include #include @@ -258,9 +260,6 @@ static const struct sc_asn1_entry c_asn1_ddo[] = { static void fix_authentic_ddo(struct sc_pkcs15_card *p15card) { - struct sc_context *ctx = p15card->card->ctx; - struct sc_path tmp_path; - /* AuthentIC v3.2 card has invalid ODF and tokenInfo paths encoded into DDO. * Cleanup this attributes -- default values must be OK. */ @@ -698,18 +697,21 @@ static struct sc_app_info *sc_dup_app_info(const struct sc_app_info *info) static int sc_pkcs15_bind_internal(sc_pkcs15_card_t *p15card, struct sc_aid *aid) { - unsigned char *buf = NULL; - int err, ok = 0, ii; - size_t len; sc_path_t tmppath; sc_card_t *card = p15card->card; sc_context_t *ctx = card->ctx; sc_pkcs15_tokeninfo_t tokeninfo; sc_pkcs15_df_t *df; const sc_app_info_t *info = NULL; + unsigned char *buf = NULL; + size_t len; + int err, ok = 0; SC_FUNC_CALLED(ctx, SC_LOG_DEBUG_NORMAL); + err = sc_parse_ef_atr(card); + SC_TEST_RET(ctx, SC_LOG_DEBUG_NORMAL, err, "Failed to parse EF(ATR) content"); + /* Enumerate apps now */ if (card->app_count < 0) { err = sc_enum_apps(card);