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

June 2023

  • 1 participants
  • 2480 discussions
[S] Change in osmo-pcu[master]: pcu_utils.h: Replace software based bitcount impl with gcc builtin
by laforge 03 Jun '23

03 Jun '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33118 ) Change subject: pcu_utils.h: Replace software based bitcount impl with gcc builtin ...................................................................... pcu_utils.h: Replace software based bitcount impl with gcc builtin The cast for different types it's not really needed, simply use the unsigned long long version to make sure we don't drop 1s, in any case __builtin_popcountll() will be quicker than what we used to have. Change-Id: I80ae72d34d53564fc3da1601ee48c8b2ffe79735 --- M src/pcu_utils.h 1 file changed, 15 insertions(+), 9 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/pcu_utils.h b/src/pcu_utils.h index a6beab0..0be37e9 100644 --- a/src/pcu_utils.h +++ b/src/pcu_utils.h @@ -67,17 +67,10 @@ return fn % GSM_MAX_FN; } -#ifdef __cplusplus -template <typename T> -inline unsigned int pcu_bitcount(T x) +inline unsigned int pcu_bitcount(unsigned long long x) { - unsigned int count = 0; - for (count = 0; x; count += 1) - x &= x - 1; - - return count; + return __builtin_popcountll(x); } -#endif static inline uint8_t pcu_lsb(uint8_t x) { -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33118 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I80ae72d34d53564fc3da1601ee48c8b2ffe79735 Gerrit-Change-Number: 33118 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-pcu[master]: Document pcu_lsb() function
by laforge 03 Jun '23

03 Jun '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33125 ) Change subject: Document pcu_lsb() function ...................................................................... Document pcu_lsb() function While at it, fix a typo in the test output. This function is nowadays only used in ms_current_pacch_slots(), which is used only to print the PACCH TS (the first common UL & DL TS). Change-Id: Id1d0b681f6866618f9f3a8c64d6a6c809ca50ea7 --- M src/pcu_utils.h M tests/types/TypesTest.cpp M tests/types/TypesTest.ok 3 files changed, 20 insertions(+), 3 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/pcu_utils.h b/src/pcu_utils.h index 0be37e9..540f704 100644 --- a/src/pcu_utils.h +++ b/src/pcu_utils.h @@ -72,6 +72,9 @@ return __builtin_popcountll(x); } +/* Trim all 1 bits except the Least Significat Bit, which is kept. + * equivalent of (1 << ffs(u)) / 2 + */ static inline uint8_t pcu_lsb(uint8_t x) { return x & -x; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index c6a2fbf..0628497 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -937,10 +937,10 @@ { uint8_t u = 0; - printf("Testing LBS utility...\n"); + printf("Testing LSB utility...\n"); do { - uint8_t x = pcu_lsb(u); /* equivalent of (1 << ffs(u)) / 2 */ + uint8_t x = pcu_lsb(u); printf("%2X " OSMO_BIT_SPEC ": {%d} %3d\n", u, OSMO_BIT_PRINT(u), pcu_bitcount(u), x); u++; diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok index 27afc71..b99e17e 100644 --- a/tests/types/TypesTest.ok +++ b/tests/types/TypesTest.ok @@ -18,7 +18,7 @@ 06 3f 10 0d 23 6d 7f 03 18 23 00 46 a0 08 00 17 44 0b 2b 2b 2b 2b 2b assignment reject: 06 3a 10 7f 06 36 14 7f 06 36 14 7f 06 36 14 7f 06 36 14 c0 2b 2b assignment reject: 06 3a 10 70 06 36 14 70 06 36 14 70 06 36 14 70 06 36 14 0b 2b 2b -Testing LBS utility... +Testing LSB utility... 0 ........: {0} 0 1 .......1: {1} 1 2 ......1.: {1} 2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33125 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Id1d0b681f6866618f9f3a8c64d6a6c809ca50ea7 Gerrit-Change-Number: 33125 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-pcu[master]: Document pcu_lsb() function
by laforge 03 Jun '23

