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 #include "chromeos/cryptohome/cryptohome_parameters.h" | 5 #include "chromeos/cryptohome/cryptohome_parameters.h" |
6 | 6 |
7 namespace cryptohome { | 7 namespace cryptohome { |
8 | 8 |
9 Authorization::Authorization(const std::string& key, const std::string& label) | |
10 : key(key), label(label) {} | |
11 | 9 |
12 Authorization::Authorization(const KeyDefinition& key_def) | 10 Identification::Identification(const std::string& user_id) : user_id(user_id) { |
13 : key(key_def.key), label(key_def.label) {} | 11 } |
14 | 12 |
15 MountParameters::MountParameters(bool ephemeral) : ephemeral(ephemeral) {} | 13 bool Identification::operator==(const Identification& other) const { |
16 | 14 return user_id == other.user_id; |
17 MountParameters::~MountParameters() {} | 15 } |
18 | 16 |
19 KeyDefinition::KeyDefinition(const std::string& key, | 17 KeyDefinition::KeyDefinition(const std::string& key, |
20 const std::string& label, | 18 const std::string& label, |
21 int /*AuthKeyPrivileges*/ privileges) | 19 int /*AuthKeyPrivileges*/ privileges) |
22 : label(label), revision(1), key(key), privileges(privileges) {} | 20 : label(label), |
| 21 revision(1), |
| 22 key(key), |
| 23 privileges(privileges) { |
| 24 } |
23 | 25 |
24 KeyDefinition::~KeyDefinition() {} | 26 KeyDefinition::~KeyDefinition() { |
| 27 } |
| 28 |
| 29 bool KeyDefinition::operator==(const KeyDefinition& other) const { |
| 30 return label == other.label && |
| 31 revision == other.revision && |
| 32 key == other.key && |
| 33 encryption_key == other.encryption_key && |
| 34 signature_key == other.signature_key && |
| 35 privileges == other.privileges; |
| 36 } |
| 37 |
| 38 Authorization::Authorization(const std::string& key, const std::string& label) |
| 39 : key(key), |
| 40 label(label) { |
| 41 } |
| 42 |
| 43 Authorization::Authorization(const KeyDefinition& key_def) |
| 44 : key(key_def.key), |
| 45 label(key_def.label) { |
| 46 } |
| 47 |
| 48 bool Authorization::operator==(const Authorization& other) const { |
| 49 return key == other.key && label == other.label; |
| 50 } |
| 51 |
| 52 MountParameters::MountParameters(bool ephemeral) : ephemeral(ephemeral) { |
| 53 } |
| 54 |
| 55 MountParameters::~MountParameters() { |
| 56 } |
| 57 |
| 58 bool MountParameters::operator==(const MountParameters& other) const { |
| 59 return ephemeral == other.ephemeral && create_keys == other.create_keys; |
| 60 } |
25 | 61 |
26 } // namespace cryptohome | 62 } // namespace cryptohome |
OLD | NEW |