gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 156/164: Added check to enforce active passive switch when inqu


From: gnunet
Subject: [gnunet] 156/164: Added check to enforce active passive switch when inquiry colision occour
Date: Fri, 30 Jul 2021 15:33:42 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit 24376e18792674b6b9b5ca5aa1a9d018db241add
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Mon Jun 14 11:22:46 2021 +0200

    Added check to enforce active passive switch when inquiry colision occour
---
 src/setu/gnunet-service-setu.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index 4a891986e..d7c5fb233 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -524,6 +524,11 @@ struct Operation
   * Estimated or committed set difference at the start
   */
   uint64_t local_set_diff;
+
+  /**
+   *
+   */
+   bool active_passive_switch_required;
 };
 
 
@@ -2524,10 +2529,12 @@ send_offers_iterator (void *cls,
   struct GNUNET_MessageHeader *mh;
 
   /* Detect 32-bit key collision for the 64-bit IBF keys. */
-  if (ke->ibf_key.key_val != sec->ibf_key.key_val)
-    return GNUNET_YES;
+  if (ke->ibf_key.key_val != sec->ibf_key.key_val) {
+      op->active_passive_switch_required = true;
+      return GNUNET_YES;
+  }
 
-  /* Prevent implementation from sending a offer multible times in case of 
roll switch */
+  /* Prevent implementation from sending a offer multiple times in case of 
roll switch */
   if (GNUNET_YES ==
       is_message_in_message_control_flow (
         op->message_control_flow,
@@ -3000,6 +3007,7 @@ handle_union_p2p_ibf (void *cls,
   }
   op->differential_sync_iterations++;
   check_max_differential_rounds (op);
+  op->active_passive_switch_required = false;
 
 #if MEASURE_PERFORMANCE
   perf_store.ibf.received += 1;
@@ -4102,6 +4110,14 @@ handle_union_p2p_done (void *cls,
     return;
   }
 
+    if(op->active_passive_switch_required) {
+        LOG (GNUNET_ERROR_TYPE_ERROR,
+             "PROTOCOL VIOLATION: Received done but role change is 
necessary\n");
+        GNUNET_break (0);
+        fail_union_operation (op);
+        return;
+    }
+
 #if MEASURE_PERFORMANCE
   perf_store.done.received += 1;
 #endif
@@ -4926,6 +4942,7 @@ handle_client_evaluate (void *cls,
   op->ibf_bucket_number_factor = msg->ibf_bucket_number_factor;
   op->ibf_number_buckets_per_element = msg->ibf_number_of_buckets_per_element;
   op->byzantine_upper_bound = msg->byzantine_upper_bond;
+  op->active_passive_switch_required = false;
   context = GNUNET_MQ_extract_nested_mh (msg);
 
   /* create hashmap for message control */
@@ -5132,6 +5149,7 @@ handle_client_accept (void *cls,
   op->ibf_bucket_number_factor = msg->ibf_bucket_number_factor;
   op->ibf_number_buckets_per_element = msg->ibf_number_of_buckets_per_element;
   op->byzantine_upper_bound = msg->byzantine_upper_bond;
+  op->active_passive_switch_required = false;
   /* create hashmap for message control */
   op->message_control_flow = GNUNET_CONTAINER_multihashmap_create (32,
                                                                    GNUNET_NO);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]