aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-04-25 20:50:13 +0200
committerHarald Welte <laforge@osmocom.org>2021-04-25 21:09:23 +0200
commit22117a7164012d6d88fc202cd63df79c6068484d (patch)
treeebd838fbe90a86799b902d41d30b31dc18baf715 /include
parenta0f2b21c6d275456995fc6778f654af3a5e7ee93 (diff)
sim: Obtain card ATR when opening the card
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/sim/sim.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/osmocom/sim/sim.h b/include/osmocom/sim/sim.h
index 72e79046..16b9f1fa 100644
--- a/include/osmocom/sim/sim.h
+++ b/include/osmocom/sim/sim.h
@@ -11,6 +11,13 @@
#define APDU_HDR_LEN 5
#define MAX_AID_LEN 16 /* Table 13.2 of TS 102 221 */
+
+/*! Maximum Answer-To-Reset (ATR) size in bytes
+ * @note defined in ISO/IEC 7816-3:2006(E) section 8.2.1 as 32, on top the initial character TS of section 8.1
+ * @remark technical there is no size limitation since Yi present in T0,TDi will indicate if more interface bytes are present, including TDi+i
+ */
+#define OSIM_MAX_ATR_LEN 33
+
/*! command-response pairs cases
*
* Enumeration used to identify the APDU structure based on command-response pair case , as specified in ISO/IEC 7816-3:2006(E) ยง12.1.
@@ -409,6 +416,10 @@ struct osim_card_hdl {
/*! list of applications found on card */
struct llist_head apps;
+
+ /*! ATR (Answer To Reset) of the card */
+ uint8_t atr[OSIM_MAX_ATR_LEN];
+ unsigned int atr_len;
};
struct osim_chan_hdl {