diff options
Diffstat (limited to 'src/namestore/gnunet-service-namestore.c')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index f6594c6f9..26de295bf 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -80,7 +80,7 @@ struct ZoneIteration | |||
80 | /** | 80 | /** |
81 | * Key of the zone we are iterating over. | 81 | * Key of the zone we are iterating over. |
82 | */ | 82 | */ |
83 | struct GNUNET_IDENTITY_PrivateKey zone; | 83 | struct GNUNET_CRYPTO_PrivateKey zone; |
84 | 84 | ||
85 | /** | 85 | /** |
86 | * The record set filter | 86 | * The record set filter |
@@ -191,7 +191,7 @@ struct ZoneMonitor | |||
191 | /** | 191 | /** |
192 | * Private key of the zone. | 192 | * Private key of the zone. |
193 | */ | 193 | */ |
194 | struct GNUNET_IDENTITY_PrivateKey zone; | 194 | struct GNUNET_CRYPTO_PrivateKey zone; |
195 | 195 | ||
196 | /** | 196 | /** |
197 | * The record set filter | 197 | * The record set filter |
@@ -302,7 +302,7 @@ struct StoreActivity | |||
302 | /** | 302 | /** |
303 | * The zone private key | 303 | * The zone private key |
304 | */ | 304 | */ |
305 | struct GNUNET_IDENTITY_PrivateKey private_key; | 305 | struct GNUNET_CRYPTO_PrivateKey private_key; |
306 | 306 | ||
307 | /** | 307 | /** |
308 | * Copy of the original record set (as data fields in @e rd will | 308 | * Copy of the original record set (as data fields in @e rd will |
@@ -326,7 +326,7 @@ struct NickCache | |||
326 | /** | 326 | /** |
327 | * Zone the cache entry is for. | 327 | * Zone the cache entry is for. |
328 | */ | 328 | */ |
329 | struct GNUNET_IDENTITY_PrivateKey zone; | 329 | struct GNUNET_CRYPTO_PrivateKey zone; |
330 | 330 | ||
331 | /** | 331 | /** |
332 | * Cached record data. | 332 | * Cached record data. |
@@ -347,7 +347,7 @@ static struct NickCache nick_cache[NC_SIZE]; | |||
347 | /** | 347 | /** |
348 | * Public key of all zeros. | 348 | * Public key of all zeros. |
349 | */ | 349 | */ |
350 | static const struct GNUNET_IDENTITY_PrivateKey zero; | 350 | static const struct GNUNET_CRYPTO_PrivateKey zero; |
351 | 351 | ||
352 | /** | 352 | /** |
353 | * Configuration handle. | 353 | * Configuration handle. |
@@ -453,7 +453,7 @@ free_store_activity (struct StoreActivity *sa) | |||
453 | static void | 453 | static void |
454 | lookup_nick_it (void *cls, | 454 | lookup_nick_it (void *cls, |
455 | uint64_t seq, | 455 | uint64_t seq, |
456 | const struct GNUNET_IDENTITY_PrivateKey *private_key, | 456 | const struct GNUNET_CRYPTO_PrivateKey *private_key, |
457 | const char *label, | 457 | const char *label, |
458 | unsigned int rd_count, | 458 | unsigned int rd_count, |
459 | const struct GNUNET_GNSRECORD_Data *rd) | 459 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -493,7 +493,7 @@ lookup_nick_it (void *cls, | |||
493 | * @param nick nick entry to cache | 493 | * @param nick nick entry to cache |
494 | */ | 494 | */ |
495 | static void | 495 | static void |
496 | cache_nick (const struct GNUNET_IDENTITY_PrivateKey *zone, | 496 | cache_nick (const struct GNUNET_CRYPTO_PrivateKey *zone, |
497 | const struct GNUNET_GNSRECORD_Data *nick) | 497 | const struct GNUNET_GNSRECORD_Data *nick) |
498 | { | 498 | { |
499 | struct NickCache *oldest; | 499 | struct NickCache *oldest; |
@@ -537,9 +537,9 @@ cache_nick (const struct GNUNET_IDENTITY_PrivateKey *zone, | |||
537 | * @return NULL if no NICK record was found | 537 | * @return NULL if no NICK record was found |
538 | */ | 538 | */ |
539 | static struct GNUNET_GNSRECORD_Data * | 539 | static struct GNUNET_GNSRECORD_Data * |
540 | get_nick_record (const struct GNUNET_IDENTITY_PrivateKey *zone) | 540 | get_nick_record (const struct GNUNET_CRYPTO_PrivateKey *zone) |
541 | { | 541 | { |
542 | struct GNUNET_IDENTITY_PublicKey pub; | 542 | struct GNUNET_CRYPTO_PublicKey pub; |
543 | struct GNUNET_GNSRECORD_Data *nick; | 543 | struct GNUNET_GNSRECORD_Data *nick; |
544 | int res; | 544 | int res; |
545 | 545 | ||
@@ -579,7 +579,7 @@ get_nick_record (const struct GNUNET_IDENTITY_PrivateKey *zone) | |||
579 | __LINE__); | 579 | __LINE__); |
580 | if (1 == do_log) | 580 | if (1 == do_log) |
581 | { | 581 | { |
582 | GNUNET_IDENTITY_key_get_public (zone, &pub); | 582 | GNUNET_CRYPTO_key_get_public (zone, &pub); |
583 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, | 583 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
584 | "No nick name set for zone `%s'\n", | 584 | "No nick name set for zone `%s'\n", |
585 | GNUNET_GNSRECORD_z2s (&pub)); | 585 | GNUNET_GNSRECORD_z2s (&pub)); |
@@ -695,7 +695,7 @@ static int | |||
695 | send_lookup_response_with_filter (struct NamestoreClient *nc, | 695 | send_lookup_response_with_filter (struct NamestoreClient *nc, |
696 | uint32_t request_id, | 696 | uint32_t request_id, |
697 | const struct | 697 | const struct |
698 | GNUNET_IDENTITY_PrivateKey *zone_key, | 698 | GNUNET_CRYPTO_PrivateKey *zone_key, |
699 | const char *name, | 699 | const char *name, |
700 | unsigned int rd_count, | 700 | unsigned int rd_count, |
701 | const struct GNUNET_GNSRECORD_Data *rd, | 701 | const struct GNUNET_GNSRECORD_Data *rd, |
@@ -778,7 +778,7 @@ send_lookup_response_with_filter (struct NamestoreClient *nc, | |||
778 | GNUNET_SERVICE_client_drop (nc->client); | 778 | GNUNET_SERVICE_client_drop (nc->client); |
779 | return 0; | 779 | return 0; |
780 | } | 780 | } |
781 | key_len = GNUNET_IDENTITY_private_key_get_length (zone_key); | 781 | key_len = GNUNET_CRYPTO_private_key_get_length (zone_key); |
782 | env = GNUNET_MQ_msg_extra (zir_msg, | 782 | env = GNUNET_MQ_msg_extra (zir_msg, |
783 | name_len + rd_ser_len + key_len, | 783 | name_len + rd_ser_len + key_len, |
784 | GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT); | 784 | GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT); |
@@ -787,7 +787,7 @@ send_lookup_response_with_filter (struct NamestoreClient *nc, | |||
787 | zir_msg->rd_count = htons (res_count); | 787 | zir_msg->rd_count = htons (res_count); |
788 | zir_msg->rd_len = htons ((uint16_t) rd_ser_len); | 788 | zir_msg->rd_len = htons ((uint16_t) rd_ser_len); |
789 | zir_msg->key_len = htons (key_len); | 789 | zir_msg->key_len = htons (key_len); |
790 | GNUNET_IDENTITY_write_private_key_to_buffer (zone_key, | 790 | GNUNET_CRYPTO_write_private_key_to_buffer (zone_key, |
791 | &zir_msg[1], | 791 | &zir_msg[1], |
792 | key_len); | 792 | key_len); |
793 | zir_msg->expire = GNUNET_TIME_absolute_hton (block_exp); | 793 | zir_msg->expire = GNUNET_TIME_absolute_hton (block_exp); |
@@ -1194,7 +1194,7 @@ struct RecordLookupContext | |||
1194 | static void | 1194 | static void |
1195 | lookup_it (void *cls, | 1195 | lookup_it (void *cls, |
1196 | uint64_t seq, | 1196 | uint64_t seq, |
1197 | const struct GNUNET_IDENTITY_PrivateKey *private_key, | 1197 | const struct GNUNET_CRYPTO_PrivateKey *private_key, |
1198 | const char *label, | 1198 | const char *label, |
1199 | unsigned int rd_count_nf, | 1199 | unsigned int rd_count_nf, |
1200 | const struct GNUNET_GNSRECORD_Data *rd_nf) | 1200 | const struct GNUNET_GNSRECORD_Data *rd_nf) |
@@ -1337,7 +1337,7 @@ check_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg) | |||
1337 | static void | 1337 | static void |
1338 | handle_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg) | 1338 | handle_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg) |
1339 | { | 1339 | { |
1340 | struct GNUNET_IDENTITY_PrivateKey zone; | 1340 | struct GNUNET_CRYPTO_PrivateKey zone; |
1341 | struct NamestoreClient *nc = cls; | 1341 | struct NamestoreClient *nc = cls; |
1342 | struct GNUNET_MQ_Envelope *env; | 1342 | struct GNUNET_MQ_Envelope *env; |
1343 | struct LabelLookupResponseMessage *llr_msg; | 1343 | struct LabelLookupResponseMessage *llr_msg; |
@@ -1352,7 +1352,7 @@ handle_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg) | |||
1352 | 1352 | ||
1353 | key_len = ntohs (ll_msg->key_len); | 1353 | key_len = ntohs (ll_msg->key_len); |
1354 | if ((GNUNET_SYSERR == | 1354 | if ((GNUNET_SYSERR == |
1355 | GNUNET_IDENTITY_read_private_key_from_buffer (&ll_msg[1], | 1355 | GNUNET_CRYPTO_read_private_key_from_buffer (&ll_msg[1], |
1356 | key_len, | 1356 | key_len, |
1357 | &zone, | 1357 | &zone, |
1358 | &kb_read)) || | 1358 | &kb_read)) || |
@@ -1489,7 +1489,7 @@ static void | |||
1489 | get_existing_rd_exp (void *cls, | 1489 | get_existing_rd_exp (void *cls, |
1490 | uint64_t seq, | 1490 | uint64_t seq, |
1491 | const struct | 1491 | const struct |
1492 | GNUNET_IDENTITY_PrivateKey *private_key, | 1492 | GNUNET_CRYPTO_PrivateKey *private_key, |
1493 | const char *label, | 1493 | const char *label, |
1494 | unsigned int rd_count, | 1494 | unsigned int rd_count, |
1495 | const struct GNUNET_GNSRECORD_Data *rd) | 1495 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -1523,7 +1523,7 @@ get_existing_rd_exp (void *cls, | |||
1523 | 1523 | ||
1524 | static enum GNUNET_ErrorCode | 1524 | static enum GNUNET_ErrorCode |
1525 | store_record_set (struct NamestoreClient *nc, | 1525 | store_record_set (struct NamestoreClient *nc, |
1526 | const struct GNUNET_IDENTITY_PrivateKey *private_key, | 1526 | const struct GNUNET_CRYPTO_PrivateKey *private_key, |
1527 | const struct RecordSet *rd_set, | 1527 | const struct RecordSet *rd_set, |
1528 | ssize_t *len) | 1528 | ssize_t *len) |
1529 | { | 1529 | { |
@@ -1727,7 +1727,7 @@ store_record_set (struct NamestoreClient *nc, | |||
1727 | static void | 1727 | static void |
1728 | handle_record_store (void *cls, const struct RecordStoreMessage *rp_msg) | 1728 | handle_record_store (void *cls, const struct RecordStoreMessage *rp_msg) |
1729 | { | 1729 | { |
1730 | struct GNUNET_IDENTITY_PrivateKey zone; | 1730 | struct GNUNET_CRYPTO_PrivateKey zone; |
1731 | struct NamestoreClient *nc = cls; | 1731 | struct NamestoreClient *nc = cls; |
1732 | uint32_t rid; | 1732 | uint32_t rid; |
1733 | uint16_t rd_set_count; | 1733 | uint16_t rd_set_count; |
@@ -1747,7 +1747,7 @@ handle_record_store (void *cls, const struct RecordStoreMessage *rp_msg) | |||
1747 | rs_off = sizeof (*rp_msg) + key_len; | 1747 | rs_off = sizeof (*rp_msg) + key_len; |
1748 | rs_len = rp_msg_len - rs_off; | 1748 | rs_len = rp_msg_len - rs_off; |
1749 | if ((GNUNET_SYSERR == | 1749 | if ((GNUNET_SYSERR == |
1750 | GNUNET_IDENTITY_read_private_key_from_buffer (&rp_msg[1], | 1750 | GNUNET_CRYPTO_read_private_key_from_buffer (&rp_msg[1], |
1751 | key_len, | 1751 | key_len, |
1752 | &zone, | 1752 | &zone, |
1753 | &kb_read)) || | 1753 | &kb_read)) || |
@@ -1949,7 +1949,7 @@ struct ZoneToNameCtx | |||
1949 | static void | 1949 | static void |
1950 | handle_zone_to_name_it (void *cls, | 1950 | handle_zone_to_name_it (void *cls, |
1951 | uint64_t seq, | 1951 | uint64_t seq, |
1952 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, | 1952 | const struct GNUNET_CRYPTO_PrivateKey *zone_key, |
1953 | const char *name, | 1953 | const char *name, |
1954 | unsigned int rd_count, | 1954 | unsigned int rd_count, |
1955 | const struct GNUNET_GNSRECORD_Data *rd) | 1955 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -1977,7 +1977,7 @@ handle_zone_to_name_it (void *cls, | |||
1977 | ztn_ctx->ec = htonl (GNUNET_EC_NAMESTORE_UNKNOWN); | 1977 | ztn_ctx->ec = htonl (GNUNET_EC_NAMESTORE_UNKNOWN); |
1978 | return; | 1978 | return; |
1979 | } | 1979 | } |
1980 | key_len = GNUNET_IDENTITY_private_key_get_length (zone_key); | 1980 | key_len = GNUNET_CRYPTO_private_key_get_length (zone_key); |
1981 | msg_size = sizeof(struct ZoneToNameResponseMessage) | 1981 | msg_size = sizeof(struct ZoneToNameResponseMessage) |
1982 | + name_len + rd_ser_len + key_len; | 1982 | + name_len + rd_ser_len + key_len; |
1983 | if (msg_size >= GNUNET_MAX_MESSAGE_SIZE) | 1983 | if (msg_size >= GNUNET_MAX_MESSAGE_SIZE) |
@@ -1997,7 +1997,7 @@ handle_zone_to_name_it (void *cls, | |||
1997 | ztnr_msg->rd_count = htons (rd_count); | 1997 | ztnr_msg->rd_count = htons (rd_count); |
1998 | ztnr_msg->name_len = htons (name_len); | 1998 | ztnr_msg->name_len = htons (name_len); |
1999 | ztnr_msg->key_len = htons (key_len); | 1999 | ztnr_msg->key_len = htons (key_len); |
2000 | GNUNET_IDENTITY_write_private_key_to_buffer (zone_key, | 2000 | GNUNET_CRYPTO_write_private_key_to_buffer (zone_key, |
2001 | &ztnr_msg[1], | 2001 | &ztnr_msg[1], |
2002 | key_len); | 2002 | key_len); |
2003 | name_tmp = (char *) &ztnr_msg[1] + key_len; | 2003 | name_tmp = (char *) &ztnr_msg[1] + key_len; |
@@ -2027,8 +2027,8 @@ check_zone_to_name (void *cls, | |||
2027 | static void | 2027 | static void |
2028 | handle_zone_to_name (void *cls, const struct ZoneToNameMessage *ztn_msg) | 2028 | handle_zone_to_name (void *cls, const struct ZoneToNameMessage *ztn_msg) |
2029 | { | 2029 | { |
2030 | struct GNUNET_IDENTITY_PrivateKey zone; | 2030 | struct GNUNET_CRYPTO_PrivateKey zone; |
2031 | struct GNUNET_IDENTITY_PublicKey value_zone; | 2031 | struct GNUNET_CRYPTO_PublicKey value_zone; |
2032 | struct NamestoreClient *nc = cls; | 2032 | struct NamestoreClient *nc = cls; |
2033 | struct ZoneToNameCtx ztn_ctx; | 2033 | struct ZoneToNameCtx ztn_ctx; |
2034 | struct GNUNET_MQ_Envelope *env; | 2034 | struct GNUNET_MQ_Envelope *env; |
@@ -2043,7 +2043,7 @@ handle_zone_to_name (void *cls, const struct ZoneToNameMessage *ztn_msg) | |||
2043 | ztn_ctx.ec = GNUNET_EC_NAMESTORE_ZONE_NOT_FOUND; | 2043 | ztn_ctx.ec = GNUNET_EC_NAMESTORE_ZONE_NOT_FOUND; |
2044 | key_len = ntohs (ztn_msg->key_len); | 2044 | key_len = ntohs (ztn_msg->key_len); |
2045 | if ((GNUNET_SYSERR == | 2045 | if ((GNUNET_SYSERR == |
2046 | GNUNET_IDENTITY_read_private_key_from_buffer (&ztn_msg[1], | 2046 | GNUNET_CRYPTO_read_private_key_from_buffer (&ztn_msg[1], |
2047 | key_len, | 2047 | key_len, |
2048 | &zone, | 2048 | &zone, |
2049 | &kb_read)) || | 2049 | &kb_read)) || |
@@ -2057,7 +2057,7 @@ handle_zone_to_name (void *cls, const struct ZoneToNameMessage *ztn_msg) | |||
2057 | } | 2057 | } |
2058 | pkey_len = ntohs (ztn_msg->pkey_len); | 2058 | pkey_len = ntohs (ztn_msg->pkey_len); |
2059 | if ((GNUNET_SYSERR == | 2059 | if ((GNUNET_SYSERR == |
2060 | GNUNET_IDENTITY_read_public_key_from_buffer ((char*) &ztn_msg[1] | 2060 | GNUNET_CRYPTO_read_public_key_from_buffer ((char*) &ztn_msg[1] |
2061 | + key_len, | 2061 | + key_len, |
2062 | pkey_len, | 2062 | pkey_len, |
2063 | &value_zone, | 2063 | &value_zone, |
@@ -2133,7 +2133,7 @@ struct ZoneIterationProcResult | |||
2133 | static void | 2133 | static void |
2134 | zone_iterate_proc (void *cls, | 2134 | zone_iterate_proc (void *cls, |
2135 | uint64_t seq, | 2135 | uint64_t seq, |
2136 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, | 2136 | const struct GNUNET_CRYPTO_PrivateKey *zone_key, |
2137 | const char *name, | 2137 | const char *name, |
2138 | unsigned int rd_count, | 2138 | unsigned int rd_count, |
2139 | const struct GNUNET_GNSRECORD_Data *rd) | 2139 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -2254,7 +2254,7 @@ static void | |||
2254 | handle_iteration_start (void *cls, | 2254 | handle_iteration_start (void *cls, |
2255 | const struct ZoneIterationStartMessage *zis_msg) | 2255 | const struct ZoneIterationStartMessage *zis_msg) |
2256 | { | 2256 | { |
2257 | struct GNUNET_IDENTITY_PrivateKey zone; | 2257 | struct GNUNET_CRYPTO_PrivateKey zone; |
2258 | struct NamestoreClient *nc = cls; | 2258 | struct NamestoreClient *nc = cls; |
2259 | struct ZoneIteration *zi; | 2259 | struct ZoneIteration *zi; |
2260 | size_t key_len; | 2260 | size_t key_len; |
@@ -2267,7 +2267,7 @@ handle_iteration_start (void *cls, | |||
2267 | if (0 < key_len) | 2267 | if (0 < key_len) |
2268 | { | 2268 | { |
2269 | if ((GNUNET_SYSERR == | 2269 | if ((GNUNET_SYSERR == |
2270 | GNUNET_IDENTITY_read_private_key_from_buffer (&zis_msg[1], | 2270 | GNUNET_CRYPTO_read_private_key_from_buffer (&zis_msg[1], |
2271 | key_len, | 2271 | key_len, |
2272 | &zone, | 2272 | &zone, |
2273 | &kb_read)) || | 2273 | &kb_read)) || |
@@ -2443,7 +2443,7 @@ monitor_iteration_next (void *cls); | |||
2443 | static void | 2443 | static void |
2444 | monitor_iterate_cb (void *cls, | 2444 | monitor_iterate_cb (void *cls, |
2445 | uint64_t seq, | 2445 | uint64_t seq, |
2446 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, | 2446 | const struct GNUNET_CRYPTO_PrivateKey *zone_key, |
2447 | const char *name, | 2447 | const char *name, |
2448 | unsigned int rd_count, | 2448 | unsigned int rd_count, |
2449 | const struct GNUNET_GNSRECORD_Data *rd) | 2449 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -2505,7 +2505,7 @@ static void | |||
2505 | handle_monitor_start (void *cls, const struct | 2505 | handle_monitor_start (void *cls, const struct |
2506 | ZoneMonitorStartMessage *zis_msg) | 2506 | ZoneMonitorStartMessage *zis_msg) |
2507 | { | 2507 | { |
2508 | struct GNUNET_IDENTITY_PrivateKey zone; | 2508 | struct GNUNET_CRYPTO_PrivateKey zone; |
2509 | struct NamestoreClient *nc = cls; | 2509 | struct NamestoreClient *nc = cls; |
2510 | struct ZoneMonitor *zm; | 2510 | struct ZoneMonitor *zm; |
2511 | size_t key_len; | 2511 | size_t key_len; |
@@ -2519,7 +2519,7 @@ handle_monitor_start (void *cls, const struct | |||
2519 | if (0 < key_len) | 2519 | if (0 < key_len) |
2520 | { | 2520 | { |
2521 | if ((GNUNET_SYSERR == | 2521 | if ((GNUNET_SYSERR == |
2522 | GNUNET_IDENTITY_read_private_key_from_buffer (&zis_msg[1], | 2522 | GNUNET_CRYPTO_read_private_key_from_buffer (&zis_msg[1], |
2523 | key_len, | 2523 | key_len, |
2524 | &zone, | 2524 | &zone, |
2525 | &kb_read)) || | 2525 | &kb_read)) || |