diff options
Diffstat (limited to 'src/namestore/gnunet-service-namestore.c')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 25 |
1 files changed, 13 insertions, 12 deletions
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 == |