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

Side by Side Diff: net/quic/quic_crypto_stream.cc

Issue 423333002: Implement QUIC key extraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass a size_t constant as a size_t argument. Created 6 years, 4 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) 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"
11 #include "net/quic/crypto/crypto_utils.h"
11 #include "net/quic/quic_connection.h" 12 #include "net/quic/quic_connection.h"
12 #include "net/quic/quic_session.h" 13 #include "net/quic/quic_session.h"
13 #include "net/quic/quic_utils.h" 14 #include "net/quic/quic_utils.h"
14 15
15 using std::string; 16 using std::string;
16 using base::StringPiece; 17 using base::StringPiece;
17 18
18 namespace net { 19 namespace net {
19 20
20 QuicCryptoStream::QuicCryptoStream(QuicSession* session) 21 QuicCryptoStream::QuicCryptoStream(QuicSession* session)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 56 }
56 57
57 void QuicCryptoStream::SendHandshakeMessage( 58 void QuicCryptoStream::SendHandshakeMessage(
58 const CryptoHandshakeMessage& message) { 59 const CryptoHandshakeMessage& message) {
59 session()->OnCryptoHandshakeMessageSent(message); 60 session()->OnCryptoHandshakeMessageSent(message);
60 const QuicData& data = message.GetSerialized(); 61 const QuicData& data = message.GetSerialized();
61 // TODO(wtc): check the return value. 62 // TODO(wtc): check the return value.
62 WriteOrBufferData(string(data.data(), data.length()), false, NULL); 63 WriteOrBufferData(string(data.data(), data.length()), false, NULL);
63 } 64 }
64 65
66 bool QuicCryptoStream::ExportKeyingMaterial(
67 StringPiece label,
68 StringPiece context,
69 size_t result_len,
70 string* result) const {
71 if (!handshake_confirmed()) {
72 DLOG(ERROR) << "ExportKeyingMaterial was called before forward-secure"
73 << "encryption was established.";
74 return false;
75 }
76 return CryptoUtils::ExportKeyingMaterial(
77 crypto_negotiated_params_.subkey_secret,
78 label,
79 context,
80 result_len,
81 result);
82 }
83
65 const QuicCryptoNegotiatedParameters& 84 const QuicCryptoNegotiatedParameters&
66 QuicCryptoStream::crypto_negotiated_params() const { 85 QuicCryptoStream::crypto_negotiated_params() const {
67 return crypto_negotiated_params_; 86 return crypto_negotiated_params_;
68 } 87 }
69 88
70 } // namespace net 89 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698