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

tools: fix binctl script

This commit is contained in:
Pavol Rusnak 2018-01-26 15:23:40 +01:00
parent 0d7f486733
commit c0220192d4
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 3 additions and 6 deletions

View File

@ -182,7 +182,7 @@ void ui_screen_install_confirm_upgrade(const vendor_header * const vhdr, const i
void ui_screen_install_confirm_newvendor(const vendor_header * const vhdr, const image_header * const hdr)
{
display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_WHITE);
display_text(16, 32, "Re-install firmware", -1, FONT_NORMAL, COLOR_BLACK, COLOR_WHITE, 0);
display_text(16, 32, "Vendor change", -1, FONT_NORMAL, COLOR_BLACK, COLOR_WHITE, 0);
display_bar(16, 44, DISPLAY_RESX - 14 * 2, 1, COLOR_BLACK);
display_icon(16, 54, 32, 32, toi_icon_info + 12, sizeof(toi_icon_info) - 12, COLOR_BLACK, COLOR_WHITE);
display_text(55, 70, "Install firmware by", -1, FONT_NORMAL, COLOR_BLACK, COLOR_WHITE, 0);

View File

@ -232,11 +232,8 @@ class VendorHeader(object):
return header
def sign(self, sigmask, signature):
if sigmask >= (1 << self.vsig_n):
raise Exception('signature index is higher than vsig_n (%d)' % self.vsig_n)
if bin(sigmask).count('1') != self.vsig_m:
raise Exception('invalid number of indexes (vsig_m expected %d, got %d)' % (self.vsig_m, bin(sigmask).count('1')))
# sign
header = self.serialize_header(sig=False)
assert len(header) == self.hdrlen
self.sigmask = sigmask
self.sig = signature