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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 key_string.length())); | 328 key_string.length())); |
329 | 329 |
330 scoped_ptr<crypto::RSAPrivateKey> private_key( | 330 scoped_ptr<crypto::RSAPrivateKey> private_key( |
331 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); | 331 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); |
332 | 332 |
333 net::SSLConfig ssl_config; | 333 net::SSLConfig ssl_config; |
334 ssl_config.cached_info_enabled = false; | 334 ssl_config.cached_info_enabled = false; |
335 ssl_config.false_start_enabled = false; | 335 ssl_config.false_start_enabled = false; |
336 ssl_config.channel_id_enabled = false; | 336 ssl_config.channel_id_enabled = false; |
337 ssl_config.version_min = SSL_PROTOCOL_VERSION_SSL3; | 337 ssl_config.version_min = SSL_PROTOCOL_VERSION_SSL3; |
338 ssl_config.version_max = SSL_PROTOCOL_VERSION_TLS1; | 338 ssl_config.version_max = SSL_PROTOCOL_VERSION_TLS1_1; |
339 | 339 |
340 // Certificate provided by the host doesn't need authority. | 340 // Certificate provided by the host doesn't need authority. |
341 net::SSLConfig::CertAndStatus cert_and_status; | 341 net::SSLConfig::CertAndStatus cert_and_status; |
342 cert_and_status.cert_status = CERT_STATUS_AUTHORITY_INVALID; | 342 cert_and_status.cert_status = CERT_STATUS_AUTHORITY_INVALID; |
343 cert_and_status.der_cert = cert_der; | 343 cert_and_status.der_cert = cert_der; |
344 ssl_config.allowed_bad_certs.push_back(cert_and_status); | 344 ssl_config.allowed_bad_certs.push_back(cert_and_status); |
345 | 345 |
346 net::HostPortPair host_and_pair("unittest", 0); | 346 net::HostPortPair host_and_pair("unittest", 0); |
347 net::SSLClientSocketContext context; | 347 net::SSLClientSocketContext context; |
348 context.cert_verifier = cert_verifier_.get(); | 348 context.cert_verifier = cert_verifier_.get(); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 unsigned char client_bad[kKeyingMaterialSize]; | 577 unsigned char client_bad[kKeyingMaterialSize]; |
578 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, | 578 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, |
579 false, kKeyingContext, | 579 false, kKeyingContext, |
580 client_bad, sizeof(client_bad)); | 580 client_bad, sizeof(client_bad)); |
581 ASSERT_EQ(rv, net::OK); | 581 ASSERT_EQ(rv, net::OK); |
582 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out))); | 582 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out))); |
583 } | 583 } |
584 #endif | 584 #endif |
585 | 585 |
586 } // namespace net | 586 } // namespace net |
OLD | NEW |