| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 bool sign; | 80 bool sign; |
| 81 std::string symmetric_key; | 81 std::string symmetric_key; |
| 82 std::string public_key; | 82 std::string public_key; |
| 83 bool wrapped; | 83 bool wrapped; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 AuthorizationData(); | 86 AuthorizationData(); |
| 87 AuthorizationData(bool encrypt, | 87 AuthorizationData(bool encrypt, |
| 88 bool sign, | 88 bool sign, |
| 89 const std::string& symmetric_key); | 89 const std::string& symmetric_key); |
| 90 AuthorizationData(const AuthorizationData& other); |
| 90 ~AuthorizationData(); | 91 ~AuthorizationData(); |
| 91 | 92 |
| 92 bool operator==(const AuthorizationData& other) const; | 93 bool operator==(const AuthorizationData& other) const; |
| 93 | 94 |
| 94 Type type; | 95 Type type; |
| 95 std::vector<Secret> secrets; | 96 std::vector<Secret> secrets; |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 // This struct holds metadata that will be stored alongside the key. Each | 99 // This struct holds metadata that will be stored alongside the key. Each |
| 99 // |ProviderData| entry must have a |name| and may hold either a |number| or a | 100 // |ProviderData| entry must have a |name| and may hold either a |number| or a |
| (...skipping 14 matching lines...) Expand all Loading... |
| 114 | 115 |
| 115 std::string name; | 116 std::string name; |
| 116 scoped_ptr<int64_t> number; | 117 scoped_ptr<int64_t> number; |
| 117 scoped_ptr<std::string> bytes; | 118 scoped_ptr<std::string> bytes; |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 KeyDefinition(); | 121 KeyDefinition(); |
| 121 KeyDefinition(const std::string& secret, | 122 KeyDefinition(const std::string& secret, |
| 122 const std::string& label, | 123 const std::string& label, |
| 123 int privileges); | 124 int privileges); |
| 125 KeyDefinition(const KeyDefinition& other); |
| 124 ~KeyDefinition(); | 126 ~KeyDefinition(); |
| 125 | 127 |
| 126 bool operator==(const KeyDefinition& other) const; | 128 bool operator==(const KeyDefinition& other) const; |
| 127 | 129 |
| 128 Type type; | 130 Type type; |
| 129 std::string label; | 131 std::string label; |
| 130 // Privileges associated with key. Combination of |AuthKeyPrivileges| values. | 132 // Privileges associated with key. Combination of |AuthKeyPrivileges| values. |
| 131 int privileges; | 133 int privileges; |
| 132 int revision; | 134 int revision; |
| 133 std::string secret; | 135 std::string secret; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 144 bool operator==(const Authorization& other) const; | 146 bool operator==(const Authorization& other) const; |
| 145 | 147 |
| 146 std::string key; | 148 std::string key; |
| 147 std::string label; | 149 std::string label; |
| 148 }; | 150 }; |
| 149 | 151 |
| 150 // Parameters for Mount call. | 152 // Parameters for Mount call. |
| 151 class CHROMEOS_EXPORT MountParameters { | 153 class CHROMEOS_EXPORT MountParameters { |
| 152 public: | 154 public: |
| 153 explicit MountParameters(bool ephemeral); | 155 explicit MountParameters(bool ephemeral); |
| 156 MountParameters(const MountParameters& other); |
| 154 ~MountParameters(); | 157 ~MountParameters(); |
| 155 | 158 |
| 156 bool operator==(const MountParameters& other) const; | 159 bool operator==(const MountParameters& other) const; |
| 157 | 160 |
| 158 // If |true|, the mounted home dir will be backed by tmpfs. If |false|, the | 161 // If |true|, the mounted home dir will be backed by tmpfs. If |false|, the |
| 159 // ephemeral users policy decides whether tmpfs or an encrypted directory is | 162 // ephemeral users policy decides whether tmpfs or an encrypted directory is |
| 160 // used as the backend. | 163 // used as the backend. |
| 161 bool ephemeral; | 164 bool ephemeral; |
| 162 | 165 |
| 163 // If not empty, home dir will be created with these keys if it exist. | 166 // If not empty, home dir will be created with these keys if it exist. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 179 // Implement hashing of cryptohome::Identification, so it can be used as a key | 182 // Implement hashing of cryptohome::Identification, so it can be used as a key |
| 180 // in STL containers. | 183 // in STL containers. |
| 181 template <> | 184 template <> |
| 182 struct hash<cryptohome::Identification> { | 185 struct hash<cryptohome::Identification> { |
| 183 std::size_t operator()(const cryptohome::Identification& cryptohome_id) const; | 186 std::size_t operator()(const cryptohome::Identification& cryptohome_id) const; |
| 184 }; | 187 }; |
| 185 | 188 |
| 186 } // namespace BASE_HASH_NAMESPACE | 189 } // namespace BASE_HASH_NAMESPACE |
| 187 | 190 |
| 188 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ | 191 #endif // CHROMEOS_CRYPTOHOME_CRYPTOHOME_PARAMETERS_H_ |
| OLD | NEW |