aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-11-06 22:32:17 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-11-06 22:32:17 +0900
commitbc3d776dd38651fae221a06a198d427d28693673 (patch)
tree431cc5c6bed61073ef9362937de41a74e95cc723
parent4db7f94ce6c8d6aed2b834c050b983de42f98718 (diff)
downloadgnunet-bc3d776dd38651fae221a06a198d427d28693673.tar.gz
gnunet-bc3d776dd38651fae221a06a198d427d28693673.zip
IPC: Convert all message payload lengths to uint16_t types.
-rw-r--r--src/identity/gnunet-service-identity.c8
-rw-r--r--src/identity/identity.h16
-rw-r--r--src/identity/identity_api.c5
-rw-r--r--src/namestore/gnunet-service-namestore.c25
-rw-r--r--src/namestore/namestore.h66
-rw-r--r--src/namestore/namestore_api.c38
-rw-r--r--src/namestore/namestore_api_monitor.c6
-rw-r--r--src/reclaim/gnunet-service-reclaim.c78
-rw-r--r--src/reclaim/reclaim.h78
-rw-r--r--src/reclaim/reclaim_api.c62
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)
244 GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE); 244 GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE);
245 um->name_len = htons (name_len); 245 um->name_len = htons (name_len);
246 um->end_of_list = htons (GNUNET_NO); 246 um->end_of_list = htons (GNUNET_NO);
247 um->key_len = htons (key_len);
247 GNUNET_memcpy (&um[1], ego->identifier, name_len); 248 GNUNET_memcpy (&um[1], ego->identifier, name_len);
248 GNUNET_IDENTITY_write_private_key_to_buffer (&ego->pk, 249 GNUNET_IDENTITY_write_private_key_to_buffer (&ego->pk,
249 ((char*) &um[1]) + name_len, 250 ((char*) &um[1]) + name_len,
@@ -287,6 +288,7 @@ handle_start_message (void *cls,
287 GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE); 288 GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE);
288 ume->end_of_list = htons (GNUNET_YES); 289 ume->end_of_list = htons (GNUNET_YES);
289 ume->name_len = htons (0); 290 ume->name_len = htons (0);
291 ume->key_len = htons (0);
290 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client), 292 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client),
291 env); 293 env);
292 } 294 }
@@ -426,6 +428,7 @@ notify_listeners (struct Ego *ego)
426 um->header.size = htons (sizeof(struct UpdateMessage) + name_len + key_len); 428 um->header.size = htons (sizeof(struct UpdateMessage) + name_len + key_len);
427 um->name_len = htons (name_len); 429 um->name_len = htons (name_len);
428 um->end_of_list = htons (GNUNET_NO); 430 um->end_of_list = htons (GNUNET_NO);
431 um->key_len = htons (key_len);
429 GNUNET_memcpy (&um[1], ego->identifier, name_len); 432 GNUNET_memcpy (&um[1], ego->identifier, name_len);
430 GNUNET_IDENTITY_write_private_key_to_buffer (&ego->pk, 433 GNUNET_IDENTITY_write_private_key_to_buffer (&ego->pk,
431 ((char*) &um[1]) + name_len, 434 ((char*) &um[1]) + name_len,
@@ -458,8 +461,7 @@ check_create_message (void *cls,
458 return GNUNET_SYSERR; 461 return GNUNET_SYSERR;
459 } 462 }
460 name_len = ntohs (msg->name_len); 463 name_len = ntohs (msg->name_len);
461 key_len = ntohl (msg->key_len); 464 key_len = ntohs (msg->key_len);
462 GNUNET_break (0 == ntohs (msg->reserved));
463 if (name_len + key_len + sizeof(struct CreateRequestMessage) != size) 465 if (name_len + key_len + sizeof(struct CreateRequestMessage) != size)
464 { 466 {
465 GNUNET_break (0); 467 GNUNET_break (0);
@@ -494,7 +496,7 @@ handle_create_message (void *cls,
494 size_t kb_read; 496 size_t kb_read;
495 497
496 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREATE message from client\n"); 498 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREATE message from client\n");
497 key_len = ntohl (crm->key_len); 499 key_len = ntohs (crm->key_len);
498 if ((GNUNET_SYSERR == 500 if ((GNUNET_SYSERR ==
499 GNUNET_IDENTITY_read_private_key_from_buffer (&crm[1], 501 GNUNET_IDENTITY_read_private_key_from_buffer (&crm[1],
500 key_len, 502 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
128 */ 128 */
129 uint16_t end_of_list GNUNET_PACKED; 129 uint16_t end_of_list GNUNET_PACKED;
130 130
131 /**
132 * Key length
133 */
134 uint16_t key_len GNUNET_PACKED;
135
136 /**
137 * Reserved (alignment)
138 */
139 uint16_t reserved GNUNET_PACKED;
140
131 /* followed by 0-terminated ego name */ 141 /* followed by 0-terminated ego name */
132 /* followed by the private key */ 142 /* followed by the private key */
133}; 143};
@@ -150,11 +160,9 @@ struct CreateRequestMessage
150 uint16_t name_len GNUNET_PACKED; 160 uint16_t name_len GNUNET_PACKED;
151 161
152 /** 162 /**
153 * Always zero. 163 * Key length
154 */ 164 */
155 uint16_t reserved GNUNET_PACKED; 165 uint16_t key_len GNUNET_PACKED;
156
157 uint32_t key_len GNUNET_PACKED;
158 166
159 /* 167 /*
160 * Followed by the private key 168 * 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,
412 tmp = (const char*) &um[1]; 412 tmp = (const char*) &um[1];
413 str = (0 == name_len) ? NULL : tmp; 413 str = (0 == name_len) ? NULL : tmp;
414 memset (&private_key, 0, sizeof (private_key)); 414 memset (&private_key, 0, sizeof (private_key));
415 key_len = ntohs (um->header.size) - name_len; 415 key_len = ntohs (um->key_len);
416 GNUNET_assert (GNUNET_SYSERR != 416 GNUNET_assert (GNUNET_SYSERR !=
417 GNUNET_IDENTITY_read_private_key_from_buffer (tmp + name_len, 417 GNUNET_IDENTITY_read_private_key_from_buffer (tmp + name_len,
418 key_len, 418 key_len,
@@ -621,11 +621,10 @@ GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *h,
621 env = GNUNET_MQ_msg_extra (crm, slen + key_len, 621 env = GNUNET_MQ_msg_extra (crm, slen + key_len,
622 GNUNET_MESSAGE_TYPE_IDENTITY_CREATE); 622 GNUNET_MESSAGE_TYPE_IDENTITY_CREATE);
623 crm->name_len = htons (slen); 623 crm->name_len = htons (slen);
624 crm->reserved = htons (0);
625 GNUNET_IDENTITY_write_private_key_to_buffer (&private_key, 624 GNUNET_IDENTITY_write_private_key_to_buffer (&private_key,
626 &crm[1], 625 &crm[1],
627 key_len); 626 key_len);
628 crm->key_len = htonl (key_len); 627 crm->key_len = htons (key_len);
629 op->pk = private_key; 628 op->pk = private_key;
630 GNUNET_memcpy ((char*) &crm[1] + key_len, name, slen); 629 GNUNET_memcpy ((char*) &crm[1] + key_len, name, slen);
631 GNUNET_MQ_send (h->mq, env); 630 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,
787 zir_msg->name_len = htons (name_len); 787 zir_msg->name_len = htons (name_len);
788 zir_msg->rd_count = htons (res_count); 788 zir_msg->rd_count = htons (res_count);
789 zir_msg->rd_len = htons ((uint16_t) rd_ser_len); 789 zir_msg->rd_len = htons ((uint16_t) rd_ser_len);
790 zir_msg->key_len = htonl (key_len); 790 zir_msg->key_len = htons (key_len);
791 GNUNET_IDENTITY_write_private_key_to_buffer (zone_key, 791 GNUNET_IDENTITY_write_private_key_to_buffer (zone_key,
792 &zir_msg[1], 792 &zir_msg[1],
793 key_len); 793 key_len);
@@ -1317,8 +1317,8 @@ check_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg)
1317 size_t key_len; 1317 size_t key_len;
1318 1318
1319 (void) cls; 1319 (void) cls;
1320 name_len = ntohl (ll_msg->label_len); 1320 name_len = ntohs (ll_msg->label_len);
1321 key_len = ntohl (ll_msg->key_len); 1321 key_len = ntohs (ll_msg->key_len);
1322 src_size = ntohs (ll_msg->gns_header.header.size); 1322 src_size = ntohs (ll_msg->gns_header.header.size);
1323 if (name_len + key_len != src_size - sizeof(struct LabelLookupMessage)) 1323 if (name_len + key_len != src_size - sizeof(struct LabelLookupMessage))
1324 { 1324 {
@@ -1351,7 +1351,7 @@ handle_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg)
1351 size_t key_len; 1351 size_t key_len;
1352 size_t kb_read; 1352 size_t kb_read;
1353 1353
1354 key_len = ntohl (ll_msg->key_len); 1354 key_len = ntohs (ll_msg->key_len);
1355 if ((GNUNET_SYSERR == 1355 if ((GNUNET_SYSERR ==
1356 GNUNET_IDENTITY_read_private_key_from_buffer (&ll_msg[1], 1356 GNUNET_IDENTITY_read_private_key_from_buffer (&ll_msg[1],
1357 key_len, 1357 key_len,
@@ -1389,7 +1389,7 @@ handle_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg)
1389 rlc.res_rd = NULL; 1389 rlc.res_rd = NULL;
1390 rlc.rd_ser_len = 0; 1390 rlc.rd_ser_len = 0;
1391 rlc.nick = get_nick_record (&zone); 1391 rlc.nick = get_nick_record (&zone);
1392 if (GNUNET_YES != ntohl (ll_msg->is_edit_request)) 1392 if (GNUNET_YES != ntohs (ll_msg->is_edit_request))
1393 res = nc->GSN_database->lookup_records (nc->GSN_database->cls, 1393 res = nc->GSN_database->lookup_records (nc->GSN_database->cls,
1394 &zone, 1394 &zone,
1395 conv_name, 1395 conv_name,
@@ -1412,6 +1412,7 @@ handle_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg)
1412 llr_msg->name_len = htons (name_len); 1412 llr_msg->name_len = htons (name_len);
1413 llr_msg->rd_count = htons (rlc.res_rd_count); 1413 llr_msg->rd_count = htons (rlc.res_rd_count);
1414 llr_msg->rd_len = htons (rlc.rd_ser_len); 1414 llr_msg->rd_len = htons (rlc.rd_ser_len);
1415 llr_msg->reserved = htons (0);
1415 res_name = ((char *) &llr_msg[1]) + key_len; 1416 res_name = ((char *) &llr_msg[1]) + key_len;
1416 if (GNUNET_YES == rlc.found) 1417 if (GNUNET_YES == rlc.found)
1417 llr_msg->found = htons (GNUNET_YES); 1418 llr_msg->found = htons (GNUNET_YES);
@@ -1446,7 +1447,7 @@ check_record_store (void *cls, const struct RecordStoreMessage *rp_msg)
1446 (void) cls; 1447 (void) cls;
1447 msg_size = ntohs (rp_msg->gns_header.header.size); 1448 msg_size = ntohs (rp_msg->gns_header.header.size);
1448 rd_set_count = ntohs (rp_msg->rd_set_count); 1449 rd_set_count = ntohs (rp_msg->rd_set_count);
1449 key_len = ntohl (rp_msg->key_len); 1450 key_len = ntohs (rp_msg->key_len);
1450 1451
1451 min_size_exp = sizeof(*rp_msg) + key_len + sizeof (struct RecordSet) 1452 min_size_exp = sizeof(*rp_msg) + key_len + sizeof (struct RecordSet)
1452 * rd_set_count; 1453 * rd_set_count;
@@ -1739,7 +1740,7 @@ handle_record_store (void *cls, const struct RecordStoreMessage *rp_msg)
1739 struct RecordSet *rs; 1740 struct RecordSet *rs;
1740 enum GNUNET_ErrorCode res; 1741 enum GNUNET_ErrorCode res;
1741 1742
1742 key_len = ntohl (rp_msg->key_len); 1743 key_len = ntohs (rp_msg->key_len);
1743 if ((GNUNET_SYSERR == 1744 if ((GNUNET_SYSERR ==
1744 GNUNET_IDENTITY_read_private_key_from_buffer (&rp_msg[1], 1745 GNUNET_IDENTITY_read_private_key_from_buffer (&rp_msg[1],
1745 key_len, 1746 key_len,
@@ -1993,7 +1994,7 @@ handle_zone_to_name_it (void *cls,
1993 ztnr_msg->rd_len = htons (rd_ser_len); 1994 ztnr_msg->rd_len = htons (rd_ser_len);
1994 ztnr_msg->rd_count = htons (rd_count); 1995 ztnr_msg->rd_count = htons (rd_count);
1995 ztnr_msg->name_len = htons (name_len); 1996 ztnr_msg->name_len = htons (name_len);
1996 ztnr_msg->key_len = htonl (key_len); 1997 ztnr_msg->key_len = htons (key_len);
1997 GNUNET_IDENTITY_write_private_key_to_buffer (zone_key, 1998 GNUNET_IDENTITY_write_private_key_to_buffer (zone_key,
1998 &ztnr_msg[1], 1999 &ztnr_msg[1],
1999 key_len); 2000 key_len);
@@ -2038,7 +2039,7 @@ handle_zone_to_name (void *cls, const struct ZoneToNameMessage *ztn_msg)
2038 ztn_ctx.rid = ntohl (ztn_msg->gns_header.r_id); 2039 ztn_ctx.rid = ntohl (ztn_msg->gns_header.r_id);
2039 ztn_ctx.nc = nc; 2040 ztn_ctx.nc = nc;
2040 ztn_ctx.ec = GNUNET_EC_NAMESTORE_ZONE_NOT_FOUND; 2041 ztn_ctx.ec = GNUNET_EC_NAMESTORE_ZONE_NOT_FOUND;
2041 key_len = ntohl (ztn_msg->key_len); 2042 key_len = ntohs (ztn_msg->key_len);
2042 if ((GNUNET_SYSERR == 2043 if ((GNUNET_SYSERR ==
2043 GNUNET_IDENTITY_read_private_key_from_buffer (&ztn_msg[1], 2044 GNUNET_IDENTITY_read_private_key_from_buffer (&ztn_msg[1],
2044 key_len, 2045 key_len,
@@ -2052,7 +2053,7 @@ handle_zone_to_name (void *cls, const struct ZoneToNameMessage *ztn_msg)
2052 GNUNET_break (0); 2053 GNUNET_break (0);
2053 return; 2054 return;
2054 } 2055 }
2055 pkey_len = ntohl (ztn_msg->pkey_len); 2056 pkey_len = ntohs (ztn_msg->pkey_len);
2056 if ((GNUNET_SYSERR == 2057 if ((GNUNET_SYSERR ==
2057 GNUNET_IDENTITY_read_public_key_from_buffer ((char*) &ztn_msg[1] 2058 GNUNET_IDENTITY_read_public_key_from_buffer ((char*) &ztn_msg[1]
2058 + key_len, 2059 + key_len,
@@ -2259,7 +2260,7 @@ handle_iteration_start (void *cls,
2259 2260
2260 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2261 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2261 "Received ZONE_ITERATION_START message\n"); 2262 "Received ZONE_ITERATION_START message\n");
2262 key_len = ntohl (zis_msg->key_len); 2263 key_len = ntohs (zis_msg->key_len);
2263 zi = GNUNET_new (struct ZoneIteration); 2264 zi = GNUNET_new (struct ZoneIteration);
2264 if (0 < key_len) 2265 if (0 < key_len)
2265 { 2266 {
@@ -2512,7 +2513,7 @@ handle_monitor_start (void *cls, const struct
2512 "Received ZONE_MONITOR_START message\n"); 2513 "Received ZONE_MONITOR_START message\n");
2513 zm = GNUNET_new (struct ZoneMonitor); 2514 zm = GNUNET_new (struct ZoneMonitor);
2514 zm->nc = nc; 2515 zm->nc = nc;
2515 key_len = ntohl (zis_msg->key_len); 2516 key_len = ntohs (zis_msg->key_len);
2516 if (0 < key_len) 2517 if (0 < key_len)
2517 { 2518 {
2518 if ((GNUNET_SYSERR == 2519 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
98 /** 98 /**
99 * Length of the zone key 99 * Length of the zone key
100 */ 100 */
101 uint32_t key_len GNUNET_PACKED; 101 uint16_t key_len GNUNET_PACKED;
102 102
103 /** 103 /**
104 * Followed by the private zone key 104 * Followed by the private zone key
@@ -138,12 +138,12 @@ struct LabelLookupMessage
138 /** 138 /**
139 * Length of the name 139 * Length of the name
140 */ 140 */
141 uint32_t label_len GNUNET_PACKED; 141 uint16_t label_len GNUNET_PACKED;
142 142
143 /** 143 /**
144 * GNUNET_YES if this lookup corresponds to an edit request 144 * GNUNET_YES if this lookup corresponds to an edit request
145 */ 145 */
146 uint32_t is_edit_request GNUNET_PACKED; 146 uint16_t is_edit_request GNUNET_PACKED;
147 147
148 /** 148 /**
149 * The record filter 149 * The record filter
@@ -153,7 +153,7 @@ struct LabelLookupMessage
153 /** 153 /**
154 * Length of the zone key 154 * Length of the zone key
155 */ 155 */
156 uint32_t key_len GNUNET_PACKED; 156 uint16_t key_len GNUNET_PACKED;
157 157
158 /* followed by: 158 /* followed by:
159 * the private zone key 159 * the private zone key
@@ -194,9 +194,14 @@ struct LabelLookupResponseMessage
194 int16_t found GNUNET_PACKED; 194 int16_t found GNUNET_PACKED;
195 195
196 /** 196 /**
197 * Reserved (alignment)
198 */
199 uint16_t reserved GNUNET_PACKED;
200
201 /**
197 * Length of the zone key 202 * Length of the zone key
198 */ 203 */
199 uint32_t key_len GNUNET_PACKED; 204 uint16_t key_len GNUNET_PACKED;
200 205
201 /* followed by: 206 /* followed by:
202 * the private zone key 207 * the private zone key
@@ -219,12 +224,12 @@ struct ZoneToNameMessage
219 /** 224 /**
220 * Length of the zone key 225 * Length of the zone key
221 */ 226 */
222 uint32_t key_len GNUNET_PACKED; 227 uint16_t key_len GNUNET_PACKED;
223 228
224 /** 229 /**
225 * Length of the public value zone key 230 * Length of the public value zone key
226 */ 231 */
227 uint32_t pkey_len GNUNET_PACKED; 232 uint16_t pkey_len GNUNET_PACKED;
228 233
229 /** 234 /**
230 * Followed by 235 * Followed by
@@ -245,6 +250,14 @@ struct ZoneToNameResponseMessage
245 struct GNUNET_NAMESTORE_Header gns_header; 250 struct GNUNET_NAMESTORE_Header gns_header;
246 251
247 /** 252 /**
253 * result in NBO: #GNUNET_EC_NONE on success,
254 * #GNUNET_EC_NAMESTORE_NO_RESULTS if there were no
255 * results.
256 * Other error messages on error.
257 */
258 int32_t ec GNUNET_PACKED;
259
260 /**
248 * Length of the name 261 * Length of the name
249 */ 262 */
250 uint16_t name_len GNUNET_PACKED; 263 uint16_t name_len GNUNET_PACKED;
@@ -260,17 +273,9 @@ struct ZoneToNameResponseMessage
260 uint16_t rd_count GNUNET_PACKED; 273 uint16_t rd_count GNUNET_PACKED;
261 274
262 /** 275 /**
263 * result in NBO: #GNUNET_EC_NONE on success,
264 * #GNUNET_EC_NAMESTORE_NO_RESULTS if there were no
265 * results.
266 * Other error messages on error.
267 */
268 int32_t ec GNUNET_PACKED;
269
270 /**
271 * Length of the zone key 276 * Length of the zone key
272 */ 277 */
273 uint32_t key_len GNUNET_PACKED; 278 uint16_t key_len GNUNET_PACKED;
274 279
275 /* followed by: 280 /* followed by:
276 * the private zone key 281 * the private zone key
@@ -312,14 +317,9 @@ struct RecordResultMessage
312 uint16_t rd_count GNUNET_PACKED; 317 uint16_t rd_count GNUNET_PACKED;
313 318
314 /** 319 /**
315 * always zero (for alignment)
316 */
317 uint16_t reserved GNUNET_PACKED;
318
319 /**
320 * Length of the zone key 320 * Length of the zone key
321 */ 321 */
322 uint32_t key_len GNUNET_PACKED; 322 uint16_t key_len GNUNET_PACKED;
323 323
324 /* followed by: 324 /* followed by:
325 * the private key of the authority 325 * the private key of the authority
@@ -339,14 +339,14 @@ struct TxControlMessage
339 struct GNUNET_NAMESTORE_Header gns_header; 339 struct GNUNET_NAMESTORE_Header gns_header;
340 340
341 /** 341 /**
342 * The type of control message to send 342 * always zero (for alignment)
343 */ 343 */
344 uint16_t control GNUNET_PACKED; 344 uint16_t reserved GNUNET_PACKED;
345 345
346 /** 346 /**
347 * always zero (for alignment) 347 * The type of control message to send
348 */ 348 */
349 uint16_t reserved GNUNET_PACKED; 349 uint16_t control GNUNET_PACKED;
350 350
351}; 351};
352 352
@@ -392,14 +392,9 @@ struct ZoneMonitorStartMessage
392 uint16_t filter; 392 uint16_t filter;
393 393
394 /** 394 /**
395 * Reserved for alignment
396 */
397 uint16_t reserved;
398
399 /**
400 * Length of the zone key 395 * Length of the zone key
401 */ 396 */
402 uint32_t key_len GNUNET_PACKED; 397 uint16_t key_len GNUNET_PACKED;
403 398
404 /** 399 /**
405 * Followed by the private zone key. 400 * Followed by the private zone key.
@@ -448,14 +443,9 @@ struct ZoneIterationStartMessage
448 uint16_t filter; 443 uint16_t filter;
449 444
450 /** 445 /**
451 * Reserved for alignment
452 */
453 uint16_t reserved;
454
455 /**
456 * Length of the zone key 446 * Length of the zone key
457 */ 447 */
458 uint32_t key_len GNUNET_PACKED; 448 uint16_t key_len GNUNET_PACKED;
459 449
460 /** 450 /**
461 * Followed by the private zone key (optional) 451 * 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)
407 rd_len = ntohs (msg->rd_len); 407 rd_len = ntohs (msg->rd_len);
408 msg_len = ntohs (msg->gns_header.header.size); 408 msg_len = ntohs (msg->gns_header.header.size);
409 name_len = ntohs (msg->name_len); 409 name_len = ntohs (msg->name_len);
410 key_len = ntohl (msg->key_len); 410 key_len = ntohs (msg->key_len);
411 exp_msg_len = sizeof(*msg) + name_len + rd_len + key_len; 411 exp_msg_len = sizeof(*msg) + name_len + rd_len + key_len;
412 if (0 != ntohs (msg->reserved))
413 {
414 GNUNET_break (0);
415 return GNUNET_SYSERR;
416 }
412 if (msg_len != exp_msg_len) 417 if (msg_len != exp_msg_len)
413 { 418 {
414 GNUNET_break (0); 419 GNUNET_break (0);
@@ -463,7 +468,7 @@ handle_lookup_result (void *cls, const struct LabelLookupResponseMessage *msg)
463 rd_len = ntohs (msg->rd_len); 468 rd_len = ntohs (msg->rd_len);
464 rd_count = ntohs (msg->rd_count); 469 rd_count = ntohs (msg->rd_count);
465 name_len = ntohs (msg->name_len); 470 name_len = ntohs (msg->name_len);
466 key_len = ntohl (msg->key_len); 471 key_len = ntohs (msg->key_len);
467 GNUNET_assert (GNUNET_SYSERR != 472 GNUNET_assert (GNUNET_SYSERR !=
468 GNUNET_IDENTITY_read_private_key_from_buffer (&msg[1], 473 GNUNET_IDENTITY_read_private_key_from_buffer (&msg[1],
469 key_len, 474 key_len,
@@ -527,13 +532,8 @@ check_record_result (void *cls, const struct RecordResultMessage *msg)
527 (void) cls; 532 (void) cls;
528 rd_len = ntohs (msg->rd_len); 533 rd_len = ntohs (msg->rd_len);
529 msg_len = ntohs (msg->gns_header.header.size); 534 msg_len = ntohs (msg->gns_header.header.size);
530 key_len = ntohl (msg->key_len); 535 key_len = ntohs (msg->key_len);
531 name_len = ntohs (msg->name_len); 536 name_len = ntohs (msg->name_len);
532 if (0 != ntohs (msg->reserved))
533 {
534 GNUNET_break (0);
535 return GNUNET_SYSERR;
536 }
537 if (msg_len != sizeof(struct RecordResultMessage) + key_len + name_len 537 if (msg_len != sizeof(struct RecordResultMessage) + key_len + name_len
538 + rd_len) 538 + rd_len)
539 { 539 {
@@ -581,7 +581,7 @@ handle_record_result (void *cls, const struct RecordResultMessage *msg)
581 rd_len = ntohs (msg->rd_len); 581 rd_len = ntohs (msg->rd_len);
582 rd_count = ntohs (msg->rd_count); 582 rd_count = ntohs (msg->rd_count);
583 name_len = ntohs (msg->name_len); 583 name_len = ntohs (msg->name_len);
584 key_len = ntohl (msg->key_len); 584 key_len = ntohs (msg->key_len);
585 ze = find_zi (h, ntohl (msg->gns_header.r_id)); 585 ze = find_zi (h, ntohl (msg->gns_header.r_id));
586 qe = find_qe (h, ntohl (msg->gns_header.r_id)); 586 qe = find_qe (h, ntohl (msg->gns_header.r_id));
587 if ((NULL == ze) && (NULL == qe)) 587 if ((NULL == ze) && (NULL == qe))
@@ -710,7 +710,7 @@ check_zone_to_name_response (void *cls,
710 (void) cls; 710 (void) cls;
711 if (GNUNET_EC_NONE != ntohl (msg->ec)) 711 if (GNUNET_EC_NONE != ntohl (msg->ec))
712 return GNUNET_OK; 712 return GNUNET_OK;
713 key_len = ntohl (msg->key_len); 713 key_len = ntohs (msg->key_len);
714 name_len = ntohs (msg->name_len); 714 name_len = ntohs (msg->name_len);
715 rd_ser_len = ntohs (msg->rd_len); 715 rd_ser_len = ntohs (msg->rd_len);
716 if (ntohs (msg->gns_header.header.size) != 716 if (ntohs (msg->gns_header.header.size) !=
@@ -762,7 +762,7 @@ handle_zone_to_name_response (void *cls,
762 return; 762 return;
763 } 763 }
764 res = ntohl (msg->ec); 764 res = ntohl (msg->ec);
765 key_len = ntohl (msg->key_len); 765 key_len = ntohs (msg->key_len);
766 GNUNET_assert (GNUNET_SYSERR != 766 GNUNET_assert (GNUNET_SYSERR !=
767 GNUNET_IDENTITY_read_private_key_from_buffer (&msg[1], 767 GNUNET_IDENTITY_read_private_key_from_buffer (&msg[1],
768 key_len, 768 key_len,
@@ -1140,7 +1140,7 @@ GNUNET_NAMESTORE_records_store2 (
1140 GNUNET_assert (NULL != msg); 1140 GNUNET_assert (NULL != msg);
1141 GNUNET_assert (NULL != env); 1141 GNUNET_assert (NULL != env);
1142 msg->gns_header.r_id = htonl (rid); 1142 msg->gns_header.r_id = htonl (rid);
1143 msg->key_len = htonl (key_len); 1143 msg->key_len = htons (key_len);
1144 msg->rd_set_count = htons ((uint16_t) (*rds_sent)); 1144 msg->rd_set_count = htons ((uint16_t) (*rds_sent));
1145 GNUNET_IDENTITY_write_private_key_to_buffer (pkey, 1145 GNUNET_IDENTITY_write_private_key_to_buffer (pkey,
1146 &msg[1], 1146 &msg[1],
@@ -1230,9 +1230,9 @@ records_lookup (
1230 &msg[1], 1230 &msg[1],
1231 key_len); 1231 key_len);
1232 1232
1233 msg->key_len = htonl (key_len); 1233 msg->key_len = htons (key_len);
1234 msg->is_edit_request = htonl (is_edit_request); 1234 msg->is_edit_request = htons (is_edit_request);
1235 msg->label_len = htonl (label_len); 1235 msg->label_len = htons (label_len);
1236 msg->filter = htons (filter); 1236 msg->filter = htons (filter);
1237 GNUNET_memcpy (((char*) &msg[1]) + key_len, label, label_len); 1237 GNUNET_memcpy (((char*) &msg[1]) + key_len, label, label_len);
1238 if (NULL == h->mq) 1238 if (NULL == h->mq)
@@ -1323,8 +1323,8 @@ GNUNET_NAMESTORE_zone_to_name (
1323 env = GNUNET_MQ_msg_extra (msg, key_len + pkey_len, 1323 env = GNUNET_MQ_msg_extra (msg, key_len + pkey_len,
1324 GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME); 1324 GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME);
1325 msg->gns_header.r_id = htonl (rid); 1325 msg->gns_header.r_id = htonl (rid);
1326 msg->key_len = htonl (key_len); 1326 msg->key_len = htons (key_len);
1327 msg->pkey_len = htonl (pkey_len); 1327 msg->pkey_len = htons (pkey_len);
1328 GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len); 1328 GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len);
1329 GNUNET_IDENTITY_write_public_key_to_buffer (value_zone, 1329 GNUNET_IDENTITY_write_public_key_to_buffer (value_zone,
1330 (char*) &msg[1] + key_len, 1330 (char*) &msg[1] + key_len,
@@ -1375,7 +1375,7 @@ GNUNET_NAMESTORE_zone_iteration_start (
1375 key_len, 1375 key_len,
1376 GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START); 1376 GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START);
1377 msg->gns_header.r_id = htonl (rid); 1377 msg->gns_header.r_id = htonl (rid);
1378 msg->key_len = htonl (key_len); 1378 msg->key_len = htons (key_len);
1379 if (NULL != zone) 1379 if (NULL != zone)
1380 GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len); 1380 GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len);
1381 if (NULL == h->mq) 1381 if (NULL == h->mq)
@@ -1424,7 +1424,7 @@ GNUNET_NAMESTORE_zone_iteration_start2 (
1424 key_len, 1424 key_len,
1425 GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START); 1425 GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START);
1426 msg->gns_header.r_id = htonl (rid); 1426 msg->gns_header.r_id = htonl (rid);
1427 msg->key_len = htonl (key_len); 1427 msg->key_len = htons (key_len);
1428 msg->filter = htons ((uint16_t) filter); 1428 msg->filter = htons ((uint16_t) filter);
1429 if (NULL != zone) 1429 if (NULL != zone)
1430 GNUNET_IDENTITY_write_private_key_to_buffer (zone, &msg[1], key_len); 1430 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)
154 size_t key_len; 154 size_t key_len;
155 155
156 (void) zm; 156 (void) zm;
157 key_len = ntohl (lrm->key_len); 157 key_len = ntohs (lrm->key_len);
158 (void) cls; 158 (void) cls;
159 if (0 == key_len) 159 if (0 == key_len)
160 { 160 {
@@ -222,7 +222,7 @@ handle_result (void *cls, const struct RecordResultMessage *lrm)
222 const char *name_tmp; 222 const char *name_tmp;
223 const char *rd_ser_tmp; 223 const char *rd_ser_tmp;
224 224
225 key_len = ntohl (lrm->key_len); 225 key_len = ntohs (lrm->key_len);
226 rd_len = ntohs (lrm->rd_len); 226 rd_len = ntohs (lrm->rd_len);
227 rd_count = ntohs (lrm->rd_count); 227 rd_count = ntohs (lrm->rd_count);
228 name_len = ntohs (lrm->name_len); 228 name_len = ntohs (lrm->name_len);
@@ -308,7 +308,7 @@ reconnect (struct GNUNET_NAMESTORE_ZoneMonitor *zm)
308 GNUNET_IDENTITY_write_private_key_to_buffer (&zm->zone, 308 GNUNET_IDENTITY_write_private_key_to_buffer (&zm->zone,
309 &sm[1], 309 &sm[1],
310 zm->key_len); 310 zm->key_len);
311 sm->key_len = htonl (zm->key_len); 311 sm->key_len = htons (zm->key_len);
312 sm->filter = htons (zm->filter); 312 sm->filter = htons (zm->filter);
313 GNUNET_MQ_send (zm->mq, env); 313 GNUNET_MQ_send (zm->mq, env);
314} 314}
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,
674 buf = (char*) &irm[1]; 674 buf = (char*) &irm[1];
675 if (NULL != ticket) 675 if (NULL != ticket)
676 { 676 {
677 irm->tkt_len = htonl (tkt_len); 677 irm->tkt_len = htons (tkt_len);
678 written = GNUNET_RECLAIM_write_ticket_to_buffer (ticket, buf, tkt_len); 678 written = GNUNET_RECLAIM_write_ticket_to_buffer (ticket, buf, tkt_len);
679 GNUNET_assert (0 <= written); 679 GNUNET_assert (0 <= written);
680 buf += written; 680 buf += written;
681 } 681 }
682 // TODO add success member 682 // TODO add success member
683 irm->id = htonl (r_id); 683 irm->id = htonl (r_id);
684 irm->presentations_len = htonl (pres_len); 684 irm->presentations_len = htons (pres_len);
685 if (NULL != presentations) 685 if (NULL != presentations)
686 { 686 {
687 GNUNET_RECLAIM_presentation_list_serialize (presentations, 687 GNUNET_RECLAIM_presentation_list_serialize (presentations,
@@ -745,9 +745,9 @@ check_issue_ticket_message (void *cls, const struct IssueTicketMessage *im)
745 size_t pkey_len; 745 size_t pkey_len;
746 746
747 size = ntohs (im->header.size); 747 size = ntohs (im->header.size);
748 attrs_len = ntohl (im->attr_len); 748 attrs_len = ntohs (im->attr_len);
749 key_len = ntohl (im->key_len); 749 key_len = ntohs (im->key_len);
750 pkey_len = ntohl (im->pkey_len); 750 pkey_len = ntohs (im->pkey_len);
751 if (size != attrs_len + key_len + pkey_len + sizeof(struct 751 if (size != attrs_len + key_len + pkey_len + sizeof(struct
752 IssueTicketMessage)) 752 IssueTicketMessage))
753 { 753 {
@@ -780,7 +780,7 @@ handle_issue_ticket_message (void *cls, const struct IssueTicketMessage *im)
780 char *buf; 780 char *buf;
781 781
782 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ISSUE_TICKET message\n"); 782 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ISSUE_TICKET message\n");
783 key_len = ntohl (im->key_len); 783 key_len = ntohs (im->key_len);
784 buf = (char *) &im[1]; 784 buf = (char *) &im[1];
785 if ((GNUNET_SYSERR == 785 if ((GNUNET_SYSERR ==
786 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len, 786 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -793,7 +793,7 @@ handle_issue_ticket_message (void *cls, const struct IssueTicketMessage *im)
793 return; 793 return;
794 } 794 }
795 buf += read; 795 buf += read;
796 pkey_len = ntohl (im->pkey_len); 796 pkey_len = ntohs (im->pkey_len);
797 if ((GNUNET_SYSERR == 797 if ((GNUNET_SYSERR ==
798 GNUNET_IDENTITY_read_public_key_from_buffer (buf, pkey_len, 798 GNUNET_IDENTITY_read_public_key_from_buffer (buf, pkey_len,
799 &rp, &read)) || 799 &rp, &read)) ||
@@ -806,7 +806,7 @@ handle_issue_ticket_message (void *cls, const struct IssueTicketMessage *im)
806 } 806 }
807 buf += read; 807 buf += read;
808 tio = GNUNET_new (struct TicketIssueOperation); 808 tio = GNUNET_new (struct TicketIssueOperation);
809 attrs_len = ntohl (im->attr_len); 809 attrs_len = ntohs (im->attr_len);
810 attrs = GNUNET_RECLAIM_attribute_list_deserialize (buf, 810 attrs = GNUNET_RECLAIM_attribute_list_deserialize (buf,
811 attrs_len); 811 attrs_len);
812 for (le = attrs->list_head; NULL != le; le = le->next) 812 for (le = attrs->list_head; NULL != le; le = le->next)
@@ -898,7 +898,7 @@ handle_revoke_ticket_message (void *cls, const struct RevokeTicketMessage *rm)
898 char *buf; 898 char *buf;
899 899
900 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received REVOKE_TICKET message\n"); 900 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received REVOKE_TICKET message\n");
901 key_len = ntohl (rm->key_len); 901 key_len = ntohs (rm->key_len);
902 buf = (char *) &rm[1]; 902 buf = (char *) &rm[1];
903 if ((GNUNET_SYSERR == 903 if ((GNUNET_SYSERR ==
904 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len, 904 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -911,7 +911,7 @@ handle_revoke_ticket_message (void *cls, const struct RevokeTicketMessage *rm)
911 return; 911 return;
912 } 912 }
913 buf += read; 913 buf += read;
914 tkt_len = ntohl (rm->tkt_len); 914 tkt_len = ntohs (rm->tkt_len);
915 if ((GNUNET_SYSERR == 915 if ((GNUNET_SYSERR ==
916 GNUNET_RECLAIM_read_ticket_from_buffer (buf, tkt_len, 916 GNUNET_RECLAIM_read_ticket_from_buffer (buf, tkt_len,
917 &ticket, &read)) || 917 &ticket, &read)) ||
@@ -972,10 +972,10 @@ consume_result_cb (void *cls,
972 attrs_len + pres_len + key_len, 972 attrs_len + pres_len + key_len,
973 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT); 973 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT);
974 crm->id = htonl (cop->r_id); 974 crm->id = htonl (cop->r_id);
975 crm->attrs_len = htonl (attrs_len); 975 crm->attrs_len = htons (attrs_len);
976 crm->presentations_len = htonl (pres_len); 976 crm->presentations_len = htons (pres_len);
977 crm->key_len = htonl (key_len); 977 crm->key_len = htons (key_len);
978 crm->result = htonl (success); 978 crm->result = htons (success);
979 data_tmp = (char *) &crm[1]; 979 data_tmp = (char *) &crm[1];
980 written = GNUNET_IDENTITY_write_public_key_to_buffer (identity, 980 written = GNUNET_IDENTITY_write_public_key_to_buffer (identity,
981 data_tmp, 981 data_tmp,
@@ -1033,7 +1033,7 @@ handle_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm)
1033 char *buf; 1033 char *buf;
1034 1034
1035 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CONSUME_TICKET message\n"); 1035 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CONSUME_TICKET message\n");
1036 key_len = ntohl (cm->key_len); 1036 key_len = ntohs (cm->key_len);
1037 buf = (char *) &cm[1]; 1037 buf = (char *) &cm[1];
1038 if ((GNUNET_SYSERR == 1038 if ((GNUNET_SYSERR ==
1039 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len, 1039 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -1046,7 +1046,7 @@ handle_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm)
1046 return; 1046 return;
1047 } 1047 }
1048 buf += read; 1048 buf += read;
1049 tkt_len = ntohl (cm->tkt_len); 1049 tkt_len = ntohs (cm->tkt_len);
1050 if ((GNUNET_SYSERR == 1050 if ((GNUNET_SYSERR ==
1051 GNUNET_RECLAIM_read_ticket_from_buffer (buf, tkt_len, 1051 GNUNET_RECLAIM_read_ticket_from_buffer (buf, tkt_len,
1052 &ticket, &read)) || 1052 &ticket, &read)) ||
@@ -1196,8 +1196,8 @@ handle_attribute_store_message (void *cls,
1196 1196
1197 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ATTRIBUTE_STORE message\n"); 1197 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ATTRIBUTE_STORE message\n");
1198 1198
1199 data_len = ntohl (sam->attr_len); 1199 data_len = ntohs (sam->attr_len);
1200 key_len = ntohl (sam->key_len); 1200 key_len = ntohs (sam->key_len);
1201 buf = (char *) &sam[1]; 1201 buf = (char *) &sam[1];
1202 if ((GNUNET_SYSERR == 1202 if ((GNUNET_SYSERR ==
1203 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len, 1203 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -1397,8 +1397,8 @@ handle_credential_store_message (void *cls,
1397 1397
1398 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREDENTIAL_STORE message\n"); 1398 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREDENTIAL_STORE message\n");
1399 1399
1400 data_len = ntohl (sam->attr_len); 1400 data_len = ntohs (sam->attr_len);
1401 key_len = ntohl (sam->key_len); 1401 key_len = ntohs (sam->key_len);
1402 buf = (char *) &sam[1]; 1402 buf = (char *) &sam[1];
1403 if ((GNUNET_SYSERR == 1403 if ((GNUNET_SYSERR ==
1404 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len, 1404 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -1868,8 +1868,8 @@ handle_attribute_delete_message (void *cls,
1868 1868
1869 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ATTRIBUTE_DELETE message\n"); 1869 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received ATTRIBUTE_DELETE message\n");
1870 1870
1871 data_len = ntohl (dam->attr_len); 1871 data_len = ntohs (dam->attr_len);
1872 key_len = ntohl (dam->key_len); 1872 key_len = ntohs (dam->key_len);
1873 buf = (char *) &dam[1]; 1873 buf = (char *) &dam[1];
1874 if ((GNUNET_SYSERR == 1874 if ((GNUNET_SYSERR ==
1875 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len, 1875 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -1975,8 +1975,8 @@ handle_credential_delete_message (void *cls,
1975 1975
1976 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREDENTIAL_DELETE message\n"); 1976 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CREDENTIAL_DELETE message\n");
1977 1977
1978 data_len = ntohl (dam->attr_len); 1978 data_len = ntohs (dam->attr_len);
1979 key_len = ntohl (dam->key_len); 1979 key_len = ntohs (dam->key_len);
1980 buf = (char *) &dam[1]; 1980 buf = (char *) &dam[1];
1981 if ((GNUNET_SYSERR == 1981 if ((GNUNET_SYSERR ==
1982 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len, 1982 GNUNET_IDENTITY_read_private_key_from_buffer (buf, key_len,
@@ -2032,8 +2032,8 @@ attr_iter_finished (void *cls)
2032 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending ATTRIBUTE_RESULT message\n"); 2032 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending ATTRIBUTE_RESULT message\n");
2033 env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT); 2033 env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT);
2034 arm->id = htonl (ai->request_id); 2034 arm->id = htonl (ai->request_id);
2035 arm->attr_len = htonl (0); 2035 arm->attr_len = htons (0);
2036 arm->pkey_len = htonl (0); 2036 arm->pkey_len = htons (0);
2037 GNUNET_MQ_send (ai->client->mq, env); 2037 GNUNET_MQ_send (ai->client->mq, env);
2038 GNUNET_CONTAINER_DLL_remove (ai->client->attr_iter_head, 2038 GNUNET_CONTAINER_DLL_remove (ai->client->attr_iter_head,
2039 ai->client->attr_iter_tail, 2039 ai->client->attr_iter_tail,
@@ -2097,9 +2097,9 @@ attr_iter_cb (void *cls,
2097 rd->data_size + key_len, 2097 rd->data_size + key_len,
2098 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT); 2098 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT);
2099 arm->id = htonl (ai->request_id); 2099 arm->id = htonl (ai->request_id);
2100 arm->attr_len = htonl (rd->data_size); 2100 arm->attr_len = htons (rd->data_size);
2101 data_tmp = (char *) &arm[1]; 2101 data_tmp = (char *) &arm[1];
2102 arm->pkey_len = htonl (key_len); 2102 arm->pkey_len = htons (key_len);
2103 written = GNUNET_IDENTITY_write_public_key_to_buffer (&identity, 2103 written = GNUNET_IDENTITY_write_public_key_to_buffer (&identity,
2104 data_tmp, 2104 data_tmp,
2105 key_len); 2105 key_len);
@@ -2119,7 +2119,7 @@ check_iteration_start (
2119 size_t key_len; 2119 size_t key_len;
2120 2120
2121 size = ntohs (ais_msg->header.size); 2121 size = ntohs (ais_msg->header.size);
2122 key_len = ntohl (ais_msg->key_len); 2122 key_len = ntohs (ais_msg->key_len);
2123 2123
2124 if (size < key_len + sizeof(*ais_msg)) 2124 if (size < key_len + sizeof(*ais_msg))
2125 { 2125 {
@@ -2147,7 +2147,7 @@ handle_iteration_start (void *cls,
2147 2147
2148 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2148 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2149 "Received ATTRIBUTE_ITERATION_START message\n"); 2149 "Received ATTRIBUTE_ITERATION_START message\n");
2150 key_len = ntohl (ais_msg->key_len); 2150 key_len = ntohs (ais_msg->key_len);
2151 if ((GNUNET_SYSERR == 2151 if ((GNUNET_SYSERR ==
2152 GNUNET_IDENTITY_read_private_key_from_buffer (&ais_msg[1], 2152 GNUNET_IDENTITY_read_private_key_from_buffer (&ais_msg[1],
2153 key_len, 2153 key_len,
@@ -2262,8 +2262,8 @@ cred_iter_finished (void *cls)
2262 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending CREDENTIAL_RESULT message\n"); 2262 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending CREDENTIAL_RESULT message\n");
2263 env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT); 2263 env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT);
2264 arm->id = htonl (ai->request_id); 2264 arm->id = htonl (ai->request_id);
2265 arm->credential_len = htonl (0); 2265 arm->credential_len = htons (0);
2266 arm->key_len = htonl (0); 2266 arm->key_len = htons (0);
2267 GNUNET_MQ_send (ai->client->mq, env); 2267 GNUNET_MQ_send (ai->client->mq, env);
2268 GNUNET_CONTAINER_DLL_remove (ai->client->cred_iter_head, 2268 GNUNET_CONTAINER_DLL_remove (ai->client->cred_iter_head,
2269 ai->client->cred_iter_tail, 2269 ai->client->cred_iter_tail,
@@ -2327,8 +2327,8 @@ cred_iter_cb (void *cls,
2327 rd->data_size + key_len, 2327 rd->data_size + key_len,
2328 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT); 2328 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT);
2329 arm->id = htonl (ai->request_id); 2329 arm->id = htonl (ai->request_id);
2330 arm->credential_len = htonl (rd->data_size); 2330 arm->credential_len = htons (rd->data_size);
2331 arm->key_len = htonl (key_len); 2331 arm->key_len = htons (key_len);
2332 data_tmp = (char *) &arm[1]; 2332 data_tmp = (char *) &arm[1];
2333 written = GNUNET_IDENTITY_write_public_key_to_buffer (&identity, 2333 written = GNUNET_IDENTITY_write_public_key_to_buffer (&identity,
2334 data_tmp, 2334 data_tmp,
@@ -2348,7 +2348,7 @@ check_credential_iteration_start (
2348 size_t key_len; 2348 size_t key_len;
2349 2349
2350 size = ntohs (cis_msg->header.size); 2350 size = ntohs (cis_msg->header.size);
2351 key_len = ntohl (cis_msg->key_len); 2351 key_len = ntohs (cis_msg->key_len);
2352 2352
2353 if (size < key_len + sizeof(*cis_msg)) 2353 if (size < key_len + sizeof(*cis_msg))
2354 { 2354 {
@@ -2378,7 +2378,7 @@ handle_credential_iteration_start (void *cls,
2378 2378
2379 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2379 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2380 "Received CREDENTIAL_ITERATION_START message\n"); 2380 "Received CREDENTIAL_ITERATION_START message\n");
2381 key_len = ntohl (ais_msg->key_len); 2381 key_len = ntohs (ais_msg->key_len);
2382 if ((GNUNET_SYSERR == 2382 if ((GNUNET_SYSERR ==
2383 GNUNET_IDENTITY_read_private_key_from_buffer (&ais_msg[1], 2383 GNUNET_IDENTITY_read_private_key_from_buffer (&ais_msg[1],
2384 key_len, 2384 key_len,
@@ -2516,7 +2516,7 @@ ticket_iter_cb (void *cls, struct GNUNET_RECLAIM_Ticket *ticket)
2516 &trm[1], 2516 &trm[1],
2517 tkt_len); 2517 tkt_len);
2518 } 2518 }
2519 trm->tkt_len = htonl (tkt_len); 2519 trm->tkt_len = htons (tkt_len);
2520 trm->id = htonl (ti->r_id); 2520 trm->id = htonl (ti->r_id);
2521 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending TICKET_RESULT message\n"); 2521 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending TICKET_RESULT message\n");
2522 GNUNET_MQ_send (ti->client->mq, env); 2522 GNUNET_MQ_send (ti->client->mq, env);
@@ -2533,7 +2533,7 @@ check_ticket_iteration_start (
2533 size_t key_len; 2533 size_t key_len;
2534 2534
2535 size = ntohs (tis_msg->header.size); 2535 size = ntohs (tis_msg->header.size);
2536 key_len = ntohl (tis_msg->key_len); 2536 key_len = ntohs (tis_msg->key_len);
2537 2537
2538 if (size < key_len + sizeof(*tis_msg)) 2538 if (size < key_len + sizeof(*tis_msg))
2539 { 2539 {
@@ -2562,7 +2562,7 @@ handle_ticket_iteration_start (
2562 2562
2563 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2563 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2564 "Received TICKET_ITERATION_START message\n"); 2564 "Received TICKET_ITERATION_START message\n");
2565 key_len = ntohl (tis_msg->key_len); 2565 key_len = ntohs (tis_msg->key_len);
2566 if ((GNUNET_SYSERR == 2566 if ((GNUNET_SYSERR ==
2567 GNUNET_IDENTITY_read_private_key_from_buffer (&tis_msg[1], 2567 GNUNET_IDENTITY_read_private_key_from_buffer (&tis_msg[1],
2568 key_len, 2568 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
57 /** 57 /**
58 * The length of the attribute 58 * The length of the attribute
59 */ 59 */
60 uint32_t attr_len GNUNET_PACKED; 60 uint16_t attr_len GNUNET_PACKED;
61 61
62 /** 62 /**
63 * The length of the private key 63 * The length of the private key
64 */ 64 */
65 uint32_t key_len GNUNET_PACKED; 65 uint16_t key_len GNUNET_PACKED;
66 66
67 /* 67 /*
68 * followed by the zone private key 68 * followed by the zone private key
@@ -88,12 +88,12 @@ struct AttributeDeleteMessage
88 /** 88 /**
89 * The length of the attribute 89 * The length of the attribute
90 */ 90 */
91 uint32_t attr_len GNUNET_PACKED; 91 uint16_t attr_len GNUNET_PACKED;
92 92
93 /** 93 /**
94 * The length of the private key 94 * The length of the private key
95 */ 95 */
96 uint32_t key_len GNUNET_PACKED; 96 uint16_t key_len GNUNET_PACKED;
97 97
98 /* followed by the serialized attribute */ 98 /* followed by the serialized attribute */
99}; 99};
@@ -136,19 +136,24 @@ struct AttributeResultMessage
136 uint32_t id GNUNET_PACKED; 136 uint32_t id GNUNET_PACKED;
137 137
138 /** 138 /**
139 * Reserved (alignment)
140 */
141 uint16_t reserved GNUNET_PACKED;
142
143 /**
139 * Length of serialized attribute data 144 * Length of serialized attribute data
140 */ 145 */
141 uint32_t attr_len GNUNET_PACKED; 146 uint16_t attr_len GNUNET_PACKED;
142 147
143 /** 148 /**
144 * Length of serialized credential data 149 * Length of serialized credential data
145 */ 150 */
146 uint32_t credential_len GNUNET_PACKED; 151 uint16_t credential_len GNUNET_PACKED;
147 152
148 /** 153 /**
149 * The length of the public key 154 * The length of the public key
150 */ 155 */
151 uint32_t pkey_len GNUNET_PACKED; 156 uint16_t pkey_len GNUNET_PACKED;
152 157
153 /** 158 /**
154 * followed by the public key key. 159 * followed by the public key key.
@@ -175,12 +180,12 @@ struct CredentialResultMessage
175 /** 180 /**
176 * Length of serialized attribute data 181 * Length of serialized attribute data
177 */ 182 */
178 uint32_t credential_len GNUNET_PACKED; 183 uint16_t credential_len GNUNET_PACKED;
179 184
180 /** 185 /**
181 * The length of the public key 186 * The length of the public key
182 */ 187 */
183 uint32_t key_len GNUNET_PACKED; 188 uint16_t key_len GNUNET_PACKED;
184 189
185 /** 190 /**
186 * followed by the private key. 191 * followed by the private key.
@@ -206,9 +211,14 @@ struct AttributeIterationStartMessage
206 uint32_t id GNUNET_PACKED; 211 uint32_t id GNUNET_PACKED;
207 212
208 /** 213 /**
214 * Reserved (alignment)
215 */
216 uint16_t reserved GNUNET_PACKED;
217
218 /**
209 * The length of the private key 219 * The length of the private key
210 */ 220 */
211 uint32_t key_len GNUNET_PACKED; 221 uint16_t key_len GNUNET_PACKED;
212 222
213 /** 223 /**
214 * followed by the private key. 224 * followed by the private key.
@@ -249,9 +259,14 @@ struct CredentialIterationStartMessage
249 uint32_t id GNUNET_PACKED; 259 uint32_t id GNUNET_PACKED;
250 260
251 /** 261 /**
262 * Reserved (alignment)
263 */
264 uint16_t reserved GNUNET_PACKED;
265
266 /**
252 * The length of the private key 267 * The length of the private key
253 */ 268 */
254 uint32_t key_len GNUNET_PACKED; 269 uint16_t key_len GNUNET_PACKED;
255 270
256 /** 271 /**
257 * followed by the private key. 272 * followed by the private key.
@@ -325,9 +340,14 @@ struct TicketIterationStartMessage
325 uint32_t id GNUNET_PACKED; 340 uint32_t id GNUNET_PACKED;
326 341
327 /** 342 /**
343 * Reserved (alignment)
344 */
345 uint16_t reserved GNUNET_PACKED;
346
347 /**
328 * The length of the private key 348 * The length of the private key
329 */ 349 */
330 uint32_t key_len GNUNET_PACKED; 350 uint16_t key_len GNUNET_PACKED;
331 351
332 /** 352 /**
333 * followed by the private key. 353 * followed by the private key.
@@ -385,19 +405,24 @@ struct IssueTicketMessage
385 uint32_t id GNUNET_PACKED; 405 uint32_t id GNUNET_PACKED;
386 406
387 /** 407 /**
408 * Reserved (alignment)
409 */
410 uint16_t reserved GNUNET_PACKED;
411
412 /**
388 * length of serialized attribute list 413 * length of serialized attribute list
389 */ 414 */
390 uint32_t attr_len GNUNET_PACKED; 415 uint16_t attr_len GNUNET_PACKED;
391 416
392 /** 417 /**
393 * The length of the identity private key 418 * The length of the identity private key
394 */ 419 */
395 uint32_t key_len GNUNET_PACKED; 420 uint16_t key_len GNUNET_PACKED;
396 421
397 /** 422 /**
398 * The length of the relying party public key 423 * The length of the relying party public key
399 */ 424 */
400 uint32_t pkey_len GNUNET_PACKED; 425 uint16_t pkey_len GNUNET_PACKED;
401 426
402 /** 427 /**
403 * Followed by the private key. 428 * Followed by the private key.
@@ -424,12 +449,12 @@ struct RevokeTicketMessage
424 /** 449 /**
425 * The length of the private key 450 * The length of the private key
426 */ 451 */
427 uint32_t key_len GNUNET_PACKED; 452 uint16_t key_len GNUNET_PACKED;
428 453
429 /** 454 /**
430 * The length of the ticket 455 * The length of the ticket
431 */ 456 */
432 uint32_t tkt_len GNUNET_PACKED; 457 uint16_t tkt_len GNUNET_PACKED;
433 458
434 /** 459 /**
435 * Followed by the serialized ticket. 460 * Followed by the serialized ticket.
@@ -478,12 +503,12 @@ struct TicketResultMessage
478 /** 503 /**
479 * Ticket length 504 * Ticket length
480 */ 505 */
481 uint32_t tkt_len GNUNET_PACKED; 506 uint16_t tkt_len GNUNET_PACKED;
482 507
483 /** 508 /**
484 * Length of new presentations created 509 * Length of new presentations created
485 */ 510 */
486 uint32_t presentations_len GNUNET_PACKED; 511 uint16_t presentations_len GNUNET_PACKED;
487 512
488 /* 513 /*
489 * Followed by the serialized ticket 514 * Followed by the serialized ticket
@@ -509,12 +534,12 @@ struct ConsumeTicketMessage
509 /** 534 /**
510 * The length of the private key 535 * The length of the private key
511 */ 536 */
512 uint32_t key_len GNUNET_PACKED; 537 uint16_t key_len GNUNET_PACKED;
513 538
514 /** 539 /**
515 * The length of the ticket 540 * The length of the ticket
516 */ 541 */
517 uint32_t tkt_len GNUNET_PACKED; 542 uint16_t tkt_len GNUNET_PACKED;
518 543
519 /** 544 /**
520 * Followed by the private key. 545 * Followed by the private key.
@@ -543,19 +568,24 @@ struct ConsumeTicketResultMessage
543 uint32_t result GNUNET_PACKED; 568 uint32_t result GNUNET_PACKED;
544 569
545 /** 570 /**
571 * Reserved (alignment)
572 */
573 uint16_t reserved GNUNET_PACKED;
574
575 /**
546 * Length of serialized attribute data 576 * Length of serialized attribute data
547 */ 577 */
548 uint32_t attrs_len GNUNET_PACKED; 578 uint16_t attrs_len GNUNET_PACKED;
549 579
550 /** 580 /**
551 * Length of presentation data 581 * Length of presentation data
552 */ 582 */
553 uint32_t presentations_len; 583 uint16_t presentations_len;
554 584
555 /** 585 /**
556 * The length of the private key 586 * The length of the private key
557 */ 587 */
558 uint32_t key_len GNUNET_PACKED; 588 uint16_t key_len GNUNET_PACKED;
559 589
560 /** 590 /**
561 * Followed by the private key. 591 * 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,
570 size_t key_len; 570 size_t key_len;
571 571
572 msg_len = ntohs (msg->header.size); 572 msg_len = ntohs (msg->header.size);
573 attrs_len = ntohl (msg->attrs_len); 573 attrs_len = ntohs (msg->attrs_len);
574 key_len = ntohl (msg->key_len); 574 key_len = ntohs (msg->key_len);
575 pl_len = ntohl (msg->presentations_len); 575 pl_len = ntohs (msg->presentations_len);
576 if (msg_len != sizeof(*msg) + attrs_len + pl_len + key_len) 576 if (msg_len != sizeof(*msg) + attrs_len + pl_len + key_len)
577 { 577 {
578 GNUNET_break (0); 578 GNUNET_break (0);
@@ -603,9 +603,9 @@ handle_consume_ticket_result (void *cls,
603 uint32_t r_id = ntohl (msg->id); 603 uint32_t r_id = ntohl (msg->id);
604 char *read_ptr; 604 char *read_ptr;
605 605
606 attrs_len = ntohl (msg->attrs_len); 606 attrs_len = ntohs (msg->attrs_len);
607 key_len = ntohl (msg->key_len); 607 key_len = ntohs (msg->key_len);
608 pl_len = ntohl (msg->presentations_len); 608 pl_len = ntohs (msg->presentations_len);
609 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing ticket result.\n"); 609 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing ticket result.\n");
610 610
611 611
@@ -694,8 +694,8 @@ check_attribute_result (void *cls, const struct AttributeResultMessage *msg)
694 size_t key_len; 694 size_t key_len;
695 695
696 msg_len = ntohs (msg->header.size); 696 msg_len = ntohs (msg->header.size);
697 attr_len = ntohl (msg->attr_len); 697 attr_len = ntohs (msg->attr_len);
698 key_len = ntohl (msg->pkey_len); 698 key_len = ntohs (msg->pkey_len);
699 if (msg_len != sizeof(*msg) + attr_len + key_len) 699 if (msg_len != sizeof(*msg) + attr_len + key_len)
700 { 700 {
701 GNUNET_break (0); 701 GNUNET_break (0);
@@ -725,8 +725,8 @@ handle_attribute_result (void *cls, const struct AttributeResultMessage *msg)
725 uint32_t r_id = ntohl (msg->id); 725 uint32_t r_id = ntohl (msg->id);
726 char *buf; 726 char *buf;
727 727
728 attr_len = ntohl (msg->attr_len); 728 attr_len = ntohs (msg->attr_len);
729 key_len = ntohl (msg->pkey_len); 729 key_len = ntohs (msg->pkey_len);
730 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing attribute result.\n"); 730 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing attribute result.\n");
731 731
732 for (it = h->it_head; NULL != it; it = it->next) 732 for (it = h->it_head; NULL != it; it = it->next)
@@ -805,8 +805,8 @@ check_credential_result (void *cls, const struct CredentialResultMessage *msg)
805 size_t key_len; 805 size_t key_len;
806 806
807 msg_len = ntohs (msg->header.size); 807 msg_len = ntohs (msg->header.size);
808 cred_len = ntohl (msg->credential_len); 808 cred_len = ntohs (msg->credential_len);
809 key_len = ntohl (msg->key_len); 809 key_len = ntohs (msg->key_len);
810 if (msg_len != sizeof(*msg) + cred_len + key_len) 810 if (msg_len != sizeof(*msg) + cred_len + key_len)
811 { 811 {
812 GNUNET_break (0); 812 GNUNET_break (0);
@@ -837,8 +837,8 @@ handle_credential_result (void *cls, const struct
837 uint32_t r_id = ntohl (msg->id); 837 uint32_t r_id = ntohl (msg->id);
838 char *buf; 838 char *buf;
839 839
840 key_len = ntohl (msg->key_len); 840 key_len = ntohs (msg->key_len);
841 att_len = ntohl (msg->credential_len); 841 att_len = ntohs (msg->credential_len);
842 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing credential result.\n"); 842 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing credential result.\n");
843 843
844 844
@@ -922,8 +922,8 @@ check_ticket_result (void *cls, const struct TicketResultMessage *msg)
922 size_t tkt_len; 922 size_t tkt_len;
923 923
924 msg_len = ntohs (msg->header.size); 924 msg_len = ntohs (msg->header.size);
925 pres_len = ntohl (msg->presentations_len); 925 pres_len = ntohs (msg->presentations_len);
926 tkt_len = ntohl (msg->tkt_len); 926 tkt_len = ntohs (msg->tkt_len);
927 if (msg_len != sizeof(*msg) + pres_len + tkt_len) 927 if (msg_len != sizeof(*msg) + pres_len + tkt_len)
928 { 928 {
929 GNUNET_break (0); 929 GNUNET_break (0);
@@ -954,8 +954,8 @@ handle_ticket_result (void *cls, const struct TicketResultMessage *msg)
954 size_t tb_read; 954 size_t tb_read;
955 char *buf; 955 char *buf;
956 956
957 tkt_len = ntohl (msg->tkt_len); 957 tkt_len = ntohs (msg->tkt_len);
958 pres_len = ntohl (msg->presentations_len); 958 pres_len = ntohs (msg->presentations_len);
959 for (op = handle->op_head; NULL != op; op = op->next) 959 for (op = handle->op_head; NULL != op; op = op->next)
960 if (op->r_id == r_id) 960 if (op->r_id == r_id)
961 break; 961 break;
@@ -1186,7 +1186,7 @@ GNUNET_RECLAIM_attribute_store (
1186 op->env = GNUNET_MQ_msg_extra (sam, 1186 op->env = GNUNET_MQ_msg_extra (sam,
1187 attr_len + key_len, 1187 attr_len + key_len,
1188 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE); 1188 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE);
1189 sam->key_len = htonl (key_len); 1189 sam->key_len = htons (key_len);
1190 buf = (char *) &sam[1]; 1190 buf = (char *) &sam[1];
1191 written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len); 1191 written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len);
1192 GNUNET_assert (0 < written); 1192 GNUNET_assert (0 < written);
@@ -1229,7 +1229,7 @@ GNUNET_RECLAIM_attribute_delete (
1229 op->env = GNUNET_MQ_msg_extra (dam, 1229 op->env = GNUNET_MQ_msg_extra (dam,
1230 attr_len + key_len, 1230 attr_len + key_len,
1231 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE); 1231 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE);
1232 dam->key_len = htonl (key_len); 1232 dam->key_len = htons (key_len);
1233 buf = (char *) &dam[1]; 1233 buf = (char *) &dam[1];
1234 written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len); 1234 written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len);
1235 GNUNET_assert (0 < written); 1235 GNUNET_assert (0 < written);
@@ -1271,7 +1271,7 @@ GNUNET_RECLAIM_credential_store (
1271 op->env = GNUNET_MQ_msg_extra (sam, 1271 op->env = GNUNET_MQ_msg_extra (sam,
1272 attr_len + key_len, 1272 attr_len + key_len,
1273 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE); 1273 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE);
1274 sam->key_len = htonl (key_len); 1274 sam->key_len = htons (key_len);
1275 buf = (char *) &sam[1]; 1275 buf = (char *) &sam[1];
1276 written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len); 1276 written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len);
1277 GNUNET_assert (0 <= written); 1277 GNUNET_assert (0 <= written);
@@ -1314,7 +1314,7 @@ GNUNET_RECLAIM_credential_delete (
1314 op->env = GNUNET_MQ_msg_extra (dam, 1314 op->env = GNUNET_MQ_msg_extra (dam,
1315 attr_len + key_len, 1315 attr_len + key_len,
1316 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE); 1316 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE);
1317 dam->key_len = htonl (key_len); 1317 dam->key_len = htons (key_len);
1318 buf = (char *) &dam[1]; 1318 buf = (char *) &dam[1];
1319 written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len); 1319 written = GNUNET_IDENTITY_write_private_key_to_buffer (pkey, buf, key_len);
1320 GNUNET_assert (0 <= written); 1320 GNUNET_assert (0 <= written);
@@ -1364,7 +1364,7 @@ GNUNET_RECLAIM_get_attributes_start (
1364 key_len, 1364 key_len,
1365 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START); 1365 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START);
1366 msg->id = htonl (rid); 1366 msg->id = htonl (rid);
1367 msg->key_len = htonl (key_len); 1367 msg->key_len = htons (key_len);
1368 GNUNET_IDENTITY_write_private_key_to_buffer (identity, &msg[1], key_len); 1368 GNUNET_IDENTITY_write_private_key_to_buffer (identity, &msg[1], key_len);
1369 if (NULL == h->mq) 1369 if (NULL == h->mq)
1370 it->env = env; 1370 it->env = env;
@@ -1441,7 +1441,7 @@ GNUNET_RECLAIM_get_credentials_start (
1441 key_len, 1441 key_len,
1442 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START); 1442 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START);
1443 msg->id = htonl (rid); 1443 msg->id = htonl (rid);
1444 msg->key_len = htonl (key_len); 1444 msg->key_len = htons (key_len);
1445 GNUNET_IDENTITY_write_private_key_to_buffer (identity, &msg[1], key_len); 1445 GNUNET_IDENTITY_write_private_key_to_buffer (identity, &msg[1], key_len);
1446 if (NULL == h->mq) 1446 if (NULL == h->mq)
1447 ait->env = env; 1447 ait->env = env;
@@ -1515,8 +1515,8 @@ GNUNET_RECLAIM_ticket_issue (
1515 op->env = GNUNET_MQ_msg_extra (tim, 1515 op->env = GNUNET_MQ_msg_extra (tim,
1516 attr_len + key_len + rpk_len, 1516 attr_len + key_len + rpk_len,
1517 GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET); 1517 GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET);
1518 tim->key_len = htonl (key_len); 1518 tim->key_len = htons (key_len);
1519 tim->pkey_len = htonl (rpk_len); 1519 tim->pkey_len = htons (rpk_len);
1520 buf = (char *) &tim[1]; 1520 buf = (char *) &tim[1];
1521 written = GNUNET_IDENTITY_write_private_key_to_buffer (iss, buf, key_len); 1521 written = GNUNET_IDENTITY_write_private_key_to_buffer (iss, buf, key_len);
1522 GNUNET_assert (0 <= written); 1522 GNUNET_assert (0 <= written);
@@ -1571,11 +1571,11 @@ GNUNET_RECLAIM_ticket_consume (
1571 op->env = GNUNET_MQ_msg_extra (ctm, 1571 op->env = GNUNET_MQ_msg_extra (ctm,
1572 key_len + tkt_len, 1572 key_len + tkt_len,
1573 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET); 1573 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET);
1574 ctm->key_len = htonl (key_len); 1574 ctm->key_len = htons (key_len);
1575 buf = (char*) &ctm[1]; 1575 buf = (char*) &ctm[1];
1576 GNUNET_IDENTITY_write_private_key_to_buffer (identity, buf, key_len); 1576 GNUNET_IDENTITY_write_private_key_to_buffer (identity, buf, key_len);
1577 buf += key_len; 1577 buf += key_len;
1578 ctm->tkt_len = htonl (tkt_len); 1578 ctm->tkt_len = htons (tkt_len);
1579 GNUNET_RECLAIM_write_ticket_to_buffer (ticket, buf, tkt_len); 1579 GNUNET_RECLAIM_write_ticket_to_buffer (ticket, buf, tkt_len);
1580 ctm->id = htonl (op->r_id); 1580 ctm->id = htonl (op->r_id);
1581 if (NULL != h->mq) 1581 if (NULL != h->mq)
@@ -1620,7 +1620,7 @@ GNUNET_RECLAIM_ticket_iteration_start (
1620 key_len, 1620 key_len,
1621 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START); 1621 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START);
1622 msg->id = htonl (rid); 1622 msg->id = htonl (rid);
1623 msg->key_len = htonl (key_len); 1623 msg->key_len = htons (key_len);
1624 GNUNET_IDENTITY_write_private_key_to_buffer (identity, 1624 GNUNET_IDENTITY_write_private_key_to_buffer (identity,
1625 &msg[1], 1625 &msg[1],
1626 key_len); 1626 key_len);
@@ -1718,8 +1718,8 @@ GNUNET_RECLAIM_ticket_revoke (
1718 key_len + tkt_len, 1718 key_len + tkt_len,
1719 GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET); 1719 GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET);
1720 msg->id = htonl (rid); 1720 msg->id = htonl (rid);
1721 msg->key_len = htonl (key_len); 1721 msg->key_len = htons (key_len);
1722 msg->tkt_len = htonl (tkt_len); 1722 msg->tkt_len = htons (tkt_len);
1723 buf = (char*) &msg[1]; 1723 buf = (char*) &msg[1];
1724 written = GNUNET_IDENTITY_write_private_key_to_buffer (identity, 1724 written = GNUNET_IDENTITY_write_private_key_to_buffer (identity,
1725 buf, 1725 buf,