chromium/net/third_party/quiche/src/quiche/quic/core/tls_client_handshaker_test.cc

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <algorithm>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>

#include "absl/base/macros.h"
#include "openssl/hpke.h"
#include "openssl/ssl.h"
#include "quiche/quic/core/crypto/quic_decrypter.h"
#include "quiche/quic/core/crypto/quic_encrypter.h"
#include "quiche/quic/core/quic_error_codes.h"
#include "quiche/quic/core/quic_packets.h"
#include "quiche/quic/core/quic_server_id.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/core/quic_utils.h"
#include "quiche/quic/core/quic_versions.h"
#include "quiche/quic/platform/api/quic_expect_bug.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/crypto_test_utils.h"
#include "quiche/quic/test_tools/quic_connection_peer.h"
#include "quiche/quic/test_tools/quic_framer_peer.h"
#include "quiche/quic/test_tools/quic_session_peer.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
#include "quiche/quic/test_tools/simple_session_cache.h"
#include "quiche/quic/tools/fake_proof_verifier.h"
#include "quiche/common/test_tools/quiche_test_utils.h"

_;

namespace quic {
namespace test {
namespace {

constexpr char kServerHostname[] =;
constexpr uint16_t kServerPort =;

// TestProofVerifier wraps ProofVerifierForTesting, except for VerifyCertChain
// which, if TestProofVerifier is active, always returns QUIC_PENDING. (If this
// test proof verifier is not active, it delegates VerifyCertChain to the
// ProofVerifierForTesting.) The pending VerifyCertChain operation can be
// completed by calling InvokePendingCallback. This allows for testing
// asynchronous VerifyCertChain operations.
class TestProofVerifier : public ProofVerifier {};

class TlsClientHandshakerTest : public QuicTestWithParam<ParsedQuicVersion> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(TlsClientHandshakerTest, NotInitiallyConnected) {}

TEST_P(TlsClientHandshakerTest, ConnectedAfterHandshake) {}

TEST_P(TlsClientHandshakerTest, ConnectionClosedOnTlsError) {}

TEST_P(TlsClientHandshakerTest, ProofVerifyDetailsAvailableAfterHandshake) {}

TEST_P(TlsClientHandshakerTest, HandshakeWithAsyncProofVerifier) {}

TEST_P(TlsClientHandshakerTest, Resumption) {}

TEST_P(TlsClientHandshakerTest, ResumptionRejection) {}

TEST_P(TlsClientHandshakerTest, ZeroRttResumption) {}

// Regression test for b/186438140.
TEST_P(TlsClientHandshakerTest, ZeroRttResumptionWithAyncProofVerifier) {}

TEST_P(TlsClientHandshakerTest, ZeroRttRejection) {}

TEST_P(TlsClientHandshakerTest, ZeroRttAndResumptionRejection) {}

TEST_P(TlsClientHandshakerTest, ClientSendsNoSNI) {}

TEST_P(TlsClientHandshakerTest, ClientSendingTooManyALPNs) {}

TEST_P(TlsClientHandshakerTest, ServerRequiresCustomALPN) {}

TEST_P(TlsClientHandshakerTest, ZeroRTTNotAttemptedOnALPNChange) {}

TEST_P(TlsClientHandshakerTest, InvalidSNI) {}

TEST_P(TlsClientHandshakerTest, BadTransportParams) {}

TEST_P(TlsClientHandshakerTest, ECH) {}

TEST_P(TlsClientHandshakerTest, ECHWithConfigAndGREASE) {}

TEST_P(TlsClientHandshakerTest, ECHInvalidConfig) {}

TEST_P(TlsClientHandshakerTest, ECHWrongKeys) {}

// Test that ECH GREASE can be configured.
TEST_P(TlsClientHandshakerTest, ECHGrease) {}

#if BORINGSSL_API_VERSION >= 22
TEST_P(TlsClientHandshakerTest, EnableKyber) {}
#endif  // BORINGSSL_API_VERSION

#if BORINGSSL_API_VERSION >= 27
TEST_P(TlsClientHandshakerTest, EnableClientAlpsUseNewCodepoint) {}
#endif  // BORINGSSL_API_VERSION

}  // namespace
}  // namespace test
}  // namespace quic