OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "chrome/browser/chromeos/attestation/attestation_key_payload.pb.h" | 10 #include "chrome/browser/chromeos/attestation/attestation_key_payload.pb.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 default: | 220 default: |
221 NOTREACHED(); | 221 NOTREACHED(); |
222 } | 222 } |
223 scoped_ptr<crypto::RSAPrivateKey> test_key( | 223 scoped_ptr<crypto::RSAPrivateKey> test_key( |
224 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo( | 224 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo( |
225 std::vector<uint8>(&kTestKeyData[0], | 225 std::vector<uint8>(&kTestKeyData[0], |
226 &kTestKeyData[arraysize(kTestKeyData)]))); | 226 &kTestKeyData[arraysize(kTestKeyData)]))); |
227 if (!test_key.get()) | 227 if (!test_key.get()) |
228 return false; | 228 return false; |
229 return net::x509_util::CreateSelfSignedCert(test_key.get(), | 229 return net::x509_util::CreateSelfSignedCert(test_key.get(), |
| 230 net::x509_util::DIGEST_SHA256, |
230 "CN=subject", | 231 "CN=subject", |
231 12345, | 232 12345, |
232 valid_start, | 233 valid_start, |
233 valid_expiry, | 234 valid_expiry, |
234 certificate); | 235 certificate); |
235 } | 236 } |
236 | 237 |
237 base::MessageLoop message_loop_; | 238 base::MessageLoop message_loop_; |
238 content::TestBrowserThread ui_thread_; | 239 content::TestBrowserThread ui_thread_; |
239 ScopedTestDeviceSettingsService test_device_settings_service_; | 240 ScopedTestDeviceSettingsService test_device_settings_service_; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 SetupMocks(MOCK_NEW_KEY, ""); | 299 SetupMocks(MOCK_NEW_KEY, ""); |
299 // Simulate a DBus failure. | 300 // Simulate a DBus failure. |
300 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _, _)) | 301 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _, _)) |
301 .WillOnce(WithArgs<3>(Invoke(DBusCallbackError))) | 302 .WillOnce(WithArgs<3>(Invoke(DBusCallbackError))) |
302 .WillRepeatedly(WithArgs<3>(Invoke(DBusCallbackFalse))); | 303 .WillRepeatedly(WithArgs<3>(Invoke(DBusCallbackFalse))); |
303 Run(); | 304 Run(); |
304 } | 305 } |
305 | 306 |
306 } // namespace attestation | 307 } // namespace attestation |
307 } // namespace chromeos | 308 } // namespace chromeos |
OLD | NEW |