| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 reinterpret_cast<const uint8*>(key_string.data()), | 274 reinterpret_cast<const uint8*>(key_string.data()), |
| 275 reinterpret_cast<const uint8*>(key_string.data() + | 275 reinterpret_cast<const uint8*>(key_string.data() + |
| 276 key_string.length())); | 276 key_string.length())); |
| 277 | 277 |
| 278 scoped_ptr<crypto::RSAPrivateKey> private_key( | 278 scoped_ptr<crypto::RSAPrivateKey> private_key( |
| 279 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); | 279 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); |
| 280 | 280 |
| 281 net::SSLConfig ssl_config; | 281 net::SSLConfig ssl_config; |
| 282 ssl_config.cached_info_enabled = false; | 282 ssl_config.cached_info_enabled = false; |
| 283 ssl_config.false_start_enabled = false; | 283 ssl_config.false_start_enabled = false; |
| 284 ssl_config.origin_bound_certs_enabled = false; | 284 ssl_config.domain_bound_certs_enabled = false; |
| 285 ssl_config.ssl3_enabled = true; | 285 ssl_config.ssl3_enabled = true; |
| 286 ssl_config.tls1_enabled = true; | 286 ssl_config.tls1_enabled = true; |
| 287 | 287 |
| 288 // Certificate provided by the host doesn't need authority. | 288 // Certificate provided by the host doesn't need authority. |
| 289 net::SSLConfig::CertAndStatus cert_and_status; | 289 net::SSLConfig::CertAndStatus cert_and_status; |
| 290 cert_and_status.cert_status = CERT_STATUS_AUTHORITY_INVALID; | 290 cert_and_status.cert_status = CERT_STATUS_AUTHORITY_INVALID; |
| 291 cert_and_status.der_cert = cert_der; | 291 cert_and_status.der_cert = cert_der; |
| 292 ssl_config.allowed_bad_certs.push_back(cert_and_status); | 292 ssl_config.allowed_bad_certs.push_back(cert_and_status); |
| 293 | 293 |
| 294 net::HostPortPair host_and_pair("unittest", 0); | 294 net::HostPortPair host_and_pair("unittest", 0); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 unsigned char client_bad[kKeyingMaterialSize]; | 471 unsigned char client_bad[kKeyingMaterialSize]; |
| 472 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, | 472 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, |
| 473 false, kKeyingContext, | 473 false, kKeyingContext, |
| 474 client_bad, sizeof(client_bad)); | 474 client_bad, sizeof(client_bad)); |
| 475 ASSERT_EQ(rv, net::OK); | 475 ASSERT_EQ(rv, net::OK); |
| 476 EXPECT_TRUE(memcmp(server_out, client_bad, sizeof(server_out)) != 0); | 476 EXPECT_TRUE(memcmp(server_out, client_bad, sizeof(server_out)) != 0); |
| 477 } | 477 } |
| 478 #endif | 478 #endif |
| 479 | 479 |
| 480 } // namespace net | 480 } // namespace net |
| OLD | NEW |