| 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 // |
| 11 // 2. FakeDataChannel | 11 // 2. FakeDataChannel |
| 12 // Implements the actual exchange of data between two FakeSockets. | 12 // Implements the actual exchange of data between two FakeSockets. |
| 13 // | 13 // |
| 14 // Implementations of these two classes are included in this file. | 14 // Implementations of these two classes are included in this file. |
| 15 | 15 |
| 16 #include "net/socket/ssl_server_socket.h" | 16 #include "net/socket/ssl_server_socket.h" |
| 17 | 17 |
| 18 #include <stdlib.h> | 18 #include <stdlib.h> |
| 19 | 19 |
| 20 #include <queue> | 20 #include <queue> |
| 21 | 21 |
| 22 #include "base/compiler_specific.h" | 22 #include "base/compiler_specific.h" |
| 23 #include "base/file_util.h" | |
| 24 #include "base/files/file_path.h" | 23 #include "base/files/file_path.h" |
| 24 #include "base/files/file_util.h" |
| 25 #include "base/message_loop/message_loop.h" | 25 #include "base/message_loop/message_loop.h" |
| 26 #include "base/path_service.h" | 26 #include "base/path_service.h" |
| 27 #include "crypto/nss_util.h" | 27 #include "crypto/nss_util.h" |
| 28 #include "crypto/rsa_private_key.h" | 28 #include "crypto/rsa_private_key.h" |
| 29 #include "net/base/address_list.h" | 29 #include "net/base/address_list.h" |
| 30 #include "net/base/completion_callback.h" | 30 #include "net/base/completion_callback.h" |
| 31 #include "net/base/host_port_pair.h" | 31 #include "net/base/host_port_pair.h" |
| 32 #include "net/base/io_buffer.h" | 32 #include "net/base/io_buffer.h" |
| 33 #include "net/base/ip_endpoint.h" | 33 #include "net/base/ip_endpoint.h" |
| 34 #include "net/base/net_errors.h" | 34 #include "net/base/net_errors.h" |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 const char* kKeyingLabelBad = "EXPERIMENTAL-server-socket-test-bad"; | 576 const char* kKeyingLabelBad = "EXPERIMENTAL-server-socket-test-bad"; |
| 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, OK); | 581 ASSERT_EQ(rv, 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 | 584 |
| 585 } // namespace net | 585 } // namespace net |
| OLD | NEW |