OLD | NEW |
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_server_config.h" | 5 #include "net/quic/crypto/crypto_server_config.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "crypto/hkdf.h" | 10 #include "crypto/hkdf.h" |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 void QuicCryptoServerConfig::set_source_address_token_future_secs( | 624 void QuicCryptoServerConfig::set_source_address_token_future_secs( |
625 uint32 future_secs) { | 625 uint32 future_secs) { |
626 source_address_token_future_secs_ = future_secs; | 626 source_address_token_future_secs_ = future_secs; |
627 } | 627 } |
628 | 628 |
629 void QuicCryptoServerConfig::set_source_address_token_lifetime_secs( | 629 void QuicCryptoServerConfig::set_source_address_token_lifetime_secs( |
630 uint32 lifetime_secs) { | 630 uint32 lifetime_secs) { |
631 source_address_token_lifetime_secs_ = lifetime_secs; | 631 source_address_token_lifetime_secs_ = lifetime_secs; |
632 } | 632 } |
633 | 633 |
| 634 void QuicCryptoServerConfig::set_server_nonce_strike_register_max_entries( |
| 635 uint32 max_entries) { |
| 636 DCHECK(!server_nonce_strike_register_.get()); |
| 637 server_nonce_strike_register_max_entries_ = max_entries; |
| 638 } |
| 639 |
| 640 void QuicCryptoServerConfig::set_server_nonce_strike_register_window_secs( |
| 641 uint32 window_secs) { |
| 642 DCHECK(!server_nonce_strike_register_.get()); |
| 643 server_nonce_strike_register_window_secs_ = window_secs; |
| 644 } |
| 645 |
634 string QuicCryptoServerConfig::NewSourceAddressToken( | 646 string QuicCryptoServerConfig::NewSourceAddressToken( |
635 const IPEndPoint& ip, | 647 const IPEndPoint& ip, |
636 QuicRandom* rand, | 648 QuicRandom* rand, |
637 QuicWallTime now) const { | 649 QuicWallTime now) const { |
638 SourceAddressToken source_address_token; | 650 SourceAddressToken source_address_token; |
639 source_address_token.set_ip(ip.ToString()); | 651 source_address_token.set_ip(ip.ToString()); |
640 source_address_token.set_timestamp(now.ToUNIXSeconds()); | 652 source_address_token.set_timestamp(now.ToUNIXSeconds()); |
641 | 653 |
642 return source_address_token_boxer_.Box( | 654 return source_address_token_boxer_.Box( |
643 rand, source_address_token.SerializeAsString()); | 655 rand, source_address_token.SerializeAsString()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 } | 757 } |
746 | 758 |
747 return is_unique; | 759 return is_unique; |
748 } | 760 } |
749 | 761 |
750 QuicCryptoServerConfig::Config::Config() : channel_id_enabled(false) { } | 762 QuicCryptoServerConfig::Config::Config() : channel_id_enabled(false) { } |
751 | 763 |
752 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } | 764 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } |
753 | 765 |
754 } // namespace net | 766 } // namespace net |
OLD | NEW |