]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1798 in SNORT/snort3 from ~KATHARVE/snort3:h2i_static_new to...
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Thu, 17 Oct 2019 14:41:56 +0000 (10:41 -0400)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Thu, 17 Oct 2019 14:41:56 +0000 (10:41 -0400)
Squashed commit of the following:

commit c7410c95a1982c8c5f9cf4300a5474f4ea595683
Author: Katura Harvey <katharve@cisco.com>
Date:   Mon Oct 14 13:00:46 2019 -0400

    http2_inspect: decode indexed header fields in the HPACK static table

15 files changed:
src/service_inspectors/http2_inspect/CMakeLists.txt
src/service_inspectors/http2_inspect/http2_enum.h
src/service_inspectors/http2_inspect/http2_flow_data.cc
src/service_inspectors/http2_inspect/http2_flow_data.h
src/service_inspectors/http2_inspect/http2_hpack.cc
src/service_inspectors/http2_inspect/http2_hpack.h
src/service_inspectors/http2_inspect/http2_hpack_string_decode.h
src/service_inspectors/http2_inspect/http2_hpack_table.cc [new file with mode: 0644]
src/service_inspectors/http2_inspect/http2_hpack_table.h [new file with mode: 0644]
src/service_inspectors/http2_inspect/http2_huffman_state_machine.cc
src/service_inspectors/http2_inspect/http2_inspect.cc
src/service_inspectors/http2_inspect/http2_stream_splitter_impl.cc
src/service_inspectors/http2_inspect/http2_tables.cc
src/service_inspectors/http2_inspect/test/CMakeLists.txt
src/service_inspectors/http2_inspect/test/http2_stream_splitter_impl_test.cc

index 19ce99abd207095b7e2e73baeaa2ac8b9b718ab2..b3826097655a88d9558d338d7325b0c9bb0f463e 100644 (file)
@@ -9,6 +9,8 @@ set (FILE_LIST
     http2_hpack.h
     http2_hpack_int_decode.cc
     http2_hpack_int_decode.h
+    http2_hpack_table.cc
+    http2_hpack_table.h
     http2_hpack_string_decode.cc
     http2_hpack_string_decode.h
     http2_huffman_state_machine.cc
index 02e2e89ac7836bdd4b3bac67a53bd2da3054b226..deab023e062dfb12bf38dbbf974c2f9e9d460d01 100644 (file)
@@ -54,6 +54,7 @@ enum EventSid
     EVENT_UNEXPECTED_CONTINUATION = 5,
     EVENT_MISFORMATTED_HTTP2 = 6,
     EVENT_PREFACE_MATCH_FAILURE = 7,
+    EVENT_HPACK_INDEX_DECODE_FAILURE = 8,
     EVENT__MAX_VALUE
 };
 
@@ -73,6 +74,7 @@ enum Infraction
     INF_HUFFMAN_INCOMPLETE_CODE_PADDING = 9,
     INF_MISSING_CONTINUATION = 10,
     INF_UNEXPECTED_CONTINUATION = 11,
+    INF_STATIC_TABLE_LOOKUP_ERROR = 12,
     INF__MAX_VALUE
 };
 
index 0b4060e284fd1649caea65ebc0488db076e16917..bc406f894a2b17914aada2416f81779dc842db69 100644 (file)
@@ -77,3 +77,17 @@ Http2FlowData::~Http2FlowData()
         delete events[k];
     }
 }
+
+void Http2FlowData::clear_frame_data(HttpCommon::SourceId source_id)
+{
+    delete[] frame_header[source_id];
+    frame_header[source_id] = nullptr;
+    delete[] frame_data[source_id];
+    frame_data[source_id] = nullptr;
+    frame_in_detection = false;
+    delete[] http2_decoded_header[source_id];
+    http2_decoded_header[source_id] = nullptr;
+    continuation_expected[source_id] = false;
+    frames_aggregated[source_id] = 0;
+    header_octets_seen[source_id] = 0;
+}
index db207517f10ef5ab5cc0c56d3f9849d17af73aca..9a703686ccdc7b11507bed49dfad3230c4e07974 100644 (file)
@@ -99,6 +99,8 @@ protected:
     Http2Infractions* infractions[2] = { new Http2Infractions, new Http2Infractions };
     Http2EventGen* events[2] = { new Http2EventGen, new Http2EventGen };
 
