lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

June 2024

  • 1 participants
  • 1566 discussions
[S] Change in libosmocore[rel-1.9.3]: Bump version: 1.9.2.2-55ea-dirty → 1.9.3
by laforge 06 Jun '24

06 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/37120?usp=email ) Change subject: Bump version: 1.9.2.2-55ea-dirty → 1.9.3 ...................................................................... Bump version: 1.9.2.2-55ea-dirty → 1.9.3 Change-Id: Ieab03b62fc1b1bbb69f566cf3b631330fcbccdf8 --- M debian/changelog M src/sim/Makefile.am 2 files changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/37120/1 diff --git a/debian/changelog b/debian/changelog index 9a06fe9..308fabf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libosmocore (1.9.3) unstable; urgency=medium + + * libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions + * libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA + + -- Harald Welte <laforge(a)osmocom.org> Thu, 06 Jun 2024 19:40:40 +0200 + libosmocore (1.9.2) unstable; urgency=medium [ Pau Espin Pedrol ] diff --git a/src/sim/Makefile.am b/src/sim/Makefile.am index 0f6be57..01c5175 100644 --- a/src/sim/Makefile.am +++ b/src/sim/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=3:2:1 +LIBVERSION=3:3:1 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -fPIC -Wall $(TALLOC_CFLAGS) -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37120?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: rel-1.9.3 Gerrit-Change-Id: Ieab03b62fc1b1bbb69f566cf3b631330fcbccdf8 Gerrit-Change-Number: 37120 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[rel-1.9.3]: libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions
by laforge 06 Jun '24

