1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 19:18:56 +00:00

tools: show fingerprint for vendorheaders too

This commit is contained in:
Pavol Rusnak 2018-01-30 16:38:19 +01:00
parent ec52ff882f
commit 36d034d83a
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -134,7 +134,7 @@ class BinImage(object):
return header
def fingerprint(self):
return pyblake2.blake2s(self.serialize_header(False)).hexdigest()
return pyblake2.blake2s(self.serialize_header(sig=False)).hexdigest()
def sign(self, sigmask, signature):
header = self.serialize_header(sig=False)
@ -222,6 +222,7 @@ class VendorHeader(object):
print(' * vimg : (%d bytes)' % len(self.vimg))
print(' * sigmask :', format_sigmask(self.sigmask))
print(' * sig :', binascii.hexlify(self.sig).decode())
print(' * fngprnt :', self.fingerprint())
print()
def serialize_header(self, sig=True):
@ -242,6 +243,9 @@ class VendorHeader(object):
assert len(header) == self.hdrlen
return header
def fingerprint(self):
return pyblake2.blake2s(self.serialize_header(sig=False)).hexdigest()
def sign(self, sigmask, signature):
header = self.serialize_header(sig=False)
assert len(header) == self.hdrlen