fix: keeping red-mark for APs with captured key material even when stations disconnect (fixes #449)

This commit is contained in:
evilsocket 2019-02-15 12:08:55 +01:00
commit 38c761afa8
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
4 changed files with 123 additions and 95 deletions

View file

@ -10,7 +10,8 @@ type AccessPoint struct {
*Station
sync.Mutex
clients map[string]*Station
clients map[string]*Station
withKeyMaterial bool
}
type apJSON struct {
@ -106,6 +107,20 @@ func (ap *AccessPoint) EachClient(cb func(mac string, station *Station)) {
}
}
func (ap *AccessPoint) WithKeyMaterial(state bool) {
ap.Lock()
defer ap.Unlock()
ap.withKeyMaterial = state
}
func (ap *AccessPoint) HasKeyMaterial() bool {
ap.Lock()
defer ap.Unlock()
return ap.withKeyMaterial
}
func (ap *AccessPoint) NumHandshakes() int {
ap.Lock()
defer ap.Unlock()