summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-12 04:29:16 +0100
committerChristian Grothoff <grothoff@gnunet.org>2022-03-12 04:29:16 +0100
commitf818a3feb7b354ad1dd2bc7abd903d710cc83f11 (patch)
treea8cc34eaf50477999a5e5fe29a2c6ddbf87fb368
parentff992f47e6528b00937c3951b812f6938e1ee21a (diff)
only hash over PID, not full HELLO URL when checking for duplicate HELLO blocks
-rw-r--r--src/dht/plugin_block_dht.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index 9ff67fa4e..5b6841a98 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -254,14 +254,23 @@ block_plugin_dht_check_reply (
}
case GNUNET_BLOCK_TYPE_DHT_URL_HELLO:
{
- struct GNUNET_HashCode phash;
+ struct GNUNET_HELLO_Builder *b;
+ struct GNUNET_PeerIdentity pid;
+ struct GNUNET_HashCode h_pid;
- GNUNET_CRYPTO_hash (reply_block,
- reply_block_size,
- &phash);
+ b = GNUNET_HELLO_builder_from_block (reply_block,
+ reply_block_size);
+ GNUNET_assert (NULL != b);
+ GNUNET_HELLO_builder_iterate (b,
+ &pid,
+ NULL, NULL);
+ GNUNET_CRYPTO_hash (&pid,
+ sizeof (pid),
+ &h_pid);
+ GNUNET_HELLO_builder_free (b);
if (GNUNET_YES ==
GNUNET_BLOCK_GROUP_bf_test_and_set (group,
- &phash))
+ &h_pid))
return GNUNET_BLOCK_REPLY_OK_DUPLICATE;
return GNUNET_BLOCK_REPLY_OK_MORE;
}