gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: IPC: Convert all message payload lengths


From: gnunet
Subject: [gnunet] branch master updated: IPC: Convert all message payload lengths to uint16_t types.
Date: Sun, 06 Nov 2022 14:32:24 +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 bc3d776dd IPC: Convert all message payload lengths to uint16_t types.
bc3d776dd is described below

commit bc3d776dd38651fae221a06a198d427d28693673
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sun Nov 6 22:32:17 2022 +0900

    IPC: Convert all message payload lengths to uint16_t types.
---
 src/identity/gnunet-service-identity.c   |  8 ++--
 src/identity/identity.h                  | 16 +++++--
 src/identity/identity_api.c              |  5 +-
 src/namestore/gnunet-service-namestore.c | 25 +++++-----
 src/namestore/namestore.h                | 66 ++++++++++++---------------
 src/namestore/namestore_api.c            | 38 ++++++++--------
 src/namestore/namestore_api_monitor.c    |  6 +--
 src/reclaim/gnunet-service-reclaim.c     | 78 ++++++++++++++++----------------
 src/reclaim/reclaim.h                    | 78 ++++++++++++++++++++++----------
 src/reclaim/reclaim_api.c                | 62 ++++++++++++-------------
 10 files changed, 206 insertions(+), 176 deletions(-)

diff --git a/src/identity/gnunet-service-identity.c 
b/src/identity/gnunet-service-identity.c
index f1156e0b6..07296a882 100644
--- a/src/identity/gnunet-service-identity.c
+++ b/src/identity/gnunet-service-identity.c
@@ -244,6 +244,7 @@ create_update_message (struct Ego *ego)
                              GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE);
   um->name_len = htons (name_len);
   um->end_of_list = htons (GNUNET_NO);
+  um->key_len = htons (key_len);
   GNUNET_memcpy (&um[1], ego->identifier, name_len);
   GNUNET_IDENTITY_write_private_key_to_buffer (&ego->pk,
                                                ((char*) &um[1]) + name_len,
@@ -287,6 +288,7 @@ handle_start_message (void *cls,
                                GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE);
     ume->end_of_list = htons (GNUNET_YES);
     ume->name_len = htons (0);
+    ume->key_len = htons (0);
     GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client),
                     env);
   }
@@ -426,6 +428,7 @@ notify_listeners (struct Ego *ego)
   um->header.size = htons (sizeof(struct UpdateMessage) + name_len + key_len);
   um->name_len = htons (name_len);
   um->end_of_list = htons (GNUNET_NO);
