OLD | NEW |
1 // Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009-2010 The Chromium OS 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 // Credentials is the interface for objects that wrap up a set | 5 // Credentials is the interface for objects that wrap up a set |
6 // of credentials with which we can authenticate. At the moment, the | 6 // of credentials with which we can authenticate. At the moment, the |
7 // only implementation of this class is UsernamePassword. | 7 // only implementation of this class is UsernamePassword. |
8 | 8 |
9 #ifndef PAM_OFFLINE_CREDENTIALS_H_ | 9 #ifndef PAM_OFFLINE_CREDENTIALS_H_ |
10 #define PAM_OFFLINE_CREDENTIALS_H_ | 10 #define PAM_OFFLINE_CREDENTIALS_H_ |
(...skipping 16 matching lines...) Expand all Loading... |
27 virtual void GetFullUsername(char *name_buffer, int length) const = 0; | 27 virtual void GetFullUsername(char *name_buffer, int length) const = 0; |
28 | 28 |
29 // Returns the part of the username before the '@' | 29 // Returns the part of the username before the '@' |
30 // | 30 // |
31 // Parameters | 31 // Parameters |
32 // name_buffer - Output buffer. | 32 // name_buffer - Output buffer. |
33 // length - Amount of space in name_buffer | 33 // length - Amount of space in name_buffer |
34 // | 34 // |
35 virtual void GetPartialUsername(char *name_buffer, int length) const = 0; | 35 virtual void GetPartialUsername(char *name_buffer, int length) const = 0; |
36 | 36 |
| 37 #ifdef CHROMEOS_PAM_LOCALACCOUNT |
| 38 // returns true if we're willing to accept these credentials without |
| 39 // talking to Google. |
| 40 virtual bool IsLocalAccount() const = 0; |
| 41 #endif |
| 42 |
37 // Returns the obfuscated username, used as the name of the directory | 43 // Returns the obfuscated username, used as the name of the directory |
38 // containing the user's stateful data (and maybe used for other reasons | 44 // containing the user's stateful data (and maybe used for other reasons |
39 // at some point.) | 45 // at some point.) |
40 virtual std::string GetObfuscatedUsername(const Blob &system_salt) const = 0; | 46 virtual std::string GetObfuscatedUsername(const Blob &system_salt) const = 0; |
41 | 47 |
42 // Returns a "weak hash" of the user's password. Requires the system | 48 // Returns a "weak hash" of the user's password. Requires the system |
43 // salt to compute. | 49 // salt to compute. |
44 // | 50 // |
45 // This hashes using the same algorithm that pam/pam_google/pam_mount use to | 51 // This hashes using the same algorithm that pam/pam_google/pam_mount use to |
46 // get the user's plaintext password passed on to the login session. The | 52 // get the user's plaintext password passed on to the login session. The |
47 // two hashing algorithms must be kept in sync, as the hash is used to derive | 53 // two hashing algorithms must be kept in sync, as the hash is used to derive |
48 // a passphrase for the master key. | 54 // a passphrase for the master key. |
49 // | 55 // |
50 // Parameters | 56 // Parameters |
51 // system_salt - A blob containing the current system salt value. | 57 // system_salt - A blob containing the current system salt value. |
52 // | 58 // |
53 // Returns | 59 // Returns |
54 // A std::string containing the weak hash encoded as a hex sequence in ASCII. | 60 // A std::string containing the weak hash encoded as a hex sequence in ASCII. |
55 // | 61 // |
56 virtual std::string GetPasswordWeakHash(const Blob &system_salt) const = 0; | 62 virtual std::string GetPasswordWeakHash(const Blob &system_salt) const = 0; |
57 }; | 63 }; |
58 | 64 |
59 } // namespace pam_offline | 65 } // namespace pam_offline |
60 | 66 |
61 #endif // PAM_OFFLINE_CREDENTIALS_H_ | 67 #endif // PAM_OFFLINE_CREDENTIALS_H_ |
OLD | NEW |