aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/plugin_namestore_flat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/plugin_namestore_flat.c')
-rw-r--r--src/namestore/plugin_namestore_flat.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/namestore/plugin_namestore_flat.c b/src/namestore/plugin_namestore_flat.c
index 60b24df67..1a071fd80 100644
--- a/src/namestore/plugin_namestore_flat.c
+++ b/src/namestore/plugin_namestore_flat.c
@@ -54,7 +54,7 @@ struct FlatFileEntry
54 /** 54 /**
55 * Entry zone 55 * Entry zone
56 */ 56 */
57 struct GNUNET_CRYPTO_EcdsaPrivateKey private_key; 57 struct GNUNET_IDENTITY_PrivateKey private_key;
58 58
59 /** 59 /**
60 * Record cound 60 * Record cound
@@ -86,7 +86,7 @@ struct FlatFileEntry
86 * @param h[out] initialized hash 86 * @param h[out] initialized hash
87 */ 87 */
88static void 88static void
89hash_pkey_and_label (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 89hash_pkey_and_label (const struct GNUNET_IDENTITY_PrivateKey *pkey,
90 const char *label, 90 const char *label,
91 struct GNUNET_HashCode *h) 91 struct GNUNET_HashCode *h)
92{ 92{
@@ -95,14 +95,14 @@ hash_pkey_and_label (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
95 size_t key_len; 95 size_t key_len;
96 96
97 label_len = strlen (label); 97 label_len = strlen (label);
98 key_len = label_len + sizeof(struct GNUNET_CRYPTO_EcdsaPrivateKey); 98 key_len = label_len + sizeof(struct GNUNET_IDENTITY_PrivateKey);
99 key = GNUNET_malloc (key_len); 99 key = GNUNET_malloc (key_len);
100 GNUNET_memcpy (key, 100 GNUNET_memcpy (key,
101 label, 101 label,
102 label_len); 102 label_len);
103 GNUNET_memcpy (key + label_len, 103 GNUNET_memcpy (key + label_len,
104 pkey, 104 pkey,
105 sizeof(struct GNUNET_CRYPTO_EcdsaPrivateKey)); 105 sizeof(struct GNUNET_IDENTITY_PrivateKey));
106 GNUNET_CRYPTO_hash (key, 106 GNUNET_CRYPTO_hash (key,
107 key_len, 107 key_len,
108 h); 108 h);
@@ -296,7 +296,7 @@ database_setup (struct Plugin *plugin)
296 GNUNET_free (record_data); 296 GNUNET_free (record_data);
297 297
298 { 298 {
299 struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key; 299 struct GNUNET_IDENTITY_PrivateKey *private_key;
300 300
301 GNUNET_STRINGS_base64_decode (zone_private_key, 301 GNUNET_STRINGS_base64_decode (zone_private_key,
302 strlen (zone_private_key), 302 strlen (zone_private_key),
@@ -345,7 +345,7 @@ store_and_free_entries (void *cls,
345 345
346 (void) key; 346 (void) key;
347 GNUNET_STRINGS_base64_encode (&entry->private_key, 347 GNUNET_STRINGS_base64_encode (&entry->private_key,
348 sizeof(struct GNUNET_CRYPTO_EcdsaPrivateKey), 348 sizeof(struct GNUNET_IDENTITY_PrivateKey),
349 &zone_private_key); 349 &zone_private_key);
350 data_size = GNUNET_GNSRECORD_records_get_size (entry->record_count, 350 data_size = GNUNET_GNSRECORD_records_get_size (entry->record_count,
351 entry->record_data); 351 entry->record_data);
@@ -452,7 +452,7 @@ database_shutdown (struct Plugin *plugin)
452static int 452static int
453namestore_flat_store_records (void *cls, 453namestore_flat_store_records (void *cls,
454 const struct 454 const struct
455 GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, 455 GNUNET_IDENTITY_PrivateKey *zone_key,
456 const char *label, 456 const char *label,
457 unsigned int rd_count, 457 unsigned int rd_count,
458 const struct GNUNET_GNSRECORD_Data *rd) 458 const struct GNUNET_GNSRECORD_Data *rd)
@@ -482,7 +482,7 @@ namestore_flat_store_records (void *cls,
482 strlen (label)); 482 strlen (label));
483 GNUNET_memcpy (&entry->private_key, 483 GNUNET_memcpy (&entry->private_key,
484 zone_key, 484 zone_key,
485 sizeof(struct GNUNET_CRYPTO_EcdsaPrivateKey)); 485 sizeof(struct GNUNET_IDENTITY_PrivateKey));
486 entry->rvalue = rvalue; 486 entry->rvalue = rvalue;
487 entry->record_count = rd_count; 487 entry->record_count = rd_count;
488 entry->record_data = GNUNET_new_array (rd_count, 488 entry->record_data = GNUNET_new_array (rd_count,
@@ -517,7 +517,7 @@ namestore_flat_store_records (void *cls,
517 */ 517 */
518static int 518static int
519namestore_flat_lookup_records (void *cls, 519namestore_flat_lookup_records (void *cls,
520 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 520 const struct GNUNET_IDENTITY_PrivateKey *zone,
521 const char *label, 521 const char *label,
522 GNUNET_NAMESTORE_RecordIterator iter, 522 GNUNET_NAMESTORE_RecordIterator iter,
523 void *iter_cls) 523 void *iter_cls)
@@ -574,7 +574,7 @@ struct IterateContext
574 /** 574 /**
575 * Target zone. 575 * Target zone.
576 */ 576 */
577 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone; 577 const struct GNUNET_IDENTITY_PrivateKey *zone;
578 578
579 /** 579 /**
580 * Function to call on each record. 580 * Function to call on each record.
@@ -647,7 +647,7 @@ iterate_zones (void *cls,
647static int 647static int
648namestore_flat_iterate_records (void *cls, 648namestore_flat_iterate_records (void *cls,
649 const struct 649 const struct
650 GNUNET_CRYPTO_EcdsaPrivateKey *zone, 650 GNUNET_IDENTITY_PrivateKey *zone,
651 uint64_t serial, 651 uint64_t serial,
652 uint64_t limit, 652 uint64_t limit,
653 GNUNET_NAMESTORE_RecordIterator iter, 653 GNUNET_NAMESTORE_RecordIterator iter,
@@ -674,8 +674,8 @@ namestore_flat_iterate_records (void *cls,
674 */ 674 */
675struct ZoneToNameContext 675struct ZoneToNameContext
676{ 676{
677 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone; 677 const struct GNUNET_IDENTITY_PrivateKey *zone;
678 const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone; 678 const struct GNUNET_IDENTITY_PublicKey *value_zone;
679 GNUNET_NAMESTORE_RecordIterator iter; 679 GNUNET_NAMESTORE_RecordIterator iter;
680 void *iter_cls; 680 void *iter_cls;
681 681
@@ -702,7 +702,7 @@ zone_to_name (void *cls,
702 continue; 702 continue;
703 if (0 == memcmp (ztn->value_zone, 703 if (0 == memcmp (ztn->value_zone,
704 entry->record_data[i].data, 704 entry->record_data[i].data,
705 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey))) 705 sizeof(struct GNUNET_IDENTITY_PublicKey)))
706 { 706 {
707 ztn->iter (ztn->iter_cls, 707 ztn->iter (ztn->iter_cls,
708 i + 1, /* zero is illegal! */ 708 i + 1, /* zero is illegal! */
@@ -730,9 +730,9 @@ zone_to_name (void *cls,
730 */ 730 */
731static int 731static int
732namestore_flat_zone_to_name (void *cls, 732namestore_flat_zone_to_name (void *cls,
733 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 733 const struct GNUNET_IDENTITY_PrivateKey *zone,
734 const struct 734 const struct
735 GNUNET_CRYPTO_EcdsaPublicKey *value_zone, 735 GNUNET_IDENTITY_PublicKey *value_zone,
736 GNUNET_NAMESTORE_RecordIterator iter, 736 GNUNET_NAMESTORE_RecordIterator iter,
737 void *iter_cls) 737 void *iter_cls)
738{ 738{