Skip to content

Commit

Permalink
Merge branch 's1g-beacon'
Browse files Browse the repository at this point in the history
  • Loading branch information
rkinder2023 committed Jul 11, 2024
2 parents 2128912 + 921e615 commit 52f8eb1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scapy/layers/dot11.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,14 @@ class Dot11(Packet):
FlagsField("FCfield", 0, 4,
["pw-mgt", "MD", "protected", "order"]),
lambda pkt: (pkt.type, pkt.subtype) == (1, 6)
),
(
# FIXME: bw1/2/3 are a 3-bit field.
# Unsure how to do this properly.
FlagsField("FCfield", 0, 8,
["next_tbtt", "comp_ssid", "ano", "bw1",
"bw2", "bw3", "security", "AP_PM"]),
lambda pkt: (pkt.type, pkt.subtype) == (3, 1)
)
],
FlagsField("FCfield", 0, 8,
Expand Down Expand Up @@ -736,7 +744,7 @@ def guess_payload_class(self, payload):
if self.type == 0x02 and (
0x08 <= self.subtype <= 0xF and self.subtype != 0xD):
return Dot11QoS
elif self.FCfield.protected:
elif hasattr(self.FCfield, "protected") and self.FCfield.protected:
# When a frame is handled by encryption, the Protected Frame bit
# (previously called WEP bit) is set to 1, and the Frame Body
# begins with the appropriate cryptographic header.
Expand Down
8 changes: 8 additions & 0 deletions test/scapy/layers/dot11.uts
Original file line number Diff line number Diff line change
Expand Up @@ -772,3 +772,11 @@ assert pkt[Dot11].subtype == 1
assert pkt[Dot11].addr1 == '2c:2f:75:1c:10:33'
assert pkt[Dot11S1GBeacon].timestamp == 16281960
assert pkt[Dot11Elt::{"ID": 0}].info == b"WiFiDiving"
assert pkt[Dot11].FCfield.bw1 == 1
assert pkt[Dot11].FCfield.bw2 == 1
assert pkt[Dot11].FCfield.bw3 == 0
assert pkt[Dot11].FCfield.next_tbtt == False
assert pkt[Dot11].FCfield.comp_ssid == False
assert pkt[Dot11].FCfield.ano == False
assert pkt[Dot11].FCfield.security == False
assert pkt[Dot11].FCfield.AP_PM == False

0 comments on commit 52f8eb1

Please sign in to comment.