| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ | 5 #ifndef CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ |
| 6 #define CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ | 6 #define CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
| 14 #include "components/user_manager/user_id.h" |
| 14 | 15 |
| 15 namespace cryptohome { | 16 namespace cryptohome { |
| 16 | 17 |
| 17 enum AuthKeyPrivileges { | 18 enum AuthKeyPrivileges { |
| 18 PRIV_MOUNT = 1 << 0, // Can mount with this key. | 19 PRIV_MOUNT = 1 << 0, // Can mount with this key. |
| 19 PRIV_ADD = 1 << 1, // Can add new keys. | 20 PRIV_ADD = 1 << 1, // Can add new keys. |
| 20 PRIV_REMOVE = 1 << 2, // Can remove other keys. | 21 PRIV_REMOVE = 1 << 2, // Can remove other keys. |
| 21 PRIV_MIGRATE = 1 << 3, // Destroy all keys and replace with new. | 22 PRIV_MIGRATE = 1 << 3, // Destroy all keys and replace with new. |
| 22 PRIV_AUTHORIZED_UPDATE = 1 << 4, // Key can be updated in place. | 23 PRIV_AUTHORIZED_UPDATE = 1 << 4, // Key can be updated in place. |
| 23 PRIV_DEFAULT = PRIV_MOUNT | PRIV_ADD | PRIV_REMOVE | PRIV_MIGRATE | 24 PRIV_DEFAULT = PRIV_MOUNT | PRIV_ADD | PRIV_REMOVE | PRIV_MIGRATE |
| 24 }; | 25 }; |
| 25 | 26 |
| 26 // Identification of the user calling cryptohome method. | 27 // Identification of the user calling cryptohome method. |
| 27 struct CHROMEOS_EXPORT Identification { | 28 struct CHROMEOS_EXPORT Identification { |
| 28 explicit Identification(const std::string& user_id); | 29 explicit Identification(const user_manager::UserID& user_id); |
| 29 | 30 |
| 30 bool operator==(const Identification& other) const; | 31 bool operator==(const Identification& other) const; |
| 31 | 32 |
| 32 std::string user_id; | 33 user_manager::UserID user_id; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 // Definition of the key (e.g. password) for the cryptohome. | 36 // Definition of the key (e.g. password) for the cryptohome. |
| 36 // It contains authorization data along with extra parameters like permissions | 37 // It contains authorization data along with extra parameters like permissions |
| 37 // associated with this key. | 38 // associated with this key. |
| 38 struct CHROMEOS_EXPORT KeyDefinition { | 39 struct CHROMEOS_EXPORT KeyDefinition { |
| 39 enum Type { | 40 enum Type { |
| 40 TYPE_PASSWORD = 0 | 41 TYPE_PASSWORD = 0 |
| 41 }; | 42 }; |
| 42 | 43 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // used as the backend. | 141 // used as the backend. |
| 141 bool ephemeral; | 142 bool ephemeral; |
| 142 | 143 |
| 143 // If not empty, home dir will be created with these keys if it exist. | 144 // If not empty, home dir will be created with these keys if it exist. |
| 144 std::vector<KeyDefinition> create_keys; | 145 std::vector<KeyDefinition> create_keys; |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 } // namespace cryptohome | 148 } // namespace cryptohome |
| 148 | 149 |
| 149 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ | 150 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ |
| OLD | NEW |