OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_INSTALL_ATTRIBUTES_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_INSTALL_ATTRIBUTES_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_INSTALL_ATTRIBUTES_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_INSTALL_ATTRIBUTES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // kInstallAttributesFileName (created early during the boot process by | 63 // kInstallAttributesFileName (created early during the boot process by |
64 // lockbox-cache) the install attributes are fully trusted. | 64 // lockbox-cache) the install attributes are fully trusted. |
65 void Init(const base::FilePath& cache_file); | 65 void Init(const base::FilePath& cache_file); |
66 | 66 |
67 // Makes sure the local caches for enterprise-related install attributes are | 67 // Makes sure the local caches for enterprise-related install attributes are |
68 // up to date with what cryptohome has. This method checks the readiness of | 68 // up to date with what cryptohome has. This method checks the readiness of |
69 // attributes and read them if ready. Actual read will be performed in | 69 // attributes and read them if ready. Actual read will be performed in |
70 // ReadAttributesIfReady(). | 70 // ReadAttributesIfReady(). |
71 void ReadImmutableAttributes(const base::Closure& callback); | 71 void ReadImmutableAttributes(const base::Closure& callback); |
72 | 72 |
| 73 // Updates the firmware management parameters from TPM, storing the devmode |
| 74 // flag according to |block_devmode|. Invokes |callback| when done. Must be |
| 75 // called before LockDevice is done. Used to update TPM on enrollment. |
| 76 void SetBlockDevmodeInTpm( |
| 77 bool block_devmode, |
| 78 const CryptohomeClient::ProtobufMethodCallback& callback); |
| 79 |
73 // Locks the device into |device_mode|. Depending on |device_mode|, a | 80 // Locks the device into |device_mode|. Depending on |device_mode|, a |
74 // specific subset of |domain|, |realm| and |device_id| must be set. Can also | 81 // specific subset of |domain|, |realm| and |device_id| must be set. Can also |
75 // be called after the lock has already been taken, in which case it checks | 82 // be called after the lock has already been taken, in which case it checks |
76 // that the passed parameters fully agree with the locked attributes. | 83 // that the passed parameters fully agree with the locked attributes. |
77 // |callback| must not be null and is called with the result. Must not be | 84 // |callback| must not be null and is called with the result. Must not be |
78 // called while a previous LockDevice() invocation is still pending. | 85 // called while a previous LockDevice() invocation is still pending. |
79 void LockDevice(policy::DeviceMode device_mode, | 86 void LockDevice(policy::DeviceMode device_mode, |
80 const std::string& domain, | 87 const std::string& domain, |
81 const std::string& realm, | 88 const std::string& realm, |
82 const std::string& device_id, | 89 const std::string& device_id, |
(...skipping 21 matching lines...) Expand all Loading... |
104 | 111 |
105 // Return the realm this device belongs to or an empty string if the device is | 112 // Return the realm this device belongs to or an empty string if the device is |
106 // not an AD enterprise device. | 113 // not an AD enterprise device. |
107 std::string GetRealm() const { return registration_realm_; } | 114 std::string GetRealm() const { return registration_realm_; } |
108 | 115 |
109 // Return the device id that was generated when the device was registered. | 116 // Return the device id that was generated when the device was registered. |
110 // Returns an empty string if the device is not an enterprise device or the | 117 // Returns an empty string if the device is not an enterprise device or the |
111 // device id was not stored in the lockbox (prior to R19). | 118 // device id was not stored in the lockbox (prior to R19). |
112 std::string GetDeviceId() const { return registration_device_id_; } | 119 std::string GetDeviceId() const { return registration_device_id_; } |
113 | 120 |
| 121 // Return whether TPM is locked. |
| 122 bool IsDeviceLocked() const { return device_locked_; } |
| 123 |
114 protected: | 124 protected: |
115 // True if install attributes have been read successfully. False if read | 125 // True if install attributes have been read successfully. False if read |
116 // failed or no read attempt was made. | 126 // failed or no read attempt was made. |
117 bool device_locked_ = false; | 127 bool device_locked_ = false; |
118 | 128 |
119 // Whether the TPM / install attributes consistency check is running. | 129 // Whether the TPM / install attributes consistency check is running. |
120 bool consistency_check_running_ = false; | 130 bool consistency_check_running_ = false; |
121 | 131 |
122 // To be run after the consistency check has finished. | 132 // To be run after the consistency check has finished. |
123 base::Closure post_check_action_; | 133 base::Closure post_check_action_; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 CryptohomeClient* cryptohome_client_; | 218 CryptohomeClient* cryptohome_client_; |
209 | 219 |
210 base::WeakPtrFactory<InstallAttributes> weak_ptr_factory_; | 220 base::WeakPtrFactory<InstallAttributes> weak_ptr_factory_; |
211 | 221 |
212 DISALLOW_COPY_AND_ASSIGN(InstallAttributes); | 222 DISALLOW_COPY_AND_ASSIGN(InstallAttributes); |
213 }; | 223 }; |
214 | 224 |
215 } // namespace chromeos | 225 } // namespace chromeos |
216 | 226 |
217 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_INSTALL_ATTRIBUTES_H_ | 227 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_INSTALL_ATTRIBUTES_H_ |
OLD | NEW |