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 osmo-bsc[master]: bsc_ctrl_lookup.c: Use AGPLv3, not GPLv2
by pespin 18 Feb '24

18 Feb '24
Attention is currently required from: laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/36001?usp=email ) Change subject: bsc_ctrl_lookup.c: Use AGPLv3, not GPLv2 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/36001?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: I5e5385f7630b41f1c4ad9534dbb4551e597ad596 Gerrit-Change-Number: 36001 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sun, 18 Feb 2024 20:17:44 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bsc[master]: Fix license header in various source code files.
by pespin 18 Feb '24

18 Feb '24
Attention is currently required from: laforge, lynxis lazus. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/36000?usp=email ) Change subject: Fix license header in various source code files. ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/36000?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: I6b8ad5147ca76052213809e67856dcb80bff2b93 Gerrit-Change-Number: 36000 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Sun, 18 Feb 2024 20:17:33 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-pcu[master]: fix license headers
by pespin 18 Feb '24

18 Feb '24
Attention is currently required from: laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/36006?usp=email ) Change subject: fix license headers ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/36006?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I52533193de0ec7e24bf7c5bb035589ba5b9419e4 Gerrit-Change-Number: 36006 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sun, 18 Feb 2024 20:16:31 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-hnbgw[master]: Fix license headers: Should have been AGPLv3+, not GPLv2+
by pespin 18 Feb '24

18 Feb '24
Attention is currently required from: dexter, laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36004?usp=email ) Change subject: Fix license headers: Should have been AGPLv3+, not GPLv2+ ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36004?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I42ea544ae4e5c4d3bedad12ddb55cf3c26a30919 Gerrit-Change-Number: 36004 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Sun, 18 Feb 2024 20:14:30 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-iuh[master]: Fix license headers: Should have been AGPLv3+, not GPLv2+
by pespin 18 Feb '24

18 Feb '24
Attention is currently required from: dexter, laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/36005?usp=email ) Change subject: Fix license headers: Should have been AGPLv3+, not GPLv2+ ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/36005?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: Ie28c32022a9cbc42b55195f7dbb513228857a3cd Gerrit-Change-Number: 36005 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Sun, 18 Feb 2024 20:14:13 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in pysim[master]: saip: profile processing; merging with templates
by laforge 18 Feb '24

18 Feb '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35733?usp=email ) Change subject: saip: profile processing; merging with templates ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35733?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: Ib1674920e488ade9597cb039e4e2047dcbc7864e Gerrit-Change-Number: 35733 Gerrit-PatchSet: 3 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sun, 18 Feb 2024 18:49:42 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: asn1/saip: Fix typo in original ASN.1: Compontents -> Components
by laforge 18 Feb '24

18 Feb '24
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36010?usp=email ) Change subject: asn1/saip: Fix typo in original ASN.1: Compontents -> Components ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/36010?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: I6bec5625579873a9ec267d896584608c9d5e3a2f Gerrit-Change-Number: 36010 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Sun, 18 Feb 2024 18:49:38 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in pysim[master]: utils: Add function to verify Luhn check digits and to sanitize ICCIDs
by Jenkins Builder 18 Feb '24

18 Feb '24
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36009?usp=email ) Change subject: utils: Add function to verify Luhn check digits and to sanitize ICCIDs ...................................................................... Patch Set 1: (1 comment) File tests/test_utils.py: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14478): https://gerrit.osmocom.org/c/pysim/+/36009/comment/930018f8_33eb9a92 PS1, Line 251: # 19 digits without correct luhn; we expect chck digit to be added 'chck' may be misspelled - perhaps 'check'? -- To view, visit https://gerrit.osmocom.org/c/pysim/+/36009?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: I7812420cf97984dd834fca6a38c5e5ae113243cb Gerrit-Change-Number: 36009 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Sun, 18 Feb 2024 18:49:38 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: pylint: esim/saip/__init__.py
by laforge 18 Feb '24

18 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/36011?usp=email ) Change subject: pylint: esim/saip/__init__.py ...................................................................... pylint: esim/saip/__init__.py pySim/esim/saip/__init__.py:28:0: R0402: Use 'from pySim.esim.saip import templates' instead (consider-using-from-import) pySim/esim/saip/__init__.py:166:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) pySim/esim/saip/__init__.py:206:4: W0612: Unused variable 'tagdict' (unused-variable) pySim/esim/saip/__init__.py:273:23: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) Change-Id: I12ef46c847d197fb0c01e624818aeac14eb99e31 --- M pySim/esim/saip/__init__.py 1 file changed, 18 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/11/36011/1 diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index fb064a1..82ed2b7 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -25,7 +25,7 @@ from pySim.ts_102_221 import FileDescriptor from pySim.construct import build_construct from pySim.esim import compile_asn1_subdir -import pySim.esim.saip.templates as templates +from pySim.esim.saip import templates asn1 = compile_asn1_subdir('saip') @@ -165,8 +165,7 @@ # unneccessarry compliaction by inconsistent naming :( if self.type.startswith('opt-'): return self.type.replace('-','') + '-header' - else: - return self.type + '-header' + return self.type + '-header' @property def header(self): @@ -203,7 +202,7 @@ def bertlv_first_segment(binary: bytes) -> Tuple[bytes, bytes]: """obtain the first segment of a binary concatenation of BER-TLV objects. Returns: tuple of first TLV and remainder.""" - tagdict, remainder = bertlv_parse_tag(binary) + _tagdict, remainder = bertlv_parse_tag(binary) length, remainder = bertlv_parse_len(remainder) tl_length = len(binary) - len(remainder) tlv_length = tl_length + length @@ -270,7 +269,7 @@ cur_naa_list = [] cur_naa_list.append(pe) # append the final one - if cur_naa and len(cur_naa_list): + if cur_naa and len(cur_naa_list) > 0: if not cur_naa in self.pes_by_naa: self.pes_by_naa[cur_naa] = [] self.pes_by_naa[cur_naa].append(cur_naa_list) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/36011?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: I12ef46c847d197fb0c01e624818aeac14eb99e31 Gerrit-Change-Number: 36011 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: utils: Add function to verify Luhn check digits and to sanitize ICCIDs
by laforge 18 Feb '24

