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

February 2024

  • 1 participants
  • 1748 discussions
[S] Change in pysim[master]: SCP02: Only C-MAC/C-ENCRYPT APDUs whose CLA byte indicates GlobalPlat...
by laforge 01 Feb '24

01 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35769?usp=email ) Change subject: SCP02: Only C-MAC/C-ENCRYPT APDUs whose CLA byte indicates GlobalPlatform ...................................................................... SCP02: Only C-MAC/C-ENCRYPT APDUs whose CLA byte indicates GlobalPlatform I'm not entirely sure if this is the right thing to do. For sure I do have cards which don't like SELECT with C-MAC appended... and GlobalPlatform clearly states SELECT is coded with CLA value that has the MSB not set (i.e. not a GlobalPlatform command). Change-Id: Ieda75c865a6ff2725fc3c8772bb274d96b8a5a43 --- M pySim/global_platform/scp02.py 1 file changed, 28 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/35769/1 diff --git a/pySim/global_platform/scp02.py b/pySim/global_platform/scp02.py index a7325e1..4df0aff 100644 --- a/pySim/global_platform/scp02.py +++ b/pySim/global_platform/scp02.py @@ -94,14 +94,6 @@ CLA_SM = 0x04 class SCP(SecureChannel): - pass - -class SCP02(SCP): - """An instance of the GlobalPlatform SCP02 secure channel protocol.""" - - constr_iur = Struct('key_div_data'/Bytes(10), 'key_ver'/Int8ub, Const(b'\x02'), - 'seq_counter'/Int16ub, 'card_challenge'/Bytes(6), 'card_cryptogram'/Bytes(8)) - def __init__(self, card_keys: 'GpCardKeyset', lchan_nr: int = 0): self.lchan_nr = lchan_nr self.card_keys = card_keys @@ -121,6 +113,19 @@ ret = ret | CLA_SM return ret + self.lchan_nr + def wrap_cmd_apdu(self, apdu: bytes) -> bytes: + # only protect those APDUs that actually are global platform commands + if apdu[0] & 0x80: + return self._wrap_cmd_apdu(apdu) + else: + return apdu + +class SCP02(SCP): + """An instance of the GlobalPlatform SCP02 secure channel protocol.""" + + constr_iur = Struct('key_div_data'/Bytes(10), 'key_ver'/Int8ub, Const(b'\x02'), + 'seq_counter'/Int16ub, 'card_challenge'/Bytes(6), 'card_cryptogram'/Bytes(8)) + def _compute_cryptograms(self, card_challenge: bytes, host_challenge: bytes): logger.debug("host_challenge(%s), card_challenge(%s)", b2h(host_challenge), b2h(card_challenge)) self.host_cryptogram = self.sk.calc_mac_3des(self.sk.counter.to_bytes(2, 'big') + card_challenge + host_challenge) @@ -168,7 +173,7 @@ mac = self.sk.calc_mac_1des(header + self.host_cryptogram, True) return bytes([self._cla(True), INS_EXT_AUTH, self.security_level, 0, 16]) + self.host_cryptogram + mac - def wrap_cmd_apdu(self, apdu: bytes) -> bytes: + def _wrap_cmd_apdu(self, apdu: bytes) -> bytes: """Wrap Command APDU for SCP02: calculate MAC and encrypt.""" lc = len(apdu) - 5 assert len(apdu) >= 5, "Wrong APDU length: %d" % len(apdu) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35769?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ieda75c865a6ff2725fc3c8772bb274d96b8a5a43 Gerrit-Change-Number: 35769 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: global_platform: Add install_for_personalization command
by laforge 01 Feb '24

01 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35771?usp=email ) Change subject: global_platform: Add install_for_personalization command ...................................................................... global_platform: Add install_for_personalization command This allows us to perform STORE DATA on applications like ARA-M/ARA-D after establishing SCP02 to the related security domain. Change-Id: I2ce766b97bba42c64c4d4492b505be66c24f471e --- M docs/shell.rst M pySim/global_platform/__init__.py 2 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/71/35771/1 diff --git a/docs/shell.rst b/docs/shell.rst index dff6cd1..96b04a7 100644 --- a/docs/shell.rst +++ b/docs/shell.rst @@ -959,6 +959,12 @@ :module: pySim.global_platform :func: ADF_SD.AddlShellCommands.put_key_parser +install_for_personalization +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. argparse:: + :module: pySim.global_platform + :func: ADF_SD.AddlShellCommands.inst_for_perso_parser + establish_scp02 ~~~~~~~~~~~~~~~ .. argparse:: diff --git a/pySim/global_platform/__init__.py b/pySim/global_platform/__init__.py index 44a24df..25b58d9 100644 --- a/pySim/global_platform/__init__.py +++ b/pySim/global_platform/__init__.py @@ -598,6 +598,21 @@ est_scp02_parser.add_argument('--security-level', type=auto_int, default=0x01, help='Security Level. Default: 0x01 (C-MAC only)') + inst_perso_parser = argparse.ArgumentParser() + inst_perso_parser.add_argument('application-aid', type=is_hexstr, help='Application AID') + + @cmd2.with_argparser(inst_perso_parser) + def do_install_for_personalization(self, opts): + """Perform GlobalPlatform INSTALL [for personalization] command in order toinform a Security + Domain that the following STORE DATA commands are meant for a specific AID (specified here).""" + # Section 11.5.2.3.6 / Table 11-47 + self.install(0x20, 0x00, "0000%02u%s000000" % (len(opts.application_aid)//2, opts.application_aid)) + + def install(self, p1:int, p2:int, data:Hexstr) -> ResTuple: + cmd_hex = "80E6%02x%02x%02x%s" % (p1, p2, len(data)//2, data) + return self._cmd.lchan.scc.send_apdu_checksw(cmd_hex) + + @cmd2.with_argparser(est_scp02_parser) def do_establish_scp02(self, opts): """Establish a secure channel using the GlobalPlatform SCP02 protocol.""" -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35771?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2ce766b97bba42c64c4d4492b505be66c24f471e Gerrit-Change-Number: 35771 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon/l1gprs: print dropped prims in l1sched_reset_lchan()
by fixeria 01 Feb '24

