gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: fix rekey


From: gnunet
Subject: [gnunet] branch master updated: fix rekey
Date: Thu, 26 Dec 2019 06:18:59 +0100

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

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 191914dcd fix rekey
191914dcd is described below

commit 191914dcd42b59e5c9bd980168ff6d14a5e38315
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Thu Dec 26 14:15:42 2019 +0900

    fix rekey
---
 src/transport/gnunet-communicator-tcp.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/transport/gnunet-communicator-tcp.c 
b/src/transport/gnunet-communicator-tcp.c
index 12f2dbc42..e902e2316 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -1272,8 +1272,13 @@ inject_rekey (struct Queue *queue)
                                                         &thp.purpose,
                                                         &rekey.sender_sig));
   calculate_hmac (&queue->out_hmac, &rekey, sizeof(rekey), &rekey.hmac);
-  memcpy (queue->pwrite_buf, &rekey, sizeof(rekey));
-  queue->pwrite_off = sizeof(rekey);
+  GNUNET_assert (0 ==
+                 gcry_cipher_encrypt (queue->out_cipher,
+                                      &queue->cwrite_buf[queue->cwrite_off],
+                                      sizeof(rekey),
+                                      &rekey,
+                                      sizeof(rekey)));
+  queue->cwrite_off += sizeof(rekey);
 }
 
 
@@ -1339,9 +1344,9 @@ queue_write (void *cls)
        (0 ==
         GNUNET_TIME_absolute_get_remaining (queue->rekey_time).rel_value_us)))
   {
+    inject_rekey (queue);
     gcry_cipher_close (queue->out_cipher);
     setup_out_cipher (queue);
-    inject_rekey (queue);
   }
   if ((0 == queue->pwrite_off) && (! queue->finishing) &&
       (GNUNET_YES == queue->mq_awaits_continue))

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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