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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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_; |
360 scoped_ptr<net::MockCertVerifier> cert_verifier_; | 360 scoped_ptr<net::MockCertVerifier> cert_verifier_; |
361 scoped_ptr<net::TransportSecurityState> transport_security_state_; | 361 scoped_ptr<net::TransportSecurityState> transport_security_state_; |
362 }; | 362 }; |
363 | 363 |
364 // SSLServerSocket is only implemented using NSS. | 364 #if defined(USE_NSS) || defined(USE_OPENSSL) || defined(OS_WIN) || defined(OS_MA COSX) |
Ryan Sleevi
2014/05/12 01:35:25
This whole #ifdef should be removed if it's now su
byungchul
2014/05/12 18:25:23
Done.
| |
365 #if defined(USE_NSS) || defined(OS_WIN) || defined(OS_MACOSX) | |
366 | 365 |
367 // This test only executes creation of client and server sockets. This is to | 366 // This test only executes creation of client and server sockets. This is to |
368 // test that creation of sockets doesn't crash and have minimal code to run | 367 // test that creation of sockets doesn't crash and have minimal code to run |
369 // under valgrind in order to help debugging memory problems. | 368 // under valgrind in order to help debugging memory problems. |
370 TEST_F(SSLServerSocketTest, Initialize) { | 369 TEST_F(SSLServerSocketTest, Initialize) { |
371 Initialize(); | 370 Initialize(); |
372 } | 371 } |
373 | 372 |
374 // This test executes Connect() on SSLClientSocket and Handshake() on | 373 // This test executes Connect() on SSLClientSocket and Handshake() on |
375 // SSLServerSocket to make sure handshaking between the two sockets is | 374 // SSLServerSocket to make sure handshaking between the two sockets is |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
576 unsigned char client_bad[kKeyingMaterialSize]; | 575 unsigned char client_bad[kKeyingMaterialSize]; |
577 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, | 576 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, |
578 false, kKeyingContext, | 577 false, kKeyingContext, |
579 client_bad, sizeof(client_bad)); | 578 client_bad, sizeof(client_bad)); |
580 ASSERT_EQ(rv, net::OK); | 579 ASSERT_EQ(rv, net::OK); |
581 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out))); | 580 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out))); |
582 } | 581 } |
583 #endif | 582 #endif |
584 | 583 |
585 } // namespace net | 584 } // namespace net |
OLD | NEW |