/**
* Our public key.
*/
-static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded my_public_key;
+static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key;
/**
* Our identity.
{
struct AddressWrapper *w;
int c = 0;
+
timeout_endbadly = GNUNET_SCHEDULER_NO_TASK;
if (GNUNET_SCHEDULER_NO_TASK != timeout_wait)
{
const char *plugin)
{
struct AddressWrapper *w;
+ struct AddressWrapper *wtmp;
void *s2a;
size_t s2a_len;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Adding address of length %u\n", addrlen);
- w = GNUNET_malloc (sizeof (struct AddressWrapper));
+ 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;
memcpy (w->addr, addr, addrlen);
end_badly_now();
return;
}
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Plugin creates `%s' %u\n",api->address_to_string (api, s2a, s2a_len), s2a_len);
+
/*
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Plugin creates `%s' %u\n",api->address_to_string (api, s2a, s2a_len), s2a_len);
+
int c1;
for (c1 = 0; c1 < s2a_len; c1++ )
fprintf (stderr, "%u == %u\n", ((char *) s2a)[c1], ((char *) w->addr)[c1]);
env.my_identity = &my_identity;
env.max_connections = max_connect_per_transport;
env.stats = stats;
-
env.receive = &env_receive;
env.notify_address = &env_notify_address;
env.get_address_type = &env_get_address_type;
env.session_end = &env_session_end;
}
+
static int
handle_helper_message (void *cls, void *client,
const struct GNUNET_MessageHeader *hdr)
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);