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
[S] Change in osmo-ttcn3-hacks[master]: testenv: add TESTENV_REBUILD_OUTDATED_IMAGE
by pespin 21 Aug '24

21 Aug '24
Attention is currently required from: osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37887?usp=email ) Change subject: testenv: add TESTENV_REBUILD_OUTDATED_IMAGE ...................................................................... Patch Set 1: (1 comment) File _testenv/testenv/podman.py: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37887/comment/8f9c5ccd_6ba0… : PS1, Line 60: logging.debug("Building anyway since --force was used") oh, so there's already a cmdline param for that? then this commit is just adding yet another way to do the same? -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37887?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia1243320b6d310c69ef9291cca69a1594b1a8a70 Gerrit-Change-Number: 37887 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Wed, 21 Aug 2024 14:36:53 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: testenv/README: describe architecture
by pespin 21 Aug '24

21 Aug '24
Attention is currently required from: osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37886?usp=email ) Change subject: testenv/README: describe architecture ...................................................................... Patch Set 1: Code-Review+1 (1 comment) File _testenv/README.md: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37886/comment/13c7a783_fbfc… : PS1, Line 7: Testenv builds and runs a testsuite and all its test components in the same One of the problems I faced initially as a user is that I thought it would run by default under a container, but it was not the case unless --podman is passed. May be worth better explicitly stating what the default behavior is. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37886?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ie9eee8cf14ba2069c1cd5bd6ab703f3f6ccdc100 Gerrit-Change-Number: 37886 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Wed, 21 Aug 2024 14:34:46 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: testenv: cmd: pass all env vars without --podman
by osmith 21 Aug '24

21 Aug '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37884?usp=email ) Change subject: testenv: cmd: pass all env vars without --podman ...................................................................... testenv: cmd: pass all env vars without --podman As suggested by Pau, pass all environment variables to through testenv if it is running without podman. This way a custom TTCN3_DIR, TTCN3_BIN_DIR and more variables that may make sense when running directly on the host, work as expected. Closes: OS#6544 Change-Id: I5e710a1ee7185a3f6f4f1e98f201f3f6fda2be55 --- M _testenv/testenv/cmd.py 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/_testenv/testenv/cmd.py b/_testenv/testenv/cmd.py index cb8386a..6f502fc 100644 --- a/_testenv/testenv/cmd.py +++ b/_testenv/testenv/cmd.py @@ -78,6 +78,13 @@ for var in env: ret[var] = env[var] + + # Without podman: pass all environment variables from host (OS#6544) + if not podman: + for var in os.environ: + if var not in ret: + ret[var] = os.environ.get(var) + return ret -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37884?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I5e710a1ee7185a3f6f4f1e98f201f3f6fda2be55 Gerrit-Change-Number: 37884 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-dev[master]: gen_makefile: support symlinks for src + src_proj
by osmith 21 Aug '24

