]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
Fixed potential DoS issue
authorMathias Hall-Andersen <mathias@hall-andersen.dk>
Tue, 16 Jan 2018 13:57:12 +0000 (14:57 +0100)
committerMathias Hall-Andersen <mathias@hall-andersen.dk>
Tue, 16 Jan 2018 13:57:12 +0000 (14:57 +0100)
src/receive.go

index e6e8481001fc35ed66bc8e601b2eb17a1d06a90a..0b87a3cd4d1fc5588e8a6cde38900cb4bc7fe8ff 100644 (file)
@@ -312,7 +312,7 @@ func (device *Device) RoutineHandshake() {
 
                        entry := device.indices.Lookup(reply.Receiver)
                        if entry.peer == nil {
-                               return
+                               continue
                        }
                        entry.peer.mac.ConsumeReply(&reply)
                        continue
@@ -323,7 +323,7 @@ func (device *Device) RoutineHandshake() {
 
                        if !device.mac.CheckMAC1(elem.packet) {
                                logDebug.Println("Received packet with invalid mac1")
-                               return
+                               continue
                        }
 
                        // 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)
                                        if err != nil {
                                                logError.Println("Failed to create cookie reply:", err)
-                                               return
+                                               continue
                                        }
 
                                        // marshal and send reply