From affee79b692d28cdaff06d2333065208a59b714d Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 8 Nov 2018 13:45:57 +0100 Subject: [PATCH] fix 'sc raw' - now raw command automatically adjust when getting a 0x6C response code and resend command. --- client/cmdsmartcard.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index fc188b951..675b9a9b7 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -224,6 +224,21 @@ int CmdSmartRaw(const char *Cmd) { free(buf); return 2; } + + if ( buf[0] == 0x6C ) { + data[4] = buf[1]; + + memcpy(c.d.asBytes, data, sizeof(data) ); + clearCommandBuffer(); + SendCommand(&c); + len = smart_response(buf); + + // TLV decoder + if (len > 4) + TLVPrintFromBuffer(buf+1, len-3); + + data[4] = 0; + } if (decodeTLV && len > 4) TLVPrintFromBuffer(buf+1, len-3);