diff options
author | mek@chromium.org <mek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-09 23:58:14 +0000 |
---|---|---|
committer | mek@chromium.org <mek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-09 23:58:14 +0000 |
commit | 573ebcb35b5e92124a5de20131fbedeab26ebf12 (patch) | |
tree | fc7f87d7083dff8afb67b6e5a8d5ab5ebfdf6225 /net/quic/crypto | |
parent | 5733b22124b90e9ad8dd5045e9acc173d1545755 (diff) | |
download | chromium_src-573ebcb35b5e92124a5de20131fbedeab26ebf12.zip chromium_src-573ebcb35b5e92124a5de20131fbedeab26ebf12.tar.gz chromium_src-573ebcb35b5e92124a5de20131fbedeab26ebf12.tar.bz2 |
Revert 227827 "Land Recent QUIC changes."
Causing problem for Linux ASAN:
http://build.chromium.org/p/chromium.memory/buildstatus?builder=Linux%20ASAN%20Tests%20%281%29&number=19137
> Land Recent QUIC changes.
>
> Addressing comments in Jana's review of cr/52231261.
>
> Merge internal change: 53582401
>
> Add a temporary legacy quic constructor
>
> Merge internal change: 53506960
>
> QUIC: disable P-256 support on the server.
>
> The P-256 key generation is done with OpenSSL, which doesn't use the
> QuicRandom passed to DefaultConfig(). This is causing the generated
> server configs to be non-deterministic and breaking 0-RTT handshakes.
>
> Merge internal change: 53501783
>
> Fix an LOG to use the correct condition in QuicReceivedPacketManager and
> change it to a DFATAL so in the future tests will prevent re-occurrence.
>
> Merge internal change: 53483753
>
> Cleanup: Rename OnIncomingAck to OnPacketAcked, and remove unneeeded
> argument from SentPacketManager::OnIncomingAck.
>
> Merge internal change: 53483155
>
> Fix a bug in QuicConnection/QuicConnectionHelper if the helper buffered
> the write (as is the case in chrome). In this case, the sent packet was
> not accounted for properly.
>
> Merge internal change: 53462749
>
> Refactor to change WritePacket to return a WriteResult struct.
>
> Merge internal change: 53382221
>
> Fixing a bug where the version negotiation packet would get dropped on
> the floor if the socket was write blocked at the time it was sent. The
> packet is now queued.
>
> Merge internal change: 53317846
>
> Create a new QUIC_INVALID_CHANNEL_ID_SIGNATURE error to replace a usage
> of QUIC_INTERNAL_ERROR.
>
> Merge internal change: 53277933
>
> Added a todo to merge internal CL 53267501 when chromium's version of
> OpenSSL has latest AEAD code.
>
> Didn't merge internal change: 53267501
>
> R=rch@chromium.org
>
> Review URL: https://codereview.chromium.org/26385004
TBR=rtenneti@chromium.org
Review URL: https://codereview.chromium.org/26666003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/crypto')
-rw-r--r-- | net/quic/crypto/aes_128_gcm_12_decrypter.h | 2 | ||||
-rw-r--r-- | net/quic/crypto/aes_128_gcm_12_encrypter.h | 2 | ||||
-rw-r--r-- | net/quic/crypto/crypto_handshake.cc | 2 | ||||
-rw-r--r-- | net/quic/crypto/crypto_server_config.cc | 29 | ||||
-rw-r--r-- | net/quic/crypto/crypto_server_config.h | 5 | ||||
-rw-r--r-- | net/quic/crypto/crypto_server_test.cc | 19 |
6 files changed, 9 insertions, 50 deletions
diff --git a/net/quic/crypto/aes_128_gcm_12_decrypter.h b/net/quic/crypto/aes_128_gcm_12_decrypter.h index aba610f..5dc12c8 100644 --- a/net/quic/crypto/aes_128_gcm_12_decrypter.h +++ b/net/quic/crypto/aes_128_gcm_12_decrypter.h @@ -60,8 +60,6 @@ class NET_EXPORT_PRIVATE Aes128Gcm12Decrypter : public QuicDecrypter { unsigned char nonce_prefix_[4]; #if defined(USE_OPENSSL) - // TODO(rtenneti): when Chromium's version of OpenSSL has EVP_AEAD_CTX, merge - // internal CL 53267501. ScopedEVPCipherCtx ctx_; #endif }; diff --git a/net/quic/crypto/aes_128_gcm_12_encrypter.h b/net/quic/crypto/aes_128_gcm_12_encrypter.h index abea8ac2..ca9a2b1 100644 --- a/net/quic/crypto/aes_128_gcm_12_encrypter.h +++ b/net/quic/crypto/aes_128_gcm_12_encrypter.h @@ -63,8 +63,6 @@ class NET_EXPORT_PRIVATE Aes128Gcm12Encrypter : public QuicEncrypter { unsigned char nonce_prefix_[4]; #if defined(USE_OPENSSL) - // TODO(rtenneti): when Chromium's version of OpenSSL has EVP_AEAD_CTX, merge - // internal CL 53267501. ScopedEVPCipherCtx ctx_; #endif }; diff --git a/net/quic/crypto/crypto_handshake.cc b/net/quic/crypto/crypto_handshake.cc index f5c7f4d..395f4ae 100644 --- a/net/quic/crypto/crypto_handshake.cc +++ b/net/quic/crypto/crypto_handshake.cc @@ -752,7 +752,7 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello( if (!channel_id_signer_->Sign(server_hostname, hkdf_input, &key, &signature)) { *error_details = "Channel ID signature failed"; - return QUIC_INVALID_CHANNEL_ID_SIGNATURE; + return QUIC_INTERNAL_ERROR; } cetv.SetStringPiece(kCIDK, key); diff --git a/net/quic/crypto/crypto_server_config.cc b/net/quic/crypto/crypto_server_config.cc index 7c7d0ff..89cea42 100644 --- a/net/quic/crypto/crypto_server_config.cc +++ b/net/quic/crypto/crypto_server_config.cc @@ -46,8 +46,7 @@ const char QuicCryptoServerConfig::TESTING[] = "secret string for testing"; QuicCryptoServerConfig::ConfigOptions::ConfigOptions() : expiry_time(QuicWallTime::Zero()), - channel_id_enabled(false), - p256(false) {} + channel_id_enabled(false) { } QuicCryptoServerConfig::QuicCryptoServerConfig( StringPiece source_address_token_secret, @@ -98,14 +97,9 @@ QuicServerConfigProtobuf* QuicCryptoServerConfig::DefaultConfig( Curve25519KeyExchange::New(curve25519_private_key)); StringPiece curve25519_public_value = curve25519->public_value(); - string p256_private_key; - StringPiece p256_public_value; - scoped_ptr<P256KeyExchange> p256; - if (options.p256) { - p256_private_key = P256KeyExchange::NewPrivateKey(); - p256.reset(P256KeyExchange::New(p256_private_key)); - p256_public_value = p256->public_value(); - } + const string p256_private_key = P256KeyExchange::NewPrivateKey(); + scoped_ptr<P256KeyExchange> p256(P256KeyExchange::New(p256_private_key)); + StringPiece p256_public_value = p256->public_value(); string encoded_public_values; // First three bytes encode the length of the public value. @@ -121,11 +115,7 @@ QuicServerConfigProtobuf* QuicCryptoServerConfig::DefaultConfig( p256_public_value.size()); msg.set_tag(kSCFG); - if (options.p256) { - msg.SetTaglist(kKEXS, kC255, kP256, 0); - } else { - msg.SetTaglist(kKEXS, kC255, 0); - } + msg.SetTaglist(kKEXS, kC255, kP256, 0); msg.SetTaglist(kAEAD, kAESG, 0); msg.SetValue(kVERS, static_cast<uint16>(0)); msg.SetStringPiece(kPUBS, encoded_public_values); @@ -168,12 +158,9 @@ QuicServerConfigProtobuf* QuicCryptoServerConfig::DefaultConfig( QuicServerConfigProtobuf::PrivateKey* curve25519_key = config->add_key(); curve25519_key->set_tag(kC255); curve25519_key->set_private_key(curve25519_private_key); - - if (options.p256) { - QuicServerConfigProtobuf::PrivateKey* p256_key = config->add_key(); - p256_key->set_tag(kP256); - p256_key->set_private_key(p256_private_key); - } + QuicServerConfigProtobuf::PrivateKey* p256_key = config->add_key(); + p256_key->set_tag(kP256); + p256_key->set_private_key(p256_private_key); return config.release(); } diff --git a/net/quic/crypto/crypto_server_config.h b/net/quic/crypto/crypto_server_config.h index 4551425..4255d22 100644 --- a/net/quic/crypto/crypto_server_config.h +++ b/net/quic/crypto/crypto_server_config.h @@ -61,11 +61,6 @@ class NET_EXPORT_PRIVATE QuicCryptoServerConfig { // orbit contains the kOrbitSize bytes of the orbit value for the server // config. If |orbit| is empty then a random orbit is generated. std::string orbit; - // p256 determines whether a P-256 public key will be included in the - // server config. Note that this breaks deterministic server-config - // generation since P-256 key generation doesn't use the QuicRandom given - // to DefaultConfig(). - bool p256; }; // |source_address_token_secret|: secret key material used for encrypting and diff --git a/net/quic/crypto/crypto_server_test.cc b/net/quic/crypto/crypto_server_test.cc index 348b31a..b2cdf82 100644 --- a/net/quic/crypto/crypto_server_test.cc +++ b/net/quic/crypto/crypto_server_test.cc @@ -8,7 +8,6 @@ #include "net/quic/crypto/quic_random.h" #include "net/quic/test_tools/crypto_test_utils.h" #include "net/quic/test_tools/mock_clock.h" -#include "net/quic/test_tools/mock_random.h" #include "testing/gtest/include/gtest/gtest.h" using base::StringPiece; @@ -240,24 +239,6 @@ TEST_F(CryptoServerTest, ReplayProtection) { ASSERT_EQ(kSHLO, out_.tag()); } -TEST(CryptoServerConfigGenerationTest, Determinism) { - // Test that using a deterministic PRNG causes the server-config to be - // deterministic. - - MockRandom rand_a, rand_b; - const QuicCryptoServerConfig::ConfigOptions options; - MockClock clock; - - QuicCryptoServerConfig a(QuicCryptoServerConfig::TESTING, &rand_a); - QuicCryptoServerConfig b(QuicCryptoServerConfig::TESTING, &rand_b); - scoped_ptr<CryptoHandshakeMessage> scfg_a( - a.AddDefaultConfig(&rand_a, &clock, options)); - scoped_ptr<CryptoHandshakeMessage> scfg_b( - b.AddDefaultConfig(&rand_b, &clock, options)); - - ASSERT_EQ(scfg_a->DebugString(), scfg_b->DebugString()); -} - class CryptoServerTestNoConfig : public CryptoServerTest { public: virtual void SetUp() { |