aboutsummaryrefslogtreecommitdiff
path: root/src/consensus/gnunet-service-consensus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/consensus/gnunet-service-consensus.c')
-rw-r--r--src/consensus/gnunet-service-consensus.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 97cfc414f..765178b5e 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -25,10 +25,9 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_protocols.h" 29#include "gnunet_protocols.h"
30#include "gnunet_applications.h" 30#include "gnunet_applications.h"
31#include "gnunet_util_lib.h"
32#include "gnunet_set_service.h" 31#include "gnunet_set_service.h"
33#include "gnunet_consensus_service.h" 32#include "gnunet_consensus_service.h"
34#include "consensus_protocol.h" 33#include "consensus_protocol.h"
@@ -811,17 +810,20 @@ get_peer_idx (const struct GNUNET_PeerIdentity *peer, const struct ConsensusSess
811 * @param session_id local id of the consensus session 810 * @param session_id local id of the consensus session
812 */ 811 */
813static void 812static void
814compute_global_id (struct ConsensusSession *session, const struct GNUNET_HashCode *session_id) 813compute_global_id (struct ConsensusSession *session,
814 const struct GNUNET_HashCode *session_id)
815{ 815{
816 int i; 816 int i;
817 struct GNUNET_HashCode tmp; 817 struct GNUNET_HashCode tmp;
818 struct GNUNET_HashCode phash;
818 819
819 /* FIXME: use kdf? */ 820 /* FIXME: use kdf? */
820 821
821 session->global_id = *session_id; 822 session->global_id = *session_id;
822 for (i = 0; i < session->num_peers; ++i) 823 for (i = 0; i < session->num_peers; ++i)
823 { 824 {
824 GNUNET_CRYPTO_hash_xor (&session->global_id, &session->info[i].peer_id.hashPubKey, &tmp); 825 GNUNET_CRYPTO_hash (&session->info[i].peer_id, sizeof (struct GNUNET_PeerIdentity), &phash);
826 GNUNET_CRYPTO_hash_xor (&session->global_id, &phash, &tmp);
825 session->global_id = tmp; 827 session->global_id = tmp;
826 GNUNET_CRYPTO_hash (&session->global_id, sizeof (struct GNUNET_PeerIdentity), &tmp); 828 GNUNET_CRYPTO_hash (&session->global_id, sizeof (struct GNUNET_PeerIdentity), &tmp);
827 session->global_id = tmp; 829 session->global_id = tmp;