+  um->key_len = htons (key_len);
   GNUNET_memcpy (&um[1], ego->identifier, name_len);
   GNUNET_IDENTITY_write_private_key_to_buffer (&ego->pk,
                                                ((char*) &um[1]) + name_len,
@@ -458,8 +461,7 @@ check_create_message (void *cls,
     return GNUNET_SYSERR;
   }
   name_len = ntohs (msg->name_len);
-  key_len = ntohl (msg->key_len);
-  GNUNET_break (0 == ntohs (msg->reserved));
+  key_len = ntohs (msg->key_len);
   if (name_len + key_len + sizeof(struct CreateRequestMessage) != size)
   {
     GNUNET_break (0);
@@ -494,7 +496,7 @@ handle_create_message (void *cls,
   size_t kb_read;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREATE message from 
client\n");
-  key_len = ntohl (crm->key_len);
+  key_len = ntohs (crm->key_len);
   if ((GNUNET_SYSERR ==
       GNUNET_IDENTITY_read_private_key_from_buffer (&crm[1],
                                                     key_len,
diff --git a/src/identity/identity.h b/src/identity/identity.h
index dc57ee11e..a3193ca2a 100644
--- a/src/identity/identity.h
+++ b/src/identity/identity.h
@@ -128,6 +128,16 @@ struct UpdateMessage
    */
   uint16_t end_of_list GNUNET_PACKED;
 
+  /**
+   * Key length
+   */
+  uint16_t key_len GNUNET_PACKED;
+
+  /**
+   * Reserved (alignment)
+   */
+  uint16_t reserved GNUNET_PACKED;
+
   /* followed by 0-terminated ego name */
   /* followed by the private key */
 };
@@ -150,11 +160,9 @@ struct CreateRequestMessage
   uint16_t name_len GNUNET_PACKED;
 
   /**
-   * Always zero.
+   * Key length
    */
-  uint16_t reserved GNUNET_PACKED;
-
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /*
    * Followed by the private key
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index ef2aacb78..47a78e2bb 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -412,7 +412,7 @@ handle_identity_update (void *cls,
   tmp = (const char*) &um[1];
   str = (0 == name_len) ? NULL : tmp;
   memset (&private_key, 0, sizeof (private_key));
-  key_len = ntohs (um->header.size) - name_len;
+  key_len = ntohs (um->key_len);
   GNUNET_assert (GNUNET_SYSERR !=
                  GNUNET_IDENTITY_read_private_key_from_buffer (tmp + name_len,
                                                                key_len,
@@ -621,11 +621,10 @@ GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *h,
   env = GNUNET_MQ_msg_extra (crm, slen + key_len,
                              GNUNET_MESSAGE_TYPE_IDENTITY_CREATE);
   crm->name_len = htons (slen);
-  crm->reserved = htons (0);
   GNUNET_IDENTITY_write_private_key_to_buffer (&private_key,
                                                &crm[1],
                                                key_len);
-  crm->key_len = htonl (key_len);
+  crm->key_len = htons (key_len);
   op->pk = private_key;
   GNUNET_memcpy ((char*) &crm[1] + key_len, name, slen);
   GNUNET_MQ_send (h->mq, env);
diff --git a/src/namestore/gnunet-service-namestore.c 
b/src/namestore/gnunet-service-namestore.c
index 9173d2e4d..a9ce9e3a1 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -787,7 +787,7 @@ send_lookup_response_with_filter (struct NamestoreClient 
*nc,
   zir_msg->name_len = htons (name_len);
   zir_msg->rd_count = htons (res_count);
   zir_msg->rd_len = htons ((uint16_t) rd_ser_len);
-  zir_msg->key_len = htonl (key_len);
+  zir_msg->key_len = htons (key_len);
   GNUNET_IDENTITY_write_private_key_to_buffer (zone_key,
                                                &zir_msg[1],
                                                key_len);
@@ -1317,8 +1317,8 @@ check_record_lookup (void *cls, const struct 
LabelLookupMessage *ll_msg)
   size_t key_len;
 
   (void) cls;
-  name_len = ntohl (ll_msg->label_len);
-  key_len = ntohl (ll_msg->key_len);
+  name_len = ntohs (ll_msg->label_len);
+  key_len = ntohs (ll_msg->key_len);
   src_size = ntohs (ll_msg->gns_header.header.size);
   if (name_len + key_len != src_size - sizeof(struct LabelLookupMessage))
   {
@@ -1351,7 +1351,7 @@ handle_record_lookup (void *cls, const struct 
LabelLookupMessage *ll_msg)
   size_t key_len;
   size_t kb_read;
 
-  key_len = ntohl (ll_msg->key_len);
+  key_len = ntohs (ll_msg->key_len);
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (&ll_msg[1],
                                                      key_len,
@@ -1389,7 +1389,7 @@ handle_record_lookup (void *cls, const struct 
LabelLookupMessage *ll_msg)
   rlc.res_rd = NULL;
   rlc.rd_ser_len = 0;
   rlc.nick = get_nick_record (&zone);
-  if (GNUNET_YES != ntohl (ll_msg->is_edit_request))
+  if (GNUNET_YES != ntohs (ll_msg->is_edit_request))
     res = nc->GSN_database->lookup_records (nc->GSN_database->cls,
                                             &zone,
                                             conv_name,
@@ -1412,6 +1412,7 @@ handle_record_lookup (void *cls, const struct 
LabelLookupMessage *ll_msg)
   llr_msg->name_len = htons (name_len);
   llr_msg->rd_count = htons (rlc.res_rd_count);
   llr_msg->rd_len = htons (rlc.rd_ser_len);
+  llr_msg->reserved = htons (0);
   res_name = ((char *) &llr_msg[1]) + key_len;
   if (GNUNET_YES == rlc.found)
     llr_msg->found = htons (GNUNET_YES);
@@ -1446,7 +1447,7 @@ check_record_store (void *cls, const struct 
RecordStoreMessage *rp_msg)
   (void) cls;
   msg_size = ntohs (rp_msg->gns_header.header.size);
   rd_set_count = ntohs (rp_msg->rd_set_count);
-  key_len = ntohl (rp_msg->key_len);
+  key_len = ntohs (rp_msg->key_len);
 
   min_size_exp = sizeof(*rp_msg) + key_len + sizeof (struct RecordSet)
                  * rd_set_count;
@@ -1739,7 +1740,7 @@ handle_record_store (void *cls, const struct 
RecordStoreMessage *rp_msg)
   struct RecordSet *rs;
   enum GNUNET_ErrorCode res;
 
-  key_len = ntohl (rp_msg->key_len);
+  key_len = ntohs (rp_msg->key_len);
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (&rp_msg[1],
                                                      key_len,
@@ -1993,7 +1994,7 @@ handle_zone_to_name_it (void *cls,
   ztnr_msg->rd_len = htons (rd_ser_len);
   ztnr_msg->rd_count = htons (rd_count);
   ztnr_msg->name_len = htons (name_len);
-  ztnr_msg->key_len = htonl (key_len);
+  ztnr_msg->key_len = htons (key_len);
   GNUNET_IDENTITY_write_private_key_to_buffer (zone_key,
                                                &ztnr_msg[1],
                                                key_len);
@@ -2038,7 +2039,7 @@ handle_zone_to_name (void *cls, const struct 
ZoneToNameMessage *ztn_msg)
   ztn_ctx.rid = ntohl (ztn_msg->gns_header.r_id);
   ztn_ctx.nc = nc;
   ztn_ctx.ec = GNUNET_EC_NAMESTORE_ZONE_NOT_FOUND;
-  key_len = ntohl (ztn_msg->key_len);
+  key_len = ntohs (ztn_msg->key_len);
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (&ztn_msg[1],
                                                      key_len,
@@ -2052,7 +2053,7 @@ handle_zone_to_name (void *cls, const struct 
ZoneToNameMessage *ztn_msg)
     GNUNET_break (0);
     return;
   }
-  pkey_len = ntohl (ztn_msg->pkey_len);
+  pkey_len = ntohs (ztn_msg->pkey_len);
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_public_key_from_buffer ((char*) &ztn_msg[1]
                                                     + key_len,
@@ -2259,7 +2260,7 @@ handle_iteration_start (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received ZONE_ITERATION_START message\n");
-  key_len = ntohl (zis_msg->key_len);
+  key_len = ntohs (zis_msg->key_len);
   zi = GNUNET_new (struct ZoneIteration);
   if (0 < key_len)
   {
@@ -2512,7 +2513,7 @@ handle_monitor_start (void *cls, const struct
               "Received ZONE_MONITOR_START message\n");
   zm = GNUNET_new (struct ZoneMonitor);
   zm->nc = nc;
-  key_len = ntohl (zis_msg->key_len);
+  key_len = ntohs (zis_msg->key_len);
   if (0 < key_len)
   {
     if ((GNUNET_SYSERR ==
diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h
index 0b50ac1ab..35d54d317 100644
--- a/src/namestore/namestore.h
+++ b/src/namestore/namestore.h
@@ -98,7 +98,7 @@ struct RecordStoreMessage
   /**
    * Length of the zone key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * Followed by the private zone key
@@ -138,12 +138,12 @@ struct LabelLookupMessage
   /**
    * Length of the name
    */
-  uint32_t label_len GNUNET_PACKED;
+  uint16_t label_len GNUNET_PACKED;
 
   /**
    * GNUNET_YES if this lookup corresponds to an edit request
    */
-  uint32_t is_edit_request GNUNET_PACKED;
+  uint16_t is_edit_request GNUNET_PACKED;
 
   /**
    * The record filter
@@ -153,7 +153,7 @@ struct LabelLookupMessage
   /**
    * Length of the zone key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /* followed by:
    * the private zone key
@@ -193,10 +193,15 @@ struct LabelLookupResponseMessage
    */
   int16_t found GNUNET_PACKED;
 
+  /**
+   * Reserved (alignment)
+   */
+  uint16_t reserved GNUNET_PACKED;
+
   /**
    * Length of the zone key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /* followed by:
    * the private zone key
@@ -219,12 +224,12 @@ struct ZoneToNameMessage
   /**
    * Length of the zone key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * Length of the public value zone key
    */
-  uint32_t pkey_len GNUNET_PACKED;
+  uint16_t pkey_len GNUNET_PACKED;
 
   /**
    * Followed by
@@ -244,6 +249,14 @@ struct ZoneToNameResponseMessage
    */
   struct GNUNET_NAMESTORE_Header gns_header;
 
+  /**
+   * result in NBO: #GNUNET_EC_NONE on success,
+   * #GNUNET_EC_NAMESTORE_NO_RESULTS if there were no
+   * results.
+   * Other error messages on error.
+   */
+  int32_t ec GNUNET_PACKED;
+
   /**
    * Length of the name
    */
@@ -259,18 +272,10 @@ struct ZoneToNameResponseMessage
    */
   uint16_t rd_count GNUNET_PACKED;
 
-  /**
-   * result in NBO: #GNUNET_EC_NONE on success,
-   * #GNUNET_EC_NAMESTORE_NO_RESULTS if there were no
-   * results.
-   * Other error messages on error.
-   */
-  int32_t ec GNUNET_PACKED;
-
   /**
    * Length of the zone key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /* followed by:
    * the private zone key
@@ -311,15 +316,10 @@ struct RecordResultMessage
    */
   uint16_t rd_count GNUNET_PACKED;
 
-  /**
-   * always zero (for alignment)
-   */
-  uint16_t reserved GNUNET_PACKED;
-
   /**
    * Length of the zone key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /* followed by:
    * the private key of the authority
@@ -339,14 +339,14 @@ struct TxControlMessage
   struct GNUNET_NAMESTORE_Header gns_header;
 
   /**
-   * The type of control message to send
+   * always zero (for alignment)
    */
-  uint16_t control GNUNET_PACKED;
+  uint16_t reserved GNUNET_PACKED;
 
   /**
-   * always zero (for alignment)
+   * The type of control message to send
    */
-  uint16_t reserved GNUNET_PACKED;
+  uint16_t control GNUNET_PACKED;
 
 };
 
@@ -391,15 +391,10 @@ struct ZoneMonitorStartMessage
    */
   uint16_t filter;
 
-  /**
-   * Reserved for alignment
-   */
-  uint16_t reserved;
-
   /**
    * Length of the zone key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * Followed by the private zone key.
@@ -447,15 +442,10 @@ struct ZoneIterationStartMessage
    */
   uint16_t filter;
 
-  /**
-   * Reserved for alignment
-   */
-  uint16_t reserved;
-
   /**
    * Length of the zone key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * Followed by the private zone key (optional)
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c
index e020b9e42..8deded9c0 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -407,8 +407,13 @@ check_lookup_result (void *cls, const struct 
LabelLookupResponseMessage *msg)
   rd_len = ntohs (msg->rd_len);
   msg_len = ntohs (msg->gns_header.header.size);
   name_len = ntohs (msg->name_len);
-  key_len = ntohl (msg->key_len);
+  key_len = ntohs (msg->key_len);
   exp_msg_len = sizeof(*msg) + name_len + rd_len + key_len;
+  if (0 != ntohs (msg->reserved))
+  {
+    GNUNET_break (0);
+    return GNUNET_SYSERR;
+  }
   if (msg_len != exp_msg_len)
   {
     GNUNET_break (0);
@@ -463,7 +468,7 @@ handle_lookup_result (void *cls, const struct 
LabelLookupResponseMessage *msg)
   rd_len = ntohs (msg->rd_len);
   rd_count = ntohs (msg->rd_count);
   name_len = ntohs (msg->name_len);
-  key_len = ntohl (msg->key_len);
+  key_len = ntohs (msg->key_len);
   GNUNET_assert (GNUNET_SYSERR !=
                  GNUNET_IDENTITY_read_private_key_from_buffer (&msg[1],
                                                                key_len,
@@ -527,13 +532,8 @@ check_record_result (void *cls, const struct 
RecordResultMessage *msg)
   (void) cls;
   rd_len = ntohs (msg->rd_len);
   msg_len = ntohs (msg->gns_header.header.size);
-  key_len = ntohl (msg->key_len);
+  key_len = ntohs (msg->key_len);
   name_len = ntohs (msg->name_len);
-  if (0 != ntohs (msg->reserved))
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
   if (msg_len != sizeof(struct RecordResultMessage) + key_len + name_len
       + rd_len)
   {
@@ -581,7 +581,7 @@ handle_record_result (void *cls, const struct 
RecordResultMessage *msg)
   rd_len = ntohs (msg->rd_len);
   rd_count = ntohs (msg->rd_count);
   name_len = ntohs (msg->name_len);
-  key_len = ntohl (msg->key_len);
+  key_len = ntohs (msg->key_len);
   ze = find_zi (h, ntohl (msg->gns_header.r_id));
   qe = find_qe (h, ntohl (msg->gns_header.r_id));
   if ((NULL == ze) && (NULL == qe))
@@ -710,7 +710,7 @@ check_zone_to_name_response (void *cls,
   (void) cls;
   if (GNUNET_EC_NONE != ntohl (msg->ec))
     return GNUNET_OK;
-  key_len = ntohl (msg->key_len);
+  key_len = ntohs (msg->key_len);
   name_len = ntohs (msg->name_len);
   rd_ser_len = ntohs (msg->rd_len);
   if (ntohs (msg->gns_header.header.size) !=
@@ -762,7 +762,7 @@ handle_zone_to_name_response (void *cls,
     return;
   }
   res = ntohl (msg->ec);
-  key_len = ntohl (msg->key_len);
+  key_len = ntohs (msg->key_len);
   GNUNET_assert (GNUNET_SYSERR !=
                  GNUNET_IDENTITY_read_private_key_from_buffer (&msg[1],
                                                                key_len,
@@ -1140,7 +1140,7 @@ GNUNET_NAMESTORE_records_store2 (
   GNUNET_assert (NULL != msg);
   GNUNET_assert (NULL != env);
   msg->gns_header.r_id = htonl (rid);
-  msg->key_len = htonl (key_len);
+  msg->key_len = htons (key_len);
   msg->rd_set_count = htons ((uint16_t) (*rds_sent));
   GNUNET_IDENTITY_write_private_key_to_buffer (pkey,
                                                &msg[1],
@@ -1230,9 +1230,9 @@ records_lookup (
                                                &msg[1],
                                                key_len);
 
-  msg->key_len = htonl (key_len);
-  msg->is_edit_request = htonl (is_edit_request);
-  msg->label_len = htonl (label_len);
+  msg->key_len = htons (key_len);
+  msg->is_edit_request = htons (is_edit_request);
+  msg->label_len = htons (label_len);
   msg->filter = htons (filter);
   GNUNET_memcpy (((char*) &msg[1]) + key_len, label, label_len);
   if (NULL == h->mq)
@@ -1323,8 +1323,8 @@ GNUNET_NAMESTORE_zone_to_name (
   env = GNUNET_MQ_msg_extra (msg, key_len + pkey_len,
                              GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME);
   msg->gns_header.r_id = htonl (rid);
-  msg->key_len = htonl (key_len);
-  msg->pkey_len = htonl (pkey_len);
+  msg->key_len = htons (key_len);
+  msg->pkey_len = htons (pkey_len);
   GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len);
   GNUNET_IDENTITY_write_public_key_to_buffer (value_zone,
                                               (char*) &msg[1] + key_len,
@@ -1375,7 +1375,7 @@ GNUNET_NAMESTORE_zone_iteration_start (
                              key_len,
                              
GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START);
   msg->gns_header.r_id = htonl (rid);
-  msg->key_len = htonl (key_len);
+  msg->key_len = htons (key_len);
   if (NULL != zone)
     GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len);
   if (NULL == h->mq)
@@ -1424,7 +1424,7 @@ GNUNET_NAMESTORE_zone_iteration_start2 (
                              key_len,
                              
GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START);
   msg->gns_header.r_id = htonl (rid);
-  msg->key_len = htonl (key_len);
+  msg->key_len = htons (key_len);
   msg->filter = htons ((uint16_t) filter);
   if (NULL != zone)
     GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len);
diff --git a/src/namestore/namestore_api_monitor.c 
b/src/namestore/namestore_api_monitor.c
index 81ea41f7d..199aec608 100644
--- a/src/namestore/namestore_api_monitor.c
+++ b/src/namestore/namestore_api_monitor.c
@@ -154,7 +154,7 @@ check_result (void *cls, const struct RecordResultMessage 
*lrm)
   size_t key_len;
 
   (void) zm;
-  key_len = ntohl (lrm->key_len);
+  key_len = ntohs (lrm->key_len);
   (void) cls;
   if (0 == key_len)
   {
@@ -222,7 +222,7 @@ handle_result (void *cls, const struct RecordResultMessage 
*lrm)
   const char *name_tmp;
   const char *rd_ser_tmp;
 
-  key_len = ntohl (lrm->key_len);
+  key_len = ntohs (lrm->key_len);
   rd_len = ntohs (lrm->rd_len);
   rd_count = ntohs (lrm->rd_count);
   name_len = ntohs (lrm->name_len);
@@ -308,7 +308,7 @@ reconnect (struct GNUNET_NAMESTORE_ZoneMonitor *zm)
     GNUNET_IDENTITY_write_private_key_to_buffer (&zm->zone,
                                                &sm[1],
                                                zm->key_len);
-  sm->key_len = htonl (zm->key_len);
+  sm->key_len = htons (zm->key_len);
   sm->filter = htons (zm->filter);
   GNUNET_MQ_send (zm->mq, env);
 }
diff --git a/src/reclaim/gnunet-service-reclaim.c 
b/src/reclaim/gnunet-service-reclaim.c
index e9616bef7..8b468fc8e 100644
--- a/src/reclaim/gnunet-service-reclaim.c
+++ b/src/reclaim/gnunet-service-reclaim.c
@@ -674,14 +674,14 @@ send_ticket_result (const struct IdpClient *client,
   buf = (char*) &irm[1];
   if (NULL != ticket)
   {
-    irm->tkt_len = htonl (tkt_len);
+    irm->tkt_len = htons (tkt_len);
     written = GNUNET_RECLAIM_write_ticket_to_buffer (ticket, buf, tkt_len);
     GNUNET_assert (0 <= written);
     buf += written;
   }
   // TODO add success member
   irm->id = htonl (r_id);
-  irm->presentations_len = htonl (pres_len);
+  irm->presentations_len = htons (pres_len);
   if (NULL != presentations)
   {
     GNUNET_RECLAIM_presentation_list_serialize (presentations,
@@ -745,9 +745,9 @@ check_issue_ticket_message (void *cls, const struct 
IssueTicketMessage *im)
   size_t pkey_len;
 
   size = ntohs (im->header.size);
-  attrs_len = ntohl (im->attr_len);
-  key_len = ntohl (im->key_len);
-  pkey_len = ntohl (im->pkey_len);
+  attrs_len = ntohs (im->attr_len);
+  key_len = ntohs (im->key_len);
+  pkey_len = ntohs (im->pkey_len);
   if (size != attrs_len + key_len + pkey_len + sizeof(struct
                                                       IssueTicketMessage))
   {
@@ -780,7 +780,7 @@ handle_issue_ticket_message (void *cls, const struct 
IssueTicketMessage *im)
   char *buf;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ISSUE_TICKET message\n");
-  key_len = ntohl (im->key_len);
+  key_len = ntohs (im->key_len);
   buf = (char *) &im[1];
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -793,7 +793,7 @@ handle_issue_ticket_message (void *cls, const struct 
IssueTicketMessage *im)
     return;
   }
   buf += read;
-  pkey_len = ntohl (im->pkey_len);
+  pkey_len = ntohs (im->pkey_len);
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_public_key_from_buffer (buf, pkey_len,
                                                     &rp, &read)) ||
@@ -806,7 +806,7 @@ handle_issue_ticket_message (void *cls, const struct 
IssueTicketMessage *im)
   }
   buf += read;
   tio = GNUNET_new (struct TicketIssueOperation);
-  attrs_len = ntohl (im->attr_len);
+  attrs_len = ntohs (im->attr_len);
   attrs = GNUNET_RECLAIM_attribute_list_deserialize (buf,
                                                      attrs_len);
   for (le = attrs->list_head; NULL != le; le = le->next)
@@ -898,7 +898,7 @@ handle_revoke_ticket_message (void *cls, const struct 
RevokeTicketMessage *rm)
   char *buf;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received REVOKE_TICKET message\n");
-  key_len = ntohl (rm->key_len);
+  key_len = ntohs (rm->key_len);
   buf = (char *) &rm[1];
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -911,7 +911,7 @@ handle_revoke_ticket_message (void *cls, const struct 
RevokeTicketMessage *rm)
     return;
   }
   buf += read;
-  tkt_len = ntohl (rm->tkt_len);
+  tkt_len = ntohs (rm->tkt_len);
   if ((GNUNET_SYSERR ==
        GNUNET_RECLAIM_read_ticket_from_buffer (buf, tkt_len,
                                                &ticket, &read)) ||
@@ -972,10 +972,10 @@ consume_result_cb (void *cls,
                              attrs_len + pres_len + key_len,
                              
GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT);
   crm->id = htonl (cop->r_id);
-  crm->attrs_len = htonl (attrs_len);
-  crm->presentations_len = htonl (pres_len);
-  crm->key_len = htonl (key_len);
-  crm->result = htonl (success);
+  crm->attrs_len = htons (attrs_len);
+  crm->presentations_len = htons (pres_len);
+  crm->key_len = htons (key_len);
+  crm->result = htons (success);
   data_tmp = (char *) &crm[1];
   written = GNUNET_IDENTITY_write_public_key_to_buffer (identity,
                                                         data_tmp,
@@ -1033,7 +1033,7 @@ handle_consume_ticket_message (void *cls, const struct 
ConsumeTicketMessage *cm)
   char *buf;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CONSUME_TICKET message\n");
-  key_len = ntohl (cm->key_len);
+  key_len = ntohs (cm->key_len);
   buf = (char *) &cm[1];
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -1046,7 +1046,7 @@ handle_consume_ticket_message (void *cls, const struct 
ConsumeTicketMessage *cm)
     return;
   }
   buf += read;
-  tkt_len = ntohl (cm->tkt_len);
+  tkt_len = ntohs (cm->tkt_len);
   if ((GNUNET_SYSERR ==
        GNUNET_RECLAIM_read_ticket_from_buffer (buf, tkt_len,
                                                &ticket, &read)) ||
@@ -1196,8 +1196,8 @@ handle_attribute_store_message (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ATTRIBUTE_STORE message\n");
 
-  data_len = ntohl (sam->attr_len);
-  key_len = ntohl (sam->key_len);
+  data_len = ntohs (sam->attr_len);
+  key_len = ntohs (sam->key_len);
   buf = (char *) &sam[1];
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -1397,8 +1397,8 @@ handle_credential_store_message (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREDENTIAL_STORE message\n");
 
-  data_len = ntohl (sam->attr_len);
-  key_len = ntohl (sam->key_len);
+  data_len = ntohs (sam->attr_len);
+  key_len = ntohs (sam->key_len);
   buf = (char *) &sam[1];
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -1868,8 +1868,8 @@ handle_attribute_delete_message (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ATTRIBUTE_DELETE message\n");
 
-  data_len = ntohl (dam->attr_len);
-  key_len = ntohl (dam->key_len);
+  data_len = ntohs (dam->attr_len);
+  key_len = ntohs (dam->key_len);
   buf = (char *) &dam[1];
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -1975,8 +1975,8 @@ handle_credential_delete_message (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREDENTIAL_DELETE message\n");
 
-  data_len = ntohl (dam->attr_len);
-  key_len = ntohl (dam->key_len);
+  data_len = ntohs (dam->attr_len);
+  key_len = ntohs (dam->key_len);
   buf = (char *) &dam[1];
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -2032,8 +2032,8 @@ attr_iter_finished (void *cls)
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending ATTRIBUTE_RESULT message\n");
   env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT);
   arm->id = htonl (ai->request_id);
-  arm->attr_len = htonl (0);
-  arm->pkey_len = htonl (0);
+  arm->attr_len = htons (0);
+  arm->pkey_len = htons (0);
   GNUNET_MQ_send (ai->client->mq, env);
   GNUNET_CONTAINER_DLL_remove (ai->client->attr_iter_head,
                                ai->client->attr_iter_tail,
@@ -2097,9 +2097,9 @@ attr_iter_cb (void *cls,
                              rd->data_size + key_len,
                              GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT);
   arm->id = htonl (ai->request_id);
-  arm->attr_len = htonl (rd->data_size);
+  arm->attr_len = htons (rd->data_size);
   data_tmp = (char *) &arm[1];
-  arm->pkey_len = htonl (key_len);
+  arm->pkey_len = htons (key_len);
   written = GNUNET_IDENTITY_write_public_key_to_buffer (&identity,
                                                         data_tmp,
                                                         key_len);
@@ -2119,7 +2119,7 @@ check_iteration_start (
   size_t key_len;
 
   size = ntohs (ais_msg->header.size);
-  key_len = ntohl (ais_msg->key_len);
+  key_len = ntohs (ais_msg->key_len);
 
   if (size < key_len + sizeof(*ais_msg))
   {
@@ -2147,7 +2147,7 @@ handle_iteration_start (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received ATTRIBUTE_ITERATION_START message\n");
-  key_len = ntohl (ais_msg->key_len);
+  key_len = ntohs (ais_msg->key_len);
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (&ais_msg[1],
                                                      key_len,
@@ -2262,8 +2262,8 @@ cred_iter_finished (void *cls)
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending CREDENTIAL_RESULT message\n");
   env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT);
   arm->id = htonl (ai->request_id);
-  arm->credential_len = htonl (0);
-  arm->key_len = htonl (0);
+  arm->credential_len = htons (0);
+  arm->key_len = htons (0);
   GNUNET_MQ_send (ai->client->mq, env);
   GNUNET_CONTAINER_DLL_remove (ai->client->cred_iter_head,
                                ai->client->cred_iter_tail,
@@ -2327,8 +2327,8 @@ cred_iter_cb (void *cls,
                              rd->data_size + key_len,
                              GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT);
   arm->id = htonl (ai->request_id);
-  arm->credential_len = htonl (rd->data_size);
-  arm->key_len = htonl (key_len);
+  arm->credential_len = htons (rd->data_size);
+  arm->key_len = htons (key_len);
   data_tmp = (char *) &arm[1];
   written = GNUNET_IDENTITY_write_public_key_to_buffer (&identity,
                                                         data_tmp,
@@ -2348,7 +2348,7 @@ check_credential_iteration_start (
   size_t key_len;
 
   size = ntohs (cis_msg->header.size);
-  key_len = ntohl (cis_msg->key_len);
+  key_len = ntohs (cis_msg->key_len);
 
   if (size < key_len + sizeof(*cis_msg))
   {
@@ -2378,7 +2378,7 @@ handle_credential_iteration_start (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received CREDENTIAL_ITERATION_START message\n");
-  key_len = ntohl (ais_msg->key_len);
+  key_len = ntohs (ais_msg->key_len);
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (&ais_msg[1],
                                                      key_len,
@@ -2516,7 +2516,7 @@ ticket_iter_cb (void *cls, struct GNUNET_RECLAIM_Ticket 
*ticket)
                                            &trm[1],
                                            tkt_len);
   }
-  trm->tkt_len = htonl (tkt_len);
+  trm->tkt_len = htons (tkt_len);
   trm->id = htonl (ti->r_id);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending TICKET_RESULT message\n");
   GNUNET_MQ_send (ti->client->mq, env);
@@ -2533,7 +2533,7 @@ check_ticket_iteration_start (
   size_t key_len;
 
   size = ntohs (tis_msg->header.size);
-  key_len = ntohl (tis_msg->key_len);
+  key_len = ntohs (tis_msg->key_len);
 
   if (size < key_len + sizeof(*tis_msg))
   {
@@ -2562,7 +2562,7 @@ handle_ticket_iteration_start (
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received TICKET_ITERATION_START message\n");
-  key_len = ntohl (tis_msg->key_len);
+  key_len = ntohs (tis_msg->key_len);
   if ((GNUNET_SYSERR ==
        GNUNET_IDENTITY_read_private_key_from_buffer (&tis_msg[1],
                                                      key_len,
diff --git a/src/reclaim/reclaim.h b/src/reclaim/reclaim.h
index f457f47a8..9d5118269 100644
--- a/src/reclaim/reclaim.h
+++ b/src/reclaim/reclaim.h
@@ -57,12 +57,12 @@ struct AttributeStoreMessage
   /**
    * The length of the attribute
    */
-  uint32_t attr_len GNUNET_PACKED;
+  uint16_t attr_len GNUNET_PACKED;
 
   /**
    * The length of the private key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /*
    * followed by the zone private key
@@ -88,12 +88,12 @@ struct AttributeDeleteMessage
   /**
    * The length of the attribute
    */
-  uint32_t attr_len GNUNET_PACKED;
+  uint16_t attr_len GNUNET_PACKED;
 
   /**
    * The length of the private key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /* followed by the serialized attribute */
 };
@@ -135,20 +135,25 @@ struct AttributeResultMessage
    */
   uint32_t id GNUNET_PACKED;
 
+  /**
+   * Reserved (alignment)
+   */
+  uint16_t reserved GNUNET_PACKED;
+
   /**
    * Length of serialized attribute data
    */
-  uint32_t attr_len GNUNET_PACKED;
+  uint16_t attr_len GNUNET_PACKED;
 
   /**
    * Length of serialized credential data
    */
-  uint32_t credential_len GNUNET_PACKED;
+  uint16_t credential_len GNUNET_PACKED;
 
   /**
    * The length of the public key
    */
-  uint32_t pkey_len GNUNET_PACKED;
+  uint16_t pkey_len GNUNET_PACKED;
 
   /**
    * followed by the public key key.
@@ -175,12 +180,12 @@ struct CredentialResultMessage
   /**
    * Length of serialized attribute data
    */
-  uint32_t credential_len GNUNET_PACKED;
+  uint16_t credential_len GNUNET_PACKED;
 
   /**
    * The length of the public key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * followed by the private key.
@@ -205,10 +210,15 @@ struct AttributeIterationStartMessage
    */
   uint32_t id GNUNET_PACKED;
 
+  /**
+   * Reserved (alignment)
+   */
+  uint16_t reserved GNUNET_PACKED;
+
   /**
    * The length of the private key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * followed by the private key.
@@ -248,10 +258,15 @@ struct CredentialIterationStartMessage
    */
   uint32_t id GNUNET_PACKED;
 
+  /**
+   * Reserved (alignment)
+   */
+  uint16_t reserved GNUNET_PACKED;
+
   /**
    * The length of the private key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * followed by the private key.
@@ -324,10 +339,15 @@ struct TicketIterationStartMessage
    */
   uint32_t id GNUNET_PACKED;
 
+  /**
+   * Reserved (alignment)
+   */
+  uint16_t reserved GNUNET_PACKED;
+
   /**
    * The length of the private key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * followed by the private key.
@@ -384,20 +404,25 @@ struct IssueTicketMessage
    */
   uint32_t id GNUNET_PACKED;
 
+  /**
+   * Reserved (alignment)
+   */
+  uint16_t reserved GNUNET_PACKED;
+
   /**
    * length of serialized attribute list
    */
-  uint32_t attr_len GNUNET_PACKED;
+  uint16_t attr_len GNUNET_PACKED;
 
   /**
    * The length of the identity private key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * The length of the relying party public key
    */
-  uint32_t pkey_len GNUNET_PACKED;
+  uint16_t pkey_len GNUNET_PACKED;
 
   /**
    * Followed by the private key.
@@ -424,12 +449,12 @@ struct RevokeTicketMessage
   /**
    * The length of the private key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * The length of the ticket
    */
-  uint32_t tkt_len GNUNET_PACKED;
+  uint16_t tkt_len GNUNET_PACKED;
 
   /**
    * Followed by the serialized ticket.
@@ -478,12 +503,12 @@ struct TicketResultMessage
   /**
    * Ticket length
    */
-  uint32_t tkt_len GNUNET_PACKED;
+  uint16_t tkt_len GNUNET_PACKED;
 
   /**
    * Length of new presentations created
    */
-  uint32_t presentations_len GNUNET_PACKED;
+  uint16_t presentations_len GNUNET_PACKED;
 
   /*
    * Followed by the serialized ticket
@@ -509,12 +534,12 @@ struct ConsumeTicketMessage
   /**
    * The length of the private key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * The length of the ticket
    */
-  uint32_t tkt_len GNUNET_PACKED;
+  uint16_t tkt_len GNUNET_PACKED;
 
   /**
    * Followed by the private key.
@@ -542,20 +567,25 @@ struct ConsumeTicketResultMessage
    */
   uint32_t result GNUNET_PACKED;
 
+  /**
+   * Reserved (alignment)
+   */
+  uint16_t reserved GNUNET_PACKED;
+
   /**
    * Length of serialized attribute data
    */
-  uint32_t attrs_len GNUNET_PACKED;
+  uint16_t attrs_len GNUNET_PACKED;
 
   /**
    * Length of presentation data
    */
-  uint32_t presentations_len;
+  uint16_t presentations_len;
 
   /**
    * The length of the private key
    */
-  uint32_t key_len GNUNET_PACKED;
+  uint16_t key_len GNUNET_PACKED;
 
   /**
    * Followed by the private key.
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c
index cb1aa305a..e94a99708 100644
--- a/src/reclaim/reclaim_api.c
+++ b/src/reclaim/reclaim_api.c
@@ -570,9 +570,9 @@ check_consume_ticket_result (void *cls,
   size_t key_len;
 
   msg_len = ntohs (msg->header.size);
-  attrs_len = ntohl (msg->attrs_len);
-  key_len = ntohl (msg->key_len);
-  pl_len = ntohl (msg->presentations_len);
+  attrs_len = ntohs (msg->attrs_len);
+  key_len = ntohs (msg->key_len);
+  pl_len = ntohs (msg->presentations_len);
   if (msg_len != sizeof(*msg) + attrs_len + pl_len + key_len)
   {
     GNUNET_break (0);
@@ -603,9 +603,9 @@ handle_consume_ticket_result (void *cls,
   uint32_t r_id = ntohl (msg->id);
   char *read_ptr;
 
-  attrs_len = ntohl (msg->attrs_len);
-  key_len = ntohl (msg->key_len);
-  pl_len = ntohl (msg->presentations_len);
+  attrs_len = ntohs (msg->attrs_len);
+  key_len = ntohs (msg->key_len);
+  pl_len = ntohs (msg->presentations_len);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing ticket result.\n");
 
 
@@ -694,8 +694,8 @@ check_attribute_result (void *cls, const struct 
AttributeResultMessage *msg)
   size_t key_len;
 
   msg_len = ntohs (msg->header.size);
-  attr_len = ntohl (msg->attr_len);
-  key_len = ntohl (msg->pkey_len);
+  attr_len = ntohs (msg->attr_len);
+  key_len = ntohs (msg->pkey_len);
   if (msg_len != sizeof(*msg) + attr_len + key_len)
   {
     GNUNET_break (0);
@@ -725,8 +725,8 @@ handle_attribute_result (void *cls, const struct 
AttributeResultMessage *msg)
   uint32_t r_id = ntohl (msg->id);
   char *buf;
 
-  attr_len = ntohl (msg->attr_len);
-  key_len = ntohl (msg->pkey_len);
+  attr_len = ntohs (msg->attr_len);
+  key_len = ntohs (msg->pkey_len);
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing attribute result.\n");
 
   for (it = h->it_head; NULL != it; it = it->next)
@@ -805,8 +805,8 @@ check_credential_result (void *cls, const struct 
CredentialResultMessage *msg)
   size_t key_len;
 
   msg_len = ntohs (msg->header.size);
-  cred_len = ntohl (msg->credential_len);
-  key_len = ntohl (msg->key_len);
+  cred_len = ntohs (msg->credential_len);
+  key_len = ntohs (msg->key_len);
   if (msg_len != sizeof(*msg) + cred_len + key_len)
   {
     GNUNET_break (0);
@@ -837,8 +837,8 @@ handle_credential_result (void *cls, const struct
   uint32_t r_id = ntohl (msg->id);
   char *buf;
 
-  key_len = ntohl (msg->key_len);
-  att_len = ntohl (msg->credential_len);
+  key_len = ntohs (msg->key_len);
+  att_len = ntohs (msg->credential_len);
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing credential result.\n");
 
 
@@ -922,8 +922,8 @@ check_ticket_result (void *cls, const struct 
TicketResultMessage *msg)
   size_t tkt_len;
 
   msg_len = ntohs (msg->header.size);
-  pres_len = ntohl (msg->presentations_len);
-  tkt_len = ntohl (msg->tkt_len);
+  pres_len = ntohs (msg->presentations_len);
+  tkt_len = ntohs (msg->tkt_len);
   if (msg_len != sizeof(*msg) + pres_len + tkt_len)
   {
     GNUNET_break (0);
@@ -954,8 +954,8 @@ handle_ticket_result (void *cls, const struct 
TicketResultMessage *msg)
   size_t tb_read;
   char *buf;
 
-  tkt_len = ntohl (msg->tkt_len);
-  pres_len = ntohl (msg->presentations_len);
+  tkt_len = ntohs (msg->tkt_len);
+  pres_len = ntohs (msg->presentations_len);
   for (op = handle->op_head; NULL != op; op = op->next)
     if (op->r_id == r_id)
       break;
@@ -1186,7 +1186,7 @@ GNUNET_RECLAIM_attribute_store (
   op->env = GNUNET_MQ_msg_extra (sam,
                                  attr_len + key_len,
                                  GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE);
-  sam->key_len = htonl (key_len);
+  sam->key_len = htons (key_len);
   buf = (char *) &sam[1];
   written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len);
   GNUNET_assert (0 < written);
@@ -1229,7 +1229,7 @@ GNUNET_RECLAIM_attribute_delete (
   op->env = GNUNET_MQ_msg_extra (dam,
                                  attr_len + key_len,
                                  GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE);
-  dam->key_len = htonl (key_len);
+  dam->key_len = htons (key_len);
   buf = (char *) &dam[1];
   written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len);
   GNUNET_assert (0 < written);
@@ -1271,7 +1271,7 @@ GNUNET_RECLAIM_credential_store (
   op->env = GNUNET_MQ_msg_extra (sam,
                                  attr_len + key_len,
                                  GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE);
-  sam->key_len = htonl (key_len);
+  sam->key_len = htons (key_len);
   buf = (char *) &sam[1];
   written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len);
   GNUNET_assert (0 <= written);
@@ -1314,7 +1314,7 @@ GNUNET_RECLAIM_credential_delete (
   op->env = GNUNET_MQ_msg_extra (dam,
                                  attr_len + key_len,
                                  
GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE);
-  dam->key_len = htonl (key_len);
+  dam->key_len = htons (key_len);
   buf = (char *) &dam[1];
   written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len);
   GNUNET_assert (0 <= written);
@@ -1364,7 +1364,7 @@ GNUNET_RECLAIM_get_attributes_start (
                          key_len,
                          
GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START);
   msg->id = htonl (rid);
-  msg->key_len = htonl (key_len);
+  msg->key_len = htons (key_len);
   GNUNET_IDENTITY_write_private_key_to_buffer (identity, &msg[1], key_len);
   if (NULL == h->mq)
     it->env = env;
@@ -1441,7 +1441,7 @@ GNUNET_RECLAIM_get_credentials_start (
                          key_len,
                          
GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START);
   msg->id = htonl (rid);
-  msg->key_len = htonl (key_len);
+  msg->key_len = htons (key_len);
   GNUNET_IDENTITY_write_private_key_to_buffer (identity, &msg[1], key_len);
   if (NULL == h->mq)
     ait->env = env;
@@ -1515,8 +1515,8 @@ GNUNET_RECLAIM_ticket_issue (
   op->env = GNUNET_MQ_msg_extra (tim,
                                  attr_len + key_len + rpk_len,
                                  GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET);
-  tim->key_len = htonl (key_len);
-  tim->pkey_len = htonl (rpk_len);
+  tim->key_len = htons (key_len);
+  tim->pkey_len = htons (rpk_len);
   buf = (char *) &tim[1];
   written = GNUNET_IDENTITY_write_private_key_to_buffer (iss, buf, key_len);
   GNUNET_assert (0 <= written);
@@ -1571,11 +1571,11 @@ GNUNET_RECLAIM_ticket_consume (
   op->env = GNUNET_MQ_msg_extra (ctm,
                                  key_len + tkt_len,
                                  GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET);
-  ctm->key_len = htonl (key_len);
+  ctm->key_len = htons (key_len);
   buf = (char*) &ctm[1];
   GNUNET_IDENTITY_write_private_key_to_buffer (identity, buf, key_len);
   buf += key_len;
-  ctm->tkt_len = htonl (tkt_len);
+  ctm->tkt_len = htons (tkt_len);
   GNUNET_RECLAIM_write_ticket_to_buffer (ticket, buf, tkt_len);
   ctm->id = htonl (op->r_id);
   if (NULL != h->mq)
@@ -1620,7 +1620,7 @@ GNUNET_RECLAIM_ticket_iteration_start (
                              key_len,
                              
GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START);
   msg->id = htonl (rid);
-  msg->key_len = htonl (key_len);
+  msg->key_len = htons (key_len);
   GNUNET_IDENTITY_write_private_key_to_buffer (identity,
                                                &msg[1],
                                                key_len);
@@ -1718,8 +1718,8 @@ GNUNET_RECLAIM_ticket_revoke (
                                  key_len + tkt_len,
                                  GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET);
   msg->id = htonl (rid);
-  msg->key_len = htonl (key_len);
-  msg->tkt_len = htonl (tkt_len);
+  msg->key_len = htons (key_len);
+  msg->tkt_len = htons (tkt_len);
   buf = (char*) &msg[1];
   written = GNUNET_IDENTITY_write_private_key_to_buffer (identity,
                                                          buf,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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