03 Jun '23
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33125 ) Change subject: Document pcu_lsb() function ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33125 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Id1d0b681f6866618f9f3a8c64d6a6c809ca50ea7 Gerrit-Change-Number: 33125 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 03 Jun 2023 12:46:24 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-pcu[master]: pcu_utils.h: Replace software based bitcount impl with gcc builtin
by laforge 03 Jun '23

03 Jun '23
Attention is currently required from: Hoernchen, pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33118 ) Change subject: pcu_utils.h: Replace software based bitcount impl with gcc builtin ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33118 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I80ae72d34d53564fc3da1601ee48c8b2ffe79735 Gerrit-Change-Number: 33118 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 03 Jun 2023 12:46:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: OTA: Fix padding of AES CMAC
by laforge 03 Jun '23

03 Jun '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33116 ) Change subject: OTA: Fix padding of AES CMAC ...................................................................... OTA: Fix padding of AES CMAC When using AES CMAC for authentication of OTA messages, we must not pad the user data before calling the CMAC function. This is unlike the DES MAC, where padding to the DES block size is mandatory. This bug was discovered when trying to talk OTA with AES to a sysmoISIM-SJA5. This patch makes the OTA AES interoperate with the card. Also, with this patch the cryptographic results of pySim/ota.py are identical to those of the java code org.opentelecoms.gsm0348.impl.crypto.CipheringManager Change-Id: I4b40b5857f95ccb21c35795abe7a1995e368bac3 --- M pySim/ota.py 1 file changed, 21 insertions(+), 2 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve dexter: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/ota.py b/pySim/ota.py index 80c823e..83303a6 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -1,6 +1,6 @@ """Code related to SIM/UICC OTA according to TS 102 225 + TS 31.115.""" -# (C) 2021-2022 by Harald Welte <laforge(a)osmocom.org> +# (C) 2021-2023 by Harald Welte <laforge(a)osmocom.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -305,7 +305,7 @@ class OtaAlgoAuthAES(OtaAlgoAuth): name = 'AES' enum_name = 'aes_cmac' - blocksize = 16 # TODO: is this needed? + blocksize = 1 # AES CMAC doesn't need any padding by us def _sign(self, data:bytes) -> bytes: cmac = CMAC.new(self.otak.kid, ciphermod=AES, mac_len=8) cmac.update(data) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I4b40b5857f95ccb21c35795abe7a1995e368bac3 Gerrit-Change-Number: 33116 Gerrit-PatchSet: 2 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> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: ts_31_102: EF_SUPI_NAI: Decode/Encode GLI+GCI as UTF-8 strings
by laforge 03 Jun '23

03 Jun '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33065 ) Change subject: ts_31_102: EF_SUPI_NAI: Decode/Encode GLI+GCI as UTF-8 strings ...................................................................... ts_31_102: EF_SUPI_NAI: Decode/Encode GLI+GCI as UTF-8 strings According to TS 23.003 Section 28.15 and 28.16 both GLI and GCI are NAI as defined in IETF RFC 7542, which in turn specifies they are encoded in UTF-8. Change-Id: I0a82bd0d0a2badd7bc4a1f8de2c3e3c144ee5b12 --- M pySim/ts_31_102.py 1 file changed, 15 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 73c5fd5..14e7cae 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -1066,11 +1066,11 @@ class GlobalLineIdentifier(TLV_IE, tag=0x81): # TS 23.003 clause 28.16.2 - pass + _construct = GreedyString("utf8") class GlobalCableIdentifier(TLV_IE, tag=0x82): # TS 23.003 clause 28.15.2 - pass + _construct = GreedyString("utf8") class NAI_TLV_Collection(TLV_IE_Collection, nested=[NetworkSpecificIdentifier, GlobalLineIdentifier, GlobalCableIdentifier]): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33065 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0a82bd0d0a2badd7bc4a1f8de2c3e3c144ee5b12 Gerrit-Change-Number: 33065 Gerrit-PatchSet: 3 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> Gerrit-MessageType: merged
1 0
0 0
[M] Change in pysim[master]: SJA2: Implement DF.SYSTEM/EF.0348_KEY using construct
by laforge 03 Jun '23

