aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-22 13:49:18 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-22 13:49:18 +0000
commit239537fefb4fb6832a65d051fb887c8c0ac59ffa (patch)
treefb26ce80bd0c8183358e4328d4ff966f271a6a68
parent73d010d100943c495b4700add14bbcad4ea74ecd (diff)
downloadgnunet-239537fefb4fb6832a65d051fb887c8c0ac59ffa.tar.gz
gnunet-239537fefb4fb6832a65d051fb887c8c0ac59ffa.zip
-adding missing const's and a comment
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index c73edf48e..cb7bbb300 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -3094,7 +3094,7 @@ GCT_handle_encrypted (struct CadetTunnel *t,
3094 { 3094 {
3095 const struct GNUNET_CADET_Encrypted *emsg; 3095 const struct GNUNET_CADET_Encrypted *emsg;
3096 3096
3097 emsg = (struct GNUNET_CADET_Encrypted *) msg; 3097 emsg = (const struct GNUNET_CADET_Encrypted *) msg;
3098 payload_size = size - sizeof (struct GNUNET_CADET_Encrypted); 3098 payload_size = size - sizeof (struct GNUNET_CADET_Encrypted);
3099 decrypted_size = t_decrypt_and_validate (t, cbuf, &emsg[1], payload_size, 3099 decrypted_size = t_decrypt_and_validate (t, cbuf, &emsg[1], payload_size,
3100 emsg->iv, &emsg->hmac); 3100 emsg->iv, &emsg->hmac);
@@ -3104,7 +3104,7 @@ GCT_handle_encrypted (struct CadetTunnel *t,
3104 { 3104 {
3105 const struct GNUNET_CADET_AX *emsg; 3105 const struct GNUNET_CADET_AX *emsg;
3106 3106
3107 emsg = (struct GNUNET_CADET_AX *) msg; 3107 emsg = (const struct GNUNET_CADET_AX *) msg;
3108 decrypted_size = t_ax_decrypt_and_validate (t, cbuf, emsg, size); 3108 decrypted_size = t_ax_decrypt_and_validate (t, cbuf, emsg, size);
3109 } 3109 }
3110 break; 3110 break;
@@ -3118,12 +3118,15 @@ GCT_handle_encrypted (struct CadetTunnel *t,
3118 return; 3118 return;
3119 } 3119 }
3120 3120
3121 /* FIXME: this is bad, as the structs returned from
3122 this loop may be unaligned, see util's MST for
3123 how to do this right. */
3121 off = 0; 3124 off = 0;
3122 while (off < decrypted_size) 3125 while (off < decrypted_size)
3123 { 3126 {
3124 uint16_t msize; 3127 uint16_t msize;
3125 3128
3126 msgh = (struct GNUNET_MessageHeader *) &cbuf[off]; 3129 msgh = (const struct GNUNET_MessageHeader *) &cbuf[off];
3127 msize = ntohs (msgh->size); 3130 msize = ntohs (msgh->size);
3128 if (msize < sizeof (struct GNUNET_MessageHeader)) 3131 if (msize < sizeof (struct GNUNET_MessageHeader))
3129 { 3132 {