From 34a1a331659e8efd89fb72079b3fb152ceff8149 Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 8 May 2025 16:01:46 +0800 Subject: [PATCH] fix off-by-one arg error on Dna routine this is a common api problem because yes, while arg1 is strictly the second item, previously arg0 was hidden and in the argument list arg1 took the first place not the second. so i make this mistake a lot... --- services/keystore/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/keystore/src/lib.rs b/services/keystore/src/lib.rs index d64b9c2cc..fdf2d5aac 100644 --- a/services/keystore/src/lib.rs +++ b/services/keystore/src/lib.rs @@ -46,7 +46,7 @@ impl Keystore { Message::new_blocking_scalar(Opcode::GetDna.to_usize().unwrap(), 0, 0, 0, 0), ) .unwrap(); - if let xous::Result::Scalar5(val1, val2, _, _, _) = response { + if let xous::Result::Scalar5(_, val1, val2, _, _) = response { (val1 as u64) | ((val2 as u64) << 32) } else { panic!("get_dna() failed with internal error"); @@ -71,7 +71,10 @@ impl Keystore { self.conn, Message::new_blocking_scalar(Opcode::EnsurePassword.to_usize().unwrap(), 0, 0, 0, 0), ) { - Ok(xous::Result::Scalar5(arg1, arg2, arg3, _arg4, _arg5)) => (arg1, arg2, arg3).into(), + Ok(xous::Result::Scalar5(_arg0, arg1, arg2, arg3, _arg4)) => { + log::info!("got {:x}, {:x}, {:x}", arg1, arg2, arg3); + (arg1, arg2, arg3).into() + } _ => panic!("ensure_password() failed with internal error"), } }