01 Feb '24
Attention is currently required from: pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35766?usp=email ) Change subject: trxcon/l1gprs: print dropped prims in l1sched_reset_lchan() ...................................................................... Patch Set 2: (1 comment) File src/host/trxcon/src/sched_trx.c: https://gerrit.osmocom.org/c/osmocom-bb/+/35766/comment/c151ff2c_e35897bd PS1, Line 531: LOGP_LCHANC(lchan, LOGL_NOTICE, "Dropping Tx prim (fn=%u): %s\n", > Some reference to "Reset lchan" here may be useful to understand the tragedy :) Done (`__func__`). -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35766?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa11b5cee16dc43ef01c38be756864c2b3b57835 Gerrit-Change-Number: 35766 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 01 Feb 2024 17:48:34 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: [HACK] trxcon/l1sched: warn about incomplete UL PDTCH transmissions
by Jenkins Builder 01 Feb '24

01 Feb '24
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35768?usp=email ) Change subject: [HACK] trxcon/l1sched: warn about incomplete UL PDTCH transmissions ...................................................................... Patch Set 1: (1 comment) File src/host/trxcon/src/sched_trx.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13977): https://gerrit.osmocom.org/c/osmocom-bb/+/35768/comment/24da1436_54105de5 PS1, Line 516: #if 1 Consider removing the #if 1 and its #endif -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35768?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Id485c919ca87a9edfb8bc974d73fb88638bfc510 Gerrit-Change-Number: 35768 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 01 Feb 2024 17:37:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: [HACK] trxcon/l1sched: warn about incomplete UL PDTCH transmissions
by fixeria 01 Feb '24

01 Feb '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35768?usp=email ) Change subject: [HACK] trxcon/l1sched: warn about incomplete UL PDTCH transmissions ...................................................................... [HACK] trxcon/l1sched: warn about incomplete UL PDTCH transmissions Change-Id: Id485c919ca87a9edfb8bc974d73fb88638bfc510 --- M src/host/trxcon/src/sched_trx.c 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/68/35768/1 diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c index f412400..bb6fbd8 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -513,6 +513,18 @@ lchan->tdma.last_proc); } +#if 1 + /* XXX: GPRS specific logic in generic code path */ + if (lchan->type == L1SCHED_PDTCH) { + uint32_t mask = lchan->tx_burst_mask & 0x0f; + if (mask != 0x00 && mask != 0x0f) { + LOGP_LCHANC(lchan, LOGL_ERROR, + "%s(): current Tx prim not fully transmitted\n", + __func__); + } + } +#endif + /* Reset internal state variables */ lchan->rx_burst_mask = 0x00; lchan->tx_burst_mask = 0x00; -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35768?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Id485c919ca87a9edfb8bc974d73fb88638bfc510 Gerrit-Change-Number: 35768 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon/l1gprs: print dropped prims in l1sched_reset_lchan()
by fixeria 01 Feb '24

01 Feb '24
Attention is currently required from: fixeria. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmocom-bb/+/35766?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: trxcon/l1gprs: print dropped prims in l1sched_reset_lchan() ...................................................................... trxcon/l1gprs: print dropped prims in l1sched_reset_lchan() Change-Id: Iaa11b5cee16dc43ef01c38be756864c2b3b57835 --- M src/host/trxcon/src/sched_trx.c 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/66/35766/2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35766?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa11b5cee16dc43ef01c38be756864c2b3b57835 Gerrit-Change-Number: 35766 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon/l1gprs: print dropped prims in l1sched_reset_lchan()
by pespin 01 Feb '24