06 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/37118?usp=email ) Change subject: libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions ...................................................................... libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions In their infinite wisdom, GlobalPlatform re-defined the CLA 8x / INS F2 command alreay specified by ETSI TS 102 221. This wouldn't be as bads if they had the same "Case". However, ETSI has case 2 while GP has case 4. Lucikly, the P1 coding of ETSI [so far] states all the four upper bits must be 0, while GP always has one of those bits set. Before this patch, it is possible that a Modem/Phone will send an 8xF2 command and intends it as a GlobalPlatform command (with Lc > 0 and command data portion), while this code assumes it is an ETSI UICC command with Lc=0 and hence no command data portion. This will make communication break when using simtrace2 'cardem'. Change-Id: I8dd317ef8f942542e412b18c834a0467c51291c3 Related: SYS#6865 Related: https://lists.osmocom.org/hyperkitty/list/simtrace@lists.osmocom.org/thread… --- M src/sim/class_tables.c M tests/sim/sim_test.c M tests/sim/sim_test.ok 3 files changed, 53 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/37118/1 diff --git a/src/sim/class_tables.c b/src/sim/class_tables.c index 9c51387..1cda9a8 100644 --- a/src/sim/class_tables.c +++ b/src/sim/class_tables.c @@ -187,6 +187,16 @@ default: return 3; } + break; + case 0xF2: + /* in their infinite wisdom, GlobalPlatform re-defined the CLA 8x / INS F2 command, so one can + * take a guess if it's GlobalPlatform or ETSI. Lucikly, the P1 coding of ETSI [so far] + * states all the four upper bits must be 0, while GP always has one of those bits set */ + if (p1 & 0xF0) + return 4; /* GlobalPlatform v2.2 11.4.2 */ + else + return 2; /* ETSI TS 102 221 V16.2.0 11.1.2 */ + break; } return 0; } @@ -217,7 +227,7 @@ [0xE2] = 0x80, /* STORE DATA */ [0xCA] = 4, /* GET DATA */ [0xCB] = 4, /* GET DATA */ - [0xF2] = 4, /* GET STATUS */ + [0xF2] = 0x80, /* GET STATUS */ [0xE6] = 4, /* INSTALL */ [0xE8] = 4, /* LOAD */ [0xD8] = 4, /* PUT KEY */ @@ -245,6 +255,12 @@ .helper = uicc046_cla_ins_helper, .ins_tbl = uicc_ins_tbl_046, }, { + /* must be before uicc_ins_tbl_8ce below with same CLA+mask */ + .cla = 0x80, + .cla_mask = 0xF0, + .helper = gp_cla_ins_helper, + .ins_tbl = gp_ins_tbl_8ce, + }, { .cla = 0x80, .cla_mask = 0xF0, .ins_tbl = uicc_ins_tbl_8ce, @@ -257,11 +273,6 @@ .cla_mask = 0xF0, .ins_tbl = uicc_ins_tbl_8ce, }, { - .cla = 0x80, - .cla_mask = 0xF0, - .helper = gp_cla_ins_helper, - .ins_tbl = gp_ins_tbl_8ce, - }, { .cla = 0xC0, .cla_mask = 0xF0, .helper = gp_cla_ins_helper, @@ -307,6 +318,12 @@ .helper = uicc046_cla_ins_helper, .ins_tbl = uicc_ins_tbl_046, }, { + /* must be before uicc_ins_tbl_8ce below with same CLA+mask */ + .cla = 0x80, + .cla_mask = 0xF0, + .helper = gp_cla_ins_helper, + .ins_tbl = gp_ins_tbl_8ce, + }, { .cla = 0x80, .cla_mask = 0xF0, .ins_tbl = uicc_ins_tbl_8ce, diff --git a/tests/sim/sim_test.c b/tests/sim/sim_test.c index 2e2eec5..9a52af4 100644 --- a/tests/sim/sim_test.c +++ b/tests/sim/sim_test.c @@ -27,6 +27,8 @@ const uint8_t uicc_tprof_wrong_class[] = { 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, 0x02 }; const uint8_t uicc_read[] = { 0x00, 0xB0, 0x00, 0x00, 0x10 }; const uint8_t uicc_upd[] = { 0x00, 0xD6, 0x00, 0x00, 0x02, 0x01, 0x02 }; +const uint8_t uicc_get_status[] = { 0x80, 0xf2, 0x00, 0x02, 0x10 }; +const uint8_t euicc_m2m_get_status[] = { 0x81, 0xf2, 0x40, 0x02, 0x02, 0x4f, 0x00 }; #define APDU_CASE_ASSERT(x, y) \ do { \ @@ -45,6 +47,8 @@ APDU_CASE_ASSERT(uicc_tprof_wrong_class, 0); APDU_CASE_ASSERT(uicc_read, 2); APDU_CASE_ASSERT(uicc_upd, 3); + APDU_CASE_ASSERT(uicc_get_status, 2); + APDU_CASE_ASSERT(euicc_m2m_get_status, 4); } int main(int argc, char **argv) diff --git a/tests/sim/sim_test.ok b/tests/sim/sim_test.ok index 7d3f986..cac59ba 100644 --- a/tests/sim/sim_test.ok +++ b/tests/sim/sim_test.ok @@ -4,3 +4,5 @@ Testing uicc_tprof_wrong_class Testing uicc_read Testing uicc_upd +Testing uicc_get_status +Testing euicc_m2m_get_status -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37118?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: rel-1.9.3 Gerrit-Change-Id: I8dd317ef8f942542e412b18c834a0467c51291c3 Gerrit-Change-Number: 37118 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[rel-1.9.3]: libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA
by laforge 06 Jun '24

06 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/37119?usp=email ) Change subject: libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA ...................................................................... libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA in their infinite wisdom, GlobalPlatform made GET DATA a command that can be either APDU case 2 or case 4. As the specify Le must be 0x00, we can conclude that P3 == 0x00 must be Le, while P3 != 0x00 must be Lc and hence case 4 */ Change-Id: Ic8a17921f5a42d227791f1de39f90b4967c2e1b6 Related: SYS#6865 --- M src/sim/class_tables.c M tests/sim/sim_test.c M tests/sim/sim_test.ok 3 files changed, 33 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/19/37119/1 diff --git a/src/sim/class_tables.c b/src/sim/class_tables.c index 1cda9a8..3217446 100644 --- a/src/sim/class_tables.c +++ b/src/sim/class_tables.c @@ -178,6 +178,7 @@ { uint8_t ins = hdr[1]; uint8_t p1 = hdr[2]; + uint8_t p3 = hdr[4]; switch (ins) { case 0xE2: /* STORE DATA */ @@ -197,6 +198,16 @@ else return 2; /* ETSI TS 102 221 V16.2.0 11.1.2 */ break; + case 0xCA: + case 0xCB: + /* in their infinite wisdom, GlobalPlatform made GET DATA a command that can be either APDU + * case 2 or case 4. As the specify Le must be 0x00, we can conclude that P3 == 0x00 must be + * Le, while P3 != 0x00 must be Lc and hence case 4 */ + if (p3 == 0x00) + return 2; + else + return 4; + break; } return 0; } @@ -225,8 +236,8 @@ static const uint8_t gp_ins_tbl_8ce[256] = { [0xE4] = 4, /* DELETE */ [0xE2] = 0x80, /* STORE DATA */ - [0xCA] = 4, /* GET DATA */ - [0xCB] = 4, /* GET DATA */ + [0xCA] = 0x80, /* GET DATA */ + [0xCB] = 0x80, /* GET DATA */ [0xF2] = 0x80, /* GET STATUS */ [0xE6] = 4, /* INSTALL */ [0xE8] = 4, /* LOAD */ diff --git a/tests/sim/sim_test.c b/tests/sim/sim_test.c index 9a52af4..ab5d2be 100644 --- a/tests/sim/sim_test.c +++ b/tests/sim/sim_test.c @@ -29,6 +29,8 @@ const uint8_t uicc_upd[] = { 0x00, 0xD6, 0x00, 0x00, 0x02, 0x01, 0x02 }; const uint8_t uicc_get_status[] = { 0x80, 0xf2, 0x00, 0x02, 0x10 }; const uint8_t euicc_m2m_get_status[] = { 0x81, 0xf2, 0x40, 0x02, 0x02, 0x4f, 0x00 }; +const uint8_t gp_get_data2[] = { 0x81, 0xCA, 0x00, 0x5A, 0x00 }; +const uint8_t gp_get_data4[] = { 0x81, 0xCA, 0x00, 0x5A, 0x12 }; #define APDU_CASE_ASSERT(x, y) \ do { \ @@ -49,6 +51,8 @@ APDU_CASE_ASSERT(uicc_upd, 3); APDU_CASE_ASSERT(uicc_get_status, 2); APDU_CASE_ASSERT(euicc_m2m_get_status, 4); + APDU_CASE_ASSERT(gp_get_data2, 2); + APDU_CASE_ASSERT(gp_get_data4, 4); } int main(int argc, char **argv) diff --git a/tests/sim/sim_test.ok b/tests/sim/sim_test.ok index cac59ba..3abfb71 100644 --- a/tests/sim/sim_test.ok +++ b/tests/sim/sim_test.ok @@ -6,3 +6,5 @@ Testing uicc_upd Testing uicc_get_status Testing euicc_m2m_get_status +Testing gp_get_data2 +Testing gp_get_data4 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37119?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: rel-1.9.3 Gerrit-Change-Id: Ic8a17921f5a42d227791f1de39f90b4967c2e1b6 Gerrit-Change-Number: 37119 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[rel-1.9.1]: Bump version: 1.9.0.2-52e39 → 1.9.1
by fixeria 06 Jun '24

