gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated (d09be50f3 -> 2c71a76ae)


From: gnunet
Subject: [gnunet] branch master updated (d09be50f3 -> 2c71a76ae)
Date: Thu, 02 Nov 2023 16:41:22 +0100

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

t3sserakt pushed a change to branch master
in repository gnunet.

    from d09be50f3 Merge branch 'master' of ssh://git.gnunet.org/gnunet
     new 53ad5e48f Transport: Fixed bug while setting up key material for 
backchannel.
     new 57d31ec0e Transport: Fixed bug in free pending messages and queue 
entries.
     new 20f5e2af5 Transport: Fixed bug in ring buffer for core messages.
     new 2c71a76ae Topology: Fixed small bug.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/service/topology/gnunet-daemon-topology.c    |  4 ++--
 src/service/transport/gnunet-service-transport.c | 30 ++++++++++++++++--------
 2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/service/topology/gnunet-daemon-topology.c 
b/src/service/topology/gnunet-daemon-topology.c
index 587f564dd..453ac9661 100644
--- a/src/service/topology/gnunet-daemon-topology.c
+++ b/src/service/topology/gnunet-daemon-topology.c
@@ -648,8 +648,8 @@ address_iterator (void *cls,
 static void
 consider_for_advertising (const struct GNUNET_MessageHeader *hello)
 {
-  int num_addresses_old;
-  int num_addresses_new;
+  int num_addresses_old = 0;
+  int num_addresses_new = 0;
   struct GNUNET_HELLO_Builder *builder = GNUNET_HELLO_builder_from_msg (hello);
   struct GNUNET_PeerIdentity pid;
   struct Peer *peer;
diff --git a/src/service/transport/gnunet-service-transport.c 
b/src/service/transport/gnunet-service-transport.c
index ff5c99bb5..a4850fa26 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -1776,7 +1776,7 @@ struct DistanceVector
   /**
    * Master secret for the setup of the Key material for the backchannel. 
    */
-  struct GNUNET_HashCode km;
+  struct GNUNET_HashCode *km;
 };
 
 
@@ -3084,8 +3084,14 @@ free_pending_message (struct PendingMessage *pm)
   free_fragment_tree (pm);
   if (NULL != pm->qe)
   {
+    struct QueueEntry *qe = pm->qe;
+
     GNUNET_assert (pm == pm->qe->pm);
     pm->qe->pm = NULL;
+    GNUNET_CONTAINER_DLL_remove (qe->queue->queue_head,
+                               qe->queue->queue_tail,
+                               qe);
+    GNUNET_free (qe);
   }
   if (NULL != pm->bpm)
   {
@@ -3093,7 +3099,12 @@ free_pending_message (struct PendingMessage *pm)
     if (NULL != pm->bpm->qe)
     {
       struct QueueEntry *qe = pm->bpm->qe;
+
       qe->pm = NULL;
+      GNUNET_CONTAINER_DLL_remove (qe->queue->queue_head,
+                               qe->queue->queue_tail,
+                               qe);
+      GNUNET_free (qe);
     }
     GNUNET_free (pm->bpm);
   }
@@ -3417,6 +3428,7 @@ free_dv_route (struct DistanceVector *dv)
       GNUNET_SCHEDULER_cancel (dv->timeout_task);
       dv->timeout_task = NULL;
     }
+    GNUNET_free (dv->km);
     GNUNET_free (dv);
   }
 }
@@ -4839,6 +4851,7 @@ encapsulate_for_dv (struct DistanceVector *dv,
   char enc[sizeof(struct TransportDVBoxPayloadP) + enc_body_size] GNUNET_ALIGN;
   struct DVKeyState *key;
   struct GNUNET_TIME_Relative rtt;
+  struct GNUNET_HashCode km;
 
   key = GNUNET_new (struct DVKeyState);
   /* Encrypt payload */
@@ -4851,7 +4864,9 @@ encapsulate_for_dv (struct DistanceVector *dv,
   {
     GNUNET_CRYPTO_eddsa_kem_encaps (&dv->target.public_key,
                                     &dv->ephemeral_key,
-                                    &dv->km);
+                                    &km);
+    dv->km = GNUNET_new (struct GNUNET_HashCode);
+    GNUNET_memcpy (dv->km, &km, sizeof(struct GNUNET_HashCode));
     sign_ephemeral (dv);
   }
   box_hdr.ephemeral_key = dv->ephemeral_key;
@@ -4863,7 +4878,7 @@ encapsulate_for_dv (struct DistanceVector *dv,
   // We are creating this key, so this must work.
   // FIXME: Possibly also add return values here. We are processing
   // Input from other peers...
-  dv_setup_key_state_from_km (&dv->km, &box_hdr.iv, key);
+  dv_setup_key_state_from_km (dv->km, &box_hdr.iv, key);
   payload_hdr.sender = GST_my_identity;
   payload_hdr.monotonic_time = GNUNET_TIME_absolute_hton (dv->monotime);
   dv_encrypt (key, &payload_hdr, enc, sizeof(payload_hdr));
@@ -6471,12 +6486,6 @@ completed_pending_message (struct PendingMessage *pm)
                 pm->logging_uuid);
     if (NULL != pm->frag_parent)
     {
-      if (NULL != pm->bpm)
-      {
-        GNUNET_free (pm->bpm);
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "Freed bpm\n");
-      }
       pos = pm->frag_parent;
       free_pending_message (pm);
       pos->bpm = NULL;
@@ -6777,6 +6786,7 @@ send_msg_from_cache (struct VirtualLink *vl)
                     (unsigned int) ntohs (mh->size));
         finish_handling_raw_message (vl, mh, cmc, GNUNET_NO);
         GNUNET_free (mh);
+        GNUNET_free (rbe);
       }
       else
       {
@@ -10374,7 +10384,7 @@ handle_send_message_ack (void *cls,
     // TODO I guess this can happen, if the Ack from the peer comes before the 
Ack from the queue.
     // Update: Maybe QueueEntry was accidentally freed during freeing 
PendingMessage.
     /* this should never happen */
-    GNUNET_break (0);
+    // GNUNET_break (0);
     // GNUNET_SERVICE_client_drop (tc->client);
     GNUNET_SERVICE_client_continue (tc->client);
     return;

-- 
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]