From f0126c28fb7cddba6fadd98fd4483d4e9d599cc5 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Fri, 23 Aug 2024 10:39:58 +0200 Subject: [PATCH] new: added new wifi RSN parsing --- packets/dot11_types.go | 23 ++++++++++++++++------- packets/dot11_types_test.go | 8 ++++---- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/packets/dot11_types.go b/packets/dot11_types.go index 6df708af..150e83b9 100644 --- a/packets/dot11_types.go +++ b/packets/dot11_types.go @@ -28,25 +28,34 @@ func (a Dot11CipherType) String() string { case Dot11CipherWep104: return "WEP104" default: - return "UNK" + return fmt.Sprintf("UNK CIPHER %d", a) } } type Dot11AuthType uint8 const ( - Dot11AuthMgt Dot11AuthType = 1 - Dot11AuthPsk Dot11AuthType = 2 + Dot11AuthNone Dot11AuthType = 0 + Dot11AuthWPA Dot11AuthType = 1 + Dot11AuthPSK Dot11AuthType = 2 + Dot11AuthFT8021X Dot11AuthType = 3 + Dot11AuthFTPSK Dot11AuthType = 4 ) func (a Dot11AuthType) String() string { switch a { - case Dot11AuthMgt: - return "MGT" - case Dot11AuthPsk: + case Dot11AuthNone: + return "NONE" + case Dot11AuthWPA: + return "WPA" + case Dot11AuthPSK: return "PSK" + case Dot11AuthFT8021X: + return "FT 802.1X" + case Dot11AuthFTPSK: + return "FT PSK" default: - return "UNK" + return fmt.Sprintf("UNK AUTH %d", a) } } diff --git a/packets/dot11_types_test.go b/packets/dot11_types_test.go index 98510021..1dbf9190 100644 --- a/packets/dot11_types_test.go +++ b/packets/dot11_types_test.go @@ -46,8 +46,8 @@ func TestDot11AuthTypes(t *testing.T) { got interface{} exp interface{} }{ - {uint8(Dot11AuthMgt), uint8(1)}, - {uint8(Dot11AuthPsk), uint8(2)}, + {uint8(Dot11AuthWPA), uint8(1)}, + {uint8(Dot11AuthPSK), uint8(2)}, } for _, u := range units { if !reflect.DeepEqual(u.exp, u.got) { @@ -61,8 +61,8 @@ func TestDot11AuthTypesAsString(t *testing.T) { got interface{} exp interface{} }{ - {Dot11AuthMgt.String(), "MGT"}, - {Dot11AuthPsk.String(), "PSK"}, + {Dot11AuthWPA.String(), "WPA"}, + {Dot11AuthPSK.String(), "PSK"}, } for _, u := range units { if !reflect.DeepEqual(u.exp, u.got) {