blob: 3480776ff1a27416eb043335d6261235f2ec0189 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// 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
11namespace quic {
12
13// Simple helper for server crypto streams which generates a new random
wub4ca3d672019-06-12 08:27:17 -070014// connection ID for rejects.
QUICHE teama6ef0a62019-03-07 20:34:33 -050015class 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,
vasilvvc48c8712019-03-11 13:38:16 -070030 std::string* error_details) const override;
QUICHE teama6ef0a62019-03-07 20:34:33 -050031
32 private:
33 QuicRandom* random_; // Unowned.
34};
35
36} // namespace quic
37
38#endif // QUICHE_QUIC_TOOLS_QUIC_SIMPLE_CRYPTO_SERVER_STREAM_HELPER_H_