gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r35793 - gnunet/src/cadet


From: gnunet
Subject: [GNUnet-SVN] r35793 - gnunet/src/cadet
Date: Fri, 22 May 2015 15:49:18 +0200

Author: grothoff
Date: 2015-05-22 15:49:18 +0200 (Fri, 22 May 2015)
New Revision: 35793

Modified:
   gnunet/src/cadet/gnunet-service-cadet_tunnel.c
Log:
-adding missing const's and a comment

Modified: gnunet/src/cadet/gnunet-service-cadet_tunnel.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2015-05-22 13:44:38 UTC 
(rev 35792)
+++ gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2015-05-22 13:49:18 UTC 
(rev 35793)
@@ -3094,7 +3094,7 @@
     {
       const struct GNUNET_CADET_Encrypted *emsg;
 
-      emsg = (struct GNUNET_CADET_Encrypted *) msg;
+      emsg = (const struct GNUNET_CADET_Encrypted *) msg;
       payload_size = size - sizeof (struct GNUNET_CADET_Encrypted);
       decrypted_size = t_decrypt_and_validate (t, cbuf, &emsg[1], payload_size,
                                                emsg->iv, &emsg->hmac);
@@ -3104,7 +3104,7 @@
     {
       const struct GNUNET_CADET_AX *emsg;
 
-      emsg = (struct GNUNET_CADET_AX *) msg;
+      emsg = (const struct GNUNET_CADET_AX *) msg;
       decrypted_size = t_ax_decrypt_and_validate (t, cbuf, emsg, size);
     }
     break;
@@ -3118,12 +3118,15 @@
     return;
   }
 
+  /* FIXME: this is bad, as the structs returned from
+     this loop may be unaligned, see util's MST for
+     how to do this right. */
   off = 0;
   while (off < decrypted_size)
   {
     uint16_t msize;
 
-    msgh = (struct GNUNET_MessageHeader *) &cbuf[off];
+    msgh = (const struct GNUNET_MessageHeader *) &cbuf[off];
     msize = ntohs (msgh->size);
     if (msize < sizeof (struct GNUNET_MessageHeader))
     {




reply via email to

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