mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-17 01:52:02 +00:00
tools: fix binctl script
This commit is contained in:
parent
0d7f486733
commit
c0220192d4
@ -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)
|
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_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_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_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);
|
display_text(55, 70, "Install firmware by", -1, FONT_NORMAL, COLOR_BLACK, COLOR_WHITE, 0);
|
||||||
|
@ -232,11 +232,8 @@ class VendorHeader(object):
|
|||||||
return header
|
return header
|
||||||
|
|
||||||
def sign(self, sigmask, signature):
|
def sign(self, sigmask, signature):
|
||||||
if sigmask >= (1 << self.vsig_n):
|
header = self.serialize_header(sig=False)
|
||||||
raise Exception('signature index is higher than vsig_n (%d)' % self.vsig_n)
|
assert len(header) == self.hdrlen
|
||||||
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
|
|
||||||
self.sigmask = sigmask
|
self.sigmask = sigmask
|
||||||
self.sig = signature
|
self.sig = signature
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user