• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OISF / suricata / 22618661228

02 Mar 2026 09:33PM UTC coverage: 42.258% (-34.4%) from 76.611%
22618661228

push

github

victorjulien
github-actions: bump actions/download-artifact from 7.0.0 to 8.0.0

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/37930b1c2...70fc10c6e)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

91511 of 216553 relevant lines covered (42.26%)

3416852.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.58
/src/app-layer-http2.c
1
/* Copyright (C) 2020 Open Information Security Foundation
2
 *
3
 * You can copy, redistribute or modify this Program under the terms of
4
 * the GNU General Public License version 2 as published by the Free
5
 * Software Foundation.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 * GNU General Public License for more details.
11
 *
12
 * You should have received a copy of the GNU General Public License
13
 * version 2 along with this program; if not, write to the Free Software
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15
 * 02110-1301, USA.
16
 */
17

18
/**
19
 * \file
20
 *
21
 * \author Philippe Antoine <p.antoine@catenacyber.fr>
22
 *
23
 * Parser for HTTP2, RFC 7540
24
 */
25

26
#include "suricata-common.h"
27
#include "stream.h"
28
#include "conf.h"
29

30
#include "util-unittest.h"
31

32
#include "app-layer-detect-proto.h"
33
#include "app-layer-parser.h"
34

35
#include "app-layer-htp.h"
36
#include "app-layer-http2.h"
37
#include "rust.h"
38

39
static int HTTP2RegisterPatternsForProtocolDetection(void)
40
{
7✔
41
    /* Using the 24 bytes pattern makes AppLayerTest09 fail/leak
42
     * The complete pattern is "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
43
     */
44
    if (SCAppLayerProtoDetectPMRegisterPatternCI(
7✔
45
                IPPROTO_TCP, ALPROTO_HTTP2, "PRI * HTTP/2.0\r\n", 16, 0, STREAM_TOSERVER) < 0) {
7✔
46
        return -1;
×
47
    }
×
48
    return 0;
7✔
49
}
7✔
50

51
static StreamingBufferConfig sbcfg = STREAMING_BUFFER_CONFIG_INITIALIZER;
52
static SuricataFileContext sfc = { &sbcfg };
53

54
void RegisterHTTP2Parsers(void)
55
{
7✔
56
    const char *proto_name = "http2";
7✔
57

58
    if (SCAppLayerProtoDetectConfProtoDetectionEnabledDefault("tcp", proto_name, true)) {
7✔
59
        AppLayerProtoDetectRegisterProtocol(ALPROTO_HTTP2, proto_name);
7✔
60
        if (HTTP2RegisterPatternsForProtocolDetection() < 0)
7✔
61
            return;
×
62

63
        SCHttp2Init(&sfc);
7✔
64
        SCRegisterHttp2Parser();
7✔
65
    }
7✔
66

67
#ifdef UNITTESTS
68
    //TODOask HTTP2ParserRegisterTests();
69
#endif
70
}
7✔
71

72
void SCHTTP2MimicHttp1Request(void *alstate_orig, void *h2s)
73
{
5✔
74
    htp_tx_t *h1tx = HtpGetTxForH2(alstate_orig);
5✔
75
    if (h2s == NULL || h1tx == NULL) {
5✔
76
        return;
×
77
    }
×
78
    if (htp_tx_request_method(h1tx) == NULL) {
5✔
79
        // may happen if we only got the reply, not the HTTP1 request
80
        return;
×
81
    }
×
82
    // else
83
    SCHttp2TxSetMethod(h2s, bstr_ptr(htp_tx_request_method(h1tx)),
5✔
84
            (uint32_t)bstr_len(htp_tx_request_method(h1tx)));
5✔
85
    if (htp_tx_request_uri(h1tx) != NULL) {
5✔
86
        // A request line without spaces gets interpreted as a request_method
87
        // and has request_uri=NULL
88
        SCHttp2TxSetUri(h2s, bstr_ptr(htp_tx_request_uri(h1tx)),
5✔
89
                (uint32_t)bstr_len(htp_tx_request_uri(h1tx)));
5✔
90
    }
5✔
91
    size_t nbheaders = htp_tx_request_headers_size(h1tx);
5✔
92
    for (size_t i = 0; i < nbheaders; i++) {
35✔
93
        const htp_header_t *h = htp_tx_request_header_index(h1tx, i);
30✔
94
        SCHttp2TxAddHeader(h2s, htp_header_name_ptr(h), (uint32_t)htp_header_name_len(h),
30✔
95
                htp_header_value_ptr(h), (uint32_t)htp_header_value_len(h));
30✔
96
    }
30✔
97
}
5✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc