Keystore 2.0: Refactor permissions. 5/5
Now that the implement_class! macro is generic enough, it can replace
implement_permissions_aidl! with minor tweak to the rest of the code.
Test: keystore2_test
Bug: 203555519
Change-Id: Ib339bd0ac0acc27169b9303f50999d552a1aa632
diff --git a/keystore2/src/maintenance.rs b/keystore2/src/maintenance.rs
index eb06784..3f6cf36 100644
--- a/keystore2/src/maintenance.rs
+++ b/keystore2/src/maintenance.rs
@@ -227,9 +227,9 @@
KeyEntryLoadBits::NONE,
caller_uid,
|k, av| {
- check_key_permission(KeyPerm::use_(), k, &av)?;
- check_key_permission(KeyPerm::delete(), k, &av)?;
- check_key_permission(KeyPerm::grant(), k, &av)
+ check_key_permission(KeyPerm::Use, k, &av)?;
+ check_key_permission(KeyPerm::Delete, k, &av)?;
+ check_key_permission(KeyPerm::Grant, k, &av)
},
)
})
@@ -245,7 +245,7 @@
};
db.borrow_mut().migrate_key_namespace(key_id_guard, destination, caller_uid, |k| {
- check_key_permission(KeyPerm::rebind(), k, &None)
+ check_key_permission(KeyPerm::Rebind, k, &None)
})
})
}