blob: f25233fdcbac193cca3078d3970c05f8590371ae [file] [log] [blame]
Hasini Gunasingheda895552021-01-27 19:34:37 +00001// Copyright 2021, The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Janis Danisevskis34a0cf22021-03-08 09:19:03 -080015//! This module implements IKeystoreMaintenance AIDL interface.
Hasini Gunasingheda895552021-01-27 19:34:37 +000016
Janis Danisevskiscdcf4e52021-04-14 15:44:36 -070017use crate::database::{KeyEntryLoadBits, KeyType, MonotonicRawTime};
Satya Tangirala5b9e5b12021-03-09 12:54:21 -080018use crate::error::map_km_error;
Janis Danisevskiscdcf4e52021-04-14 15:44:36 -070019use crate::error::map_or_log_err;
20use crate::error::Error;
Satya Tangirala5b9e5b12021-03-09 12:54:21 -080021use crate::globals::get_keymint_device;
Janis Danisevskis0ffb8a82022-02-06 22:37:21 -080022use crate::globals::{DB, LEGACY_IMPORTER, SUPER_KEY};
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +000023use crate::ks_err;
Janis Danisevskiscdcf4e52021-04-14 15:44:36 -070024use crate::permission::{KeyPerm, KeystorePerm};
Janis Danisevskis0fd25a62022-01-04 19:53:37 -080025use crate::super_key::{SuperKeyManager, UserState};
John Wu16db29e2022-01-13 15:21:43 -080026use crate::utils::{
John Wu889c1cc2022-03-14 16:02:56 -070027 check_key_permission, check_keystore_permission, uid_to_android_user, watchdog as wd,
John Wu16db29e2022-01-13 15:21:43 -080028};
Paul Crowley46c703e2021-08-06 15:13:53 -070029use android_hardware_security_keymint::aidl::android::hardware::security::keymint::{
30 IKeyMintDevice::IKeyMintDevice, SecurityLevel::SecurityLevel,
31};
Eric Biggers2f9498a2023-10-09 23:16:05 +000032use android_security_maintenance::aidl::android::security::maintenance::IKeystoreMaintenance::{
33 BnKeystoreMaintenance, IKeystoreMaintenance,
Hasini Gunasingheda895552021-01-27 19:34:37 +000034};
Andrew Walbrande45c8b2021-04-13 14:42:38 +000035use android_security_maintenance::binder::{
36 BinderFeatures, Interface, Result as BinderResult, Strong, ThreadState,
37};
Janis Danisevskis5898d152021-06-15 08:23:46 -070038use android_system_keystore2::aidl::android::system::keystore2::KeyDescriptor::KeyDescriptor;
Hasini Gunasingheda895552021-01-27 19:34:37 +000039use android_system_keystore2::aidl::android::system::keystore2::ResponseCode::ResponseCode;
40use anyhow::{Context, Result};
Paul Crowleyf61fee72021-03-17 14:38:44 -070041use keystore2_crypto::Password;
Hasini Gunasingheda895552021-01-27 19:34:37 +000042
Janis Danisevskis5898d152021-06-15 08:23:46 -070043/// Reexport Domain for the benefit of DeleteListener
44pub use android_system_keystore2::aidl::android::system::keystore2::Domain::Domain;
45
46/// The Maintenance module takes a delete listener argument which observes user and namespace
47/// deletion events.
48pub trait DeleteListener {
49 /// Called by the maintenance module when an app/namespace is deleted.
50 fn delete_namespace(&self, domain: Domain, namespace: i64) -> Result<()>;
51 /// Called by the maintenance module when a user is deleted.
52 fn delete_user(&self, user_id: u32) -> Result<()>;
53}
54
Hasini Gunasingheda895552021-01-27 19:34:37 +000055/// This struct is defined to implement the aforementioned AIDL interface.
Janis Danisevskis5898d152021-06-15 08:23:46 -070056pub struct Maintenance {
57 delete_listener: Box<dyn DeleteListener + Send + Sync + 'static>,
58}
Hasini Gunasingheda895552021-01-27 19:34:37 +000059
Janis Danisevskis34a0cf22021-03-08 09:19:03 -080060impl Maintenance {
Janis Danisevskis5898d152021-06-15 08:23:46 -070061 /// Create a new instance of Keystore Maintenance service.
62 pub fn new_native_binder(
63 delete_listener: Box<dyn DeleteListener + Send + Sync + 'static>,
64 ) -> Result<Strong<dyn IKeystoreMaintenance>> {
Andrew Walbrande45c8b2021-04-13 14:42:38 +000065 Ok(BnKeystoreMaintenance::new_binder(
Janis Danisevskis5898d152021-06-15 08:23:46 -070066 Self { delete_listener },
Andrew Walbrande45c8b2021-04-13 14:42:38 +000067 BinderFeatures { set_requesting_sid: true, ..BinderFeatures::default() },
68 ))
Hasini Gunasingheda895552021-01-27 19:34:37 +000069 }
70
Paul Crowleyf61fee72021-03-17 14:38:44 -070071 fn on_user_password_changed(user_id: i32, password: Option<Password>) -> Result<()> {
Janis Danisevskis0fd25a62022-01-04 19:53:37 -080072 // Check permission. Function should return if this failed. Therefore having '?' at the end
73 // is very important.
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +000074 check_keystore_permission(KeystorePerm::ChangePassword).context(ks_err!())?;
Hasini Gunasingheda895552021-01-27 19:34:37 +000075
Janis Danisevskis0fd25a62022-01-04 19:53:37 -080076 let mut skm = SUPER_KEY.write().unwrap();
77
Paul Crowley7a658392021-03-18 17:08:20 -070078 if let Some(pw) = password.as_ref() {
79 DB.with(|db| {
Janis Danisevskis0fd25a62022-01-04 19:53:37 -080080 skm.unlock_screen_lock_bound_key(&mut db.borrow_mut(), user_id as u32, pw)
Paul Crowley7a658392021-03-18 17:08:20 -070081 })
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +000082 .context(ks_err!("unlock_screen_lock_bound_key failed"))?;
Paul Crowley7a658392021-03-18 17:08:20 -070083 }
84
Nathan Huckleberry204a0442023-03-30 17:27:47 +000085 if let UserState::LskfLocked = DB
86 .with(|db| skm.get_user_state(&mut db.borrow_mut(), &LEGACY_IMPORTER, user_id as u32))
87 .context(ks_err!("Could not get user state while changing password!"))?
Hasini Gunasingheda895552021-01-27 19:34:37 +000088 {
Nathan Huckleberry204a0442023-03-30 17:27:47 +000089 // Error - password can not be changed when the device is locked
90 return Err(Error::Rc(ResponseCode::LOCKED)).context(ks_err!("Device is locked."));
Hasini Gunasingheda895552021-01-27 19:34:37 +000091 }
Nathan Huckleberry204a0442023-03-30 17:27:47 +000092
93 DB.with(|db| match password {
94 Some(pass) => {
95 skm.init_user(&mut db.borrow_mut(), &LEGACY_IMPORTER, user_id as u32, &pass)
96 }
97 None => {
98 // User transitioned to swipe.
99 skm.reset_user(&mut db.borrow_mut(), &LEGACY_IMPORTER, user_id as u32)
100 }
101 })
102 .context(ks_err!("Failed to change user password!"))
Hasini Gunasingheda895552021-01-27 19:34:37 +0000103 }
104
Janis Danisevskis5898d152021-06-15 08:23:46 -0700105 fn add_or_remove_user(&self, user_id: i32) -> Result<()> {
Hasini Gunasingheda895552021-01-27 19:34:37 +0000106 // Check permission. Function should return if this failed. Therefore having '?' at the end
107 // is very important.
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000108 check_keystore_permission(KeystorePerm::ChangeUser).context(ks_err!())?;
Janis Danisevskis0fd25a62022-01-04 19:53:37 -0800109
Janis Danisevskiseed69842021-02-18 20:04:10 -0800110 DB.with(|db| {
Nathan Huckleberry204a0442023-03-30 17:27:47 +0000111 SUPER_KEY.write().unwrap().remove_user(
Janis Danisevskiseed69842021-02-18 20:04:10 -0800112 &mut db.borrow_mut(),
Janis Danisevskis0ffb8a82022-02-06 22:37:21 -0800113 &LEGACY_IMPORTER,
Janis Danisevskiseed69842021-02-18 20:04:10 -0800114 user_id as u32,
Janis Danisevskiseed69842021-02-18 20:04:10 -0800115 )
116 })
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000117 .context(ks_err!("Trying to delete keys from db."))?;
Janis Danisevskis5898d152021-06-15 08:23:46 -0700118 self.delete_listener
119 .delete_user(user_id as u32)
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000120 .context(ks_err!("While invoking the delete listener."))
Hasini Gunasingheda895552021-01-27 19:34:37 +0000121 }
Janis Danisevskisddd6e752021-02-22 18:46:55 -0800122
Janis Danisevskis5898d152021-06-15 08:23:46 -0700123 fn clear_namespace(&self, domain: Domain, nspace: i64) -> Result<()> {
Janis Danisevskisddd6e752021-02-22 18:46:55 -0800124 // Permission check. Must return on error. Do not touch the '?'.
Janis Danisevskisa916d992021-10-19 15:46:09 -0700125 check_keystore_permission(KeystorePerm::ClearUID).context("In clear_namespace.")?;
Janis Danisevskisddd6e752021-02-22 18:46:55 -0800126
Janis Danisevskis0ffb8a82022-02-06 22:37:21 -0800127 LEGACY_IMPORTER
Janis Danisevskisddd6e752021-02-22 18:46:55 -0800128 .bulk_delete_uid(domain, nspace)
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000129 .context(ks_err!("Trying to delete legacy keys."))?;
Janis Danisevskisddd6e752021-02-22 18:46:55 -0800130 DB.with(|db| db.borrow_mut().unbind_keys_for_namespace(domain, nspace))
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000131 .context(ks_err!("Trying to delete keys from db."))?;
Janis Danisevskis5898d152021-06-15 08:23:46 -0700132 self.delete_listener
133 .delete_namespace(domain, nspace)
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000134 .context(ks_err!("While invoking the delete listener."))
Janis Danisevskisddd6e752021-02-22 18:46:55 -0800135 }
Hasini Gunasinghe9ee18412021-03-11 20:12:44 +0000136
Paul Crowley46c703e2021-08-06 15:13:53 -0700137 fn call_with_watchdog<F>(sec_level: SecurityLevel, name: &'static str, op: &F) -> Result<()>
138 where
Stephen Crane23cf7242022-01-19 17:49:46 +0000139 F: Fn(Strong<dyn IKeyMintDevice>) -> binder::Result<()>,
Paul Crowley46c703e2021-08-06 15:13:53 -0700140 {
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000141 let (km_dev, _, _) =
142 get_keymint_device(&sec_level).context(ks_err!("getting keymint device"))?;
Janis Danisevskis2ee014b2021-05-05 14:29:08 -0700143
Paul Crowley46c703e2021-08-06 15:13:53 -0700144 let _wp = wd::watch_millis_with("In call_with_watchdog", 500, move || {
145 format!("Seclevel: {:?} Op: {}", sec_level, name)
146 });
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000147 map_km_error(op(km_dev)).with_context(|| ks_err!("calling {}", name))?;
Satya Tangirala5b9e5b12021-03-09 12:54:21 -0800148 Ok(())
149 }
150
Paul Crowley46c703e2021-08-06 15:13:53 -0700151 fn call_on_all_security_levels<F>(name: &'static str, op: F) -> Result<()>
152 where
Stephen Crane23cf7242022-01-19 17:49:46 +0000153 F: Fn(Strong<dyn IKeyMintDevice>) -> binder::Result<()>,
Paul Crowley46c703e2021-08-06 15:13:53 -0700154 {
155 let sec_levels = [
156 (SecurityLevel::TRUSTED_ENVIRONMENT, "TRUSTED_ENVIRONMENT"),
157 (SecurityLevel::STRONGBOX, "STRONGBOX"),
158 ];
James Farrelld77b97f2023-08-15 20:03:38 +0000159 sec_levels.iter().try_fold((), |_result, (sec_level, sec_level_string)| {
Paul Crowley46c703e2021-08-06 15:13:53 -0700160 let curr_result = Maintenance::call_with_watchdog(*sec_level, name, &op);
161 match curr_result {
162 Ok(()) => log::info!(
163 "Call to {} succeeded for security level {}.",
164 name,
165 &sec_level_string
166 ),
167 Err(ref e) => log::error!(
168 "Call to {} failed for security level {}: {}.",
169 name,
170 &sec_level_string,
171 e
172 ),
173 }
James Farrelld77b97f2023-08-15 20:03:38 +0000174 curr_result
Paul Crowley46c703e2021-08-06 15:13:53 -0700175 })
176 }
177
Satya Tangirala5b9e5b12021-03-09 12:54:21 -0800178 fn early_boot_ended() -> Result<()> {
Janis Danisevskisa916d992021-10-19 15:46:09 -0700179 check_keystore_permission(KeystorePerm::EarlyBootEnded)
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000180 .context(ks_err!("Checking permission"))?;
Paul Crowley44c02da2021-04-08 17:04:43 +0000181 log::info!("In early_boot_ended.");
182
Janis Danisevskis0fd25a62022-01-04 19:53:37 -0800183 if let Err(e) =
184 DB.with(|db| SuperKeyManager::set_up_boot_level_cache(&SUPER_KEY, &mut db.borrow_mut()))
185 {
Paul Crowley44c02da2021-04-08 17:04:43 +0000186 log::error!("SUPER_KEY.set_up_boot_level_cache failed:\n{:?}\n:(", e);
187 }
Paul Crowley46c703e2021-08-06 15:13:53 -0700188 Maintenance::call_on_all_security_levels("earlyBootEnded", |dev| dev.earlyBootEnded())
Satya Tangirala5b9e5b12021-03-09 12:54:21 -0800189 }
190
Janis Danisevskis333b7c02021-03-23 18:57:41 -0700191 fn on_device_off_body() -> Result<()> {
192 // Security critical permission check. This statement must return on fail.
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000193 check_keystore_permission(KeystorePerm::ReportOffBody).context(ks_err!())?;
Janis Danisevskis333b7c02021-03-23 18:57:41 -0700194
Matthew Maurerd7815ca2021-05-06 21:58:45 -0700195 DB.with(|db| db.borrow_mut().update_last_off_body(MonotonicRawTime::now()));
196 Ok(())
Janis Danisevskis333b7c02021-03-23 18:57:41 -0700197 }
Janis Danisevskiscdcf4e52021-04-14 15:44:36 -0700198
199 fn migrate_key_namespace(source: &KeyDescriptor, destination: &KeyDescriptor) -> Result<()> {
John Wu889c1cc2022-03-14 16:02:56 -0700200 let calling_uid = ThreadState::get_calling_uid();
Janis Danisevskiscdcf4e52021-04-14 15:44:36 -0700201
John Wu889c1cc2022-03-14 16:02:56 -0700202 match source.domain {
203 Domain::SELINUX | Domain::KEY_ID | Domain::APP => (),
John Wu16db29e2022-01-13 15:21:43 -0800204 _ => {
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000205 return Err(Error::Rc(ResponseCode::INVALID_ARGUMENT))
206 .context(ks_err!("Source domain must be one of APP, SELINUX, or KEY_ID."));
John Wu16db29e2022-01-13 15:21:43 -0800207 }
208 };
Janis Danisevskiscdcf4e52021-04-14 15:44:36 -0700209
John Wu889c1cc2022-03-14 16:02:56 -0700210 match destination.domain {
211 Domain::SELINUX | Domain::APP => (),
John Wu16db29e2022-01-13 15:21:43 -0800212 _ => {
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000213 return Err(Error::Rc(ResponseCode::INVALID_ARGUMENT))
214 .context(ks_err!("Destination domain must be one of APP or SELINUX."));
John Wu16db29e2022-01-13 15:21:43 -0800215 }
216 };
217
John Wu889c1cc2022-03-14 16:02:56 -0700218 let user_id = uid_to_android_user(calling_uid);
Janis Danisevskisf84d0b02022-01-26 14:11:14 -0800219
220 let super_key = SUPER_KEY.read().unwrap().get_per_boot_key_by_user_id(user_id);
221
222 DB.with(|db| {
John Wu889c1cc2022-03-14 16:02:56 -0700223 let (key_id_guard, _) = LEGACY_IMPORTER
224 .with_try_import(source, calling_uid, super_key, || {
225 db.borrow_mut().load_key_entry(
226 source,
227 KeyType::Client,
228 KeyEntryLoadBits::NONE,
229 calling_uid,
230 |k, av| {
231 check_key_permission(KeyPerm::Use, k, &av)?;
232 check_key_permission(KeyPerm::Delete, k, &av)?;
233 check_key_permission(KeyPerm::Grant, k, &av)
234 },
235 )
Janis Danisevskisf84d0b02022-01-26 14:11:14 -0800236 })
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000237 .context(ks_err!("Failed to load key blob."))?;
John Wu889c1cc2022-03-14 16:02:56 -0700238 {
239 db.borrow_mut().migrate_key_namespace(key_id_guard, destination, calling_uid, |k| {
240 check_key_permission(KeyPerm::Rebind, k, &None)
241 })
Janis Danisevskisf84d0b02022-01-26 14:11:14 -0800242 }
Janis Danisevskiscdcf4e52021-04-14 15:44:36 -0700243 })
244 }
Paul Crowley46c703e2021-08-06 15:13:53 -0700245
246 fn delete_all_keys() -> Result<()> {
247 // Security critical permission check. This statement must return on fail.
Janis Danisevskisa916d992021-10-19 15:46:09 -0700248 check_keystore_permission(KeystorePerm::DeleteAllKeys)
Shaquille Johnson9da2e1c2022-09-19 12:39:01 +0000249 .context(ks_err!("Checking permission"))?;
Paul Crowley46c703e2021-08-06 15:13:53 -0700250 log::info!("In delete_all_keys.");
251
252 Maintenance::call_on_all_security_levels("deleteAllKeys", |dev| dev.deleteAllKeys())
253 }
Hasini Gunasingheda895552021-01-27 19:34:37 +0000254}
255
Janis Danisevskis34a0cf22021-03-08 09:19:03 -0800256impl Interface for Maintenance {}
Hasini Gunasingheda895552021-01-27 19:34:37 +0000257
Janis Danisevskis34a0cf22021-03-08 09:19:03 -0800258impl IKeystoreMaintenance for Maintenance {
Hasini Gunasingheda895552021-01-27 19:34:37 +0000259 fn onUserPasswordChanged(&self, user_id: i32, password: Option<&[u8]>) -> BinderResult<()> {
David Drysdalee85523f2023-06-19 12:28:53 +0100260 log::info!(
261 "onUserPasswordChanged(user={}, password.is_some()={})",
262 user_id,
263 password.is_some()
264 );
Hasini Gunasinghe5a893e82021-05-05 14:32:32 +0000265 let _wp = wd::watch_millis("IKeystoreMaintenance::onUserPasswordChanged", 500);
Paul Crowleyf61fee72021-03-17 14:38:44 -0700266 map_or_log_err(Self::on_user_password_changed(user_id, password.map(|pw| pw.into())), Ok)
Hasini Gunasingheda895552021-01-27 19:34:37 +0000267 }
268
269 fn onUserAdded(&self, user_id: i32) -> BinderResult<()> {
David Drysdalee85523f2023-06-19 12:28:53 +0100270 log::info!("onUserAdded(user={user_id})");
Hasini Gunasinghe5a893e82021-05-05 14:32:32 +0000271 let _wp = wd::watch_millis("IKeystoreMaintenance::onUserAdded", 500);
Janis Danisevskis5898d152021-06-15 08:23:46 -0700272 map_or_log_err(self.add_or_remove_user(user_id), Ok)
Hasini Gunasingheda895552021-01-27 19:34:37 +0000273 }
274
275 fn onUserRemoved(&self, user_id: i32) -> BinderResult<()> {
David Drysdalee85523f2023-06-19 12:28:53 +0100276 log::info!("onUserRemoved(user={user_id})");
Hasini Gunasinghe5a893e82021-05-05 14:32:32 +0000277 let _wp = wd::watch_millis("IKeystoreMaintenance::onUserRemoved", 500);
Janis Danisevskis5898d152021-06-15 08:23:46 -0700278 map_or_log_err(self.add_or_remove_user(user_id), Ok)
Hasini Gunasingheda895552021-01-27 19:34:37 +0000279 }
Janis Danisevskisddd6e752021-02-22 18:46:55 -0800280
281 fn clearNamespace(&self, domain: Domain, nspace: i64) -> BinderResult<()> {
David Drysdalee85523f2023-06-19 12:28:53 +0100282 log::info!("clearNamespace({domain:?}, nspace={nspace})");
Hasini Gunasinghe5a893e82021-05-05 14:32:32 +0000283 let _wp = wd::watch_millis("IKeystoreMaintenance::clearNamespace", 500);
Janis Danisevskis5898d152021-06-15 08:23:46 -0700284 map_or_log_err(self.clear_namespace(domain, nspace), Ok)
Janis Danisevskisddd6e752021-02-22 18:46:55 -0800285 }
Hasini Gunasinghe9ee18412021-03-11 20:12:44 +0000286
Satya Tangirala5b9e5b12021-03-09 12:54:21 -0800287 fn earlyBootEnded(&self) -> BinderResult<()> {
David Drysdalee85523f2023-06-19 12:28:53 +0100288 log::info!("earlyBootEnded()");
Hasini Gunasinghe5a893e82021-05-05 14:32:32 +0000289 let _wp = wd::watch_millis("IKeystoreMaintenance::earlyBootEnded", 500);
Satya Tangirala5b9e5b12021-03-09 12:54:21 -0800290 map_or_log_err(Self::early_boot_ended(), Ok)
291 }
292
Janis Danisevskis333b7c02021-03-23 18:57:41 -0700293 fn onDeviceOffBody(&self) -> BinderResult<()> {
David Drysdalee85523f2023-06-19 12:28:53 +0100294 log::info!("onDeviceOffBody()");
Hasini Gunasinghe5a893e82021-05-05 14:32:32 +0000295 let _wp = wd::watch_millis("IKeystoreMaintenance::onDeviceOffBody", 500);
Janis Danisevskis333b7c02021-03-23 18:57:41 -0700296 map_or_log_err(Self::on_device_off_body(), Ok)
297 }
Janis Danisevskiscdcf4e52021-04-14 15:44:36 -0700298
299 fn migrateKeyNamespace(
300 &self,
301 source: &KeyDescriptor,
302 destination: &KeyDescriptor,
303 ) -> BinderResult<()> {
David Drysdalee85523f2023-06-19 12:28:53 +0100304 log::info!("migrateKeyNamespace(src={source:?}, dest={destination:?})");
Hasini Gunasinghe5a893e82021-05-05 14:32:32 +0000305 let _wp = wd::watch_millis("IKeystoreMaintenance::migrateKeyNamespace", 500);
Janis Danisevskiscdcf4e52021-04-14 15:44:36 -0700306 map_or_log_err(Self::migrate_key_namespace(source, destination), Ok)
307 }
Paul Crowley46c703e2021-08-06 15:13:53 -0700308
309 fn deleteAllKeys(&self) -> BinderResult<()> {
David Drysdalee85523f2023-06-19 12:28:53 +0100310 log::warn!("deleteAllKeys()");
Paul Crowley46c703e2021-08-06 15:13:53 -0700311 let _wp = wd::watch_millis("IKeystoreMaintenance::deleteAllKeys", 500);
312 map_or_log_err(Self::delete_all_keys(), Ok)
313 }
Hasini Gunasingheda895552021-01-27 19:34:37 +0000314}