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

Side by Side Diff: components/policy/core/common/cloud/policy_builder.cc

Issue 143183007: Update policy signature verification to include policy domain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed style error. Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/policy/core/common/cloud/policy_builder.h" 5 #include "components/policy/core/common/cloud/policy_builder.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 10 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 0xc4, 0x05, 0xa9, 0xab, 0xba, 0xfe, 0x46, 0xf1, 0xf9, 0xe7, 0x07, 0x59, 42 0xc4, 0x05, 0xa9, 0xab, 0xba, 0xfe, 0x46, 0xf1, 0xf9, 0xe7, 0x07, 0x59,
43 0x4f, 0x4d, 0xe1, 0x07, 0x8a, 0x76, 0x87, 0x88, 0x2f, 0x13, 0x35, 0xc1, 43 0x4f, 0x4d, 0xe1, 0x07, 0x8a, 0x76, 0x87, 0x88, 0x2f, 0x13, 0x35, 0xc1,
44 0x02, 0x20, 0x24, 0xc3, 0xd9, 0x2f, 0x13, 0x47, 0x99, 0x3e, 0x20, 0x59, 44 0x02, 0x20, 0x24, 0xc3, 0xd9, 0x2f, 0x13, 0x47, 0x99, 0x3e, 0x20, 0x59,
45 0xa1, 0x1a, 0xeb, 0x1c, 0x81, 0x53, 0x38, 0x7e, 0xc5, 0x9e, 0x71, 0xe5, 45 0xa1, 0x1a, 0xeb, 0x1c, 0x81, 0x53, 0x38, 0x7e, 0xc5, 0x9e, 0x71, 0xe5,
46 0xc0, 0x19, 0x95, 0xdb, 0xef, 0xf6, 0x46, 0xc8, 0x95, 0x3d, 0x02, 0x21, 46 0xc0, 0x19, 0x95, 0xdb, 0xef, 0xf6, 0x46, 0xc8, 0x95, 0x3d, 0x02, 0x21,
47 0x00, 0xaa, 0xb1, 0xff, 0x8a, 0xa2, 0xb2, 0x2b, 0xef, 0x9a, 0x83, 0x3f, 47 0x00, 0xaa, 0xb1, 0xff, 0x8a, 0xa2, 0xb2, 0x2b, 0xef, 0x9a, 0x83, 0x3f,
48 0xc5, 0xbc, 0xd4, 0x6a, 0x07, 0xe8, 0xc7, 0x0b, 0x2e, 0xd4, 0x0f, 0xf8, 48 0xc5, 0xbc, 0xd4, 0x6a, 0x07, 0xe8, 0xc7, 0x0b, 0x2e, 0xd4, 0x0f, 0xf8,
49 0x98, 0x68, 0xe1, 0x04, 0xa8, 0x92, 0xd0, 0x10, 0xaa, 49 0x98, 0x68, 0xe1, 0x04, 0xa8, 0x92, 0xd0, 0x10, 0xaa,
50 }; 50 };
51 51
52 // SHA256 signature of kSigningKey for "example.com" domain.
53 const uint8 kSigningKeySignature[] = {
54 0x97, 0xEB, 0x13, 0xE6, 0x6C, 0xE2, 0x7A, 0x2F, 0xC6, 0x6E, 0x68, 0x8F,
55 0xED, 0x5B, 0x51, 0x08, 0x27, 0xF0, 0xA5, 0x97, 0x20, 0xEE, 0xE2, 0x9B,
56 0x5B, 0x63, 0xA5, 0x9C, 0xAE, 0x41, 0xFD, 0x34, 0xC4, 0x2E, 0xEB, 0x63,
57 0x10, 0x80, 0x0C, 0x74, 0x77, 0x6E, 0x34, 0x1C, 0x1B, 0x3B, 0x8E, 0x2A,
58 0x3A, 0x7F, 0xF9, 0x73, 0xB6, 0x2B, 0xB6, 0x45, 0xDB, 0x05, 0xE8, 0x5A,
59 0x68, 0x36, 0x05, 0x3C, 0x62, 0x3A, 0x6C, 0x64, 0xDB, 0x0E, 0x61, 0xBD,
60 0x29, 0x1C, 0x61, 0x4B, 0xE0, 0xDA, 0x07, 0xBA, 0x29, 0x81, 0xF0, 0x90,
61 0x58, 0xB8, 0xBB, 0xF4, 0x69, 0xFF, 0x8F, 0x2B, 0x4A, 0x2D, 0x98, 0x51,
62 0x37, 0xF5, 0x52, 0xCB, 0xE3, 0xC4, 0x6D, 0xEC, 0xEA, 0x32, 0x2D, 0xDD,
63 0xD7, 0xFC, 0x43, 0xC6, 0x54, 0xE1, 0xC1, 0x66, 0x43, 0x37, 0x09, 0xE1,
64 0xBF, 0xD1, 0x11, 0xFC, 0xDB, 0xBF, 0xDF, 0x66, 0x53, 0x8F, 0x38, 0x2D,
65 0xAA, 0x89, 0xD2, 0x9F, 0x60, 0x90, 0xB7, 0x05, 0xC2, 0x20, 0x82, 0xE6,
66 0xE0, 0x57, 0x55, 0xFF, 0x5F, 0xC1, 0x76, 0x66, 0x46, 0xF8, 0x67, 0xB8,
67 0x8B, 0x81, 0x53, 0xA9, 0x8B, 0x48, 0x9E, 0x2A, 0xF9, 0x60, 0x57, 0xBA,
68 0xD7, 0x52, 0x97, 0x53, 0xF0, 0x2F, 0x78, 0x68, 0x50, 0x18, 0x12, 0x00,
69 0x5E, 0x8E, 0x2A, 0x62, 0x0D, 0x48, 0xA9, 0xB5, 0x6B, 0xBC, 0xA0, 0x52,
70 0x53, 0xD7, 0x65, 0x23, 0xA4, 0xA5, 0xF5, 0x32, 0x49, 0x2D, 0xB2, 0x77,
71 0x2C, 0x66, 0x97, 0xBA, 0x58, 0xE0, 0x16, 0x1C, 0x8C, 0x02, 0x5D, 0xE0,
72 0x73, 0x2E, 0xDF, 0xB4, 0x2F, 0x4C, 0xA2, 0x11, 0x26, 0xC1, 0xAF, 0xAC,
73 0x73, 0xBC, 0xB6, 0x98, 0xE0, 0x20, 0x61, 0x0E, 0x52, 0x4A, 0x6C, 0x80,
74 0xB5, 0x0C, 0x10, 0x80, 0x09, 0x17, 0xF4, 0x9D, 0xFE, 0xB5, 0xFC, 0x63,
75 0x9A, 0x80, 0x3F, 0x76,
76 };
77
52 // New signing key test data in DER-encoded PKCS8 format. 78 // New signing key test data in DER-encoded PKCS8 format.
53 const uint8 kNewSigningKey[] = { 79 const uint8 kNewSigningKey[] = {
54 0x30, 0x82, 0x01, 0x54, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, 80 0x30, 0x82, 0x01, 0x54, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a,
55 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x82, 81 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x82,
56 0x01, 0x3e, 0x30, 0x82, 0x01, 0x3a, 0x02, 0x01, 0x00, 0x02, 0x41, 0x00, 82 0x01, 0x3e, 0x30, 0x82, 0x01, 0x3a, 0x02, 0x01, 0x00, 0x02, 0x41, 0x00,
57 0x99, 0x98, 0x6b, 0x79, 0x5d, 0x38, 0x33, 0x79, 0x27, 0x0a, 0x2e, 0xb0, 83 0x99, 0x98, 0x6b, 0x79, 0x5d, 0x38, 0x33, 0x79, 0x27, 0x0a, 0x2e, 0xb0,
58 0x89, 0xba, 0xf8, 0xf6, 0x80, 0xde, 0xb0, 0x79, 0xf2, 0xd4, 0x6d, 0xf7, 84 0x89, 0xba, 0xf8, 0xf6, 0x80, 0xde, 0xb0, 0x79, 0xf2, 0xd4, 0x6d, 0xf7,
59 0x3c, 0xa3, 0x97, 0xf6, 0x4a, 0x3c, 0xa5, 0xcc, 0x40, 0x8a, 0xef, 0x59, 85 0x3c, 0xa3, 0x97, 0xf6, 0x4a, 0x3c, 0xa5, 0xcc, 0x40, 0x8a, 0xef, 0x59,
60 0xaa, 0xc2, 0x82, 0x8f, 0xbc, 0x0d, 0x5b, 0x63, 0xc6, 0xaa, 0x72, 0xe2, 86 0xaa, 0xc2, 0x82, 0x8f, 0xbc, 0x0d, 0x5b, 0x63, 0xc6, 0xaa, 0x72, 0xe2,
61 0xf3, 0x57, 0xdd, 0x74, 0x00, 0xb0, 0x42, 0xd6, 0x27, 0xe7, 0x17, 0x61, 87 0xf3, 0x57, 0xdd, 0x74, 0x00, 0xb0, 0x42, 0xd6, 0x27, 0xe7, 0x17, 0x61,
(...skipping 13 matching lines...) Expand all
75 0xbd, 0x72, 0xa3, 0xbb, 0xad, 0x07, 0xcb, 0x13, 0x41, 0xef, 0x4a, 0x07, 101 0xbd, 0x72, 0xa3, 0xbb, 0xad, 0x07, 0xcb, 0x13, 0x41, 0xef, 0x4a, 0x07,
76 0x2e, 0xeb, 0x7d, 0x70, 0x00, 0xe9, 0xeb, 0x88, 0xfa, 0x40, 0xc9, 0x02, 102 0x2e, 0xeb, 0x7d, 0x70, 0x00, 0xe9, 0xeb, 0x88, 0xfa, 0x40, 0xc9, 0x02,
77 0x20, 0x3a, 0xe0, 0xc4, 0xde, 0x10, 0x6e, 0x6a, 0xe1, 0x68, 0x00, 0x26, 103 0x20, 0x3a, 0xe0, 0xc4, 0xde, 0x10, 0x6e, 0x6a, 0xe1, 0x68, 0x00, 0x26,
78 0xb6, 0x21, 0x8a, 0x13, 0x5c, 0x2b, 0x96, 0x00, 0xb0, 0x08, 0x8b, 0x15, 104 0xb6, 0x21, 0x8a, 0x13, 0x5c, 0x2b, 0x96, 0x00, 0xb0, 0x08, 0x8b, 0x15,
79 0x6a, 0x68, 0x9a, 0xb1, 0x23, 0x8a, 0x02, 0xa2, 0xe1, 0x02, 0x21, 0x00, 105 0x6a, 0x68, 0x9a, 0xb1, 0x23, 0x8a, 0x02, 0xa2, 0xe1, 0x02, 0x21, 0x00,
80 0xa3, 0xf2, 0x2d, 0x55, 0xc1, 0x6d, 0x40, 0xfa, 0x1d, 0xf7, 0xba, 0x86, 106 0xa3, 0xf2, 0x2d, 0x55, 0xc1, 0x6d, 0x40, 0xfa, 0x1d, 0xf7, 0xba, 0x86,
81 0xef, 0x50, 0x98, 0xfc, 0xee, 0x09, 0xcc, 0xe7, 0x22, 0xb9, 0x4e, 0x80, 107 0xef, 0x50, 0x98, 0xfc, 0xee, 0x09, 0xcc, 0xe7, 0x22, 0xb9, 0x4e, 0x80,
82 0x32, 0x1a, 0x6b, 0xb3, 0x5f, 0x35, 0xbd, 0xf3, 108 0x32, 0x1a, 0x6b, 0xb3, 0x5f, 0x35, 0xbd, 0xf3,
83 }; 109 };
84 110
111 // SHA256 signature of kNewSigningKey for "example.com" domain.
112 const uint8 kNewSigningKeySignature[] = {
113 0x70, 0xED, 0x27, 0x42, 0x34, 0x69, 0xB6, 0x47, 0x9E, 0x7C, 0xA0, 0xF0,
114 0xE5, 0x0A, 0x49, 0x49, 0x00, 0xDA, 0xBC, 0x70, 0x01, 0xC5, 0x4B, 0xDB,
115 0x47, 0xD5, 0xAF, 0xA1, 0xAD, 0xB7, 0xE4, 0xE1, 0xBD, 0x5A, 0x1C, 0x35,
116 0x44, 0x5A, 0xAA, 0xDB, 0x27, 0xBA, 0xA4, 0xA9, 0xC8, 0xDD, 0xEC, 0xD6,
117 0xEB, 0xFE, 0xDB, 0xE0, 0x03, 0x5C, 0xA6, 0x2E, 0x5A, 0xEC, 0x75, 0x79,
118 0xB8, 0x5F, 0x0A, 0xEE, 0x05, 0xB2, 0x61, 0xDC, 0x58, 0xF0, 0xD1, 0xCB,
119 0x7B, 0x2A, 0xDB, 0xC1, 0x7C, 0x60, 0xE6, 0x3E, 0x87, 0x02, 0x61, 0xE6,
120 0x90, 0xFD, 0x54, 0x65, 0xC7, 0xFF, 0x74, 0x09, 0xD6, 0xAA, 0x8E, 0xDC,
121 0x5B, 0xC8, 0x38, 0x0C, 0x84, 0x0E, 0x84, 0x2E, 0x37, 0x2A, 0x4B, 0xDE,
122 0x31, 0x82, 0x76, 0x1E, 0x77, 0xA5, 0xC1, 0xD5, 0xED, 0xFF, 0xBC, 0xEA,
123 0x91, 0xB7, 0xBC, 0xFF, 0x76, 0x23, 0xE2, 0x78, 0x63, 0x01, 0x47, 0x80,
124 0x47, 0x1F, 0x3A, 0x49, 0xBF, 0x0D, 0xCF, 0x27, 0x70, 0x92, 0xBB, 0xEA,
125 0xB3, 0x92, 0x70, 0xFF, 0x1E, 0x4B, 0x1B, 0xE0, 0x4E, 0x0C, 0x4C, 0x6B,
126 0x5D, 0x77, 0x06, 0xBB, 0xFB, 0x9B, 0x0E, 0x55, 0xB8, 0x8A, 0xF2, 0x45,
127 0xA9, 0xF3, 0x54, 0x3D, 0x0C, 0xAC, 0xA8, 0x15, 0xD2, 0x31, 0x8D, 0x97,
128 0x08, 0x73, 0xC9, 0x0F, 0x1D, 0xDE, 0x10, 0x22, 0xC6, 0x55, 0x53, 0x7F,
129 0x7C, 0x50, 0x16, 0x5A, 0x08, 0xCC, 0x1C, 0x53, 0x9B, 0x02, 0xB8, 0x80,
130 0xB7, 0x46, 0xF5, 0xF1, 0xC7, 0x3D, 0x36, 0xBD, 0x26, 0x02, 0xDE, 0x10,
131 0xAB, 0x5A, 0x03, 0xCD, 0x67, 0x00, 0x1C, 0x23, 0xC7, 0x13, 0xEE, 0x5D,
132 0xAF, 0xC5, 0x1F, 0xE3, 0xA0, 0x54, 0xAC, 0xC2, 0xC9, 0x44, 0xD4, 0x4A,
133 0x09, 0x8E, 0xEB, 0xAE, 0xCA, 0x08, 0x8A, 0x7F, 0x41, 0x7B, 0xD8, 0x2C,
134 0xDD, 0x6F, 0x80, 0xC3,
135 };
136
85 } // namespace 137 } // namespace
86 138
87 // Constants used as dummy data for filling the PolicyData protobuf. 139 // Constants used as dummy data for filling the PolicyData protobuf.
88 const char PolicyBuilder::kFakeDeviceId[] = "device-id"; 140 const char PolicyBuilder::kFakeDeviceId[] = "device-id";
89 const char PolicyBuilder::kFakeDomain[] = "example.com"; 141 const char PolicyBuilder::kFakeDomain[] = "example.com";
90 const char PolicyBuilder::kFakeMachineName[] = "machine-name"; 142 const char PolicyBuilder::kFakeMachineName[] = "machine-name";
91 const char PolicyBuilder::kFakePolicyType[] = "policy type"; 143 const char PolicyBuilder::kFakePolicyType[] = "policy type";
92 const int PolicyBuilder::kFakePublicKeyVersion = 17; 144 const int PolicyBuilder::kFakePublicKeyVersion = 17;
93 const int64 PolicyBuilder::kFakeTimestamp = 365LL * 24 * 60 * 60 * 1000; 145 const int64 PolicyBuilder::kFakeTimestamp = 365LL * 24 * 60 * 60 * 1000;
94 const char PolicyBuilder::kFakeToken[] = "token"; 146 const char PolicyBuilder::kFakeToken[] = "token";
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if (raw_new_signing_key_.empty()) 187 if (raw_new_signing_key_.empty())
136 return scoped_ptr<crypto::RSAPrivateKey>(); 188 return scoped_ptr<crypto::RSAPrivateKey>();
137 return scoped_ptr<crypto::RSAPrivateKey>( 189 return scoped_ptr<crypto::RSAPrivateKey>(
138 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(raw_new_signing_key_)); 190 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(raw_new_signing_key_));
139 } 191 }
140 192
141 void PolicyBuilder::SetDefaultNewSigningKey() { 193 void PolicyBuilder::SetDefaultNewSigningKey() {
142 std::vector<uint8> key(kNewSigningKey, 194 std::vector<uint8> key(kNewSigningKey,
143 kNewSigningKey + arraysize(kNewSigningKey)); 195 kNewSigningKey + arraysize(kNewSigningKey));
144 raw_new_signing_key_.swap(key); 196 raw_new_signing_key_.swap(key);
197 raw_new_signing_key_signature_ = GetTestOtherSigningKeySignature();
145 } 198 }
146 199
147 void PolicyBuilder::SetDefaultInitialSigningKey() { 200 void PolicyBuilder::SetDefaultInitialSigningKey() {
148 std::vector<uint8> key(kSigningKey, 201 std::vector<uint8> key(kSigningKey,
149 kSigningKey + arraysize(kSigningKey)); 202 kSigningKey + arraysize(kSigningKey));
150 raw_new_signing_key_.swap(key); 203 raw_new_signing_key_.swap(key);
204 raw_new_signing_key_signature_ = GetTestSigningKeySignature();
151 UnsetSigningKey(); 205 UnsetSigningKey();
152 } 206 }
153 207
154 void PolicyBuilder::UnsetNewSigningKey() { 208 void PolicyBuilder::UnsetNewSigningKey() {
155 raw_new_signing_key_.clear(); 209 raw_new_signing_key_.clear();
210 raw_new_signing_key_signature_.clear();
156 } 211 }
157 212
158 void PolicyBuilder::Build() { 213 void PolicyBuilder::Build() {
159 if (policy_data_.get()) 214 if (policy_data_.get())
160 CHECK(policy_data_->SerializeToString(policy_.mutable_policy_data())); 215 CHECK(policy_data_->SerializeToString(policy_.mutable_policy_data()));
161 216
162 // Generate signatures if applicable. 217 // Generate signatures if applicable.
163 scoped_ptr<crypto::RSAPrivateKey> policy_signing_key = GetNewSigningKey(); 218 scoped_ptr<crypto::RSAPrivateKey> policy_signing_key = GetNewSigningKey();
164 if (policy_signing_key) { 219 if (policy_signing_key) {
165 // Add the new public key. 220 // Add the new public key.
166 std::vector<uint8> raw_new_public_signing_key; 221 std::vector<uint8> raw_new_public_signing_key;
167 CHECK(policy_signing_key->ExportPublicKey(&raw_new_public_signing_key)); 222 CHECK(policy_signing_key->ExportPublicKey(&raw_new_public_signing_key));
168 policy_.set_new_public_key(vector_as_array(&raw_new_public_signing_key), 223 policy_.set_new_public_key(vector_as_array(&raw_new_public_signing_key),
169 raw_new_public_signing_key.size()); 224 raw_new_public_signing_key.size());
170 225
226 policy_.set_new_public_key_verification_signature(
227 raw_new_signing_key_signature_);
228
171 // The new public key must be signed by the old key. 229 // The new public key must be signed by the old key.
172 scoped_ptr<crypto::RSAPrivateKey> old_signing_key = GetSigningKey(); 230 scoped_ptr<crypto::RSAPrivateKey> old_signing_key = GetSigningKey();
173 if (old_signing_key) { 231 if (old_signing_key) {
174 SignData(policy_.new_public_key(), 232 SignData(policy_.new_public_key(),
175 old_signing_key.get(), 233 old_signing_key.get(),
176 policy_.mutable_new_public_key_signature()); 234 policy_.mutable_new_public_key_signature());
177 } 235 }
178 } else { 236 } else {
179 // No new signing key, so clear the old public key (this allows us to 237 // No new signing key, so clear the old public key (this allows us to
180 // reuse the same PolicyBuilder to build multiple policy blobs). 238 // reuse the same PolicyBuilder to build multiple policy blobs).
(...skipping 30 matching lines...) Expand all
211 // static 269 // static
212 scoped_ptr<crypto::RSAPrivateKey> PolicyBuilder::CreateTestOtherSigningKey() { 270 scoped_ptr<crypto::RSAPrivateKey> PolicyBuilder::CreateTestOtherSigningKey() {
213 std::vector<uint8> raw_new_signing_key( 271 std::vector<uint8> raw_new_signing_key(
214 kNewSigningKey, kNewSigningKey + arraysize(kNewSigningKey)); 272 kNewSigningKey, kNewSigningKey + arraysize(kNewSigningKey));
215 return scoped_ptr<crypto::RSAPrivateKey>( 273 return scoped_ptr<crypto::RSAPrivateKey>(
216 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(raw_new_signing_key)); 274 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(raw_new_signing_key));
217 } 275 }
218 276
219 // static 277 // static
220 std::string PolicyBuilder::GetTestSigningKeySignature() { 278 std::string PolicyBuilder::GetTestSigningKeySignature() {
221 // TODO(atwilson): Return a real verification signature when one is available. 279 return std::string(reinterpret_cast<const char*>(kSigningKeySignature),
222 return std::string(); 280 sizeof(kSigningKeySignature));
223 } 281 }
224 282
225 // static 283 // static
226 std::string PolicyBuilder::GetTestOtherSigningKeySignature() { 284 std::string PolicyBuilder::GetTestOtherSigningKeySignature() {
227 // TODO(atwilson): Return a real verification signature when one is available. 285 return std::string(reinterpret_cast<const char*>(kNewSigningKeySignature),
228 return std::string(); 286 sizeof(kNewSigningKeySignature));
229 } 287 }
230 288
231 void PolicyBuilder::SignData(const std::string& data, 289 void PolicyBuilder::SignData(const std::string& data,
232 crypto::RSAPrivateKey* key, 290 crypto::RSAPrivateKey* key,
233 std::string* signature) { 291 std::string* signature) {
234 scoped_ptr<crypto::SignatureCreator> signature_creator( 292 scoped_ptr<crypto::SignatureCreator> signature_creator(
235 crypto::SignatureCreator::Create(key)); 293 crypto::SignatureCreator::Create(key));
236 signature_creator->Update(reinterpret_cast<const uint8*>(data.c_str()), 294 signature_creator->Update(reinterpret_cast<const uint8*>(data.c_str()),
237 data.size()); 295 data.size());
238 std::vector<uint8> signature_bytes; 296 std::vector<uint8> signature_bytes;
(...skipping 16 matching lines...) Expand all
255 template<> 313 template<>
256 TypedPolicyBuilder<em::ExternalPolicyData>::TypedPolicyBuilder() 314 TypedPolicyBuilder<em::ExternalPolicyData>::TypedPolicyBuilder()
257 : payload_(new em::ExternalPolicyData()) { 315 : payload_(new em::ExternalPolicyData()) {
258 policy_data().set_policy_type(dm_protocol::kChromeExtensionPolicyType); 316 policy_data().set_policy_type(dm_protocol::kChromeExtensionPolicyType);
259 } 317 }
260 318
261 template class TypedPolicyBuilder<em::ExternalPolicyData>; 319 template class TypedPolicyBuilder<em::ExternalPolicyData>;
262 #endif 320 #endif
263 321
264 } // namespace policy 322 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698