From 8ab9b6d0ea74d7c83463448fc4e9b0c069130cab Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Tue, 18 Dec 2018 16:14:52 +0200 Subject: [PATCH] sw 0x6cxx works --- client/cmdsmartcard.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index 0d4e7a46d..24803035c 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -488,13 +488,10 @@ int ExchangeAPDUSC(uint8_t *datain, int datainlen, bool activateCard, bool leave // retry if (len > 1 && dataout[len - 2] == 0x6c && datainlen > 4) { UsbCommand c2 = {CMD_SMART_RAW, {SC_RAW_T0, datainlen, 0}}; - memcpy(c2.d.asBytes, datain, datainlen); + memcpy(c2.d.asBytes, datain, 5); - int vlen = 5 + datain[4]; - if (datainlen == vlen) - datainlen++; - - c2.d.asBytes[vlen] = dataout[len - 1]; + // transfer length via T=0 + c2.d.asBytes[4] = dataout[len - 1]; clearCommandBuffer(); SendCommand(&c2);