OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ | 5 #ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ |
6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ | 6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 22 matching lines...) Expand all Loading... |
33 class QuicServerConfigProtobuf; | 33 class QuicServerConfigProtobuf; |
34 class StrikeRegister; | 34 class StrikeRegister; |
35 class StrikeRegisterClient; | 35 class StrikeRegisterClient; |
36 | 36 |
37 struct ClientHelloInfo; | 37 struct ClientHelloInfo; |
38 | 38 |
39 namespace test { | 39 namespace test { |
40 class QuicCryptoServerConfigPeer; | 40 class QuicCryptoServerConfigPeer; |
41 } // namespace test | 41 } // namespace test |
42 | 42 |
43 enum HandshakeFailureReason { | |
44 HANDSHAKE_OK = 0, | |
45 | |
46 // Failure reasons for an invalid client nonce in CHLO. | |
47 // | |
48 // TODO(rtenneti): Implement capturing of error from strike register. | |
49 CLIENT_NONCE_UNKNOWN_FAILURE = 100, | |
50 // Invalid client nonce. A possible reason, client nonce had incorrect length. | |
51 CLIENT_NONCE_INVALID_FAILURE, | |
52 | |
53 // Failure reasons for an invalid server nonce in CHLO. | |
54 SERVER_NONCE_INVALID_FAILURE = 200, // Nonce had incorrect length. | |
55 SERVER_NONCE_DECRYPTION_FAILURE, // Unbox of nonce failed. | |
56 SERVER_NONCE_NOT_UNIQUE_FAILURE, // Nonce is not unique. | |
57 | |
58 // Failure reasons for an invalid server config in CHLO. | |
59 // | |
60 // Missing Server config id (kSCID) tag. | |
61 SERVER_CONFIG_INCHOATE_HELLO_FAILURE = 300, | |
62 // GetConfigWithScid couldn't find the Server config id (kSCID). | |
63 SERVER_CONFIG_UNKNOWN_CONFIG_FAILURE, | |
64 | |
65 // Failure reasons for an invalid source-address token. | |
66 // | |
67 // Missing Source-address token (kSourceAddressTokenTag) tag. | |
68 SOURCE_ADDRESS_TOKEN_INVALID_FAILURE = 400, | |
69 // Unbox of Source-address token failed. | |
70 SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE, | |
71 // Couldn't parse the unbox'ed Source-address token. | |
72 SOURCE_ADDRESS_TOKEN_PARSE_FAILURE, | |
73 // Source-address token is for a different IP address. | |
74 SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE, | |
75 // The difference between the time in source-address token and |now| is more | |
76 // than |source_address_token_future_secs_|. | |
77 SOURCE_ADDRESS_TOKEN_CLOCK_SKEW_FAILURE, | |
78 // The difference between the time in source-address token and |now| is more | |
79 // than |source_address_token_lifetime_secs_|. | |
80 SOURCE_ADDRESS_TOKEN_EXPIRED_FAILURE, | |
81 }; | |
82 | |
83 // Hook that allows application code to subscribe to primary config changes. | 43 // Hook that allows application code to subscribe to primary config changes. |
84 class PrimaryConfigChangedCallback { | 44 class PrimaryConfigChangedCallback { |
85 public: | 45 public: |
86 PrimaryConfigChangedCallback(); | 46 PrimaryConfigChangedCallback(); |
87 virtual ~PrimaryConfigChangedCallback(); | 47 virtual ~PrimaryConfigChangedCallback(); |
88 virtual void Run(const std::string& scid) = 0; | 48 virtual void Run(const std::string& scid) = 0; |
89 | 49 |
90 private: | 50 private: |
91 DISALLOW_COPY_AND_ASSIGN(PrimaryConfigChangedCallback); | 51 DISALLOW_COPY_AND_ASSIGN(PrimaryConfigChangedCallback); |
92 }; | 52 }; |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 uint32 source_address_token_lifetime_secs_; | 469 uint32 source_address_token_lifetime_secs_; |
510 uint32 server_nonce_strike_register_max_entries_; | 470 uint32 server_nonce_strike_register_max_entries_; |
511 uint32 server_nonce_strike_register_window_secs_; | 471 uint32 server_nonce_strike_register_window_secs_; |
512 | 472 |
513 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerConfig); | 473 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerConfig); |
514 }; | 474 }; |
515 | 475 |
516 } // namespace net | 476 } // namespace net |
517 | 477 |
518 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ | 478 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ |
OLD | NEW |