delete persistent keys on reset if theyre set

This commit is contained in:
Conor Patrick
2020-08-30 22:42:29 -07:00
committed by Nicolas Stalder
parent 866e9c22c0
commit f3e1b5a44b
+6
View File
@@ -234,6 +234,12 @@ impl PersistentState {
}
pub fn reset<S: Syscall>(&mut self, crypto: &mut CryptoClient<S>) -> Result<()> {
if let Some(key) = self.key_encryption_key {
syscall!(crypto.delete(key));
}
if let Some(key) = self.key_wrapping_key {
syscall!(crypto.delete(key));
}
self.key_encryption_key = None;
self.key_wrapping_key = None;
self.consecutive_pin_mismatches = 0;