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 // Some helpers for quic crypto | 5 // Some helpers for quic crypto |
6 | 6 |
7 #ifndef NET_QUIC_CRYPTO_CRYPTO_UTILS_H_ | 7 #ifndef NET_QUIC_CRYPTO_CRYPTO_UTILS_H_ |
8 #define NET_QUIC_CRYPTO_CRYPTO_UTILS_H_ | 8 #define NET_QUIC_CRYPTO_CRYPTO_UTILS_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // Validates that |server_hello| is actually an SHLO message and that it is | 78 // Validates that |server_hello| is actually an SHLO message and that it is |
79 // not part of a downgrade attack. | 79 // not part of a downgrade attack. |
80 // | 80 // |
81 // Returns QUIC_NO_ERROR if this is the case or returns the appropriate error | 81 // Returns QUIC_NO_ERROR if this is the case or returns the appropriate error |
82 // code and sets |error_details|. | 82 // code and sets |error_details|. |
83 static QuicErrorCode ValidateServerHello( | 83 static QuicErrorCode ValidateServerHello( |
84 const CryptoHandshakeMessage& server_hello, | 84 const CryptoHandshakeMessage& server_hello, |
85 const QuicVersionVector& negotiated_versions, | 85 const QuicVersionVector& negotiated_versions, |
86 std::string* error_details); | 86 std::string* error_details); |
87 | 87 |
| 88 // Validates that |client_hello| is actually a CHLO and that this is not part |
| 89 // of a downgrade attack. |
| 90 // This includes verifiying versions and detecting downgrade attacks. |
| 91 // |
| 92 // Returns QUIC_NO_ERROR if this is the case or returns the appropriate error |
| 93 // code and sets |error_details|. |
| 94 static QuicErrorCode ValidateClientHello( |
| 95 const CryptoHandshakeMessage& client_hello, |
| 96 QuicVersion version, |
| 97 const QuicVersionVector& supported_versions, |
| 98 std::string* error_details); |
| 99 |
88 private: | 100 private: |
89 DISALLOW_COPY_AND_ASSIGN(CryptoUtils); | 101 DISALLOW_COPY_AND_ASSIGN(CryptoUtils); |
90 }; | 102 }; |
91 | 103 |
92 } // namespace net | 104 } // namespace net |
93 | 105 |
94 #endif // NET_QUIC_CRYPTO_CRYPTO_UTILS_H_ | 106 #endif // NET_QUIC_CRYPTO_CRYPTO_UTILS_H_ |
OLD | NEW |