#include "quiche/quic/core/tls_server_handshaker.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/base/macros.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/crypto/certificate_util.h"
#include "quiche/quic/core/crypto/client_proof_source.h"
#include "quiche/quic/core/crypto/proof_source.h"
#include "quiche/quic/core/crypto/quic_random.h"
#include "quiche/quic/core/quic_connection_id.h"
#include "quiche/quic/core/quic_crypto_client_stream.h"
#include "quiche/quic/core/quic_session.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/core/tls_client_handshaker.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/crypto_test_utils.h"
#include "quiche/quic/test_tools/failing_proof_source.h"
#include "quiche/quic/test_tools/fake_proof_source.h"
#include "quiche/quic/test_tools/fake_proof_source_handle.h"
#include "quiche/quic/test_tools/quic_config_peer.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
#include "quiche/quic/test_tools/simple_session_cache.h"
#include "quiche/quic/test_tools/test_certificates.h"
#include "quiche/quic/test_tools/test_ticket_crypter.h"
namespace quic {
class QuicConnection;
class QuicStream;
}
_;
NiceMock;
Return;
namespace quic {
namespace test {
namespace {
const char kServerHostname[] = …;
const uint16_t kServerPort = …;
struct TestParams { … };
std::string PrintToString(const TestParams& p) { … }
std::vector<TestParams> GetTestParams() { … }
class TestTlsServerHandshaker : public TlsServerHandshaker { … };
class TlsServerHandshakerTestSession : public TestQuicSpdyServerSession { … };
class TlsServerHandshakerTest : public QuicTestWithParam<TestParams> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(TlsServerHandshakerTest, NotInitiallyConected) { … }
TEST_P(TlsServerHandshakerTest, ConnectedAfterTlsHandshake) { … }
TEST_P(TlsServerHandshakerTest, HandshakeWithAsyncSelectCertSuccess) { … }
TEST_P(TlsServerHandshakerTest, HandshakeWithAsyncSelectCertFailure) { … }
TEST_P(TlsServerHandshakerTest, HandshakeWithAsyncSelectCertAndSignature) { … }
TEST_P(TlsServerHandshakerTest, HandshakeWithAsyncSignature) { … }
TEST_P(TlsServerHandshakerTest, CancelPendingSelectCert) { … }
TEST_P(TlsServerHandshakerTest, CancelPendingSignature) { … }
TEST_P(TlsServerHandshakerTest, ExtractSNI) { … }
TEST_P(TlsServerHandshakerTest, ServerConnectionIdPassedToSelectCert) { … }
TEST_P(TlsServerHandshakerTest, HostnameForCertSelectionAndComputeSignature) { … }
TEST_P(TlsServerHandshakerTest, SSLConfigForCertSelection) { … }
TEST_P(TlsServerHandshakerTest, ConnectionClosedOnTlsError) { … }
TEST_P(TlsServerHandshakerTest, ClientSendingBadALPN) { … }
TEST_P(TlsServerHandshakerTest, CustomALPNNegotiation) { … }
TEST_P(TlsServerHandshakerTest, RejectInvalidSNI) { … }
TEST_P(TlsServerHandshakerTest, Resumption) { … }
TEST_P(TlsServerHandshakerTest, ResumptionWithAsyncDecryptCallback) { … }
TEST_P(TlsServerHandshakerTest, ResumptionWithPlaceholderTicket) { … }
TEST_P(TlsServerHandshakerTest, AdvanceHandshakeDuringAsyncDecryptCallback) { … }
TEST_P(TlsServerHandshakerTest, ResumptionWithFailingDecryptCallback) { … }
TEST_P(TlsServerHandshakerTest, ResumptionWithFailingAsyncDecryptCallback) { … }
TEST_P(TlsServerHandshakerTest, HandshakeFailsWithFailingProofSource) { … }
TEST_P(TlsServerHandshakerTest, ZeroRttResumption) { … }
TEST_P(TlsServerHandshakerTest, ZeroRttRejectOnApplicationStateChange) { … }
TEST_P(TlsServerHandshakerTest, RequestClientCert) { … }
TEST_P(TlsServerHandshakerTest,
SetInvalidServerTransportParamsByDelayedSslConfig) { … }
TEST_P(TlsServerHandshakerTest,
SetValidServerTransportParamsByDelayedSslConfig) { … }
TEST_P(TlsServerHandshakerTest, RequestClientCertByDelayedSslConfig) { … }
TEST_P(TlsServerHandshakerTest, RequestClientCert_NoCert) { … }
TEST_P(TlsServerHandshakerTest, RequestAndRequireClientCert) { … }
TEST_P(TlsServerHandshakerTest, RequestAndRequireClientCertByDelayedSslConfig) { … }
TEST_P(TlsServerHandshakerTest, RequestAndRequireClientCert_NoCert) { … }
TEST_P(TlsServerHandshakerTest, CloseConnectionBeforeSelectCert) { … }
TEST_P(TlsServerHandshakerTest, FailUponCustomTranportParam) { … }
TEST_P(TlsServerHandshakerTest, SuccessWithCustomTranportParam) { … }
#if BORINGSSL_API_VERSION >= 22
TEST_P(TlsServerHandshakerTest, EnableKyber) { … }
#endif
#if BORINGSSL_API_VERSION >= 27
TEST_P(TlsServerHandshakerTest, AlpsUseNewCodepoint) { … }
#endif
}
}
}