+    void clear_frame_data(HttpCommon::SourceId source_id);
+
 #ifdef REG_TEST
     static uint64_t instance_count;
     uint64_t seq_num;
index d40d2508938606c0bf70e7d3e619b7d665bc6b6c..e51d73d856ca12ffcf61d26a16f056637bdc08ae 100644 (file)
@@ -37,6 +37,7 @@ Http2HpackIntDecode Http2Hpack::decode_int6(6);
 Http2HpackIntDecode Http2Hpack::decode_int5(5);
 Http2HpackIntDecode Http2Hpack::decode_int4(4);
 Http2HpackStringDecode Http2Hpack::decode_string;
+Http2HpackTable Http2Hpack::table;
 
 bool Http2Hpack::write_decoded_headers(Http2FlowData* session_data, HttpCommon::SourceId source_id,
     const uint8_t* in_buffer, const uint32_t in_length,
@@ -110,13 +111,61 @@ bool Http2Hpack::decode_string_literal(Http2FlowData* session_data, HttpCommon::
     return true;
 }
 
+bool Http2Hpack::decode_static_table_index(Http2FlowData* session_data,
+    HttpCommon::SourceId source_id, const uint64_t index, const bool decode_full_line,
+    uint8_t* decoded_header_buffer, const uint32_t decoded_header_length,
+    uint32_t& bytes_written)
+{
+    uint32_t local_bytes_written = 0;
+    const Http2HpackTable::TableEntry* const entry = table.lookup(index);
+    bytes_written = 0;
+
+    // FIXIT-H check if header is part of start-line, if so pass to start-line generating
+    // object and don't write to decoded header buffer
+
+    // Write header name + ': ' to decoded headers
+    // FIXIT-H For now pseudo-headers are also copied. Need to be converted to start-line
+    if (!write_decoded_headers(session_data, source_id, (const uint8_t*) entry->name,
+             strlen(entry->name), decoded_header_buffer, decoded_header_length,
+             local_bytes_written))
+        return false;
+    bytes_written += local_bytes_written;
+    if (!write_decoded_headers(session_data, source_id, (const uint8_t*)": ", 2,
+            decoded_header_buffer + bytes_written, decoded_header_length - bytes_written,
+            local_bytes_written))
+        return false;
+    bytes_written += local_bytes_written;
+
+    if (decode_full_line)
+    {
+        if (strlen(entry->value) == 0)
+        {
+            *session_data->infractions[source_id] += INF_STATIC_TABLE_LOOKUP_ERROR;
+            session_data->events[source_id]->create_event(EVENT_HPACK_INDEX_DECODE_FAILURE);
+            return false;
+        }
+        if (!write_decoded_headers(session_data, source_id, (const uint8_t*)entry->value,
+                 strlen(entry->value), decoded_header_buffer + bytes_written,
+                 decoded_header_length - bytes_written, local_bytes_written))
+            return false;
+        bytes_written += local_bytes_written;
+        if (!write_decoded_headers(session_data, source_id, (const uint8_t*)"\r\n", 2,
+                decoded_header_buffer + bytes_written, decoded_header_length -
+                bytes_written, local_bytes_written))
+            return false;
+        bytes_written += local_bytes_written;
+    }
+
+    return true;
+}
+
+
 // FIXIT-H Will be incrementally updated to actually decode indexes. For now just copies encoded
 // index directly to decoded_header_buffer
 bool Http2Hpack::decode_index(Http2FlowData* session_data, HttpCommon::SourceId source_id,
     const uint8_t* encoded_header_buffer, const uint32_t encoded_header_length,
-    const Http2HpackIntDecode &decode_int, uint32_t &bytes_consumed,
-    uint8_t* decoded_header_buffer, const uint32_t decoded_header_length,
-    uint32_t &bytes_written)
+    const Http2HpackIntDecode &decode_int, const bool decode_full_line, uint32_t &bytes_consumed,
+    uint8_t* decoded_header_buffer, const uint32_t decoded_header_length, uint32_t &bytes_written)
 {
     uint64_t index;
     bytes_written = 0;
@@ -130,15 +179,11 @@ bool Http2Hpack::decode_index(Http2FlowData* session_data, HttpCommon::SourceId
     }
 
     if (index <= STATIC_TABLE_MAX_INDEX)
-        decode_static_table_index();
+        return decode_static_table_index(session_data, source_id, index, decode_full_line,
+            decoded_header_buffer, decoded_header_length, bytes_written);
     else
-        decode_dynamic_table_index();
-
-    if (!Http2Hpack::write_decoded_headers(session_data, source_id, encoded_header_buffer,
-        bytes_consumed, decoded_header_buffer, decoded_header_length, bytes_written))
-        return false;
-
-    return true;
+        return Http2Hpack::write_decoded_headers(session_data, source_id, encoded_header_buffer,
+            bytes_consumed, decoded_header_buffer, decoded_header_length, bytes_written);
 }
 
 bool Http2Hpack::decode_literal_header_line(Http2FlowData* session_data,
@@ -156,7 +201,7 @@ bool Http2Hpack::decode_literal_header_line(Http2FlowData* session_data,
     if (encoded_header_buffer[0] & name_index_mask)
     {
         if (!Http2Hpack::decode_index(session_data, source_id, encoded_header_buffer,
-                encoded_header_length, decode_int, partial_bytes_consumed,
+                encoded_header_length, decode_int, false, partial_bytes_consumed,
                 decoded_header_buffer, decoded_header_length, partial_bytes_written))
             return false;
     }
@@ -232,7 +277,7 @@ bool Http2Hpack::decode_header_line(Http2FlowData* session_data, HttpCommon::Sou
     // indexed header representation
     if (encoded_header_buffer[0] & index_mask)
         return Http2Hpack::decode_index(session_data, source_id, encoded_header_buffer,
-            encoded_header_length, decode_int7, bytes_consumed,
+            encoded_header_length, decode_int7, true, bytes_consumed,
             decoded_header_buffer, decoded_header_length, bytes_written);
 
     // literal header representation to be added to dynamic table
index e268419cb0b02766ad805234a674583f5b327fba..c5a853814204bf7d370fc9f9ab75880c625f478e 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "http2_hpack_int_decode.h"
 #include "http2_hpack_string_decode.h"
+#include "http2_hpack_table.h"
 
 class Http2FlowData;
 
@@ -55,15 +56,18 @@ public:
         uint32_t &bytes_written);
     static bool decode_index(Http2FlowData* session_data, HttpCommon::SourceId source_id,
         const uint8_t* encoded_header_buffer, const uint32_t encoded_header_length,
-        const Http2HpackIntDecode &decode_int, uint32_t &bytes_consumed,
+        const Http2HpackIntDecode &decode_int,const bool decode_full_line, uint32_t &bytes_consumed,
         uint8_t* decoded_header_buffer, const uint32_t decoded_header_length,
         uint32_t &bytes_written);
     static bool handle_dynamic_size_update(Http2FlowData* session_data,
         HttpCommon::SourceId source_id, const uint8_t* encoded_header_buffer,
         const uint32_t encoded_header_length, const Http2HpackIntDecode &decode_int,
         uint32_t &bytes_consumed, uint32_t &bytes_written);
-    static bool decode_static_table_index(void) { return false; }
-    static bool decode_dynamic_table_index(void) { return false; }
+    static bool decode_static_table_index(Http2FlowData* session_data,
+        HttpCommon::SourceId source_id, const uint64_t index, const bool decode_full_line,
+        uint8_t* decoded_header_buffer, const uint32_t decoded_header_length,
+        uint32_t& bytes_written);
+    static bool decode_dynamic_table_index(void) { return true; }
 
     static const int STATIC_TABLE_MAX_INDEX = 61;
 
@@ -75,6 +79,7 @@ private:
     static Http2HpackStringDecode decode_string;
 
 // FIXIT-H Dictionary class and object go here
+    static Http2HpackTable table; //static until dynamic table is implemented
 };
 
 #endif
index 0a772420ca6745ed81f82d4be897e317ba66150e..e45168a90296735a7e7955aaf86becfcee1fc2c6 100644 (file)
@@ -43,7 +43,7 @@ private:
         uint32_t& bytes_consumed, uint8_t* out_buff, const uint32_t out_len, uint32_t& 
         bytes_written, Http2EventGen* events, Http2Infractions* infractions) const;
     bool get_next_byte(const uint8_t* in_buff, const uint32_t last_byte,
-               uint32_t& bytes_consumed, uint8_t& cur_bit, uint8_t match_len, uint8_t& byte,
+        uint32_t& bytes_consumed, uint8_t& cur_bit, uint8_t match_len, uint8_t& byte,
         bool& another_search) const;
   
     const Http2HpackIntDecode decode7;