06 Jun '24
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/37116?usp=email ) Change subject: Bump version: 1.9.0.2-52e39 → 1.9.1 ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: We already do have v1.9.1 and event v1.9.2: https://cgit.osmocom.org/libosmocore/tag/?h=1.9.1 https://cgit.osmocom.org/libosmocore/tag/?h=1.9.2 so how can there be another v1.9.1? -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37116?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: rel-1.9.1 Gerrit-Change-Id: If7e1113af2393bb776e7fff60b89355fa02a016d Gerrit-Change-Number: 37116 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 06 Jun 2024 17:14:36 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: IMS: Validate Via port matches the ipsec port-c one
by pespin 06 Jun '24

06 Jun '24
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37117?usp=email ) Change subject: asterisk: IMS: Validate Via port matches the ipsec port-c one ...................................................................... asterisk: IMS: Validate Via port matches the ipsec port-c one Related: SYS#6964 Change-Id: I3f8b2112d40dd5f018abb8bc00b9e1be16586a9b --- M asterisk/IMS_ConnectionHandler.ttcn 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/17/37117/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37117?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I3f8b2112d40dd5f018abb8bc00b9e1be16586a9b Gerrit-Change-Number: 37117 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: asterisk: IMS: Validate Via port matches the ipsec spi-c one
by pespin 06 Jun '24

