gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r28562 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r28562 - gnunet/src/mesh
Date: Tue, 13 Aug 2013 12:52:38 +0200

Author: bartpolot
Date: 2013-08-13 12:52:37 +0200 (Tue, 13 Aug 2013)
New Revision: 28562

Modified:
   gnunet/src/mesh/gnunet-service-mesh-enc.c
Log:
- fixes


Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-13 10:45:55 UTC (rev 
28561)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-08-13 10:52:37 UTC (rev 
28562)
@@ -1610,6 +1610,8 @@
   size_t size;
   uint16_t type;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Send on Connection %s[%X]\n",
+              GNUNET_h2s (&c->t->id), c->id);
   neighbor = connection_get_hop (c, fwd);
   if (NULL == neighbor)
   {
@@ -1664,6 +1666,8 @@
   struct MeshConnection *c;
   uint16_t type;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Send on Tunnel %s\n",
+              GNUNET_h2s (&t->id));
   c = tunnel_get_connection (t, fwd);
   if (NULL == c)
   {
@@ -1708,12 +1712,14 @@
   uint16_t type;
   uint64_t iv;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Send on Channel %s:%X\n",
+              GNUNET_h2s (&ch->t->id), ch->gid);
   type = fwd ? GNUNET_MESSAGE_TYPE_MESH_FWD : GNUNET_MESSAGE_TYPE_MESH_BCK;
-  iv = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX);
+  iv = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_NONCE, UINT64_MAX);
 
   msg = (struct GNUNET_MESH_Encrypted *) cbuf;
   msg->header.type = htons (type);
-  msg->header.size = htons (size);
+  msg->header.size = htons (sizeof (struct GNUNET_MESH_Encrypted) + size);
   msg->iv = GNUNET_htonll (iv);
   tunnel_encrypt (ch->t, &msg[1], message, size, iv, fwd);
 




reply via email to

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