forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
h2_capture_fuzz.proto
185 lines (159 loc) · 3.94 KB
/
h2_capture_fuzz.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
syntax = "proto3";
package test.integration;
message H2FramePing {
enum Flags {
NONE = 0;
ACK = 1;
}
Flags flags = 1;
bytes data = 2;
}
message H2FrameSettings {
enum Flags {
NONE = 0;
ACK = 1;
}
Flags flags = 1;
}
enum H2HeadersFlags {
option allow_alias = true;
NONE = 0;
END_STREAM = 1;
END_HEADERS = 4;
END_METADATA = 4;
}
message H2FrameHeaders {
repeated H2HeadersFlags flags = 1;
uint32 stream_index = 2;
}
message H2FrameContinuation {
repeated H2HeadersFlags flags = 1;
uint32 stream_index = 2;
}
message H2FrameData {
enum Flags {
NONE = 0;
END_STREAM = 1;
}
Flags flags = 1;
uint32 stream_index = 2;
}
message H2FramePriority {
uint32 stream_index = 1;
uint32 dependent_index = 2;
}
// These map to the errors defined in: https://tools.ietf.org/html/rfc7540#section-7
enum H2ErrorCode {
NO_ERROR = 0;
PROTOCOL_ERROR = 1;
INTERNAL_ERROR = 2;
FLOW_CONTROL_ERROR = 3;
SETTINGS_TIMEOUT = 4;
STREAM_CLOSED = 5;
FRAME_SIZE_ERROR = 6;
REFUSED_STREAM = 7;
CANCEL = 8;
COMPRESSION_ERROR = 9;
CONNECT_ERROR = 10;
ENHANCE_YOUR_CLAIM = 11;
INADEQUATE_SECURITY = 12;
HTTP_1_1_REQUIRED = 13;
}
message H2FramePushPromise {
repeated H2HeadersFlags flags = 1;
uint32 stream_index = 2;
uint32 promised_stream_index = 3;
}
message H2FrameResetStream {
uint32 stream_index = 1;
H2ErrorCode error_code = 2;
}
message H2FrameGoAway {
uint32 last_stream_index = 1;
H2ErrorCode error_code = 2;
}
message H2FrameWindowUpdate {
uint32 stream_index = 1;
uint32 increment = 2;
}
// A header that contains invalid status
message H2FrameMalformedRequest {
uint32 stream_index = 1;
}
// A request that is comprised of a header that has HTTP GET request with a given host and path and
// an additional zero length header (making this a malformed request)
message H2FrameMalformedRequestWithZerolenHeader {
uint32 stream_index = 1;
string host = 2;
string path = 3;
}
// A request that is comprised of a header that has HTTP GET request with a given host and path
message H2FrameRequest {
uint32 stream_index = 1;
string host = 2;
string path = 3;
}
// A request that is comprised of a header that has HTTP POST request with a given host and path
message H2FramePostRequest {
uint32 stream_index = 1;
string host = 2;
string path = 3;
}
// A generic frame to emit a malformed frame
message H2FrameGeneric {
bytes frame_bytes = 1;
}
message Metadata {
map<string, string> metadata = 1;
}
message H2FrameMetadata {
H2HeadersFlags flags = 1;
uint32 stream_index = 2;
Metadata metadata = 3;
}
// A header that contains an arbitrary status
message H2FrameStatus {
bytes status = 1;
uint32 stream_index = 2;
}
message H2TestFrame {
// These values map to the frame creation methods in:
// test/common/http/http2/http2_frame.h
oneof frame_type {
H2FramePing ping = 1;
H2FrameSettings settings = 2;
H2FrameHeaders headers = 3;
H2FrameContinuation continuation = 4;
H2FrameData data = 5;
H2FramePriority priority = 6;
H2FramePushPromise push_promise = 7;
H2FrameResetStream reset_stream = 8;
H2FrameGoAway go_away = 9;
H2FrameWindowUpdate window_update = 10;
H2FrameMalformedRequest malformed_request = 11;
H2FrameMalformedRequestWithZerolenHeader malformed_request_with_zerolen_header = 12;
H2FrameRequest request = 13;
H2FramePostRequest post_request = 14;
H2FrameGeneric generic = 15;
H2FrameStatus status = 16;
H2FrameMetadata metadata = 77;
}
}
message DownstreamSendEvent {
repeated H2TestFrame h2_frames = 1;
}
message UpstreamSendEvent {
repeated H2TestFrame h2_frames = 1;
}
message Event {
oneof event_selector {
// Frames sent from downstream.
DownstreamSendEvent downstream_send_event = 1;
// Frames sent from upstream.
UpstreamSendEvent upstream_send_event = 2;
}
}
// Test case in corpus for *_h2_capture_fuzz_test.
message H2CaptureFuzzTestCase {
repeated Event events = 1;
}