06 Jun '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37117?usp=email ) Change subject: asterisk: IMS: Validate Via port matches the ipsec spi-c one ...................................................................... asterisk: IMS: Validate Via port matches the ipsec spi-c one Related: SYS#6964 Change-Id: I3f8b2112d40dd5f018abb8bc00b9e1be16586a9b --- M asterisk/IMS_ConnectionHandler.ttcn 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/17/37117/1 diff --git a/asterisk/IMS_ConnectionHandler.ttcn b/asterisk/IMS_ConnectionHandler.ttcn index f10e2aa..c06df15 100644 --- a/asterisk/IMS_ConnectionHandler.ttcn +++ b/asterisk/IMS_ConnectionHandler.ttcn @@ -595,7 +595,7 @@ ?, tr_From(), tr_To(), - tr_Via_from(?), + tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.ipsec_remote_port_c)), authorization := authorization); SIP.receive(exp_req) -> value g_rx_sip_req; @@ -662,7 +662,7 @@ ?, tr_From(), tr_To(), - tr_Via_from(?), + tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.ipsec_remote_port_c)), expires := tr_Expires(int2str(0)), require := tr_Require(superset("sec-agree")), security_client := tr_Security_client(superset(tr_Security_mechanism("ipsec-3gpp", @@ -759,7 +759,7 @@ ?, tr_From(tr_Addr_Union_from_val(g_pars.subscr.cp.calling.addr), *), tr_To(tr_Addr_Union_from_val(g_pars.subscr.cp.called.addr), *), - tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.remote_sip_port)), + tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.ipsec_remote_port_c)), ?, ?); var charstring sip_expect_str := log2str(exp_req); @@ -815,7 +815,7 @@ g_pars.subscr.cp.sip_call_id, g_pars.subscr.cp.from_addr, g_pars.subscr.cp.to_addr, - tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.remote_sip_port)), + tr_Via_from(f_tr_HostPort(g_pars.subscr.remote_sip_host, g_pars.subscr.ipsec_remote_port_c)), exp_seq_nr); var charstring sip_expect_str := log2str(exp_req); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37117?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I3f8b2112d40dd5f018abb8bc00b9e1be16586a9b Gerrit-Change-Number: 37117 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[rel-1.9.1]: libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA
by laforge 06 Jun '24

06 Jun '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/37114?usp=email ) Change subject: libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA ...................................................................... libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA in their infinite wisdom, GlobalPlatform made GET DATA a command that can be either APDU case 2 or case 4. As the specify Le must be 0x00, we can conclude that P3 == 0x00 must be Le, while P3 != 0x00 must be Lc and hence case 4 */ Change-Id: Ic8a17921f5a42d227791f1de39f90b4967c2e1b6 Related: SYS#6865 --- M src/sim/class_tables.c M tests/sim/sim_test.c M tests/sim/sim_test.ok 3 files changed, 33 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/src/sim/class_tables.c b/src/sim/class_tables.c index 1cda9a8..3217446 100644 --- a/src/sim/class_tables.c +++ b/src/sim/class_tables.c @@ -178,6 +178,7 @@ { uint8_t ins = hdr[1]; uint8_t p1 = hdr[2]; + uint8_t p3 = hdr[4]; switch (ins) { case 0xE2: /* STORE DATA */ @@ -197,6 +198,16 @@ else return 2; /* ETSI TS 102 221 V16.2.0 11.1.2 */ break; + case 0xCA: + case 0xCB: + /* in their infinite wisdom, GlobalPlatform made GET DATA a command that can be either APDU + * case 2 or case 4. As the specify Le must be 0x00, we can conclude that P3 == 0x00 must be + * Le, while P3 != 0x00 must be Lc and hence case 4 */ + if (p3 == 0x00) + return 2; + else + return 4; + break; } return 0; } @@ -225,8 +236,8 @@ static const uint8_t gp_ins_tbl_8ce[256] = { [0xE4] = 4, /* DELETE */ [0xE2] = 0x80, /* STORE DATA */ - [0xCA] = 4, /* GET DATA */ - [0xCB] = 4, /* GET DATA */ + [0xCA] = 0x80, /* GET DATA */ + [0xCB] = 0x80, /* GET DATA */ [0xF2] = 0x80, /* GET STATUS */ [0xE6] = 4, /* INSTALL */ [0xE8] = 4, /* LOAD */ diff --git a/tests/sim/sim_test.c b/tests/sim/sim_test.c index 9a52af4..ab5d2be 100644 --- a/tests/sim/sim_test.c +++ b/tests/sim/sim_test.c @@ -29,6 +29,8 @@ const uint8_t uicc_upd[] = { 0x00, 0xD6, 0x00, 0x00, 0x02, 0x01, 0x02 }; const uint8_t uicc_get_status[] = { 0x80, 0xf2, 0x00, 0x02, 0x10 }; const uint8_t euicc_m2m_get_status[] = { 0x81, 0xf2, 0x40, 0x02, 0x02, 0x4f, 0x00 }; +const uint8_t gp_get_data2[] = { 0x81, 0xCA, 0x00, 0x5A, 0x00 }; +const uint8_t gp_get_data4[] = { 0x81, 0xCA, 0x00, 0x5A, 0x12 }; #define APDU_CASE_ASSERT(x, y) \ do { \ @@ -49,6 +51,8 @@ APDU_CASE_ASSERT(uicc_upd, 3); APDU_CASE_ASSERT(uicc_get_status, 2); APDU_CASE_ASSERT(euicc_m2m_get_status, 4); + APDU_CASE_ASSERT(gp_get_data2, 2); + APDU_CASE_ASSERT(gp_get_data4, 4); } int main(int argc, char **argv) diff --git a/tests/sim/sim_test.ok b/tests/sim/sim_test.ok index cac59ba..3abfb71 100644 --- a/tests/sim/sim_test.ok +++ b/tests/sim/sim_test.ok @@ -6,3 +6,5 @@ Testing uicc_upd Testing uicc_get_status Testing euicc_m2m_get_status +Testing gp_get_data2 +Testing gp_get_data4 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37114?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: rel-1.9.1 Gerrit-Change-Id: Ic8a17921f5a42d227791f1de39f90b4967c2e1b6 Gerrit-Change-Number: 37114 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmocore[rel-1.9.1]: libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions
by laforge 06 Jun '24

