Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: chromeos/cryptohome/cryptohome_parameters.cc

Issue 554043003: cros: Create cryptohome keys for Easy sign-in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: support multiple get key op, create key first then trim extra, lazily create manager Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chromeos/dbus/cryptohome/key.pb.h" 7 #include "chromeos/dbus/cryptohome/key.pb.h"
8 8
9 namespace cryptohome { 9 namespace cryptohome {
10 10
11 ProviderDataEntry::ProviderDataEntry(const std::string& name)
12 : name(name),
13 has_number(false),
14 number(0),
15 has_bytes(false) {
16 }
17
18 ProviderDataEntry::ProviderDataEntry(const std::string& name, int64 number)
19 : name(name),
20 has_number(true),
21 number(number),
22 has_bytes(false) {
23 }
24
25 ProviderDataEntry::ProviderDataEntry(const std::string& name,
26 const std::string& bytes)
27 : name(name),
28 has_number(false),
29 number(0),
30 has_bytes(true),
31 bytes(bytes) {
32 }
33
34 ProviderDataEntry::~ProviderDataEntry() {
35 }
36
37 void ProviderDataEntry::SetNumber(int64 number) {
38 has_number = true;
39 this->number = number;
40 }
41
42 void ProviderDataEntry::SetBytes(const std::string& bytes) {
43 has_bytes = true;
44 this->bytes = bytes;
45 }
46
11 Identification::Identification(const std::string& user_id) : user_id(user_id) { 47 Identification::Identification(const std::string& user_id) : user_id(user_id) {
12 } 48 }
13 49
14 bool Identification::operator==(const Identification& other) const { 50 bool Identification::operator==(const Identification& other) const {
15 return user_id == other.user_id; 51 return user_id == other.user_id;
16 } 52 }
17 53
18 KeyDefinition::KeyDefinition(const std::string& key, 54 KeyDefinition::KeyDefinition(const std::string& key,
19 const std::string& label, 55 const std::string& label,
20 int /*AuthKeyPrivileges*/ privileges) 56 int /*AuthKeyPrivileges*/ privileges)
(...skipping 22 matching lines...) Expand all
43 79
44 Authorization::Authorization(const KeyDefinition& key_def) 80 Authorization::Authorization(const KeyDefinition& key_def)
45 : key(key_def.key), 81 : key(key_def.key),
46 label(key_def.label) { 82 label(key_def.label) {
47 } 83 }
48 84
49 bool Authorization::operator==(const Authorization& other) const { 85 bool Authorization::operator==(const Authorization& other) const {
50 return key == other.key && label == other.label; 86 return key == other.key && label == other.label;
51 } 87 }
52 88
53 RetrievedKeyData::ProviderData::ProviderData(const std::string& name)
54 : name(name) {
55 }
56
57 RetrievedKeyData::ProviderData::~ProviderData() {
58 }
59
60 RetrievedKeyData::RetrievedKeyData(Type type, 89 RetrievedKeyData::RetrievedKeyData(Type type,
61 const std::string& label, 90 const std::string& label,
62 int64 revision) : type(type), 91 int64 revision) : type(type),
63 label(label), 92 label(label),
64 privileges(0), 93 privileges(0),
65 revision(revision) { 94 revision(revision) {
66 } 95 }
67 96
68 RetrievedKeyData::~RetrievedKeyData() { 97 RetrievedKeyData::~RetrievedKeyData() {
69 } 98 }
70 99
71 MountParameters::MountParameters(bool ephemeral) : ephemeral(ephemeral) { 100 MountParameters::MountParameters(bool ephemeral) : ephemeral(ephemeral) {
72 } 101 }
73 102
74 bool MountParameters::operator==(const MountParameters& other) const { 103 bool MountParameters::operator==(const MountParameters& other) const {
75 return ephemeral == other.ephemeral && create_keys == other.create_keys; 104 return ephemeral == other.ephemeral && create_keys == other.create_keys;
76 } 105 }
77 106
78 MountParameters::~MountParameters() { 107 MountParameters::~MountParameters() {
79 } 108 }
80 109
81 } // namespace cryptohome 110 } // namespace cryptohome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698