add unit tests for BER-TLV encoder/decoder functions
... and while at it resolve a bug in bertlv_parse_len() discovered by those new tests. Change-Id: I9f14dafab4f712c29224c4eb25cacab7885e2b68
This commit is contained in:
@@ -132,7 +132,7 @@ def bertlv_parse_len(binary:bytes) -> Tuple[int, bytes]:
|
||||
for i in range(1, 1+num_len_oct):
|
||||
length <<= 8
|
||||
length |= binary[i]
|
||||
return (length, binary[num_len_oct:])
|
||||
return (length, binary[1+num_len_oct:])
|
||||
|
||||
def bertlv_encode_len(length:int) -> bytes:
|
||||
"""Encode a single Length value according to ITU-T X.690 8.1.3;
|
||||
|
||||
Reference in New Issue
Block a user