splitting 'struct GNUNET_CRYPTO_EccPublicKey' into one struct for signing and another...
[oweals/gnunet.git] / src / transport / test_plugin_transport.c
index 60cc3c94133dc12be7ffe059e6395069c3bd0d9b..eecb30605a97efd82febea35647f9869cdfdf232 100644 (file)
@@ -48,7 +48,7 @@
 /**
  * Our public key.
  */
-static struct GNUNET_CRYPTO_EccPublicKey my_public_key;
+static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key;
 
 /**
  * Our identity.
@@ -342,6 +342,7 @@ env_notify_address (void *cls,
                     const char *plugin)
 {
   struct AddressWrapper *w;
+  struct AddressWrapper *wtmp;
   void *s2a;
   size_t s2a_len;
 
@@ -351,6 +352,16 @@ env_notify_address (void *cls,
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Adding address of length %u\n", addrlen);
 
+      for (wtmp = head; NULL != wtmp; wtmp = wtmp->next)
+      {
+       if ((addrlen == wtmp->addrlen) && (0 == memcmp (addr, wtmp->addr, addrlen)))
+       {
+               GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                      "Duplicate address notification .... \n");
+                       return;
+       }
+      }
+
       w = GNUNET_new (struct AddressWrapper);
       w->addr = GNUNET_malloc (addrlen);
       w->addrlen = addrlen;
@@ -623,7 +634,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     end_badly_now ();
     return;
   }
-  GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key);
+  GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key);
   GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key),
                       &my_identity.hashPubKey);