| 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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 } | 632 } |
| 633 | 633 |
| 634 int SpdySession::WriteCredentialFrame(const std::string& origin, | 634 int SpdySession::WriteCredentialFrame(const std::string& origin, |
| 635 SSLClientCertType type, | 635 SSLClientCertType type, |
| 636 const std::string& key, | 636 const std::string& key, |
| 637 const std::string& cert, | 637 const std::string& cert, |
| 638 RequestPriority priority) { | 638 RequestPriority priority) { |
| 639 DCHECK(is_secure_); | 639 DCHECK(is_secure_); |
| 640 unsigned char secret[32]; // 32 bytes from the spec | 640 unsigned char secret[32]; // 32 bytes from the spec |
| 641 GetSSLClientSocket()->ExportKeyingMaterial("SPDY certificate proof", | 641 GetSSLClientSocket()->ExportKeyingMaterial("SPDY certificate proof", |
| 642 origin, | 642 true, origin, |
| 643 secret, arraysize(secret)); | 643 secret, arraysize(secret)); |
| 644 | 644 |
| 645 // Convert the key string into a vector<unit8> | 645 // Convert the key string into a vector<unit8> |
| 646 std::vector<uint8> key_data; | 646 std::vector<uint8> key_data; |
| 647 for (size_t i = 0; i < key.length(); i++) { | 647 for (size_t i = 0; i < key.length(); i++) { |
| 648 key_data.push_back(key[i]); | 648 key_data.push_back(key[i]); |
| 649 } | 649 } |
| 650 | 650 |
| 651 std::vector<uint8> proof; | 651 std::vector<uint8> proof; |
| 652 switch (type) { | 652 switch (type) { |
| (...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1921 SSLClientSocket* SpdySession::GetSSLClientSocket() const { | 1921 SSLClientSocket* SpdySession::GetSSLClientSocket() const { |
| 1922 if (!is_secure_) | 1922 if (!is_secure_) |
| 1923 return NULL; | 1923 return NULL; |
| 1924 SSLClientSocket* ssl_socket = | 1924 SSLClientSocket* ssl_socket = |
| 1925 reinterpret_cast<SSLClientSocket*>(connection_->socket()); | 1925 reinterpret_cast<SSLClientSocket*>(connection_->socket()); |
| 1926 DCHECK(ssl_socket); | 1926 DCHECK(ssl_socket); |
| 1927 return ssl_socket; | 1927 return ssl_socket; |
| 1928 } | 1928 } |
| 1929 | 1929 |
| 1930 } // namespace net | 1930 } // namespace net |
| OLD | NEW |