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

Side by Side Diff: chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc

Issue 27832002: Sign self-signed certs with SHA256. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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 (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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/webrtc_identity_store.cc » ('j') | content/browser/media/webrtc_identity_store.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698