aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/gnunet-communicator-tcp.c11
1 files 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)
1272 &thp.purpose, 1272 &thp.purpose,
1273 &rekey.sender_sig)); 1273 &rekey.sender_sig));
1274 calculate_hmac (&queue->out_hmac, &rekey, sizeof(rekey), &rekey.hmac); 1274 calculate_hmac (&queue->out_hmac, &rekey, sizeof(rekey), &rekey.hmac);
1275 memcpy (queue->pwrite_buf, &rekey, sizeof(rekey)); 1275 GNUNET_assert (0 ==
1276 queue->pwrite_off = sizeof(rekey); 1276 gcry_cipher_encrypt (queue->out_cipher,
1277 &queue->cwrite_buf[queue->cwrite_off],
1278 sizeof(rekey),
1279 &rekey,
1280 sizeof(rekey)));
1281 queue->cwrite_off += sizeof(rekey);
1277} 1282}
1278 1283
1279 1284
@@ -1339,9 +1344,9 @@ queue_write (void *cls)
1339 (0 == 1344 (0 ==
1340 GNUNET_TIME_absolute_get_remaining (queue->rekey_time).rel_value_us))) 1345 GNUNET_TIME_absolute_get_remaining (queue->rekey_time).rel_value_us)))
1341 { 1346 {
1347 inject_rekey (queue);
1342 gcry_cipher_close (queue->out_cipher); 1348 gcry_cipher_close (queue->out_cipher);
1343 setup_out_cipher (queue); 1349 setup_out_cipher (queue);
1344 inject_rekey (queue);
1345 } 1350 }
1346 if ((0 == queue->pwrite_off) && (! queue->finishing) && 1351 if ((0 == queue->pwrite_off) && (! queue->finishing) &&
1347 (GNUNET_YES == queue->mq_awaits_continue)) 1352 (GNUNET_YES == queue->mq_awaits_continue))