Commit 8fc7fc9
authored
dot15d4: fix aux_sec_header incorrect parsing (#4969)
* dot15d4: fix aux_sec_header incorrect parsing (#4928)
Fix two bugs preventing correct parsing of 802.15.4 frames with the
security bit set:
1. Replace `is True` identity check with truthiness check in
ConditionalField lambdas for Dot15d4Data, Dot15d4Beacon, and
Dot15d4Cmd. In Python 3, `1 is True` is False because `is` checks
object identity, not equality, so aux_sec_header was never parsed.
2. Add extract_padding() to Dot15d4AuxSecurityHeader so that remaining
bytes after the header fields are returned to the parent packet
instead of being consumed as payload.
* test: wrap encrypted beacon test with no_debug_dissector
The encrypted beacon payload cannot be parsed as ZigBeeBeacon, which
raises an exception when conf.debug_dissector is True (as in CI).
* dot15d4: prevent dissection of encrypted payloads as upper layers
When sec_sc_seclevel >= 4 (ENC, ENC-MIC-*), the payload after
aux_sec_header is encrypted and must not be passed to upper layer
dissectors (SixLoWPAN, ZigBee, etc.). Add encrypted payload checks
to guess_payload_class() in Dot15d4Data, Dot15d4Beacon, and
Dot15d4Cmd.1 parent bfab325 commit 8fc7fc9
2 files changed
Lines changed: 95 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
224 | 227 | | |
225 | 228 | | |
226 | 229 | | |
| |||
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
236 | | - | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
240 | 247 | | |
241 | 248 | | |
242 | 249 | | |
| |||
268 | 275 | | |
269 | 276 | | |
270 | 277 | | |
271 | | - | |
| 278 | + | |
272 | 279 | | |
273 | 280 | | |
274 | 281 | | |
| |||
306 | 313 | | |
307 | 314 | | |
308 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
309 | 323 | | |
310 | 324 | | |
311 | 325 | | |
| |||
323 | 337 | | |
324 | 338 | | |
325 | 339 | | |
326 | | - | |
| 340 | + | |
327 | 341 | | |
328 | 342 | | |
329 | 343 | | |
| |||
345 | 359 | | |
346 | 360 | | |
347 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
348 | 366 | | |
349 | 367 | | |
350 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
328 | 402 | | |
329 | 403 | | |
330 | 404 | | |
| |||
0 commit comments