Attention is currently required from: dexter, laforge. Hoernchen has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43546?usp=email )
Change subject: ota: indefinite length en/decoding support ...................................................................... Patch Set 3: (12 comments) File pySim/ota.py: https://gerrit.osmocom.org/c/pysim/+/43546/comment/569c712b_18068c96?usp=email : PS2, Line 134: 'commands'/Prefixed(BerTlvLen, ExpandedCmdItems)) > We don't need such a definition for the indefinite length coding as well? […] Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/4d9feb83_ae74fdb6?usp=email : PS2, Line 169: # - starts with the "Number of executed command TLV objects" (table 5.10/5.13/5.15) > I would recommend to put a spec ref on top of this: […] Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/0342fc86_699af2d5?usp=email : PS2, Line 172: ExpandedRemoteResp = Struct('_tag'/Const(b'\xab'), > 0xAB is the tag for definite length coding. For indefinite length coding the > tag is 0xAF. […] Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/388e061b_cb69d183?usp=email : PS2, Line 185: """Parse the definite BER-TLV len, return (length_value, number_of_length_octets) """ > maybe you can use bertlv_parse_len() from pyosmocom here? However, it returns > the length value and t […] Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/99034494_a36fce53?usp=email : PS2, Line 196: "<tag> 80 <content> 00 00" """ > maybe add a hint like "(works for commands and response)" It was first > wondering a bit why you put t […] Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/ee053f00_fd94e956?usp=email : PS2, Line 198: raise ValueError('expected indefinite-length template tag 0x%02x' % tag) > I would strongly recommend to split this into two distinct checks. […] Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/69915d1f_63d84c83?usp=email : PS2, Line 204: if data[off:off+2] != b'\x00\x00': > Is this safe? What if you get a string where everything is valid but the last > byte is chopped off fo […] Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/57a636d5_6c09a840?usp=email : PS2, Line 207: length, len_octets = _read_ber_tlv_len(data, off + 1) > As it seems you are not only interested in the octets, you are also putting > much effort into verifyi […] Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/21c4cc56_8313b8a2?usp=email : PS2, Line 232: return b'\xae\x80' + ExpandedCmdItems.build(commands) + b'\x00\x00' > Ah, now I see why there is no explicit struct for the indefinite command > scripting template. […] It was my first try and old code from july, this reworked patch now uses construct. File tests/unittests/test_ota.py: https://gerrit.osmocom.org/c/pysim/+/43546/comment/72424fde_6250fc8b?usp=email : PS2, Line 470: 'ae80220700a4000c023f00220700a4000c022fe2220500b000000a0000') > maybe add a testcase like this one, but with one byte chopped off at the end? > (See my other comment) Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/4f5f7d98_e91ac4ab?usp=email : PS2, Line 486: 'af8023029000230290002' '30c988812010000408608149000' '0000')) > Looks like you have chopped the string wrongly. […] Done https://gerrit.osmocom.org/c/pysim/+/43546/comment/9f48c29a_27032d29?usp=email : PS2, Line 498: 'c00401408510c00403018810c00402018810c004010188109000' '0000') > maybe separate the 'af80'? You also have the end marker separate. Done -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43546?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I4e023112e98729489ed443eec3ed5ab45c773b17 Gerrit-Change-Number: 43546 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen <[email protected]> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <[email protected]> Gerrit-Reviewer: laforge <[email protected]> Gerrit-Attention: laforge <[email protected]> Gerrit-Attention: dexter <[email protected]> Gerrit-Comment-Date: Wed, 23 Sep 2026 16:09:22 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: dexter <[email protected]>
