9 #include <gmock/gmock.h> 10 #include <gtest/gtest.h> 20 using namespace folly;
24 "90a791cf38c0b5c20447ef029ae1bc4bf3eecc2e85042174497671835ceaccd9"};
29 "444444444444444444444444444444444444444444444444444444444444444400000000579bb5b10c83d7a581f6b8f7bd25acde3dabfe6f59e5147bde86681831"};
31 "444444444444444444444444444444444444444444444444444444444444444400000001f444b4f0a0d1dd8b26d3a0afa275b4f6956cfdce4857f9ec46177d0ff9"};
34 "04de0343a34c12f17f8b9696443d55e533ca1eef92bdba6634a46b604e51436d"};
39 "5cef31d266ca1fe1d634de9b95668d3d8895d4837d3ba81787185ff51c056e95000000005d19a72a3becb5b063346fdf1ec6f9d9d4ddd82cb5f34a8ba0d19e4b69"};
43 "5cef31d266ca1fe1d634de9b95668d3d8895d4837d3ba81787185ff51c056e95000000005b2168cc0fda4f9987b5e9d045845ba4809ac5189158c578c0e5d11b00"};
46 "5d19a72a3becb5b061346fdf1ec6f9d9d4ddd82cb5f34a8ba0d19e4b69"};
64 return instance->_encode(state);
67 return instance->_decode(encoded, context);
83 MockTicketCodec::instance = &
codec_;
91 if (!pskContext.empty()) {
98 std::vector<ByteRange> ticketSecrets{{s1->coalesce(), s2->coalesce()}};
125 cipher_.setValidity(std::chrono::seconds(5));
130 auto result = cipher_.encrypt(
std::move(state)).get();
133 EXPECT_EQ(result->second, std::chrono::seconds(5));
159 setTicketSecrets(
"foobar");
175 setTicketSecrets(
"barbaz");
183 setTicketSecrets(
"foobar");
214 EXPECT_TRUE(cipher_.setTicketSecrets(std::vector<ByteRange>()));
220 std::vector<ByteRange> ticketSecrets{{tooShort}};
#define MOCK_CONST_METHOD1(m,...)
#define EXPECT_EQ(val1, val2)
static constexpr StringPiece ticketSecret1
constexpr detail::Map< Move > move
void setTicketSecrets(std::string pskContext="")
static constexpr StringPiece ticket4
—— Concurrent Priority Queue Implementation ——
std::unique_ptr< Codec > codec_
PolymorphicAction< internal::InvokeWithoutArgsAction< FunctionImpl > > InvokeWithoutArgs(FunctionImpl function_impl)
TestAeadTicketCipher cipher_
MockTicketCodecInstance codec_
std::unique_ptr< folly::IOBuf > toIOBuf(std::string hexData, size_t headroom, size_t tailroom)
static constexpr StringPiece ticket1
bool setTicketSecrets(const std::vector< folly::ByteRange > &ticketSecrets)
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
folly::Future< folly::Optional< std::pair< Buf, std::chrono::seconds > > > encrypt(ResumptionState resState) const override
static Buf encode(ResumptionState state)
static MockTicketCodecInstance * instance
#define EXPECT_TRUE(condition)
TEST_F(RSAPSSTest, TestSignVerify)
std::unique_ptr< folly::IOBuf > Buf
#define MOCK_CONST_METHOD2(m,...)
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
#define EXPECT_FALSE(condition)
static constexpr StringPiece badTicket
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)
AeadTicketCipher< OpenSSLEVPCipher< AESGCM128 >, MockTicketCodec, HkdfImpl< Sha256 >> TestAeadTicketCipher
static constexpr StringPiece ticket2
static constexpr StringPiece ticket3
static ResumptionState decode(Buf encoded, const FizzServerContext *context)
static constexpr StringPiece ticketSecret2