#include "quiche/quic/test_tools/fake_proof_source_handle.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/string_view.h"
#include "quiche/quic/core/crypto/proof_source.h"
#include "quiche/quic/core/quic_connection_id.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/platform/api/quic_bug_tracker.h"
#include "quiche/quic/platform/api/quic_socket_address.h"
#include "quiche/common/platform/api/quiche_logging.h"
#include "quiche/common/platform/api/quiche_reference_counted.h"
namespace quic {
namespace test {
namespace {
struct ComputeSignatureResult { … };
class ResultSavingSignatureCallback : public ProofSource::SignatureCallback { … };
ComputeSignatureResult ComputeSignatureNow(
ProofSource* delegate, const QuicSocketAddress& server_address,
const QuicSocketAddress& client_address, const std::string& hostname,
uint16_t signature_algorithm, absl::string_view in) { … }
}
FakeProofSourceHandle::FakeProofSourceHandle(
ProofSource* delegate, ProofSourceHandleCallback* callback,
Action select_cert_action, Action compute_signature_action,
QuicDelayedSSLConfig delayed_ssl_config)
: … { … }
void FakeProofSourceHandle::CloseHandle() { … }
QuicAsyncStatus FakeProofSourceHandle::SelectCertificate(
const QuicSocketAddress& server_address,
const QuicSocketAddress& client_address,
const QuicConnectionId& original_connection_id,
absl::string_view ssl_capabilities, const std::string& hostname,
absl::string_view client_hello, const std::string& alpn,
std::optional<std::string> alps,
const std::vector<uint8_t>& quic_transport_params,
const std::optional<std::vector<uint8_t>>& early_data_context,
const QuicSSLConfig& ssl_config) { … }
QuicAsyncStatus FakeProofSourceHandle::ComputeSignature(
const QuicSocketAddress& server_address,
const QuicSocketAddress& client_address, const std::string& hostname,
uint16_t signature_algorithm, absl::string_view in,
size_t max_signature_size) { … }
ProofSourceHandleCallback* FakeProofSourceHandle::callback() { … }
bool FakeProofSourceHandle::HasPendingOperation() const { … }
void FakeProofSourceHandle::CompletePendingOperation() { … }
int FakeProofSourceHandle::NumPendingOperations() const { … }
FakeProofSourceHandle::SelectCertOperation::SelectCertOperation(
ProofSource* delegate, ProofSourceHandleCallback* callback, Action action,
SelectCertArgs args, QuicDelayedSSLConfig delayed_ssl_config)
: … { … }
void FakeProofSourceHandle::SelectCertOperation::Run() { … }
FakeProofSourceHandle::ComputeSignatureOperation::ComputeSignatureOperation(
ProofSource* delegate, ProofSourceHandleCallback* callback, Action action,
ComputeSignatureArgs args)
: … { … }
void FakeProofSourceHandle::ComputeSignatureOperation::Run() { … }
}
}