diff options
Diffstat (limited to 'src/namestore')
31 files changed, 303 insertions, 303 deletions
diff --git a/src/namestore/Makefile.am b/src/namestore/Makefile.am index 40ac64197..3a92f98c9 100644 --- a/src/namestore/Makefile.am +++ b/src/namestore/Makefile.am | |||
@@ -131,6 +131,7 @@ libgnunet_plugin_rest_namestore_la_LIBADD = \ | |||
131 | $(top_builddir)/src/identity/libgnunetidentity.la \ | 131 | $(top_builddir)/src/identity/libgnunetidentity.la \ |
132 | $(top_builddir)/src/json/libgnunetjson.la \ | 132 | $(top_builddir)/src/json/libgnunetjson.la \ |
133 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 133 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
134 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecordjson.la \ | ||
134 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ | 135 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ |
135 | $(LTLIBINTL) -ljansson $(MHD_LIBS) | 136 | $(LTLIBINTL) -ljansson $(MHD_LIBS) |
136 | libgnunet_plugin_rest_namestore_la_LDFLAGS = \ | 137 | libgnunet_plugin_rest_namestore_la_LDFLAGS = \ |
@@ -144,6 +145,7 @@ libgnunetnamestore_la_SOURCES = \ | |||
144 | namestore.h | 145 | namestore.h |
145 | libgnunetnamestore_la_LIBADD = \ | 146 | libgnunetnamestore_la_LIBADD = \ |
146 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 147 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
148 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
147 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 149 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
148 | $(top_builddir)/src/util/libgnunetutil.la \ | 150 | $(top_builddir)/src/util/libgnunetutil.la \ |
149 | $(GN_LIBINTL) | 151 | $(GN_LIBINTL) |
@@ -190,6 +192,7 @@ gnunet_service_namestore_SOURCES = \ | |||
190 | gnunet_service_namestore_LDADD = \ | 192 | gnunet_service_namestore_LDADD = \ |
191 | $(top_builddir)/src/namecache/libgnunetnamecache.la \ | 193 | $(top_builddir)/src/namecache/libgnunetnamecache.la \ |
192 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 194 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
195 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
193 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 196 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
194 | $(top_builddir)/src/util/libgnunetutil.la \ | 197 | $(top_builddir)/src/util/libgnunetutil.la \ |
195 | libgnunetnamestore.la \ | 198 | libgnunetnamestore.la \ |
@@ -200,7 +203,8 @@ gnunet_service_namestore_LDADD = \ | |||
200 | libgnunet_plugin_namestore_flat_la_SOURCES = \ | 203 | libgnunet_plugin_namestore_flat_la_SOURCES = \ |
201 | plugin_namestore_flat.c | 204 | plugin_namestore_flat.c |
202 | libgnunet_plugin_namestore_flat_la_LIBADD = \ | 205 | libgnunet_plugin_namestore_flat_la_LIBADD = \ |
203 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 206 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
207 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
204 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 208 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
205 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ | 209 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ |
206 | $(LTLIBINTL) | 210 | $(LTLIBINTL) |
@@ -212,6 +216,7 @@ libgnunet_plugin_namestore_sqlite_la_SOURCES = \ | |||
212 | plugin_namestore_sqlite.c | 216 | plugin_namestore_sqlite.c |
213 | libgnunet_plugin_namestore_sqlite_la_LIBADD = \ | 217 | libgnunet_plugin_namestore_sqlite_la_LIBADD = \ |
214 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 218 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
219 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
215 | $(top_builddir)/src/sq/libgnunetsq.la \ | 220 | $(top_builddir)/src/sq/libgnunetsq.la \ |
216 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 221 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
217 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \ | 222 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \ |
@@ -223,6 +228,7 @@ libgnunet_plugin_namestore_postgres_la_SOURCES = \ | |||
223 | plugin_namestore_postgres.c | 228 | plugin_namestore_postgres.c |
224 | libgnunet_plugin_namestore_postgres_la_LIBADD = \ | 229 | libgnunet_plugin_namestore_postgres_la_LIBADD = \ |
225 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 230 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
231 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
226 | $(top_builddir)/src/pq/libgnunetpq.la \ | 232 | $(top_builddir)/src/pq/libgnunetpq.la \ |
227 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 233 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
228 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \ | 234 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \ |
@@ -236,6 +242,7 @@ test_namestore_api_store_flat_LDADD = \ | |||
236 | $(top_builddir)/src/testing/libgnunettesting.la \ | 242 | $(top_builddir)/src/testing/libgnunettesting.la \ |
237 | $(top_builddir)/src/util/libgnunetutil.la \ | 243 | $(top_builddir)/src/util/libgnunetutil.la \ |
238 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 244 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
245 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
239 | libgnunetnamestore.la | 246 | libgnunetnamestore.la |
240 | 247 | ||
241 | test_namestore_api_store_sqlite_SOURCES = \ | 248 | test_namestore_api_store_sqlite_SOURCES = \ |
@@ -244,6 +251,7 @@ test_namestore_api_store_sqlite_LDADD = \ | |||
244 | $(top_builddir)/src/testing/libgnunettesting.la \ | 251 | $(top_builddir)/src/testing/libgnunettesting.la \ |
245 | $(top_builddir)/src/util/libgnunetutil.la \ | 252 | $(top_builddir)/src/util/libgnunetutil.la \ |
246 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 253 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
254 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
247 | libgnunetnamestore.la | 255 | libgnunetnamestore.la |
248 | 256 | ||
249 | test_namestore_api_store_postgres_SOURCES = \ | 257 | test_namestore_api_store_postgres_SOURCES = \ |
@@ -252,6 +260,7 @@ test_namestore_api_store_postgres_LDADD = \ | |||
252 | $(top_builddir)/src/testing/libgnunettesting.la \ | 260 | $(top_builddir)/src/testing/libgnunettesting.la \ |
253 | $(top_builddir)/src/util/libgnunetutil.la \ | 261 | $(top_builddir)/src/util/libgnunetutil.la \ |
254 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 262 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
263 | $(top_builddir)/src/identity/libgnunetidentity.la \ | ||
255 | libgnunetnamestore.la | 264 | libgnunetnamestore.la |
256 | 265 | ||
257 | test_namestore_api_store_update_flat_SOURCES = \ | 266 | test_namestore_api_store_update_flat_SOURCES = \ |
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c index 34641d22e..22d108067 100644 --- a/src/namestore/gnunet-namestore-fcfsd.c +++ b/src/namestore/gnunet-namestore-fcfsd.c | |||
@@ -164,7 +164,7 @@ struct Request | |||
164 | */ | 164 | */ |
165 | char public_key[128]; | 165 | char public_key[128]; |
166 | 166 | ||
167 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | 167 | struct GNUNET_IDENTITY_PublicKey pub; |
168 | }; | 168 | }; |
169 | 169 | ||
170 | /** | 170 | /** |
@@ -211,7 +211,7 @@ static struct GNUNET_NAMESTORE_Handle *ns; | |||
211 | /** | 211 | /** |
212 | * Private key for the fcfsd zone. | 212 | * Private key for the fcfsd zone. |
213 | */ | 213 | */ |
214 | static struct GNUNET_CRYPTO_EcdsaPrivateKey fcfs_zone_pkey; | 214 | static struct GNUNET_IDENTITY_PrivateKey fcfs_zone_pkey; |
215 | 215 | ||
216 | /** | 216 | /** |
217 | * Connection to identity service. | 217 | * Connection to identity service. |
@@ -306,7 +306,6 @@ zone_iteration_end (void *cls) | |||
306 | /* return static form */ | 306 | /* return static form */ |
307 | GNUNET_asprintf (&full_page, | 307 | GNUNET_asprintf (&full_page, |
308 | ZONEINFO_PAGE, | 308 | ZONEINFO_PAGE, |
309 | zr->zoneinfo, | ||
310 | zr->zoneinfo); | 309 | zr->zoneinfo); |
311 | response = MHD_create_response_from_buffer (strlen (full_page), | 310 | response = MHD_create_response_from_buffer (strlen (full_page), |
312 | (void *) full_page, | 311 | (void *) full_page, |
@@ -332,7 +331,7 @@ zone_iteration_end (void *cls) | |||
332 | */ | 331 | */ |
333 | static void | 332 | static void |
334 | iterate_cb (void *cls, | 333 | iterate_cb (void *cls, |
335 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 334 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
336 | const char *name, | 335 | const char *name, |
337 | unsigned int rd_len, | 336 | unsigned int rd_len, |
338 | const struct GNUNET_GNSRECORD_Data *rd) | 337 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -350,7 +349,8 @@ iterate_cb (void *cls, | |||
350 | return; | 349 | return; |
351 | } | 350 | } |
352 | 351 | ||
353 | if (GNUNET_GNSRECORD_TYPE_PKEY != rd->record_type) | 352 | if ((GNUNET_GNSRECORD_TYPE_PKEY != rd->record_type) && |
353 | (GNUNET_GNSRECORD_TYPE_EDKEY != rd->record_type)) | ||
354 | { | 354 | { |
355 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it, | 355 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it, |
356 | 1); | 356 | 1); |
@@ -615,13 +615,14 @@ zone_to_name_error (void *cls) | |||
615 | */ | 615 | */ |
616 | static void | 616 | static void |
617 | zone_to_name_cb (void *cls, | 617 | zone_to_name_cb (void *cls, |
618 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 618 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
619 | const char *name, | 619 | const char *name, |
620 | unsigned int rd_count, | 620 | unsigned int rd_count, |
621 | const struct GNUNET_GNSRECORD_Data *rd) | 621 | const struct GNUNET_GNSRECORD_Data *rd) |
622 | { | 622 | { |
623 | struct Request *request = cls; | 623 | struct Request *request = cls; |
624 | struct GNUNET_GNSRECORD_Data r; | 624 | struct GNUNET_GNSRECORD_Data r; |
625 | char *rdata; | ||
625 | 626 | ||
626 | (void) rd; | 627 | (void) rd; |
627 | (void) zone_key; | 628 | (void) zone_key; |
@@ -636,10 +637,21 @@ zone_to_name_cb (void *cls, | |||
636 | run_httpd_now (); | 637 | run_httpd_now (); |
637 | return; | 638 | return; |
638 | } | 639 | } |
639 | r.data = &request->pub; | 640 | if (GNUNET_OK != GNUNET_GNSRECORD_data_from_identity (&request->pub, |
640 | r.data_size = sizeof(request->pub); | 641 | &rdata, |
642 | &r.data_size, | ||
643 | &r.record_type)) | ||
644 | { | ||
645 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
646 | _ ("Error creating record data.\n")); | ||
647 | request->phase = RP_FAIL; | ||
648 | MHD_resume_connection (request->con); | ||
649 | run_httpd_now (); | ||
650 | return; | ||
651 | } | ||
652 | |||
653 | r.data = rdata; | ||
641 | r.expiration_time = UINT64_MAX; | 654 | r.expiration_time = UINT64_MAX; |
642 | r.record_type = GNUNET_GNSRECORD_TYPE_PKEY; | ||
643 | r.flags = GNUNET_GNSRECORD_RF_NONE; | 655 | r.flags = GNUNET_GNSRECORD_RF_NONE; |
644 | request->qe = GNUNET_NAMESTORE_records_store (ns, | 656 | request->qe = GNUNET_NAMESTORE_records_store (ns, |
645 | &fcfs_zone_pkey, | 657 | &fcfs_zone_pkey, |
@@ -647,6 +659,7 @@ zone_to_name_cb (void *cls, | |||
647 | 1, &r, | 659 | 1, &r, |
648 | &put_continuation, | 660 | &put_continuation, |
649 | request); | 661 | request); |
662 | GNUNET_free (rdata); | ||
650 | } | 663 | } |
651 | 664 | ||
652 | 665 | ||
@@ -677,7 +690,7 @@ lookup_it_error (void *cls) | |||
677 | */ | 690 | */ |
678 | static void | 691 | static void |
679 | lookup_it_processor (void *cls, | 692 | lookup_it_processor (void *cls, |
680 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zonekey, | 693 | const struct GNUNET_IDENTITY_PrivateKey *zonekey, |
681 | const char *label, | 694 | const char *label, |
682 | unsigned int rd_count, | 695 | unsigned int rd_count, |
683 | const struct GNUNET_GNSRECORD_Data *rd) | 696 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -712,9 +725,8 @@ lookup_it_finished (void *cls) | |||
712 | return; | 725 | return; |
713 | } | 726 | } |
714 | if (GNUNET_OK != | 727 | if (GNUNET_OK != |
715 | GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key, | 728 | GNUNET_IDENTITY_public_key_from_string (request->public_key, |
716 | strlen (request->public_key), | 729 | &request->pub)) |
717 | &request->pub)) | ||
718 | { | 730 | { |
719 | GNUNET_break (0); | 731 | GNUNET_break (0); |
720 | request->phase = RP_FAIL; | 732 | request->phase = RP_FAIL; |
@@ -767,7 +779,7 @@ create_response (void *cls, | |||
767 | { | 779 | { |
768 | struct MHD_Response *response; | 780 | struct MHD_Response *response; |
769 | struct Request *request; | 781 | struct Request *request; |
770 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | 782 | struct GNUNET_IDENTITY_PublicKey pub; |
771 | MHD_RESULT ret; | 783 | MHD_RESULT ret; |
772 | 784 | ||
773 | (void) cls; | 785 | (void) cls; |
@@ -822,10 +834,8 @@ create_response (void *cls, | |||
822 | request->pp = NULL; | 834 | request->pp = NULL; |
823 | } | 835 | } |
824 | if (GNUNET_OK != | 836 | if (GNUNET_OK != |
825 | GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key, | 837 | GNUNET_IDENTITY_public_key_from_string (request->public_key, |
826 | strlen ( | 838 | &pub)) |
827 | request->public_key), | ||
828 | &pub)) | ||
829 | { | 839 | { |
830 | /* parse error */ | 840 | /* parse error */ |
831 | return fill_s_reply ("Failed to parse given public key", | 841 | return fill_s_reply ("Failed to parse given public key", |
@@ -1211,7 +1221,8 @@ main (int argc, | |||
1211 | options, | 1221 | options, |
1212 | &run, NULL)) ? 0 : 1; | 1222 | &run, NULL)) ? 0 : 1; |
1213 | GNUNET_free_nz ((void *) argv); | 1223 | GNUNET_free_nz ((void *) argv); |
1214 | GNUNET_CRYPTO_ecdsa_key_clear (&fcfs_zone_pkey); | 1224 | // FIXME |
1225 | // GNUNET_CRYPTO_ecdsa_key_clear (&fcfs_zone_pkey); | ||
1215 | return ret; | 1226 | return ret; |
1216 | } | 1227 | } |
1217 | 1228 | ||
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index 07d045b90..92d2cf627 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c | |||
@@ -59,7 +59,7 @@ static struct GNUNET_NAMESTORE_Handle *ns; | |||
59 | /** | 59 | /** |
60 | * Private key for the our zone. | 60 | * Private key for the our zone. |
61 | */ | 61 | */ |
62 | static struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey; | 62 | static struct GNUNET_IDENTITY_PrivateKey zone_pkey; |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * Handle to identity lookup. | 65 | * Handle to identity lookup. |
@@ -496,7 +496,7 @@ display_record (const char *rname, | |||
496 | */ | 496 | */ |
497 | static void | 497 | static void |
498 | display_record_iterator (void *cls, | 498 | display_record_iterator (void *cls, |
499 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 499 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
500 | const char *rname, | 500 | const char *rname, |
501 | unsigned int rd_len, | 501 | unsigned int rd_len, |
502 | const struct GNUNET_GNSRECORD_Data *rd) | 502 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -519,7 +519,7 @@ display_record_iterator (void *cls, | |||
519 | */ | 519 | */ |
520 | static void | 520 | static void |
521 | display_record_monitor (void *cls, | 521 | display_record_monitor (void *cls, |
522 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 522 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
523 | const char *rname, | 523 | const char *rname, |
524 | unsigned int rd_len, | 524 | unsigned int rd_len, |
525 | const struct GNUNET_GNSRECORD_Data *rd) | 525 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -542,7 +542,7 @@ display_record_monitor (void *cls, | |||
542 | */ | 542 | */ |
543 | static void | 543 | static void |
544 | display_record_lookup (void *cls, | 544 | display_record_lookup (void *cls, |
545 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 545 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
546 | const char *rname, | 546 | const char *rname, |
547 | unsigned int rd_len, | 547 | unsigned int rd_len, |
548 | const struct GNUNET_GNSRECORD_Data *rd) | 548 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -622,7 +622,7 @@ add_error_cb (void *cls) | |||
622 | */ | 622 | */ |
623 | static void | 623 | static void |
624 | get_existing_record (void *cls, | 624 | get_existing_record (void *cls, |
625 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 625 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
626 | const char *rec_name, | 626 | const char *rec_name, |
627 | unsigned int rd_count, | 627 | unsigned int rd_count, |
628 | const struct GNUNET_GNSRECORD_Data *rd) | 628 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -661,11 +661,11 @@ get_existing_record (void *cls, | |||
661 | return; | 661 | return; |
662 | 662 | ||
663 | case GNUNET_GNSRECORD_TYPE_PKEY: | 663 | case GNUNET_GNSRECORD_TYPE_PKEY: |
664 | case GNUNET_GNSRECORD_TYPE_EDKEY: | ||
664 | fprintf ( | 665 | fprintf ( |
665 | stderr, | 666 | stderr, |
666 | _ ( | 667 | _ ( |
667 | "A %s record exists already under `%s', no other records can be added.\n"), | 668 | "A zone key record exists already under `%s', no other records can be added.\n"), |
668 | "PKEY", | ||
669 | rec_name); | 669 | rec_name); |
670 | ret = 1; | 670 | ret = 1; |
671 | test_finished (); | 671 | test_finished (); |
@@ -703,13 +703,13 @@ get_existing_record (void *cls, | |||
703 | break; | 703 | break; |
704 | 704 | ||
705 | case GNUNET_GNSRECORD_TYPE_PKEY: | 705 | case GNUNET_GNSRECORD_TYPE_PKEY: |
706 | case GNUNET_GNSRECORD_TYPE_EDKEY: | ||
706 | if (0 != rd_count) | 707 | if (0 != rd_count) |
707 | { | 708 | { |
708 | fprintf (stderr, | 709 | fprintf (stderr, |
709 | _ ( | 710 | _ ( |
710 | "Records already exist under `%s', cannot add `%s' record.\n"), | 711 | "Records already exist under `%s', cannot add record.\n"), |
711 | rec_name, | 712 | rec_name); |
712 | "PKEY"); | ||
713 | ret = 1; | 713 | ret = 1; |
714 | test_finished (); | 714 | test_finished (); |
715 | return; | 715 | return; |
@@ -781,7 +781,7 @@ reverse_error_cb (void *cls) | |||
781 | */ | 781 | */ |
782 | static void | 782 | static void |
783 | handle_reverse_lookup (void *cls, | 783 | handle_reverse_lookup (void *cls, |
784 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 784 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
785 | const char *label, | 785 | const char *label, |
786 | unsigned int rd_count, | 786 | unsigned int rd_count, |
787 | const struct GNUNET_GNSRECORD_Data *rd) | 787 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -826,7 +826,7 @@ del_lookup_error_cb (void *cls) | |||
826 | */ | 826 | */ |
827 | static void | 827 | static void |
828 | del_monitor (void *cls, | 828 | del_monitor (void *cls, |
829 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 829 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
830 | const char *label, | 830 | const char *label, |
831 | unsigned int rd_count, | 831 | unsigned int rd_count, |
832 | const struct GNUNET_GNSRECORD_Data *rd) | 832 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -1187,12 +1187,11 @@ run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
1187 | } | 1187 | } |
1188 | if (NULL != reverse_pkey) | 1188 | if (NULL != reverse_pkey) |
1189 | { | 1189 | { |
1190 | struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 1190 | struct GNUNET_IDENTITY_PublicKey pubkey; |
1191 | 1191 | ||
1192 | if (GNUNET_OK != | 1192 | if (GNUNET_OK != |
1193 | GNUNET_CRYPTO_ecdsa_public_key_from_string (reverse_pkey, | 1193 | GNUNET_IDENTITY_public_key_from_string (reverse_pkey, |
1194 | strlen (reverse_pkey), | 1194 | &pubkey)) |
1195 | &pubkey)) | ||
1196 | { | 1195 | { |
1197 | fprintf (stderr, | 1196 | fprintf (stderr, |
1198 | _ ("Invalid public key for reverse lookup `%s'\n"), | 1197 | _ ("Invalid public key for reverse lookup `%s'\n"), |
@@ -1211,12 +1210,12 @@ run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
1211 | { | 1210 | { |
1212 | char sh[105]; | 1211 | char sh[105]; |
1213 | char sname[64]; | 1212 | char sname[64]; |
1214 | struct GNUNET_CRYPTO_EcdsaPublicKey pkey; | 1213 | struct GNUNET_IDENTITY_PublicKey pkey; |
1215 | 1214 | ||
1216 | GNUNET_STRINGS_utf8_tolower (uri, uri); | 1215 | GNUNET_STRINGS_utf8_tolower (uri, uri); |
1217 | if ((2 != (sscanf (uri, "gnunet://gns/%52s/%63s", sh, sname))) || | 1216 | if ((2 != (sscanf (uri, "gnunet://gns/%52s/%63s", sh, sname))) || |
1218 | (GNUNET_OK != | 1217 | (GNUNET_OK != |
1219 | GNUNET_CRYPTO_ecdsa_public_key_from_string (sh, strlen (sh), &pkey))) | 1218 | GNUNET_IDENTITY_public_key_from_string (sh, &pkey))) |
1220 | { | 1219 | { |
1221 | fprintf (stderr, _ ("Invalid URI `%s'\n"), uri); | 1220 | fprintf (stderr, _ ("Invalid URI `%s'\n"), uri); |
1222 | GNUNET_SCHEDULER_shutdown (); | 1221 | GNUNET_SCHEDULER_shutdown (); |
@@ -1242,8 +1241,8 @@ run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
1242 | } | 1241 | } |
1243 | memset (&rd, 0, sizeof(rd)); | 1242 | memset (&rd, 0, sizeof(rd)); |
1244 | rd.data = &pkey; | 1243 | rd.data = &pkey; |
1245 | rd.data_size = sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey); | 1244 | rd.data_size = GNUNET_IDENTITY_key_get_length (&pkey); |
1246 | rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY; | 1245 | rd.record_type = ntohl (pkey.type); |
1247 | rd.expiration_time = etime; | 1246 | rd.expiration_time = etime; |
1248 | if (GNUNET_YES == etime_is_rel) | 1247 | if (GNUNET_YES == etime_is_rel) |
1249 | rd.flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; | 1248 | rd.flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; |
@@ -1704,11 +1703,13 @@ main (int argc, char *const *argv) | |||
1704 | NULL))) | 1703 | NULL))) |
1705 | { | 1704 | { |
1706 | GNUNET_free_nz ((void *) argv); | 1705 | GNUNET_free_nz ((void *) argv); |
1707 | GNUNET_CRYPTO_ecdsa_key_clear (&zone_pkey); | 1706 | //FIXME |
1707 | //GNUNET_CRYPTO_ecdsa_key_clear (&zone_pkey); | ||
1708 | return lret; | 1708 | return lret; |
1709 | } | 1709 | } |
1710 | GNUNET_free_nz ((void *) argv); | 1710 | GNUNET_free_nz ((void *) argv); |
1711 | GNUNET_CRYPTO_ecdsa_key_clear (&zone_pkey); | 1711 | //FIXME |
1712 | //GNUNET_CRYPTO_ecdsa_key_clear (&zone_pkey); | ||
1712 | return ret; | 1713 | return ret; |
1713 | } | 1714 | } |
1714 | 1715 | ||
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index b24bb2952..d6774b37b 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -82,7 +82,7 @@ struct ZoneIteration | |||
82 | /** | 82 | /** |
83 | * Key of the zone we are iterating over. | 83 | * Key of the zone we are iterating over. |
84 | */ | 84 | */ |
85 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 85 | struct GNUNET_IDENTITY_PrivateKey zone; |
86 | 86 | ||
87 | /** | 87 | /** |
88 | * Last sequence number in the zone iteration used to address next | 88 | * Last sequence number in the zone iteration used to address next |
@@ -174,7 +174,7 @@ struct ZoneMonitor | |||
174 | /** | 174 | /** |
175 | * Private key of the zone. | 175 | * Private key of the zone. |
176 | */ | 176 | */ |
177 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 177 | struct GNUNET_IDENTITY_PrivateKey zone; |
178 | 178 | ||
179 | /** | 179 | /** |
180 | * Task active during initial iteration. | 180 | * Task active during initial iteration. |
@@ -314,7 +314,7 @@ struct NickCache | |||
314 | /** | 314 | /** |
315 | * Zone the cache entry is for. | 315 | * Zone the cache entry is for. |
316 | */ | 316 | */ |
317 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 317 | struct GNUNET_IDENTITY_PrivateKey zone; |
318 | 318 | ||
319 | /** | 319 | /** |
320 | * Cached record data. | 320 | * Cached record data. |
@@ -336,7 +336,7 @@ static struct NickCache nick_cache[NC_SIZE]; | |||
336 | /** | 336 | /** |
337 | * Public key of all zeros. | 337 | * Public key of all zeros. |
338 | */ | 338 | */ |
339 | static const struct GNUNET_CRYPTO_EcdsaPrivateKey zero; | 339 | static const struct GNUNET_IDENTITY_PrivateKey zero; |
340 | 340 | ||
341 | /** | 341 | /** |
342 | * Configuration handle. | 342 | * Configuration handle. |
@@ -481,7 +481,7 @@ free_store_activity (struct StoreActivity *sa) | |||
481 | static void | 481 | static void |
482 | lookup_nick_it (void *cls, | 482 | lookup_nick_it (void *cls, |
483 | uint64_t seq, | 483 | uint64_t seq, |
484 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key, | 484 | const struct GNUNET_IDENTITY_PrivateKey *private_key, |
485 | const char *label, | 485 | const char *label, |
486 | unsigned int rd_count, | 486 | unsigned int rd_count, |
487 | const struct GNUNET_GNSRECORD_Data *rd) | 487 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -521,7 +521,7 @@ lookup_nick_it (void *cls, | |||
521 | * @param nick nick entry to cache | 521 | * @param nick nick entry to cache |
522 | */ | 522 | */ |
523 | static void | 523 | static void |
524 | cache_nick (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 524 | cache_nick (const struct GNUNET_IDENTITY_PrivateKey *zone, |
525 | const struct GNUNET_GNSRECORD_Data *nick) | 525 | const struct GNUNET_GNSRECORD_Data *nick) |
526 | { | 526 | { |
527 | struct NickCache *oldest; | 527 | struct NickCache *oldest; |
@@ -564,9 +564,9 @@ cache_nick (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | |||
564 | * @return NULL if no NICK record was found | 564 | * @return NULL if no NICK record was found |
565 | */ | 565 | */ |
566 | static struct GNUNET_GNSRECORD_Data * | 566 | static struct GNUNET_GNSRECORD_Data * |
567 | get_nick_record (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone) | 567 | get_nick_record (const struct GNUNET_IDENTITY_PrivateKey *zone) |
568 | { | 568 | { |
569 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | 569 | struct GNUNET_IDENTITY_PublicKey pub; |
570 | struct GNUNET_GNSRECORD_Data *nick; | 570 | struct GNUNET_GNSRECORD_Data *nick; |
571 | int res; | 571 | int res; |
572 | 572 | ||
@@ -606,7 +606,7 @@ get_nick_record (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone) | |||
606 | __LINE__); | 606 | __LINE__); |
607 | if (1 == do_log) | 607 | if (1 == do_log) |
608 | { | 608 | { |
609 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &pub); | 609 | GNUNET_IDENTITY_key_get_public (zone, &pub); |
610 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, | 610 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
611 | "No nick name set for zone `%s'\n", | 611 | "No nick name set for zone `%s'\n", |
612 | GNUNET_GNSRECORD_z2s (&pub)); | 612 | GNUNET_GNSRECORD_z2s (&pub)); |
@@ -720,7 +720,7 @@ merge_with_nick_records (const struct GNUNET_GNSRECORD_Data *nick_rd, | |||
720 | static void | 720 | static void |
721 | send_lookup_response (struct NamestoreClient *nc, | 721 | send_lookup_response (struct NamestoreClient *nc, |
722 | uint32_t request_id, | 722 | uint32_t request_id, |
723 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 723 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
724 | const char *name, | 724 | const char *name, |
725 | unsigned int rd_count, | 725 | unsigned int rd_count, |
726 | const struct GNUNET_GNSRECORD_Data *rd) | 726 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -899,14 +899,14 @@ static void | |||
899 | refresh_block (struct NamestoreClient *nc, | 899 | refresh_block (struct NamestoreClient *nc, |
900 | struct ZoneIteration *zi, | 900 | struct ZoneIteration *zi, |
901 | uint32_t rid, | 901 | uint32_t rid, |
902 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 902 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
903 | const char *name, | 903 | const char *name, |
904 | unsigned int rd_count, | 904 | unsigned int rd_count, |
905 | const struct GNUNET_GNSRECORD_Data *rd) | 905 | const struct GNUNET_GNSRECORD_Data *rd) |
906 | { | 906 | { |
907 | struct GNUNET_GNSRECORD_Block *block; | 907 | struct GNUNET_GNSRECORD_Block *block; |
908 | struct CacheOperation *cop; | 908 | struct CacheOperation *cop; |
909 | struct GNUNET_CRYPTO_EcdsaPublicKey pkey; | 909 | struct GNUNET_IDENTITY_PublicKey pkey; |
910 | struct GNUNET_GNSRECORD_Data *nick; | 910 | struct GNUNET_GNSRECORD_Data *nick; |
911 | struct GNUNET_GNSRECORD_Data *res; | 911 | struct GNUNET_GNSRECORD_Data *res; |
912 | unsigned int res_count; | 912 | unsigned int res_count; |
@@ -946,7 +946,7 @@ refresh_block (struct NamestoreClient *nc, | |||
946 | block = | 946 | block = |
947 | GNUNET_GNSRECORD_block_create (zone_key, exp_time, name, res, res_count); | 947 | GNUNET_GNSRECORD_block_create (zone_key, exp_time, name, res, res_count); |
948 | GNUNET_assert (NULL != block); | 948 | GNUNET_assert (NULL != block); |
949 | GNUNET_CRYPTO_ecdsa_key_get_public (zone_key, &pkey); | 949 | GNUNET_IDENTITY_key_get_public (zone_key, &pkey); |
950 | GNUNET_log ( | 950 | GNUNET_log ( |
951 | GNUNET_ERROR_TYPE_DEBUG, | 951 | GNUNET_ERROR_TYPE_DEBUG, |
952 | "Caching block for label `%s' with %u records and expiration %s in zone `%s' in namecache\n", | 952 | "Caching block for label `%s' with %u records and expiration %s in zone `%s' in namecache\n", |
@@ -1214,7 +1214,7 @@ struct RecordLookupContext | |||
1214 | static void | 1214 | static void |
1215 | lookup_it (void *cls, | 1215 | lookup_it (void *cls, |
1216 | uint64_t seq, | 1216 | uint64_t seq, |
1217 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key, | 1217 | const struct GNUNET_IDENTITY_PrivateKey *private_key, |
1218 | const char *label, | 1218 | const char *label, |
1219 | unsigned int rd_count, | 1219 | unsigned int rd_count, |
1220 | const struct GNUNET_GNSRECORD_Data *rd) | 1220 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -1605,7 +1605,7 @@ struct ZoneToNameCtx | |||
1605 | static void | 1605 | static void |
1606 | handle_zone_to_name_it (void *cls, | 1606 | handle_zone_to_name_it (void *cls, |
1607 | uint64_t seq, | 1607 | uint64_t seq, |
1608 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 1608 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
1609 | const char *name, | 1609 | const char *name, |
1610 | unsigned int rd_count, | 1610 | unsigned int rd_count, |
1611 | const struct GNUNET_GNSRECORD_Data *rd) | 1611 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -1738,7 +1738,7 @@ struct ZoneIterationProcResult | |||
1738 | static void | 1738 | static void |
1739 | zone_iterate_proc (void *cls, | 1739 | zone_iterate_proc (void *cls, |
1740 | uint64_t seq, | 1740 | uint64_t seq, |
1741 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 1741 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
1742 | const char *name, | 1742 | const char *name, |
1743 | unsigned int rd_count, | 1743 | unsigned int rd_count, |
1744 | const struct GNUNET_GNSRECORD_Data *rd) | 1744 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -2009,7 +2009,7 @@ monitor_iteration_next (void *cls); | |||
2009 | static void | 2009 | static void |
2010 | monitor_iterate_cb (void *cls, | 2010 | monitor_iterate_cb (void *cls, |
2011 | uint64_t seq, | 2011 | uint64_t seq, |
2012 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 2012 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
2013 | const char *name, | 2013 | const char *name, |
2014 | unsigned int rd_count, | 2014 | unsigned int rd_count, |
2015 | const struct GNUNET_GNSRECORD_Data *rd) | 2015 | const struct GNUNET_GNSRECORD_Data *rd) |
diff --git a/src/namestore/gnunet-zoneimport.c b/src/namestore/gnunet-zoneimport.c index 5b4e41475..ce62b52d5 100644 --- a/src/namestore/gnunet-zoneimport.c +++ b/src/namestore/gnunet-zoneimport.c | |||
@@ -96,7 +96,7 @@ struct Zone | |||
96 | /** | 96 | /** |
97 | * Private key of the zone. | 97 | * Private key of the zone. |
98 | */ | 98 | */ |
99 | struct GNUNET_CRYPTO_EcdsaPrivateKey key; | 99 | struct GNUNET_IDENTITY_PrivateKey key; |
100 | }; | 100 | }; |
101 | 101 | ||
102 | 102 | ||
@@ -1405,7 +1405,7 @@ ns_lookup_error_cb (void *cls) | |||
1405 | */ | 1405 | */ |
1406 | static void | 1406 | static void |
1407 | ns_lookup_result_cb (void *cls, | 1407 | ns_lookup_result_cb (void *cls, |
1408 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 1408 | const struct GNUNET_IDENTITY_PrivateKey *key, |
1409 | const char *label, | 1409 | const char *label, |
1410 | unsigned int rd_count, | 1410 | unsigned int rd_count, |
1411 | const struct GNUNET_GNSRECORD_Data *rd) | 1411 | const struct GNUNET_GNSRECORD_Data *rd) |
diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h index 6f45ab1c1..fd9a8ed47 100644 --- a/src/namestore/namestore.h +++ b/src/namestore/namestore.h | |||
@@ -90,7 +90,7 @@ struct RecordStoreMessage | |||
90 | /** | 90 | /** |
91 | * The private key of the authority. | 91 | * The private key of the authority. |
92 | */ | 92 | */ |
93 | struct GNUNET_CRYPTO_EcdsaPrivateKey private_key; | 93 | struct GNUNET_IDENTITY_PrivateKey private_key; |
94 | 94 | ||
95 | /* followed by: | 95 | /* followed by: |
96 | * name with length name_len | 96 | * name with length name_len |
@@ -134,7 +134,7 @@ struct LabelLookupMessage | |||
134 | /** | 134 | /** |
135 | * The private key of the zone to look up in | 135 | * The private key of the zone to look up in |
136 | */ | 136 | */ |
137 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 137 | struct GNUNET_IDENTITY_PrivateKey zone; |
138 | 138 | ||
139 | /* followed by: | 139 | /* followed by: |
140 | * name with length name_len | 140 | * name with length name_len |
@@ -176,7 +176,7 @@ struct LabelLookupResponseMessage | |||
176 | /** | 176 | /** |
177 | * The private key of the authority. | 177 | * The private key of the authority. |
178 | */ | 178 | */ |
179 | struct GNUNET_CRYPTO_EcdsaPrivateKey private_key; | 179 | struct GNUNET_IDENTITY_PrivateKey private_key; |
180 | 180 | ||
181 | /* followed by: | 181 | /* followed by: |
182 | * name with length name_len | 182 | * name with length name_len |
@@ -198,12 +198,12 @@ struct ZoneToNameMessage | |||
198 | /** | 198 | /** |
199 | * The private key of the zone to look up in | 199 | * The private key of the zone to look up in |
200 | */ | 200 | */ |
201 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 201 | struct GNUNET_IDENTITY_PrivateKey zone; |
202 | 202 | ||
203 | /** | 203 | /** |
204 | * The public key of the target zone | 204 | * The public key of the target zone |
205 | */ | 205 | */ |
206 | struct GNUNET_CRYPTO_EcdsaPublicKey value_zone; | 206 | struct GNUNET_IDENTITY_PublicKey value_zone; |
207 | }; | 207 | }; |
208 | 208 | ||
209 | 209 | ||
@@ -241,7 +241,7 @@ struct ZoneToNameResponseMessage | |||
241 | /** | 241 | /** |
242 | * The private key of the zone that contained the name. | 242 | * The private key of the zone that contained the name. |
243 | */ | 243 | */ |
244 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 244 | struct GNUNET_IDENTITY_PrivateKey zone; |
245 | 245 | ||
246 | /* followed by: | 246 | /* followed by: |
247 | * name with length name_len | 247 | * name with length name_len |
@@ -283,7 +283,7 @@ struct RecordResultMessage | |||
283 | /** | 283 | /** |
284 | * The private key of the authority. | 284 | * The private key of the authority. |
285 | */ | 285 | */ |
286 | struct GNUNET_CRYPTO_EcdsaPrivateKey private_key; | 286 | struct GNUNET_IDENTITY_PrivateKey private_key; |
287 | 287 | ||
288 | /* followed by: | 288 | /* followed by: |
289 | * name with length name_len | 289 | * name with length name_len |
@@ -311,7 +311,7 @@ struct ZoneMonitorStartMessage | |||
311 | /** | 311 | /** |
312 | * Zone key. | 312 | * Zone key. |
313 | */ | 313 | */ |
314 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 314 | struct GNUNET_IDENTITY_PrivateKey zone; |
315 | }; | 315 | }; |
316 | 316 | ||
317 | 317 | ||
@@ -352,7 +352,7 @@ struct ZoneIterationStartMessage | |||
352 | /** | 352 | /** |
353 | * Zone key. All zeros for "all zones". | 353 | * Zone key. All zeros for "all zones". |
354 | */ | 354 | */ |
355 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 355 | struct GNUNET_IDENTITY_PrivateKey zone; |
356 | }; | 356 | }; |
357 | 357 | ||
358 | 358 | ||
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index f383f8b4a..c845b5019 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c | |||
@@ -174,7 +174,7 @@ struct GNUNET_NAMESTORE_ZoneIterator | |||
174 | /** | 174 | /** |
175 | * Private key of the zone. | 175 | * Private key of the zone. |
176 | */ | 176 | */ |
177 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 177 | struct GNUNET_IDENTITY_PrivateKey zone; |
178 | 178 | ||
179 | /** | 179 | /** |
180 | * The operation id this zone iteration operation has | 180 | * The operation id this zone iteration operation has |
@@ -493,7 +493,7 @@ handle_lookup_result (void *cls, const struct LabelLookupResponseMessage *msg) | |||
493 | static int | 493 | static int |
494 | check_record_result (void *cls, const struct RecordResultMessage *msg) | 494 | check_record_result (void *cls, const struct RecordResultMessage *msg) |
495 | { | 495 | { |
496 | static struct GNUNET_CRYPTO_EcdsaPrivateKey priv_dummy; | 496 | static struct GNUNET_IDENTITY_PrivateKey priv_dummy; |
497 | const char *name; | 497 | const char *name; |
498 | size_t msg_len; | 498 | size_t msg_len; |
499 | size_t name_len; | 499 | size_t name_len; |
@@ -981,7 +981,7 @@ warn_delay (void *cls) | |||
981 | struct GNUNET_NAMESTORE_QueueEntry * | 981 | struct GNUNET_NAMESTORE_QueueEntry * |
982 | GNUNET_NAMESTORE_records_store ( | 982 | GNUNET_NAMESTORE_records_store ( |
983 | struct GNUNET_NAMESTORE_Handle *h, | 983 | struct GNUNET_NAMESTORE_Handle *h, |
984 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 984 | const struct GNUNET_IDENTITY_PrivateKey *pkey, |
985 | const char *label, | 985 | const char *label, |
986 | unsigned int rd_count, | 986 | unsigned int rd_count, |
987 | const struct GNUNET_GNSRECORD_Data *rd, | 987 | const struct GNUNET_GNSRECORD_Data *rd, |
@@ -1080,7 +1080,7 @@ GNUNET_NAMESTORE_records_store ( | |||
1080 | struct GNUNET_NAMESTORE_QueueEntry * | 1080 | struct GNUNET_NAMESTORE_QueueEntry * |
1081 | GNUNET_NAMESTORE_records_lookup ( | 1081 | GNUNET_NAMESTORE_records_lookup ( |
1082 | struct GNUNET_NAMESTORE_Handle *h, | 1082 | struct GNUNET_NAMESTORE_Handle *h, |
1083 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 1083 | const struct GNUNET_IDENTITY_PrivateKey *pkey, |
1084 | const char *label, | 1084 | const char *label, |
1085 | GNUNET_SCHEDULER_TaskCallback error_cb, | 1085 | GNUNET_SCHEDULER_TaskCallback error_cb, |
1086 | void *error_cb_cls, | 1086 | void *error_cb_cls, |
@@ -1140,8 +1140,8 @@ GNUNET_NAMESTORE_records_lookup ( | |||
1140 | struct GNUNET_NAMESTORE_QueueEntry * | 1140 | struct GNUNET_NAMESTORE_QueueEntry * |
1141 | GNUNET_NAMESTORE_zone_to_name ( | 1141 | GNUNET_NAMESTORE_zone_to_name ( |
1142 | struct GNUNET_NAMESTORE_Handle *h, | 1142 | struct GNUNET_NAMESTORE_Handle *h, |
1143 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 1143 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
1144 | const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, | 1144 | const struct GNUNET_IDENTITY_PublicKey *value_zone, |
1145 | GNUNET_SCHEDULER_TaskCallback error_cb, | 1145 | GNUNET_SCHEDULER_TaskCallback error_cb, |
1146 | void *error_cb_cls, | 1146 | void *error_cb_cls, |
1147 | GNUNET_NAMESTORE_RecordMonitor proc, | 1147 | GNUNET_NAMESTORE_RecordMonitor proc, |
@@ -1196,7 +1196,7 @@ GNUNET_NAMESTORE_zone_to_name ( | |||
1196 | struct GNUNET_NAMESTORE_ZoneIterator * | 1196 | struct GNUNET_NAMESTORE_ZoneIterator * |
1197 | GNUNET_NAMESTORE_zone_iteration_start ( | 1197 | GNUNET_NAMESTORE_zone_iteration_start ( |
1198 | struct GNUNET_NAMESTORE_Handle *h, | 1198 | struct GNUNET_NAMESTORE_Handle *h, |
1199 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 1199 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
1200 | GNUNET_SCHEDULER_TaskCallback error_cb, | 1200 | GNUNET_SCHEDULER_TaskCallback error_cb, |
1201 | void *error_cb_cls, | 1201 | void *error_cb_cls, |
1202 | GNUNET_NAMESTORE_RecordMonitor proc, | 1202 | GNUNET_NAMESTORE_RecordMonitor proc, |
diff --git a/src/namestore/namestore_api_monitor.c b/src/namestore/namestore_api_monitor.c index 9dc955544..6670e54ce 100644 --- a/src/namestore/namestore_api_monitor.c +++ b/src/namestore/namestore_api_monitor.c | |||
@@ -82,7 +82,7 @@ struct GNUNET_NAMESTORE_ZoneMonitor | |||
82 | /** | 82 | /** |
83 | * Monitored zone. | 83 | * Monitored zone. |
84 | */ | 84 | */ |
85 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone; | 85 | struct GNUNET_IDENTITY_PrivateKey zone; |
86 | 86 | ||
87 | /** | 87 | /** |
88 | * Do we first iterate over all existing records? | 88 | * Do we first iterate over all existing records? |
@@ -302,7 +302,7 @@ reconnect (struct GNUNET_NAMESTORE_ZoneMonitor *zm) | |||
302 | struct GNUNET_NAMESTORE_ZoneMonitor * | 302 | struct GNUNET_NAMESTORE_ZoneMonitor * |
303 | GNUNET_NAMESTORE_zone_monitor_start ( | 303 | GNUNET_NAMESTORE_zone_monitor_start ( |
304 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 304 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
305 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 305 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
306 | int iterate_first, | 306 | int iterate_first, |
307 | GNUNET_SCHEDULER_TaskCallback error_cb, | 307 | GNUNET_SCHEDULER_TaskCallback error_cb, |
308 | void *error_cb_cls, | 308 | void *error_cb_cls, |
diff --git a/src/namestore/perf_namestore_api_zone_iteration.c b/src/namestore/perf_namestore_api_zone_iteration.c index c1012de62..f46a1c523 100644 --- a/src/namestore/perf_namestore_api_zone_iteration.c +++ b/src/namestore/perf_namestore_api_zone_iteration.c | |||
@@ -64,7 +64,7 @@ static struct GNUNET_SCHEDULER_Task *timeout_task; | |||
64 | 64 | ||
65 | static struct GNUNET_SCHEDULER_Task *t; | 65 | static struct GNUNET_SCHEDULER_Task *t; |
66 | 66 | ||
67 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 67 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
68 | 68 | ||
69 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; | 69 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; |
70 | 70 | ||
@@ -188,7 +188,7 @@ fail_cb (void *cls) | |||
188 | 188 | ||
189 | static void | 189 | static void |
190 | zone_proc (void *cls, | 190 | zone_proc (void *cls, |
191 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 191 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
192 | const char *label, | 192 | const char *label, |
193 | unsigned int rd_count, | 193 | unsigned int rd_count, |
194 | const struct GNUNET_GNSRECORD_Data *rd) | 194 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -341,7 +341,8 @@ run (void *cls, | |||
341 | NULL); | 341 | NULL); |
342 | nsh = GNUNET_NAMESTORE_connect (cfg); | 342 | nsh = GNUNET_NAMESTORE_connect (cfg); |
343 | GNUNET_assert (NULL != nsh); | 343 | GNUNET_assert (NULL != nsh); |
344 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 344 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
345 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); | ||
345 | start = GNUNET_TIME_absolute_get (); | 346 | start = GNUNET_TIME_absolute_get (); |
346 | t = GNUNET_SCHEDULER_add_now (&publish_record, | 347 | t = GNUNET_SCHEDULER_add_now (&publish_record, |
347 | NULL); | 348 | NULL); |
diff --git a/src/namestore/plugin_namestore_flat.c b/src/namestore/plugin_namestore_flat.c index 60b24df67..9ccc90cfd 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 | */ |
88 | static void | 88 | static void |
89 | hash_pkey_and_label (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, | 89 | hash_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) | |||
452 | static int | 452 | static int |
453 | namestore_flat_store_records (void *cls, | 453 | namestore_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 | */ |
518 | static int | 518 | static int |
519 | namestore_flat_lookup_records (void *cls, | 519 | namestore_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, | |||
647 | static int | 647 | static int |
648 | namestore_flat_iterate_records (void *cls, | 648 | namestore_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 | */ |
675 | struct ZoneToNameContext | 675 | struct 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 | ||
@@ -698,11 +698,14 @@ zone_to_name (void *cls, | |||
698 | 698 | ||
699 | for (unsigned int i = 0; i < entry->record_count; i++) | 699 | for (unsigned int i = 0; i < entry->record_count; i++) |
700 | { | 700 | { |
701 | if (GNUNET_GNSRECORD_TYPE_PKEY != entry->record_data[i].record_type) | 701 | if (GNUNET_NO == |
702 | GNUNET_GNSRECORD_is_zonekey_type (entry->record_data[i].record_type)) | ||
703 | continue; | ||
704 | if (ztn->value_zone->type != entry->record_data[i].record_type) | ||
702 | continue; | 705 | continue; |
703 | if (0 == memcmp (ztn->value_zone, | 706 | if (0 == memcmp (ztn->value_zone, |
704 | entry->record_data[i].data, | 707 | entry->record_data[i].data, |
705 | sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey))) | 708 | entry->record_data[i].data_size)) |
706 | { | 709 | { |
707 | ztn->iter (ztn->iter_cls, | 710 | ztn->iter (ztn->iter_cls, |
708 | i + 1, /* zero is illegal! */ | 711 | i + 1, /* zero is illegal! */ |
@@ -730,9 +733,9 @@ zone_to_name (void *cls, | |||
730 | */ | 733 | */ |
731 | static int | 734 | static int |
732 | namestore_flat_zone_to_name (void *cls, | 735 | namestore_flat_zone_to_name (void *cls, |
733 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 736 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
734 | const struct | 737 | const struct |
735 | GNUNET_CRYPTO_EcdsaPublicKey *value_zone, | 738 | GNUNET_IDENTITY_PublicKey *value_zone, |
736 | GNUNET_NAMESTORE_RecordIterator iter, | 739 | GNUNET_NAMESTORE_RecordIterator iter, |
737 | void *iter_cls) | 740 | void *iter_cls) |
738 | { | 741 | { |
diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c index 01dddde9e..bdbaf96b3 100644 --- a/src/namestore/plugin_namestore_postgres.c +++ b/src/namestore/plugin_namestore_postgres.c | |||
@@ -73,8 +73,7 @@ database_setup (struct Plugin *plugin) | |||
73 | " record_data BYTEA NOT NULL DEFAULT ''," | 73 | " record_data BYTEA NOT NULL DEFAULT ''," |
74 | " label TEXT NOT NULL DEFAULT ''," | 74 | " label TEXT NOT NULL DEFAULT ''," |
75 | " CONSTRAINT zl UNIQUE (zone_private_key,label)" | 75 | " CONSTRAINT zl UNIQUE (zone_private_key,label)" |
76 | ")" | 76 | ")"); |
77 | "WITH OIDS"); | ||
78 | struct GNUNET_PQ_ExecuteStatement es_default = | 77 | struct GNUNET_PQ_ExecuteStatement es_default = |
79 | GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS ns098records (" | 78 | GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS ns098records (" |
80 | " seq BIGSERIAL PRIMARY KEY," | 79 | " seq BIGSERIAL PRIMARY KEY," |
@@ -85,8 +84,7 @@ database_setup (struct Plugin *plugin) | |||
85 | " record_data BYTEA NOT NULL DEFAULT ''," | 84 | " record_data BYTEA NOT NULL DEFAULT ''," |
86 | " label TEXT NOT NULL DEFAULT ''," | 85 | " label TEXT NOT NULL DEFAULT ''," |
87 | " CONSTRAINT zl UNIQUE (zone_private_key,label)" | 86 | " CONSTRAINT zl UNIQUE (zone_private_key,label)" |
88 | ")" | 87 | ")"); |
89 | "WITH OIDS"); | ||
90 | const struct GNUNET_PQ_ExecuteStatement *cr; | 88 | const struct GNUNET_PQ_ExecuteStatement *cr; |
91 | struct GNUNET_PQ_ExecuteStatement sc = GNUNET_PQ_EXECUTE_STATEMENT_END; | 89 | struct GNUNET_PQ_ExecuteStatement sc = GNUNET_PQ_EXECUTE_STATEMENT_END; |
92 | 90 | ||
@@ -182,13 +180,13 @@ database_setup (struct Plugin *plugin) | |||
182 | static int | 180 | static int |
183 | namestore_postgres_store_records (void *cls, | 181 | namestore_postgres_store_records (void *cls, |
184 | const struct | 182 | const struct |
185 | GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 183 | GNUNET_IDENTITY_PrivateKey *zone_key, |
186 | const char *label, | 184 | const char *label, |
187 | unsigned int rd_count, | 185 | unsigned int rd_count, |
188 | const struct GNUNET_GNSRECORD_Data *rd) | 186 | const struct GNUNET_GNSRECORD_Data *rd) |
189 | { | 187 | { |
190 | struct Plugin *plugin = cls; | 188 | struct Plugin *plugin = cls; |
191 | struct GNUNET_CRYPTO_EcdsaPublicKey pkey; | 189 | struct GNUNET_IDENTITY_PublicKey pkey; |
192 | uint64_t rvalue; | 190 | uint64_t rvalue; |
193 | uint32_t rd_count32 = (uint32_t) rd_count; | 191 | uint32_t rd_count32 = (uint32_t) rd_count; |
194 | ssize_t data_size; | 192 | ssize_t data_size; |
@@ -197,13 +195,14 @@ namestore_postgres_store_records (void *cls, | |||
197 | 0, | 195 | 0, |
198 | sizeof(pkey)); | 196 | sizeof(pkey)); |
199 | for (unsigned int i = 0; i < rd_count; i++) | 197 | for (unsigned int i = 0; i < rd_count; i++) |
200 | if (GNUNET_GNSRECORD_TYPE_PKEY == rd[i].record_type) | 198 | if (GNUNET_YES == |
199 | GNUNET_GNSRECORD_is_zonekey_type (rd[i].record_type)) | ||
201 | { | 200 | { |
202 | GNUNET_break (sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) == | 201 | GNUNET_break (GNUNET_OK == |
203 | rd[i].data_size); | 202 | GNUNET_GNSRECORD_identity_from_data (rd[i].data, |
204 | GNUNET_memcpy (&pkey, | 203 | rd[i].data_size, |
205 | rd[i].data, | 204 | rd[i].record_type, |
206 | rd[i].data_size); | 205 | &pkey)); |
207 | break; | 206 | break; |
208 | } | 207 | } |
209 | rvalue = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, | 208 | rvalue = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, |
@@ -298,7 +297,7 @@ struct ParserContext | |||
298 | /** | 297 | /** |
299 | * Zone key, NULL if part of record. | 298 | * Zone key, NULL if part of record. |
300 | */ | 299 | */ |
301 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key; | 300 | const struct GNUNET_IDENTITY_PrivateKey *zone_key; |
302 | 301 | ||
303 | /** | 302 | /** |
304 | * Number of results still to return (counted down by | 303 | * Number of results still to return (counted down by |
@@ -332,7 +331,7 @@ parse_result_call_iterator (void *cls, | |||
332 | size_t data_size; | 331 | size_t data_size; |
333 | uint32_t record_count; | 332 | uint32_t record_count; |
334 | char *label; | 333 | char *label; |
335 | struct GNUNET_CRYPTO_EcdsaPrivateKey zk; | 334 | struct GNUNET_IDENTITY_PrivateKey zk; |
336 | struct GNUNET_PQ_ResultSpec rs_with_zone[] = { | 335 | struct GNUNET_PQ_ResultSpec rs_with_zone[] = { |
337 | GNUNET_PQ_result_spec_uint64 ("seq", &serial), | 336 | GNUNET_PQ_result_spec_uint64 ("seq", &serial), |
338 | GNUNET_PQ_result_spec_uint32 ("record_count", &record_count), | 337 | GNUNET_PQ_result_spec_uint32 ("record_count", &record_count), |
@@ -409,7 +408,7 @@ parse_result_call_iterator (void *cls, | |||
409 | static int | 408 | static int |
410 | namestore_postgres_lookup_records (void *cls, | 409 | namestore_postgres_lookup_records (void *cls, |
411 | const struct | 410 | const struct |
412 | GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 411 | GNUNET_IDENTITY_PrivateKey *zone, |
413 | const char *label, | 412 | const char *label, |
414 | GNUNET_NAMESTORE_RecordIterator iter, | 413 | GNUNET_NAMESTORE_RecordIterator iter, |
415 | void *iter_cls) | 414 | void *iter_cls) |
@@ -459,7 +458,7 @@ namestore_postgres_lookup_records (void *cls, | |||
459 | static int | 458 | static int |
460 | namestore_postgres_iterate_records (void *cls, | 459 | namestore_postgres_iterate_records (void *cls, |
461 | const struct | 460 | const struct |
462 | GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 461 | GNUNET_IDENTITY_PrivateKey *zone, |
463 | uint64_t serial, | 462 | uint64_t serial, |
464 | uint64_t limit, | 463 | uint64_t limit, |
465 | GNUNET_NAMESTORE_RecordIterator iter, | 464 | GNUNET_NAMESTORE_RecordIterator iter, |
@@ -526,9 +525,9 @@ namestore_postgres_iterate_records (void *cls, | |||
526 | static int | 525 | static int |
527 | namestore_postgres_zone_to_name (void *cls, | 526 | namestore_postgres_zone_to_name (void *cls, |
528 | const struct | 527 | const struct |
529 | GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 528 | GNUNET_IDENTITY_PrivateKey *zone, |
530 | const struct | 529 | const struct |
531 | GNUNET_CRYPTO_EcdsaPublicKey *value_zone, | 530 | GNUNET_IDENTITY_PublicKey *value_zone, |
532 | GNUNET_NAMESTORE_RecordIterator iter, | 531 | GNUNET_NAMESTORE_RecordIterator iter, |
533 | void *iter_cls) | 532 | void *iter_cls) |
534 | { | 533 | { |
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index 45fb782f7..7cb9b7ed0 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c | |||
@@ -314,14 +314,14 @@ database_shutdown (struct Plugin *plugin) | |||
314 | static int | 314 | static int |
315 | namestore_sqlite_store_records (void *cls, | 315 | namestore_sqlite_store_records (void *cls, |
316 | const struct | 316 | const struct |
317 | GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 317 | GNUNET_IDENTITY_PrivateKey *zone_key, |
318 | const char *label, | 318 | const char *label, |
319 | unsigned int rd_count, | 319 | unsigned int rd_count, |
320 | const struct GNUNET_GNSRECORD_Data *rd) | 320 | const struct GNUNET_GNSRECORD_Data *rd) |
321 | { | 321 | { |
322 | struct Plugin *plugin = cls; | 322 | struct Plugin *plugin = cls; |
323 | int n; | 323 | int n; |
324 | struct GNUNET_CRYPTO_EcdsaPublicKey pkey; | 324 | struct GNUNET_IDENTITY_PublicKey pkey; |
325 | uint64_t rvalue; | 325 | uint64_t rvalue; |
326 | ssize_t data_size; | 326 | ssize_t data_size; |
327 | 327 | ||
@@ -329,13 +329,13 @@ namestore_sqlite_store_records (void *cls, | |||
329 | 0, | 329 | 0, |
330 | sizeof(pkey)); | 330 | sizeof(pkey)); |
331 | for (unsigned int i = 0; i < rd_count; i++) | 331 | for (unsigned int i = 0; i < rd_count; i++) |
332 | if (GNUNET_GNSRECORD_TYPE_PKEY == rd[i].record_type) | 332 | if (GNUNET_YES == GNUNET_GNSRECORD_is_zonekey_type (rd[i].record_type)) |
333 | { | 333 | { |
334 | GNUNET_break (sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) == | 334 | GNUNET_break (GNUNET_YES == |
335 | rd[i].data_size); | 335 | GNUNET_GNSRECORD_identity_from_data (rd[i].data, |
336 | GNUNET_memcpy (&pkey, | 336 | rd[i].data_size, |
337 | rd[i].data, | 337 | rd[i].record_type, |
338 | rd[i].data_size); | 338 | &pkey)); |
339 | break; | 339 | break; |
340 | } | 340 | } |
341 | rvalue = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, | 341 | rvalue = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, |
@@ -461,7 +461,7 @@ static int | |||
461 | get_records_and_call_iterator (struct Plugin *plugin, | 461 | get_records_and_call_iterator (struct Plugin *plugin, |
462 | sqlite3_stmt *stmt, | 462 | sqlite3_stmt *stmt, |
463 | const struct | 463 | const struct |
464 | GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 464 | GNUNET_IDENTITY_PrivateKey *zone_key, |
465 | uint64_t limit, | 465 | uint64_t limit, |
466 | GNUNET_NAMESTORE_RecordIterator iter, | 466 | GNUNET_NAMESTORE_RecordIterator iter, |
467 | void *iter_cls) | 467 | void *iter_cls) |
@@ -496,7 +496,7 @@ get_records_and_call_iterator (struct Plugin *plugin, | |||
496 | size_t data_size; | 496 | size_t data_size; |
497 | void *data; | 497 | void *data; |
498 | char *label; | 498 | char *label; |
499 | struct GNUNET_CRYPTO_EcdsaPrivateKey zk; | 499 | struct GNUNET_IDENTITY_PrivateKey zk; |
500 | struct GNUNET_SQ_ResultSpec rs[] = { | 500 | struct GNUNET_SQ_ResultSpec rs[] = { |
501 | GNUNET_SQ_result_spec_uint64 (&seq), | 501 | GNUNET_SQ_result_spec_uint64 (&seq), |
502 | GNUNET_SQ_result_spec_uint32 (&record_count), | 502 | GNUNET_SQ_result_spec_uint32 (&record_count), |
@@ -578,7 +578,7 @@ get_records_and_call_iterator (struct Plugin *plugin, | |||
578 | static int | 578 | static int |
579 | namestore_sqlite_lookup_records (void *cls, | 579 | namestore_sqlite_lookup_records (void *cls, |
580 | const struct | 580 | const struct |
581 | GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 581 | GNUNET_IDENTITY_PrivateKey *zone, |
582 | const char *label, | 582 | const char *label, |
583 | GNUNET_NAMESTORE_RecordIterator iter, | 583 | GNUNET_NAMESTORE_RecordIterator iter, |
584 | void *iter_cls) | 584 | void *iter_cls) |
@@ -629,7 +629,7 @@ namestore_sqlite_lookup_records (void *cls, | |||
629 | static int | 629 | static int |
630 | namestore_sqlite_iterate_records (void *cls, | 630 | namestore_sqlite_iterate_records (void *cls, |
631 | const struct | 631 | const struct |
632 | GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 632 | GNUNET_IDENTITY_PrivateKey *zone, |
633 | uint64_t serial, | 633 | uint64_t serial, |
634 | uint64_t limit, | 634 | uint64_t limit, |
635 | GNUNET_NAMESTORE_RecordIterator iter, | 635 | GNUNET_NAMESTORE_RecordIterator iter, |
@@ -695,9 +695,9 @@ namestore_sqlite_iterate_records (void *cls, | |||
695 | */ | 695 | */ |
696 | static int | 696 | static int |
697 | namestore_sqlite_zone_to_name (void *cls, | 697 | namestore_sqlite_zone_to_name (void *cls, |
698 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 698 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
699 | const struct | 699 | const struct |
700 | GNUNET_CRYPTO_EcdsaPublicKey *value_zone, | 700 | GNUNET_IDENTITY_PublicKey *value_zone, |
701 | GNUNET_NAMESTORE_RecordIterator iter, | 701 | GNUNET_NAMESTORE_RecordIterator iter, |
702 | void *iter_cls) | 702 | void *iter_cls) |
703 | { | 703 | { |
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c index 9354b9896..edcbeb874 100644 --- a/src/namestore/plugin_rest_namestore.c +++ b/src/namestore/plugin_rest_namestore.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include "gnunet_namestore_service.h" | 30 | #include "gnunet_namestore_service.h" |
31 | #include "gnunet_identity_service.h" | 31 | #include "gnunet_identity_service.h" |
32 | #include "gnunet_rest_lib.h" | 32 | #include "gnunet_rest_lib.h" |
33 | #include "gnunet_json_lib.h" | 33 | #include "gnunet_gnsrecord_json_lib.h" |
34 | #include "microhttpd.h" | 34 | #include "microhttpd.h" |
35 | #include <jansson.h> | 35 | #include <jansson.h> |
36 | 36 | ||
@@ -214,7 +214,7 @@ struct RequestHandle | |||
214 | /** | 214 | /** |
215 | * Private key for the zone | 215 | * Private key for the zone |
216 | */ | 216 | */ |
217 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_pkey; | 217 | const struct GNUNET_IDENTITY_PrivateKey *zone_pkey; |
218 | 218 | ||
219 | /** | 219 | /** |
220 | * IDENTITY Operation | 220 | * IDENTITY Operation |
@@ -510,7 +510,7 @@ namestore_list_finished (void *cls) | |||
510 | */ | 510 | */ |
511 | static void | 511 | static void |
512 | namestore_list_iteration (void *cls, | 512 | namestore_list_iteration (void *cls, |
513 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 513 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
514 | const char *rname, | 514 | const char *rname, |
515 | unsigned int rd_len, | 515 | unsigned int rd_len, |
516 | const struct GNUNET_GNSRECORD_Data *rd) | 516 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -535,9 +535,9 @@ namestore_list_iteration (void *cls, | |||
535 | /** Only add if not empty **/ | 535 | /** Only add if not empty **/ |
536 | if (j > 0) | 536 | if (j > 0) |
537 | { | 537 | { |
538 | record_obj = GNUNET_JSON_from_gnsrecord (rname, | 538 | record_obj = GNUNET_GNSRECORD_JSON_from_gnsrecord (rname, |
539 | rd_filtered, | 539 | rd_filtered, |
540 | j); | 540 | j); |
541 | json_array_append_new (handle->resp_object, record_obj); | 541 | json_array_append_new (handle->resp_object, record_obj); |
542 | } | 542 | } |
543 | GNUNET_NAMESTORE_zone_iterator_next (handle->list_it, 1); | 543 | GNUNET_NAMESTORE_zone_iterator_next (handle->list_it, 1); |
@@ -561,7 +561,7 @@ ns_lookup_error_cb (void *cls) | |||
561 | 561 | ||
562 | static void | 562 | static void |
563 | ns_get_lookup_cb (void *cls, | 563 | ns_get_lookup_cb (void *cls, |
564 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 564 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
565 | const char *label, | 565 | const char *label, |
566 | unsigned int rd_len, | 566 | unsigned int rd_len, |
567 | const struct GNUNET_GNSRECORD_Data *rd) | 567 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -587,9 +587,9 @@ ns_get_lookup_cb (void *cls, | |||
587 | /** Only add if not empty **/ | 587 | /** Only add if not empty **/ |
588 | if (j > 0) | 588 | if (j > 0) |
589 | { | 589 | { |
590 | record_obj = GNUNET_JSON_from_gnsrecord (label, | 590 | record_obj = GNUNET_GNSRECORD_JSON_from_gnsrecord (label, |
591 | rd_filtered, | 591 | rd_filtered, |
592 | j); | 592 | j); |
593 | json_array_append_new (handle->resp_object, record_obj); | 593 | json_array_append_new (handle->resp_object, record_obj); |
594 | } | 594 | } |
595 | GNUNET_SCHEDULER_add_now (&namestore_list_finished, handle); | 595 | GNUNET_SCHEDULER_add_now (&namestore_list_finished, handle); |
@@ -689,7 +689,7 @@ namestore_get (struct GNUNET_REST_RequestHandle *con_handle, | |||
689 | 689 | ||
690 | static void | 690 | static void |
691 | ns_lookup_cb (void *cls, | 691 | ns_lookup_cb (void *cls, |
692 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 692 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
693 | const char *label, | 693 | const char *label, |
694 | unsigned int rd_count, | 694 | unsigned int rd_count, |
695 | const struct GNUNET_GNSRECORD_Data *rd) | 695 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -755,7 +755,7 @@ namestore_add_or_update (struct GNUNET_REST_RequestHandle *con_handle, | |||
755 | handle->rest_handle->data_size); | 755 | handle->rest_handle->data_size); |
756 | data_js = json_loads (term_data, JSON_DECODE_ANY, &err); | 756 | data_js = json_loads (term_data, JSON_DECODE_ANY, &err); |
757 | struct GNUNET_JSON_Specification gnsspec[] = | 757 | struct GNUNET_JSON_Specification gnsspec[] = |
758 | { GNUNET_JSON_spec_gnsrecord (&handle->rd, &handle->rd_count, | 758 | { GNUNET_GNSRECORD_JSON_spec_gnsrecord (&handle->rd, &handle->rd_count, |
759 | &handle->record_name), | 759 | &handle->record_name), |
760 | GNUNET_JSON_spec_end () }; | 760 | GNUNET_JSON_spec_end () }; |
761 | if (GNUNET_OK != GNUNET_JSON_parse (data_js, gnsspec, NULL, NULL)) | 761 | if (GNUNET_OK != GNUNET_JSON_parse (data_js, gnsspec, NULL, NULL)) |
@@ -946,7 +946,7 @@ list_ego (void *cls, | |||
946 | const char *identifier) | 946 | const char *identifier) |
947 | { | 947 | { |
948 | struct EgoEntry *ego_entry; | 948 | struct EgoEntry *ego_entry; |
949 | struct GNUNET_CRYPTO_EcdsaPublicKey pk; | 949 | struct GNUNET_IDENTITY_PublicKey pk; |
950 | 950 | ||
951 | if ((NULL == ego) && (ID_REST_STATE_INIT == state)) | 951 | if ((NULL == ego) && (ID_REST_STATE_INIT == state)) |
952 | { | 952 | { |
@@ -957,7 +957,7 @@ list_ego (void *cls, | |||
957 | { | 957 | { |
958 | ego_entry = GNUNET_new (struct EgoEntry); | 958 | ego_entry = GNUNET_new (struct EgoEntry); |
959 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); | 959 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); |
960 | ego_entry->keystring = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | 960 | ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); |
961 | ego_entry->ego = ego; | 961 | ego_entry->ego = ego; |
962 | ego_entry->identifier = GNUNET_strdup (identifier); | 962 | ego_entry->identifier = GNUNET_strdup (identifier); |
963 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, | 963 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, |
@@ -983,7 +983,7 @@ list_ego (void *cls, | |||
983 | /* Add */ | 983 | /* Add */ |
984 | ego_entry = GNUNET_new (struct EgoEntry); | 984 | ego_entry = GNUNET_new (struct EgoEntry); |
985 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); | 985 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); |
986 | ego_entry->keystring = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | 986 | ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); |
987 | ego_entry->ego = ego; | 987 | ego_entry->ego = ego; |
988 | ego_entry->identifier = GNUNET_strdup (identifier); | 988 | ego_entry->identifier = GNUNET_strdup (identifier); |
989 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, | 989 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, |
diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c index 14fe7fc70..6ce969c9b 100644 --- a/src/namestore/test_namestore_api_lookup_nick.c +++ b/src/namestore/test_namestore_api_lookup_nick.c | |||
@@ -41,9 +41,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
41 | 41 | ||
42 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 42 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 44 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
45 | 45 | ||
46 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 46 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
47 | 47 | ||
48 | static int res; | 48 | static int res; |
49 | 49 | ||
@@ -98,7 +98,7 @@ end (void *cls) | |||
98 | 98 | ||
99 | static void | 99 | static void |
100 | lookup_it (void *cls, | 100 | lookup_it (void *cls, |
101 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 101 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
102 | const char *label, | 102 | const char *label, |
103 | unsigned int rd_count, | 103 | unsigned int rd_count, |
104 | const struct GNUNET_GNSRECORD_Data *rd) | 104 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -288,8 +288,9 @@ run (void *cls, | |||
288 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 288 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
289 | &endbadly, | 289 | &endbadly, |
290 | NULL); | 290 | NULL); |
291 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 291 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
292 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 292 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
293 | GNUNET_IDENTITY_key_get_public (&privkey, | ||
293 | &pubkey); | 294 | &pubkey); |
294 | 295 | ||
295 | nsh = GNUNET_NAMESTORE_connect (cfg); | 296 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_lookup_private.c b/src/namestore/test_namestore_api_lookup_private.c index d0ad726cc..67cf54582 100644 --- a/src/namestore/test_namestore_api_lookup_private.c +++ b/src/namestore/test_namestore_api_lookup_private.c | |||
@@ -38,9 +38,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
38 | 38 | ||
39 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 39 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
40 | 40 | ||
41 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 41 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
42 | 42 | ||
43 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 43 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
44 | 44 | ||
45 | static int res; | 45 | static int res; |
46 | 46 | ||
@@ -91,7 +91,7 @@ end (void *cls) | |||
91 | 91 | ||
92 | static void | 92 | static void |
93 | lookup_it (void *cls, | 93 | lookup_it (void *cls, |
94 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 94 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
95 | const char *label, | 95 | const char *label, |
96 | unsigned int rd_count, | 96 | unsigned int rd_count, |
97 | const struct GNUNET_GNSRECORD_Data *rd) | 97 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -187,8 +187,9 @@ run (void *cls, | |||
187 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 187 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
188 | &endbadly, | 188 | &endbadly, |
189 | NULL); | 189 | NULL); |
190 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 190 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
191 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, &pubkey); | 191 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
192 | GNUNET_IDENTITY_key_get_public (&privkey, &pubkey); | ||
192 | 193 | ||
193 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; | 194 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; |
194 | rd.record_type = TEST_RECORD_TYPE; | 195 | rd.record_type = TEST_RECORD_TYPE; |
diff --git a/src/namestore/test_namestore_api_lookup_public.c b/src/namestore/test_namestore_api_lookup_public.c index 039c7cbf6..5e3e7bbd8 100644 --- a/src/namestore/test_namestore_api_lookup_public.c +++ b/src/namestore/test_namestore_api_lookup_public.c | |||
@@ -42,9 +42,9 @@ static struct GNUNET_NAMECACHE_Handle *nch; | |||
42 | 42 | ||
43 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 43 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
44 | 44 | ||
45 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 45 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
46 | 46 | ||
47 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 47 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
48 | 48 | ||
49 | static int res; | 49 | static int res; |
50 | 50 | ||
@@ -163,7 +163,7 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
163 | { | 163 | { |
164 | const char *name = cls; | 164 | const char *name = cls; |
165 | struct GNUNET_HashCode derived_hash; | 165 | struct GNUNET_HashCode derived_hash; |
166 | struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 166 | struct GNUNET_IDENTITY_PublicKey pubkey; |
167 | 167 | ||
168 | nsqe = NULL; | 168 | nsqe = NULL; |
169 | GNUNET_assert (NULL != cls); | 169 | GNUNET_assert (NULL != cls); |
@@ -173,8 +173,8 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
173 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); | 173 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); |
174 | 174 | ||
175 | /* Create derived hash */ | 175 | /* Create derived hash */ |
176 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 176 | GNUNET_IDENTITY_key_get_public (&privkey, |
177 | &pubkey); | 177 | &pubkey); |
178 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, name, &derived_hash); | 178 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, name, &derived_hash); |
179 | 179 | ||
180 | ncqe = GNUNET_NAMECACHE_lookup_block (nch, &derived_hash, | 180 | ncqe = GNUNET_NAMECACHE_lookup_block (nch, &derived_hash, |
@@ -193,9 +193,10 @@ run (void *cls, | |||
193 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 193 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
194 | &endbadly, | 194 | &endbadly, |
195 | NULL); | 195 | NULL); |
196 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 196 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
197 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 197 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
198 | &pubkey); | 198 | GNUNET_IDENTITY_key_get_public (&privkey, |
199 | &pubkey); | ||
199 | 200 | ||
200 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; | 201 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; |
201 | rd.record_type = TEST_RECORD_TYPE; | 202 | rd.record_type = TEST_RECORD_TYPE; |
diff --git a/src/namestore/test_namestore_api_lookup_shadow.c b/src/namestore/test_namestore_api_lookup_shadow.c index d399d903a..79fa4c9c6 100644 --- a/src/namestore/test_namestore_api_lookup_shadow.c +++ b/src/namestore/test_namestore_api_lookup_shadow.c | |||
@@ -44,9 +44,9 @@ static struct GNUNET_NAMECACHE_Handle *nch; | |||
44 | 44 | ||
45 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 45 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
46 | 46 | ||
47 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 47 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
48 | 48 | ||
49 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 49 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
50 | 50 | ||
51 | static int res; | 51 | static int res; |
52 | 52 | ||
@@ -195,7 +195,7 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
195 | { | 195 | { |
196 | const char *name = cls; | 196 | const char *name = cls; |
197 | struct GNUNET_HashCode derived_hash; | 197 | struct GNUNET_HashCode derived_hash; |
198 | struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 198 | struct GNUNET_IDENTITY_PublicKey pubkey; |
199 | 199 | ||
200 | nsqe = NULL; | 200 | nsqe = NULL; |
201 | GNUNET_assert (NULL != cls); | 201 | GNUNET_assert (NULL != cls); |
@@ -205,8 +205,8 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
205 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); | 205 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); |
206 | 206 | ||
207 | /* Create derived hash */ | 207 | /* Create derived hash */ |
208 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 208 | GNUNET_IDENTITY_key_get_public (&privkey, |
209 | &pubkey); | 209 | &pubkey); |
210 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, | 210 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, |
211 | name, | 211 | name, |
212 | &derived_hash); | 212 | &derived_hash); |
@@ -228,9 +228,10 @@ run (void *cls, | |||
228 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 228 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
229 | &endbadly, | 229 | &endbadly, |
230 | NULL); | 230 | NULL); |
231 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 231 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
232 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 232 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
233 | &pubkey); | 233 | GNUNET_IDENTITY_key_get_public (&privkey, |
234 | &pubkey); | ||
234 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; | 235 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; |
235 | rd.record_type = TEST_RECORD_TYPE; | 236 | rd.record_type = TEST_RECORD_TYPE; |
236 | rd.data_size = TEST_RECORD_DATALEN; | 237 | rd.data_size = TEST_RECORD_DATALEN; |
diff --git a/src/namestore/test_namestore_api_lookup_shadow_filter.c b/src/namestore/test_namestore_api_lookup_shadow_filter.c index 40dbeb90f..4fc197750 100644 --- a/src/namestore/test_namestore_api_lookup_shadow_filter.c +++ b/src/namestore/test_namestore_api_lookup_shadow_filter.c | |||
@@ -48,9 +48,9 @@ static struct GNUNET_SCHEDULER_Task *endbadly_task; | |||
48 | 48 | ||
49 | static struct GNUNET_SCHEDULER_Task *delayed_lookup_task; | 49 | static struct GNUNET_SCHEDULER_Task *delayed_lookup_task; |
50 | 50 | ||
51 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 51 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
52 | 52 | ||
53 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 53 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
54 | 54 | ||
55 | static int res; | 55 | static int res; |
56 | 56 | ||
@@ -66,7 +66,7 @@ static struct GNUNET_TIME_Absolute record_expiration; | |||
66 | 66 | ||
67 | static struct GNUNET_HashCode derived_hash; | 67 | static struct GNUNET_HashCode derived_hash; |
68 | 68 | ||
69 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 69 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
70 | 70 | ||
71 | 71 | ||
72 | static void | 72 | static void |
@@ -267,8 +267,8 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
267 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); | 267 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); |
268 | 268 | ||
269 | /* Create derived hash */ | 269 | /* Create derived hash */ |
270 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 270 | GNUNET_IDENTITY_key_get_public (&privkey, |
271 | &pubkey); | 271 | &pubkey); |
272 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, TEST_NAME, &derived_hash); | 272 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, TEST_NAME, &derived_hash); |
273 | 273 | ||
274 | if (0 == GNUNET_TIME_absolute_get_remaining (record_expiration).rel_value_us) | 274 | if (0 == GNUNET_TIME_absolute_get_remaining (record_expiration).rel_value_us) |
@@ -297,9 +297,10 @@ run (void *cls, | |||
297 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 297 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
298 | &endbadly, | 298 | &endbadly, |
299 | NULL); | 299 | NULL); |
300 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 300 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
301 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 301 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
302 | &pubkey); | 302 | GNUNET_IDENTITY_key_get_public (&privkey, |
303 | &pubkey); | ||
303 | 304 | ||
304 | record_expiration = GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (), | 305 | record_expiration = GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (), |
305 | EXPIRATION); | 306 | EXPIRATION); |
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c index 3f1be1403..df0c38608 100644 --- a/src/namestore/test_namestore_api_monitoring.c +++ b/src/namestore/test_namestore_api_monitoring.c | |||
@@ -37,9 +37,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
37 | 37 | ||
38 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 38 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
39 | 39 | ||
40 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 40 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey2; | 42 | static struct GNUNET_IDENTITY_PrivateKey privkey2; |
43 | 43 | ||
44 | static struct GNUNET_NAMESTORE_ZoneMonitor *zm; | 44 | static struct GNUNET_NAMESTORE_ZoneMonitor *zm; |
45 | 45 | ||
@@ -133,7 +133,7 @@ end (void *cls) | |||
133 | 133 | ||
134 | static void | 134 | static void |
135 | zone_proc (void *cls, | 135 | zone_proc (void *cls, |
136 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 136 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
137 | const char *name, | 137 | const char *name, |
138 | unsigned int rd_count, | 138 | unsigned int rd_count, |
139 | const struct GNUNET_GNSRECORD_Data *rd) | 139 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -273,7 +273,8 @@ run (void *cls, | |||
273 | struct GNUNET_TESTING_Peer *peer) | 273 | struct GNUNET_TESTING_Peer *peer) |
274 | { | 274 | { |
275 | res = 1; | 275 | res = 1; |
276 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 276 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
277 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); | ||
277 | /* Start monitoring */ | 278 | /* Start monitoring */ |
278 | zm = GNUNET_NAMESTORE_zone_monitor_start (cfg, | 279 | zm = GNUNET_NAMESTORE_zone_monitor_start (cfg, |
279 | &privkey, | 280 | &privkey, |
@@ -304,7 +305,8 @@ run (void *cls, | |||
304 | return; | 305 | return; |
305 | } | 306 | } |
306 | 307 | ||
307 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2); | 308 | privkey2.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
309 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2.ecdsa_key); | ||
308 | 310 | ||
309 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 311 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
310 | "Created record 3\n"); | 312 | "Created record 3\n"); |
diff --git a/src/namestore/test_namestore_api_monitoring_existing.c b/src/namestore/test_namestore_api_monitoring_existing.c index 728fcc25e..366f5739f 100644 --- a/src/namestore/test_namestore_api_monitoring_existing.c +++ b/src/namestore/test_namestore_api_monitoring_existing.c | |||
@@ -38,9 +38,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
38 | 38 | ||
39 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 39 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
40 | 40 | ||
41 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 41 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
42 | 42 | ||
43 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey2; | 43 | static struct GNUNET_IDENTITY_PrivateKey privkey2; |
44 | 44 | ||
45 | static struct GNUNET_NAMESTORE_ZoneMonitor *zm; | 45 | static struct GNUNET_NAMESTORE_ZoneMonitor *zm; |
46 | 46 | ||
@@ -129,7 +129,7 @@ end (void *cls) | |||
129 | 129 | ||
130 | static void | 130 | static void |
131 | zone_proc (void *cls, | 131 | zone_proc (void *cls, |
132 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 132 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
133 | const char *name, | 133 | const char *name, |
134 | unsigned int rd_count, | 134 | unsigned int rd_count, |
135 | const struct GNUNET_GNSRECORD_Data *rd) | 135 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -302,8 +302,10 @@ run (void *cls, | |||
302 | struct GNUNET_TESTING_Peer *peer) | 302 | struct GNUNET_TESTING_Peer *peer) |
303 | { | 303 | { |
304 | res = 1; | 304 | res = 1; |
305 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 305 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
306 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2); | 306 | privkey2.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
307 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); | ||
308 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2.ecdsa_key); | ||
307 | 309 | ||
308 | cfg = mycfg; | 310 | cfg = mycfg; |
309 | GNUNET_SCHEDULER_add_shutdown (&end, | 311 | GNUNET_SCHEDULER_add_shutdown (&end, |
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index e575821e8..b6254e531 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -39,9 +39,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
39 | 39 | ||
40 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 40 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 42 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 44 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
45 | 45 | ||
46 | static int res; | 46 | static int res; |
47 | 47 | ||
@@ -158,9 +158,10 @@ run (void *cls, | |||
158 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 158 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
159 | &endbadly, | 159 | &endbadly, |
160 | NULL); | 160 | NULL); |
161 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 161 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
162 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 162 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
163 | &pubkey); | 163 | GNUNET_IDENTITY_key_get_public (&privkey, |
164 | &pubkey); | ||
164 | 165 | ||
165 | removed = GNUNET_NO; | 166 | removed = GNUNET_NO; |
166 | 167 | ||
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c index 75e1cc3ed..e66992909 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c | |||
@@ -38,9 +38,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
38 | 38 | ||
39 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 39 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
40 | 40 | ||
41 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 41 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
42 | 42 | ||
43 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 43 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
44 | 44 | ||
45 | static int res; | 45 | static int res; |
46 | 46 | ||
@@ -132,8 +132,9 @@ run (void *cls, | |||
132 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 132 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
133 | &endbadly, | 133 | &endbadly, |
134 | NULL); | 134 | NULL); |
135 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 135 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
136 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, &pubkey); | 136 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
137 | GNUNET_IDENTITY_key_get_public (&privkey, &pubkey); | ||
137 | 138 | ||
138 | nsh = GNUNET_NAMESTORE_connect (cfg); | 139 | nsh = GNUNET_NAMESTORE_connect (cfg); |
139 | GNUNET_break (NULL != nsh); | 140 | GNUNET_break (NULL != nsh); |
diff --git a/src/namestore/test_namestore_api_store.c b/src/namestore/test_namestore_api_store.c index 9223b56a3..e0b7daa5d 100644 --- a/src/namestore/test_namestore_api_store.c +++ b/src/namestore/test_namestore_api_store.c | |||
@@ -39,9 +39,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
39 | 39 | ||
40 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 40 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 42 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 44 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
45 | 45 | ||
46 | static int res; | 46 | static int res; |
47 | 47 | ||
@@ -113,8 +113,9 @@ run (void *cls, | |||
113 | 113 | ||
114 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 114 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
115 | &endbadly, NULL); | 115 | &endbadly, NULL); |
116 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 116 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
117 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, &pubkey); | 117 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
118 | GNUNET_IDENTITY_key_get_public (&privkey, &pubkey); | ||
118 | 119 | ||
119 | 120 | ||
120 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; | 121 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; |
diff --git a/src/namestore/test_namestore_api_store_update.c b/src/namestore/test_namestore_api_store_update.c index 7a5a69a6c..5c169734a 100644 --- a/src/namestore/test_namestore_api_store_update.c +++ b/src/namestore/test_namestore_api_store_update.c | |||
@@ -48,9 +48,9 @@ static struct GNUNET_NAMECACHE_Handle *nch; | |||
48 | 48 | ||
49 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 49 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
50 | 50 | ||
51 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 51 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
52 | 52 | ||
53 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 53 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
54 | 54 | ||
55 | static int res; | 55 | static int res; |
56 | 56 | ||
@@ -246,9 +246,10 @@ run (void *cls, | |||
246 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 246 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
247 | &endbadly, | 247 | &endbadly, |
248 | NULL); | 248 | NULL); |
249 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 249 | memset (&privkey, 0, sizeof (privkey)); |
250 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 250 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
251 | &pubkey); | 251 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
252 | GNUNET_IDENTITY_key_get_public (&privkey, &pubkey); | ||
252 | rd.flags = GNUNET_GNSRECORD_RF_NONE; | 253 | rd.flags = GNUNET_GNSRECORD_RF_NONE; |
253 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; | 254 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; |
254 | rd.record_type = TEST_RECORD_TYPE; | 255 | rd.record_type = TEST_RECORD_TYPE; |
@@ -291,7 +292,7 @@ main (int argc, | |||
291 | SETUP_CFG (plugin_name, cfg_name); | 292 | SETUP_CFG (plugin_name, cfg_name); |
292 | res = 1; | 293 | res = 1; |
293 | if (0 != | 294 | if (0 != |
294 | GNUNET_TESTING_peer_run ("test-namestore-api-store-update", | 295 | GNUNET_TESTING_peer_run ("test--store-update", |
295 | cfg_name, | 296 | cfg_name, |
296 | &run, | 297 | &run, |
297 | NULL)) | 298 | NULL)) |
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index 5d02b9e49..55ca901e2 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c | |||
@@ -37,9 +37,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
37 | 37 | ||
38 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 38 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
39 | 39 | ||
40 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 40 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey2; | 42 | static struct GNUNET_IDENTITY_PrivateKey privkey2; |
43 | 43 | ||
44 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; | 44 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; |
45 | 45 | ||
@@ -142,7 +142,7 @@ fail_cb (void *cls) | |||
142 | 142 | ||
143 | static void | 143 | static void |
144 | zone_proc (void *cls, | 144 | zone_proc (void *cls, |
145 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 145 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
146 | const char *label, | 146 | const char *label, |
147 | unsigned int rd_count, | 147 | unsigned int rd_count, |
148 | const struct GNUNET_GNSRECORD_Data *rd) | 148 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -331,7 +331,7 @@ create_record (unsigned int count) | |||
331 | */ | 331 | */ |
332 | static void | 332 | static void |
333 | empty_zone_proc (void *cls, | 333 | empty_zone_proc (void *cls, |
334 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 334 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
335 | const char *label, | 335 | const char *label, |
336 | unsigned int rd_count, | 336 | unsigned int rd_count, |
337 | const struct GNUNET_GNSRECORD_Data *rd) | 337 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -362,34 +362,11 @@ empty_zone_proc (void *cls, | |||
362 | static void | 362 | static void |
363 | empty_zone_end (void *cls) | 363 | empty_zone_end (void *cls) |
364 | { | 364 | { |
365 | char *hostkey_file; | ||
366 | |||
367 | zi = NULL; | 365 | zi = NULL; |
368 | GNUNET_asprintf (&hostkey_file, | 366 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
369 | "zonefiles%s%s", | 367 | privkey2.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
370 | DIR_SEPARATOR_STR, | 368 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
371 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 369 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2.ecdsa_key); |
372 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
373 | "Using zonekey file `%s' \n", | ||
374 | hostkey_file); | ||
375 | GNUNET_assert (GNUNET_SYSERR != | ||
376 | GNUNET_CRYPTO_ecdsa_key_from_file (hostkey_file, | ||
377 | GNUNET_YES, | ||
378 | &privkey)); | ||
379 | GNUNET_free (hostkey_file); | ||
380 | |||
381 | GNUNET_asprintf (&hostkey_file, | ||
382 | "zonefiles%s%s", | ||
383 | DIR_SEPARATOR_STR, | ||
384 | "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"); | ||
385 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
386 | "Using zonekey file `%s' \n", | ||
387 | hostkey_file); | ||
388 | GNUNET_assert (GNUNET_SYSERR != | ||
389 | GNUNET_CRYPTO_ecdsa_key_from_file (hostkey_file, | ||
390 | GNUNET_YES, | ||
391 | &privkey2)); | ||
392 | GNUNET_free (hostkey_file); | ||
393 | 370 | ||
394 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n"); | 371 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n"); |
395 | 372 | ||
diff --git a/src/namestore/test_namestore_api_zone_iteration_nick.c b/src/namestore/test_namestore_api_zone_iteration_nick.c index 4e54a05d2..c203a63a6 100644 --- a/src/namestore/test_namestore_api_zone_iteration_nick.c +++ b/src/namestore/test_namestore_api_zone_iteration_nick.c | |||
@@ -38,9 +38,9 @@ | |||
38 | 38 | ||
39 | static struct GNUNET_NAMESTORE_Handle *nsh; | 39 | static struct GNUNET_NAMESTORE_Handle *nsh; |
40 | 40 | ||
41 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 41 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
42 | 42 | ||
43 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey2; | 43 | static struct GNUNET_IDENTITY_PrivateKey privkey2; |
44 | 44 | ||
45 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; | 45 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; |
46 | 46 | ||
@@ -153,7 +153,7 @@ zone_proc_end (void *cls) | |||
153 | 153 | ||
154 | static void | 154 | static void |
155 | zone_proc (void *cls, | 155 | zone_proc (void *cls, |
156 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 156 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
157 | const char *label, | 157 | const char *label, |
158 | unsigned int rd_count, | 158 | unsigned int rd_count, |
159 | const struct GNUNET_GNSRECORD_Data *rd) | 159 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -345,7 +345,7 @@ nick_1_cont (void *cls, int32_t success, const char *emsg) | |||
345 | */ | 345 | */ |
346 | static void | 346 | static void |
347 | empty_zone_proc (void *cls, | 347 | empty_zone_proc (void *cls, |
348 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 348 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
349 | const char *label, | 349 | const char *label, |
350 | unsigned int rd_count, | 350 | unsigned int rd_count, |
351 | const struct GNUNET_GNSRECORD_Data *rd) | 351 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -379,8 +379,10 @@ empty_zone_end (void *cls) | |||
379 | struct GNUNET_GNSRECORD_Data rd; | 379 | struct GNUNET_GNSRECORD_Data rd; |
380 | 380 | ||
381 | zi = NULL; | 381 | zi = NULL; |
382 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 382 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
383 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2); | 383 | privkey2.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
384 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); | ||
385 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2.ecdsa_key); | ||
384 | 386 | ||
385 | memset (&rd, 0, sizeof(rd)); | 387 | memset (&rd, 0, sizeof(rd)); |
386 | rd.data = ZONE_NICK_1; | 388 | rd.data = ZONE_NICK_1; |
diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c index 30920713f..70097a69e 100644 --- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c +++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c | |||
@@ -38,9 +38,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
38 | 38 | ||
39 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 39 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
40 | 40 | ||
41 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 41 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
42 | 42 | ||
43 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey2; | 43 | static struct GNUNET_IDENTITY_PrivateKey privkey2; |
44 | 44 | ||
45 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; | 45 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; |
46 | 46 | ||
@@ -124,7 +124,7 @@ fail_cb (void *cls) | |||
124 | 124 | ||
125 | static void | 125 | static void |
126 | zone_proc (void *cls, | 126 | zone_proc (void *cls, |
127 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 127 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
128 | const char *label, | 128 | const char *label, |
129 | unsigned int rd_count, | 129 | unsigned int rd_count, |
130 | const struct GNUNET_GNSRECORD_Data *rd) | 130 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -309,7 +309,7 @@ create_record (unsigned int count) | |||
309 | */ | 309 | */ |
310 | static void | 310 | static void |
311 | empty_zone_proc (void *cls, | 311 | empty_zone_proc (void *cls, |
312 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 312 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
313 | const char *label, | 313 | const char *label, |
314 | unsigned int rd_count, | 314 | unsigned int rd_count, |
315 | const struct GNUNET_GNSRECORD_Data *rd) | 315 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -341,8 +341,10 @@ static void | |||
341 | empty_zone_proc_end (void *cls) | 341 | empty_zone_proc_end (void *cls) |
342 | { | 342 | { |
343 | zi = NULL; | 343 | zi = NULL; |
344 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 344 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
345 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2); | 345 | privkey2.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
346 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); | ||
347 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2.ecdsa_key); | ||
346 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 348 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
347 | "Created record 1\n"); | 349 | "Created record 1\n"); |
348 | GNUNET_asprintf (&s_name_1, | 350 | GNUNET_asprintf (&s_name_1, |
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c index bdcdd1706..71b36ba09 100644 --- a/src/namestore/test_namestore_api_zone_iteration_stop.c +++ b/src/namestore/test_namestore_api_zone_iteration_stop.c | |||
@@ -34,9 +34,9 @@ | |||
34 | 34 | ||
35 | static struct GNUNET_NAMESTORE_Handle *nsh; | 35 | static struct GNUNET_NAMESTORE_Handle *nsh; |
36 | 36 | ||
37 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 37 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
38 | 38 | ||
39 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey2; | 39 | static struct GNUNET_IDENTITY_PrivateKey privkey2; |
40 | 40 | ||
41 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; | 41 | static struct GNUNET_NAMESTORE_ZoneIterator *zi; |
42 | 42 | ||
@@ -112,7 +112,7 @@ fail_cb (void *cls) | |||
112 | 112 | ||
113 | static void | 113 | static void |
114 | zone_proc (void *cls, | 114 | zone_proc (void *cls, |
115 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 115 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
116 | const char *label, | 116 | const char *label, |
117 | unsigned int rd_count, | 117 | unsigned int rd_count, |
118 | const struct GNUNET_GNSRECORD_Data *rd) | 118 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -318,7 +318,7 @@ create_record (unsigned int count) | |||
318 | */ | 318 | */ |
319 | static void | 319 | static void |
320 | empty_zone_proc (void *cls, | 320 | empty_zone_proc (void *cls, |
321 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 321 | const struct GNUNET_IDENTITY_PrivateKey *zone, |
322 | const char *label, | 322 | const char *label, |
323 | unsigned int rd_count, | 323 | unsigned int rd_count, |
324 | const struct GNUNET_GNSRECORD_Data *rd) | 324 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -347,34 +347,13 @@ empty_zone_proc (void *cls, | |||
347 | static void | 347 | static void |
348 | empty_zone_proc_end (void *cls) | 348 | empty_zone_proc_end (void *cls) |
349 | { | 349 | { |
350 | char *hostkey_file; | ||
351 | |||
352 | GNUNET_assert (nsh == cls); | 350 | GNUNET_assert (nsh == cls); |
353 | zi = NULL; | 351 | zi = NULL; |
354 | GNUNET_asprintf (&hostkey_file, | 352 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
355 | "zonefiles%s%s", | 353 | privkey2.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
356 | DIR_SEPARATOR_STR, | 354 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); |
357 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 355 | GNUNET_CRYPTO_ecdsa_key_create (&privkey2.ecdsa_key); |
358 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 356 | |
359 | "Using zonekey file `%s' \n", | ||
360 | hostkey_file); | ||
361 | GNUNET_assert (GNUNET_SYSERR | ||
362 | != GNUNET_CRYPTO_ecdsa_key_from_file (hostkey_file, | ||
363 | GNUNET_YES, | ||
364 | &privkey)); | ||
365 | GNUNET_free (hostkey_file); | ||
366 | GNUNET_asprintf (&hostkey_file, | ||
367 | "zonefiles%s%s", | ||
368 | DIR_SEPARATOR_STR, | ||
369 | "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"); | ||
370 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
371 | "Using zonekey file `%s'\n", | ||
372 | hostkey_file); | ||
373 | GNUNET_assert (GNUNET_SYSERR != | ||
374 | GNUNET_CRYPTO_ecdsa_key_from_file (hostkey_file, | ||
375 | GNUNET_YES, | ||
376 | &privkey2)); | ||
377 | GNUNET_free (hostkey_file); | ||
378 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 357 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
379 | "Created record 1\n"); | 358 | "Created record 1\n"); |
380 | 359 | ||
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c index 94cc5c285..3fd10e4a1 100644 --- a/src/namestore/test_namestore_api_zone_to_name.c +++ b/src/namestore/test_namestore_api_zone_to_name.c | |||
@@ -42,11 +42,11 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
42 | 42 | ||
43 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 43 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
44 | 44 | ||
45 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; | 45 | static struct GNUNET_IDENTITY_PrivateKey privkey; |
46 | 46 | ||
47 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 47 | static struct GNUNET_IDENTITY_PublicKey pubkey; |
48 | 48 | ||
49 | static struct GNUNET_CRYPTO_EcdsaPublicKey s_zone_value; | 49 | static struct GNUNET_IDENTITY_PublicKey s_zone_value; |
50 | 50 | ||
51 | static char *s_name; | 51 | static char *s_name; |
52 | 52 | ||
@@ -92,7 +92,7 @@ end (void *cls) | |||
92 | 92 | ||
93 | static void | 93 | static void |
94 | zone_to_name_proc (void *cls, | 94 | zone_to_name_proc (void *cls, |
95 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 95 | const struct GNUNET_IDENTITY_PrivateKey *zone_key, |
96 | const char *n, | 96 | const char *n, |
97 | unsigned int rd_count, | 97 | unsigned int rd_count, |
98 | const struct GNUNET_GNSRECORD_Data *rd) | 98 | const struct GNUNET_GNSRECORD_Data *rd) |
@@ -203,20 +203,22 @@ run (void *cls, | |||
203 | GNUNET_SCHEDULER_add_shutdown (&end, | 203 | GNUNET_SCHEDULER_add_shutdown (&end, |
204 | NULL); | 204 | NULL); |
205 | GNUNET_asprintf (&s_name, "dummy"); | 205 | GNUNET_asprintf (&s_name, "dummy"); |
206 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); | 206 | privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); |
207 | GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key); | ||
207 | /* get public key */ | 208 | /* get public key */ |
208 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, | 209 | GNUNET_IDENTITY_key_get_public (&privkey, |
209 | &pubkey); | 210 | &pubkey); |
210 | 211 | ||
211 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, | 212 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, |
212 | &s_zone_value, | 213 | &s_zone_value, |
213 | sizeof(s_zone_value)); | 214 | sizeof(s_zone_value)); |
215 | s_zone_value.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY); | ||
214 | { | 216 | { |
215 | struct GNUNET_GNSRECORD_Data rd; | 217 | struct GNUNET_GNSRECORD_Data rd; |
216 | 218 | ||
217 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; | 219 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; |
218 | rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY; | 220 | rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY; |
219 | rd.data_size = sizeof(s_zone_value); | 221 | rd.data_size = GNUNET_IDENTITY_key_get_length (&s_zone_value); |
220 | rd.data = &s_zone_value; | 222 | rd.data = &s_zone_value; |
221 | rd.flags = 0; | 223 | rd.flags = 0; |
222 | 224 | ||
diff --git a/src/namestore/test_plugin_namestore.c b/src/namestore/test_plugin_namestore.c index 0f9ce97e4..baea0e444 100644 --- a/src/namestore/test_plugin_namestore.c +++ b/src/namestore/test_plugin_namestore.c | |||
@@ -85,14 +85,14 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
85 | static void | 85 | static void |
86 | test_record (void *cls, | 86 | test_record (void *cls, |
87 | uint64_t seq, | 87 | uint64_t seq, |
88 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key, | 88 | const struct GNUNET_IDENTITY_PrivateKey *private_key, |
89 | const char *label, | 89 | const char *label, |
90 | unsigned int rd_count, | 90 | unsigned int rd_count, |
91 | const struct GNUNET_GNSRECORD_Data *rd) | 91 | const struct GNUNET_GNSRECORD_Data *rd) |
92 | { | 92 | { |
93 | int *idp = cls; | 93 | int *idp = cls; |
94 | int id = *idp; | 94 | int id = *idp; |
95 | struct GNUNET_CRYPTO_EcdsaPrivateKey tzone_private_key; | 95 | struct GNUNET_IDENTITY_PrivateKey tzone_private_key; |
96 | char tname[64]; | 96 | char tname[64]; |
97 | unsigned int trd_count = 1 + (id % 1024); | 97 | unsigned int trd_count = 1 + (id % 1024); |
98 | 98 | ||
@@ -123,7 +123,7 @@ get_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) | |||
123 | static void | 123 | static void |
124 | put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) | 124 | put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) |
125 | { | 125 | { |
126 | struct GNUNET_CRYPTO_EcdsaPrivateKey zone_private_key; | 126 | struct GNUNET_IDENTITY_PrivateKey zone_private_key; |
127 | char label[64]; | 127 | char label[64]; |
128 | unsigned int rd_count = 1 + (id % 1024); | 128 | unsigned int rd_count = 1 + (id % 1024); |
129 | struct GNUNET_GNSRECORD_Data rd[GNUNET_NZL (rd_count)]; | 129 | struct GNUNET_GNSRECORD_Data rd[GNUNET_NZL (rd_count)]; |
diff --git a/src/namestore/test_plugin_rest_namestore.sh b/src/namestore/test_plugin_rest_namestore.sh index 12a7fa50c..8a45cebf5 100755 --- a/src/namestore/test_plugin_rest_namestore.sh +++ b/src/namestore/test_plugin_rest_namestore.sh | |||
@@ -84,14 +84,15 @@ gnunet-identity -C $TEST_ID -c test_namestore_api.conf | |||
84 | test="$(gnunet-namestore -D -z $TEST_ID -c test_namestore_api.conf)" | 84 | test="$(gnunet-namestore -D -z $TEST_ID -c test_namestore_api.conf)" |
85 | name=$TEST_ID | 85 | name=$TEST_ID |
86 | public="$(gnunet-identity -d -c test_namestore_api.conf | grep $TEST_ID | awk 'NR==1{print $3}')" | 86 | public="$(gnunet-identity -d -c test_namestore_api.conf | grep $TEST_ID | awk 'NR==1{print $3}')" |
87 | gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG" -t "PKEY" -c test_namestore_api.conf | 87 | echo "$name $public" |
88 | valgrind gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8" -t "PKEY" -c test_namestore_api.conf | ||
88 | #curl_get "${namestore_link}" "HTTP/1.1 200 OK" | 89 | #curl_get "${namestore_link}" "HTTP/1.1 200 OK" |
89 | curl_get "${namestore_link}/$name" "HTTP/1.1 200 OK" | 90 | curl_get "${namestore_link}/$name" "HTTP/1.1 200 OK" |
90 | curl_get "${namestore_link}/$public" "error" | 91 | curl_get "${namestore_link}/$public" "error" |
91 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf | 92 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf |
92 | 93 | ||
93 | #Test POST with NAME | 94 | #Test POST with NAME |
94 | curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "HTTP/1.1 204 No Content" | 95 | curl_post "${namestore_link}/$name" '{"data": [{"value":"000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "HTTP/1.1 204 No Content" |
95 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 | 96 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 |
96 | 97 | ||
97 | # invalid values | 98 | # invalid values |
@@ -106,29 +107,29 @@ curl_post "${namestore_link}/$name" '{"data": [{"record_type":"PKEY", "expiratio | |||
106 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 | 107 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 |
107 | 108 | ||
108 | #expirations | 109 | #expirations |
109 | curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"0d","private": false, "relative_expiration": true, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "HTTP/1.1 204" | 110 | curl_post "${namestore_link}/$name" '{"data": [{"value":"000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8", "record_type":"PKEY", "expiration_time":"0d","private": false, "relative_expiration": true, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "HTTP/1.1 204" |
110 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 | 111 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 |
111 | 112 | ||
112 | curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"10000d","private": false, "relative_expiration": true, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "HTTP/1.1 204" | 113 | curl_post "${namestore_link}/$name" '{"data": [{"value":"000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8", "record_type":"PKEY", "expiration_time":"10000d","private": false, "relative_expiration": true, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "HTTP/1.1 204" |
113 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 | 114 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 |
114 | 115 | ||
115 | curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"now","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "error" | 116 | curl_post "${namestore_link}/$name" '{"data": [{"value":"000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8", "record_type":"PKEY", "expiration_time":"now","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "error" |
116 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 | 117 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 |
117 | 118 | ||
118 | curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time_missing":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "error" | 119 | curl_post "${namestore_link}/$name" '{"data": [{"value":"000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8", "record_type":"PKEY", "expiration_time_missing":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "error" |
119 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 | 120 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 |
120 | 121 | ||
121 | #record_name | 122 | #record_name |
122 | curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":""}' "error" | 123 | curl_post "${namestore_link}/$name" '{"data": [{"value":"000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":""}' "error" |
123 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 | 124 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 |
124 | curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name_missing":"test_entry"}' "error" | 125 | curl_post "${namestore_link}/$name" '{"data": [{"value":"000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name_missing":"test_entry"}' "error" |
125 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 | 126 | gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 |
126 | 127 | ||
127 | #Test DELETE | 128 | #Test DELETE |
128 | gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG" -t "PKEY" -c test_namestore_api.conf | 129 | gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8" -t "PKEY" -c test_namestore_api.conf |
129 | curl_delete "${namestore_link}/$name/test_entry" "HTTP/1.1 204" | 130 | curl_delete "${namestore_link}/$name/test_entry" "HTTP/1.1 204" |
130 | curl_delete "${namestore_link}/$name/test_entry" "error" | 131 | curl_delete "${namestore_link}/$name/test_entry" "error" |
131 | gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG" -t "PKEY" -c test_namestore_api.conf | 132 | gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8" -t "PKEY" -c test_namestore_api.conf |
132 | curl_delete "${namestore_link}/$public/test_entry" "error" | 133 | curl_delete "${namestore_link}/$public/test_entry" "error" |
133 | 134 | ||
134 | gnunet-arm -e -c test_namestore_api.conf | 135 | gnunet-arm -e -c test_namestore_api.conf |