Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: net/socket/socket_test_util.cc

Issue 6017010: Ensure that when using False Start + client auth, bad client certificates are not cached (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac compile Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "net/base/address_family.h" 15 #include "net/base/address_family.h"
16 #include "net/base/auth.h" 16 #include "net/base/auth.h"
17 #include "net/base/host_resolver_proc.h" 17 #include "net/base/host_resolver_proc.h"
18 #include "net/base/ssl_cert_request_info.h"
18 #include "net/base/ssl_info.h" 19 #include "net/base/ssl_info.h"
19 #include "net/http/http_network_session.h" 20 #include "net/http/http_network_session.h"
20 #include "net/http/http_request_headers.h" 21 #include "net/http/http_request_headers.h"
21 #include "net/http/http_response_headers.h" 22 #include "net/http/http_response_headers.h"
22 #include "net/socket/client_socket_pool_histograms.h" 23 #include "net/socket/client_socket_pool_histograms.h"
23 #include "net/socket/socket.h" 24 #include "net/socket/socket.h"
24 #include "net/socket/ssl_host_info.h" 25 #include "net/socket/ssl_host_info.h"
25 #include "testing/gtest/include/gtest/gtest.h" 26 #include "testing/gtest/include/gtest/gtest.h"
26 27
27 #define NET_TRACE(level, s) DLOG(level) << s << __FUNCTION__ << "() " 28 #define NET_TRACE(level, s) DLOG(level) << s << __FUNCTION__ << "() "
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 525
525 int MockSSLClientSocket::Write(net::IOBuffer* buf, int buf_len, 526 int MockSSLClientSocket::Write(net::IOBuffer* buf, int buf_len,
526 net::CompletionCallback* callback) { 527 net::CompletionCallback* callback) {
527 return transport_->socket()->Write(buf, buf_len, callback); 528 return transport_->socket()->Write(buf, buf_len, callback);
528 } 529 }
529 530
530 void MockSSLClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) { 531 void MockSSLClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) {
531 ssl_info->Reset(); 532 ssl_info->Reset();
532 } 533 }
533 534
535 void MockSSLClientSocket::GetSSLCertRequestInfo(
536 net::SSLCertRequestInfo* cert_request_info) {
537 DCHECK(cert_request_info);
538 if (data_->cert_request_info) {
539 cert_request_info->host_and_port =
540 data_->cert_request_info->host_and_port;
541 cert_request_info->client_certs = data_->cert_request_info->client_certs;
wtc 2011/01/12 00:21:09 Would it be better to just do a struct copy here?
Ryan Sleevi 2011/01/12 00:40:07 Yes. However, because SSLCertRequestInfo is RefCou
542 } else {
543 cert_request_info->Reset();
544 }
545 }
546
534 SSLClientSocket::NextProtoStatus MockSSLClientSocket::GetNextProto( 547 SSLClientSocket::NextProtoStatus MockSSLClientSocket::GetNextProto(
535 std::string* proto) { 548 std::string* proto) {
536 *proto = data_->next_proto; 549 *proto = data_->next_proto;
537 return data_->next_proto_status; 550 return data_->next_proto_status;
538 } 551 }
539 552
540 bool MockSSLClientSocket::was_npn_negotiated() const { 553 bool MockSSLClientSocket::was_npn_negotiated() const {
541 if (is_npn_state_set_) 554 if (is_npn_state_set_)
542 return new_npn_value_; 555 return new_npn_value_;
543 return data_->was_npn_negotiated; 556 return data_->was_npn_negotiated;
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 1290
1278 const char kSOCKS5OkRequest[] = 1291 const char kSOCKS5OkRequest[] =
1279 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; 1292 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 };
1280 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); 1293 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest);
1281 1294
1282 const char kSOCKS5OkResponse[] = 1295 const char kSOCKS5OkResponse[] =
1283 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; 1296 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 };
1284 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); 1297 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse);
1285 1298
1286 } // namespace net 1299 } // namespace net
OLDNEW
« net/http/http_network_transaction.cc ('K') | « net/socket/socket_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698