diff --git a/ccid/pace.c b/ccid/pace.c index 531af15..8c6cd42 100644 --- a/ccid/pace.c +++ b/ccid/pace.c @@ -401,8 +401,6 @@ static int pace_gen_auth(sc_card_t *card, memset(&apdu, 0, sizeof apdu); apdu.cla = 0x10; apdu.ins = 0x86; - apdu.p1 = 0; - apdu.p2 = 0; apdu.cse = SC_APDU_CASE_4; apdu.flags = SC_APDU_FLAGS_NO_GET_RESP|SC_APDU_FLAGS_NO_RETRY_WL; @@ -583,7 +581,7 @@ pace_reset_retry_counter(struct sm_ctx *ctx, sc_card_t *card, { sc_apdu_t apdu; - apdu.cla = 0; + memset(&apdu, 0, sizeof apdu); apdu.ins = 0x2C; apdu.p2 = pin_id; apdu.data = (u8 *) new; diff --git a/ccid/sm.c b/ccid/sm.c index 2729671..181f1a5 100644 --- a/ccid/sm.c +++ b/ccid/sm.c @@ -49,7 +49,10 @@ void _bin_log(sc_context_t *ctx, int type, const char *file, int line, { char buf[1024]; - sc_hex_dump(ctx, data, len, buf, sizeof buf); + if (data) + sc_hex_dump(ctx, data, len, buf, sizeof buf); + else + buf[0] = 0; if (!f) { sc_do_log(ctx, type, file, line, func, "\n%s (%u byte%s):\n%s"