QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef QUICHE_QUIC_TOOLS_QUIC_SIMPLE_CRYPTO_SERVER_STREAM_HELPER_H_ |
| 6 | #define QUICHE_QUIC_TOOLS_QUIC_SIMPLE_CRYPTO_SERVER_STREAM_HELPER_H_ |
| 7 | |
| 8 | #include "net/third_party/quiche/src/quic/core/crypto/quic_random.h" |
| 9 | #include "net/third_party/quiche/src/quic/core/quic_crypto_server_stream.h" |
| 10 | |
| 11 | namespace quic { |
| 12 | |
| 13 | // Simple helper for server crypto streams which generates a new random |
wub | 4ca3d67 | 2019-06-12 08:27:17 -0700 | [diff] [blame] | 14 | // connection ID for rejects. |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 15 | class QuicSimpleCryptoServerStreamHelper |
| 16 | : public QuicCryptoServerStream::Helper { |
| 17 | public: |
| 18 | explicit QuicSimpleCryptoServerStreamHelper(QuicRandom* random); |
| 19 | |
| 20 | ~QuicSimpleCryptoServerStreamHelper() override; |
| 21 | |
| 22 | QuicConnectionId GenerateConnectionIdForReject( |
| 23 | QuicTransportVersion /*version*/, |
| 24 | QuicConnectionId /*connection_id*/) const override; |
| 25 | |
| 26 | bool CanAcceptClientHello(const CryptoHandshakeMessage& message, |
| 27 | const QuicSocketAddress& client_address, |
| 28 | const QuicSocketAddress& peer_address, |
| 29 | const QuicSocketAddress& self_address, |
vasilvv | c48c871 | 2019-03-11 13:38:16 -0700 | [diff] [blame] | 30 | std::string* error_details) const override; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 31 | |
| 32 | private: |
| 33 | QuicRandom* random_; // Unowned. |
| 34 | }; |
| 35 | |
| 36 | } // namespace quic |
| 37 | |
| 38 | #endif // QUICHE_QUIC_TOOLS_QUIC_SIMPLE_CRYPTO_SERVER_STREAM_HELPER_H_ |