fix: one beacon packet per handshake is saved in order to have both the ESSID and BSSID

This commit is contained in:
evilsocket 2019-02-06 07:08:01 +01:00
commit 1120f98be1
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
4 changed files with 28 additions and 4 deletions

View file

@ -8,6 +8,7 @@ import (
type Handshake struct {
sync.Mutex
Beacon gopacket.Packet
Challenges []gopacket.Packet
Responses []gopacket.Packet
Confirmations []gopacket.Packet
@ -23,6 +24,16 @@ func NewHandshake() *Handshake {
}
}
func (h *Handshake) SetBeacon(pkt gopacket.Packet) {
h.Lock()
defer h.Unlock()
if h.Beacon == nil {
h.Beacon = pkt
h.unsaved = append(h.unsaved, pkt)
}
}
func (h *Handshake) AddFrame(n int, pkt gopacket.Packet) {
h.Lock()
defer h.Unlock()