9 #include <gmock/gmock.h> 10 #include <gtest/gtest.h> 20 using namespace folly;
30 "00890002004140dd2fa2430a0f54ca96454bdf23c264353a252812bc5fe7b851a6fe9d620424be43f20e50a4ca0a1769f4024db346ca5075eecdb7f62d0018cf1642b75f679d98004089915dea6f6d4d46db349993c5194e709fd22e10bc63ed2b1dfc1f58f300abc13d28c4ecb4dc1dadc8597f813d5f129a58181d3489db69766d832919fbe38a940000"};
37 auto ext = getExtension<TokenBindingParameters>(exts);
40 EXPECT_EQ(ext->key_parameters_list.size(), 1);
50 auto& tokenbinding =
message.tokenbindings.front();
53 auto&
id = tokenbinding.tokenbindingid;
57 EXPECT_EQ(
id.key->computeChainDataLength(), 65);
60 EXPECT_EQ(tokenbinding.extensions->computeChainDataLength(), 0);
63 EXPECT_EQ(tokenbinding.signature->computeChainDataLength(), 64);
81 auto decoded = decode<TokenBindingMessage>(
std::move(encoded));
83 EXPECT_EQ(decoded.tokenbindings.size(), 1);
85 auto& decodedId = decodedTokenBinding.tokenbindingid;
87 decodedTokenBinding.tokenbinding_type,
93 TEST(ContextTest, TestAscendingVersionsNotSet) {
94 std::vector<TokenBindingProtocolVersion> ascending{
105 TEST(ContextTest, TestShuffledNotSet) {
106 std::vector<TokenBindingProtocolVersion> shuffled{
117 TEST(ContextTest, TestDoubleNotSet) {
118 std::vector<TokenBindingProtocolVersion> two{
128 TEST(ContextTest, TestEmptySet) {
129 std::vector<TokenBindingProtocolVersion>
empty;
136 TEST(ContextTest, TestSingleSet) {
137 std::vector<TokenBindingProtocolVersion>
single{
145 TEST(ContextTest, TestDescendingVersionsSet) {
146 std::vector<TokenBindingProtocolVersion> descending{
156 TEST(ContextTest, TestDoubleSet) {
157 std::vector<TokenBindingProtocolVersion> two{
166 TEST(ContextTest, TestDescendingDuplicatesNotSet) {
167 std::vector<TokenBindingProtocolVersion> duplicate{
170 TokenBindingProtocolVersion::token_binding_0_11};
const auto & getSupportedVersions() const
#define EXPECT_THROW(statement, expected_exception)
static std::unique_ptr< IOBuf > create(std::size_t capacity)
#define EXPECT_EQ(val1, val2)
TEST_F(ExtensionsTest, TokenBindingMessageSelfCreated)
constexpr detail::Map< Move > move
void setSupportedVersions(std::vector< TokenBindingProtocolVersion > versions)
—— Concurrent Priority Queue Implementation ——
TokenBindingType tokenbinding_type
TEST(ContextTest, TestDescendingDuplicatesNotSet)
std::vector< TokenBinding > tokenbindings
StringPiece tokenBindingMessage
constexpr auto empty(C const &c) -> decltype(c.empty())
TokenBindingKeyParameters key_parameters
TokenBindingID tokenbindingid
#define EXPECT_TRUE(condition)
Buf encode(TokenBindingMessage &&message)
const internal::AnythingMatcher _