mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
binctl: show fingerprint for BinImage (hash of header - signature)
This commit is contained in:
parent
2f719526e7
commit
44196be481
@ -50,6 +50,7 @@ class BinImage(object):
|
||||
assert self.reserved2 == 415 * b'\x00'
|
||||
self.code = data[self.hdrlen:]
|
||||
assert len(self.code) == self.codelen
|
||||
self.fingerprint = pyblake2.blake2s(data[:IMAGE_HEADER_SIZE - 65]).hexdigest()
|
||||
|
||||
def print(self):
|
||||
if self.magic == b'TRZF':
|
||||
@ -71,6 +72,7 @@ class BinImage(object):
|
||||
print(' * sigmask :', format_sigmask(self.sigmask))
|
||||
print(' * sig :', binascii.hexlify(self.sig).decode())
|
||||
print(' * total : %d bytes' % total_len)
|
||||
print(' * fngprnt :', self.fingerprint)
|
||||
print()
|
||||
|
||||
def compute_hashes(self):
|
||||
|
Loading…
Reference in New Issue
Block a user