From 0a7b79c8d4ed95af682aa683ac8471a1ec3c1146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thoralf=20M=C3=BCller?= Date: Wed, 4 Sep 2024 17:27:27 +0200 Subject: [PATCH 1/2] Revert "fix!: don't display sender address as it would crash the app" This reverts commit 2d801488c28526973790f3a57d7763eb87ea5e07. --- rust-app/src/implementation.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/rust-app/src/implementation.rs b/rust-app/src/implementation.rs index 6ceeed0..09119f8 100644 --- a/rust-app/src/implementation.rs +++ b/rust-app/src/implementation.rs @@ -716,6 +716,27 @@ pub async fn sign_apdu(io: HostIO, settings: Settings) { if scroller("Transfer", |w| Ok(write!(w, "IOTA")?)).is_none() { reject::<()>(StatusWords::UserCancelled as u16).await; }; + { + let mut bs = input[1].clone(); + NoinlineFut(async move { + let path = BIP_PATH_PARSER.parse(&mut bs).await; + if !is_bip_prefix_valid(&path) { + reject::<()>(SyscallError::InvalidParameter as u16).await; + } + if with_public_keys(&path, true, |_, address: &IotaPubKeyAddress| { + try_option(|| -> Option<()> { + scroller_paginated("From", |w| Ok(write!(w, "{address}")?))?; + Some(()) + }()) + }) + .ok() + .is_none() + { + reject::<()>(StatusWords::UserCancelled as u16).await; + } + }) + .await + }; { let mut txn = input[0].clone(); From 59773899c949a08b6a42f3347a717e396f84f95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thoralf=20M=C3=BCller?= Date: Thu, 5 Sep 2024 08:56:45 +0200 Subject: [PATCH 2/2] Update test --- ts-tests/signing-tests.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ts-tests/signing-tests.ts b/ts-tests/signing-tests.ts index 776b33b..80f9bab 100644 --- a/ts-tests/signing-tests.ts +++ b/ts-tests/signing-tests.ts @@ -46,6 +46,11 @@ describe("Signing tests", function () { "header": "Transfer", "prompt": "", }, + { + "header": "From", + "prompt": "0x1b3669e321893ee49c387a08fc251dbfff37cd2a981e6c473a5b2afde19d363e", + "paginate": true + }, { "header": "To", "prompt": "0x4f2370b2a4810ad6c8e1cfd92cc8c8818fef8f59e3a80cea17871f78d850ba4b",