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

Side by Side Diff: net/spdy/spdy_session.cc

Issue 1378613004: Set Token-Binding HTTP header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tb-tls-ext-new
Patch Set: fix build issues Created 4 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
OLDNEW
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/spdy/spdy_session.h" 5 #include "net/spdy/spdy_session.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 30 matching lines...) Expand all
41 #include "net/socket/ssl_client_socket.h" 41 #include "net/socket/ssl_client_socket.h"
42 #include "net/spdy/spdy_buffer_producer.h" 42 #include "net/spdy/spdy_buffer_producer.h"
43 #include "net/spdy/spdy_frame_builder.h" 43 #include "net/spdy/spdy_frame_builder.h"
44 #include "net/spdy/spdy_http_utils.h" 44 #include "net/spdy/spdy_http_utils.h"
45 #include "net/spdy/spdy_protocol.h" 45 #include "net/spdy/spdy_protocol.h"
46 #include "net/spdy/spdy_session_pool.h" 46 #include "net/spdy/spdy_session_pool.h"
47 #include "net/spdy/spdy_stream.h" 47 #include "net/spdy/spdy_stream.h"
48 #include "net/ssl/channel_id_service.h" 48 #include "net/ssl/channel_id_service.h"
49 #include "net/ssl/ssl_cipher_suite_names.h" 49 #include "net/ssl/ssl_cipher_suite_names.h"
50 #include "net/ssl/ssl_connection_status_flags.h" 50 #include "net/ssl/ssl_connection_status_flags.h"
51 #include "net/ssl/token_binding.h"
davidben 2016/01/22 00:19:21 Not necessary?
nharper 2016/01/22 19:36:52 Removed.
51 52
52 namespace net { 53 namespace net {
53 54
54 namespace { 55 namespace {
55 56
56 const int kReadBufferSize = 8 * 1024; 57 const int kReadBufferSize = 8 * 1024;
57 const int kDefaultConnectionAtRiskOfLossSeconds = 10; 58 const int kDefaultConnectionAtRiskOfLossSeconds = 10;
58 const int kHungIntervalSeconds = 10; 59 const int kHungIntervalSeconds = 10;
59 60
60 // Minimum seconds that unclaimed pushed streams will be kept in memory. 61 // Minimum seconds that unclaimed pushed streams will be kept in memory.
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 } 2041 }
2041 2042
2042 bool SpdySession::GetSSLInfo(SSLInfo* ssl_info, 2043 bool SpdySession::GetSSLInfo(SSLInfo* ssl_info,
2043 bool* was_npn_negotiated, 2044 bool* was_npn_negotiated,
2044 NextProto* protocol_negotiated) { 2045 NextProto* protocol_negotiated) {
2045 *was_npn_negotiated = connection_->socket()->WasNpnNegotiated(); 2046 *was_npn_negotiated = connection_->socket()->WasNpnNegotiated();
2046 *protocol_negotiated = connection_->socket()->GetNegotiatedProtocol(); 2047 *protocol_negotiated = connection_->socket()->GetNegotiatedProtocol();
2047 return connection_->socket()->GetSSLInfo(ssl_info); 2048 return connection_->socket()->GetSSLInfo(ssl_info);
2048 } 2049 }
2049 2050
2051 int SpdySession::GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key,
2052 std::vector<uint8_t>* out) {
2053 if (!is_secure_) {
2054 NOTREACHED();
2055 return ERR_FAILED;
2056 }
2057 SSLClientSocket* ssl_socket =
2058 static_cast<SSLClientSocket*>(connection_->socket());
2059 return ssl_socket->GetSignedEKMForTokenBinding(key, out);
2060 }
2061
2050 void SpdySession::OnError(SpdyFramer::SpdyError error_code) { 2062 void SpdySession::OnError(SpdyFramer::SpdyError error_code) {
2051 CHECK(in_io_loop_); 2063 CHECK(in_io_loop_);
2052 2064
2053 RecordProtocolErrorHistogram(MapFramerErrorToProtocolError(error_code)); 2065 RecordProtocolErrorHistogram(MapFramerErrorToProtocolError(error_code));
2054 std::string description = 2066 std::string description =
2055 base::StringPrintf("Framer error: %d (%s).", 2067 base::StringPrintf("Framer error: %d (%s).",
2056 error_code, 2068 error_code,
2057 SpdyFramer::ErrorCodeToString(error_code)); 2069 SpdyFramer::ErrorCodeToString(error_code));
2058 DoDrainSession(MapFramerErrorToNetError(error_code), description); 2070 DoDrainSession(MapFramerErrorToNetError(error_code), description);
2059 } 2071 }
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
3322 if (!queue->empty()) { 3334 if (!queue->empty()) {
3323 SpdyStreamId stream_id = queue->front(); 3335 SpdyStreamId stream_id = queue->front();
3324 queue->pop_front(); 3336 queue->pop_front();
3325 return stream_id; 3337 return stream_id;
3326 } 3338 }
3327 } 3339 }
3328 return 0; 3340 return 0;
3329 } 3341 }
3330 3342
3331 } // namespace net 3343 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698