[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: only hash over PID, not full HELLO URL w
From: |
gnunet |
Subject: |
[gnunet] branch master updated: only hash over PID, not full HELLO URL when checking for duplicate HELLO blocks |
Date: |
Sat, 12 Mar 2022 04:29:23 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new f818a3feb only hash over PID, not full HELLO URL when checking for
duplicate HELLO blocks
f818a3feb is described below
commit f818a3feb7b354ad1dd2bc7abd903d710cc83f11
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sat Mar 12 04:29:16 2022 +0100
only hash over PID, not full HELLO URL when checking for duplicate HELLO
blocks
---
src/dht/plugin_block_dht.c | 19 ++++++++++++++-----
1 file 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;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: only hash over PID, not full HELLO URL when checking for duplicate HELLO blocks,
gnunet <=