Skip to content

Commit

Permalink
fixup! feat(core/bootloader): only allow confirm-less firmware instal…
Browse files Browse the repository at this point in the history
…lation for full-trust images
  • Loading branch information
TychoVrahe committed Aug 29, 2024
1 parent dca328c commit 1148b43
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions core/embed/bootloader/messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,20 +673,19 @@ int process_msg_FirmwareUpload(uint8_t iface_num, uint32_t msg_size,
#endif

uint32_t response = INPUT_CANCEL;
if (((vhdr.vtrust & VTRUST_ALL) == VTRUST_ALL) &&
if (((vhdr.vtrust & VTRUST_NO_WARNING) == VTRUST_NO_WARNING) &&
(sectrue == is_new || sectrue == is_ilu)) {
// new installation or interaction less updated - auto confirm
// only allowed for full-trust images
response = INPUT_CONFIRM;
} else {
if (!is_new) {
int version_cmp = version_compare(hdr.version, current_hdr->version);
response = ui_screen_install_confirm(
&vhdr, &hdr, should_keep_seed, is_newvendor, is_new, version_cmp);
} else {
response = ui_screen_install_confirm(&vhdr, &hdr, true, is_newvendor,
is_new, 0);
}
int version_cmp =
(sectrue == is_new)
? 0
: version_compare(hdr.version, current_hdr->version);
response =
ui_screen_install_confirm(&vhdr, &hdr, should_keep_seed | is_new,
is_newvendor, is_new, version_cmp);
}

if (INPUT_CANCEL == response) {
Expand Down

0 comments on commit 1148b43

Please sign in to comment.