bugfix: initializing apdu in pace_gen_auth. bin_log now checks input data.
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@88 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -401,8 +401,6 @@ static int pace_gen_auth(sc_card_t *card,
|
|||||||
memset(&apdu, 0, sizeof apdu);
|
memset(&apdu, 0, sizeof apdu);
|
||||||
apdu.cla = 0x10;
|
apdu.cla = 0x10;
|
||||||
apdu.ins = 0x86;
|
apdu.ins = 0x86;
|
||||||
apdu.p1 = 0;
|
|
||||||
apdu.p2 = 0;
|
|
||||||
apdu.cse = SC_APDU_CASE_4;
|
apdu.cse = SC_APDU_CASE_4;
|
||||||
apdu.flags = SC_APDU_FLAGS_NO_GET_RESP|SC_APDU_FLAGS_NO_RETRY_WL;
|
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;
|
sc_apdu_t apdu;
|
||||||
|
|
||||||
apdu.cla = 0;
|
memset(&apdu, 0, sizeof apdu);
|
||||||
apdu.ins = 0x2C;
|
apdu.ins = 0x2C;
|
||||||
apdu.p2 = pin_id;
|
apdu.p2 = pin_id;
|
||||||
apdu.data = (u8 *) new;
|
apdu.data = (u8 *) new;
|
||||||
|
|||||||
@@ -49,7 +49,10 @@ void _bin_log(sc_context_t *ctx, int type, const char *file, int line,
|
|||||||
{
|
{
|
||||||
char buf[1024];
|
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) {
|
if (!f) {
|
||||||
sc_do_log(ctx, type, file, line, func,
|
sc_do_log(ctx, type, file, line, func,
|
||||||
"\n%s (%u byte%s):\n%s"
|
"\n%s (%u byte%s):\n%s"
|
||||||
|
|||||||
Reference in New Issue
Block a user