TA1=96 support for SIM module
This commit is contained in:
1 parent
47d0a8fa00
commit
264d9bf284
5 files changed
+10
-9
No files matched your search
+5
-5
@@ -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;
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
291660D9063C74204D04AAEDE5925B7DF662C48AF8C0733BC923E5566D42109A72EB97097C6CBD21FD928EB2AF53F57BA35905B523EA3A3CCCF2315191C7BAEA
|
||||
Reference in new issue
Block a user