diff --git a/src/service_inspectors/http2_inspect/http2_hpack_table.cc b/src/service_inspectors/http2_inspect/http2_hpack_table.cc
new file mode 100644 (file)
index 0000000..2d62023
--- /dev/null
@@ -0,0 +1,94 @@
+//--------------------------------------------------------------------------
+// Copyright (C) 2019-2019 Cisco and/or its affiliates. All rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License Version 2 as published
+// by the Free Software Foundation.  You may not use, modify or distribute
+// this program under any other version of the GNU General Public License.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//--------------------------------------------------------------------------
+// http2_hpack_table.cc author Katura Harvey <katharve@cisco.com>
+
+#include "http2_hpack_table.h"
+
+#include <cassert>
+
+const Http2HpackTable::TableEntry Http2HpackTable::table[STATIC_MAX_INDEX + 1] =
+{
+    {"", ""},
+    {":authority", ""},
+    {":method", "GET"},
+    {":method", "POST"},
+    {":path", "/"},
+    {":path", "/index.html"},
+    {":scheme", "http"},
+    {":scheme", "https"},
+    {":status", "200"},
+    {":status", "204"},
+    {":status", "206"},
+    {":status", "304"},
+    {":status", "400"},
+    {":status", "404"},
+    {":status", "500"},
+    {"accept-charset", ""},
+    {"accept-encoding", "gzip, deflate"},
+    {"accept-language", ""},
+    {"accept-ranges", ""},
+    {"accept", ""},
+    {"access-control-allow-origin", ""},
+    {"age", ""},
+    {"allow", ""},
+    {"authorization", ""},
+    {"cache-control", ""},
+    {"content-disposition", ""},
+    {"content-encoding", ""},
+    {"content-language", ""},
+    {"content-length", ""},
+    {"content-location", ""},
+    {"content-range", ""},
+    {"content-type", ""},
+    {"cookie", ""},
+    {"date", ""},
+    {"etag", ""},
+    {"expect", ""},
+    {"expires", ""},
+    {"from", ""},
+    {"host", ""},
+    {"if-match", ""},
+    {"if-modified-since", ""},
+    {"if-none-match", ""},
+    {"if-range", ""},
+    {"if-unmodified-since", ""},
+    {"last-modified", ""},
+    {"link", ""},
+    {"location", ""},
+    {"max-forwards", ""},
+    {"proxy-authenticate", ""},
+    {"proxy-authorization", ""},
+    {"range", ""},
+    {"referer", ""},
+    {"refresh", ""},
+    {"retry-after", ""},
+    {"server", ""},
+    {"set-cookie", ""},
+    {"strict-transport-security", ""},
+    {"transfer-encoding", ""},
+    {"user-agent", ""},
+    {"vary", ""},
+    {"via", ""},
+    {"www-authenticate", ""},
+};
+
+const Http2HpackTable::TableEntry* Http2HpackTable::lookup(uint64_t index)
+{ 
+    assert(index <= STATIC_MAX_INDEX);
+    return &table[index];
+}
diff --git a/src/service_inspectors/http2_inspect/http2_hpack_table.h b/src/service_inspectors/http2_inspect/http2_hpack_table.h
new file mode 100644 (file)
index 0000000..d1e2a27
--- /dev/null
@@ -0,0 +1,44 @@
+//--------------------------------------------------------------------------
+// Copyright (C) 2019-2019 Cisco and/or its affiliates. All rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License Version 2 as published
+// by the Free Software Foundation.  You may not use, modify or distribute
+// this program under any other version of the GNU General Public License.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//--------------------------------------------------------------------------
+// http2_hpack_table.h author Katura Harvey <katharve@cisco.com>
+
+#ifndef HTTP2_HPACK_TABLE_H
+#define HTTP2_HPACK_TABLE_H
+
+#include <cstdint>
+
+#define STATIC_MAX_INDEX 61
+
+// Only static table is implemented. lookup() will be extended to support dynamic table
+// lookups once dynamic table is implemented
+class Http2HpackTable
+{
+public:
+    struct TableEntry
+    {
+        const char *name;
+        const char *value;
+    };
+
+    const static TableEntry* lookup(uint64_t index);
+
+private:
+    const static TableEntry table[STATIC_MAX_INDEX + 1];
+};
+
+#endif
index 36a74db764c60257c71652130c6a72b0ed1d9f62..d4cd7738338589fd6ce82eed05c9937d64a14a72 100644 (file)
@@ -473,9 +473,9 @@ const HuffmanEntry huffman_decode[HUFFMAN_LOOKUP_MAX+1] [UINT8_MAX+1] =
         {8, (char)236, HUFFMAN_MATCH}, {8, (char)237, HUFFMAN_MATCH},
         {8, 0, HUFFMAN_LOOKUP_6}, {8, 0, HUFFMAN_LOOKUP_7},
         {8, 0, HUFFMAN_LOOKUP_8}, {8, 0, HUFFMAN_LOOKUP_9},
