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

Unified Diff: net/quic/test_tools/quic_test_utils.cc

Issue 12381018: QUIC - Some sketching of the crypto handshake. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 10 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
Index: net/quic/test_tools/quic_test_utils.cc
===================================================================
--- net/quic/test_tools/quic_test_utils.cc (revision 184750)
+++ net/quic/test_tools/quic_test_utils.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/stl_util.h"
#include "net/quic/crypto/crypto_framer.h"
+#include "net/quic/crypto/crypto_handshake.h"
#include "net/quic/crypto/crypto_utils.h"
using std::max;
@@ -275,28 +276,27 @@
const QuicClock* clock,
QuicRandom* random_generator,
const string& server_hostname) {
- QuicCryptoConfig config;
- config.SetClientDefaults();
+ QuicCryptoClientConfig config;
+ config.SetDefaults();
string nonce;
CryptoUtils::GenerateNonce(clock, random_generator, &nonce);
CryptoHandshakeMessage message;
- CryptoUtils::FillClientHelloMessage(config, nonce, server_hostname,
- &message);
+ config.FillClientHello(nonce, server_hostname, &message);
return ConstructPacketFromHandshakeMessage(guid, message);
}
QuicPacket* ConstructServerHelloPacket(QuicGuid guid,
const QuicClock* clock,
QuicRandom* random_generator) {
- QuicCryptoNegotiatedParams negotiated_params;
- negotiated_params.SetDefaults();
string nonce;
CryptoUtils::GenerateNonce(clock, random_generator, &nonce);
- CryptoHandshakeMessage message;
- CryptoUtils::FillServerHelloMessage(negotiated_params, nonce, &message);
- return ConstructPacketFromHandshakeMessage(guid, message);
+ CryptoHandshakeMessage dummy_client_hello, server_hello;
+ QuicCryptoServerConfig server_config;
+ server_config.AddTestingConfig(random_generator, clock);
+ server_config.ProcessClientHello(dummy_client_hello, nonce, &server_hello);
+ return ConstructPacketFromHandshakeMessage(guid, server_hello);
}
QuicPacketEntropyHash TestEntropyCalculator::ReceivedEntropyHash(
« net/quic/quic_crypto_client_stream.h ('K') | « net/quic/quic_crypto_client_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698