01 Feb '24
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35766?usp=email ) Change subject: trxcon/l1gprs: print dropped prims in l1sched_reset_lchan() ...................................................................... Patch Set 1: (1 comment) File src/host/trxcon/src/sched_trx.c: https://gerrit.osmocom.org/c/osmocom-bb/+/35766/comment/b8e7d80c_374c41be PS1, Line 531: LOGP_LCHANC(lchan, LOGL_NOTICE, "Dropping Tx prim (fn=%u): %s\n", Some reference to "Reset lchan" here may be useful to understand the tragedy :) -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35766?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa11b5cee16dc43ef01c38be756864c2b3b57835 Gerrit-Change-Number: 35766 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 01 Feb 2024 17:04:19 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon/l1gprs: print dropped prims in l1sched_reset_lchan()
by fixeria 01 Feb '24

01 Feb '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35766?usp=email ) Change subject: trxcon/l1gprs: print dropped prims in l1sched_reset_lchan() ...................................................................... trxcon/l1gprs: print dropped prims in l1sched_reset_lchan() Change-Id: Iaa11b5cee16dc43ef01c38be756864c2b3b57835 --- M src/host/trxcon/src/sched_trx.c 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/66/35766/1 diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c index d07a579..82db4cb 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -525,8 +525,13 @@ lchan->tx_bursts = NULL; /* Flush the queue of pending Tx prims */ - while ((msg = msgb_dequeue(&lchan->tx_prims)) != NULL) + while ((msg = msgb_dequeue(&lchan->tx_prims)) != NULL) { + const struct l1sched_prim *prim = l1sched_prim_from_msgb(msg); + + LOGP_LCHANC(lchan, LOGL_NOTICE, "Dropping Tx prim (fn=%u): %s\n", + prim->prim->data_req.frame_nr, msgb_hexdump_l2(msg)); msgb_free(msg); + } /* Channel specific stuff */ if (L1SCHED_CHAN_IS_TCH(lchan->type)) { -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35766?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa11b5cee16dc43ef01c38be756864c2b3b57835 Gerrit-Change-Number: 35766 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon/l1gprs: print msgb hexdump in prim_dequeue_pdtch()
by fixeria 01 Feb '24

01 Feb '24
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35767?usp=email ) Change subject: trxcon/l1gprs: print msgb hexdump in prim_dequeue_pdtch() ...................................................................... trxcon/l1gprs: print msgb hexdump in prim_dequeue_pdtch() Change-Id: I1f82d53a46017c805c70b9dcccad058048549220 --- M src/host/trxcon/src/sched_lchan_pdtch.c 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/67/35767/1 diff --git a/src/host/trxcon/src/sched_lchan_pdtch.c b/src/host/trxcon/src/sched_lchan_pdtch.c index 915b060..4c49504 100644 --- a/src/host/trxcon/src/sched_lchan_pdtch.c +++ b/src/host/trxcon/src/sched_lchan_pdtch.c @@ -118,8 +118,8 @@ } /* else: the ship has sailed, drop your ticket */ LOGP_LCHAND(lchan, LOGL_ERROR, - "%s(): dropping stale Tx primitive (current Fn=%u, prim Fn=%u)\n", - __func__, fn, prim->data_req.frame_nr); + "%s(): dropping stale Tx prim (current Fn=%u, prim Fn=%u): %s\n", + __func__, fn, prim->data_req.frame_nr, msgb_hexdump_l2(msg)); llist_del(&msg->list); msgb_free(msg); } -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35767?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I1f82d53a46017c805c70b9dcccad058048549220 Gerrit-Change-Number: 35767 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-gprs[master]: cosmetic: tbf_ul_fsm: add missing state to tdef_state_timeout array
by pespin 01 Feb '24

01 Feb '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/35765?usp=email ) Change subject: cosmetic: tbf_ul_fsm: add missing state to tdef_state_timeout array ...................................................................... cosmetic: tbf_ul_fsm: add missing state to tdef_state_timeout array Change-Id: I6e825a105de4a49329912db6c79aaebbfd3ddf9f --- M src/rlcmac/tbf_ul_fsm.c 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/65/35765/1 diff --git a/src/rlcmac/tbf_ul_fsm.c b/src/rlcmac/tbf_ul_fsm.c index 43cb02f..0949ca6 100644 --- a/src/rlcmac/tbf_ul_fsm.c +++ b/src/rlcmac/tbf_ul_fsm.c @@ -46,6 +46,7 @@ [GPRS_RLCMAC_TBF_UL_ST_WAIT_ASSIGN] = { }, [GPRS_RLCMAC_TBF_UL_ST_FLOW] = { .T = 3164 }, [GPRS_RLCMAC_TBF_UL_ST_FINISHED] = { .keep_timer = true }, /* keep FLOW state's T3164 / T3166 */ + [GPRS_RLCMAC_TBF_UL_ST_RELEASING] = { }, }; /* Transition to a state, using the T timer defined in tbf_fsm_timeouts. -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/35765?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: I6e825a105de4a49329912db6c79aaebbfd3ddf9f Gerrit-Change-Number: 35765 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.