#include "quiche/quic/core/tls_client_handshaker.h"
#include <algorithm>
#include <cstring>
#include <limits>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "openssl/ssl.h"
#include "quiche/quic/core/crypto/quic_crypto_client_config.h"
#include "quiche/quic/core/crypto/quic_encrypter.h"
#include "quiche/quic/core/crypto/transport_parameters.h"
#include "quiche/quic/core/quic_session.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_hostname_utils.h"
#include "quiche/common/quiche_text_utils.h"
namespace quic {
TlsClientHandshaker::TlsClientHandshaker(
const QuicServerId& server_id, QuicCryptoStream* stream,
QuicSession* session, std::unique_ptr<ProofVerifyContext> verify_context,
QuicCryptoClientConfig* crypto_config,
QuicCryptoClientStream::ProofHandler* proof_handler,
bool has_application_state)
: … { … }
TlsClientHandshaker::~TlsClientHandshaker() { … }
bool TlsClientHandshaker::CryptoConnect() { … }
bool TlsClientHandshaker::PrepareZeroRttConfig(
QuicResumptionState* cached_state) { … }
static bool IsValidAlpn(const std::string& alpn_string) { … }
bool TlsClientHandshaker::SetAlpn() { … }
bool TlsClientHandshaker::SetTransportParameters() { … }
bool TlsClientHandshaker::ProcessTransportParameters(
std::string* error_details) { … }
int TlsClientHandshaker::num_sent_client_hellos() const { … }
bool TlsClientHandshaker::ResumptionAttempted() const { … }
bool TlsClientHandshaker::IsResumption() const { … }
bool TlsClientHandshaker::EarlyDataAccepted() const { … }
ssl_early_data_reason_t TlsClientHandshaker::EarlyDataReason() const { … }
bool TlsClientHandshaker::ReceivedInchoateReject() const { … }
int TlsClientHandshaker::num_scup_messages_received() const { … }
std::string TlsClientHandshaker::chlo_hash() const { … }
bool TlsClientHandshaker::ExportKeyingMaterial(absl::string_view label,
absl::string_view context,
size_t result_len,
std::string* result) { … }
bool TlsClientHandshaker::encryption_established() const { … }
bool TlsClientHandshaker::IsCryptoFrameExpectedForEncryptionLevel(
EncryptionLevel level) const { … }
EncryptionLevel TlsClientHandshaker::GetEncryptionLevelToSendCryptoDataOfSpace(
PacketNumberSpace space) const { … }
bool TlsClientHandshaker::one_rtt_keys_available() const { … }
const QuicCryptoNegotiatedParameters&
TlsClientHandshaker::crypto_negotiated_params() const { … }
CryptoMessageParser* TlsClientHandshaker::crypto_message_parser() { … }
HandshakeState TlsClientHandshaker::GetHandshakeState() const { … }
size_t TlsClientHandshaker::BufferSizeLimitForLevel(
EncryptionLevel level) const { … }
std::unique_ptr<QuicDecrypter>
TlsClientHandshaker::AdvanceKeysAndCreateCurrentOneRttDecrypter() { … }
std::unique_ptr<QuicEncrypter>
TlsClientHandshaker::CreateCurrentOneRttEncrypter() { … }
void TlsClientHandshaker::OnOneRttPacketAcknowledged() { … }
void TlsClientHandshaker::OnHandshakePacketSent() { … }
void TlsClientHandshaker::OnConnectionClosed(QuicErrorCode error,
ConnectionCloseSource source) { … }
void TlsClientHandshaker::OnHandshakeDoneReceived() { … }
void TlsClientHandshaker::OnNewTokenReceived(absl::string_view token) { … }
void TlsClientHandshaker::SetWriteSecret(
EncryptionLevel level, const SSL_CIPHER* cipher,
absl::Span<const uint8_t> write_secret) { … }
void TlsClientHandshaker::OnHandshakeConfirmed() { … }
QuicAsyncStatus TlsClientHandshaker::VerifyCertChain(
const std::vector<std::string>& certs, std::string* error_details,
std::unique_ptr<ProofVerifyDetails>* details, uint8_t* out_alert,
std::unique_ptr<ProofVerifierCallback> callback) { … }
void TlsClientHandshaker::OnProofVerifyDetailsAvailable(
const ProofVerifyDetails& verify_details) { … }
void TlsClientHandshaker::FinishHandshake() { … }
void TlsClientHandshaker::OnEnterEarlyData() { … }
void TlsClientHandshaker::FillNegotiatedParams() { … }
void TlsClientHandshaker::ProcessPostHandshakeMessage() { … }
bool TlsClientHandshaker::ShouldCloseConnectionOnUnexpectedError(
int ssl_error) { … }
void TlsClientHandshaker::HandleZeroRttReject() { … }
void TlsClientHandshaker::InsertSession(bssl::UniquePtr<SSL_SESSION> session) { … }
void TlsClientHandshaker::WriteMessage(EncryptionLevel level,
absl::string_view data) { … }
void TlsClientHandshaker::SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> application_state) { … }
}