summaryrefslogtreecommitdiffstats
path: root/net/quic/crypto/crypto_server_test.cc
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-25 08:00:19 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-25 08:00:19 +0000
commit300ccd5a125e75bd194cbb9d6a2e20058896a7f1 (patch)
treef54913789684a41a3a6976beca746a41b74ae17f /net/quic/crypto/crypto_server_test.cc
parent6744b4f2f21028ebd268fc1158f5e38b2ee9c087 (diff)
downloadchromium_src-300ccd5a125e75bd194cbb9d6a2e20058896a7f1.zip
chromium_src-300ccd5a125e75bd194cbb9d6a2e20058896a7f1.tar.gz
chromium_src-300ccd5a125e75bd194cbb9d6a2e20058896a7f1.tar.bz2
Add the kCADR (client address) tag to ServerHello.
It allows the server to send the observed client IP address and port to the client. Add the QuicSocketAddressCoder class for serializing and parsing a socket address (IP address and port). Merge internal CL: 60101137 R=rch@chromium.org,rtenneti@chromium.org BUG=none TEST=net_unittests Review URL: https://codereview.chromium.org/145003011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/crypto/crypto_server_test.cc')
-rw-r--r--net/quic/crypto/crypto_server_test.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/quic/crypto/crypto_server_test.cc b/net/quic/crypto/crypto_server_test.cc
index 1d32093..568cd06 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -13,6 +13,7 @@
#include "net/quic/test_tools/delayed_verify_strike_register_client.h"
#include "net/quic/test_tools/mock_clock.h"
#include "net/quic/test_tools/mock_random.h"
+#include "net/quic/test_tools/quic_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::StringPiece;
@@ -38,9 +39,8 @@ class CryptoServerTest : public ::testing::Test {
public:
CryptoServerTest()
: rand_(QuicRandom::GetInstance()),
- config_(QuicCryptoServerConfig::TESTING, rand_),
- addr_(ParseIPLiteralToNumber("192.0.2.33", &ip_) ?
- ip_ : IPAddressNumber(), 1) {
+ client_address_(Loopback4(), 1234),
+ config_(QuicCryptoServerConfig::TESTING, rand_) {
config_.SetProofSource(CryptoTestUtils::ProofSourceForTesting());
supported_versions_ = QuicSupportedVersions();
}
@@ -136,7 +136,7 @@ class CryptoServerTest : public ::testing::Test {
void RunValidate(
const CryptoHandshakeMessage& message,
ValidateClientHelloResultCallback* cb) {
- config_.ValidateClientHello(message, addr_, &clock_, cb);
+ config_.ValidateClientHello(message, client_address_, &clock_, cb);
}
void ShouldFailMentioning(const char* error_substr,
@@ -150,7 +150,7 @@ class CryptoServerTest : public ::testing::Test {
const CryptoHandshakeMessage& message,
bool* called) {
config_.ValidateClientHello(
- message, addr_, &clock_,
+ message, client_address_, &clock_,
new ValidateCallback(this, false, error_substr, called));
}
@@ -160,7 +160,7 @@ class CryptoServerTest : public ::testing::Test {
const char* error_substr) {
string error_details;
QuicErrorCode error = config_.ProcessClientHello(
- result, 1 /* GUID */, addr_,
+ result, 1 /* GUID */, client_address_,
supported_versions_.front(), supported_versions_, &clock_, rand_,
&params_, &out_, &error_details);
@@ -201,13 +201,12 @@ class CryptoServerTest : public ::testing::Test {
protected:
QuicRandom* const rand_;
MockClock clock_;
+ const IPEndPoint client_address_;
QuicVersionVector supported_versions_;
QuicCryptoServerConfig config_;
QuicCryptoServerConfig::ConfigOptions config_options_;
QuicCryptoNegotiatedParameters params_;
CryptoHandshakeMessage out_;
- IPAddressNumber ip_;
- IPEndPoint addr_;
uint8 orbit_[kOrbitSize];
// These strings contain hex escaped values from the server suitable for