Index: net/quic/crypto/crypto_utils.h |
diff --git a/net/quic/crypto/crypto_utils.h b/net/quic/crypto/crypto_utils.h |
index 436f178e14f4a84f6eab1f3081358f7c65deec5f..ff9c95119526bc2ec039c87ee0f101b913f676ea 100644 |
--- a/net/quic/crypto/crypto_utils.h |
+++ b/net/quic/crypto/crypto_utils.h |
@@ -12,6 +12,7 @@ |
#include "base/strings/string_piece.h" |
#include "net/base/net_export.h" |
#include "net/quic/crypto/crypto_handshake.h" |
+#include "net/quic/crypto/crypto_handshake_message.h" |
#include "net/quic/crypto/crypto_protocol.h" |
#include "net/quic/quic_protocol.h" |
#include "net/quic/quic_time.h" |
@@ -74,6 +75,16 @@ class NET_EXPORT_PRIVATE CryptoUtils { |
// XLCT tag. |
static uint64 ComputeLeafCertHash(const std::string& cert); |
+ // Validates that |server_hello| is actually an SHLO message and that it is |
+ // not part of a downgrade attack. |
+ // |
+ // Returns QUIC_NO_ERROR if this is the case or returns the appropriate error |
+ // code and sets |error_details|. |
+ static QuicErrorCode ValidateServerHello( |
+ const CryptoHandshakeMessage& server_hello, |
+ const QuicVersionVector& negotiated_versions, |
+ std::string* error_details); |
+ |
private: |
DISALLOW_COPY_AND_ASSIGN(CryptoUtils); |
}; |