validate target
authorChristian Grothoff <christian@grothoff.org>
Fri, 15 Jan 2010 09:02:23 +0000 (09:02 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 15 Jan 2010 09:02:23 +0000 (09:02 +0000)
src/core/gnunet-service-core.c

index b11e2d37f48ff159037b07967b9c24dba2a7f581..c766ceb30114bcc9f70e01019f875a826c6f5efc 100644 (file)
@@ -2349,6 +2349,14 @@ handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m)
                                &process_hello_retry_handle_set_key, m_cpy);
       return;
     }
+  if (0 != memcmp (&m->target,
+                  &my_identity,
+                  sizeof (struct GNUNET_PeerIdentity)))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                 _("Received `%s' message that was not for me.  Ignoring.\n"));
+      return;
+    }
   if ((ntohl (m->purpose.size) !=
        sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) +
        sizeof (struct GNUNET_TIME_AbsoluteNBO) +