diff --git a/rust-app/src/implementation.rs b/rust-app/src/implementation.rs index e832d8e..32564d1 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(); 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",