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 -----
  • 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

January 2024

  • 1 participants
  • 1559 discussions
[S] Change in pysim[master]: ts_102_221: Better explain 'selected file invalidated'
by laforge 16 Jan '24

16 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35565?usp=email ) Change subject: ts_102_221: Better explain 'selected file invalidated' ...................................................................... ts_102_221: Better explain 'selected file invalidated' Some specs call it 'invalidated', others call it 'deactivated'. If the user is unfamiliar with this, the error message about "invalidated" might not be obvious enough; let's also mention 'deactivated' in the message and explicitly mention that it needs to be activated before use. Change-Id: I91488b0e7dc25a8970022b09e575485a4165eefa --- M docs/shell.rst M pySim-shell.py M pySim/ts_102_221.py 3 files changed, 37 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/docs/shell.rst b/docs/shell.rst index 4742b8e..7022b5a 100644 --- a/docs/shell.rst +++ b/docs/shell.rst @@ -400,7 +400,19 @@ deactivate_file ~~~~~~~~~~~~~~~ -Deactivate the currently selected file. This used to be called INVALIDATE in TS 11.11. +Deactivate the currently selected file. A deactivated file can no longer be accessed +for any further operation (such as selecting and subsequently reading or writing). + +Any access to a file that is deactivated will trigger the error +*SW 6283 'Selected file invalidated/disabled'* + +In order to re-access a deactivated file, you need to activate it again, see the +`activate_file` command below. Note that for *deactivation* the to-be-deactivated +EF must be selected, but for *activation*, the DF above the to-be-activated +EF must be selected! + +This command sends a DEACTIVATE FILE APDU to +the card (used to be called INVALIDATE in TS 11.11 for classic SIM). activate_file diff --git a/pySim-shell.py b/pySim-shell.py index 6ff484b..c645403 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -882,8 +882,15 @@ activate_file_parser.add_argument('NAME', type=str, help='File name or FID of file to activate') @cmd2.with_argparser(activate_file_parser) def do_activate_file(self, opts): - """Activate the specified EF. This used to be called REHABILITATE in TS 11.11 for classic - SIM. You need to specify the name or FID of the file to activate.""" + """Activate the specified EF by sending an ACTIVATE FILE apdu command (used to be called REHABILITATE +in TS 11.11 for classic SIM). + +This command is used to (re-)activate a file that is currently in deactivated (sometimes also called +"invalidated") state. You need to call this from the DF above the to-be-activated EF and specify the name or +FID of the file to activate. + +Note that for *deactivation* the to-be-deactivated EF must be selected, but for *activation*, the DF +above the to-be-activated EF must be selected!""" (data, sw) = self._cmd.lchan.activate_file(opts.NAME) def complete_activate_file(self, text, line, begidx, endidx) -> List[str]: diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py index 308fc4a..65dd87d 100644 --- a/pySim/ts_102_221.py +++ b/pySim/ts_102_221.py @@ -808,7 +808,7 @@ '6200': 'No information given, state of non-volatile memory unchanged', '6281': 'Part of returned data may be corrupted', '6282': 'End of file/record reached before reading Le bytes or unsuccessful search', - '6283': 'Selected file invalidated', + '6283': 'Selected file invalidated/disabled; needs to be activated before use', '6284': 'Selected file in termination state', '62f1': 'More data available', '62f2': 'More data available and proactive command pending', -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35565?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: I91488b0e7dc25a8970022b09e575485a4165eefa Gerrit-Change-Number: 35565 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: merged
1 0
0 0
[M] Change in pysim[master]: euicc: Implement EID checksum verification + computation
by laforge 16 Jan '24

