Fixed potential DoS issue

This commit is contained in:
Mathias Hall-Andersen 2018-01-16 14:57:12 +01:00
parent 1dd590b91b
commit 068d932f2c

View file

@ -312,7 +312,7 @@ func (device *Device) RoutineHandshake() {
entry := device.indices.Lookup(reply.Receiver) entry := device.indices.Lookup(reply.Receiver)
if entry.peer == nil { if entry.peer == nil {
return continue
} }
entry.peer.mac.ConsumeReply(&reply) entry.peer.mac.ConsumeReply(&reply)
continue continue
@ -323,7 +323,7 @@ func (device *Device) RoutineHandshake() {
if !device.mac.CheckMAC1(elem.packet) { if !device.mac.CheckMAC1(elem.packet) {
logDebug.Println("Received packet with invalid mac1") logDebug.Println("Received packet with invalid mac1")
return continue
} }
// endpoints destination address is the source of the datagram // endpoints destination address is the source of the datagram
@ -347,7 +347,7 @@ func (device *Device) RoutineHandshake() {
reply, err := device.mac.CreateReply(elem.packet, sender, srcBytes) reply, err := device.mac.CreateReply(elem.packet, sender, srcBytes)
if err != nil { if err != nil {
logError.Println("Failed to create cookie reply:", err) logError.Println("Failed to create cookie reply:", err)
return continue
} }
// marshal and send reply // marshal and send reply