-       {8, 0, HUFFMAN_LOOKUP_10}, {8, 0, HUFFMAN_LOOKUP_11},
+        {8, 0, HUFFMAN_LOOKUP_10}, {8, 0, HUFFMAN_LOOKUP_11},
         {8, 0, HUFFMAN_LOOKUP_12}, {8, 0, HUFFMAN_LOOKUP_13},
-       {8, 0, HUFFMAN_LOOKUP_14}, {8, 0, HUFFMAN_LOOKUP_15}
+        {8, 0, HUFFMAN_LOOKUP_14}, {8, 0, HUFFMAN_LOOKUP_15}
     },
     { // HUFFMAN_LOOKUP_6
         // 0
@@ -841,7 +841,7 @@ const HuffmanEntry huffman_decode[HUFFMAN_LOOKUP_MAX+1] [UINT8_MAX+1] =
         {2, (char)200, HUFFMAN_MATCH}, {2, (char)200, HUFFMAN_MATCH},
         {2, (char)200, HUFFMAN_MATCH}, {2, (char)200, HUFFMAN_MATCH},
         {2, (char)200, HUFFMAN_MATCH}, {2, (char)200, HUFFMAN_MATCH},
-        // 11  
+        // 11
         {2, (char)201, HUFFMAN_MATCH}, {2, (char)201, HUFFMAN_MATCH},
         {2, (char)201, HUFFMAN_MATCH}, {2, (char)201, HUFFMAN_MATCH},
         {2, (char)201, HUFFMAN_MATCH}, {2, (char)201, HUFFMAN_MATCH},
@@ -975,7 +975,7 @@ const HuffmanEntry huffman_decode[HUFFMAN_LOOKUP_MAX+1] [UINT8_MAX+1] =
         {2, (char)210, HUFFMAN_MATCH}, {2, (char)210, HUFFMAN_MATCH},
         {2, (char)210, HUFFMAN_MATCH}, {2, (char)210, HUFFMAN_MATCH},
         {2, (char)210, HUFFMAN_MATCH}, {2, (char)210, HUFFMAN_MATCH},
-        // 11  
+        // 11
         {2, (char)213, HUFFMAN_MATCH}, {2, (char)213, HUFFMAN_MATCH},
         {2, (char)213, HUFFMAN_MATCH}, {2, (char)213, HUFFMAN_MATCH},
         {2, (char)213, HUFFMAN_MATCH}, {2, (char)213, HUFFMAN_MATCH},
@@ -1109,7 +1109,7 @@ const HuffmanEntry huffman_decode[HUFFMAN_LOOKUP_MAX+1] [UINT8_MAX+1] =
         {2, (char)238, HUFFMAN_MATCH}, {2, (char)238, HUFFMAN_MATCH},
         {2, (char)238, HUFFMAN_MATCH}, {2, (char)238, HUFFMAN_MATCH},
         {2, (char)238, HUFFMAN_MATCH}, {2, (char)238, HUFFMAN_MATCH},
-        // 11  
+        // 11
         {2, (char)240, HUFFMAN_MATCH}, {2, (char)240, HUFFMAN_MATCH},
         {2, (char)240, HUFFMAN_MATCH}, {2, (char)240, HUFFMAN_MATCH},
         {2, (char)240, HUFFMAN_MATCH}, {2, (char)240, HUFFMAN_MATCH},
index bbe8d3c2c80195f3819bddcbf1a6b04e84fa7598..a555d4b9a23e3dbd141cbb8d5e7921727da8eb53 100644 (file)
@@ -113,7 +113,7 @@ void Http2Inspect::eval(Packet* p)
             (int) session_data->frame_data_size[source_id] : HttpCommon::STAT_NOT_PRESENT,
             session_data->frame_data[source_id]).print(HttpTestManager::get_output_file(),
             "Frame Data");
