aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2018-01-16 14:57:12 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2018-01-16 14:57:12 +0100
commit068d932f2c54f3b1cf0873d74113205dbeb1816f (patch)
tree50204d0d9463e97a6439f42ef531323565cfec21
parentWork on timer teardown + bug fixes (diff)
downloadwireguard-go-068d932f2c54f3b1cf0873d74113205dbeb1816f.tar.xz
wireguard-go-068d932f2c54f3b1cf0873d74113205dbeb1816f.zip
Fixed potential DoS issue
-rw-r--r--src/receive.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/receive.go b/src/receive.go
index e6e8481..0b87a3c 100644
--- a/src/receive.go
+++ b/src/receive.go
@@ -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