Added shakefile string for use in the UI

Added shakefile string for use in the UI
This commit is contained in:
curious-ninja 2021-01-01 16:22:59 -05:00
commit 8ccb7c7396
2 changed files with 11 additions and 0 deletions

View file

@ -119,6 +119,7 @@ func (mod *WiFiModule) discoverHandshakes(radiotap *layers.RadioTap, dot11 *laye
// make sure the info that we have key material for this AP // make sure the info that we have key material for this AP
// is persisted even after stations are pruned due to inactivity // is persisted even after stations are pruned due to inactivity
ap.WithKeyMaterial(true) ap.WithKeyMaterial(true)
ap.ShakeFile(shakesFileName)
} }
// if we added ourselves as a client station but we didn't get any // if we added ourselves as a client station but we didn't get any
// PMKID, just remove it from the list of clients of this AP. // PMKID, just remove it from the list of clients of this AP.

View file

@ -15,12 +15,14 @@ type AccessPoint struct {
aliases *data.UnsortedKV aliases *data.UnsortedKV
clients map[string]*Station clients map[string]*Station
withKeyMaterial bool withKeyMaterial bool
shakeFile string
} }
type apJSON struct { type apJSON struct {
*Station *Station
Clients []*Station `json:"clients"` Clients []*Station `json:"clients"`
Handshake bool `json:"handshake"` Handshake bool `json:"handshake"`
shakeFile string `json:"shakefile"`
} }
func NewAccessPoint(essid, bssid string, frequency int, rssi int8, aliases *data.UnsortedKV) *AccessPoint { func NewAccessPoint(essid, bssid string, frequency int, rssi int8, aliases *data.UnsortedKV) *AccessPoint {
@ -39,6 +41,7 @@ func (ap *AccessPoint) MarshalJSON() ([]byte, error) {
Station: ap.Station, Station: ap.Station,
Clients: make([]*Station, 0), Clients: make([]*Station, 0),
Handshake: ap.withKeyMaterial, Handshake: ap.withKeyMaterial,
shakeFile: ap.shakeFile,
} }
for _, c := range ap.clients { for _, c := range ap.clients {
@ -167,3 +170,10 @@ func (ap *AccessPoint) HasPMKID() bool {
return false return false
} }
func (ap *AccessPoint) ShakeFile(filename string) {
ap.Lock()
defer ap.Unlock()
ap.shakeFile = filename
}