@@ -4,15 +4,6 @@ import (
44 "bytes"
55 "encoding/binary"
66 "fmt"
7- "math/rand"
8- "net"
9- "os"
10- "os/exec"
11- "reflect"
12- "sort"
13- "strconv"
14- "strings"
15- "time"
167 "gapcast/libs/RadarRSSI"
178 "gapcast/libs/RadarRSSI/libs"
189 "gapcast/libs/jsonreader"
@@ -23,6 +14,15 @@ import (
2314 "github.com/google/gopacket/pcap"
2415 "github.com/mattn/go-isatty"
2516 "golang.org/x/exp/slices"
17+ "math/rand"
18+ "net"
19+ "os"
20+ "os/exec"
21+ "reflect"
22+ "sort"
23+ "strconv"
24+ "strings"
25+ "time"
2626)
2727
2828var (
@@ -136,7 +136,7 @@ func ParseChannels(ch string, g5 bool, g5g24 bool) ([]int, string) {
136136 if g5 {
137137 if ! slices .Contains (G5channels [:], channel ) {
138138 return nil , fmt .Sprintf ("Channel %s is invalid for 5 GHz." , channelStr )
139- }
139+ }
140140 } else {
141141 if ! slices .Contains (G24channels [:], channel ) {
142142 return nil , fmt .Sprintf ("Channel %s is invalid for 2.4 GHz." , channelStr )
@@ -493,7 +493,7 @@ func getAKMFromID(authID uint8) (auth string) {
493493}
494494
495495// Check if cipher and AKM they are associated for WPA-3
496- func isWPA3Suite (cipher string , auth string ) ( bool ) {
496+ func isWPA3Suite (cipher string , auth string ) bool {
497497 // reference https://www.wi-fi.org/system/files/WPA3%20Specification%20v3.3.pdf
498498 switch cipher {
499499 case "GCMP" , "GCMP256" , "CCMP" :
@@ -531,7 +531,7 @@ func GetENCSuite(packet gopacket.Packet) (encSuite string) {
531531 encSuite = "WPA2"
532532 if len (buf ) > 7 {
533533 var rsnCipherCount uint16 = binary .LittleEndian .Uint16 (buf [6 :8 ])
534- buf = buf [8 :]
534+ buf = buf [8 :]
535535 if len (buf ) > int (rsnCipherCount )* 4 {
536536 buf = buf [(rsnCipherCount - 1 )* 4 :]
537537 cipher = getCipherFromID (buf [3 ])
@@ -573,7 +573,9 @@ func GetENCSuite(packet gopacket.Packet) (encSuite string) {
573573 }
574574 }
575575 }
576- if encSuite == "OPEN" {return "OPEN" }
576+ if encSuite == "OPEN" {
577+ return "OPEN"
578+ }
577579 if isWPA3Suite (cipher , auth ) {
578580 encSuite = "WPA3"
579581 }
@@ -595,7 +597,7 @@ func GetENCSuite(packet gopacket.Packet) (encSuite string) {
595597func GetESSID (packet gopacket.Packet ) (ESSID string ) {
596598 for _ , layer := range packet .Layers () {
597599 if layer .LayerType () == layers .LayerTypeDot11InformationElement {
598- if dot11info , exist := layer .(* layers.Dot11InformationElement ); exist && dot11info .ID == layers .Dot11InformationElementIDSSID {
600+ if dot11info , exist := layer .(* layers.Dot11InformationElement ); exist && dot11info .ID == layers .Dot11InformationElementIDSSID {
599601 if len (dot11info .Info ) == 0 {
600602 return "<hidden>"
601603 } else if IsValidESSID (string (dot11info .Info )) {
0 commit comments