Attention is currently required from: dexter, laforge.
12 comments:
File pySim/ota.py:
Patch Set #2, Line 134: 'commands'/Prefixed(BerTlvLen, ExpandedCmdItems))
We don't need such a definition for the indefinite length coding as well? […]
Done
Patch Set #2, 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
Patch Set #2, 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
Patch Set #2, 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
Patch Set #2, 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
Patch Set #2, Line 198: raise ValueError('expected indefinite-length template tag 0x%02x' % tag)
I would strongly recommend to split this into two distinct checks. […]
Done
Patch Set #2, 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
Patch Set #2, 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
Patch Set #2, 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:
Patch Set #2, Line 470: 'ae80220700a4000c023f00220700a4000c022fe2220500b000000a0000')
maybe add a testcase like this one, but with one byte chopped off at the end? (See my other comment)
Done
Patch Set #2, Line 486: 'af8023029000230290002' '30c988812010000408608149000' '0000'))
Looks like you have chopped the string wrongly. […]
Done
Patch Set #2, Line 498: 'c00401408510c00403018810c00402018810c004010188109000' '0000')
maybe separate the 'af80'? You also have the end marker separate.
Done
To view, visit change 43546. To unsubscribe, or for help writing mail filters, visit settings.