OLD | NEW |
1 // Copyright (c) 2011 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 // |
11 // 2. FakeDataChannel | 11 // 2. FakeDataChannel |
(...skipping 262 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.server_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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 const char* kKeyingLabelBad = "EXPERIMENTAL-server-socket-test-bad"; | 468 const char* kKeyingLabelBad = "EXPERIMENTAL-server-socket-test-bad"; |
469 unsigned char client_bad[kKeyingMaterialSize]; | 469 unsigned char client_bad[kKeyingMaterialSize]; |
470 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, kKeyingContext, | 470 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, kKeyingContext, |
471 client_bad, sizeof(client_bad)); | 471 client_bad, sizeof(client_bad)); |
472 ASSERT_EQ(rv, net::OK); | 472 ASSERT_EQ(rv, net::OK); |
473 EXPECT_TRUE(memcmp(server_out, client_bad, sizeof(server_out)) != 0); | 473 EXPECT_TRUE(memcmp(server_out, client_bad, sizeof(server_out)) != 0); |
474 } | 474 } |
475 #endif | 475 #endif |
476 | 476 |
477 } // namespace net | 477 } // namespace net |
OLD | NEW |