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/quic/quic_crypto_stream.h" | 5 #include "net/quic/quic_crypto_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
10 #include "net/quic/crypto/crypto_handshake.h" | 10 #include "net/quic/crypto/crypto_handshake.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 SendHandshakeMessage(message, nullptr); | 65 SendHandshakeMessage(message, nullptr); |
66 } | 66 } |
67 | 67 |
68 void QuicCryptoStream::SendHandshakeMessage( | 68 void QuicCryptoStream::SendHandshakeMessage( |
69 const CryptoHandshakeMessage& message, | 69 const CryptoHandshakeMessage& message, |
70 QuicAckListenerInterface* listener) { | 70 QuicAckListenerInterface* listener) { |
71 DVLOG(1) << ENDPOINT << "Sending " << message.DebugString(); | 71 DVLOG(1) << ENDPOINT << "Sending " << message.DebugString(); |
72 session()->OnCryptoHandshakeMessageSent(message); | 72 session()->OnCryptoHandshakeMessageSent(message); |
73 const QuicData& data = message.GetSerialized(); | 73 const QuicData& data = message.GetSerialized(); |
74 // TODO(wtc): check the return value. | 74 // TODO(wtc): check the return value. |
75 WriteOrBufferData(string(data.data(), data.length()), false, listener); | 75 WriteOrBufferData(StringPiece(data.data(), data.length()), false, listener); |
76 } | 76 } |
77 | 77 |
78 bool QuicCryptoStream::ExportKeyingMaterial(StringPiece label, | 78 bool QuicCryptoStream::ExportKeyingMaterial(StringPiece label, |
79 StringPiece context, | 79 StringPiece context, |
80 size_t result_len, | 80 size_t result_len, |
81 string* result) const { | 81 string* result) const { |
82 if (!handshake_confirmed()) { | 82 if (!handshake_confirmed()) { |
83 DLOG(ERROR) << "ExportKeyingMaterial was called before forward-secure" | 83 DLOG(ERROR) << "ExportKeyingMaterial was called before forward-secure" |
84 << "encryption was established."; | 84 << "encryption was established."; |
85 return false; | 85 return false; |
(...skipping 13 matching lines...) Expand all Loading... |
99 crypto_negotiated_params_.initial_subkey_secret, "EXPORTER-Token-Binding", | 99 crypto_negotiated_params_.initial_subkey_secret, "EXPORTER-Token-Binding", |
100 /* context= */ "", 32, result); | 100 /* context= */ "", 32, result); |
101 } | 101 } |
102 | 102 |
103 const QuicCryptoNegotiatedParameters& | 103 const QuicCryptoNegotiatedParameters& |
104 QuicCryptoStream::crypto_negotiated_params() const { | 104 QuicCryptoStream::crypto_negotiated_params() const { |
105 return crypto_negotiated_params_; | 105 return crypto_negotiated_params_; |
106 } | 106 } |
107 | 107 |
108 } // namespace net | 108 } // namespace net |
OLD | NEW |