mirror of
https://github.com/trussed-dev/piv-authenticator.git
synced 2026-06-20 04:16:15 -07:00
Fix reset
- Delete pins - Verify that the user pin is locked - Reset loaded state Fix #26
This commit is contained in:
@@ -200,12 +200,17 @@ where
|
||||
|
||||
YubicoPivExtension::Reset => {
|
||||
let this = self.load()?;
|
||||
if this.state.persistent.remaining_pin_retries(this.trussed) == 0 {
|
||||
return Err(Status::ConditionsOfUseNotSatisfied);
|
||||
}
|
||||
|
||||
// TODO: find out what all needs resetting :)
|
||||
for location in [Location::Volatile, Location::External, Location::Internal] {
|
||||
try_syscall!(this.trussed.delete_all(location)).ok();
|
||||
try_syscall!(this.trussed.remove_dir_all(location, PathBuf::new())).ok();
|
||||
}
|
||||
try_syscall!(this.trussed.delete_all_pins()).ok();
|
||||
self.state.persistent = None;
|
||||
}
|
||||
|
||||
YubicoPivExtension::SetManagementKey(touch_policy) => {
|
||||
|
||||
Reference in New Issue
Block a user