handle bad signature cases with a dialog box

This commit is contained in:
bunnie 2022-10-13 03:11:33 +08:00
parent cc996fce0b
commit db7d190270
2 changed files with 17 additions and 0 deletions

View file

@ -317,6 +317,12 @@
"zh": "取消",
"en-tts": "No"
},
"rootkeys.gwup.sig_problem": {
"en": "Invalid signature on update, aborting.",
"ja": "更新時の署名が無効です。中止します。",
"zh": "更新时签名无效,正在中止。",
"en-tts": "Invalid signature on update, aborting."
},
"rootkeys.gwup_starting": {
"en": "Updating gateware. This takes a few minutes.\nDo not reset or sleep!",
"ja": "ゲートウェアをアップデート中です。これには数分かかります。\nリセットやスリープはしないでください。",

View file

@ -884,6 +884,17 @@ fn main() -> ! {
SignatureResult::SelfSignOk => t!("rootkeys.gwup.viewinfo_ss", xous::LANG),
SignatureResult::ThirdPartyOk => t!("rootkeys.gwup.viewinfo_tp", xous::LANG),
SignatureResult::DevKeyOk => t!("rootkeys.gwup.viewinfo_dk", xous::LANG),
SignatureResult::MalformedSignature
| SignatureResult::InvalidPubKey
| SignatureResult::InvalidSignatureType
=> {
modals.dynamic_notification_close().expect("modals error");
modals.show_notification(t!("rootkeys.gwup.sig_problem", xous::LANG), None).expect("modals error");
if let Some(dr) = deferred_response.take() {
xous::return_scalar(dr, 0).unwrap();
}
continue;
}
_ => {
modals.dynamic_notification_close().expect("modals error");
modals.show_notification(t!("rootkeys.gwup.no_update_found", xous::LANG), None).expect("modals error");