From 07a8f7a6de334e9adde8ea63776560480f72a467 Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Mon, 5 Dec 2022 21:15:49 +0100 Subject: [PATCH 1/2] Raise the buffer size even more. I was too conservative as it requires 261 bytes. Let's put 270 for the peace of mind. --- armsrc/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/armsrc/i2c.c b/armsrc/i2c.c index eba6fe200..d8495e59c 100644 --- a/armsrc/i2c.c +++ b/armsrc/i2c.c @@ -54,7 +54,7 @@ static void __attribute__((optimize("O0"))) I2CSpinDelayClk(uint16_t delay) { #define I2C_DELAY_XCLK(x) I2CSpinDelayClk((x)) // The SIM module v4 supports up to 384 bytes for the length. -#define ISO7816_MAX_FRAME 260 +#define ISO7816_MAX_FRAME 270 // try i2c bus recovery at 100kHz = 5us high, 5us low void I2C_recovery(void) { From 5bd6379b5bd761405473f4d95aba93f0a77c3b00 Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Mon, 5 Dec 2022 21:55:38 +0100 Subject: [PATCH 2/2] Move message to debug --- client/src/cmdsmartcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cmdsmartcard.c b/client/src/cmdsmartcard.c index 80cf0f4c4..4a0a6606a 100644 --- a/client/src/cmdsmartcard.c +++ b/client/src/cmdsmartcard.c @@ -337,7 +337,7 @@ static int smart_responseEx(uint8_t *out, int maxoutlen, bool verbose) { } int ofs = totallen; maxoutlen -= totallen; - PrintAndLogEx(INFO, "Keeping data (%d bytes): %s", ofs, sprint_hex(out, ofs)); + PrintAndLogEx(DEBUG, "Keeping data (%d bytes): %s", ofs, sprint_hex(out, ofs)); int len = out[datalen - 1]; if (len == 0 || len > MAX_APDU_SIZE) {