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

August 2024

  • 1 participants
  • 1478 discussions
[XS] Change in pysim[master]: saip-tool: Set default log level to INFO (instead of DEBUG)
by laforge 16 Aug '24

16 Aug '24
laforge has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/37833?usp=email ) Change subject: saip-tool: Set default log level to INFO (instead of DEBUG) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37833?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I54ae558cf8d87bf64cc75431cc4edcc694fa9084 Gerrit-Change-Number: 37833 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Fri, 16 Aug 2024 16:51:59 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in pysim[master]: pySim.filesystem: Permit Path object construction from FID integer list
by laforge 16 Aug '24

16 Aug '24
laforge has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/37832?usp=email ) Change subject: pySim.filesystem: Permit Path object construction from FID integer list ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37832?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ia7e9375b3258d1fbfdc892cefba3e3bbe841c550 Gerrit-Change-Number: 37832 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Fri, 16 Aug 2024 16:51:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in pysim[master]: pySim.esim.saip.oid: Allow OID instance in prefix_match()
by laforge 16 Aug '24

16 Aug '24
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/37834?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: pySim.esim.saip.oid: Allow OID instance in prefix_match() ...................................................................... pySim.esim.saip.oid: Allow OID instance in prefix_match() So far the prefix_match() required a string argument; let's also permit another OID object to be passed; we internally convert that to string. Change-Id: I0feb7782d1813cc46ec78f170eb0fce804aebe3a --- M pySim/esim/saip/oid.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/34/37834/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37834?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0feb7782d1813cc46ec78f170eb0fce804aebe3a Gerrit-Change-Number: 37834 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in pysim[master]: ara_m: use class byte of current lchan
by dexter 16 Aug '24

