From 34e5e5817c2a7776754c7ad6d2f7edf85982c028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Mon, 15 May 2023 11:56:32 +0200 Subject: [PATCH] Set pin length after a RESET RETRY COUNTER call --- src/state.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/state.rs b/src/state.rs index aa8b344..77b3379 100644 --- a/src/state.rs +++ b/src/state.rs @@ -381,6 +381,8 @@ impl<'a> LoadedState<'a> { let user_key = self.get_user_key(client, storage)?; let new_pin = Bytes::from_slice(new_value).map_err(|_| Error::InvalidPin)?; syscall!(client.set_pin_with_key(Password::Pw1, new_pin, Some(3), user_key)); + self.persistent + .set_pin_len(client, storage, new_value.len(), Password::Pw1)?; syscall!(client.delete(user_key)); Ok(()) } @@ -395,6 +397,8 @@ impl<'a> LoadedState<'a> { let user_key = self.get_user_key_from_rc(client, storage, rc_key)?; let new_pin = Bytes::from_slice(new_value).map_err(|_| Error::InvalidPin)?; syscall!(client.set_pin_with_key(Password::Pw1, new_pin, Some(3), user_key)); + self.persistent + .set_pin_len(client, storage, new_value.len(), Password::Pw1)?; syscall!(client.delete(user_key)); Ok(()) }