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

Unified Diff: net/quic/test_tools/crypto_test_utils.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, 5 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 side-by-side diff with in-line comments
Download patch
« crypto/hkdf.h ('K') | « net/quic/quic_crypto_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/crypto_test_utils.cc
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc
index ca0681ac5b317f8c055628e79aacc01cdda04a5e..0e3a81517a7745ec49fd36ac130d6bf1bbff02c6 100644
--- a/net/quic/test_tools/crypto_test_utils.cc
+++ b/net/quic/test_tools/crypto_test_utils.cc
@@ -452,6 +452,26 @@ void CryptoTestUtils::CompareClientAndServerKeys(
StringPiece server_forward_secure_decrypter_iv =
server_forward_secure_decrypter->GetNoncePrefix();
+ StringPiece client_subkey_secret =
+ client->crypto_negotiated_params().subkey_secret;
+ StringPiece server_subkey_secret =
+ server->crypto_negotiated_params().subkey_secret;
+
+
+ const char kSampleLabel[] = "label";
+ const char kSampleContext[] = "context";
+ const size_t kSampleOutputLength = 32;
+ string client_key_extraction;
+ string server_key_extraction;
+ EXPECT_TRUE(client->ExportKeyingMaterial(kSampleLabel,
+ kSampleContext,
+ kSampleOutputLength,
+ &client_key_extraction));
+ EXPECT_TRUE(server->ExportKeyingMaterial(kSampleLabel,
+ kSampleContext,
+ kSampleOutputLength,
+ &server_key_extraction));
+
CompareCharArraysWithHexError("client write key",
client_encrypter_key.data(),
client_encrypter_key.length(),
@@ -492,6 +512,16 @@ void CryptoTestUtils::CompareClientAndServerKeys(
server_forward_secure_encrypter_iv.length(),
client_forward_secure_decrypter_iv.data(),
client_forward_secure_decrypter_iv.length());
+ CompareCharArraysWithHexError("subkey secret",
+ client_subkey_secret.data(),
+ client_subkey_secret.length(),
+ server_subkey_secret.data(),
+ server_subkey_secret.length());
+ CompareCharArraysWithHexError("sample key extraction",
+ client_key_extraction.data(),
+ client_key_extraction.length(),
+ server_key_extraction.data(),
+ server_key_extraction.length());
}
// static
« crypto/hkdf.h ('K') | « net/quic/quic_crypto_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698