From e8e8e09793c2dfc83f2cd9922ee30bf1f540161c Mon Sep 17 00:00:00 2001 From: Matrix86 Date: Wed, 21 Feb 2018 17:46:19 +0100 Subject: [PATCH] Fix #57: the check of the binary array was wrong --- packets/dot11.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packets/dot11.go b/packets/dot11.go index 2f44173d..257d1b1e 100644 --- a/packets/dot11.go +++ b/packets/dot11.go @@ -80,7 +80,7 @@ func Dot11ParseEncryption(packet gopacket.Packet, dot11 *layers.Dot11) (bool, st found = true if info.ID == layers.Dot11InformationElementIDRSNInfo { enc = "WPA2" - } else if info.ID == layers.Dot11InformationElementIDVendor && bytes.Index(info.OUI, []byte{0, 0x50, 0xf2, 1, 1, 0}) == 0 { + } else if info.ID == layers.Dot11InformationElementIDVendor && info.Length >= 8 && bytes.Compare(info.OUI, []byte{0, 0x50, 0xf2, 1}) == 0 && bytes.HasPrefix(info.Info, []byte{1, 0}) { enc = "WPA" } }