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

Side by Side Diff: net/quic/crypto/crypto_handshake_test.cc

Issue 13976007: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated copyright notice Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/crypto/crypto_handshake.cc ('k') | net/quic/crypto/crypto_protocol.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/crypto/crypto_handshake.h" 5 #include "net/quic/crypto/crypto_handshake.h"
6 6
7 #include "net/quic/crypto/aes_128_gcm_encrypter.h" 7 #include "net/quic/crypto/aes_128_gcm_encrypter.h"
8 #include "net/quic/crypto/quic_random.h" 8 #include "net/quic/crypto/quic_random.h"
9 #include "net/quic/quic_time.h" 9 #include "net/quic/quic_time.h"
10 #include "net/quic/test_tools/mock_clock.h" 10 #include "net/quic/test_tools/mock_clock.h"
(...skipping 27 matching lines...) Expand all
38 private: 38 private:
39 QuicCryptoServerConfig* const server_config_; 39 QuicCryptoServerConfig* const server_config_;
40 }; 40 };
41 41
42 TEST(QuicCryptoServerConfigTest, ServerConfig) { 42 TEST(QuicCryptoServerConfigTest, ServerConfig) {
43 QuicCryptoServerConfig server("source address token secret"); 43 QuicCryptoServerConfig server("source address token secret");
44 MockClock clock; 44 MockClock clock;
45 CryptoHandshakeMessage extra_tags; 45 CryptoHandshakeMessage extra_tags;
46 46
47 scoped_ptr<CryptoHandshakeMessage>( 47 scoped_ptr<CryptoHandshakeMessage>(
48 server.AddTestingConfig(QuicRandom::GetInstance(), &clock, extra_tags)); 48 server.AddDefaultConfig(QuicRandom::GetInstance(), &clock, extra_tags));
49 } 49 }
50 50
51 TEST(QuicCryptoServerConfigTest, SourceAddressTokens) { 51 TEST(QuicCryptoServerConfigTest, SourceAddressTokens) {
52 if (!Aes128GcmEncrypter::IsSupported()) { 52 if (!Aes128GcmEncrypter::IsSupported()) {
53 LOG(INFO) << "AES GCM not supported. Test skipped."; 53 LOG(INFO) << "AES GCM not supported. Test skipped.";
54 return; 54 return;
55 } 55 }
56 56
57 QuicCryptoServerConfig server("source address token secret"); 57 QuicCryptoServerConfig server("source address token secret");
58 IPAddressNumber ip; 58 IPAddressNumber ip;
(...skipping 16 matching lines...) Expand all
75 75
76 now = original_time.Add(QuicTime::Delta::FromSeconds(86400 * 7)); 76 now = original_time.Add(QuicTime::Delta::FromSeconds(86400 * 7));
77 EXPECT_FALSE(peer.ValidateSourceAddressToken(token4, ip4, now)); 77 EXPECT_FALSE(peer.ValidateSourceAddressToken(token4, ip4, now));
78 78
79 now = original_time.Subtract(QuicTime::Delta::FromSeconds(3600 * 2)); 79 now = original_time.Subtract(QuicTime::Delta::FromSeconds(3600 * 2));
80 EXPECT_FALSE(peer.ValidateSourceAddressToken(token4, ip4, now)); 80 EXPECT_FALSE(peer.ValidateSourceAddressToken(token4, ip4, now));
81 } 81 }
82 82
83 } // namespace test 83 } // namespace test
84 } // namespace net 84 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_handshake.cc ('k') | net/quic/crypto/crypto_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698