OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CROS_CRYPTOHOME_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 virtual bool AsyncMountForBwsi(Delegate* callback) = 0; | 68 virtual bool AsyncMountForBwsi(Delegate* callback) = 0; |
69 | 69 |
70 // Asks cryptohomed to asynchronously try to find the cryptohome for | 70 // Asks cryptohomed to asynchronously try to find the cryptohome for |
71 // |user_email| and then nuke it. | 71 // |user_email| and then nuke it. |
72 virtual bool AsyncRemove(const std::string& user_email, | 72 virtual bool AsyncRemove(const std::string& user_email, |
73 Delegate* callback) = 0; | 73 Delegate* callback) = 0; |
74 | 74 |
75 // Asks cryptohomed if a drive is currently mounted. | 75 // Asks cryptohomed if a drive is currently mounted. |
76 virtual bool IsMounted() = 0; | 76 virtual bool IsMounted() = 0; |
77 | 77 |
78 // Asks cryptohomed for the system salt. | |
79 virtual CryptohomeBlob GetSystemSalt() = 0; | |
80 | |
81 // Passes cryptohomed the owner user. It is used to prevent | 78 // Passes cryptohomed the owner user. It is used to prevent |
82 // deletion of the owner in low disk space cleanup (see above). | 79 // deletion of the owner in low disk space cleanup (see above). |
83 virtual bool AsyncSetOwnerUser(const std::string& username, | 80 virtual bool AsyncSetOwnerUser(const std::string& username, |
84 Delegate* callback) = 0; | 81 Delegate* callback) = 0; |
85 | 82 |
86 // Wrappers of the functions for working with Tpm. | 83 // Wrappers of the functions for working with Tpm. |
87 | 84 |
88 // Returns whether Tpm is ready. | 85 // Returns whether Tpm is ready. |
89 virtual bool TpmIsReady() = 0; | 86 virtual bool TpmIsReady() = 0; |
90 | 87 |
(...skipping 30 matching lines...) Expand all Loading... |
121 // the TpmGetPassword because it's getting the PKCS#11 user PIN and | 118 // the TpmGetPassword because it's getting the PKCS#11 user PIN and |
122 // not the TPM password. | 119 // not the TPM password. |
123 virtual void Pkcs11GetTpmTokenInfo(std::string* label, | 120 virtual void Pkcs11GetTpmTokenInfo(std::string* label, |
124 std::string* user_pin) = 0; | 121 std::string* user_pin) = 0; |
125 | 122 |
126 // Gets the status of the TPM. This is different from TpmIsReady | 123 // Gets the status of the TPM. This is different from TpmIsReady |
127 // because it's getting the staus of the PKCS#11 initialization of | 124 // because it's getting the staus of the PKCS#11 initialization of |
128 // the TPM token, not the TPM itself. | 125 // the TPM token, not the TPM itself. |
129 virtual bool Pkcs11IsTpmTokenReady() = 0; | 126 virtual bool Pkcs11IsTpmTokenReady() = 0; |
130 | 127 |
| 128 // Returns hash of |password|, salted with the system salt. |
| 129 virtual std::string HashPassword(const std::string& password) = 0; |
| 130 |
| 131 // Returns system hash in hex encoded ascii format. |
| 132 virtual std::string GetSystemSalt() = 0; |
| 133 |
131 // Factory function, creates a new instance and returns ownership. | 134 // Factory function, creates a new instance and returns ownership. |
132 // For normal usage, access the singleton via CrosLibrary::Get(). | 135 // For normal usage, access the singleton via CrosLibrary::Get(). |
133 static CryptohomeLibrary* GetImpl(bool stub); | 136 static CryptohomeLibrary* GetImpl(bool stub); |
134 }; | 137 }; |
135 | 138 |
136 } // namespace chromeos | 139 } // namespace chromeos |
137 | 140 |
138 #endif // CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ | 141 #endif // CHROME_BROWSER_CHROMEOS_CROS_CRYPTOHOME_LIBRARY_H_ |
OLD | NEW |