| 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 enum HandshakeFailureReason { |
| 23 HANDSHAKE_OK = 0, |
| 24 |
| 25 // Failure reasons for an invalid client nonce in CHLO. |
| 26 // |
| 27 // TODO(rtenneti): Implement capturing of error from strike register. |
| 28 CLIENT_NONCE_UNKNOWN_FAILURE = 100, |
| 29 // Invalid client nonce. A possible reason, client nonce had incorrect length. |
| 30 CLIENT_NONCE_INVALID_FAILURE, |
| 31 |
| 32 // Failure reasons for an invalid server nonce in CHLO. |
| 33 SERVER_NONCE_INVALID_FAILURE = 200, // Nonce had incorrect length. |
| 34 SERVER_NONCE_DECRYPTION_FAILURE, // Unbox of nonce failed. |
| 35 SERVER_NONCE_NOT_UNIQUE_FAILURE, // Nonce is not unique. |
| 36 |
| 37 // Failure reasons for an invalid server config in CHLO. |
| 38 // |
| 39 // Missing Server config id (kSCID) tag. |
| 40 SERVER_CONFIG_INCHOATE_HELLO_FAILURE = 300, |
| 41 // GetConfigWithScid couldn't find the Server config id (kSCID). |
| 42 SERVER_CONFIG_UNKNOWN_CONFIG_FAILURE, |
| 43 |
| 44 // Failure reasons for an invalid source-address token. |
| 45 // |
| 46 // Missing Source-address token (kSourceAddressTokenTag) tag. |
| 47 SOURCE_ADDRESS_TOKEN_INVALID_FAILURE = 400, |
| 48 // Unbox of Source-address token failed. |
| 49 SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE, |
| 50 // Couldn't parse the unbox'ed Source-address token. |
| 51 SOURCE_ADDRESS_TOKEN_PARSE_FAILURE, |
| 52 // Source-address token is for a different IP address. |
| 53 SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE, |
| 54 // The difference between the time in source-address token and |now| is more |
| 55 // than |source_address_token_future_secs_|. |
| 56 SOURCE_ADDRESS_TOKEN_CLOCK_SKEW_FAILURE, |
| 57 // The difference between the time in source-address token and |now| is more |
| 58 // than |source_address_token_lifetime_secs_|. |
| 59 SOURCE_ADDRESS_TOKEN_EXPIRED_FAILURE, |
| 60 }; |
| 61 |
| 22 // A CrypterPair contains the encrypter and decrypter for an encryption level. | 62 // A CrypterPair contains the encrypter and decrypter for an encryption level. |
| 23 struct NET_EXPORT_PRIVATE CrypterPair { | 63 struct NET_EXPORT_PRIVATE CrypterPair { |
| 24 CrypterPair(); | 64 CrypterPair(); |
| 25 ~CrypterPair(); | 65 ~CrypterPair(); |
| 26 scoped_ptr<QuicEncrypter> encrypter; | 66 scoped_ptr<QuicEncrypter> encrypter; |
| 27 scoped_ptr<QuicDecrypter> decrypter; | 67 scoped_ptr<QuicDecrypter> decrypter; |
| 28 }; | 68 }; |
| 29 | 69 |
| 30 // Parameters negotiated by the crypto handshake. | 70 // Parameters negotiated by the crypto handshake. |
| 31 struct NET_EXPORT_PRIVATE QuicCryptoNegotiatedParameters { | 71 struct NET_EXPORT_PRIVATE QuicCryptoNegotiatedParameters { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 129 |
| 90 const CommonCertSets* common_cert_sets; | 130 const CommonCertSets* common_cert_sets; |
| 91 | 131 |
| 92 private: | 132 private: |
| 93 DISALLOW_COPY_AND_ASSIGN(QuicCryptoConfig); | 133 DISALLOW_COPY_AND_ASSIGN(QuicCryptoConfig); |
| 94 }; | 134 }; |
| 95 | 135 |
| 96 } // namespace net | 136 } // namespace net |
| 97 | 137 |
| 98 #endif // NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ | 138 #endif // NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_H_ |
| OLD | NEW |