18 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/36009?usp=email ) Change subject: utils: Add function to verify Luhn check digits and to sanitize ICCIDs ...................................................................... utils: Add function to verify Luhn check digits and to sanitize ICCIDs Change-Id: I7812420cf97984dd834fca6a38c5e5ae113243cb --- M pySim/utils.py M tests/test_utils.py 2 files changed, 56 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/09/36009/1 diff --git a/pySim/utils.py b/pySim/utils.py index 86874ba..afa476b 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -9,7 +9,7 @@ import datetime import argparse from io import BytesIO -from typing import Optional, List, Dict, Any, Tuple, NewType +from typing import Optional, List, Dict, Any, Tuple, NewType, Union # Copyright (C) 2009-2010 Sylvain Munaut <tnt(a)246tNt.com> # Copyright (C) 2021 Harald Welte <laforge(a)osmocom.org> @@ -446,6 +446,30 @@ def enc_iccid(iccid: str) -> Hexstr: return swap_nibbles(rpad(iccid, 20)) +def sanitize_iccid(iccid: Union[int, str]) -> str: + iccid = str(iccid) + if len(iccid) < 18: + raise ValueError('ICCID input value must be at least 18 digits') + if len(iccid) > 20: + raise ValueError('ICCID input value must be at most 20 digits') + if len(iccid) == 18: + # 18 digits means we must add a luhn check digit to reach 19 digits + iccid += str(calculate_luhn(iccid)) + if len(iccid) == 20: + # 20 digits means we're actually exceeding E.118 by one digit, and + # the luhn check digit must already be included + verify_luhn(iccid) + if len(iccid) == 19: + # 19 digits means that it's either an in-spec 19-digits ICCID with + # its luhn check digit already present, or it's an out-of-spec 20-digit + # ICCID without that check digit... + try: + verify_luhn(iccid) + except ValueError: + # 19th digit was not luhn check digit; we must add it + iccid += str(calculate_luhn(iccid)) + return iccid + def enc_plmn(mcc: Hexstr, mnc: Hexstr) -> Hexstr: """Converts integer MCC/MNC into 3 bytes for EF""" @@ -606,6 +630,11 @@ for d in num[::-2]]) % 10 return 0 if check_digit == 10 else check_digit +def verify_luhn(digits: str): + """Verify the Luhn check digit; raises ValueError if it is incorrect.""" + cd = calculate_luhn(digits[:-1]) + if str(cd) != digits[-1]: + raise ValueError('Luhn check digit mismatch: should be %s but is %s' % (str(cd), digits[-1])) def mcc_from_imsi(imsi: str) -> Optional[str]: """ diff --git a/tests/test_utils.py b/tests/test_utils.py index 7609f80..75c8566 100755 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -236,5 +236,22 @@ self.assertEqual(utils.dgi_parse_len(b'\xfe\x0b'), (254, b'\x0b')) self.assertEqual(utils.dgi_parse_len(b'\xff\x00\xff\x0b'), (255, b'\x0b')) +class TestLuhn(unittest.TestCase): + def test_verify(self): + utils.verify_luhn('8988211000000530082') + + def test_encode(self): + self.assertEqual(utils.calculate_luhn('898821100000053008'), 2) + + def test_sanitize_iccid(self): + # 19 digits with correct luhn; we expect no change + self.assertEqual(utils.sanitize_iccid('8988211000000530082'), '8988211000000530082') + # 20 digits with correct luhn; we expect no change + self.assertEqual(utils.sanitize_iccid('89882110000005300811'), '89882110000005300811') + # 19 digits without correct luhn; we expect chck digit to be added + self.assertEqual(utils.sanitize_iccid('8988211000000530081'), '89882110000005300811') + # 18 digits; we expect luhn check digit to be added + self.assertEqual(utils.sanitize_iccid('898821100000053008'), '8988211000000530082') + if __name__ == "__main__": unittest.main() -- To view, visit https://gerrit.osmocom.org/c/pysim/+/36009?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: I7812420cf97984dd834fca6a38c5e5ae113243cb Gerrit-Change-Number: 36009 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • ...
  • 175
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.