summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_crypto_stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/quic/quic_crypto_stream.cc')
-rw-r--r--net/quic/quic_crypto_stream.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/quic/quic_crypto_stream.cc b/net/quic/quic_crypto_stream.cc
index 36b7c45..d53b736 100644
--- a/net/quic/quic_crypto_stream.cc
+++ b/net/quic/quic_crypto_stream.cc
@@ -8,6 +8,7 @@
#include "base/strings/string_piece.h"
#include "net/quic/crypto/crypto_handshake.h"
+#include "net/quic/crypto/crypto_utils.h"
#include "net/quic/quic_connection.h"
#include "net/quic/quic_session.h"
#include "net/quic/quic_utils.h"
@@ -62,6 +63,24 @@ void QuicCryptoStream::SendHandshakeMessage(
WriteOrBufferData(string(data.data(), data.length()), false, NULL);
}
+bool QuicCryptoStream::ExportKeyingMaterial(
+ StringPiece label,
+ StringPiece context,
+ size_t result_len,
+ string* result) const {
+ if (!handshake_confirmed()) {
+ DLOG(ERROR) << "ExportKeyingMaterial was called before forward-secure"
+ << "encryption was established.";
+ return false;
+ }
+ return CryptoUtils::ExportKeyingMaterial(
+ crypto_negotiated_params_.subkey_secret,
+ label,
+ context,
+ result_len,
+ result);
+}
+
const QuicCryptoNegotiatedParameters&
QuicCryptoStream::crypto_negotiated_params() const {
return crypto_negotiated_params_;