Use TicketCrypter to enable TLS session resumption in QUIC. gfe-relnote: Adds support for session resumption in TLS-based versions of QUIC. Protected by quic_enable_tls_resumption. PiperOrigin-RevId: 308357681 Change-Id: I3889a8eec65d3903967d6ab1ca7c1b997da79606
diff --git a/quic/test_tools/fake_proof_source.h b/quic/test_tools/fake_proof_source.h index ef7669d..c179f59 100644 --- a/quic/test_tools/fake_proof_source.h +++ b/quic/test_tools/fake_proof_source.h
@@ -15,10 +15,13 @@ namespace quic { namespace test { -// Implementation of ProofSource which delegates to a ProofSourceForTesting, -// except that when the async GetProof is called, it captures the call and -// allows tests to see that a call is pending, which they can then cause to -// complete at a time of their choosing. +// Implementation of ProofSource which delegates to a ProofSourceForTesting, but +// allows for overriding certain functionality. FakeProofSource allows +// intercepting calls to GetProof and ComputeTlsSignature to force them to run +// asynchronously, and allow the caller to see that the call is pending and +// resume the operation at the caller's choosing. FakeProofSource also allows +// the caller to replace the TicketCrypter provided by +// FakeProofSource::SessionTicketCrypter. class FakeProofSource : public ProofSource { public: FakeProofSource(); @@ -46,9 +49,12 @@ uint16_t signature_algorithm, quiche::QuicheStringPiece in, std::unique_ptr<ProofSource::SignatureCallback> callback) override; - TicketCrypter* SessionTicketCrypter() override; + // Sets the TicketCrypter to use. If nullptr, the TicketCrypter from + // ProofSourceForTesting will be returned instead. + void SetTicketCrypter(std::unique_ptr<TicketCrypter> ticket_crypter); + // Get the number of callbacks which are pending int NumPendingCallbacks() const; @@ -58,6 +64,7 @@ private: std::unique_ptr<ProofSource> delegate_; + std::unique_ptr<TicketCrypter> ticket_crypter_; bool active_ = false; class PendingOp {