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 #ifndef NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ | 5 #ifndef NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ |
6 #define NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ | 6 #define NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
13 #include "net/quic/quic_protocol.h" | 13 #include "net/quic/quic_protocol.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 | 16 |
17 class CommonCertSets; | 17 class CommonCertSets; |
18 class KeyExchange; | 18 class KeyExchange; |
19 class QuicDecrypter; | 19 class QuicDecrypter; |
20 class QuicEncrypter; | 20 class QuicEncrypter; |
21 | 21 |
22 // HandshakeFailureReason enum values are uploaded to UMA, they cannot be | 22 // HandshakeFailureReason enum values are uploaded to UMA, they cannot be |
23 // changed. | 23 // changed. |
24 enum HandshakeFailureReason { | 24 enum HandshakeFailureReason { |
25 HANDSHAKE_OK = 0, | 25 HANDSHAKE_OK = 0, |
26 | 26 |
27 // Failure reasons for an invalid client nonce in CHLO. | 27 // Failure reasons for an invalid client nonce in CHLO. |
28 // | 28 // |
| 29 // The default error value for nonce verification failures from strike |
| 30 // register (covers old strike registers and unknown failures). |
| 31 CLIENT_NONCE_UNKNOWN_FAILURE = 1, |
29 // Client nonce had incorrect length. | 32 // Client nonce had incorrect length. |
30 CLIENT_NONCE_INVALID_FAILURE = 1, | 33 CLIENT_NONCE_INVALID_FAILURE = 2, |
31 // Client nonce is not unique. | 34 // Client nonce is not unique. |
32 CLIENT_NONCE_NOT_UNIQUE_FAILURE = 2, | 35 CLIENT_NONCE_NOT_UNIQUE_FAILURE = 3, |
33 // Client orbit is invalid or incorrect. | 36 // Client orbit is invalid or incorrect. |
34 CLIENT_NONCE_INVALID_ORBIT_FAILURE = 3, | 37 CLIENT_NONCE_INVALID_ORBIT_FAILURE = 4, |
35 // Client nonce's timestamp is not in the strike register's valid time range. | 38 // Client nonce's timestamp is not in the strike register's valid time range. |
36 CLIENT_NONCE_INVALID_TIME_FAILURE = 4, | 39 CLIENT_NONCE_INVALID_TIME_FAILURE = 5, |
37 // Client nonce verification has failed because strike register is down. | 40 // Strike register's RPC call timed out, client nonce couldn't be verified. |
38 CLIENT_NONCE_NO_STRIKE_REGISTER_FAILURE = 5, | 41 CLIENT_NONCE_STRIKE_REGISTER_TIMEOUT = 6, |
| 42 // Strike register is down, client nonce couldn't be verified. |
| 43 CLIENT_NONCE_STRIKE_REGISTER_FAILURE = 7, |
39 | 44 |
40 // Failure reasons for an invalid server nonce in CHLO. | 45 // Failure reasons for an invalid server nonce in CHLO. |
41 // | 46 // |
42 // Unbox of server nonce failed. | 47 // Unbox of server nonce failed. |
43 SERVER_NONCE_DECRYPTION_FAILURE = 6, | 48 SERVER_NONCE_DECRYPTION_FAILURE = 8, |
44 // Decrypted server nonce had incorrect length. | 49 // Decrypted server nonce had incorrect length. |
45 SERVER_NONCE_INVALID_FAILURE = 7, | 50 SERVER_NONCE_INVALID_FAILURE = 9, |
46 // Server nonce is not unique. | 51 // Server nonce is not unique. |
47 SERVER_NONCE_NOT_UNIQUE_FAILURE = 8, | 52 SERVER_NONCE_NOT_UNIQUE_FAILURE = 10, |
48 // Server nonce's timestamp is not in the strike register's valid time range. | 53 // Server nonce's timestamp is not in the strike register's valid time range. |
49 SERVER_NONCE_INVALID_TIME_FAILURE = 9, | 54 SERVER_NONCE_INVALID_TIME_FAILURE = 11, |
50 | 55 |
51 // Failure reasons for an invalid server config in CHLO. | 56 // Failure reasons for an invalid server config in CHLO. |
52 // | 57 // |
53 // Missing Server config id (kSCID) tag. | 58 // Missing Server config id (kSCID) tag. |
54 SERVER_CONFIG_INCHOATE_HELLO_FAILURE = 10, | 59 SERVER_CONFIG_INCHOATE_HELLO_FAILURE = 12, |
55 // Couldn't find the Server config id (kSCID). | 60 // Couldn't find the Server config id (kSCID). |
56 SERVER_CONFIG_UNKNOWN_CONFIG_FAILURE = 11, | 61 SERVER_CONFIG_UNKNOWN_CONFIG_FAILURE = 13, |
57 | 62 |
58 // Failure reasons for an invalid source-address token. | 63 // Failure reasons for an invalid source-address token. |
59 // | 64 // |
60 // Missing Source-address token (kSourceAddressTokenTag) tag. | 65 // Missing Source-address token (kSourceAddressTokenTag) tag. |
61 SOURCE_ADDRESS_TOKEN_INVALID_FAILURE = 12, | 66 SOURCE_ADDRESS_TOKEN_INVALID_FAILURE = 14, |
62 // Unbox of Source-address token failed. | 67 // Unbox of Source-address token failed. |
63 SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE = 13, | 68 SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE = 15, |
64 // Couldn't parse the unbox'ed Source-address token. | 69 // Couldn't parse the unbox'ed Source-address token. |
65 SOURCE_ADDRESS_TOKEN_PARSE_FAILURE = 14, | 70 SOURCE_ADDRESS_TOKEN_PARSE_FAILURE = 16, |
66 // Source-address token is for a different IP address. | 71 // Source-address token is for a different IP address. |
67 SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE = 15, | 72 SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE = 17, |
68 // The source-address token has a timestamp in the future. | 73 // The source-address token has a timestamp in the future. |
69 SOURCE_ADDRESS_TOKEN_CLOCK_SKEW_FAILURE = 16, | 74 SOURCE_ADDRESS_TOKEN_CLOCK_SKEW_FAILURE = 18, |
70 // The source-address token has expired. | 75 // The source-address token has expired. |
71 SOURCE_ADDRESS_TOKEN_EXPIRED_FAILURE = 17, | 76 SOURCE_ADDRESS_TOKEN_EXPIRED_FAILURE = 19, |
72 | 77 |
73 MAX_FAILURE_REASON, | 78 MAX_FAILURE_REASON, |
74 }; | 79 }; |
75 | 80 |
76 // These errors will be packed into an uint32 and we don't want to set the most | 81 // These errors will be packed into an uint32 and we don't want to set the most |
77 // significant bit, which may be misinterpreted as the sign bit. | 82 // significant bit, which may be misinterpreted as the sign bit. |
78 COMPILE_ASSERT(MAX_FAILURE_REASON <= 32, failure_reason_out_of_sync); | 83 COMPILE_ASSERT(MAX_FAILURE_REASON <= 32, failure_reason_out_of_sync); |
79 | 84 |
80 // A CrypterPair contains the encrypter and decrypter for an encryption level. | 85 // A CrypterPair contains the encrypter and decrypter for an encryption level. |
81 struct NET_EXPORT_PRIVATE CrypterPair { | 86 struct NET_EXPORT_PRIVATE CrypterPair { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 152 |
148 const CommonCertSets* common_cert_sets; | 153 const CommonCertSets* common_cert_sets; |
149 | 154 |
150 private: | 155 private: |
151 DISALLOW_COPY_AND_ASSIGN(QuicCryptoConfig); | 156 DISALLOW_COPY_AND_ASSIGN(QuicCryptoConfig); |
152 }; | 157 }; |
153 | 158 |
154 } // namespace net | 159 } // namespace net |
155 | 160 |
156 #endif // NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ | 161 #endif // NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ |
OLD | NEW |