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 | |
646 string QuicCryptoServerConfig::NewSourceAddressToken( | 634 string QuicCryptoServerConfig::NewSourceAddressToken( |
647 const IPEndPoint& ip, | 635 const IPEndPoint& ip, |
648 QuicRandom* rand, | 636 QuicRandom* rand, |
649 QuicWallTime now) const { | 637 QuicWallTime now) const { |
650 SourceAddressToken source_address_token; | 638 SourceAddressToken source_address_token; |
651 source_address_token.set_ip(ip.ToString()); | 639 source_address_token.set_ip(ip.ToString()); |
652 source_address_token.set_timestamp(now.ToUNIXSeconds()); | 640 source_address_token.set_timestamp(now.ToUNIXSeconds()); |
653 | 641 |
654 return source_address_token_boxer_.Box( | 642 return source_address_token_boxer_.Box( |
655 rand, source_address_token.SerializeAsString()); | 643 rand, source_address_token.SerializeAsString()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 } | 745 } |
758 | 746 |
759 return is_unique; | 747 return is_unique; |
760 } | 748 } |
761 | 749 |
762 QuicCryptoServerConfig::Config::Config() : channel_id_enabled(false) { } | 750 QuicCryptoServerConfig::Config::Config() : channel_id_enabled(false) { } |
763 | 751 |
764 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } | 752 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } |
765 | 753 |
766 } // namespace net | 754 } // namespace net |
OLD | NEW |