log if we get a redundant KX_AUTH, do not assert
authorChristian Grothoff <christian@grothoff.org>
Wed, 1 Feb 2017 15:49:06 +0000 (16:49 +0100)
committerChristian Grothoff <christian@grothoff.org>
Wed, 1 Feb 2017 15:49:06 +0000 (16:49 +0100)
src/cadet/gnunet-service-cadet-new_tunnels.c

index 32ddf29847927a4ac92ca5b01bcb9bb43fd774b4..ffc38af18a35ceb37c1239d3bf6039a8c7136f36 100644 (file)
@@ -1804,7 +1804,17 @@ GCT_handle_kx_auth (struct CadetTConnection *ct,
                          GCP_get_id (t->destination),
                          &msg->kx.ephemeral_key,
                          &msg->kx.ratchet_key);
-  GNUNET_break (GNUNET_OK == ret);
+  if (GNUNET_OK != ret)
+  {
+    if (GNUNET_NO == ret)
+      GNUNET_STATISTICS_update (stats,
+                                "# redundant KX_AUTH received",
+                                1,
+                                GNUNET_NO);
+    else
+      GNUNET_break (0); /* connect to self!? */
+    return;
+  }
   GNUNET_CRYPTO_hash (&ax_tmp.RK,
                       sizeof (ax_tmp.RK),
                       &kx_auth);