Change in libosmocore[master]: osmo-sim-test: Also [attempt to] dump DF.GSM on USIM cards

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Mar 21 16:16:27 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/17556 )

Change subject: osmo-sim-test: Also [attempt to] dump DF.GSM on USIM cards
......................................................................

osmo-sim-test: Also [attempt to] dump DF.GSM on USIM cards

an USIM application can very well exist on a UICC without supporting
classic DF.GSM access.  However, most commonly, both are found on
cards.

Change-Id: I6180a3f81a7d3006e8ece4302c2433db2588bfaa
---
M src/sim/card_fs_uicc.c
M src/sim/card_fs_usim.c
M utils/osmo-sim-test.c
3 files changed, 12 insertions(+), 12 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/sim/card_fs_uicc.c b/src/sim/card_fs_uicc.c
index c73fc9a..5dcaaa1 100644
--- a/src/sim/card_fs_uicc.c
+++ b/src/sim/card_fs_uicc.c
@@ -231,7 +231,7 @@
 /* Annex E - TS 101 220 */
 static const uint8_t __attribute__((__unused__)) adf_uicc_aid[] = { 0xA0, 0x00, 0x00, 0x00, 0x87, 0x10, 0x01 };
 
-struct osim_card_profile *osim_cprof_uicc(void *ctx)
+struct osim_card_profile *osim_cprof_uicc(void *ctx, bool have_df_gsm)
 {
 	struct osim_card_profile *cprof;
 	struct osim_file_desc *mf;
@@ -255,5 +255,14 @@
 		return NULL;
 	}
 
+	if (have_df_gsm) {
+		/* DF.GSM as sub-directory of MF */
+		rc = osim_int_cprof_add_gsm(mf);
+		if (rc != 0) {
+			talloc_free(cprof);
+			return NULL;
+		}
+	}
+
 	return cprof;
 }
diff --git a/src/sim/card_fs_usim.c b/src/sim/card_fs_usim.c
index 97f712a..d5d2736 100644
--- a/src/sim/card_fs_usim.c
+++ b/src/sim/card_fs_usim.c
@@ -345,14 +345,5 @@
 	/* OMA BCAST Smart Card Profile */
 	add_df_with_ef(uadf, 0x5F80, "DF.BCAST", NULL, 0);
 
-#if 0
-	/* DF.GSM as sub-directory of MF */
-	rc = osim_int_cprof_add_gsm(mf);
-	if (rc != 0) {
-		talloc_free(cprof);
-		return NULL;
-	}
-#endif
-
 	return aprof;
 }
diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c
index e71d0ef..6cf36a6 100644
--- a/utils/osmo-sim-test.c
+++ b/utils/osmo-sim-test.c
@@ -341,7 +341,7 @@
 
 
 extern struct osim_card_profile *osim_cprof_sim(void *ctx);
-extern struct osim_card_profile *osim_cprof_uicc(void *ctx);
+extern struct osim_card_profile *osim_cprof_uicc(void *ctx, bool have_df_gsm);
 
 static int dump_file(struct osim_chan_hdl *chan, const char *short_name, uint16_t fid)
 {
@@ -652,7 +652,7 @@
 
 	rc = osim_uicc_scan_apps(chan);
 	if (rc >= 0) {
-		chan->card->prof = osim_cprof_uicc(chan->card);
+		chan->card->prof = osim_cprof_uicc(chan->card, true);
 		chan->cwd = chan->card->prof->mf;
 	} else if (rc == -0x6e00) {
 		/* CLA not supported: must be classic SIM, not USIM */

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/17556
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6180a3f81a7d3006e8ece4302c2433db2588bfaa
Gerrit-Change-Number: 17556
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200321/3f9d1268/attachment.htm>


More information about the gerrit-log mailing list