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 #include "net/socket/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 3131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3142 SSLConfig ssl_config; | 3142 SSLConfig ssl_config; |
3143 ssl_config.token_binding_params.push_back(TB_PARAM_ECDSAP256_SHA256); | 3143 ssl_config.token_binding_params.push_back(TB_PARAM_ECDSAP256_SHA256); |
3144 ssl_config.channel_id_enabled = true; | 3144 ssl_config.channel_id_enabled = true; |
3145 | 3145 |
3146 int rv; | 3146 int rv; |
3147 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); | 3147 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); |
3148 EXPECT_EQ(OK, rv); | 3148 EXPECT_EQ(OK, rv); |
3149 SSLInfo info; | 3149 SSLInfo info; |
3150 EXPECT_TRUE(sock_->GetSSLInfo(&info)); | 3150 EXPECT_TRUE(sock_->GetSSLInfo(&info)); |
3151 EXPECT_TRUE(info.token_binding_negotiated); | 3151 EXPECT_TRUE(info.token_binding_negotiated); |
| 3152 std::string provided_token_binding = sock_->GetProvidedTokenBinding(); |
| 3153 EXPECT_GT(provided_token_binding.length(), 0ull); |
3152 } | 3154 } |
3153 | 3155 |
3154 TEST_F(SSLClientSocketChannelIDTest, TokenBindingFailsWithEmsDisabled) { | 3156 TEST_F(SSLClientSocketChannelIDTest, TokenBindingFailsWithEmsDisabled) { |
3155 SpawnedTestServer::SSLOptions ssl_options; | 3157 SpawnedTestServer::SSLOptions ssl_options; |
3156 ssl_options.supported_token_binding_params.push_back( | 3158 ssl_options.supported_token_binding_params.push_back( |
3157 TB_PARAM_ECDSAP256_SHA256); | 3159 TB_PARAM_ECDSAP256_SHA256); |
3158 ssl_options.disable_extended_master_secret = true; | 3160 ssl_options.disable_extended_master_secret = true; |
3159 ssl_options.disable_channel_id = true; | 3161 ssl_options.disable_channel_id = true; |
3160 ASSERT_TRUE(ConnectToTestServer(ssl_options)); | 3162 ASSERT_TRUE(ConnectToTestServer(ssl_options)); |
3161 | 3163 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3450 ssl_config.channel_id_enabled = true; | 3452 ssl_config.channel_id_enabled = true; |
3451 | 3453 |
3452 int rv; | 3454 int rv; |
3453 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); | 3455 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); |
3454 | 3456 |
3455 EXPECT_EQ(ERR_UNEXPECTED, rv); | 3457 EXPECT_EQ(ERR_UNEXPECTED, rv); |
3456 EXPECT_FALSE(sock_->IsConnected()); | 3458 EXPECT_FALSE(sock_->IsConnected()); |
3457 } | 3459 } |
3458 | 3460 |
3459 } // namespace net | 3461 } // namespace net |
OLD | NEW |