diff --git a/armsrc/i2c.c b/armsrc/i2c.c index f8498e972..52d1a64b4 100644 --- a/armsrc/i2c.c +++ b/armsrc/i2c.c @@ -65,7 +65,7 @@ static bool s_proto_announced = false; // keep the T=0 they had before. static uint8_t s_pps_proto_cmd = 0; -#if SAM_SC_FORCE_T1_TA1_95 +#if SAM_SC_FORCE_T1_PROFILE // One-shot request used by the SAM secure-channel path. Keep it separate // from generic SmartCardRaw PPS selection so the performance policy does not // alter unrelated contact-card commands. @@ -1138,7 +1138,7 @@ static bool sc_pps(uint8_t proto, uint8_t ta1) { return false; } // resp is [ok][active protocol][ta1 in force] - if ((resp[0] != 1) || (resp[2] != ta1)) { + if ((resp[0] != 1) || (resp[1] != (proto & 0x0F)) || (resp[2] != ta1)) { return false; } @@ -1162,7 +1162,7 @@ uint8_t sc_active_device_cmd(void) { } void sc_request_sam_t1_profile(void) { -#if SAM_SC_FORCE_T1_TA1_95 +#if SAM_SC_FORCE_T1_PROFILE s_sam_t1_profile_requested = true; #endif } @@ -1241,7 +1241,7 @@ bool GetATR(smart_card_atr_t *card_ptr, bool verbose) { s_card_protocols = atr_protocols(card_ptr->atr, card_ptr->atr_len); s_proto_announced = false; -#if SAM_SC_FORCE_T1_TA1_95 +#if SAM_SC_FORCE_T1_PROFILE const bool request_sam_t1 = s_sam_t1_profile_requested; s_sam_t1_profile_requested = false; if (request_sam_t1) { @@ -1300,7 +1300,7 @@ bool GetATR(smart_card_atr_t *card_ptr, bool verbose) { uint8_t want_proto = atr_first_proto(card_ptr->atr, card_ptr->atr_len); uint8_t want = sc_pps_best_ta1(card_ptr->atr, card_ptr->atr_len); -#if SAM_SC_FORCE_T1_TA1_95 +#if SAM_SC_FORCE_T1_PROFILE if (request_sam_t1 && (s_card_protocols & SC_PROTO_T1)) { want_proto = 1; want = SAM_SC_T1_TA1; diff --git a/armsrc/i2c.h b/armsrc/i2c.h index cbc050b78..66ae7fa6b 100644 --- a/armsrc/i2c.h +++ b/armsrc/i2c.h @@ -57,10 +57,10 @@ // SAM secure-channel transport policy for the performance build. Artemis // offers T=0 first in its ATR; request its advertised T=1 service explicitly -// and use the validated Fi=512/Di=16 rate. This is protocol selection only: +// and use Fi=512/Di=32 with SIM firmware v4.66. This is protocol selection only: // it does not enable APDU dumps or other bring-up diagnostics. -#define SAM_SC_FORCE_T1_TA1_95 1 -#define SAM_SC_T1_TA1 0x95 +#define SAM_SC_FORCE_T1_PROFILE 1 +#define SAM_SC_T1_TA1 0x96 // The SIM module v4 supports up to 384 bytes for the length. #define ISO7816_MAX_FRAME 270 diff --git a/armsrc/sam_sc.c b/armsrc/sam_sc.c index 5ea4f22ab..f1d3462ba 100644 --- a/armsrc/sam_sc.c +++ b/armsrc/sam_sc.c @@ -522,7 +522,7 @@ void sam_sc_handler(const PacketCommandNG *c) { s_sam_sc_session_active = false; I2C_Reset_EnterMainProgram(); StartTicks(); -#if SAM_SC_FORCE_T1_TA1_95 +#if SAM_SC_FORCE_T1_PROFILE sc_request_sam_t1_profile(); #endif smart_card_atr_t card; diff --git a/client/resources/sim024.bin b/client/resources/sim024.bin new file mode 100644 index 000000000..5f79b5afc Binary files /dev/null and b/client/resources/sim024.bin differ diff --git a/client/resources/sim024.sha512.txt b/client/resources/sim024.sha512.txt new file mode 100644 index 000000000..3cbf2209d --- /dev/null +++ b/client/resources/sim024.sha512.txt @@ -0,0 +1 @@ +291660D9063C74204D04AAEDE5925B7DF662C48AF8C0733BC923E5566D42109A72EB97097C6CBD21FD928EB2AF53F57BA35905B523EA3A3CCCF2315191C7BAEA