mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-14 09:20:55 +00:00
python/firmware: shorten names for vendor header fields
This commit is contained in:
parent
3fc3231254
commit
b26a430b85
@ -44,7 +44,7 @@ def validate_firmware(version, fw, expected_fingerprint=None):
|
|||||||
_print_version(fw.header.version)
|
_print_version(fw.header.version)
|
||||||
elif version == firmware.FirmwareFormat.TREZOR_T:
|
elif version == firmware.FirmwareFormat.TREZOR_T:
|
||||||
click.echo("Trezor T firmware image.")
|
click.echo("Trezor T firmware image.")
|
||||||
vendor = fw.vendor_header.vendor_string
|
vendor = fw.vendor_header.text
|
||||||
vendor_version = "{major}.{minor}".format(**fw.vendor_header.version)
|
vendor_version = "{major}.{minor}".format(**fw.vendor_header.version)
|
||||||
click.echo("Vendor header from {}, version {}".format(vendor, vendor_version))
|
click.echo("Vendor header from {}, version {}".format(vendor, vendor_version))
|
||||||
_print_version(fw.image.header.version)
|
_print_version(fw.image.header.version)
|
||||||
|
@ -152,13 +152,13 @@ VendorHeader = c.Struct(
|
|||||||
"major" / c.Int8ul,
|
"major" / c.Int8ul,
|
||||||
"minor" / c.Int8ul,
|
"minor" / c.Int8ul,
|
||||||
),
|
),
|
||||||
"vendor_sigs_required" / c.Int8ul,
|
"sig_m" / c.Int8ul,
|
||||||
"vendor_sigs_n" / c.Rebuild(c.Int8ul, c.len_(c.this.pubkeys)),
|
"sig_n" / c.Rebuild(c.Int8ul, c.len_(c.this.pubkeys)),
|
||||||
"vendor_trust" / VendorTrust,
|
"trust" / VendorTrust,
|
||||||
"_reserved" / c.Padding(14),
|
"_reserved" / c.Padding(14),
|
||||||
"pubkeys" / c.Bytes(32)[c.this.vendor_sigs_n],
|
"pubkeys" / c.Bytes(32)[c.this.sig_n],
|
||||||
"vendor_string" / c.Aligned(4, c.PascalString(c.Int8ul, "utf-8")),
|
"text" / c.Aligned(4, c.PascalString(c.Int8ul, "utf-8")),
|
||||||
"vendor_image" / Toif,
|
"image" / Toif,
|
||||||
"_data_end_offset" / c.Tell,
|
"_data_end_offset" / c.Tell,
|
||||||
|
|
||||||
c.Padding(-(c.this._data_end_offset + 65) % 512),
|
c.Padding(-(c.this._data_end_offset + 65) % 512),
|
||||||
@ -446,7 +446,7 @@ def validate_v2(fw: c.Container, skip_vendor_header: bool = False) -> None:
|
|||||||
cosi.verify(
|
cosi.verify(
|
||||||
fw.image.header.signature,
|
fw.image.header.signature,
|
||||||
fingerprint,
|
fingerprint,
|
||||||
fw.vendor_header.vendor_sigs_required,
|
fw.vendor_header.sig_m,
|
||||||
fw.vendor_header.pubkeys,
|
fw.vendor_header.pubkeys,
|
||||||
fw.image.header.sigmask,
|
fw.image.header.sigmask,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user