Add reset_user_pin() fn for Open and for Admin, as well as set_resetting_code() to Admin.

This commit is contained in:
Heiko Schaefer 2021-10-26 21:56:22 +02:00
parent 2c0c19502f
commit 3407cd3a39

View file

@ -113,6 +113,15 @@ impl Open {
self.card_app.change_pw1(old, new)
}
pub fn reset_user_pin(
&mut self,
rst: &str,
new: &str,
) -> Result<Response, Error> {
self.card_app
.reset_retry_counter_pw1(new.into(), Some(rst.into()))
}
pub fn change_admin_pin(
&mut self,
old: &str,
@ -364,6 +373,17 @@ impl Admin<'_> {
}
}
pub fn set_resetting_code(
&mut self,
pin: &str,
) -> Result<Response, Error> {
self.oc.card_app.set_resetting_code(pin.into())
}
pub fn reset_user_pin(&mut self, new: &str) -> Result<Response, Error> {
self.oc.card_app.reset_retry_counter_pw1(new.into(), None)
}
/// Upload a ValidErasedKeyAmalgamation to the card as a specific KeyType.
///
/// (The caller needs to make sure that `vka` is suitable as `key_type`)