From 279f279758af620fbfc490521bff37407e7c4591 Mon Sep 17 00:00:00 2001 From: Nils Durner Date: Fri, 1 Oct 2010 19:21:19 +0000 Subject: [PATCH] reintroduce seeds, fix calculations --- src/core/gnunet-service-core.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index 6e5a907b6..9496d2209 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c @@ -228,8 +228,7 @@ struct PingMessage /** * Seed for the IV */ - /* FIXME: Does adding this member break things (why?) */ - /*uint32_t iv_seed GNUNET_PACKED;*/ + uint32_t iv_seed GNUNET_PACKED; /** * Random number chosen to make reply harder. @@ -259,8 +258,7 @@ struct PongMessage /** * Seed for the IV */ - /* FIXME: Does adding this member break things (why?) */ - /*uint32_t iv_seed GNUNET_PACKED;*/ + uint32_t iv_seed GNUNET_PACKED; /** * Random number proochosen to make reply harder. Must be @@ -1324,7 +1322,7 @@ send_keep_alive (void *cls, &pp.challenge, &pm->challenge, sizeof (struct PingMessage) - - sizeof (struct GNUNET_MessageHeader)); + ((void *) &pm->challenge - (void *) pm)); process_encrypted_neighbour_queue (n); /* reschedule PING job */ left = GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_add (n->last_activity, @@ -2733,7 +2731,7 @@ send_key (struct Neighbour *n) &pp.challenge, &pm->challenge, sizeof (struct PingMessage) - - sizeof (struct GNUNET_MessageHeader)); + ((void *) &pm->challenge - (void *) pm)); GNUNET_STATISTICS_update (stats, gettext_noop ("# SET_KEY and PING messages created"), 1, @@ -2849,7 +2847,7 @@ handle_ping (struct Neighbour *n, const struct PingMessage *m) &m->challenge, &t.challenge, sizeof (struct PingMessage) - - sizeof (struct GNUNET_MessageHeader))) + ((void *) &m->challenge - (void *) m))) return; #if DEBUG_HANDSHAKE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -2890,7 +2888,7 @@ handle_ping (struct Neighbour *n, const struct PingMessage *m) &tx.challenge, &tp->challenge, sizeof (struct PongMessage) - - sizeof (struct GNUNET_MessageHeader)); + ((void *) &tp->challenge - (void *) tp)); GNUNET_STATISTICS_update (stats, gettext_noop ("# PONG messages created"), 1, @@ -2933,7 +2931,7 @@ handle_pong (struct Neighbour *n, &m->challenge, &t.challenge, sizeof (struct PongMessage) - - sizeof (struct GNUNET_MessageHeader))) + ((void *) &m->challenge - (void *) m))) { GNUNET_break_op (0); return; -- 2.25.1