Repository navigation
Commit d57c0a4
committed
refactor(protocols)!: refuse fixed-size octets and timestamp counts the makers masked (#2676)
- _make_octets: a caller's octets for a fixed-size field raise ProtocolError
at any other width instead of being padded or cut -- the IPv4, MH, HIP,
ICMP, IGMP, IPX and OSPF checksums, the CALIPSO checksum, MH cookies and
keygen tokens, HIP opaque and payload data, PCAP-NG ZigBee keys, IPX
addresses, and the reserved, unused and zero octets of HOPOPT, IPv6-Opts,
IPv6-Frag, IPv6-Route, MH, HIP, ICMP, IGMPv3, OSPF and IP_Pseudo.
- _fill_short_read: a model's reserved octets are zero-filled before the
check only where its short read ends at or before them, for the rebuild
to cut back; any other model's are checked as a caller's are.
- IPv4 TS: a slot count past nine (list) or four (dict) raises instead of
being cut; the default is derived from the form.
- Empty defaults of fixed-size fields become zero octets of their width.
- protocol.rst documents the shared value helpers and how makers use them.
- MH ipv4_dhcp.mode=True is unchanged: S is one bit, which takes a bool.
- Tests: a source sweep finds every fixed-size octet field a maker writes;
every refusal fails on main; cut captures rebuild as captured; the widest
values build and round-trip.1 parent 596dcfa commit d57c0a4
21 files changed
Lines changed: 1372 additions & 292 deletions
File tree
- docs/source/pcapkit/protocols
- pcapkit/protocols
- application
- internet
- misc
- checksum
- tests
- project
- protocols
- internet
- misc/checksum
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
88 | 105 | | |
89 | 106 | | |
90 | 107 | | |
| |||
140 | 157 | | |
141 | 158 | | |
142 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
143 | 183 | | |
144 | 184 | | |
145 | 185 | | |
| |||
205 | 245 | | |
206 | 246 | | |
207 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
208 | 263 | | |
209 | 264 | | |
210 | 265 | | |
| |||
233 | 288 | | |
234 | 289 | | |
235 | 290 | | |
236 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
237 | 300 | | |
238 | 301 | | |
239 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
301 | 307 | | |
302 | 308 | | |
303 | 309 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
309 | 316 | | |
310 | 317 | | |
311 | 318 | | |
| |||
341 | 348 | | |
342 | 349 | | |
343 | 350 | | |
344 | | - | |
| 351 | + | |
| 352 | + | |
345 | 353 | | |
346 | 354 | | |
347 | 355 | | |
| |||
391 | 399 | | |
392 | 400 | | |
393 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
394 | 410 | | |
395 | 411 | | |
396 | 412 | | |
| |||
399 | 415 | | |
400 | 416 | | |
401 | 417 | | |
402 | | - | |
| 418 | + | |
403 | 419 | | |
404 | 420 | | |
405 | 421 | | |
| |||
497 | 513 | | |
498 | 514 | | |
499 | 515 | | |
500 | | - | |
501 | | - | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
502 | 519 | | |
503 | 520 | | |
504 | 521 | | |
| |||
509 | 526 | | |
510 | 527 | | |
511 | 528 | | |
512 | | - | |
| 529 | + | |
| 530 | + | |
513 | 531 | | |
514 | 532 | | |
515 | 533 | | |
| |||
519 | 537 | | |
520 | 538 | | |
521 | 539 | | |
522 | | - | |
| 540 | + | |
| 541 | + | |
523 | 542 | | |
524 | 543 | | |
525 | 544 | | |
| |||
0 commit comments