21 Aug '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/37888?usp=email ) Change subject: gen_makefile: support symlinks for src + src_proj ...................................................................... gen_makefile: support symlinks for src + src_proj Support the src and src_proj directories to be symlinks by checking if these paths exist only (-e), instead of checking if these are directories (-d). Add a second check to detect broken symlinks and inform the user about those, so it does not fail later on with a more confusing error. This may happen if the user runs testenv inside podman, and has a symlink pointing to a directory that is not mounted inside podman. Related: OS#6494 Change-Id: Ic5ffa132b29e0a2ca78b02e4c8c05492471b3966 --- M gen_makefile.py 1 file changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/88/37888/1 diff --git a/gen_makefile.py b/gen_makefile.py index 0476a3f..50405fa 100755 --- a/gen_makefile.py +++ b/gen_makefile.py @@ -221,8 +221,25 @@ return f''' .make.{proj}.clone: @echo "\\n\\n\\n===== $@\\n" - test -d {src} || mkdir -p {src} - test -d {src_proj} || ( {cmd_clone} && {cmd_set_push_url} ) + + @if ! [ -e {src} ]; then \\ + if [ -L {src} ]; then \\ + echo "ERROR: broken symlink: {src}"; \\ + exit 1; \\ + fi; \\ + set -x; \\ + mkdir -p {src}; \\ + fi + + @if ! [ -e {src_proj} ]; then \\ + if [ -L {src_proj} ]; then \\ + echo "ERROR: broken symlink: {src_proj}"; \\ + exit 1; \\ + fi; \\ + set -x; \\ + ( {cmd_clone} && {cmd_set_push_url} ); \\ + fi + sync touch $@ ''' -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/37888?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: Ic5ffa132b29e0a2ca78b02e4c8c05492471b3966 Gerrit-Change-Number: 37888 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[XS] Change in pysim[master]: pySim.esim.saip: Fix typo in ProfileElementAKA.set_mapping() method
by laforge 21 Aug '24

21 Aug '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37845?usp=email ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: pySim.esim.saip: Fix typo in ProfileElementAKA.set_mapping() method ...................................................................... pySim.esim.saip: Fix typo in ProfileElementAKA.set_mapping() method Change-Id: Icd1594c6c2a8536a4ab8d1fc698307f05f539bdb --- M pySim/esim/saip/__init__.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index dfc4584..037f7cc 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -932,7 +932,7 @@ def set_mapping(self, aid: bytes, options: int = 6): """Configure akaParametes for a mapping from another AID.""" - self.decoded['algoConfiguration'] = ('mappingParamete', { + self.decoded['algoConfiguration'] = ('mappingParameter', { 'mappingOptions': bytes([options]), 'mappingSource': aid, }) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37845?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Icd1594c6c2a8536a4ab8d1fc698307f05f539bdb Gerrit-Change-Number: 37845 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[XS] Change in pysim[master]: pySim.esim.saip: Fix key used in FsProfileElement.files2pe
by laforge 21 Aug '24

21 Aug '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37846?usp=email ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: pySim.esim.saip: Fix key used in FsProfileElement.files2pe ...................................................................... pySim.esim.saip: Fix key used in FsProfileElement.files2pe The self.files member is a dict. Hence we should use those dict keys when [re]building the decoded dict. The previous code ignored it and re-constructed the key from File.pe_name - but that's not always identical. Change-Id: I0e6c97721fb1cfc6b5c21595d85bd374d485b573 --- M pySim/esim/saip/__init__.py 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index 037f7cc..20e2cb4 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -371,9 +371,9 @@ self.files[file.pe_name] = file def files2pe(self): - """Update the "decoded" member with the contents of the files member.""" - for f in self.files: - self.decoded[f.pename] = f.to_tuples() + """Update the "decoded" member with the contents of the "files" member.""" + for k, f in self.files.items(): + self.decoded[k] = f.to_tuples() def pe2files(self): """Update the "files" member with the contents of the "decoded" member.""" -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37846?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0e6c97721fb1cfc6b5c21595d85bd374d485b573 Gerrit-Change-Number: 37846 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in pysim[master]: pySim.esim.saip.File: move away from stream for file content
by laforge 21 Aug '24

21 Aug '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37847?usp=email ) Change subject: pySim.esim.saip.File: move away from stream for file content ...................................................................... pySim.esim.saip.File: move away from stream for file content Let's linearize the file content in a bytes member variable self.body. Change-Id: I6cb23a3a644854abd3dfd3b50b586ce80da21353 --- M pySim/esim/saip/__init__.py 1 file changed, 12 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index 20e2cb4..27327b0 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -97,7 +97,7 @@ self.pe_name = pename self.template = template self.fileDescriptor = {} - self.stream = None + self.body = None # apply some defaults from profile if self.template: self.from_template(self.template) @@ -173,7 +173,7 @@ raise ValueError("No fileDescriptor found in tuple, and none set by template before") if fd: self.fileDescriptor.update(dict(fd)) - self.stream = self.linearize_file_content(l) + self.body = self.linearize_file_content(l) def from_gfm(self, d: Dict): print(d) @@ -184,7 +184,7 @@ raise NotImplementedError @staticmethod - def linearize_file_content(l: List[Tuple]) -> Optional[io.BytesIO]: + def linearize_file_content(l: List[Tuple]) -> Optional[bytes]: """linearize a list of fillFileContent / fillFileOffset tuples into a stream of bytes.""" stream = io.BytesIO() for k, v in l: @@ -199,7 +199,14 @@ stream.write(v) else: return ValueError("Unknown key '%s' in tuple list" % k) - return stream + return stream.getvalue() + + def file_content_to_tuples(self) -> List[Tuple]: + # FIXME: simplistic approach. needs optimization. We should first check if the content + # matches the expanded default value from the template. If it does, return empty list. + # Next, we should compute the diff between the default value and self.body, and encode + # that as a sequence of fillFileOffset and fillFileContent tuples. + return [('fillFileContent', self.body)] def __str__(self) -> str: return "File(%s)" % self.pe_name @@ -819,7 +826,7 @@ @property def imsi(self) -> Optional[str]: f = File('ef-imsi', self.decoded['ef-imsi']) - return dec_imsi(b2h(f.stream.getvalue())) + return dec_imsi(b2h(f.body)) class ProfileElementOptUSIM(FsProfileElement): type = 'opt-usim' -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37847?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I6cb23a3a644854abd3dfd3b50b586ce80da21353 Gerrit-Change-Number: 37847 Gerrit-PatchSet: 6 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in pysim[master]: pySim.esim.saip: Refactor file size encoding into a method
by laforge 21 Aug '24

21 Aug '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37836?usp=email ) ( 4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: pySim.esim.saip: Refactor file size encoding into a method ...................................................................... pySim.esim.saip: Refactor file size encoding into a method Change-Id: I46b8cb81ef8cc1794c11b61e0adfb575f937b349 --- M pySim/esim/saip/__init__.py 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index c41a0b6..90d63db 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -104,6 +104,10 @@ if l: self.from_tuples(l) + def _encode_file_size(self, size: int) -> bytes: + # FIXME: handle > v2.0 case where it must be encoded on the minimum number of octets possible + return size.to_bytes(2, 'big') + def from_template(self, template: templates.FileTemplate): """Determine defaults for file based on given FileTemplate.""" fdb_dec = {} @@ -122,7 +126,7 @@ if template.rec_len: self.record_len = template.rec_len if template.nb_rec and template.rec_len: - self.fileDescriptor['efFileSize'] = (template.nb_rec * template.rec_len).to_bytes(2, 'big') # FIXME + self.fileDescriptor['efFileSize'] = self._encode_file_size(template.nb_rec * template.rec_len) if template.file_type == 'LF': fdb_dec['structure'] = 'linear_fixed' elif template.file_type == 'CY': @@ -131,12 +135,12 @@ 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 + pefi['maximumFileSize'] = self._encode_file_size(template.file_size) 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 + self.fileDescriptor['efFileSize'] = self._encode_file_size(template.file_size) elif template.file_type in ['MF', 'DF', 'ADF']: fdb_dec['file_type'] = 'df' fdb_dec['structure'] = 'no_info_given' -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37836?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I46b8cb81ef8cc1794c11b61e0adfb575f937b349 Gerrit-Change-Number: 37836 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: 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 21 Aug '24

21 Aug '24
laforge has submitted this change. ( 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(-) Approvals: fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index b63b95a..c41a0b6 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 + pass + 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: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I3ba092e0893f53a18264dff5fa37b12ccd9bd47e Gerrit-Change-Number: 37835 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[M] Change in pysim[master]: pySim.esim.saip: Move AKA specific post_dec + pre_enc to AKA subclass
by laforge 21 Aug '24

21 Aug '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37837?usp=email ) Change subject: pySim.esim.saip: Move AKA specific post_dec + pre_enc to AKA subclass ...................................................................... pySim.esim.saip: Move AKA specific post_dec + pre_enc to AKA subclass Having AKA specific code in the generic ProfileElement base class dated back to when we didn't have a ProfileElementAKA subclass. Change-Id: Icd332183758b8ef20a77507b728f5e455698def0 --- M pySim/esim/saip/__init__.py 1 file changed, 31 insertions(+), 31 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index 90d63db..fb2097a 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -235,33 +235,6 @@ if mandated: self.decoded[self.header_name] = { 'mandated': None} - def _fixup_sqnInit_dec(self) -> None: - """asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around - this.""" - if self.type != 'akaParameter': - return - sqn_init = self.decoded.get('sqnInit', None) - if not sqn_init: - return - # this weird '0x' value in a string is what we get from our (slightly hacked) ASN.1 syntax - if sqn_init == '0x000000000000': - # SEQUENCE (SIZE (32)) OF OCTET STRING (SIZE (6)) - self.decoded['sqnInit'] = [b'\x00'*6] * 32 - - def _fixup_sqnInit_enc(self) -> None: - """asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around - this.""" - if self.type != 'akaParameter': - return - sqn_init = self.decoded.get('sqnInit', None) - if not sqn_init: - return - for s in sqn_init: - if any(s): - return - # none of the fields were initialized with a non-default (non-zero) value, so we can skip it - del self.decoded['sqnInit'] - @property def header_name(self) -> str: """Return the name of the header field within the profile element.""" @@ -337,8 +310,6 @@ else: inst = ProfileElement(decoded) inst.type = pe_type - # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF - inst._fixup_sqnInit_dec() # run any post-decoder a derived class may have if hasattr(inst, '_post_decode'): inst._post_decode() @@ -349,8 +320,6 @@ # run any pre-encoder a derived class may have if hasattr(self, '_pre_encode'): self._pre_encode() - # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF - self._fixup_sqnInit_enc() return asn1.encode('ProfileElement', (self.type, self.decoded)) def __str__(self) -> str: @@ -861,6 +830,37 @@ # provide some reasonable defaults for a MNO-SD self.set_milenage(b'\x00'*16, b'\x00'*16) + def _fixup_sqnInit_dec(self) -> None: + """asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around + this.""" + sqn_init = self.decoded.get('sqnInit', None) + if not sqn_init: + return + # this weird '0x' value in a string is what we get from our (slightly hacked) ASN.1 syntax + if sqn_init == '0x000000000000': + # SEQUENCE (SIZE (32)) OF OCTET STRING (SIZE (6)) + self.decoded['sqnInit'] = [b'\x00'*6] * 32 + + def _fixup_sqnInit_enc(self) -> None: + """asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around + this.""" + sqn_init = self.decoded.get('sqnInit', None) + if not sqn_init: + return + for s in sqn_init: + if any(s): + return + # none of the fields were initialized with a non-default (non-zero) value, so we can skip it + del self.decoded['sqnInit'] + + def _post_decode(self): + # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF + self._fixup_sqnInit_dec() + + def _pre_encode(self): + # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF + self._fixup_sqnInit_enc() + def set_milenage(self, k: bytes, opc: bytes): """Configure akaParametes for MILENAGE.""" self.decoded['algoConfiguration'] = ('algoParameter', { -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37837?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Icd332183758b8ef20a77507b728f5e455698def0 Gerrit-Change-Number: 37837 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • ...
  • 148
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.