Chromium Code Reviews| Index: chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.h |
| diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.h b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.h |
| index 26cd08b444dfdf844bcb2df59e160f80357e2528..154c76925501105a3ad4dfe8da1df4db9387f950 100644 |
| --- a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.h |
| +++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.h |
| @@ -29,8 +29,12 @@ class EasyUnlockTpmKeyManager : public KeyedService { |
| // |user_id|: Id for the user associated with the service. Empty for signin |
| // service. |
| + // |username_hash|: Username hash for the user associated with the service. |
| + // Empty for signing service. |
|
pneubeck (no reviews)
2015/05/12 12:21:43
signing or sign-in as in the line before?
tbarzic
2015/05/12 17:10:47
Done.
|
| // |local_state|: The local state prefs. |
| - EasyUnlockTpmKeyManager(const std::string& user_id, PrefService* local_state); |
| + EasyUnlockTpmKeyManager(const std::string& user_id, |
| + const std::string& username_hash, |
| + PrefService* local_state); |
| ~EasyUnlockTpmKeyManager() override; |
| // Checks if the RSA public key is set in the local state. If not, creates |
| @@ -69,9 +73,12 @@ class EasyUnlockTpmKeyManager : public KeyedService { |
| const std::string& data, |
| const base::Callback<void(const std::string& data)> callback); |
| + bool StartedCreatingTpmKeys() const; |
| + |
| private: |
| enum CreateTpmKeyState { |
| CREATE_TPM_KEY_NOT_STARTED, |
| + CREATE_TPM_KEY_WAITING_FOR_USER_SLOT, |
| CREATE_TPM_KEY_WAITING_FOR_SYSTEM_SLOT, |
| CREATE_TPM_KEY_GOT_SYSTEM_SLOT, |
| CREATE_TPM_KEY_DONE |
| @@ -92,6 +99,12 @@ class EasyUnlockTpmKeyManager : public KeyedService { |
| void CreateKeyInSystemSlot(const std::string& public_key, |
| crypto::ScopedPK11Slot system_slot); |
| + // Called when user TPM token initialization is done. After this happens, |
| + // |this| may proceed with creating user-specific TPM key for easy sign-in. |
|
pneubeck (no reviews)
2015/05/12 12:21:43
s/creating/creating a/
tbarzic
2015/05/12 17:10:47
Done.
|
| + // Note that this is done solely to ensure user TPM initialization, which is |
| + // done on IO thread, is not blocked by creating TPM keys in system slot. |
| + void OnUserTPMInitialized(const std::string& public_key); |
| + |
| // Called when TPM system slot is initialized and ready to be used. |
| // It schedules data signing operation on a worker thread. The data is signed |
| // by a private key stored in |system_slot| and identified by |public_key| |
| @@ -116,6 +129,7 @@ class EasyUnlockTpmKeyManager : public KeyedService { |
| const std::string& signature); |
| std::string user_id_; |
| + std::string username_hash_; |
| PrefService* local_state_; |