16 Aug '24
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37840?usp=email ) Change subject: ara_m: use class byte of current lchan ...................................................................... ara_m: use class byte of current lchan The ara_m commands use APDUs with a fix class byte (0x80). This means that all ARA-M related features only work in the basic logical channel. To fix this, let's compute the class byte for the current logical channel dynamically. Related: OS#6531 Change-Id: Ie3e48678f178a488bfaea6cc2b9a3e18145a8d10 --- M pySim/ara_m.py 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/40/37840/1 diff --git a/pySim/ara_m.py b/pySim/ara_m.py index cdc934d..372d044 100644 --- a/pySim/ara_m.py +++ b/pySim/ara_m.py @@ -262,7 +262,7 @@ return pySim.global_platform.decode_select_response(data_hex) @staticmethod - def xceive_apdu_tlv(tp, hdr: Hexstr, cmd_do, resp_cls, exp_sw='9000'): + def xceive_apdu_tlv(scc, hdr: Hexstr, cmd_do, resp_cls, exp_sw='9000'): """Transceive an APDU with the card, transparently encoding the command data from TLV and decoding the response data tlv.""" if cmd_do: @@ -274,7 +274,7 @@ cmd_do_enc = b'' cmd_do_len = 0 c_apdu = hdr + ('%02x' % cmd_do_len) + b2h(cmd_do_enc) - (data, _sw) = tp.send_apdu_checksw(c_apdu, exp_sw) + (data, _sw) = scc.send_apdu_checksw(c_apdu, exp_sw) if data: if resp_cls: resp_do = resp_cls() @@ -285,32 +285,32 @@ return None @staticmethod - def store_data(tp, do) -> bytes: + def store_data(scc, do) -> bytes: """Build the Command APDU for STORE DATA.""" - return ADF_ARAM.xceive_apdu_tlv(tp, '80e29000', do, StoreResponseDoCollection) + return ADF_ARAM.xceive_apdu_tlv(scc, scc.cla4lchan('80') + 'e29000', do, StoreResponseDoCollection) @staticmethod - def get_all(tp): - return ADF_ARAM.xceive_apdu_tlv(tp, '80caff40', None, GetResponseDoCollection) + def get_all(scc): + return ADF_ARAM.xceive_apdu_tlv(scc, scc.cla4lchan('80') + 'caff40', None, GetResponseDoCollection) @staticmethod - def get_config(tp, v_major=0, v_minor=0, v_patch=1): + def get_config(scc, v_major=0, v_minor=0, v_patch=1): cmd_do = DeviceConfigDO() cmd_do.from_val_dict([{'device_interface_version_do': { 'major': v_major, 'minor': v_minor, 'patch': v_patch}}]) - return ADF_ARAM.xceive_apdu_tlv(tp, '80cadf21', cmd_do, ResponseAramConfigDO) + return ADF_ARAM.xceive_apdu_tlv(scc, scc.cla4lchan('80') + 'cadf21', cmd_do, ResponseAramConfigDO) @with_default_category('Application-Specific Commands') class AddlShellCommands(CommandSet): def do_aram_get_all(self, _opts): """GET DATA [All] on the ARA-M Applet""" - res_do = ADF_ARAM.get_all(self._cmd.lchan.scc._tp) + res_do = ADF_ARAM.get_all(self._cmd.lchan.scc) if res_do: self._cmd.poutput_json(res_do.to_dict()) def do_aram_get_config(self, _opts): """Perform GET DATA [Config] on the ARA-M Applet: Tell it our version and retrieve its version.""" - res_do = ADF_ARAM.get_config(self._cmd.lchan.scc._tp) + res_do = ADF_ARAM.get_config(self._cmd.lchan.scc) if res_do: self._cmd.poutput_json(res_do.to_dict()) @@ -378,14 +378,14 @@ d = [{'ref_ar_do': [{'ref_do': ref_do_content}, {'ar_do': ar_do_content}]}] csrado = CommandStoreRefArDO() csrado.from_val_dict(d) - res_do = ADF_ARAM.store_data(self._cmd.lchan.scc._tp, csrado) + res_do = ADF_ARAM.store_data(self._cmd.lchan.scc, csrado) if res_do: self._cmd.poutput_json(res_do.to_dict()) def do_aram_delete_all(self, _opts): """Perform STORE DATA [Command-Delete[all]] to delete all access rules.""" deldo = CommandDelete() - res_do = ADF_ARAM.store_data(self._cmd.lchan.scc._tp, deldo) + res_do = ADF_ARAM.store_data(self._cmd.lchan.scc, deldo) if res_do: self._cmd.poutput_json(res_do.to_dict()) @@ -479,7 +479,7 @@ export_str = "" export_str += "aram_delete_all\n" - res_do = ADF_ARAM.get_all(lchan.scc._tp) + res_do = ADF_ARAM.get_all(lchan.scc) if not res_do: return export_str.strip() -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37840?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ie3e48678f178a488bfaea6cc2b9a3e18145a8d10 Gerrit-Change-Number: 37840 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
1 0
0 0
[M] Change in pysim[master]: pySim-shell: fix CardKeyProvider for chv management commands
by dexter 16 Aug '24

16 Aug '24
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37838?usp=email ) Change subject: pySim-shell: fix CardKeyProvider for chv management commands ...................................................................... pySim-shell: fix CardKeyProvider for chv management commands The CardKeyProvider support for the commands enable_chv, disable_chv, verify_chv, change_chv and unblock_chv is broken. The reason for this is the annotation "type=is_decimal" in the argument parser. This annotation prevents the usage of string placeholders ("PIN1", "PUK1", etc). Let's fix this by finding a better solution. We can also replace any missing PIN/PUK code by checking if it is supplied or not. If not, we query the CardKeyProvider. This also makes the usage of the *_chv commands more uniform with the verify_adm command. Related: OS#6531 Change-Id: I565b56ac608e801c67ca53d337bdec9efa3f3817 --- M pySim-shell.py 1 file changed, 27 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/38/37838/1 diff --git a/pySim-shell.py b/pySim-shell.py index 3a89f2d..630d54a 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -851,50 +851,47 @@ index_dict = {1: self._cmd.lchan.selected_file.get_selectable_names()} return self._cmd.index_based_complete(text, line, begidx, endidx, index_dict=index_dict) - def get_code(self, code): - """Use code either directly or try to get it from external data source""" - auto = ('PIN1', 'PIN2', 'PUK1', 'PUK2') - - if str(code).upper() not in auto: + def get_code(self, code, field): + """Use code either directly or try to get it from external data source using the provided field name""" + if code is not None: return sanitize_pin_adm(code) - iccid = self._cmd.rs.identity['ICCID'] - result = card_key_provider_get_field(str(code), key='ICCID', value=iccid) + result = card_key_provider_get_field(field, key='ICCID', value=iccid) result = sanitize_pin_adm(result) if result: - self._cmd.poutput("found %s '%s' for ICCID '%s'" % (code.upper(), result, iccid)) + self._cmd.poutput("found %s '%s' for ICCID '%s'" % (field, result, iccid)) else: - self._cmd.poutput("cannot find %s for ICCID '%s'" % (code.upper(), iccid)) + raise RuntimeError("cannot find %s for ICCID '%s'" % (field, iccid)) return result verify_chv_parser = argparse.ArgumentParser() + verify_chv_parser.add_argument('PIN', nargs='?', type=is_decimal, + help='PIN code value. If none given, CSV file will be queried') verify_chv_parser.add_argument( '--pin-nr', type=int, default=1, help='PIN Number, 1=PIN1, 2=PIN2 or custom value (decimal)') - verify_chv_parser.add_argument( - 'pin_code', type=is_decimal, help='PIN code digits, \"PIN1\" or \"PIN2\" to get PIN code from external data source') @cmd2.with_argparser(verify_chv_parser) def do_verify_chv(self, opts): """Verify (authenticate) using specified CHV (PIN) code, which is how the specifications call it if you authenticate yourself using the specified PIN. There usually is at least PIN1 and PIN2.""" - pin = self.get_code(opts.pin_code) + pin = self.get_code(opts.PIN, "PIN" + str(opts.pin_nr)) (data, sw) = self._cmd.lchan.scc.verify_chv(opts.pin_nr, h2b(pin)) self._cmd.poutput("CHV verification successful") unblock_chv_parser = argparse.ArgumentParser() + unblock_chv_parser.add_argument('PUK', nargs='?', type=is_decimal, + help='PUK code value. If none given, CSV file will be queried') + unblock_chv_parser.add_argument('NEWPIN', nargs='?', type=is_decimal, + help='PIN code value. If none given, CSV file will be queried') unblock_chv_parser.add_argument( '--pin-nr', type=int, default=1, help='PUK Number, 1=PIN1, 2=PIN2 or custom value (decimal)') - unblock_chv_parser.add_argument( - 'puk_code', type=is_decimal, help='PUK code digits \"PUK1\" or \"PUK2\" to get PUK code from external data source') - unblock_chv_parser.add_argument( - 'new_pin_code', type=is_decimal, help='PIN code digits \"PIN1\" or \"PIN2\" to get PIN code from external data source') @cmd2.with_argparser(unblock_chv_parser) def do_unblock_chv(self, opts): """Unblock PIN code using specified PUK code""" - new_pin = self.get_code(opts.new_pin_code) - puk = self.get_code(opts.puk_code) + new_pin = self.get_code(opts.NEWPIN, "PIN" + str(opts.pin_nr)) + puk = self.get_code(opts.PUK, "PUK" + str(opts.pin_nr)) (data, sw) = self._cmd.lchan.scc.unblock_chv( opts.pin_nr, h2b(puk), h2b(new_pin)) self._cmd.poutput("CHV unblock successful") @@ -902,43 +899,43 @@ change_chv_parser = argparse.ArgumentParser() change_chv_parser.add_argument( '--pin-nr', type=int, default=1, help='PUK Number, 1=PIN1, 2=PIN2 or custom value (decimal)') - change_chv_parser.add_argument( - 'pin_code', type=is_decimal, help='PIN code digits \"PIN1\" or \"PIN2\" to get PIN code from external data source') - change_chv_parser.add_argument( - 'new_pin_code', type=is_decimal, help='PIN code digits \"PIN1\" or \"PIN2\" to get PIN code from external data source') + change_chv_parser.add_argument('NEWPIN', nargs='?', type=is_decimal, + help='PIN code value. If none given, CSV file will be queried') + change_chv_parser.add_argument('PIN', nargs='?', type=is_decimal, + help='PIN code value. If none given, CSV file will be queried') @cmd2.with_argparser(change_chv_parser) def do_change_chv(self, opts): """Change PIN code to a new PIN code""" - new_pin = self.get_code(opts.new_pin_code) - pin = self.get_code(opts.pin_code) + new_pin = self.get_code(opts.NEWPIN, "PIN" + str(opts.pin_nr)) + pin = self.get_code(opts.PIN, "PIN" + str(opts.pin_nr)) (data, sw) = self._cmd.lchan.scc.change_chv( opts.pin_nr, h2b(pin), h2b(new_pin)) self._cmd.poutput("CHV change successful") disable_chv_parser = argparse.ArgumentParser() + disable_chv_parser.add_argument('PIN', nargs='?', type=is_decimal, + help='PIN code value. If none given, CSV file will be queried') disable_chv_parser.add_argument( '--pin-nr', type=int, default=1, help='PIN Number, 1=PIN1, 2=PIN2 or custom value (decimal)') - disable_chv_parser.add_argument( - 'pin_code', type=is_decimal, help='PIN code digits, \"PIN1\" or \"PIN2\" to get PIN code from external data source') @cmd2.with_argparser(disable_chv_parser) def do_disable_chv(self, opts): """Disable PIN code using specified PIN code""" - pin = self.get_code(opts.pin_code) + pin = self.get_code(opts.PIN, "PIN" + str(opts.pin_nr)) (data, sw) = self._cmd.lchan.scc.disable_chv(opts.pin_nr, h2b(pin)) self._cmd.poutput("CHV disable successful") enable_chv_parser = argparse.ArgumentParser() + enable_chv_parser.add_argument('PIN', nargs='?', type=is_decimal, + help='PIN code value. If none given, CSV file will be queried') enable_chv_parser.add_argument( '--pin-nr', type=int, default=1, help='PIN Number, 1=PIN1, 2=PIN2 or custom value (decimal)') - enable_chv_parser.add_argument( - 'pin_code', type=is_decimal, help='PIN code digits, \"PIN1\" or \"PIN2\" to get PIN code from external data source') @cmd2.with_argparser(enable_chv_parser) def do_enable_chv(self, opts): """Enable PIN code using specified PIN code""" - pin = self.get_code(opts.pin_code) + pin = self.get_code(opts.PIN, "PIN" + str(opts.pin_nr)) (data, sw) = self._cmd.lchan.scc.enable_chv(opts.pin_nr, h2b(pin)) self._cmd.poutput("CHV enable successful") -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37838?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I565b56ac608e801c67ca53d337bdec9efa3f3817 Gerrit-Change-Number: 37838 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
1 0
0 0
[XS] Change in pysim[master]: pySim-shell: prevent opening/closing logical channel 0
by dexter 16 Aug '24

16 Aug '24
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37839?usp=email ) Change subject: pySim-shell: prevent opening/closing logical channel 0 ...................................................................... pySim-shell: prevent opening/closing logical channel 0 The basic logical channel 0 is always present. It cannot be created or closed. In case someone tries to create or close it anyway, we should reject such a command immediately since it might cause unexpected effects. Related: OS#6531 Change-Id: I4eebd9f15fadd18e1caeb033fda36c59446fcab8 --- M pySim-shell.py 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/39/37839/1 diff --git a/pySim-shell.py b/pySim-shell.py index 630d54a..5d99d48 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -970,6 +970,8 @@ @cmd2.with_argparser(open_chan_parser) def do_open_channel(self, opts): """Open a logical channel.""" + if opts.chan_nr == 0: + raise RuntimeError("Cannot create (always existing) basic logical lchan 0") (data, sw) = self._cmd.lchan.scc.manage_channel( mode='open', lchan_nr=opts.chan_nr) # this is executed only in successful case, as unsuccessful raises exception @@ -982,6 +984,8 @@ @cmd2.with_argparser(close_chan_parser) def do_close_channel(self, opts): """Close a logical channel.""" + if opts.chan_nr == 0: + raise RuntimeError("Cannot close (always existing) basic logical lchan 0") (data, sw) = self._cmd.lchan.scc.manage_channel( mode='close', lchan_nr=opts.chan_nr) # this is executed only in successful case, as unsuccessful raises exception -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37839?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I4eebd9f15fadd18e1caeb033fda36c59446fcab8 Gerrit-Change-Number: 37839 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
1 0
0 0
[XS] Change in pysim[master]: pySim.filesystem: Permit Path object construction from FID integer list
by laforge 16 Aug '24

16 Aug '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37832?usp=email ) Change subject: pySim.filesystem: Permit Path object construction from FID integer list ...................................................................... pySim.filesystem: Permit Path object construction from FID integer list we so far supported construction of the Path object from a string or a list of strings. Let's also add the option of constructing it from a path consisting of a list of integer FID values. Change-Id: Ia7e9375b3258d1fbfdc892cefba3e3bbe841c550 --- M pySim/filesystem.py 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/32/37832/1 diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 624619b..805983b 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -1481,10 +1481,12 @@ class Path: """Representation of a file-system path.""" - def __init__(self, p: Union[str, List[str]]): + def __init__(self, p: Union[str, List[str], List[int]]): # split if given as single string with slahes if isinstance(p, str): p = p.split('/') + elif len(p) and isinstance(p[0], int): + p = ['%04x' % x for x in p] # make sure internal representation alwas is uppercase only self.list = [x.upper() for x in p] @@ -1514,7 +1516,7 @@ def relative_to_mf(self) -> 'Path': """Return a path relative to MF, i.e. without initial explicit MF.""" - if self.list[0] == 'MF': + if len(self.list) and self.list[0] in ['MF', '3F00']: return Path(self.list[1:]) return self -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37832?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ia7e9375b3258d1fbfdc892cefba3e3bbe841c550 Gerrit-Change-Number: 37832 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org>
1 0
0 0
[XS] Change in pysim[master]: saip-tool: Set default log level to INFO (instead of DEBUG)
by laforge 16 Aug '24

16 Aug '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37833?usp=email ) Change subject: saip-tool: Set default log level to INFO (instead of DEBUG) ...................................................................... saip-tool: Set default log level to INFO (instead of DEBUG) most users don't want to debug the program. Change-Id: I54ae558cf8d87bf64cc75431cc4edcc694fa9084 --- M contrib/saip-tool.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/37833/1 diff --git a/contrib/saip-tool.py b/contrib/saip-tool.py index d9d33c0..22b913e 100755 --- a/contrib/saip-tool.py +++ b/contrib/saip-tool.py @@ -31,7 +31,7 @@ pp = HexBytesPrettyPrinter(indent=4,width=500) -logging.basicConfig(level=logging.DEBUG) +logging.basicConfig(level=logging.INFO) parser = argparse.ArgumentParser(description=""" Utility program to work with eSIM SAIP (SimAlliance Interoperable Profile) files.""") -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37833?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I54ae558cf8d87bf64cc75431cc4edcc694fa9084 Gerrit-Change-Number: 37833 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org>
1 0
0 0
[XS] Change in pysim[master]: pySim.esim.saip.oid: Allow OID instance in prefix_match()
by laforge 16 Aug '24

16 Aug '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37834?usp=email ) Change subject: pySim.esim.saip.oid: Allow OID instance in prefix_match() ...................................................................... pySim.esim.saip.oid: Allow OID instance in prefix_match() So far the prefix_match() required a string argument; let's also permit another OID object to be passed; we internally convert that to string. Change-Id: I0feb7782d1813cc46ec78f170eb0fce804aebe3a --- M pySim/esim/saip/oid.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/34/37834/1 diff --git a/pySim/esim/saip/oid.py b/pySim/esim/saip/oid.py index f201ffe..c7804b1 100644 --- a/pySim/esim/saip/oid.py +++ b/pySim/esim/saip/oid.py @@ -77,9 +77,9 @@ if self.cmp(other) > 0: return True - def prefix_match(self, oid_str): + def prefix_match(self, oid_str: Union[str, OID]): """determine if oid_str is equal or below our OID.""" - return oid_str.startswith(str(self)) + return str(oid_str).startswith(str(self)) class eOID(OID): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37834?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0feb7782d1813cc46ec78f170eb0fce804aebe3a Gerrit-Change-Number: 37834 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in pysim[master]: pySim.esim.saip: Improve File.from_template feature support
by laforge 16 Aug '24

16 Aug '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37835?usp=email ) Change subject: pySim.esim.saip: Improve File.from_template feature support ...................................................................... pySim.esim.saip: Improve File.from_template feature support When populating a File from a FileTemplate, let's make sure we * correctly treat the maximum file size for BER-TLV files * respect the default value pattern / repeat pattern * respect the high_update flag. Change-Id: I3ba092e0893f53a18264dff5fa37b12ccd9bd47e --- M pySim/esim/saip/__init__.py 1 file changed, 20 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/35/37835/1 diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index b63b95a..0bf805d 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -107,6 +107,7 @@ def from_template(self, template: templates.FileTemplate): """Determine defaults for file based on given FileTemplate.""" fdb_dec = {} + pefi = {} self.rec_len = None if template.fid: self.fileDescriptor['fileID'] = template.fid.to_bytes(2, 'big') @@ -126,14 +127,16 @@ fdb_dec['structure'] = 'linear_fixed' elif template.file_type == 'CY': fdb_dec['structure'] = 'cyclic' - elif template.file_type in ['TR', 'BT']: + elif template.file_type == 'BT': fdb_dec['file_type'] = 'working_ef' + fdb_dec['structure'] = 'ber_tlv' + if template.file_size: + pefi['maximumFileSize'] = template.file_size.to_bytes(2, 'big') # FIXME + elif template.file_type == 'TR': + fdb_dec['file_type'] = 'working_ef' + fdb_dec['structure'] = 'transparent' if template.file_size: self.fileDescriptor['efFileSize'] = template.file_size.to_bytes(2, 'big') # FIXME - if template.file_type == 'BT': - fdb_dec['structure'] = 'ber_tlv' - elif template.file_type == 'TR': - fdb_dec['structure'] = 'transparent' elif template.file_type in ['MF', 'DF', 'ADF']: fdb_dec['file_type'] = 'df' fdb_dec['structure'] = 'no_info_given' @@ -142,9 +145,18 @@ if self.rec_len: fd_dict['record_len'] = self.rec_len self.fileDescriptor['fileDescriptor'] = build_construct(FileDescriptor._construct, fd_dict) - # FIXME: default_val - # FIXME: high_update - # FIXME: params? + if template.high_update: + pefi['specialFileInformation'] = b'\x80' # TS 102 222 Table 5 + try: + if template.default_val_repeat: + pefi['repeatPattern'] = template.expand_default_value_pattern() + elif template.default_val: + pefi['fillPattern'] = template.expand_default_value_pattern() + except ValueError: + # ignore this here as without a file or record length we cannot do this + continue + if len(pefi.keys()): + self.fileDescriptor['proprietaryEFInfo'] = pefi def from_tuples(self, l:List[Tuple]): """Parse a list of fileDescriptor, fillFileContent, fillFileOffset tuples into this instance.""" -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37835?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I3ba092e0893f53a18264dff5fa37b12ccd9bd47e Gerrit-Change-Number: 37835 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • ...
  • 148
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.