Repository navigation
Commit ea9935d
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 57a6c36 commit ea9935d
21 files changed
Lines changed: 1371 additions & 277 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 | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
86 | 103 | | |
87 | 104 | | |
88 | 105 | | |
| |||
138 | 155 | | |
139 | 156 | | |
140 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
141 | 181 | | |
142 | 182 | | |
143 | 183 | | |
| |||
201 | 241 | | |
202 | 242 | | |
203 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
204 | 259 | | |
205 | 260 | | |
206 | 261 | | |
| |||
228 | 283 | | |
229 | 284 | | |
230 | 285 | | |
231 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
232 | 295 | | |
233 | 296 | | |
234 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
298 | 303 | | |
299 | 304 | | |
300 | 305 | | |
301 | | - | |
302 | | - | |
303 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
304 | 311 | | |
305 | 312 | | |
306 | 313 | | |
| |||
336 | 343 | | |
337 | 344 | | |
338 | 345 | | |
339 | | - | |
| 346 | + | |
| 347 | + | |
340 | 348 | | |
341 | 349 | | |
342 | 350 | | |
| |||
386 | 394 | | |
387 | 395 | | |
388 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
389 | 404 | | |
390 | 405 | | |
391 | 406 | | |
| |||
394 | 409 | | |
395 | 410 | | |
396 | 411 | | |
397 | | - | |
| 412 | + | |
398 | 413 | | |
399 | 414 | | |
400 | 415 | | |
| |||
492 | 507 | | |
493 | 508 | | |
494 | 509 | | |
495 | | - | |
496 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
497 | 513 | | |
498 | 514 | | |
499 | 515 | | |
| |||
504 | 520 | | |
505 | 521 | | |
506 | 522 | | |
507 | | - | |
| 523 | + | |
| 524 | + | |
508 | 525 | | |
509 | 526 | | |
510 | 527 | | |
| |||
514 | 531 | | |
515 | 532 | | |
516 | 533 | | |
517 | | - | |
| 534 | + | |
| 535 | + | |
518 | 536 | | |
519 | 537 | | |
520 | 538 | | |
| |||
0 commit comments