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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 2600053002: net: change ImportFromPKCS12() to take a PK11SlotInfo* (Closed)
Patch Set: REBASE Created 3 years, 11 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 (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 <utility> 5 #include <utility>
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 }; 1300 };
1301 1301
1302 // SSL client certificate tests are only enabled when using NSS for private key 1302 // SSL client certificate tests are only enabled when using NSS for private key
1303 // storage, as only NSS can avoid modifying global machine state when testing. 1303 // storage, as only NSS can avoid modifying global machine state when testing.
1304 // See http://crbug.com/51132 1304 // See http://crbug.com/51132
1305 1305
1306 // Visit a HTTPS page which requires client cert authentication. The client 1306 // Visit a HTTPS page which requires client cert authentication. The client
1307 // cert will be selected automatically, then a test which uses WebSocket runs. 1307 // cert will be selected automatically, then a test which uses WebSocket runs.
1308 IN_PROC_BROWSER_TEST_F(SSLUITestWithClientCert, TestWSSClientCert) { 1308 IN_PROC_BROWSER_TEST_F(SSLUITestWithClientCert, TestWSSClientCert) {
1309 // Import a client cert for test. 1309 // Import a client cert for test.
1310 scoped_refptr<net::CryptoModule> crypt_module = cert_db_->GetPublicModule(); 1310 crypto::ScopedPK11Slot public_slot = cert_db_->GetPublicSlot();
1311 std::string pkcs12_data; 1311 std::string pkcs12_data;
1312 base::FilePath cert_path = net::GetTestCertsDirectory().Append( 1312 base::FilePath cert_path = net::GetTestCertsDirectory().Append(
1313 FILE_PATH_LITERAL("websocket_client_cert.p12")); 1313 FILE_PATH_LITERAL("websocket_client_cert.p12"));
1314 EXPECT_TRUE(base::ReadFileToString(cert_path, &pkcs12_data)); 1314 EXPECT_TRUE(base::ReadFileToString(cert_path, &pkcs12_data));
1315 EXPECT_EQ(net::OK, 1315 EXPECT_EQ(net::OK, cert_db_->ImportFromPKCS12(public_slot.get(), pkcs12_data,
1316 cert_db_->ImportFromPKCS12( 1316 base::string16(), true, NULL));
1317 crypt_module.get(), pkcs12_data, base::string16(), true, NULL));
1318 1317
1319 // Start WebSocket test server with TLS and client cert authentication. 1318 // Start WebSocket test server with TLS and client cert authentication.
1320 net::SpawnedTestServer::SSLOptions options( 1319 net::SpawnedTestServer::SSLOptions options(
1321 net::SpawnedTestServer::SSLOptions::CERT_OK); 1320 net::SpawnedTestServer::SSLOptions::CERT_OK);
1322 options.request_client_certificate = true; 1321 options.request_client_certificate = true;
1323 base::FilePath ca_path = net::GetTestCertsDirectory().Append( 1322 base::FilePath ca_path = net::GetTestCertsDirectory().Append(
1324 FILE_PATH_LITERAL("websocket_cacert.pem")); 1323 FILE_PATH_LITERAL("websocket_cacert.pem"));
1325 options.client_authorities.push_back(ca_path); 1324 options.client_authorities.push_back(ca_path);
1326 net::SpawnedTestServer wss_server(net::SpawnedTestServer::TYPE_WSS, 1325 net::SpawnedTestServer wss_server(net::SpawnedTestServer::TYPE_WSS,
1327 options, 1326 options,
(...skipping 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after
3889 3888
3890 // Visit a page over https that contains a frame with a redirect. 3889 // Visit a page over https that contains a frame with a redirect.
3891 3890
3892 // XMLHttpRequest insecure content in synchronous mode. 3891 // XMLHttpRequest insecure content in synchronous mode.
3893 3892
3894 // XMLHttpRequest insecure content in asynchronous mode. 3893 // XMLHttpRequest insecure content in asynchronous mode.
3895 3894
3896 // XMLHttpRequest over bad ssl in synchronous mode. 3895 // XMLHttpRequest over bad ssl in synchronous mode.
3897 3896
3898 // XMLHttpRequest over OK ssl in synchronous mode. 3897 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « chrome/browser/certificate_manager_model.cc ('k') | chrome/browser/ui/webui/options/certificate_manager_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698