1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

tools: small refactor in keyctl

This commit is contained in:
Pavol Rusnak 2018-01-29 08:09:02 +01:00
parent 754cf3672d
commit 03943c960b
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -32,9 +32,8 @@ def header_to_sign(index, data):
elif index == 1: # vendorheader
return data[:-65] + z
elif index == 2: # firmware
vlen = struct.unpack('<I', data[4:8])
vlen = vlen[0]
return data[vlen:vlen + 0x03BF] + z
vhdrlen = struct.unpack('<I', data[4:8])[0]
return data[vhdrlen:vhdrlen + 0x03BF] + z
@click.group()