-               if (HttpTestManager::use_test_input(HttpTestManager::IN_HTTP2))
+        if (HttpTestManager::use_test_input(HttpTestManager::IN_HTTP2))
         {
             printf("Finished processing section from test %" PRIi64 "\n",
                 HttpTestManager::get_test_number());
@@ -132,15 +132,6 @@ void Http2Inspect::clear(Packet* p)
 
     const SourceId source_id = (p->is_from_client()) ? SRC_CLIENT : SRC_SERVER;
 
-    delete[] session_data->frame_header[source_id];
-    session_data->frame_header[source_id] = nullptr;
-    delete[] session_data->frame_data[source_id];
-    session_data->frame_data[source_id] = nullptr;
-    session_data->frame_in_detection = false;
-    delete[] session_data->http2_decoded_header[source_id];
-    session_data->http2_decoded_header[source_id] = nullptr;
-    session_data->continuation_expected[source_id] = false;
-    session_data->frames_aggregated[source_id] = 0;
-    session_data->header_octets_seen[source_id] = 0;
+    session_data->clear_frame_data(source_id);
 }
 
index 919219a986ed8b582d63fe6c5641d1455b34c984..82e1b6aae903c921b5779949cc6f7cf0ae4ed48f 100644 (file)
@@ -399,7 +399,12 @@ const StreamBuffer implement_reassemble(Http2FlowData* session_data, unsigned to
                 // FIXIT-H This will eventually be the decoded header buffer. Under development.
                 if (!Http2Hpack::decode_headers(session_data, source_id,
                     session_data->frame_data[source_id], session_data->frame_data_size[source_id]))
+                {
+                    // Since this doesn't go to detection, clear() doesn't get called, so need to
+                    // clear frame data from flow data directly
+                    session_data->clear_frame_data(source_id);
                     return frame_buf;
+                }
             }
         }
         // Return 0-length non-null buffer to stream which signals detection required, but don't 
