| OLD | NEW |
| 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 // This test suite uses SSLClientSocket to test the implementation of | 5 // This test suite uses SSLClientSocket to test the implementation of |
| 6 // SSLServerSocket. In order to establish connections between the sockets | 6 // SSLServerSocket. In order to establish connections between the sockets |
| 7 // we need two additional classes: | 7 // we need two additional classes: |
| 8 // 1. FakeSocket | 8 // 1. FakeSocket |
| 9 // Connects SSL socket to FakeDataChannel. This class is just a stub. | 9 // Connects SSL socket to FakeDataChannel. This class is just a stub. |
| 10 // | 10 // |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 cert_and_status.cert_status = CERT_STATUS_AUTHORITY_INVALID; | 339 cert_and_status.cert_status = CERT_STATUS_AUTHORITY_INVALID; |
| 340 cert_and_status.der_cert = cert_der; | 340 cert_and_status.der_cert = cert_der; |
| 341 ssl_config.allowed_bad_certs.push_back(cert_and_status); | 341 ssl_config.allowed_bad_certs.push_back(cert_and_status); |
| 342 | 342 |
| 343 net::HostPortPair host_and_pair("unittest", 0); | 343 net::HostPortPair host_and_pair("unittest", 0); |
| 344 net::SSLClientSocketContext context; | 344 net::SSLClientSocketContext context; |
| 345 context.cert_verifier = cert_verifier_.get(); | 345 context.cert_verifier = cert_verifier_.get(); |
| 346 context.transport_security_state = transport_security_state_.get(); | 346 context.transport_security_state = transport_security_state_.get(); |
| 347 client_socket_ = | 347 client_socket_ = |
| 348 socket_factory_->CreateSSLClientSocket( | 348 socket_factory_->CreateSSLClientSocket( |
| 349 client_connection.Pass(), host_and_pair, ssl_config, context); | 349 client_connection.Pass(), host_and_pair, ssl_config, NULL, context); |
| 350 server_socket_ = net::CreateSSLServerSocket( | 350 server_socket_ = net::CreateSSLServerSocket( |
| 351 server_socket.Pass(), | 351 server_socket.Pass(), |
| 352 cert.get(), private_key.get(), net::SSLConfig()); | 352 cert.get(), private_key.get(), net::SSLConfig()); |
| 353 } | 353 } |
| 354 | 354 |
| 355 FakeDataChannel channel_1_; | 355 FakeDataChannel channel_1_; |
| 356 FakeDataChannel channel_2_; | 356 FakeDataChannel channel_2_; |
| 357 scoped_ptr<net::SSLClientSocket> client_socket_; | 357 scoped_ptr<net::SSLClientSocket> client_socket_; |
| 358 scoped_ptr<net::SSLServerSocket> server_socket_; | 358 scoped_ptr<net::SSLServerSocket> server_socket_; |
| 359 net::ClientSocketFactory* socket_factory_; | 359 net::ClientSocketFactory* socket_factory_; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 unsigned char client_bad[kKeyingMaterialSize]; | 576 unsigned char client_bad[kKeyingMaterialSize]; |
| 577 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, | 577 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, |
| 578 false, kKeyingContext, | 578 false, kKeyingContext, |
| 579 client_bad, sizeof(client_bad)); | 579 client_bad, sizeof(client_bad)); |
| 580 ASSERT_EQ(rv, net::OK); | 580 ASSERT_EQ(rv, net::OK); |
| 581 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out))); | 581 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out))); |
| 582 } | 582 } |
| 583 #endif | 583 #endif |
| 584 | 584 |
| 585 } // namespace net | 585 } // namespace net |
| OLD | NEW |