03 Jun '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33066 ) Change subject: SJA2: Implement DF.SYSTEM/EF.0348_KEY using construct ...................................................................... SJA2: Implement DF.SYSTEM/EF.0348_KEY using construct This implicitly adds support for JSON->binary encoding, not just decoding (previous code predating construct support). Change-Id: I0994d9f66a504dd3c60b43ed5cf6645515dcbc6a --- M pySim/construct.py M pySim/sysmocom_sja2.py 2 files changed, 41 insertions(+), 13 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/pySim/construct.py b/pySim/construct.py index 97af235..20a6946 100644 --- a/pySim/construct.py +++ b/pySim/construct.py @@ -87,6 +87,26 @@ len(obj), self.sizeof())) return obj + self.pattern * (self.sizeof() - len(obj)) +class MultiplyAdapter(Adapter): + """ + Decoder multiplies by multiplicator + Encoder divides by multiplicator + + Parameters: + subcon: Subconstruct as defined by construct library + multiplier: Multiplier to apply to raw encoded value + """ + + def __init__(self, subcon, multiplicator): + super().__init__(subcon) + self.multiplicator = multiplicator + + def _decode(self, obj, context, path): + return obj * 8 + + def _encode(self, obj, context, path): + return obj // 8 + class GsmStringAdapter(Adapter): """Convert GSM 03.38 encoded bytes to a string.""" diff --git a/pySim/sysmocom_sja2.py b/pySim/sysmocom_sja2.py index e32943f..20504a7 100644 --- a/pySim/sysmocom_sja2.py +++ b/pySim/sysmocom_sja2.py @@ -86,19 +86,15 @@ class EF_0348_KEY(LinFixedEF): def __init__(self, fid='6f22', name='EF.0348_KEY', desc='TS 03.48 OTA Keys'): super().__init__(fid, name=name, desc=desc, rec_len=(27, 35)) - - def _decode_record_bin(self, raw_bin_data, **kwargs): - u = unpack('!BBB', raw_bin_data[0:3]) - key_algo = (u[2] >> 6) & 1 - key_length = ((u[2] >> 3) & 3) * 8 - return {'sec_domain': u[0], - 'key_set_version': u[1], - 'key_type': key_type2str[u[2] & 3], - 'key_length': key_length, - 'algorithm': key_algo2str[key_algo], - 'mac_length': mac_length[(u[2] >> 7)], - 'key': raw_bin_data[3:key_length].hex() - } + KeyLenAndType = BitStruct('mac_length'/Mapping(Bit, {8:0, 4:1}), + 'algorithm'/Enum(Bit, des=0, aes=1), + 'key_length'/MultiplyAdapter(BitsInteger(3), 8), + '_rfu'/BitsRFU(1), + 'key_type'/Enum(BitsInteger(2), kic=0, kid=1, kik=2, any=3)) + self._construct = Struct('security_domain'/Int8ub, + 'key_set_version'/Int8ub, + 'key_len_and_type'/KeyLenAndType, + 'key'/HexAdapter(Bytes(this.key_len_and_type.key_length))) class EF_0348_COUNT(LinFixedEF): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33066 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0994d9f66a504dd3c60b43ed5cf6645515dcbc6a Gerrit-Change-Number: 33066 Gerrit-PatchSet: 3 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> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: SJA5: Proper encode/decode of TUAK data in EF.USIM_AUTH_KEY
by laforge 03 Jun '23

03 Jun '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33078 ) Change subject: SJA5: Proper encode/decode of TUAK data in EF.USIM_AUTH_KEY ...................................................................... SJA5: Proper encode/decode of TUAK data in EF.USIM_AUTH_KEY Unfortunately, TUAK requires a number of additional (and differently-sized) parameters, so the format of EF.USIM_AUTH_KEY differs significantly depending on TUAK or non-TUAK case. Change-Id: I0dcfe05777510fb34973dc2259b137133d8e199d --- M pySim/sysmocom_sja2.py 1 file changed, 46 insertions(+), 3 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/pySim/sysmocom_sja2.py b/pySim/sysmocom_sja2.py index d1f643e..8b1fc04 100644 --- a/pySim/sysmocom_sja2.py +++ b/pySim/sysmocom_sja2.py @@ -183,13 +183,43 @@ class EF_USIM_AUTH_KEY(TransparentEF): def __init__(self, fid='af20', name='EF.USIM_AUTH_KEY'): super().__init__(fid, name=name, desc='USIM authentication key') + Algorithm = Enum(Nibble, milenage=4, sha1_aka=5, tuak=6, xor=15) CfgByte = BitStruct(Padding(1), 'only_4bytes_res_in_3g'/Bit, - 'use_sres_deriv_func_2_in_3g'/Bit, - 'use_opc_instead_of_op'/Bit, - 'algorithm'/Enum(Nibble, milenage=4, sha1_aka=5, tuak=6, xor=15)) + 'sres_deriv_func_2_in_3g'/Mapping(Bit, {1:0, 2:1}), + 'use_opc_instead_of_op'/Mapping(Bit, {False:0, True:1}), + 'algorithm'/Algorithm) self._construct = Struct('cfg'/CfgByte, 'key'/HexAdapter(Bytes(16)), 'op_opc' /HexAdapter(Bytes(16))) + # TUAK has a rather different layout for the data, so we define a different + # construct below and use explicit _{decode,encode}_bin() methods for separating + # the TUAK and non-TUAK situation + CfgByteTuak = BitStruct(Padding(1), + 'key_length'/Mapping(Bit, {128:0, 256:1}), + 'sres_deriv_func_in_3g'/Mapping(Bit, {1:0, 2:1}), + 'use_opc_instead_of_op'/Mapping(Bit, {False:0, True:1}), + 'algorithm'/Algorithm) + TuakCfgByte = BitStruct(Padding(1), + 'ck_and_ik_size'/Mapping(Bit, {128:0, 256:1}), + 'mac_size'/Mapping(BitsInteger(3), {64:0, 128:1, 256:2}), + 'res_size'/Mapping(BitsInteger(3), {32:0, 64:1, 128:2, 256:3})) + self._constr_tuak = Struct('cfg'/CfgByteTuak, + 'tuak_cfg'/TuakCfgByte, + 'num_of_keccak_iterations'/Int8ub, + 'op_opc'/HexAdapter(Bytes(32)), + 'k'/HexAdapter(Bytes(32))) + + def _decode_bin(self, raw_bin_data: bytearray) -> dict: + if raw_bin_data[0] & 0x0F == 0x06: + return parse_construct(self._constr_tuak, raw_bin_data) + else: + return parse_construct(self._construct, raw_bin_data) + + def _encode_bin(self, abstract_data: dict) -> bytearray: + if abstract_data['cfg']['algorithm'] == 'tuak': + return self._constr_tuak.build(abstract_data) + else: + return self._construct.build(abstract_data) class EF_USIM_AUTH_KEY_2G(TransparentEF): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33078 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0dcfe05777510fb34973dc2259b137133d8e199d Gerrit-Change-Number: 33078 Gerrit-PatchSet: 3 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> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: SJA5: Add TUAK + XOR-2G algorithm definitions for EF_[U]SIM_AUTH_KEY
by laforge 03 Jun '23

03 Jun '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33077 ) Change subject: SJA5: Add TUAK + XOR-2G algorithm definitions for EF_[U]SIM_AUTH_KEY ...................................................................... SJA5: Add TUAK + XOR-2G algorithm definitions for EF_[U]SIM_AUTH_KEY Change-Id: I62a7255d991fa1ed09a7c9bcf8be4b68acfa61a7 --- M pySim/sysmocom_sja2.py 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/pySim/sysmocom_sja2.py b/pySim/sysmocom_sja2.py index 20504a7..d1f643e 100644 --- a/pySim/sysmocom_sja2.py +++ b/pySim/sysmocom_sja2.py @@ -186,7 +186,7 @@ CfgByte = BitStruct(Padding(1), 'only_4bytes_res_in_3g'/Bit, 'use_sres_deriv_func_2_in_3g'/Bit, 'use_opc_instead_of_op'/Bit, - 'algorithm'/Enum(Nibble, milenage=4, sha1_aka=5, xor=15)) + 'algorithm'/Enum(Nibble, milenage=4, sha1_aka=5, tuak=6, xor=15)) self._construct = Struct('cfg'/CfgByte, 'key'/HexAdapter(Bytes(16)), 'op_opc' /HexAdapter(Bytes(16))) @@ -198,7 +198,7 @@ CfgByte = BitStruct(Padding(1), 'only_4bytes_res_in_3g'/Bit, 'use_sres_deriv_func_2_in_3g'/Bit, 'use_opc_instead_of_op'/Bit, - 'algorithm'/Enum(Nibble, milenage=4, comp128v1=1, comp128v2=2, comp128v3=3)) + 'algorithm'/Enum(Nibble, milenage=4, comp128v1=1, comp128v2=2, comp128v3=3, xor=14)) self._construct = Struct('cfg'/CfgByte, 'key'/HexAdapter(Bytes(16)), 'op_opc' /HexAdapter(Bytes(16))) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33077 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I62a7255d991fa1ed09a7c9bcf8be4b68acfa61a7 Gerrit-Change-Number: 33077 Gerrit-PatchSet: 3 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> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: ts_31_102: Add decoder/encoder for DF.5GS/EF.Routing_Indicator
by laforge 03 Jun '23

03 Jun '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33064 ) Change subject: ts_31_102: Add decoder/encoder for DF.5GS/EF.Routing_Indicator ...................................................................... ts_31_102: Add decoder/encoder for DF.5GS/EF.Routing_Indicator This file is rather important for 5G SA operation, so we should have a proper encoder/decoder in place. Change-Id: I1b37fdfc2807976880b2cafb61951f08eebeb344 --- M docs/suci-tutorial.rst M pySim/ts_31_102.py 2 files changed, 24 insertions(+), 5 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/docs/suci-tutorial.rst b/docs/suci-tutorial.rst index 00c060f..fc6e911 100644 --- a/docs/suci-tutorial.rst +++ b/docs/suci-tutorial.rst @@ -132,10 +132,8 @@ :: - pySIM-shell (MF/ADF.USIM/DF.5GS/EF.Routing_Indicator)> update_binary 0071ffff + pySIM-shell (MF/ADF.USIM/DF.5GS/EF.Routing_Indicator)> update_binary 17ffffff -(the encoding might be different, see `this -comment <https://gist.github.com/mrlnc/01d6300f1904f154d969ff205136b753?permalink_co…>`__) You can also set the routing indicator to **0x0**, which is *valid* and means “routing indicator not specified”, leaving it to the modem. diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 76f1358..73c5fd5 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -1080,6 +1080,16 @@ super().__init__(fid, sfid=sfid, name=name, desc=desc, **kwargs) self._tlv = EF_SUPI_NAI.NAI_TLV_Collection +# TS 31.102 Section 4.4.11.11 +class EF_Routing_Indicator(TransparentEF): + def __init__(self, fid='4f0a', sfid=0x0a, name='EF.Routing_Indicator', desc='Routing Indicator', **kwargs): + super().__init__(fid, sfid=sfid, name=name, desc=desc, **kwargs) + # 3GPP TS 24.501 Table 9.11.3.4.1: + # Routing Indicator shall consist of 1 to 4 digits. The coding of this field is the + # responsibility of home network operator but BCD coding shall be used. If a network + # operator decides to assign less than 4 digits to Routing Indicator, the remaining digits + # shall be coded as "1111" to fill the 4 digits coding of Routing Indicator + self._construct = Struct('routing_indicator'/BcdAdapter(Rpad(Bytes(2))), 'rfu'/HexAdapter(Bytes(2))) # TS 31.102 Section 4.4.11.13 class EF_TN3GPPSNN(TransparentEF): @@ -1434,8 +1444,7 @@ EF_SUCI_Calc_Info(service=124), EF_OPL5G(service=129), EF_SUPI_NAI(service=130), - TransparentEF('4F0A', 0x0a, 'EF.Routing_Indicator', - 'Routing Indicator', size=(4, 4), service=124), + EF_Routing_Indicator(service=124), TransparentEF('4F0B', 0x0b, 'EF.URSP', 'UE Route Selector Policies per PLMN', service=132), EF_TN3GPPSNN(service=133), -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33064 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I1b37fdfc2807976880b2cafb61951f08eebeb344 Gerrit-Change-Number: 33064 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> Gerrit-Reviewer: merlinchlosta <merlin.chlosta(a)rub.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • ...
  • 248
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.