Access TLV.length directly.

This commit is contained in:
Markus Birth 2018-10-18 00:56:13 +02:00
parent 121522ced7
commit 81e69b8bea
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 2 additions and 5 deletions

View File

@ -35,7 +35,7 @@ class Gcd:
if tlv.type_id == 0xFFFF:
# End of file reached
break
tlength = tlv.get_length()
tlength = tlv.length
payload = f.read(tlength)
tlv.set_value(payload)
if tlv.type_id == 0x0006:
@ -57,5 +57,5 @@ class Gcd:
print("#{:03d}: {}".format(i, tlv))
else:
tlv_count += 1
tlv_length += tlv.get_length()
tlv_length += tlv.length
last_tlv = tlv.type_id

View File

@ -51,9 +51,6 @@ class TLV:
def set_value(self, new_value: bytes):
self.value = new_value
def get_length(self):
return self.length
def get_actual_length(self):
if self.value is None:
return 0