16 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35569?usp=email ) Change subject: euicc: Implement EID checksum verification + computation ...................................................................... euicc: Implement EID checksum verification + computation Change-Id: I2cb342783137ee7e4b1be3b14e9c3747316f1995 --- M pySim/euicc.py A tests/test_euicc.py 2 files changed, 70 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/pySim/euicc.py b/pySim/euicc.py index 96d95d6..e249f4f 100644 --- a/pySim/euicc.py +++ b/pySim/euicc.py @@ -32,6 +32,36 @@ from pySim.utils import Hexstr, SwHexstr import pySim.global_platform +def compute_eid_checksum(eid) -> str: + """Compute and add/replace check digits of an EID value according to GSMA SGP.29 Section 10.""" + if type(eid) == str: + if len(eid) == 30: + # first pad by 2 digits + eid += "00" + elif len(eid) == 32: + # zero the last two digits + eid = eid[:-2] + "00" + else: + raise ValueError("and EID must be 30 or 32 digits") + eid_int = int(eid) + elif type(eid) == int: + eid_int = eid + if eid_int % 100: + # zero the last two digits + eid_int -= eid_int % 100 + # Using the resulting 32 digits as a decimal integer, compute the remainder of that number on division by + # 97, Subtract the remainder from 98, and use the decimal result for the two check digits, if the result + # is one digit long, its value SHALL be prefixed by one digit of 0. + csum = 98 - (eid_int % 97) + eid_int += csum + return str(eid_int) + +def verify_eid_checksum(eid) -> bool: + """Verify the check digits of an EID value according to GSMA SGP.29 Section 10.""" + # Using the 32 digits as a decimal integer, compute the remainder of that number on division by 97. If the + # remainder of the division is 1, the verification is successful; otherwise the EID is invalid. + return int(eid) % 97 == 1 + class VersionAdapter(Adapter): """convert an EUICC Version (3-int array) to a textual representation.""" diff --git a/tests/test_euicc.py b/tests/test_euicc.py new file mode 100755 index 0000000..05d71ed --- /dev/null +++ b/tests/test_euicc.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +import unittest + +from pySim.euicc import * + +class TestEid(unittest.TestCase): + + def test_eid_verify(self): + for eid in ['89049032123451234512345678901235', '89086030202200000022000023022943', + '89044045116727494800000004479366', 89044045116727494800000004479366]: + self.assertTrue(verify_eid_checksum(eid)) + + def test_eid_verify_wrong(self): + self.assertFalse(verify_eid_checksum('89049032123451234512345678901234')) + self.assertFalse(verify_eid_checksum(89049032123451234512345678901234)) + + def test_eid_encode_with_32_digits(self): + self.assertEquals(compute_eid_checksum('89049032123451234512345678901200'), '89049032123451234512345678901235') + self.assertEquals(compute_eid_checksum('89086030202200000022000023022900'), '89086030202200000022000023022943') + + def test_eid_encode_with_30digits(self): + self.assertEquals(compute_eid_checksum('890490321234512345123456789012'), '89049032123451234512345678901235') + + def test_eid_encode_with_wrong_csum(self): + # input: EID with wrong checksum + self.assertEquals(compute_eid_checksum('89049032123451234512345678901299'), '89049032123451234512345678901235') + self.assertEquals(compute_eid_checksum(89049032123451234512345678901299), '89049032123451234512345678901235') + +if __name__ == "__main__": + unittest.main() -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35569?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: I2cb342783137ee7e4b1be3b14e9c3747316f1995 Gerrit-Change-Number: 35569 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[M] Change in pysim[master]: euicc: Implement EID checksum verification + computation
by laforge 16 Jan '24

16 Jan '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35569?usp=email ) Change subject: euicc: Implement EID checksum verification + computation ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35569?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: I2cb342783137ee7e4b1be3b14e9c3747316f1995 Gerrit-Change-Number: 35569 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 16 Jan 2024 18:17:37 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: ts_102_221: Better explain 'selected file invalidated'
by laforge 16 Jan '24

16 Jan '24
Attention is currently required from: jolly. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35565?usp=email ) Change subject: ts_102_221: Better explain 'selected file invalidated' ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35565?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: I91488b0e7dc25a8970022b09e575485a4165eefa Gerrit-Change-Number: 35565 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: jolly <andreas(a)eversberg.eu> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Tue, 16 Jan 2024 18:17:30 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bsc[master]: vty: show mscs: tweak output
by laforge 16 Jan '24

16 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/35596?usp=email ) Change subject: vty: show mscs: tweak output ...................................................................... vty: show mscs: tweak output Make the output more readable and split it over two lines, in preparation to add more information in the next patch. Before: OsmoBSC> show mscs 0 m3ua RI=SSN_PC,PC=0.23.3,SSN=BSSAP RI=SSN_PC,PC=0.23.1,SSN=BSSAP After: OsmoBSC> show mscs MSC 0: RI=SSN_PC,PC=0.23.3,SSN=BSSAP <-> RI=SSN_PC,PC=0.23.1,SSN=BSSAP ASP protocol: m3ua Related: OS#6741 Change-Id: I70ad1b0f44f2a923248f4e3259747cb3fec98fd2 --- M src/osmo-bsc/bsc_vty.c 1 file changed, 28 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 925f21f..27ceae4 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -3250,13 +3250,15 @@ { struct bsc_msc_data *msc; llist_for_each_entry(msc, &bsc_gsmnet->mscs, entry) { - vty_out(vty, "%d %s %s ", + vty_out(vty, "MSC %d: %s <-> ", msc->a.cs7_instance, - osmo_ss7_asp_protocol_name(msc->a.asp_proto), osmo_sccp_inst_addr_name(msc->a.sccp, &msc->a.bsc_addr)); vty_out(vty, "%s%s", osmo_sccp_inst_addr_name(msc->a.sccp, &msc->a.msc_addr), VTY_NEWLINE); + vty_out(vty, " ASP protocol: %s%s", + osmo_ss7_asp_protocol_name(msc->a.asp_proto), + VTY_NEWLINE); } return CMD_SUCCESS; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/35596?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I70ad1b0f44f2a923248f4e3259747cb3fec98fd2 Gerrit-Change-Number: 35596 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-bsc[master]: vty: show mscs: add BSSMAP state
by laforge 16 Jan '24

