Open Source Telephony
 help / color / mirror / Atom feed
* [PATCHv2 01/11] simutil: Added app type to application parser
@ 2017-10-10 21:36 James Prestwood
  2017-10-10 21:36 ` [PATCHv2 02/11] simutil: Added authenticate builder/parser API James Prestwood
                   ` (10 more replies)
  0 siblings, 11 replies; 16+ messages in thread
From: James Prestwood @ 2017-10-10 21:36 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

Parsing a SIM application only copied the 16 byte AID
portion, which included the application type. Parsing out
the type makes sorting much easier for modules using the
parser.
---
 src/simutil.c |  2 ++
 src/simutil.h | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/src/simutil.c b/src/simutil.c
index 4731d3b..f43c2c2 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -1570,6 +1570,8 @@ GSList *sim_parse_app_template_entries(const unsigned char *buffer, int len)
 
 		memcpy(app.aid, aid, app.aid_len);
 
+		app.type = GUINT16_FROM_BE(*((unsigned short *)(app.aid + 5)));
+
 		/* Find the label (optional) */
 		label = ber_tlv_find_by_tag(dataobj, 0x50, dataobj_len,
 						&label_len);
diff --git a/src/simutil.h b/src/simutil.h
index 1faf948..9984b2c 100644
--- a/src/simutil.h
+++ b/src/simutil.h
@@ -261,6 +261,17 @@ enum sim_csp_entry {
 	SIM_CSP_ENTRY_INFORMATION_NUMBERS =	0xD5,
 };
 
+/* 101.220 Annex E */
+enum sim_app_type {
+	SIM_APP_TYPE_UICC =		0x1001,
+	SIM_APP_TYPE_USIM =		0x1002,
+	SIM_APP_TYPE_USIM_TOOLKIT =	0x1003,
+	SIM_APP_TYPE_ISIM =		0x1004,
+	SIM_APP_TYPE_USIM_API =		0x1005,
+	SIM_APP_TYPE_ISIM_API =		0x1006,
+	SIM_APP_TYPE_CONTACT_MGR =	0x1007
+};
+
 enum ber_tlv_data_type {
 	BER_TLV_DATA_TYPE_UNIVERSAL =		0,
 	BER_TLV_DATA_TYPE_APPLICATION =		1,
@@ -296,6 +307,7 @@ struct sim_app_record {
 	unsigned char aid[16];
 	int aid_len;
 	char *label;
+	enum sim_app_type type;
 };
 
 struct simple_tlv_iter {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-10-11 15:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-10 21:36 [PATCHv2 01/11] simutil: Added app type to application parser James Prestwood
2017-10-10 21:36 ` [PATCHv2 02/11] simutil: Added authenticate builder/parser API James Prestwood
2017-10-11 15:30   ` Denis Kenzior
2017-10-10 21:36 ` [PATCHv2 03/11] unit: add gsm and umts parse/build unit tests James Prestwood
2017-10-10 21:36 ` [PATCHv2 04/11] sim: new API to check for a UST service only James Prestwood
2017-10-11 15:34   ` Denis Kenzior
2017-10-10 21:36 ` [PATCHv2 05/11] sim-auth: prep simauth/dbus headers James Prestwood
2017-10-11 15:39   ` Denis Kenzior
2017-10-10 21:36 ` [PATCHv2 06/11] sim-auth: implementation of core sim-auth atom James Prestwood
2017-10-10 21:36 ` [PATCHv2 07/11] atmodem: implemented sim-auth functionality in atmodem James Prestwood
2017-10-10 21:36 ` [PATCHv2 08/11] xmm7xxx: add sim-auth driver to xmm7xxx plugin James Prestwood
2017-10-10 21:36 ` [PATCHv2 09/11] phonesim: Added sim-auth to phonesim plugin James Prestwood
2017-10-10 21:36 ` [PATCHv2 10/11] test: added tests for GSM/UMTS auth algorithms James Prestwood
2017-10-10 21:36 ` [PATCHv2 11/11] doc: documentation for SimAuth dbus interfaces James Prestwood
2017-10-11 15:57   ` Denis Kenzior
2017-10-11 15:29 ` [PATCHv2 01/11] simutil: Added app type to application parser Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox