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 2024

  • 1 participants
  • 1566 discussions
[S] Change in pysim[master]: jenkins.sh: Include es9p_client in pylint
by laforge 09 Jun '24

09 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37146?usp=email ) Change subject: jenkins.sh: Include es9p_client in pylint ...................................................................... jenkins.sh: Include es9p_client in pylint Change-Id: I06f6773b8b5d3dfa588617d5af81c2fddb474a3d --- M contrib/jenkins.sh 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/46/37146/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6fb3d1a..96c4d2b 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -57,7 +57,8 @@ --disable E0401 \ --enable W0301 \ pySim tests/*.py *.py \ - contrib/es2p_client.py + contrib/es2p_client.py \ + contrib/es9p_client.py ;; "docs") rm -rf docs/_build -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37146?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: I06f6773b8b5d3dfa588617d5af81c2fddb474a3d Gerrit-Change-Number: 37146 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: pySim.cat: Add more alredy-defined IEs to ProactiveCmd classes
by laforge 09 Jun '24

09 Jun '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/+/37138?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.cat: Add more alredy-defined IEs to ProactiveCmd classes ...................................................................... pySim.cat: Add more alredy-defined IEs to ProactiveCmd classes ... also add some spec references Change-Id: If071abdc61c7c881bdea5292d12c74a1024f6784 --- M pySim/cat.py 1 file changed, 54 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/38/37138/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37138?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: If071abdc61c7c881bdea5292d12c74a1024f6784 Gerrit-Change-Number: 37138 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in pysim[master]: pySim.tlv.COMPR_TLV_IE: Patch comprehension bit if derived class miss...
by laforge 09 Jun '24

09 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37145?usp=email ) Change subject: pySim.tlv.COMPR_TLV_IE: Patch comprehension bit if derived class misses it ...................................................................... pySim.tlv.COMPR_TLV_IE: Patch comprehension bit if derived class misses it Our current implementation assumes that all COMPR_TLV_IE are created with a raw tag value that has the comprehension bit set. Check for this during the class __new__ method and print a warning if we have to fix it up Change-Id: I299cd65f32dffda9040d18c17a374e8dc9ebe7da --- M pySim/tlv.py 1 file changed, 25 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/45/37145/1 diff --git a/pySim/tlv.py b/pySim/tlv.py index 5835d33..c6662ea 100644 --- a/pySim/tlv.py +++ b/pySim/tlv.py @@ -271,6 +271,18 @@ class COMPR_TLV_IE(TLV_IE): """TLV_IE formated as COMPREHENSION-TLV as described in ETSI TS 101 220.""" + def __new__(mcs, name, bases, namespace, **kwargs): + x = super().__new__(mcs, name, bases, namespace) + if x.tag: + # we currently assume that the tag values always have the comprehension bit set; + # let's fix it up if a derived class has forgotten about that + if x.tag > 0xff and x.tag & 0x8000 == 0: + print("Fixing up COMPR_TLV_IE class %s: tag=0x%x has no comprehension bit" % (name, x.tag)) + x.tag = x.tag | 0x8000 + elif x.tag & 0x80 == 0: + print("Fixing up COMPR_TLV_IE class %s: tag=0x%x has no comprehension bit" % (name, x.tag)) + x.tag = x.tag | 0x80 + def __init__(self, **kwargs): super().__init__(**kwargs) self.comprehension = False -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37145?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: I299cd65f32dffda9040d18c17a374e8dc9ebe7da Gerrit-Change-Number: 37145 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: pySim.cat: Make sure to always set comprehension bit in COMPR_TLV_IE
by laforge 09 Jun '24

09 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37144?usp=email ) Change subject: pySim.cat: Make sure to always set comprehension bit in COMPR_TLV_IE ...................................................................... pySim.cat: Make sure to always set comprehension bit in COMPR_TLV_IE our implementation currently assumes that all derived classes are created with a tag value that has the comprehension bit set. Change-Id: I6e5f2a69c960c03015c3f233f8fbc2a7a802f07e --- M pySim/cat.py 1 file changed, 33 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/44/37144/1 diff --git a/pySim/cat.py b/pySim/cat.py index bfd22b4..f2c4a30 100644 --- a/pySim/cat.py +++ b/pySim/cat.py @@ -30,25 +30,25 @@ # Tag values as per TS 101 220 Table 7.23 # TS 102 223 Section 8.1 -class Address(COMPR_TLV_IE, tag=0x06): +class Address(COMPR_TLV_IE, tag=0x86): _construct = Struct('ton_npi'/Int8ub, 'call_number'/BcdAdapter(GreedyBytes)) # TS 102 223 Section 8.2 -class AlphaIdentifier(COMPR_TLV_IE, tag=0x05): +class AlphaIdentifier(COMPR_TLV_IE, tag=0x85): # FIXME: like EF.ADN pass # TS 102 223 Section 8.3 -class Subaddress(COMPR_TLV_IE, tag=0x08): +class Subaddress(COMPR_TLV_IE, tag=0x88): pass # TS 102 223 Section 8.4 + TS 31.111 Section 8.4 -class CapabilityConfigParams(COMPR_TLV_IE, tag=0x07): +class CapabilityConfigParams(COMPR_TLV_IE, tag=0x87): pass # TS 31.111 Section 8.5 -class CBSPage(COMPR_TLV_IE, tag=0x0C): +class CBSPage(COMPR_TLV_IE, tag=0x8C): pass # TS 102 223 V15.3.0 Section 9.4 @@ -121,7 +121,7 @@ return bytes([src, dst]) # TS 102 223 Section 8.8 -class Duration(COMPR_TLV_IE, tag=0x04): +class Duration(COMPR_TLV_IE, tag=0x84): _construct = Struct('time_unit'/Enum(Int8ub, minutes=0, seconds=1, tenths_of_seconds=2), 'time_interval'/Int8ub) @@ -131,16 +131,16 @@ 'text_string'/GsmStringAdapter(GreedyBytes)) # TS 102 223 Section 8.10 -class ItemIdentifier(COMPR_TLV_IE, tag=0x10): +class ItemIdentifier(COMPR_TLV_IE, tag=0x90): _construct = Struct('identifier'/Int8ub) # TS 102 223 Section 8.11 -class ResponseLength(COMPR_TLV_IE, tag=0x11): +class ResponseLength(COMPR_TLV_IE, tag=0x91): _construct = Struct('minimum_length'/Int8ub, 'maximum_length'/Int8ub) # TS 102 223 Section 8.12 -class Result(COMPR_TLV_IE, tag=0x03): +class Result(COMPR_TLV_IE, tag=0x83): GeneralResult = Enum(Int8ub, # '0X' and '1X' indicate that the command has been performed performed_successfully=0, @@ -266,12 +266,12 @@ # TS 102 223 Section 8.15 -class TextString(COMPR_TLV_IE, tag=0x0d): +class TextString(COMPR_TLV_IE, tag=0x8D): _construct = Struct('dcs'/Int8ub, # TS 03.38 'text_string'/HexAdapter(GreedyBytes)) # TS 102 223 Section 8.16 -class Tone(COMPR_TLV_IE, tag=0x0e): +class Tone(COMPR_TLV_IE, tag=0x8E): _construct = Struct('tone'/Enum(Int8ub, dial_tone=0x01, called_subscriber_busy=0x02, congestion=0x03, @@ -302,12 +302,12 @@ melody_8=0x47)) # TS 31 111 Section 8.17 -class USSDString(COMPR_TLV_IE, tag=0x0a): +class USSDString(COMPR_TLV_IE, tag=0x8A): _construct = Struct('dcs'/Int8ub, 'ussd_string'/HexAdapter(GreedyBytes)) # TS 102 223 Section 8.18 -class FileList(COMPR_TLV_IE, tag=0x12): +class FileList(COMPR_TLV_IE, tag=0x92): FileId=HexAdapter(Bytes(2)) _construct = Struct('number_of_files'/Int8ub, 'files'/GreedyRange(FileId)) @@ -334,7 +334,7 @@ 'text_string'/HexAdapter(GreedyBytes)) # TS 102 223 Section 8.24 -class ItemsNextActionIndicator(COMPR_TLV_IE, tag=0x18): +class ItemsNextActionIndicator(COMPR_TLV_IE, tag=0x98): _construct = GreedyRange(Int8ub) class EventList(COMPR_TLV_IE, tag=0x99): @@ -379,7 +379,7 @@ _construct = Enum(Int8ub, normal_service=0, limited_service=1, no_service=2) # TS 102 223 Section 8.31 -class IconIdentifier(COMPR_TLV_IE, tag=0x1e): +class IconIdentifier(COMPR_TLV_IE, tag=0x9e): _construct = Struct('icon_qualifier'/FlagsEnum(Int8ub, not_self_explanatory=1), 'icon_identifier'/Int8ub) @@ -405,7 +405,7 @@ _construct = HexAdapter(GreedyBytes) # TS 102 223 Section 8.43 -class ImmediateResponse(COMPR_TLV_IE, tag=0x2b): +class ImmediateResponse(COMPR_TLV_IE, tag=0xAB): pass # TS 102 223 Section 8.45 @@ -413,7 +413,7 @@ _construct = HexAdapter(GreedyBytes) # TS 31.111 Section 8.46 -class TimingAdvance(COMPR_TLV_IE, tag=0x46): +class TimingAdvance(COMPR_TLV_IE, tag=0xC6): _construct = Struct('me_status'/Enum(Int8ub, in_idle_state=0, not_in_idle_state=1), 'timing_advance'/Int8ub) @@ -497,7 +497,7 @@ 'port_number'/Int16ub) # TS 102 223 Section 8.60 -class Aid(COMPR_TLV_IE, tag=0x2f): +class Aid(COMPR_TLV_IE, tag=0xAF): _construct = Struct('aid'/HexAdapter(GreedyBytes)) # TS 102 223 Section 8.61 @@ -540,7 +540,7 @@ _construct = HexAdapter(GreedyBytes) # TS 102 223 Section 8.72 -class TextAttribute(COMPR_TLV_IE, tag=0x50): +class TextAttribute(COMPR_TLV_IE, tag=0xD0): pass # TS 31.111 Section 8.72 @@ -576,7 +576,7 @@ _construct = GreedyRange(Int8ub) # TS 102 223 Section 8.80 -class FrameIdentifier(COMPR_TLV_IE, tag=0x68): +class FrameIdentifier(COMPR_TLV_IE, tag=0xE8): _construct = Struct('identifier'/Int8ub) # TS 102 223 Section 8.82 @@ -697,7 +697,7 @@ _construct = GreedyRange(AccessTechTuple) # TS 102 223 Section 8.107 -class ApplicationSpecificRefreshData(COMPR_TLV_IE, tag=0x3B): +class ApplicationSpecificRefreshData(COMPR_TLV_IE, tag=0xBB): pass # TS 31.111 Section 8.108 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37144?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: I6e5f2a69c960c03015c3f233f8fbc2a7a802f07e Gerrit-Change-Number: 37144 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: tests/ota_test.py: Allow stand-alone execution
by laforge 09 Jun '24

09 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37142?usp=email ) Change subject: tests/ota_test.py: Allow stand-alone execution ...................................................................... tests/ota_test.py: Allow stand-alone execution Let's add a __main__ section to allow stand-alone execution via python3 ./tests/test_ota.py Change-Id: Ic3940ac23c7ddc1013e21f41eae6076a11dfd4f4 --- M tests/test_ota.py 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/42/37142/1 diff --git a/tests/test_ota.py b/tests/test_ota.py index c4598a3..f75ba8d 100644 --- a/tests/test_ota.py +++ b/tests/test_ota.py @@ -299,3 +299,6 @@ self.assertEqual(d.number_of_commands, t['response']['number_of_commands']) self.assertEqual(d.last_status_word, t['response']['last_status_word']) self.assertEqual(d.last_response_data, t['response']['last_response_data']) + +if __name__ == "__main__": + unittest.main() -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37142?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: Ic3940ac23c7ddc1013e21f41eae6076a11dfd4f4 Gerrit-Change-Number: 37142 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: pySim.ota.OtaDialectSms: Implement command decoding
by laforge 09 Jun '24

09 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37141?usp=email ) Change subject: pySim.ota.OtaDialectSms: Implement command decoding ...................................................................... pySim.ota.OtaDialectSms: Implement command decoding So far we only implemented command encoding and response decoding. Let's also add command decoding, which is useful for example when decoding protocol traces. Change-Id: Id666cea8a91a854209f3c19c1f09b512bb493c85 --- M pySim/ota.py M tests/test_ota.py 2 files changed, 79 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/41/37141/1 diff --git a/pySim/ota.py b/pySim/ota.py index d77a64e..39904c7 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -18,7 +18,7 @@ import zlib import abc import struct -from typing import Optional +from typing import Optional, Tuple from construct import Enum, Int8ub, Int16ub, Struct, Bytes, GreedyBytes, BitsInteger, BitStruct from construct import Flag, Padding, Switch, this @@ -388,6 +388,49 @@ return envelope_data + def decode_cmd(self, otak: OtaKeyset, encoded: bytes) -> Tuple[bytes, dict, bytes]: + """Decode an encoded (encrypted, signed) OTA SMS Command-APDU.""" + if True: # TODO: how to decide? + cpl = int.from_bytes(encoded[:2], 'big') + part_head = encoded[2:2+8] + ciph = encoded[2+8:] + envelope_data = otak.crypt.decrypt(ciph) + else: + part_head = encoded[:8] + envelope_data = encoded[8:] + + hdr_dec = self.hdr_construct.parse(part_head) + + # strip counter part from front of envelope_data + part_cnt = envelope_data[:6] + cntr = int.from_bytes(part_cnt[:5]) + pad_cnt = int.from_bytes(part_cnt[5:]) + envelope_data = envelope_data[6:] + + spi = hdr_dec['spi'] + if spi['rc_cc_ds'] == 'cc': + # split cc from front of APDU + cc = envelope_data[:8] + apdu = envelope_data[8:] + # verify CC + temp_data = cpl.to_bytes(2, 'big') + part_head + part_cnt + apdu + otak.auth.check_sig(temp_data, cc) + elif spi['rc_cc_ds'] == 'rc': + # CRC32 + crc32_rx = int.from_bytes(envelope_data[:4]) + # FIXME: crc32_computed = zlip.crc32( + # FIXME: verify RC + raise NotImplementedError + apdu = envelope_data[4:] + elif spi['rc_cc_ds'] == 'no_rc_cc_ds': + apdu = envelope_data + else: + raise ValueError("Invalid rc_cc_ds: %s" % spi['rc_cc_ds']) + + apdu = apdu[:len(apdu)-pad_cnt] + return hdr_dec['tar'], spi, apdu + + def decode_resp(self, otak: OtaKeyset, spi: dict, data: bytes) -> ("OtaDialectSms.SmsResponsePacket", Optional["CompactRemoteResp"]): if isinstance(data, str): data = h2b(data) diff --git a/tests/test_ota.py b/tests/test_ota.py index ce10a7d..c4598a3 100644 --- a/tests/test_ota.py +++ b/tests/test_ota.py @@ -65,14 +65,19 @@ def test_cmd_aes128_ciphered(self): spi = self.spi_base - r = self.dialect.encode_cmd(self.od, self.tar, spi, h2b('00a40004023f00')) + apdu = h2b('00a40004023f00') + r = self.dialect.encode_cmd(self.od, self.tar, spi, apdu) self.assertEqual(b2h(r), '00281506192222b00011e87cceebb2d93083011ce294f93fc4d8de80da1abae8c37ca3e72ec4432e5058') - - + # also test decoder + dec_tar, dec_spi, dec_apdu = self.dialect.decode_cmd(self.od, r) + self.assertEqual(b2h(apdu), b2h(dec_apdu)) + self.assertEqual(b2h(dec_tar), b2h(self.tar)) + self.assertEqual(dec_spi, spi) class Test_SMS_3DES(unittest.TestCase): tar = h2b('b00000') + apdu = h2b('00a40000023f00') """Test the OtaDialectSms for 3DES algorithms.""" def __init__(self, foo, **kwargs): super().__init__(foo, **kwargs) @@ -134,21 +139,26 @@ spi = self.spi_base spi['ciphering'] = True spi['rc_cc_ds'] = 'no_rc_cc_ds' - r = self.dialect.encode_cmd(self.od, self.tar, spi, h2b('00a40000023f00')) + r = self.dialect.encode_cmd(self.od, self.tar, spi, self.apdu) self.assertEqual(b2h(r), '00180d04193535b00000e3ec80a849b554421276af3883927c20') + # also test decoder + dec_tar, dec_spi, dec_apdu = self.dialect.decode_cmd(self.od, r) + self.assertEqual(b2h(self.apdu), b2h(dec_apdu)) + self.assertEqual(b2h(dec_tar), b2h(self.tar)) + self.assertEqual(dec_spi, spi) def test_cmd_3des_signed(self): spi = self.spi_base spi['ciphering'] = False spi['rc_cc_ds'] = 'cc' - r = self.dialect.encode_cmd(self.od, self.tar, spi, h2b('00a40000023f00')) + r = self.dialect.encode_cmd(self.od, self.tar, spi, self.apdu) self.assertEqual(b2h(r), '1502193535b00000000000000000072ea17bdb72060e00a40000023f00') def test_cmd_3des_none(self): spi = self.spi_base spi['ciphering'] = False spi['rc_cc_ds'] = 'no_rc_cc_ds' - r = self.dialect.encode_cmd(self.od, self.tar, spi, h2b('00a40000023f00')) + r = self.dialect.encode_cmd(self.od, self.tar, spi, self.apdu) self.assertEqual(b2h(r), '0d00193535b0000000000000000000a40000023f00') @@ -273,6 +283,12 @@ #print("tpdu: %s" % b2h(tpdu.to_bytes())) self.assertEqual(b2h(tpdu.to_bytes()), t['request']['encoded_tpdu']) + # also test decoder + dec_tar, dec_spi, dec_apdu = self.dialect.decode_cmd(kset, outp) + self.assertEqual(b2h(t['request']['apdu']), b2h(dec_apdu)) + self.assertEqual(b2h(dec_tar), b2h(self.tar)) + self.assertEqual(dec_spi, t['spi']) + def test_decode_resp(self): for t in SmsOtaTestCase.testdatasets: with self.subTest(name=t['name']): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37141?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: Id666cea8a91a854209f3c19c1f09b512bb493c85 Gerrit-Change-Number: 37141 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: osmo-smdpp: use NIST-P256 by default
by laforge 09 Jun '24

09 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37143?usp=email ) Change subject: osmo-smdpp: use NIST-P256 by default ...................................................................... osmo-smdpp: use NIST-P256 by default The eSIM specs allow for both brainpool and nist; in reality the deployments use the NIST P256 curve. osmo-smdpp currently only supports a single certificate; let's use the NIST one by default. Change-Id: Idc7809f320505279c8a75e9b667be0a2af802f6b --- M osmo-smdpp.py 1 file changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/43/37143/1 diff --git a/osmo-smdpp.py b/osmo-smdpp.py index 9551396..6c275ac 100755 --- a/osmo-smdpp.py +++ b/osmo-smdpp.py @@ -559,7 +559,7 @@ args = parser.parse_args() - hs = SmDppHttpServer(HOSTNAME, os.path.join(DATA_DIR, 'certs', 'CertificateIssuer'), use_brainpool=True) + hs = SmDppHttpServer(HOSTNAME, os.path.join(DATA_DIR, 'certs', 'CertificateIssuer'), use_brainpool=False) #hs.app.run(endpoint_description="ssl:port=8000:dhParameters=dh_param_2048.pem") hs.app.run("localhost", 8000) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37143?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: Idc7809f320505279c8a75e9b667be0a2af802f6b Gerrit-Change-Number: 37143 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim.cat: Add more alredy-defined IEs to ProactiveCmd classes
by laforge 09 Jun '24

09 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37138?usp=email ) Change subject: pySim.cat: Add more alredy-defined IEs to ProactiveCmd classes ...................................................................... pySim.cat: Add more alredy-defined IEs to ProactiveCmd classes ... also add some spec references Change-Id: If071abdc61c7c881bdea5292d12c74a1024f6784 --- M pySim/cat.py 1 file changed, 33 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/38/37138/1 diff --git a/pySim/cat.py b/pySim/cat.py index bfd22b4..21a3cc8 100644 --- a/pySim/cat.py +++ b/pySim/cat.py @@ -482,7 +482,7 @@ # TS 31.111 Section 8.56 class ChannelStatus(COMPR_TLV_IE, tag = 0xB8): # complex decoding, depends on out-of-band context/knowledge :( - pass + _construct = HexAdapter(GreedyBytes) # TS 102 223 Section 8.58 class OtherAddress(COMPR_TLV_IE, tag = 0xBE): @@ -849,6 +849,7 @@ # TS 102 223 7.5.8 LanguageSelectionEvent # TS 102 223 7.5.9 BrowserTerminationEvent # TS 102 223 7.5.10 DataAvailableEvent + ChannelStatus, ChannelDataLength, # TS 102 223 7.5.11 ChannelStatusEvent # TS 102 223 7.5.12 AccessTechnologyChangeEvent # TS 102 223 7.5.13 DisplayParametersChangedEvent @@ -925,20 +926,24 @@ ApplicationSpecificRefreshData, PlmnWactList, PlmnList]): pass +# TS 102 223 Section 6.6.4 class MoreTime(ProactiveCmd, tag=0x02, - nested=[CommandDetails]): + nested=[CommandDetails, DeviceIdentities]): pass +# TS 102 223 Section 6.6.5 class PollInterval(ProactiveCmd, tag=0x03, - nested=[CommandDetails]): + nested=[CommandDetails, DeviceIdentities, Duration]): pass +# TS 102 223 Section 6.6.14 class PollingOff(ProactiveCmd, tag=0x04, - nested=[CommandDetails]): + nested=[CommandDetails, DeviceIdentities]): pass +# TS 102 223 Section 6.6.16 class SetUpEventList(ProactiveCmd, tag=0x05, - nested=[CommandDetails]): + nested=[CommandDetails, DeviceIdentities, EventList]): pass # TS 31.111 Section 6.6.12 @@ -966,20 +971,27 @@ SMS_TPDU, IconIdentifier, TextAttribute, FrameIdentifier]): pass +# TS 102 223 6.6.24 class SendDTMF(ProactiveCmd, tag=0x14, - nested=[CommandDetails]): + nested=[CommandDetails, DeviceIdentities, AlphaIdentifier, + DtmfString, IconIdentifier, TextAttribute, FrameIdentifier]): pass +# TS 102 223 6.6.26 class LaunchBrowser(ProactiveCmd, tag=0x15, - nested=[CommandDetails]): + nested=[CommandDetails, DeviceIdentities, BrowserIdentity, Url, Bearer, ProvisioningFileReference, + TextString, AlphaIdentifer, IconIdentifier, TextAttribute, FrameIdentifier, + NetworkAccessName]): pass class GeographicalLocationRequest(ProactiveCmd, tag=0x16, nested=[CommandDetails]): pass +# TS 102 223 6.6.5 class PlayTone(ProactiveCmd, tag=0x20, - nested=[CommandDetails]): + nested=[CommandDetails, DeviceIdentities, AlphaIdentifier, + Tone, Duration, IconIdentifier, TextAttribute, FrameIdentifier]): pass # TS 101 220 Table 7.17 + 102 223 6.6.1/9.4 CMD=0x21 @@ -1215,6 +1227,8 @@ nested=[CommandDetails, DeviceIdentities, Result, Duration, TextString, ItemIdentifier, #TODO: LocalInformation and other optional/conditional IEs + ChannelData, ChannelDataLength, + ChannelStatus, BufferSize, BearerDescription, ]): pass -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37138?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: If071abdc61c7c881bdea5292d12c74a1024f6784 Gerrit-Change-Number: 37138 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim/ota: Don't modify input argument in OtaDialectSms.encode_cmd
by laforge 09 Jun '24

09 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37139?usp=email ) Change subject: pySim/ota: Don't modify input argument in OtaDialectSms.encode_cmd ...................................................................... pySim/ota: Don't modify input argument in OtaDialectSms.encode_cmd Change-Id: I4c4c44002762696b931ed3580ffe54daf62ffa61 --- M pySim/ota.py 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/39/37139/1 diff --git a/pySim/ota.py b/pySim/ota.py index 10de611..54e8f75 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -332,6 +332,7 @@ len_cipher = 6 + len_sig + len(apdu) padding = otak.crypt._get_padding(len_cipher, otak.crypt.blocksize) pad_cnt = len(padding) + apdu = bytes(apdu) # make a copy so we don't modify the input data apdu += padding kic = {'key': otak.kic_idx, 'algo': otak.algo_crypt} -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37139?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: I4c4c44002762696b931ed3580ffe54daf62ffa61 Gerrit-Change-Number: 37139 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim.ota.OtaDialectSMS: Move SMS header construct ip to class level
by laforge 09 Jun '24

09 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37140?usp=email ) Change subject: pySim.ota.OtaDialectSMS: Move SMS header construct ip to class level ...................................................................... pySim.ota.OtaDialectSMS: Move SMS header construct ip to class level this way we can use it in other [future] methods. Change-Id: If296f823c18864fddcfb9cb1b82a087bac8875d4 --- M pySim/ota.py 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/40/37140/1 diff --git a/pySim/ota.py b/pySim/ota.py index 54e8f75..d77a64e 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -322,6 +322,7 @@ 'response_status'/ResponseStatus, 'cc_rc'/Bytes(this.rhl-10), 'secured_data'/GreedyBytes) + hdr_construct = Struct('chl'/Int8ub, 'spi'/SPI, 'kic'/KIC, 'kid'/KID_CC, 'tar'/Bytes(3)) def encode_cmd(self, otak: OtaKeyset, tar: bytes, spi: dict, apdu: bytes) -> bytes: # length of signature in octets @@ -343,8 +344,7 @@ chl = 13 + len_sig # CHL + SPI (+ KIC + KID) - c = Struct('chl'/Int8ub, 'spi'/SPI, 'kic'/KIC, 'kid'/KID_CC, 'tar'/Bytes(3)) - part_head = c.build({'chl': chl, 'spi':spi, 'kic':kic, 'kid':kid, 'tar':tar}) + part_head = self.hdr_construct.build({'chl': chl, 'spi':spi, 'kic':kic, 'kid':kid, 'tar':tar}) #print("part_head: %s" % b2h(part_head)) # CNTR + PCNTR (CNTR not used) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37140?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: If296f823c18864fddcfb9cb1b82a087bac8875d4 Gerrit-Change-Number: 37140 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • ...
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.