06 Jun '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/37113?usp=email ) Change subject: libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions ...................................................................... libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions In their infinite wisdom, GlobalPlatform re-defined the CLA 8x / INS F2 command alreay specified by ETSI TS 102 221. This wouldn't be as bads if they had the same "Case". However, ETSI has case 2 while GP has case 4. Lucikly, the P1 coding of ETSI [so far] states all the four upper bits must be 0, while GP always has one of those bits set. Before this patch, it is possible that a Modem/Phone will send an 8xF2 command and intends it as a GlobalPlatform command (with Lc > 0 and command data portion), while this code assumes it is an ETSI UICC command with Lc=0 and hence no command data portion. This will make communication break when using simtrace2 'cardem'. Change-Id: I8dd317ef8f942542e412b18c834a0467c51291c3 Related: SYS#6865 Related: https://lists.osmocom.org/hyperkitty/list/simtrace@lists.osmocom.org/thread… --- M src/sim/class_tables.c M tests/sim/sim_test.c M tests/sim/sim_test.ok 3 files changed, 53 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/src/sim/class_tables.c b/src/sim/class_tables.c index 9c51387..1cda9a8 100644 --- a/src/sim/class_tables.c +++ b/src/sim/class_tables.c @@ -187,6 +187,16 @@ default: return 3; } + break; + case 0xF2: + /* in their infinite wisdom, GlobalPlatform re-defined the CLA 8x / INS F2 command, so one can + * take a guess if it's GlobalPlatform or ETSI. Lucikly, the P1 coding of ETSI [so far] + * states all the four upper bits must be 0, while GP always has one of those bits set */ + if (p1 & 0xF0) + return 4; /* GlobalPlatform v2.2 11.4.2 */ + else + return 2; /* ETSI TS 102 221 V16.2.0 11.1.2 */ + break; } return 0; } @@ -217,7 +227,7 @@ [0xE2] = 0x80, /* STORE DATA */ [0xCA] = 4, /* GET DATA */ [0xCB] = 4, /* GET DATA */ - [0xF2] = 4, /* GET STATUS */ + [0xF2] = 0x80, /* GET STATUS */ [0xE6] = 4, /* INSTALL */ [0xE8] = 4, /* LOAD */ [0xD8] = 4, /* PUT KEY */ @@ -245,6 +255,12 @@ .helper = uicc046_cla_ins_helper, .ins_tbl = uicc_ins_tbl_046, }, { + /* must be before uicc_ins_tbl_8ce below with same CLA+mask */ + .cla = 0x80, + .cla_mask = 0xF0, + .helper = gp_cla_ins_helper, + .ins_tbl = gp_ins_tbl_8ce, + }, { .cla = 0x80, .cla_mask = 0xF0, .ins_tbl = uicc_ins_tbl_8ce, @@ -257,11 +273,6 @@ .cla_mask = 0xF0, .ins_tbl = uicc_ins_tbl_8ce, }, { - .cla = 0x80, - .cla_mask = 0xF0, - .helper = gp_cla_ins_helper, - .ins_tbl = gp_ins_tbl_8ce, - }, { .cla = 0xC0, .cla_mask = 0xF0, .helper = gp_cla_ins_helper, @@ -307,6 +318,12 @@ .helper = uicc046_cla_ins_helper, .ins_tbl = uicc_ins_tbl_046, }, { + /* must be before uicc_ins_tbl_8ce below with same CLA+mask */ + .cla = 0x80, + .cla_mask = 0xF0, + .helper = gp_cla_ins_helper, + .ins_tbl = gp_ins_tbl_8ce, + }, { .cla = 0x80, .cla_mask = 0xF0, .ins_tbl = uicc_ins_tbl_8ce, diff --git a/tests/sim/sim_test.c b/tests/sim/sim_test.c index 2e2eec5..9a52af4 100644 --- a/tests/sim/sim_test.c +++ b/tests/sim/sim_test.c @@ -27,6 +27,8 @@ const uint8_t uicc_tprof_wrong_class[] = { 0x00, 0x10, 0x00, 0x00, 0x02, 0x01, 0x02 }; const uint8_t uicc_read[] = { 0x00, 0xB0, 0x00, 0x00, 0x10 }; const uint8_t uicc_upd[] = { 0x00, 0xD6, 0x00, 0x00, 0x02, 0x01, 0x02 }; +const uint8_t uicc_get_status[] = { 0x80, 0xf2, 0x00, 0x02, 0x10 }; +const uint8_t euicc_m2m_get_status[] = { 0x81, 0xf2, 0x40, 0x02, 0x02, 0x4f, 0x00 }; #define APDU_CASE_ASSERT(x, y) \ do { \ @@ -45,6 +47,8 @@ APDU_CASE_ASSERT(uicc_tprof_wrong_class, 0); APDU_CASE_ASSERT(uicc_read, 2); APDU_CASE_ASSERT(uicc_upd, 3); + APDU_CASE_ASSERT(uicc_get_status, 2); + APDU_CASE_ASSERT(euicc_m2m_get_status, 4); } int main(int argc, char **argv) diff --git a/tests/sim/sim_test.ok b/tests/sim/sim_test.ok index 7d3f986..cac59ba 100644 --- a/tests/sim/sim_test.ok +++ b/tests/sim/sim_test.ok @@ -4,3 +4,5 @@ Testing uicc_tprof_wrong_class Testing uicc_read Testing uicc_upd +Testing uicc_get_status +Testing euicc_m2m_get_status -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37113?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: rel-1.9.1 Gerrit-Change-Id: I8dd317ef8f942542e412b18c834a0467c51291c3 Gerrit-Change-Number: 37113 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[rel-1.9.1]: Bump version: 1.9.0.2-52e39 → 1.9.1
by laforge 06 Jun '24