@@ -430,4 +435,3 @@ ValidationResult validate_preface(const uint8_t* data, const uint32_t length,
     
     return V_GOOD;
 }
-
index 04a44eb70d9a7ef71121464e20e4d9fdf8847f0b..fc1a4a2dd14a8cefc5e4cb628b07ede99dfb6805 100644 (file)
@@ -38,6 +38,7 @@ const RuleMap Http2Module::http2_events[] =
     { EVENT_UNEXPECTED_CONTINUATION, "unexpected continuation frame"},
     { EVENT_MISFORMATTED_HTTP2, "misformatted HTTP/2 traffic"},
     { EVENT_PREFACE_MATCH_FAILURE, "HTTP/2 connection preface does not match"},
+    { EVENT_HPACK_INDEX_DECODE_FAILURE, "error in decoding HPACK indexed field"},
     { 0, nullptr }
 };
 
index 91e06679618efe3c3f92f841f1f3b46bef3c18f4..3903bdb7b900890e85c64089c2167041e1474bbd 100644 (file)
@@ -10,6 +10,7 @@ add_cpputest( http2_stream_splitter_impl_test
     SOURCES
         ../http2_flow_data.cc
         ../http2_hpack_int_decode.cc
+        ../http2_hpack_table.cc
         ../http2_hpack_string_decode.cc
         ../http2_huffman_state_machine.cc
         ../http2_stream_splitter_impl.cc
index 50b5d14ecd2cef6933967e7e22f2e21de1394b7f..41577742e8e0fde2b68449aaff218db1c8ac5eba 100644 (file)
@@ -30,6 +30,7 @@
 #include "service_inspectors/http2_inspect/http2_enum.h"
 #include "service_inspectors/http2_inspect/http2_flow_data.h"
 #include "service_inspectors/http2_inspect/http2_hpack_int_decode.h"
+#include "service_inspectors/http2_inspect/http2_hpack_table.h"
 #include "service_inspectors/http2_inspect/http2_hpack_string_decode.h"
 #include "service_inspectors/http2_inspect/http2_stream_splitter.h"