Add generic unlock key setting and removal.

* Replace {Set|Remove}MasterKey() by generic {Set|Remove}UnlockKey()
  that works on a keyring.
* Implement {Set|Remove}MasterUnlockKey() on top of that.
* Rename the commands and constants accrodingly.
* Implement setting and removing keyring unlock keys.
This commit is contained in:
Michael Lotz
2013-03-05 11:04:57 -05:00
committed by Ryan Leavengood
parent a82011ff96
commit 4a0460a9bc
4 changed files with 72 additions and 23 deletions
+7 -3
View File
@@ -57,10 +57,14 @@ public:
status_t GetNextKeyring(uint32& cookie,
BString& keyring);
// Master key
status_t SetUnlockKey(const char* keyring,
const BKey& key);
status_t RemoveUnlockKey(const char* keyring);
status_t SetMasterKey(const BKey& key);
status_t RemoveMasterKey();
// Master keyring
status_t SetMasterUnlockKey(const BKey& key);
status_t RemoveMasterUnlockKey();
status_t AddKeyringToMaster(const char* keyring);
status_t RemoveKeyringFromMaster(const char* keyring);
+2 -2
View File
@@ -30,8 +30,8 @@ enum {
KEY_STORE_ADD_KEYRING = 'KaKR',
KEY_STORE_REMOVE_KEYRING = 'KrKR',
KEY_STORE_GET_NEXT_KEYRING = 'KnKR',
KEY_STORE_SET_MASTER_KEY = 'KsMK',
KEY_STORE_REMOVE_MASTER_KEY = 'KrMK',
KEY_STORE_SET_UNLOCK_KEY = 'KsuK',
KEY_STORE_REMOVE_UNLOCK_KEY = 'KruK',
KEY_STORE_ADD_KEYRING_TO_MASTER = 'KarM',
KEY_STORE_REMOVE_KEYRING_FROM_MASTER = 'KrrM',
KEY_STORE_GET_NEXT_MASTER_KEYRING = 'KnrM',