06 Jun '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/37116?usp=email ) Change subject: Bump version: 1.9.0.2-52e39 → 1.9.1 ...................................................................... Bump version: 1.9.0.2-52e39 → 1.9.1 Change-Id: If7e1113af2393bb776e7fff60b89355fa02a016d --- M debian/changelog M src/sim/Makefile.am 2 files changed, 17 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/debian/changelog b/debian/changelog index c9184df..7256e69 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libosmocore (1.9.1) unstable; urgency=medium + + * libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions + * libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA + + -- Harald Welte <laforge(a)osmocom.org> Thu, 06 Jun 2024 18:36:01 +0200 + libosmocore (1.9.0) unstable; urgency=medium [ Oliver Smith ] diff --git a/src/sim/Makefile.am b/src/sim/Makefile.am index 0f6be57..01c5175 100644 --- a/src/sim/Makefile.am +++ b/src/sim/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=3:2:1 +LIBVERSION=3:3:1 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -fPIC -Wall $(TALLOC_CFLAGS) -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37116?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: rel-1.9.1 Gerrit-Change-Id: If7e1113af2393bb776e7fff60b89355fa02a016d Gerrit-Change-Number: 37116 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[rel-1.9.1]: Bump version: 1.9.0.2-52e39 → 1.9.1
by pespin 06 Jun '24

06 Jun '24
Attention is currently required from: laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/37116?usp=email ) Change subject: Bump version: 1.9.0.2-52e39 → 1.9.1 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37116?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: rel-1.9.1 Gerrit-Change-Id: If7e1113af2393bb776e7fff60b89355fa02a016d Gerrit-Change-Number: 37116 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Thu, 06 Jun 2024 16:38:50 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • ...
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.