17 #include <gtest/gtest.h> 21 using ::testing::InSequence;
47 TEST(TLSTicketKeyManager, TestSetGetTLSTicketKeySeeds) {
48 std::vector<std::string> origOld = {
"67"};
49 std::vector<std::string> origCurr = {
"68"};
50 std::vector<std::string> origNext = {
"69"};
55 manager.setTLSTicketKeySeeds(origOld, origCurr, origNext);
56 std::vector<std::string> old;
57 std::vector<std::string> curr;
58 std::vector<std::string>
next;
59 manager.getTLSTicketKeySeeds(old, curr, next);
65 TEST(TLSTicketKeyManager, TestValidateTicketSeedsSuccess) {
69 std::vector<std::string> origOld = {
"67",
"77"};
70 std::vector<std::string> origCurr = {
"68",
"78"};
71 std::vector<std::string> origNext = {
"69",
"79"};
74 std::vector<std::string> newOld = {
"68",
"78"};
75 std::vector<std::string> newCurr = {
"69",
"79"};
76 std::vector<std::string> newNext = {
"70",
"80"};
81 manager.setTLSTicketKeySeeds(origOld, origCurr, origNext);
82 manager.setTLSTicketKeySeeds(newOld, newCurr, newNext);
85 TEST(TLSTicketKeyManager, TestValidateTicketSeedsIdempotent) {
89 std::vector<std::string> origOld = {
"67",
"77"};
90 std::vector<std::string> origCurr = {
"68",
"78"};
91 std::vector<std::string> origNext = {
"69",
"79"};
96 manager.setTLSTicketKeySeeds(origOld, origCurr, origNext);
97 manager.setTLSTicketKeySeeds(origOld, origCurr, origNext);
100 TEST(TLSTicketKeyManager, TestValidateTicketSeedsFailure) {
102 InSequence inSequence;
106 std::vector<std::string> origOld = {
"67",
"77"};
107 std::vector<std::string> origCurr = {
"68",
"78"};
108 std::vector<std::string> origNext = {
"69",
"79"};
111 std::vector<std::string> newOld = {
"69",
"79"};
112 std::vector<std::string> newCurr = {
"70",
"80"};
113 std::vector<std::string> newNext = {
"71",
"81"};
118 manager.setTLSTicketKeySeeds(origOld, origCurr, origNext);
119 manager.setTLSTicketKeySeeds(newOld, newCurr, newNext);
122 TEST(TLSTicketKeyManager, TestValidateTicketSeedsSubsetPass) {
124 InSequence inSequence;
127 std::vector<std::string> origOld = {
"67"};
128 std::vector<std::string> origCurr = {
"68"};
129 std::vector<std::string> origNext = {
"69"};
132 std::vector<std::string> newOld = {
"68",
"78"};
133 std::vector<std::string> newCurr = {
"69"};
134 std::vector<std::string> newNext = {
"70",
"80"};
139 manager.setTLSTicketKeySeeds(origOld, origCurr, origNext);
140 manager.setTLSTicketKeySeeds(newOld, newCurr, newNext);
void recordSSLSession(bool, bool, bool) noexceptoverride
#define ASSERT_EQ(val1, val2)
MOCK_QUALIFIED_METHOD1(recordTLSTicketRotation, noexcept, void(bool valid))
void recordTLSTicket(bool, bool) noexceptoverride
TEST(TLSTicketKeyManager, TestSetGetTLSTicketKeySeeds)
void recordSSLSessionSetError(uint32_t) noexceptoverride
void recordSSLSessionFree(uint32_t) noexceptoverride
requires E e noexcept(noexcept(s.error(std::move(e))))
void recordSSLClientCertificateMismatch() noexceptoverride
void recordSSLSessionGetError(uint32_t) noexceptoverride
void recordSSLUpstreamConnection(bool) noexceptoverride
void recordClientRenegotiation() noexceptoverride
void recordSSLSessionRemove() noexceptoverride
void recordSSLAcceptLatency(int64_t) noexceptoverride
#define EXPECT_CALL(obj, call)
void recordSSLUpstreamConnectionError(bool) noexceptoverride
virtual void recordTLSTicketRotation(bool valid) noexcept=0