16 Jan '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/35597?usp=email ) Change subject: vty: show mscs: add BSSMAP state ...................................................................... vty: show mscs: add BSSMAP state New output: OsmoBSC> show mscs MSC 0: RI=SSN_PC,PC=0.23.3,SSN=BSSAP <-> RI=SSN_PC,PC=0.23.1,SSN=BSSAP ASP protocol: m3ua BSSMAP state: CONNECTED Closes: OS#6741 Change-Id: I23ddba7d935e5cc5dae041458207c674ccb9d013 --- M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bssmap_reset.c 2 files changed, 22 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 27ceae4..8a0747c 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -3259,6 +3259,10 @@ vty_out(vty, " ASP protocol: %s%s", osmo_ss7_asp_protocol_name(msc->a.asp_proto), VTY_NEWLINE); + vty_out(vty, " BSSMAP state: %s%s", + msc->a.bssmap_reset ? osmo_fsm_inst_state_name(msc->a.bssmap_reset->fi) : "", + VTY_NEWLINE); + } return CMD_SUCCESS; diff --git a/src/osmo-bsc/bssmap_reset.c b/src/osmo-bsc/bssmap_reset.c index ac304a5..018ecba 100644 --- a/src/osmo-bsc/bssmap_reset.c +++ b/src/osmo-bsc/bssmap_reset.c @@ -198,7 +198,7 @@ static struct osmo_fsm_state bssmap_reset_fsm_states[] = { [BSSMAP_RESET_ST_DISC] = { - .name = "DISC", + .name = "DISCONNECTED", .in_event_mask = 0 | S(BSSMAP_RESET_EV_RX_RESET) | S(BSSMAP_RESET_EV_RX_RESET_ACK) @@ -213,7 +213,7 @@ .action = bssmap_reset_disc_action, }, [BSSMAP_RESET_ST_CONN] = { - .name = "CONN", + .name = "CONNECTED", .in_event_mask = 0 | S(BSSMAP_RESET_EV_RX_RESET) | S(BSSMAP_RESET_EV_RX_RESET_ACK) -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/35597?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I23ddba7d935e5cc5dae041458207c674ccb9d013 Gerrit-Change-Number: 35597 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-bsc[master]: vty: show mscs: tweak output
by laforge 16 Jan '24

16 Jan '24
Attention is currently required from: osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/35596?usp=email ) Change subject: vty: show mscs: tweak output ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/35596?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I70ad1b0f44f2a923248f4e3259747cb3fec98fd2 Gerrit-Change-Number: 35596 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 16 Jan 2024 18:16:57 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bsc[master]: vty: show mscs: add BSSMAP state
by laforge 16 Jan '24

16 Jan '24
Attention is currently required from: osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/35597?usp=email ) Change subject: vty: show mscs: add BSSMAP state ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/35597?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I23ddba7d935e5cc5dae041458207c674ccb9d013 Gerrit-Change-Number: 35597 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 16 Jan 2024 18:16:47 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: pySim-shell: Permit 'reset' command also in unqeuipped stage
by laforge 16 Jan '24

16 Jan '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35595?usp=email ) Change subject: pySim-shell: Permit 'reset' command also in unqeuipped stage ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35595?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: I23199da727973d7095ac18031f49e1e8423aa287 Gerrit-Change-Number: 35595 Gerrit-PatchSet: 3 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 16 Jan 2024 18:05:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: ts_102_221: Better explain 'selected file invalidated'
by laforge 16 Jan '24

16 Jan '24
Attention is currently required from: jolly. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35565?usp=email ) Change subject: ts_102_221: Better explain 'selected file invalidated' ...................................................................... Patch Set 2: (2 comments) Commit Message: https://gerrit.osmocom.org/c/pysim/+/35565/comment/cd9d89a4_e8f689dc PS1, Line 9: Some specs call it 'invalidated', others call it 'deactivaed'. If the > deactivated Done File docs/shell.rst: https://gerrit.osmocom.org/c/pysim/+/35565/comment/9ec7a6bc_e47b5153 PS1, Line 415: sed > used? Done -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35565?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: I91488b0e7dc25a8970022b09e575485a4165eefa Gerrit-Change-Number: 35565 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: jolly <andreas(a)eversberg.eu> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Tue, 16 Jan 2024 18:05:06 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • ...
  • 156
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.