diff options
62 files changed, 647 insertions, 637 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 0d056100e..6819ec90b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -3,7 +3,7 @@ | |||
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | if HAVE_EXPERIMENTAL | 5 | if HAVE_EXPERIMENTAL |
6 | EXP_DIR = gns chat consensus dv set experimentation | 6 | EXP_DIR = gns consensus dv set experimentation |
7 | endif | 7 | endif |
8 | 8 | ||
9 | if LINUX | 9 | if LINUX |
diff --git a/src/dns/plugin_block_dns.c b/src/dns/plugin_block_dns.c index 8ac1ef2b5..d8f3cbb6f 100644 --- a/src/dns/plugin_block_dns.c +++ b/src/dns/plugin_block_dns.c | |||
@@ -75,13 +75,13 @@ block_plugin_dns_evaluate (void *cls, enum GNUNET_BLOCK_Type type, | |||
75 | 75 | ||
76 | if (ntohl (rec->purpose.size) != | 76 | if (ntohl (rec->purpose.size) != |
77 | sizeof (struct GNUNET_DNS_Record) - | 77 | sizeof (struct GNUNET_DNS_Record) - |
78 | sizeof (struct GNUNET_CRYPTO_RsaSignature)) | 78 | sizeof (struct GNUNET_CRYPTO_EccSignature)) |
79 | { | 79 | { |
80 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 80 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
81 | "DNS-Block is invalid: rec->purpose.size=%d != %d\n", | 81 | "DNS-Block is invalid: rec->purpose.size=%d != %d\n", |
82 | ntohl (rec->purpose.size), | 82 | ntohl (rec->purpose.size), |
83 | sizeof (struct GNUNET_DNS_Record) - | 83 | sizeof (struct GNUNET_DNS_Record) - |
84 | sizeof (struct GNUNET_CRYPTO_RsaSignature)); | 84 | sizeof (struct GNUNET_CRYPTO_EccSignature)); |
85 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 85 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
86 | } | 86 | } |
87 | 87 | ||
@@ -94,7 +94,7 @@ block_plugin_dns_evaluate (void *cls, enum GNUNET_BLOCK_Type type, | |||
94 | } | 94 | } |
95 | 95 | ||
96 | if (GNUNET_OK != | 96 | if (GNUNET_OK != |
97 | GNUNET_CRYPTO_rsa_verify (htonl (GNUNET_SIGNATURE_PURPOSE_DNS_RECORD), | 97 | GNUNET_CRYPTO_ecc_verify (htonl (GNUNET_SIGNATURE_PURPOSE_DNS_RECORD), |
98 | &rec->purpose, &rec->signature, &rec->peer)) | 98 | &rec->purpose, &rec->signature, &rec->peer)) |
99 | { | 99 | { |
100 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 100 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am index 03eab7b4e..bb8f0bf41 100644 --- a/src/gns/Makefile.am +++ b/src/gns/Makefile.am | |||
@@ -224,9 +224,11 @@ check_PROGRAMS = \ | |||
224 | 224 | ||
225 | if ENABLE_TEST_RUN | 225 | if ENABLE_TEST_RUN |
226 | if LINUX | 226 | if LINUX |
227 | if HAVE_SQLITE | ||
227 | TESTS = $(check_PROGRAMS) | 228 | TESTS = $(check_PROGRAMS) |
228 | endif | 229 | endif |
229 | endif | 230 | endif |
231 | endif | ||
230 | 232 | ||
231 | 233 | ||
232 | #test_gns_proxy_SOURCES = \ | 234 | #test_gns_proxy_SOURCES = \ |
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index 1e3cb0169..fe378a922 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c | |||
@@ -823,7 +823,7 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, | |||
823 | struct GNUNET_CRYPTO_ShortHashCode *zone, | 823 | struct GNUNET_CRYPTO_ShortHashCode *zone, |
824 | enum GNUNET_GNS_RecordType type, | 824 | enum GNUNET_GNS_RecordType type, |
825 | int only_cached, | 825 | int only_cached, |
826 | struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key, | 826 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, |
827 | GNUNET_GNS_LookupResultProcessor proc, | 827 | GNUNET_GNS_LookupResultProcessor proc, |
828 | void *proc_cls) | 828 | void *proc_cls) |
829 | { | 829 | { |
@@ -832,7 +832,7 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, | |||
832 | struct GNUNET_GNS_LookupRequest *lr; | 832 | struct GNUNET_GNS_LookupRequest *lr; |
833 | size_t msize; | 833 | size_t msize; |
834 | struct PendingMessage *pending; | 834 | struct PendingMessage *pending; |
835 | struct GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded *pkey_enc; | 835 | struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded *pkey_enc; |
836 | size_t key_len; | 836 | size_t key_len; |
837 | char* pkey_tmp; | 837 | char* pkey_tmp; |
838 | 838 | ||
@@ -843,9 +843,9 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, | |||
843 | } | 843 | } |
844 | if (NULL != shorten_key) | 844 | if (NULL != shorten_key) |
845 | { | 845 | { |
846 | pkey_enc = GNUNET_CRYPTO_rsa_encode_key (shorten_key); | 846 | pkey_enc = GNUNET_CRYPTO_ecc_encode_key (shorten_key); |
847 | GNUNET_assert (pkey_enc != NULL); | 847 | GNUNET_assert (pkey_enc != NULL); |
848 | key_len = ntohs (pkey_enc->len); | 848 | key_len = ntohs (pkey_enc->size); |
849 | } | 849 | } |
850 | else | 850 | else |
851 | { | 851 | { |
@@ -927,7 +927,7 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | |||
927 | const char *name, | 927 | const char *name, |
928 | enum GNUNET_GNS_RecordType type, | 928 | enum GNUNET_GNS_RecordType type, |
929 | int only_cached, | 929 | int only_cached, |
930 | struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key, | 930 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, |
931 | GNUNET_GNS_LookupResultProcessor proc, | 931 | GNUNET_GNS_LookupResultProcessor proc, |
932 | void *proc_cls) | 932 | void *proc_cls) |
933 | { | 933 | { |
diff --git a/src/gns/gnunet-gns-fcfsd.c b/src/gns/gnunet-gns-fcfsd.c index d55396459..9ea69a87d 100644 --- a/src/gns/gnunet-gns-fcfsd.c +++ b/src/gns/gnunet-gns-fcfsd.c | |||
@@ -199,7 +199,7 @@ static struct GNUNET_CRYPTO_ShortHashCode fcfsd_zone; | |||
199 | /** | 199 | /** |
200 | * Private key for the fcfsd zone. | 200 | * Private key for the fcfsd zone. |
201 | */ | 201 | */ |
202 | static struct GNUNET_CRYPTO_RsaPrivateKey *fcfs_zone_pkey; | 202 | static struct GNUNET_CRYPTO_EccPrivateKey *fcfs_zone_pkey; |
203 | 203 | ||
204 | 204 | ||
205 | /** | 205 | /** |
@@ -229,12 +229,12 @@ run_httpd_now () | |||
229 | 229 | ||
230 | static void | 230 | static void |
231 | iterate_cb (void *cls, | 231 | iterate_cb (void *cls, |
232 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 232 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
233 | struct GNUNET_TIME_Absolute expire, | 233 | struct GNUNET_TIME_Absolute expire, |
234 | const char *name, | 234 | const char *name, |
235 | unsigned int rd_len, | 235 | unsigned int rd_len, |
236 | const struct GNUNET_NAMESTORE_RecordData *rd, | 236 | const struct GNUNET_NAMESTORE_RecordData *rd, |
237 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 237 | const struct GNUNET_CRYPTO_EccSignature *signature) |
238 | { | 238 | { |
239 | struct ZoneinfoRequest *zr = cls; | 239 | struct ZoneinfoRequest *zr = cls; |
240 | struct MHD_Response *response; | 240 | struct MHD_Response *response; |
@@ -506,12 +506,12 @@ put_continuation (void *cls, | |||
506 | */ | 506 | */ |
507 | static void | 507 | static void |
508 | zone_to_name_cb (void *cls, | 508 | zone_to_name_cb (void *cls, |
509 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 509 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
510 | struct GNUNET_TIME_Absolute expire, | 510 | struct GNUNET_TIME_Absolute expire, |
511 | const char *name, | 511 | const char *name, |
512 | unsigned int rd_count, | 512 | unsigned int rd_count, |
513 | const struct GNUNET_NAMESTORE_RecordData *rd, | 513 | const struct GNUNET_NAMESTORE_RecordData *rd, |
514 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 514 | const struct GNUNET_CRYPTO_EccSignature *signature) |
515 | { | 515 | { |
516 | struct Request *request = cls; | 516 | struct Request *request = cls; |
517 | struct GNUNET_NAMESTORE_RecordData r; | 517 | struct GNUNET_NAMESTORE_RecordData r; |
@@ -565,12 +565,12 @@ zone_to_name_cb (void *cls, | |||
565 | */ | 565 | */ |
566 | static void | 566 | static void |
567 | lookup_result_processor (void *cls, | 567 | lookup_result_processor (void *cls, |
568 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 568 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
569 | struct GNUNET_TIME_Absolute expire, | 569 | struct GNUNET_TIME_Absolute expire, |
570 | const char *name, | 570 | const char *name, |
571 | unsigned int rd_count, | 571 | unsigned int rd_count, |
572 | const struct GNUNET_NAMESTORE_RecordData *rd, | 572 | const struct GNUNET_NAMESTORE_RecordData *rd, |
573 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 573 | const struct GNUNET_CRYPTO_EccSignature *signature) |
574 | { | 574 | { |
575 | struct Request *request = cls; | 575 | struct Request *request = cls; |
576 | struct GNUNET_CRYPTO_ShortHashCode pub; | 576 | struct GNUNET_CRYPTO_ShortHashCode pub; |
@@ -862,7 +862,7 @@ do_shutdown (void *cls, | |||
862 | } | 862 | } |
863 | if (NULL != fcfs_zone_pkey) | 863 | if (NULL != fcfs_zone_pkey) |
864 | { | 864 | { |
865 | GNUNET_CRYPTO_rsa_key_free (fcfs_zone_pkey); | 865 | GNUNET_CRYPTO_ecc_key_free (fcfs_zone_pkey); |
866 | fcfs_zone_pkey = NULL; | 866 | fcfs_zone_pkey = NULL; |
867 | } | 867 | } |
868 | } | 868 | } |
@@ -882,7 +882,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
882 | { | 882 | { |
883 | char *keyfile; | 883 | char *keyfile; |
884 | unsigned long long port; | 884 | unsigned long long port; |
885 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub; | 885 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pub; |
886 | 886 | ||
887 | if (GNUNET_OK != | 887 | if (GNUNET_OK != |
888 | GNUNET_CONFIGURATION_get_value_number (cfg, | 888 | GNUNET_CONFIGURATION_get_value_number (cfg, |
@@ -904,7 +904,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
904 | "fcfsd", "ZONEKEY"); | 904 | "fcfsd", "ZONEKEY"); |
905 | return; | 905 | return; |
906 | } | 906 | } |
907 | fcfs_zone_pkey = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 907 | fcfs_zone_pkey = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
908 | GNUNET_free (keyfile); | 908 | GNUNET_free (keyfile); |
909 | if (NULL == fcfs_zone_pkey) | 909 | if (NULL == fcfs_zone_pkey) |
910 | { | 910 | { |
@@ -912,7 +912,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
912 | _("Failed to read or create private zone key\n")); | 912 | _("Failed to read or create private zone key\n")); |
913 | return; | 913 | return; |
914 | } | 914 | } |
915 | GNUNET_CRYPTO_rsa_key_get_public (fcfs_zone_pkey, | 915 | GNUNET_CRYPTO_ecc_key_get_public (fcfs_zone_pkey, |
916 | &pub); | 916 | &pub); |
917 | GNUNET_CRYPTO_short_hash (&pub, sizeof (pub), &fcfsd_zone); | 917 | GNUNET_CRYPTO_short_hash (&pub, sizeof (pub), &fcfsd_zone); |
918 | ns = GNUNET_NAMESTORE_connect (cfg); | 918 | ns = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/gns/gnunet-gns-helper-service-w32.c b/src/gns/gnunet-gns-helper-service-w32.c index 72956c854..44ae87b84 100644 --- a/src/gns/gnunet-gns-helper-service-w32.c +++ b/src/gns/gnunet-gns-helper-service-w32.c | |||
@@ -63,7 +63,7 @@ static struct GNUNET_GNS_Handle *gns; | |||
63 | 63 | ||
64 | static struct GNUNET_CRYPTO_ShortHashCode *zone = NULL; | 64 | static struct GNUNET_CRYPTO_ShortHashCode *zone = NULL; |
65 | static struct GNUNET_CRYPTO_ShortHashCode user_zone; | 65 | static struct GNUNET_CRYPTO_ShortHashCode user_zone; |
66 | struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key = NULL; | 66 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key = NULL; |
67 | 67 | ||
68 | 68 | ||
69 | /** | 69 | /** |
@@ -670,8 +670,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
670 | }; | 670 | }; |
671 | 671 | ||
672 | char* keyfile; | 672 | char* keyfile; |
673 | struct GNUNET_CRYPTO_RsaPrivateKey *key = NULL; | 673 | struct GNUNET_CRYPTO_EccPrivateKey *key = NULL; |
674 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 674 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; |
675 | struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename; | 675 | struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename; |
676 | 676 | ||
677 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns", | 677 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns", |
@@ -685,16 +685,16 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
685 | { | 685 | { |
686 | if (GNUNET_YES == GNUNET_DISK_file_test (keyfile)) | 686 | if (GNUNET_YES == GNUNET_DISK_file_test (keyfile)) |
687 | { | 687 | { |
688 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 688 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
689 | GNUNET_CRYPTO_rsa_key_get_public (key, &pkey); | 689 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); |
690 | GNUNET_CRYPTO_short_hash(&pkey, | 690 | GNUNET_CRYPTO_short_hash(&pkey, |
691 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 691 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
692 | &user_zone); | 692 | &user_zone); |
693 | zone = &user_zone; | 693 | zone = &user_zone; |
694 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); | 694 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); |
695 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 695 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
696 | "Using zone: %s!\n", &zonename); | 696 | "Using zone: %s!\n", &zonename); |
697 | GNUNET_CRYPTO_rsa_key_free(key); | 697 | GNUNET_CRYPTO_ecc_key_free(key); |
698 | } | 698 | } |
699 | GNUNET_free(keyfile); | 699 | GNUNET_free(keyfile); |
700 | } | 700 | } |
@@ -710,7 +710,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
710 | { | 710 | { |
711 | if (GNUNET_YES == GNUNET_DISK_file_test (keyfile)) | 711 | if (GNUNET_YES == GNUNET_DISK_file_test (keyfile)) |
712 | { | 712 | { |
713 | shorten_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 713 | shorten_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
714 | } | 714 | } |
715 | GNUNET_free(keyfile); | 715 | GNUNET_free(keyfile); |
716 | } | 716 | } |
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 7b783787b..0135fea34 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c | |||
@@ -459,7 +459,7 @@ static struct GNUNET_NETWORK_Handle *mhd_unix_socket; | |||
459 | #endif | 459 | #endif |
460 | 460 | ||
461 | /* Shorten zone private key */ | 461 | /* Shorten zone private key */ |
462 | static struct GNUNET_CRYPTO_RsaPrivateKey *shorten_zonekey; | 462 | static struct GNUNET_CRYPTO_EccPrivateKey *shorten_zonekey; |
463 | 463 | ||
464 | 464 | ||
465 | /** | 465 | /** |
@@ -3188,8 +3188,8 @@ static int | |||
3188 | load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) | 3188 | load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) |
3189 | { | 3189 | { |
3190 | char *keyfile; | 3190 | char *keyfile; |
3191 | struct GNUNET_CRYPTO_RsaPrivateKey *key; | 3191 | struct GNUNET_CRYPTO_EccPrivateKey *key; |
3192 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 3192 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; |
3193 | struct GNUNET_CRYPTO_ShortHashCode *zone; | 3193 | struct GNUNET_CRYPTO_ShortHashCode *zone; |
3194 | struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename; | 3194 | struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename; |
3195 | 3195 | ||
@@ -3209,17 +3209,17 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
3209 | return GNUNET_NO; | 3209 | return GNUNET_NO; |
3210 | } | 3210 | } |
3211 | 3211 | ||
3212 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 3212 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
3213 | GNUNET_CRYPTO_rsa_key_get_public (key, &pkey); | 3213 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); |
3214 | local_gns_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 3214 | local_gns_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
3215 | GNUNET_CRYPTO_short_hash(&pkey, | 3215 | GNUNET_CRYPTO_short_hash(&pkey, |
3216 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 3216 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
3217 | local_gns_zone); | 3217 | local_gns_zone); |
3218 | zone = local_gns_zone; | 3218 | zone = local_gns_zone; |
3219 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); | 3219 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); |
3220 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3220 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3221 | "Using zone: %s!\n", &zonename); | 3221 | "Using zone: %s!\n", &zonename); |
3222 | GNUNET_CRYPTO_rsa_key_free(key); | 3222 | GNUNET_CRYPTO_ecc_key_free(key); |
3223 | GNUNET_free(keyfile); | 3223 | GNUNET_free(keyfile); |
3224 | keyfile = NULL; | 3224 | keyfile = NULL; |
3225 | 3225 | ||
@@ -3238,16 +3238,16 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
3238 | } | 3238 | } |
3239 | else | 3239 | else |
3240 | { | 3240 | { |
3241 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 3241 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
3242 | GNUNET_CRYPTO_rsa_key_get_public (key, &pkey); | 3242 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); |
3243 | local_private_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 3243 | local_private_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
3244 | GNUNET_CRYPTO_short_hash(&pkey, | 3244 | GNUNET_CRYPTO_short_hash(&pkey, |
3245 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 3245 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
3246 | local_private_zone); | 3246 | local_private_zone); |
3247 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); | 3247 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); |
3248 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3248 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3249 | "Using private zone: %s!\n", &zonename); | 3249 | "Using private zone: %s!\n", &zonename); |
3250 | GNUNET_CRYPTO_rsa_key_free(key); | 3250 | GNUNET_CRYPTO_ecc_key_free(key); |
3251 | GNUNET_free(keyfile); | 3251 | GNUNET_free(keyfile); |
3252 | } | 3252 | } |
3253 | keyfile = NULL; | 3253 | keyfile = NULL; |
@@ -3267,16 +3267,16 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
3267 | } | 3267 | } |
3268 | else | 3268 | else |
3269 | { | 3269 | { |
3270 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 3270 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
3271 | GNUNET_CRYPTO_rsa_key_get_public (key, &pkey); | 3271 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); |
3272 | local_shorten_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 3272 | local_shorten_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
3273 | GNUNET_CRYPTO_short_hash(&pkey, | 3273 | GNUNET_CRYPTO_short_hash(&pkey, |
3274 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 3274 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
3275 | local_shorten_zone); | 3275 | local_shorten_zone); |
3276 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); | 3276 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); |
3277 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3277 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3278 | "Using shorten zone: %s!\n", &zonename); | 3278 | "Using shorten zone: %s!\n", &zonename); |
3279 | GNUNET_CRYPTO_rsa_key_free(key); | 3279 | GNUNET_CRYPTO_ecc_key_free(key); |
3280 | GNUNET_free(keyfile); | 3280 | GNUNET_free(keyfile); |
3281 | } | 3281 | } |
3282 | 3282 | ||
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index 74212d4fc..542a8106d 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c | |||
@@ -204,13 +204,13 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
204 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 204 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
205 | { | 205 | { |
206 | char* keyfile; | 206 | char* keyfile; |
207 | struct GNUNET_CRYPTO_RsaPrivateKey *key = NULL; | 207 | struct GNUNET_CRYPTO_EccPrivateKey *key = NULL; |
208 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 208 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; |
209 | struct GNUNET_CRYPTO_ShortHashCode *zone = NULL; | 209 | struct GNUNET_CRYPTO_ShortHashCode *zone = NULL; |
210 | struct GNUNET_CRYPTO_ShortHashCode user_zone; | 210 | struct GNUNET_CRYPTO_ShortHashCode user_zone; |
211 | struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename; | 211 | struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename; |
212 | struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key = NULL; | 212 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key = NULL; |
213 | struct GNUNET_CRYPTO_RsaPrivateKey *private_key = NULL; | 213 | struct GNUNET_CRYPTO_EccPrivateKey *private_key = NULL; |
214 | struct GNUNET_CRYPTO_ShortHashCode *private_zone = NULL; | 214 | struct GNUNET_CRYPTO_ShortHashCode *private_zone = NULL; |
215 | struct GNUNET_CRYPTO_ShortHashCode *shorten_zone = NULL; | 215 | struct GNUNET_CRYPTO_ShortHashCode *shorten_zone = NULL; |
216 | 216 | ||
@@ -230,17 +230,17 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
230 | } | 230 | } |
231 | else | 231 | else |
232 | { | 232 | { |
233 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 233 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
234 | GNUNET_CRYPTO_rsa_key_get_public (key, &pkey); | 234 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); |
235 | GNUNET_CRYPTO_short_hash (&pkey, | 235 | GNUNET_CRYPTO_short_hash (&pkey, |
236 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 236 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
237 | &user_zone); | 237 | &user_zone); |
238 | zone = &user_zone; | 238 | zone = &user_zone; |
239 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); | 239 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); |
240 | if (!raw) | 240 | if (!raw) |
241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
242 | "Using zone: %s!\n", &zonename); | 242 | "Using zone: %s!\n", &zonename); |
243 | GNUNET_CRYPTO_rsa_key_free (key); | 243 | GNUNET_CRYPTO_ecc_key_free (key); |
244 | GNUNET_free(keyfile); | 244 | GNUNET_free(keyfile); |
245 | } | 245 | } |
246 | 246 | ||
@@ -253,11 +253,11 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
253 | } | 253 | } |
254 | else | 254 | else |
255 | { | 255 | { |
256 | shorten_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 256 | shorten_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
257 | GNUNET_CRYPTO_rsa_key_get_public (shorten_key, &pkey); | 257 | GNUNET_CRYPTO_ecc_key_get_public (shorten_key, &pkey); |
258 | shorten_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 258 | shorten_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
259 | GNUNET_CRYPTO_short_hash(&pkey, | 259 | GNUNET_CRYPTO_short_hash(&pkey, |
260 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 260 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
261 | shorten_zone); | 261 | shorten_zone); |
262 | GNUNET_CRYPTO_short_hash_to_enc (shorten_zone, &zonename); | 262 | GNUNET_CRYPTO_short_hash_to_enc (shorten_zone, &zonename); |
263 | if (! raw) | 263 | if (! raw) |
@@ -275,17 +275,17 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
275 | } | 275 | } |
276 | else | 276 | else |
277 | { | 277 | { |
278 | private_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 278 | private_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
279 | GNUNET_CRYPTO_rsa_key_get_public (private_key, &pkey); | 279 | GNUNET_CRYPTO_ecc_key_get_public (private_key, &pkey); |
280 | private_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 280 | private_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
281 | GNUNET_CRYPTO_short_hash(&pkey, | 281 | GNUNET_CRYPTO_short_hash(&pkey, |
282 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 282 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
283 | private_zone); | 283 | private_zone); |
284 | GNUNET_CRYPTO_short_hash_to_enc (private_zone, &zonename); | 284 | GNUNET_CRYPTO_short_hash_to_enc (private_zone, &zonename); |
285 | if (! raw) | 285 | if (! raw) |
286 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 286 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
287 | "Using private zone: %s!\n", &zonename); | 287 | "Using private zone: %s!\n", &zonename); |
288 | GNUNET_CRYPTO_rsa_key_free (private_key); | 288 | GNUNET_CRYPTO_ecc_key_free (private_key); |
289 | } | 289 | } |
290 | 290 | ||
291 | if (NULL != lookup_type) | 291 | if (NULL != lookup_type) |
@@ -321,7 +321,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
321 | } | 321 | } |
322 | 322 | ||
323 | if (NULL != shorten_key) | 323 | if (NULL != shorten_key) |
324 | GNUNET_CRYPTO_rsa_key_free (shorten_key); | 324 | GNUNET_CRYPTO_ecc_key_free (shorten_key); |
325 | if (NULL != shorten_zone) | 325 | if (NULL != shorten_zone) |
326 | GNUNET_free (shorten_zone); | 326 | GNUNET_free (shorten_zone); |
327 | if (NULL != private_zone) | 327 | if (NULL != private_zone) |
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 16887c62d..517722643 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c | |||
@@ -168,7 +168,7 @@ struct ClientLookupHandle | |||
168 | /** | 168 | /** |
169 | * optional zone private key used for shorten | 169 | * optional zone private key used for shorten |
170 | */ | 170 | */ |
171 | struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key; | 171 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key; |
172 | 172 | ||
173 | /** | 173 | /** |
174 | * the name to look up | 174 | * the name to look up |
@@ -205,7 +205,7 @@ static struct GNUNET_DHT_Handle *dht_handle; | |||
205 | /** | 205 | /** |
206 | * Our zone's private key | 206 | * Our zone's private key |
207 | */ | 207 | */ |
208 | static struct GNUNET_CRYPTO_RsaPrivateKey *zone_key; | 208 | static struct GNUNET_CRYPTO_EccPrivateKey *zone_key; |
209 | 209 | ||
210 | /** | 210 | /** |
211 | * Our handle to the namestore service | 211 | * Our handle to the namestore service |
@@ -382,12 +382,12 @@ publish_zone_dht_start (void *cls, | |||
382 | */ | 382 | */ |
383 | static void | 383 | static void |
384 | put_gns_record (void *cls, | 384 | put_gns_record (void *cls, |
385 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key, | 385 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *key, |
386 | struct GNUNET_TIME_Absolute expiration, | 386 | struct GNUNET_TIME_Absolute expiration, |
387 | const char *name, | 387 | const char *name, |
388 | unsigned int rd_count, | 388 | unsigned int rd_count, |
389 | const struct GNUNET_NAMESTORE_RecordData *rd, | 389 | const struct GNUNET_NAMESTORE_RecordData *rd, |
390 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 390 | const struct GNUNET_CRYPTO_EccSignature *signature) |
391 | { | 391 | { |
392 | struct GNSNameRecordBlock *nrb; | 392 | struct GNSNameRecordBlock *nrb; |
393 | struct GNUNET_CRYPTO_ShortHashCode zhash; | 393 | struct GNUNET_CRYPTO_ShortHashCode zhash; |
@@ -475,7 +475,7 @@ put_gns_record (void *cls, | |||
475 | nrb_data += namelen; | 475 | nrb_data += namelen; |
476 | rd_payload_length += sizeof(struct GNSNameRecordBlock) + namelen; | 476 | rd_payload_length += sizeof(struct GNSNameRecordBlock) + namelen; |
477 | GNUNET_CRYPTO_short_hash (key, | 477 | GNUNET_CRYPTO_short_hash (key, |
478 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 478 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
479 | &zhash); | 479 | &zhash); |
480 | if (-1 == GNUNET_NAMESTORE_records_serialize (rd_count, | 480 | if (-1 == GNUNET_NAMESTORE_records_serialize (rd_count, |
481 | rd, | 481 | rd, |
@@ -626,12 +626,12 @@ send_shorten_response (void* cls, const char* name) | |||
626 | */ | 626 | */ |
627 | static void | 627 | static void |
628 | process_shorten_in_private_zone_lookup (void *cls, | 628 | process_shorten_in_private_zone_lookup (void *cls, |
629 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key, | 629 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *key, |
630 | struct GNUNET_TIME_Absolute expiration, | 630 | struct GNUNET_TIME_Absolute expiration, |
631 | const char *name, | 631 | const char *name, |
632 | unsigned int rd_count, | 632 | unsigned int rd_count, |
633 | const struct GNUNET_NAMESTORE_RecordData *rd, | 633 | const struct GNUNET_NAMESTORE_RecordData *rd, |
634 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 634 | const struct GNUNET_CRYPTO_EccSignature *signature) |
635 | { | 635 | { |
636 | struct ClientShortenHandle *csh = cls; | 636 | struct ClientShortenHandle *csh = cls; |
637 | struct GNUNET_CRYPTO_ShortHashCode *szone = &csh->shorten_zone; | 637 | struct GNUNET_CRYPTO_ShortHashCode *szone = &csh->shorten_zone; |
@@ -682,12 +682,12 @@ process_shorten_in_private_zone_lookup (void *cls, | |||
682 | */ | 682 | */ |
683 | static void | 683 | static void |
684 | process_shorten_in_root_zone_lookup (void *cls, | 684 | process_shorten_in_root_zone_lookup (void *cls, |
685 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key, | 685 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *key, |
686 | struct GNUNET_TIME_Absolute expiration, | 686 | struct GNUNET_TIME_Absolute expiration, |
687 | const char *name, | 687 | const char *name, |
688 | unsigned int rd_count, | 688 | unsigned int rd_count, |
689 | const struct GNUNET_NAMESTORE_RecordData *rd, | 689 | const struct GNUNET_NAMESTORE_RecordData *rd, |
690 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 690 | const struct GNUNET_CRYPTO_EccSignature *signature) |
691 | { | 691 | { |
692 | struct ClientShortenHandle *csh = cls; | 692 | struct ClientShortenHandle *csh = cls; |
693 | struct GNUNET_CRYPTO_ShortHashCode *szone = &csh->shorten_zone; | 693 | struct GNUNET_CRYPTO_ShortHashCode *szone = &csh->shorten_zone; |
@@ -738,12 +738,12 @@ process_shorten_in_root_zone_lookup (void *cls, | |||
738 | */ | 738 | */ |
739 | static void | 739 | static void |
740 | process_private_in_root_zone_lookup (void *cls, | 740 | process_private_in_root_zone_lookup (void *cls, |
741 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key, | 741 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *key, |
742 | struct GNUNET_TIME_Absolute expiration, | 742 | struct GNUNET_TIME_Absolute expiration, |
743 | const char *name, | 743 | const char *name, |
744 | unsigned int rd_count, | 744 | unsigned int rd_count, |
745 | const struct GNUNET_NAMESTORE_RecordData *rd, | 745 | const struct GNUNET_NAMESTORE_RecordData *rd, |
746 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 746 | const struct GNUNET_CRYPTO_EccSignature *signature) |
747 | { | 747 | { |
748 | struct ClientShortenHandle *csh = cls; | 748 | struct ClientShortenHandle *csh = cls; |
749 | 749 | ||
@@ -1036,7 +1036,7 @@ send_lookup_response (void* cls, | |||
1036 | GNUNET_free(clh->name); | 1036 | GNUNET_free(clh->name); |
1037 | 1037 | ||
1038 | if (NULL != clh->shorten_key) | 1038 | if (NULL != clh->shorten_key) |
1039 | GNUNET_CRYPTO_rsa_key_free (clh->shorten_key); | 1039 | GNUNET_CRYPTO_ecc_key_free (clh->shorten_key); |
1040 | GNUNET_free (clh); | 1040 | GNUNET_free (clh); |
1041 | GNUNET_STATISTICS_update (statistics, | 1041 | GNUNET_STATISTICS_update (statistics, |
1042 | "Completed lookups", 1, GNUNET_NO); | 1042 | "Completed lookups", 1, GNUNET_NO); |
@@ -1064,8 +1064,8 @@ handle_lookup (void *cls, | |||
1064 | char* nameptr = name; | 1064 | char* nameptr = name; |
1065 | const char *utf_in; | 1065 | const char *utf_in; |
1066 | int only_cached; | 1066 | int only_cached; |
1067 | struct GNUNET_CRYPTO_RsaPrivateKey *key; | 1067 | struct GNUNET_CRYPTO_EccPrivateKey *key; |
1068 | struct GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded *pkey; | 1068 | struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded *pkey; |
1069 | char* tmp_pkey; | 1069 | char* tmp_pkey; |
1070 | uint16_t msg_size; | 1070 | uint16_t msg_size; |
1071 | const struct GNUNET_GNS_ClientLookupMessage *sh_msg; | 1071 | const struct GNUNET_GNS_ClientLookupMessage *sh_msg; |
@@ -1083,10 +1083,11 @@ handle_lookup (void *cls, | |||
1083 | GNUNET_SERVER_notification_context_add (nc, client); | 1083 | GNUNET_SERVER_notification_context_add (nc, client); |
1084 | if (GNUNET_YES == ntohl (sh_msg->have_key)) | 1084 | if (GNUNET_YES == ntohl (sh_msg->have_key)) |
1085 | { | 1085 | { |
1086 | pkey = (struct GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded *) &sh_msg[1]; | 1086 | pkey = (struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded *) &sh_msg[1]; |
1087 | tmp_pkey = (char*) &sh_msg[1]; | 1087 | tmp_pkey = (char*) &sh_msg[1]; |
1088 | key = GNUNET_CRYPTO_rsa_decode_key (tmp_pkey, ntohs (pkey->len)); | 1088 | key = GNUNET_CRYPTO_ecc_decode_key (tmp_pkey, ntohs (pkey->size), |
1089 | GNUNET_STRINGS_utf8_tolower (&tmp_pkey[ntohs (pkey->len)], &nameptr); | 1089 | GNUNET_NO); |
1090 | GNUNET_STRINGS_utf8_tolower (&tmp_pkey[ntohs (pkey->size)], &nameptr); | ||
1090 | } | 1091 | } |
1091 | else | 1092 | else |
1092 | { | 1093 | { |
@@ -1184,7 +1185,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
1184 | {&handle_get_authority, NULL, GNUNET_MESSAGE_TYPE_GNS_GET_AUTH, 0} | 1185 | {&handle_get_authority, NULL, GNUNET_MESSAGE_TYPE_GNS_GET_AUTH, 0} |
1185 | }; | 1186 | }; |
1186 | char* keyfile; | 1187 | char* keyfile; |
1187 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 1188 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; |
1188 | unsigned long long max_parallel_bg_queries = 0; | 1189 | unsigned long long max_parallel_bg_queries = 0; |
1189 | int ignore_pending = GNUNET_NO; | 1190 | int ignore_pending = GNUNET_NO; |
1190 | 1191 | ||
@@ -1203,10 +1204,10 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
1203 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1204 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
1204 | "Using keyfile %s for root zone.\n", keyfile); | 1205 | "Using keyfile %s for root zone.\n", keyfile); |
1205 | 1206 | ||
1206 | zone_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 1207 | zone_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
1207 | GNUNET_CRYPTO_rsa_key_get_public (zone_key, &pkey); | 1208 | GNUNET_CRYPTO_ecc_key_get_public (zone_key, &pkey); |
1208 | GNUNET_CRYPTO_short_hash(&pkey, | 1209 | GNUNET_CRYPTO_short_hash(&pkey, |
1209 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 1210 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
1210 | &zone_hash); | 1211 | &zone_hash); |
1211 | GNUNET_free(keyfile); | 1212 | GNUNET_free(keyfile); |
1212 | namestore_handle = GNUNET_NAMESTORE_connect (c); | 1213 | namestore_handle = GNUNET_NAMESTORE_connect (c); |
diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c index cbacc318d..affa0f5d6 100644 --- a/src/gns/gnunet-service-gns_interceptor.c +++ b/src/gns/gnunet-service-gns_interceptor.c | |||
@@ -66,7 +66,7 @@ static struct GNUNET_CRYPTO_ShortHashCode our_zone; | |||
66 | /** | 66 | /** |
67 | * Our priv key | 67 | * Our priv key |
68 | */ | 68 | */ |
69 | static struct GNUNET_CRYPTO_RsaPrivateKey *our_key; | 69 | static struct GNUNET_CRYPTO_EccPrivateKey *our_key; |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * Default timeout | 72 | * Default timeout |
@@ -344,7 +344,7 @@ handle_dns_request (void *cls, | |||
344 | */ | 344 | */ |
345 | int | 345 | int |
346 | gns_interceptor_init (struct GNUNET_CRYPTO_ShortHashCode zone, | 346 | gns_interceptor_init (struct GNUNET_CRYPTO_ShortHashCode zone, |
347 | struct GNUNET_CRYPTO_RsaPrivateKey *key, | 347 | struct GNUNET_CRYPTO_EccPrivateKey *key, |
348 | const struct GNUNET_CONFIGURATION_Handle *c) | 348 | const struct GNUNET_CONFIGURATION_Handle *c) |
349 | { | 349 | { |
350 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | 350 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
diff --git a/src/gns/gnunet-service-gns_interceptor.h b/src/gns/gnunet-service-gns_interceptor.h index 613ce8cdc..a1da4938b 100644 --- a/src/gns/gnunet-service-gns_interceptor.h +++ b/src/gns/gnunet-service-gns_interceptor.h | |||
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | int | 38 | int |
39 | gns_interceptor_init (struct GNUNET_CRYPTO_ShortHashCode zone, | 39 | gns_interceptor_init (struct GNUNET_CRYPTO_ShortHashCode zone, |
40 | struct GNUNET_CRYPTO_RsaPrivateKey *key, | 40 | struct GNUNET_CRYPTO_EccPrivateKey *key, |
41 | const struct GNUNET_CONFIGURATION_Handle *c); | 41 | const struct GNUNET_CONFIGURATION_Handle *c); |
42 | 42 | ||
43 | /** | 43 | /** |
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 37f12ff6e..f20cd24c9 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -224,7 +224,7 @@ free_get_pseu_authority_handle (struct GetPseuAuthorityHandle *gph) | |||
224 | { | 224 | { |
225 | gph->namestore_task = NULL; | 225 | gph->namestore_task = NULL; |
226 | GNUNET_free (gph->auth); | 226 | GNUNET_free (gph->auth); |
227 | GNUNET_CRYPTO_rsa_key_free (gph->key); | 227 | GNUNET_CRYPTO_ecc_key_free (gph->key); |
228 | GNUNET_CONTAINER_DLL_remove (gph_head, gph_tail, gph); | 228 | GNUNET_CONTAINER_DLL_remove (gph_head, gph_tail, gph); |
229 | GNUNET_free (gph); | 229 | GNUNET_free (gph); |
230 | } | 230 | } |
@@ -270,11 +270,11 @@ create_pkey_cont (void* cls, int32_t success, const char* emsg) | |||
270 | */ | 270 | */ |
271 | static void | 271 | static void |
272 | process_pseu_lookup_ns (void* cls, | 272 | process_pseu_lookup_ns (void* cls, |
273 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key, | 273 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *key, |
274 | struct GNUNET_TIME_Absolute expiration, | 274 | struct GNUNET_TIME_Absolute expiration, |
275 | const char *name, unsigned int rd_count, | 275 | const char *name, unsigned int rd_count, |
276 | const struct GNUNET_NAMESTORE_RecordData *rd, | 276 | const struct GNUNET_NAMESTORE_RecordData *rd, |
277 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 277 | const struct GNUNET_CRYPTO_EccSignature *signature) |
278 | { | 278 | { |
279 | struct GetPseuAuthorityHandle* gph = cls; | 279 | struct GetPseuAuthorityHandle* gph = cls; |
280 | struct GNUNET_NAMESTORE_RecordData new_pkey; | 280 | struct GNUNET_NAMESTORE_RecordData new_pkey; |
@@ -463,12 +463,12 @@ process_auth_discovery_dht_result (void* cls, | |||
463 | */ | 463 | */ |
464 | static void | 464 | static void |
465 | process_auth_discovery_ns_result (void* cls, | 465 | process_auth_discovery_ns_result (void* cls, |
466 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key, | 466 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *key, |
467 | struct GNUNET_TIME_Absolute expiration, | 467 | struct GNUNET_TIME_Absolute expiration, |
468 | const char *name, | 468 | const char *name, |
469 | unsigned int rd_count, | 469 | unsigned int rd_count, |
470 | const struct GNUNET_NAMESTORE_RecordData *rd, | 470 | const struct GNUNET_NAMESTORE_RecordData *rd, |
471 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 471 | const struct GNUNET_CRYPTO_EccSignature *signature) |
472 | { | 472 | { |
473 | struct GetPseuAuthorityHandle* gph = cls; | 473 | struct GetPseuAuthorityHandle* gph = cls; |
474 | struct GNUNET_HashCode lookup_key; | 474 | struct GNUNET_HashCode lookup_key; |
@@ -536,12 +536,12 @@ process_auth_discovery_ns_result (void* cls, | |||
536 | */ | 536 | */ |
537 | static void | 537 | static void |
538 | process_zone_to_name_discover (void *cls, | 538 | process_zone_to_name_discover (void *cls, |
539 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 539 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
540 | struct GNUNET_TIME_Absolute expire, | 540 | struct GNUNET_TIME_Absolute expire, |
541 | const char *name, | 541 | const char *name, |
542 | unsigned int rd_len, | 542 | unsigned int rd_len, |
543 | const struct GNUNET_NAMESTORE_RecordData *rd, | 543 | const struct GNUNET_NAMESTORE_RecordData *rd, |
544 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 544 | const struct GNUNET_CRYPTO_EccSignature *signature) |
545 | { | 545 | { |
546 | struct GetPseuAuthorityHandle* gph = cls; | 546 | struct GetPseuAuthorityHandle* gph = cls; |
547 | 547 | ||
@@ -592,31 +592,33 @@ shorten_authority_chain (struct GetPseuAuthorityHandle *gph) | |||
592 | */ | 592 | */ |
593 | static void | 593 | static void |
594 | start_shorten (struct AuthorityChain *auth, | 594 | start_shorten (struct AuthorityChain *auth, |
595 | const struct GNUNET_CRYPTO_RsaPrivateKey *key) | 595 | const struct GNUNET_CRYPTO_EccPrivateKey *key) |
596 | { | 596 | { |
597 | struct GetPseuAuthorityHandle *gph; | 597 | struct GetPseuAuthorityHandle *gph; |
598 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 598 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; |
599 | struct GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded *pb_key; | 599 | struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded *pb_key; |
600 | 600 | ||
601 | GNUNET_CRYPTO_rsa_key_get_public (key, &pkey); | 601 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); |
602 | if (NULL == (pb_key = GNUNET_CRYPTO_rsa_encode_key (key))) | 602 | if (NULL == (pb_key = GNUNET_CRYPTO_ecc_encode_key (key))) |
603 | { | 603 | { |
604 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 604 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
605 | "Failed to encode RSA key on shorten\n"); | 605 | "Failed to encode ECC key on shorten\n"); |
606 | return; | 606 | return; |
607 | } | 607 | } |
608 | gph = GNUNET_malloc (sizeof (struct GetPseuAuthorityHandle)); | 608 | gph = GNUNET_new (struct GetPseuAuthorityHandle); |
609 | gph->key = GNUNET_CRYPTO_rsa_decode_key ((const char*) pb_key, ntohs (pb_key->len)); | 609 | gph->key = GNUNET_CRYPTO_ecc_decode_key ((const char*) pb_key, |
610 | ntohs (pb_key->size), | ||
611 | GNUNET_YES); | ||
610 | GNUNET_free (pb_key); | 612 | GNUNET_free (pb_key); |
611 | if (NULL == gph->key) | 613 | if (NULL == gph->key) |
612 | { | 614 | { |
613 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 615 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
614 | "Failed to decode RSA key on shorten\n"); | 616 | "Failed to decode ECC key on shorten\n"); |
615 | GNUNET_free (gph); | 617 | GNUNET_free (gph); |
616 | return; | 618 | return; |
617 | } | 619 | } |
618 | GNUNET_CRYPTO_short_hash (&pkey, | 620 | GNUNET_CRYPTO_short_hash (&pkey, |
619 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 621 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
620 | &gph->our_zone); | 622 | &gph->our_zone); |
621 | gph->auth = GNUNET_malloc (sizeof (struct AuthorityChain)); | 623 | gph->auth = GNUNET_malloc (sizeof (struct AuthorityChain)); |
622 | memcpy (gph->auth, auth, sizeof (struct AuthorityChain)); | 624 | memcpy (gph->auth, auth, sizeof (struct AuthorityChain)); |
@@ -1154,11 +1156,11 @@ resolve_record_dht (struct ResolverHandle *rh) | |||
1154 | */ | 1156 | */ |
1155 | static void | 1157 | static void |
1156 | process_record_result_ns (void* cls, | 1158 | process_record_result_ns (void* cls, |
1157 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key, | 1159 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *key, |
1158 | struct GNUNET_TIME_Absolute expiration, | 1160 | struct GNUNET_TIME_Absolute expiration, |
1159 | const char *name, unsigned int rd_count, | 1161 | const char *name, unsigned int rd_count, |
1160 | const struct GNUNET_NAMESTORE_RecordData *rd, | 1162 | const struct GNUNET_NAMESTORE_RecordData *rd, |
1161 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 1163 | const struct GNUNET_CRYPTO_EccSignature *signature) |
1162 | { | 1164 | { |
1163 | struct ResolverHandle *rh = cls; | 1165 | struct ResolverHandle *rh = cls; |
1164 | struct RecordLookupHandle *rlh = rh->proc_cls; | 1166 | struct RecordLookupHandle *rlh = rh->proc_cls; |
@@ -1169,7 +1171,7 @@ process_record_result_ns (void* cls, | |||
1169 | 1171 | ||
1170 | rh->namestore_task = NULL; | 1172 | rh->namestore_task = NULL; |
1171 | GNUNET_CRYPTO_short_hash (key, | 1173 | GNUNET_CRYPTO_short_hash (key, |
1172 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 1174 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
1173 | &zone); | 1175 | &zone); |
1174 | remaining_time = GNUNET_TIME_absolute_get_remaining (expiration); | 1176 | remaining_time = GNUNET_TIME_absolute_get_remaining (expiration); |
1175 | rh->status = 0; | 1177 | rh->status = 0; |
@@ -2034,12 +2036,12 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh, | |||
2034 | */ | 2036 | */ |
2035 | static void | 2037 | static void |
2036 | process_pkey_revocation_result_ns (void *cls, | 2038 | process_pkey_revocation_result_ns (void *cls, |
2037 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key, | 2039 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *key, |
2038 | struct GNUNET_TIME_Absolute expiration, | 2040 | struct GNUNET_TIME_Absolute expiration, |
2039 | const char *name, | 2041 | const char *name, |
2040 | unsigned int rd_count, | 2042 | unsigned int rd_count, |
2041 | const struct GNUNET_NAMESTORE_RecordData *rd, | 2043 | const struct GNUNET_NAMESTORE_RecordData *rd, |
2042 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 2044 | const struct GNUNET_CRYPTO_EccSignature *signature) |
2043 | { | 2045 | { |
2044 | struct ResolverHandle *rh = cls; | 2046 | struct ResolverHandle *rh = cls; |
2045 | struct GNUNET_TIME_Relative remaining_time; | 2047 | struct GNUNET_TIME_Relative remaining_time; |
@@ -3063,12 +3065,12 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh, | |||
3063 | */ | 3065 | */ |
3064 | static void | 3066 | static void |
3065 | process_delegation_result_ns (void* cls, | 3067 | process_delegation_result_ns (void* cls, |
3066 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key, | 3068 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *key, |
3067 | struct GNUNET_TIME_Absolute expiration, | 3069 | struct GNUNET_TIME_Absolute expiration, |
3068 | const char *name, | 3070 | const char *name, |
3069 | unsigned int rd_count, | 3071 | unsigned int rd_count, |
3070 | const struct GNUNET_NAMESTORE_RecordData *rd, | 3072 | const struct GNUNET_NAMESTORE_RecordData *rd, |
3071 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 3073 | const struct GNUNET_CRYPTO_EccSignature *signature) |
3072 | { | 3074 | { |
3073 | struct ResolverHandle *rh = cls; | 3075 | struct ResolverHandle *rh = cls; |
3074 | struct GNUNET_TIME_Relative remaining_time; | 3076 | struct GNUNET_TIME_Relative remaining_time; |
@@ -3080,7 +3082,7 @@ process_delegation_result_ns (void* cls, | |||
3080 | 3082 | ||
3081 | rh->namestore_task = NULL; | 3083 | rh->namestore_task = NULL; |
3082 | GNUNET_CRYPTO_short_hash (key, | 3084 | GNUNET_CRYPTO_short_hash (key, |
3083 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 3085 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
3084 | &zone); | 3086 | &zone); |
3085 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3087 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3086 | "GNS_PHASE_DELEGATE_NS-%llu: Got %d records from authority lookup for `%s' in zone %s\n", | 3088 | "GNS_PHASE_DELEGATE_NS-%llu: Got %d records from authority lookup for `%s' in zone %s\n", |
@@ -3326,7 +3328,7 @@ gns_resolver_lookup_record (struct GNUNET_CRYPTO_ShortHashCode zone, | |||
3326 | struct GNUNET_CRYPTO_ShortHashCode pzone, | 3328 | struct GNUNET_CRYPTO_ShortHashCode pzone, |
3327 | uint32_t record_type, | 3329 | uint32_t record_type, |
3328 | const char* name, | 3330 | const char* name, |
3329 | struct GNUNET_CRYPTO_RsaPrivateKey *key, | 3331 | struct GNUNET_CRYPTO_EccPrivateKey *key, |
3330 | struct GNUNET_TIME_Relative timeout, | 3332 | struct GNUNET_TIME_Relative timeout, |
3331 | int only_cached, | 3333 | int only_cached, |
3332 | RecordLookupProcessor proc, | 3334 | RecordLookupProcessor proc, |
@@ -3509,12 +3511,12 @@ finish_shorten (struct ResolverHandle *rh, | |||
3509 | */ | 3511 | */ |
3510 | static void | 3512 | static void |
3511 | process_zone_to_name_shorten_root (void *cls, | 3513 | process_zone_to_name_shorten_root (void *cls, |
3512 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 3514 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
3513 | struct GNUNET_TIME_Absolute expire, | 3515 | struct GNUNET_TIME_Absolute expire, |
3514 | const char *name, | 3516 | const char *name, |
3515 | unsigned int rd_len, | 3517 | unsigned int rd_len, |
3516 | const struct GNUNET_NAMESTORE_RecordData *rd, | 3518 | const struct GNUNET_NAMESTORE_RecordData *rd, |
3517 | const struct GNUNET_CRYPTO_RsaSignature *signature); | 3519 | const struct GNUNET_CRYPTO_EccSignature *signature); |
3518 | 3520 | ||
3519 | 3521 | ||
3520 | /** | 3522 | /** |
@@ -3531,12 +3533,12 @@ process_zone_to_name_shorten_root (void *cls, | |||
3531 | */ | 3533 | */ |
3532 | static void | 3534 | static void |
3533 | process_zone_to_name_shorten_shorten (void *cls, | 3535 | process_zone_to_name_shorten_shorten (void *cls, |
3534 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 3536 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
3535 | struct GNUNET_TIME_Absolute expire, | 3537 | struct GNUNET_TIME_Absolute expire, |
3536 | const char *name, | 3538 | const char *name, |
3537 | unsigned int rd_len, | 3539 | unsigned int rd_len, |
3538 | const struct GNUNET_NAMESTORE_RecordData *rd, | 3540 | const struct GNUNET_NAMESTORE_RecordData *rd, |
3539 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 3541 | const struct GNUNET_CRYPTO_EccSignature *signature) |
3540 | { | 3542 | { |
3541 | struct ResolverHandle *rh = cls; | 3543 | struct ResolverHandle *rh = cls; |
3542 | struct NameShortenHandle* nsh = rh->proc_cls; | 3544 | struct NameShortenHandle* nsh = rh->proc_cls; |
@@ -3647,12 +3649,12 @@ process_zone_to_name_shorten_shorten (void *cls, | |||
3647 | */ | 3649 | */ |
3648 | static void | 3650 | static void |
3649 | process_zone_to_name_shorten_private (void *cls, | 3651 | process_zone_to_name_shorten_private (void *cls, |
3650 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 3652 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
3651 | struct GNUNET_TIME_Absolute expire, | 3653 | struct GNUNET_TIME_Absolute expire, |
3652 | const char *name, | 3654 | const char *name, |
3653 | unsigned int rd_len, | 3655 | unsigned int rd_len, |
3654 | const struct GNUNET_NAMESTORE_RecordData *rd, | 3656 | const struct GNUNET_NAMESTORE_RecordData *rd, |
3655 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 3657 | const struct GNUNET_CRYPTO_EccSignature *signature) |
3656 | { | 3658 | { |
3657 | struct ResolverHandle *rh = cls; | 3659 | struct ResolverHandle *rh = cls; |
3658 | struct NameShortenHandle* nsh = rh->proc_cls; | 3660 | struct NameShortenHandle* nsh = rh->proc_cls; |
@@ -3762,12 +3764,12 @@ process_zone_to_name_shorten_private (void *cls, | |||
3762 | */ | 3764 | */ |
3763 | static void | 3765 | static void |
3764 | process_zone_to_name_shorten_root (void *cls, | 3766 | process_zone_to_name_shorten_root (void *cls, |
3765 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 3767 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
3766 | struct GNUNET_TIME_Absolute expire, | 3768 | struct GNUNET_TIME_Absolute expire, |
3767 | const char *name, | 3769 | const char *name, |
3768 | unsigned int rd_len, | 3770 | unsigned int rd_len, |
3769 | const struct GNUNET_NAMESTORE_RecordData *rd, | 3771 | const struct GNUNET_NAMESTORE_RecordData *rd, |
3770 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 3772 | const struct GNUNET_CRYPTO_EccSignature *signature) |
3771 | { | 3773 | { |
3772 | struct ResolverHandle *rh = cls; | 3774 | struct ResolverHandle *rh = cls; |
3773 | struct NameShortenHandle* nsh = rh->proc_cls; | 3775 | struct NameShortenHandle* nsh = rh->proc_cls; |
@@ -3985,12 +3987,12 @@ handle_delegation_ns_shorten (void* cls, | |||
3985 | */ | 3987 | */ |
3986 | static void | 3988 | static void |
3987 | process_zone_to_name_zkey(void *cls, | 3989 | process_zone_to_name_zkey(void *cls, |
3988 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 3990 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
3989 | struct GNUNET_TIME_Absolute expire, | 3991 | struct GNUNET_TIME_Absolute expire, |
3990 | const char *name, | 3992 | const char *name, |
3991 | unsigned int rd_len, | 3993 | unsigned int rd_len, |
3992 | const struct GNUNET_NAMESTORE_RecordData *rd, | 3994 | const struct GNUNET_NAMESTORE_RecordData *rd, |
3993 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 3995 | const struct GNUNET_CRYPTO_EccSignature *signature) |
3994 | { | 3996 | { |
3995 | struct ResolverHandle *rh = cls; | 3997 | struct ResolverHandle *rh = cls; |
3996 | struct NameShortenHandle *nsh = rh->proc_cls; | 3998 | struct NameShortenHandle *nsh = rh->proc_cls; |
diff --git a/src/gns/gnunet-service-gns_resolver.h b/src/gns/gnunet-service-gns_resolver.h index c4b6a8aa2..1d236b427 100644 --- a/src/gns/gnunet-service-gns_resolver.h +++ b/src/gns/gnunet-service-gns_resolver.h | |||
@@ -327,7 +327,7 @@ struct ResolverHandle | |||
327 | * private key of an/our authoritative zone | 327 | * private key of an/our authoritative zone |
328 | * can be NULL but automatical PKEY import will not work | 328 | * can be NULL but automatical PKEY import will not work |
329 | */ | 329 | */ |
330 | struct GNUNET_CRYPTO_RsaPrivateKey *priv_key; | 330 | struct GNUNET_CRYPTO_EccPrivateKey *priv_key; |
331 | 331 | ||
332 | /** | 332 | /** |
333 | * the heap node associated with this lookup, null if timeout is set | 333 | * the heap node associated with this lookup, null if timeout is set |
@@ -484,7 +484,7 @@ struct GetPseuAuthorityHandle | |||
484 | /** | 484 | /** |
485 | * the private key of the zone to store the pseu in | 485 | * the private key of the zone to store the pseu in |
486 | */ | 486 | */ |
487 | struct GNUNET_CRYPTO_RsaPrivateKey *key; | 487 | struct GNUNET_CRYPTO_EccPrivateKey *key; |
488 | 488 | ||
489 | /** | 489 | /** |
490 | * a handle for dht lookups. should be NULL if no lookups are in progress | 490 | * a handle for dht lookups. should be NULL if no lookups are in progress |
@@ -573,7 +573,7 @@ gns_resolver_lookup_record (struct GNUNET_CRYPTO_ShortHashCode zone, | |||
573 | struct GNUNET_CRYPTO_ShortHashCode pzone, | 573 | struct GNUNET_CRYPTO_ShortHashCode pzone, |
574 | uint32_t record_type, | 574 | uint32_t record_type, |
575 | const char* name, | 575 | const char* name, |
576 | struct GNUNET_CRYPTO_RsaPrivateKey *key, | 576 | struct GNUNET_CRYPTO_EccPrivateKey *key, |
577 | struct GNUNET_TIME_Relative timeout, | 577 | struct GNUNET_TIME_Relative timeout, |
578 | int only_cached, | 578 | int only_cached, |
579 | RecordLookupProcessor proc, | 579 | RecordLookupProcessor proc, |
diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c index 50ad01215..72149ef4f 100644 --- a/src/gns/plugin_block_gns.c +++ b/src/gns/plugin_block_gns.c | |||
@@ -237,7 +237,7 @@ block_plugin_gns_get_key (void *cls, enum GNUNET_BLOCK_Type type, | |||
237 | return GNUNET_SYSERR; | 237 | return GNUNET_SYSERR; |
238 | } | 238 | } |
239 | GNUNET_CRYPTO_short_hash (&nrb->public_key, | 239 | GNUNET_CRYPTO_short_hash (&nrb->public_key, |
240 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 240 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
241 | &pkey_hash); | 241 | &pkey_hash); |
242 | GNUNET_GNS_get_key_for_record (name, &pkey_hash, key); | 242 | GNUNET_GNS_get_key_for_record (name, &pkey_hash, key); |
243 | return GNUNET_OK; | 243 | return GNUNET_OK; |
diff --git a/src/gns/test_gns_cname_lookup.c b/src/gns/test_gns_cname_lookup.c index 6870e897a..4d15175e1 100644 --- a/src/gns/test_gns_cname_lookup.c +++ b/src/gns/test_gns_cname_lookup.c | |||
@@ -334,9 +334,9 @@ do_check (void *cls, | |||
334 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 334 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
335 | struct GNUNET_TESTING_Peer *peer) | 335 | struct GNUNET_TESTING_Peer *peer) |
336 | { | 336 | { |
337 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 337 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
338 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 338 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
339 | struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 339 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
340 | char* alice_keyfile; | 340 | char* alice_keyfile; |
341 | struct GNUNET_NAMESTORE_RecordData rd; | 341 | struct GNUNET_NAMESTORE_RecordData rd; |
342 | const char* ip = TEST_IP_PLUS; | 342 | const char* ip = TEST_IP_PLUS; |
@@ -365,11 +365,11 @@ do_check (void *cls, | |||
365 | return; | 365 | return; |
366 | } | 366 | } |
367 | 367 | ||
368 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 368 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
369 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 369 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
370 | GNUNET_free(alice_keyfile); | 370 | GNUNET_free(alice_keyfile); |
371 | 371 | ||
372 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 372 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
373 | 373 | ||
374 | rd.expiration_time = UINT64_MAX; | 374 | rd.expiration_time = UINT64_MAX; |
375 | GNUNET_assert(1 == inet_pton (AF_INET, ip, &web)); | 375 | GNUNET_assert(1 == inet_pton (AF_INET, ip, &web)); |
@@ -429,8 +429,8 @@ do_check (void *cls, | |||
429 | &rd, | 429 | &rd, |
430 | &commence_testing, | 430 | &commence_testing, |
431 | NULL); | 431 | NULL); |
432 | GNUNET_CRYPTO_rsa_key_free(alice_key); | 432 | GNUNET_CRYPTO_ecc_key_free(alice_key); |
433 | GNUNET_CRYPTO_rsa_key_free(bob_key); | 433 | GNUNET_CRYPTO_ecc_key_free(bob_key); |
434 | } | 434 | } |
435 | 435 | ||
436 | 436 | ||
diff --git a/src/gns/test_gns_dht_delegated_lookup.c b/src/gns/test_gns_dht_delegated_lookup.c index 1eb77d821..ded45ecb0 100644 --- a/src/gns/test_gns_dht_delegated_lookup.c +++ b/src/gns/test_gns_dht_delegated_lookup.c | |||
@@ -65,10 +65,10 @@ static struct GNUNET_DHT_Handle *dht_handle; | |||
65 | 65 | ||
66 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 66 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
67 | 67 | ||
68 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 68 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
69 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 69 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
70 | static struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 70 | static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
71 | static struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 71 | static struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
72 | 72 | ||
73 | 73 | ||
74 | /** | 74 | /** |
@@ -216,7 +216,7 @@ put_dht(void *cls, int32_t success, const char *emsg) | |||
216 | struct GNUNET_HashCode zone_hash_double; | 216 | struct GNUNET_HashCode zone_hash_double; |
217 | uint32_t rd_payload_length; | 217 | uint32_t rd_payload_length; |
218 | char* nrb_data = NULL; | 218 | char* nrb_data = NULL; |
219 | struct GNUNET_CRYPTO_RsaSignature *sig; | 219 | struct GNUNET_CRYPTO_EccSignature *sig; |
220 | struct GNUNET_NAMESTORE_RecordData rd; | 220 | struct GNUNET_NAMESTORE_RecordData rd; |
221 | char* ip = TEST_IP; | 221 | char* ip = TEST_IP; |
222 | struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); | 222 | struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); |
@@ -262,7 +262,7 @@ put_dht(void *cls, int32_t success, const char *emsg) | |||
262 | } | 262 | } |
263 | GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); | 263 | GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); |
264 | GNUNET_CRYPTO_short_hash(&bob_pkey, | 264 | GNUNET_CRYPTO_short_hash(&bob_pkey, |
265 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 265 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
266 | &zone_hash); | 266 | &zone_hash); |
267 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); | 267 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); |
268 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); | 268 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); |
@@ -330,13 +330,13 @@ do_check (void *cls, | |||
330 | return; | 330 | return; |
331 | } | 331 | } |
332 | 332 | ||
333 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 333 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
334 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 334 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
335 | 335 | ||
336 | GNUNET_free(alice_keyfile); | 336 | GNUNET_free(alice_keyfile); |
337 | 337 | ||
338 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 338 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
339 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 339 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
340 | GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); | 340 | GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); |
341 | 341 | ||
342 | struct GNUNET_NAMESTORE_RecordData rd; | 342 | struct GNUNET_NAMESTORE_RecordData rd; |
diff --git a/src/gns/test_gns_dht_three_peers.c b/src/gns/test_gns_dht_three_peers.c index ee2c36e3b..227ca4606 100644 --- a/src/gns/test_gns_dht_three_peers.c +++ b/src/gns/test_gns_dht_three_peers.c | |||
@@ -308,8 +308,8 @@ static int | |||
308 | setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) | 308 | setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) |
309 | { | 309 | { |
310 | char* keyfile; | 310 | char* keyfile; |
311 | struct GNUNET_CRYPTO_RsaPrivateKey *key; | 311 | struct GNUNET_CRYPTO_EccPrivateKey *key; |
312 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 312 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; |
313 | struct in_addr *web; | 313 | struct in_addr *web; |
314 | struct GNUNET_NAMESTORE_RecordData rd; | 314 | struct GNUNET_NAMESTORE_RecordData rd; |
315 | 315 | ||
@@ -324,7 +324,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
324 | return GNUNET_SYSERR; | 324 | return GNUNET_SYSERR; |
325 | } | 325 | } |
326 | 326 | ||
327 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 327 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
328 | if (NULL == key) | 328 | if (NULL == key) |
329 | { | 329 | { |
330 | 330 | ||
@@ -336,12 +336,12 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
336 | if (NULL == nh[0]) | 336 | if (NULL == nh[0]) |
337 | { | 337 | { |
338 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n"); | 338 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n"); |
339 | GNUNET_CRYPTO_rsa_key_free (key); | 339 | GNUNET_CRYPTO_ecc_key_free (key); |
340 | GNUNET_free (keyfile); | 340 | GNUNET_free (keyfile); |
341 | return GNUNET_SYSERR; | 341 | return GNUNET_SYSERR; |
342 | } | 342 | } |
343 | 343 | ||
344 | GNUNET_CRYPTO_rsa_key_get_public (key, &pkey); | 344 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); |
345 | GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &dave_hash); | 345 | GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &dave_hash); |
346 | 346 | ||
347 | rd.expiration_time = UINT64_MAX; | 347 | rd.expiration_time = UINT64_MAX; |
@@ -362,7 +362,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
362 | 362 | ||
363 | GNUNET_NAMESTORE_record_create (nh[0], key, GNUNET_GNS_MASTERZONE_STR, &rd, &cont_ns, nh[0]); | 363 | GNUNET_NAMESTORE_record_create (nh[0], key, GNUNET_GNS_MASTERZONE_STR, &rd, &cont_ns, nh[0]); |
364 | 364 | ||
365 | GNUNET_CRYPTO_rsa_key_free(key); | 365 | GNUNET_CRYPTO_ecc_key_free(key); |
366 | GNUNET_free(keyfile); | 366 | GNUNET_free(keyfile); |
367 | GNUNET_free(web); | 367 | GNUNET_free(web); |
368 | dave_is_setup = GNUNET_YES; | 368 | dave_is_setup = GNUNET_YES; |
@@ -374,8 +374,8 @@ static int | |||
374 | setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) | 374 | setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) |
375 | { | 375 | { |
376 | char* keyfile; | 376 | char* keyfile; |
377 | struct GNUNET_CRYPTO_RsaPrivateKey *key; | 377 | struct GNUNET_CRYPTO_EccPrivateKey *key; |
378 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey; | 378 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; |
379 | struct GNUNET_NAMESTORE_RecordData rd; | 379 | struct GNUNET_NAMESTORE_RecordData rd; |
380 | 380 | ||
381 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob\n"); | 381 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob\n"); |
@@ -389,7 +389,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
389 | return GNUNET_SYSERR; | 389 | return GNUNET_SYSERR; |
390 | } | 390 | } |
391 | 391 | ||
392 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 392 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
393 | if (NULL == key) | 393 | if (NULL == key) |
394 | { | 394 | { |
395 | 395 | ||
@@ -402,12 +402,12 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
402 | if (NULL == nh[1]) | 402 | if (NULL == nh[1]) |
403 | { | 403 | { |
404 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n"); | 404 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n"); |
405 | GNUNET_CRYPTO_rsa_key_free (key); | 405 | GNUNET_CRYPTO_ecc_key_free (key); |
406 | GNUNET_free (keyfile); | 406 | GNUNET_free (keyfile); |
407 | return GNUNET_SYSERR; | 407 | return GNUNET_SYSERR; |
408 | } | 408 | } |
409 | 409 | ||
410 | GNUNET_CRYPTO_rsa_key_get_public (key, &pkey); | 410 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); |
411 | GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &bob_hash); | 411 | GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &bob_hash); |
412 | 412 | ||
413 | rd.expiration_time = UINT64_MAX; | 413 | rd.expiration_time = UINT64_MAX; |
@@ -418,7 +418,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
418 | 418 | ||
419 | GNUNET_NAMESTORE_record_create (nh[1], key, "buddy", &rd, &cont_ns, nh[1]); | 419 | GNUNET_NAMESTORE_record_create (nh[1], key, "buddy", &rd, &cont_ns, nh[1]); |
420 | 420 | ||
421 | GNUNET_CRYPTO_rsa_key_free(key); | 421 | GNUNET_CRYPTO_ecc_key_free(key); |
422 | GNUNET_free(keyfile); | 422 | GNUNET_free(keyfile); |
423 | bob_is_setup = GNUNET_YES; | 423 | bob_is_setup = GNUNET_YES; |
424 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob done\n"); | 424 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob done\n"); |
@@ -429,7 +429,7 @@ static int | |||
429 | setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) | 429 | setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) |
430 | { | 430 | { |
431 | char* keyfile; | 431 | char* keyfile; |
432 | struct GNUNET_CRYPTO_RsaPrivateKey *key; | 432 | struct GNUNET_CRYPTO_EccPrivateKey *key; |
433 | struct GNUNET_NAMESTORE_RecordData rd; | 433 | struct GNUNET_NAMESTORE_RecordData rd; |
434 | 434 | ||
435 | cfg_handles[2] = GNUNET_CONFIGURATION_dup (cfg); | 435 | cfg_handles[2] = GNUNET_CONFIGURATION_dup (cfg); |
@@ -442,7 +442,7 @@ setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
442 | return GNUNET_SYSERR; | 442 | return GNUNET_SYSERR; |
443 | } | 443 | } |
444 | 444 | ||
445 | key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); | 445 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
446 | if (NULL == key) | 446 | if (NULL == key) |
447 | { | 447 | { |
448 | 448 | ||
@@ -455,7 +455,7 @@ setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
455 | if (NULL == nh[2]) | 455 | if (NULL == nh[2]) |
456 | { | 456 | { |
457 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n"); | 457 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n"); |
458 | GNUNET_CRYPTO_rsa_key_free (key); | 458 | GNUNET_CRYPTO_ecc_key_free (key); |
459 | GNUNET_free (keyfile); | 459 | GNUNET_free (keyfile); |
460 | return GNUNET_SYSERR; | 460 | return GNUNET_SYSERR; |
461 | } | 461 | } |
@@ -473,12 +473,12 @@ setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
473 | if (NULL == gh) | 473 | if (NULL == gh) |
474 | { | 474 | { |
475 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to gns\n"); | 475 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to gns\n"); |
476 | GNUNET_CRYPTO_rsa_key_free (key); | 476 | GNUNET_CRYPTO_ecc_key_free (key); |
477 | GNUNET_free (keyfile); | 477 | GNUNET_free (keyfile); |
478 | return GNUNET_SYSERR; | 478 | return GNUNET_SYSERR; |
479 | } | 479 | } |
480 | 480 | ||
481 | GNUNET_CRYPTO_rsa_key_free (key); | 481 | GNUNET_CRYPTO_ecc_key_free (key); |
482 | GNUNET_free (keyfile); | 482 | GNUNET_free (keyfile); |
483 | alice_is_setup = GNUNET_YES; | 483 | alice_is_setup = GNUNET_YES; |
484 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up alice done\n"); | 484 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up alice done\n"); |
diff --git a/src/gns/test_gns_max_queries.c b/src/gns/test_gns_max_queries.c index 00caf8335..16084eb4b 100644 --- a/src/gns/test_gns_max_queries.c +++ b/src/gns/test_gns_max_queries.c | |||
@@ -252,10 +252,10 @@ do_check (void *cls, | |||
252 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 252 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
253 | struct GNUNET_TESTING_Peer *peer) | 253 | struct GNUNET_TESTING_Peer *peer) |
254 | { | 254 | { |
255 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 255 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
256 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 256 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
257 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 257 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
258 | struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 258 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
259 | char* alice_keyfile; | 259 | char* alice_keyfile; |
260 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 260 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
261 | 261 | ||
@@ -292,11 +292,11 @@ do_check (void *cls, | |||
292 | } | 292 | } |
293 | requests = GNUNET_malloc ((max_parallel_lookups + TEST_ADDITIONAL_LOOKUPS + 1) * | 293 | requests = GNUNET_malloc ((max_parallel_lookups + TEST_ADDITIONAL_LOOKUPS + 1) * |
294 | sizeof (struct GNUNET_GNS_LookupRequest *)); | 294 | sizeof (struct GNUNET_GNS_LookupRequest *)); |
295 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 295 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
296 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 296 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
297 | 297 | ||
298 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 298 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
299 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 299 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
300 | 300 | ||
301 | GNUNET_free(alice_keyfile); | 301 | GNUNET_free(alice_keyfile); |
302 | 302 | ||
@@ -329,8 +329,8 @@ do_check (void *cls, | |||
329 | &commence_testing, | 329 | &commence_testing, |
330 | NULL); | 330 | NULL); |
331 | 331 | ||
332 | GNUNET_CRYPTO_rsa_key_free(alice_key); | 332 | GNUNET_CRYPTO_ecc_key_free(alice_key); |
333 | GNUNET_CRYPTO_rsa_key_free(bob_key); | 333 | GNUNET_CRYPTO_ecc_key_free(bob_key); |
334 | GNUNET_free(web); | 334 | GNUNET_free(web); |
335 | 335 | ||
336 | } | 336 | } |
diff --git a/src/gns/test_gns_ns_lookup.c b/src/gns/test_gns_ns_lookup.c index f48ab8030..e0803b848 100644 --- a/src/gns/test_gns_ns_lookup.c +++ b/src/gns/test_gns_ns_lookup.c | |||
@@ -134,7 +134,7 @@ static struct GNUNET_NAMESTORE_QueueEntry *qe; | |||
134 | /** | 134 | /** |
135 | * Our private key for signing records. | 135 | * Our private key for signing records. |
136 | */ | 136 | */ |
137 | static struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 137 | static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
138 | 138 | ||
139 | 139 | ||
140 | /** | 140 | /** |
@@ -174,7 +174,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
174 | } | 174 | } |
175 | if (NULL != alice_key) | 175 | if (NULL != alice_key) |
176 | { | 176 | { |
177 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 177 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
178 | alice_key = NULL; | 178 | alice_key = NULL; |
179 | } | 179 | } |
180 | GNUNET_break (0); | 180 | GNUNET_break (0); |
@@ -229,7 +229,7 @@ end_now (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
229 | } | 229 | } |
230 | if (NULL != alice_key) | 230 | if (NULL != alice_key) |
231 | { | 231 | { |
232 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 232 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
233 | alice_key = NULL; | 233 | alice_key = NULL; |
234 | } | 234 | } |
235 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n"); | 235 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer!\n"); |
@@ -592,7 +592,7 @@ do_check (void *cls, | |||
592 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 592 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
593 | struct GNUNET_TESTING_Peer *peer) | 593 | struct GNUNET_TESTING_Peer *peer) |
594 | { | 594 | { |
595 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 595 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
596 | char* alice_keyfile; | 596 | char* alice_keyfile; |
597 | struct GNUNET_NAMESTORE_RecordData rd; | 597 | struct GNUNET_NAMESTORE_RecordData rd; |
598 | struct in_addr ns; | 598 | struct in_addr ns; |
@@ -621,8 +621,8 @@ do_check (void *cls, | |||
621 | return; | 621 | return; |
622 | } | 622 | } |
623 | 623 | ||
624 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 624 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
625 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 625 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
626 | GNUNET_free (alice_keyfile); | 626 | GNUNET_free (alice_keyfile); |
627 | 627 | ||
628 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 628 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c index 10b2ec810..d07f197c3 100644 --- a/src/gns/test_gns_proxy.c +++ b/src/gns/test_gns_proxy.c | |||
@@ -364,7 +364,7 @@ run (void *cls, | |||
364 | struct GNUNET_TESTING_Peer *peer) | 364 | struct GNUNET_TESTING_Peer *peer) |
365 | { | 365 | { |
366 | enum MHD_FLAG flags; | 366 | enum MHD_FLAG flags; |
367 | struct GNUNET_CRYPTO_RsaPrivateKey *host_key; | 367 | struct GNUNET_CRYPTO_EccPrivateKey *host_key; |
368 | struct GNUNET_NAMESTORE_RecordData rd; | 368 | struct GNUNET_NAMESTORE_RecordData rd; |
369 | char *zone_keyfile; | 369 | char *zone_keyfile; |
370 | 370 | ||
@@ -421,7 +421,7 @@ run (void *cls, | |||
421 | return; | 421 | return; |
422 | } | 422 | } |
423 | 423 | ||
424 | host_key = GNUNET_CRYPTO_rsa_key_create_from_file (zone_keyfile); | 424 | host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile); |
425 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; | 425 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; |
426 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_GNS_RECORD_A, | 426 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_GNS_RECORD_A, |
427 | "127.0.0.1", | 427 | "127.0.0.1", |
@@ -438,7 +438,7 @@ run (void *cls, | |||
438 | 438 | ||
439 | GNUNET_free ((void**)rd.data); | 439 | GNUNET_free ((void**)rd.data); |
440 | GNUNET_free (zone_keyfile); | 440 | GNUNET_free (zone_keyfile); |
441 | GNUNET_CRYPTO_rsa_key_free (host_key); | 441 | GNUNET_CRYPTO_ecc_key_free (host_key); |
442 | } | 442 | } |
443 | 443 | ||
444 | int | 444 | int |
@@ -460,7 +460,7 @@ main (int argc, char *const *argv) | |||
460 | } | 460 | } |
461 | GNUNET_free (binary); | 461 | GNUNET_free (binary); |
462 | 462 | ||
463 | GNUNET_CRYPTO_rsa_setup_hostkey ("test_gns_proxy.conf"); | 463 | GNUNET_CRYPTO_ecc_setup_hostkey ("test_gns_proxy.conf"); |
464 | 464 | ||
465 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) | 465 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) |
466 | { | 466 | { |
diff --git a/src/gns/test_gns_pseu_shorten.c b/src/gns/test_gns_pseu_shorten.c index 5e2f1fc11..a104d38fc 100644 --- a/src/gns/test_gns_pseu_shorten.c +++ b/src/gns/test_gns_pseu_shorten.c | |||
@@ -71,16 +71,16 @@ static struct GNUNET_DHT_Handle *dht_handle; | |||
71 | 71 | ||
72 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 72 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
73 | 73 | ||
74 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 74 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
75 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 75 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
76 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey; | 76 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded our_pkey; |
77 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded priv_pkey; | 77 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded priv_pkey; |
78 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded short_pkey; | 78 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded short_pkey; |
79 | static struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 79 | static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
80 | static struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 80 | static struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
81 | static struct GNUNET_CRYPTO_RsaPrivateKey *our_key; | 81 | static struct GNUNET_CRYPTO_EccPrivateKey *our_key; |
82 | static struct GNUNET_CRYPTO_RsaPrivateKey *priv_key; | 82 | static struct GNUNET_CRYPTO_EccPrivateKey *priv_key; |
83 | static struct GNUNET_CRYPTO_RsaPrivateKey *short_key; | 83 | static struct GNUNET_CRYPTO_EccPrivateKey *short_key; |
84 | static struct GNUNET_CRYPTO_ShortHashCode alice_hash; | 84 | static struct GNUNET_CRYPTO_ShortHashCode alice_hash; |
85 | static struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 85 | static struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
86 | static struct GNUNET_CRYPTO_ShortHashCode our_zone; | 86 | static struct GNUNET_CRYPTO_ShortHashCode our_zone; |
@@ -236,9 +236,9 @@ on_lookup_result(void *cls, uint32_t rd_count, | |||
236 | static void | 236 | static void |
237 | commence_testing (void *cls, int success) | 237 | commence_testing (void *cls, int success) |
238 | { | 238 | { |
239 | GNUNET_CRYPTO_rsa_key_free(our_key); | 239 | GNUNET_CRYPTO_ecc_key_free(our_key); |
240 | GNUNET_CRYPTO_rsa_key_free(bob_key); | 240 | GNUNET_CRYPTO_ecc_key_free(bob_key); |
241 | GNUNET_CRYPTO_rsa_key_free(alice_key); | 241 | GNUNET_CRYPTO_ecc_key_free(alice_key); |
242 | GNUNET_NAMESTORE_disconnect (namestore_handle); | 242 | GNUNET_NAMESTORE_disconnect (namestore_handle); |
243 | namestore_handle = NULL; | 243 | namestore_handle = NULL; |
244 | gns_handle = GNUNET_GNS_connect(cfg); | 244 | gns_handle = GNUNET_GNS_connect(cfg); |
@@ -267,7 +267,7 @@ put_pseu_dht (void *cls, int success) | |||
267 | struct GNUNET_HashCode zone_hash_double; | 267 | struct GNUNET_HashCode zone_hash_double; |
268 | uint32_t rd_payload_length; | 268 | uint32_t rd_payload_length; |
269 | char* nrb_data = NULL; | 269 | char* nrb_data = NULL; |
270 | struct GNUNET_CRYPTO_RsaSignature *sig; | 270 | struct GNUNET_CRYPTO_EccSignature *sig; |
271 | struct GNUNET_NAMESTORE_RecordData rd; | 271 | struct GNUNET_NAMESTORE_RecordData rd; |
272 | 272 | ||
273 | memset (&rd, 0, sizeof (struct GNUNET_NAMESTORE_RecordData)); | 273 | memset (&rd, 0, sizeof (struct GNUNET_NAMESTORE_RecordData)); |
@@ -308,9 +308,9 @@ put_pseu_dht (void *cls, int success) | |||
308 | { | 308 | { |
309 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n"); | 309 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n"); |
310 | ok = 3; | 310 | ok = 3; |
311 | GNUNET_CRYPTO_rsa_key_free(our_key); | 311 | GNUNET_CRYPTO_ecc_key_free(our_key); |
312 | GNUNET_CRYPTO_rsa_key_free(bob_key); | 312 | GNUNET_CRYPTO_ecc_key_free(bob_key); |
313 | GNUNET_CRYPTO_rsa_key_free(alice_key); | 313 | GNUNET_CRYPTO_ecc_key_free(alice_key); |
314 | GNUNET_free(sig); | 314 | GNUNET_free(sig); |
315 | GNUNET_free (nrb); | 315 | GNUNET_free (nrb); |
316 | end_badly_now (); | 316 | end_badly_now (); |
@@ -318,7 +318,7 @@ put_pseu_dht (void *cls, int success) | |||
318 | } | 318 | } |
319 | GNUNET_CRYPTO_short_hash(GNUNET_GNS_MASTERZONE_STR, strlen(GNUNET_GNS_MASTERZONE_STR), &name_hash); | 319 | GNUNET_CRYPTO_short_hash(GNUNET_GNS_MASTERZONE_STR, strlen(GNUNET_GNS_MASTERZONE_STR), &name_hash); |
320 | GNUNET_CRYPTO_short_hash(&alice_pkey, | 320 | GNUNET_CRYPTO_short_hash(&alice_pkey, |
321 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 321 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
322 | &zone_hash); | 322 | &zone_hash); |
323 | 323 | ||
324 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); | 324 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); |
@@ -355,7 +355,7 @@ put_www_dht(void *cls, int success) | |||
355 | struct GNUNET_HashCode zone_hash_double; | 355 | struct GNUNET_HashCode zone_hash_double; |
356 | uint32_t rd_payload_length; | 356 | uint32_t rd_payload_length; |
357 | char* nrb_data = NULL; | 357 | char* nrb_data = NULL; |
358 | struct GNUNET_CRYPTO_RsaSignature *sig; | 358 | struct GNUNET_CRYPTO_EccSignature *sig; |
359 | struct GNUNET_NAMESTORE_RecordData rd; | 359 | struct GNUNET_NAMESTORE_RecordData rd; |
360 | char* ip = TEST_IP; | 360 | char* ip = TEST_IP; |
361 | struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); | 361 | struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr)); |
@@ -396,9 +396,9 @@ put_www_dht(void *cls, int success) | |||
396 | { | 396 | { |
397 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n"); | 397 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n"); |
398 | ok = 3; | 398 | ok = 3; |
399 | GNUNET_CRYPTO_rsa_key_free(our_key); | 399 | GNUNET_CRYPTO_ecc_key_free(our_key); |
400 | GNUNET_CRYPTO_rsa_key_free(bob_key); | 400 | GNUNET_CRYPTO_ecc_key_free(bob_key); |
401 | GNUNET_CRYPTO_rsa_key_free(alice_key); | 401 | GNUNET_CRYPTO_ecc_key_free(alice_key); |
402 | GNUNET_free (sig); | 402 | GNUNET_free (sig); |
403 | GNUNET_free(web); | 403 | GNUNET_free(web); |
404 | GNUNET_free (nrb); | 404 | GNUNET_free (nrb); |
@@ -407,7 +407,7 @@ put_www_dht(void *cls, int success) | |||
407 | } | 407 | } |
408 | GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); | 408 | GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); |
409 | GNUNET_CRYPTO_short_hash(&alice_pkey, | 409 | GNUNET_CRYPTO_short_hash(&alice_pkey, |
410 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 410 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
411 | &zone_hash); | 411 | &zone_hash); |
412 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); | 412 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); |
413 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); | 413 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); |
@@ -443,7 +443,7 @@ put_pkey_dht(void *cls, int32_t success, const char *emsg) | |||
443 | struct GNUNET_HashCode zone_hash_double; | 443 | struct GNUNET_HashCode zone_hash_double; |
444 | uint32_t rd_payload_length; | 444 | uint32_t rd_payload_length; |
445 | char* nrb_data = NULL; | 445 | char* nrb_data = NULL; |
446 | struct GNUNET_CRYPTO_RsaSignature *sig; | 446 | struct GNUNET_CRYPTO_EccSignature *sig; |
447 | struct GNUNET_NAMESTORE_RecordData rd; | 447 | struct GNUNET_NAMESTORE_RecordData rd; |
448 | 448 | ||
449 | rd.expiration_time = UINT64_MAX; | 449 | rd.expiration_time = UINT64_MAX; |
@@ -477,9 +477,9 @@ put_pkey_dht(void *cls, int32_t success, const char *emsg) | |||
477 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n"); | 477 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n"); |
478 | ok = 3; | 478 | ok = 3; |
479 | 479 | ||
480 | GNUNET_CRYPTO_rsa_key_free (our_key); | 480 | GNUNET_CRYPTO_ecc_key_free (our_key); |
481 | GNUNET_CRYPTO_rsa_key_free (bob_key); | 481 | GNUNET_CRYPTO_ecc_key_free (bob_key); |
482 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 482 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
483 | GNUNET_free (sig); | 483 | GNUNET_free (sig); |
484 | GNUNET_free (nrb); | 484 | GNUNET_free (nrb); |
485 | end_badly_now (); | 485 | end_badly_now (); |
@@ -490,7 +490,7 @@ put_pkey_dht(void *cls, int32_t success, const char *emsg) | |||
490 | GNUNET_CRYPTO_short_hash(TEST_AUTHORITY_ALICE, | 490 | GNUNET_CRYPTO_short_hash(TEST_AUTHORITY_ALICE, |
491 | strlen(TEST_AUTHORITY_ALICE), &name_hash); | 491 | strlen(TEST_AUTHORITY_ALICE), &name_hash); |
492 | GNUNET_CRYPTO_short_hash(&bob_pkey, | 492 | GNUNET_CRYPTO_short_hash(&bob_pkey, |
493 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 493 | sizeof(struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
494 | &zone_hash); | 494 | &zone_hash); |
495 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); | 495 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); |
496 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); | 496 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); |
@@ -610,21 +610,21 @@ do_check (void *cls, | |||
610 | end_badly_now(); | 610 | end_badly_now(); |
611 | return; | 611 | return; |
612 | } | 612 | } |
613 | our_key = GNUNET_CRYPTO_rsa_key_create_from_file (our_keyfile); | 613 | our_key = GNUNET_CRYPTO_ecc_key_create_from_file (our_keyfile); |
614 | priv_key = GNUNET_CRYPTO_rsa_key_create_from_file (private_keyfile); | 614 | priv_key = GNUNET_CRYPTO_ecc_key_create_from_file (private_keyfile); |
615 | short_key = GNUNET_CRYPTO_rsa_key_create_from_file (shorten_keyfile); | 615 | short_key = GNUNET_CRYPTO_ecc_key_create_from_file (shorten_keyfile); |
616 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 616 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
617 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_ALICE); | 617 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_ALICE); |
618 | 618 | ||
619 | GNUNET_free(our_keyfile); | 619 | GNUNET_free(our_keyfile); |
620 | GNUNET_free(shorten_keyfile); | 620 | GNUNET_free(shorten_keyfile); |
621 | GNUNET_free(private_keyfile); | 621 | GNUNET_free(private_keyfile); |
622 | 622 | ||
623 | GNUNET_CRYPTO_rsa_key_get_public (our_key, &our_pkey); | 623 | GNUNET_CRYPTO_ecc_key_get_public (our_key, &our_pkey); |
624 | GNUNET_CRYPTO_rsa_key_get_public (priv_key, &priv_pkey); | 624 | GNUNET_CRYPTO_ecc_key_get_public (priv_key, &priv_pkey); |
625 | GNUNET_CRYPTO_rsa_key_get_public (short_key, &short_pkey); | 625 | GNUNET_CRYPTO_ecc_key_get_public (short_key, &short_pkey); |
626 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 626 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
627 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 627 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
628 | GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); | 628 | GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); |
629 | GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash); | 629 | GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash); |
630 | GNUNET_CRYPTO_short_hash(&our_pkey, sizeof(our_pkey), &our_zone); | 630 | GNUNET_CRYPTO_short_hash(&our_pkey, sizeof(our_pkey), &our_zone); |
diff --git a/src/gns/test_gns_revocation.c b/src/gns/test_gns_revocation.c index 8e677880a..540f58a35 100644 --- a/src/gns/test_gns_revocation.c +++ b/src/gns/test_gns_revocation.c | |||
@@ -180,12 +180,12 @@ do_check (void *cls, | |||
180 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 180 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
181 | struct GNUNET_TESTING_Peer *peer) | 181 | struct GNUNET_TESTING_Peer *peer) |
182 | { | 182 | { |
183 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 183 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
184 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 184 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
185 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 185 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
186 | struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 186 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
187 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 187 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
188 | struct GNUNET_CRYPTO_RsaSignature *sig; | 188 | struct GNUNET_CRYPTO_EccSignature *sig; |
189 | char* alice_keyfile; | 189 | char* alice_keyfile; |
190 | 190 | ||
191 | cfg = ccfg; | 191 | cfg = ccfg; |
@@ -209,11 +209,11 @@ do_check (void *cls, | |||
209 | return; | 209 | return; |
210 | } | 210 | } |
211 | 211 | ||
212 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 212 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
213 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 213 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
214 | 214 | ||
215 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 215 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
216 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 216 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
217 | 217 | ||
218 | struct GNUNET_NAMESTORE_RecordData rd; | 218 | struct GNUNET_NAMESTORE_RecordData rd; |
219 | char* ip = TEST_IP; | 219 | char* ip = TEST_IP; |
@@ -264,8 +264,8 @@ do_check (void *cls, | |||
264 | GNUNET_free (alice_keyfile); | 264 | GNUNET_free (alice_keyfile); |
265 | GNUNET_free (web); | 265 | GNUNET_free (web); |
266 | GNUNET_free (sig); | 266 | GNUNET_free (sig); |
267 | GNUNET_CRYPTO_rsa_key_free (bob_key); | 267 | GNUNET_CRYPTO_ecc_key_free (bob_key); |
268 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 268 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
269 | } | 269 | } |
270 | 270 | ||
271 | 271 | ||
diff --git a/src/gns/test_gns_simple_delegated_lookup.c b/src/gns/test_gns_simple_delegated_lookup.c index 393ddfb0e..f2610c167 100644 --- a/src/gns/test_gns_simple_delegated_lookup.c +++ b/src/gns/test_gns_simple_delegated_lookup.c | |||
@@ -189,12 +189,12 @@ do_check (void *cls, | |||
189 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 189 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
190 | struct GNUNET_TESTING_Peer *peer) | 190 | struct GNUNET_TESTING_Peer *peer) |
191 | { | 191 | { |
192 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 192 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
193 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 193 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
194 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 194 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
195 | struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 195 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
196 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 196 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
197 | struct GNUNET_CRYPTO_RsaSignature *sig; | 197 | struct GNUNET_CRYPTO_EccSignature *sig; |
198 | char* alice_keyfile; | 198 | char* alice_keyfile; |
199 | struct GNUNET_TIME_Absolute et; | 199 | struct GNUNET_TIME_Absolute et; |
200 | struct GNUNET_NAMESTORE_RecordData rd; | 200 | struct GNUNET_NAMESTORE_RecordData rd; |
@@ -223,10 +223,10 @@ do_check (void *cls, | |||
223 | GNUNET_SCHEDULER_shutdown (); | 223 | GNUNET_SCHEDULER_shutdown (); |
224 | return; | 224 | return; |
225 | } | 225 | } |
226 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 226 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
227 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 227 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
228 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 228 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
229 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 229 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
230 | rd.expiration_time = UINT64_MAX; | 230 | rd.expiration_time = UINT64_MAX; |
231 | GNUNET_assert (1 == inet_pton (AF_INET, ip, &web)); | 231 | GNUNET_assert (1 == inet_pton (AF_INET, ip, &web)); |
232 | GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); | 232 | GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); |
@@ -259,8 +259,8 @@ do_check (void *cls, | |||
259 | NULL); | 259 | NULL); |
260 | GNUNET_free (sig); | 260 | GNUNET_free (sig); |
261 | GNUNET_free (alice_keyfile); | 261 | GNUNET_free (alice_keyfile); |
262 | GNUNET_CRYPTO_rsa_key_free (bob_key); | 262 | GNUNET_CRYPTO_ecc_key_free (bob_key); |
263 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 263 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
264 | } | 264 | } |
265 | 265 | ||
266 | 266 | ||
diff --git a/src/gns/test_gns_simple_get_authority.c b/src/gns/test_gns_simple_get_authority.c index 111f8f1f9..300e7be5b 100644 --- a/src/gns/test_gns_simple_get_authority.c +++ b/src/gns/test_gns_simple_get_authority.c | |||
@@ -178,15 +178,15 @@ void do_check (void *cls, | |||
178 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 178 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
179 | struct GNUNET_TESTING_Peer *peer) | 179 | struct GNUNET_TESTING_Peer *peer) |
180 | { | 180 | { |
181 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey; | 181 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded our_pkey; |
182 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 182 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
183 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 183 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
184 | struct GNUNET_CRYPTO_RsaPrivateKey *our_key; | 184 | struct GNUNET_CRYPTO_EccPrivateKey *our_key; |
185 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 185 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
186 | struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 186 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
187 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 187 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
188 | struct GNUNET_CRYPTO_ShortHashCode alice_hash; | 188 | struct GNUNET_CRYPTO_ShortHashCode alice_hash; |
189 | struct GNUNET_CRYPTO_RsaSignature *sig; | 189 | struct GNUNET_CRYPTO_EccSignature *sig; |
190 | char* our_keyfile; | 190 | char* our_keyfile; |
191 | 191 | ||
192 | cfg = ccfg; | 192 | cfg = ccfg; |
@@ -211,15 +211,15 @@ void do_check (void *cls, | |||
211 | return; | 211 | return; |
212 | } | 212 | } |
213 | 213 | ||
214 | our_key = GNUNET_CRYPTO_rsa_key_create_from_file (our_keyfile); | 214 | our_key = GNUNET_CRYPTO_ecc_key_create_from_file (our_keyfile); |
215 | GNUNET_free(our_keyfile); | 215 | GNUNET_free(our_keyfile); |
216 | 216 | ||
217 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 217 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
218 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_ALICE); | 218 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_ALICE); |
219 | 219 | ||
220 | GNUNET_CRYPTO_rsa_key_get_public (our_key, &our_pkey); | 220 | GNUNET_CRYPTO_ecc_key_get_public (our_key, &our_pkey); |
221 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 221 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
222 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 222 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
223 | 223 | ||
224 | struct GNUNET_NAMESTORE_RecordData rd; | 224 | struct GNUNET_NAMESTORE_RecordData rd; |
225 | char* ip = TEST_IP; | 225 | char* ip = TEST_IP; |
@@ -298,9 +298,9 @@ void do_check (void *cls, | |||
298 | 298 | ||
299 | GNUNET_free (web); | 299 | GNUNET_free (web); |
300 | GNUNET_free (sig); | 300 | GNUNET_free (sig); |
301 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 301 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
302 | GNUNET_CRYPTO_rsa_key_free (bob_key); | 302 | GNUNET_CRYPTO_ecc_key_free (bob_key); |
303 | GNUNET_CRYPTO_rsa_key_free (our_key); | 303 | GNUNET_CRYPTO_ecc_key_free (our_key); |
304 | } | 304 | } |
305 | 305 | ||
306 | 306 | ||
diff --git a/src/gns/test_gns_simple_lookup.c b/src/gns/test_gns_simple_lookup.c index 96283df5b..ff325a464 100644 --- a/src/gns/test_gns_simple_lookup.c +++ b/src/gns/test_gns_simple_lookup.c | |||
@@ -221,8 +221,8 @@ do_check (void *cls, | |||
221 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 221 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
222 | struct GNUNET_TESTING_Peer *peer) | 222 | struct GNUNET_TESTING_Peer *peer) |
223 | { | 223 | { |
224 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 224 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
225 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 225 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
226 | struct GNUNET_NAMESTORE_RecordData rd; | 226 | struct GNUNET_NAMESTORE_RecordData rd; |
227 | char* alice_keyfile; | 227 | char* alice_keyfile; |
228 | char* ip = TEST_IP; | 228 | char* ip = TEST_IP; |
@@ -251,8 +251,8 @@ do_check (void *cls, | |||
251 | return; | 251 | return; |
252 | } | 252 | } |
253 | 253 | ||
254 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 254 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
255 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 255 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
256 | GNUNET_free (alice_keyfile); | 256 | GNUNET_free (alice_keyfile); |
257 | rd.expiration_time = UINT64_MAX; | 257 | rd.expiration_time = UINT64_MAX; |
258 | GNUNET_assert (1 == inet_pton (AF_INET, ip, &web)); | 258 | GNUNET_assert (1 == inet_pton (AF_INET, ip, &web)); |
@@ -266,7 +266,7 @@ do_check (void *cls, | |||
266 | &rd, | 266 | &rd, |
267 | &commence_testing, | 267 | &commence_testing, |
268 | NULL); | 268 | NULL); |
269 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 269 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
270 | } | 270 | } |
271 | 271 | ||
272 | 272 | ||
diff --git a/src/gns/test_gns_simple_mx_lookup.c b/src/gns/test_gns_simple_mx_lookup.c index cfaea67ad..f928a3913 100644 --- a/src/gns/test_gns_simple_mx_lookup.c +++ b/src/gns/test_gns_simple_mx_lookup.c | |||
@@ -180,12 +180,12 @@ do_check (void *cls, | |||
180 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 180 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
181 | struct GNUNET_TESTING_Peer *peer) | 181 | struct GNUNET_TESTING_Peer *peer) |
182 | { | 182 | { |
183 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 183 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
184 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 184 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
185 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 185 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
186 | struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 186 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
187 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 187 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
188 | struct GNUNET_CRYPTO_RsaSignature *sig; | 188 | struct GNUNET_CRYPTO_EccSignature *sig; |
189 | char* alice_keyfile; | 189 | char* alice_keyfile; |
190 | struct GNUNET_TIME_Absolute et; | 190 | struct GNUNET_TIME_Absolute et; |
191 | 191 | ||
@@ -210,11 +210,11 @@ do_check (void *cls, | |||
210 | return; | 210 | return; |
211 | } | 211 | } |
212 | 212 | ||
213 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 213 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
214 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 214 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
215 | 215 | ||
216 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 216 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
217 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 217 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
218 | 218 | ||
219 | struct GNUNET_NAMESTORE_RecordData rd; | 219 | struct GNUNET_NAMESTORE_RecordData rd; |
220 | char* ip = TEST_IP; | 220 | char* ip = TEST_IP; |
@@ -282,8 +282,8 @@ do_check (void *cls, | |||
282 | GNUNET_free (mx_record); | 282 | GNUNET_free (mx_record); |
283 | GNUNET_free (mail); | 283 | GNUNET_free (mail); |
284 | GNUNET_free (sig); | 284 | GNUNET_free (sig); |
285 | GNUNET_CRYPTO_rsa_key_free (bob_key); | 285 | GNUNET_CRYPTO_ecc_key_free (bob_key); |
286 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 286 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
287 | } | 287 | } |
288 | 288 | ||
289 | 289 | ||
diff --git a/src/gns/test_gns_simple_shorten.c b/src/gns/test_gns_simple_shorten.c index c6d49f82f..9b61a41c8 100644 --- a/src/gns/test_gns_simple_shorten.c +++ b/src/gns/test_gns_simple_shorten.c | |||
@@ -61,10 +61,10 @@ static struct GNUNET_GNS_Handle *gns_handle; | |||
61 | 61 | ||
62 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 62 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
63 | 63 | ||
64 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded priv_pkey; | 64 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded priv_pkey; |
65 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded short_pkey; | 65 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded short_pkey; |
66 | struct GNUNET_CRYPTO_RsaPrivateKey *priv_key; | 66 | struct GNUNET_CRYPTO_EccPrivateKey *priv_key; |
67 | struct GNUNET_CRYPTO_RsaPrivateKey *short_key; | 67 | struct GNUNET_CRYPTO_EccPrivateKey *short_key; |
68 | 68 | ||
69 | struct GNUNET_CRYPTO_ShortHashCode priv_zone; | 69 | struct GNUNET_CRYPTO_ShortHashCode priv_zone; |
70 | struct GNUNET_CRYPTO_ShortHashCode short_zone; | 70 | struct GNUNET_CRYPTO_ShortHashCode short_zone; |
@@ -170,15 +170,15 @@ void do_check (void *cls, | |||
170 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 170 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
171 | struct GNUNET_TESTING_Peer *peer) | 171 | struct GNUNET_TESTING_Peer *peer) |
172 | { | 172 | { |
173 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey; | 173 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded our_pkey; |
174 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 174 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
175 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 175 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
176 | struct GNUNET_CRYPTO_RsaPrivateKey *our_key; | 176 | struct GNUNET_CRYPTO_EccPrivateKey *our_key; |
177 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 177 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
178 | struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 178 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
179 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 179 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
180 | struct GNUNET_CRYPTO_ShortHashCode alice_hash; | 180 | struct GNUNET_CRYPTO_ShortHashCode alice_hash; |
181 | struct GNUNET_CRYPTO_RsaSignature *sig; | 181 | struct GNUNET_CRYPTO_EccSignature *sig; |
182 | char* our_keyfile; | 182 | char* our_keyfile; |
183 | char* private_keyfile; | 183 | char* private_keyfile; |
184 | char* shorten_keyfile; | 184 | char* shorten_keyfile; |
@@ -226,22 +226,22 @@ void do_check (void *cls, | |||
226 | return; | 226 | return; |
227 | } | 227 | } |
228 | 228 | ||
229 | our_key = GNUNET_CRYPTO_rsa_key_create_from_file (our_keyfile); | 229 | our_key = GNUNET_CRYPTO_ecc_key_create_from_file (our_keyfile); |
230 | GNUNET_free(our_keyfile); | 230 | GNUNET_free(our_keyfile); |
231 | 231 | ||
232 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 232 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
233 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_ALICE); | 233 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_ALICE); |
234 | priv_key = GNUNET_CRYPTO_rsa_key_create_from_file (private_keyfile); | 234 | priv_key = GNUNET_CRYPTO_ecc_key_create_from_file (private_keyfile); |
235 | short_key = GNUNET_CRYPTO_rsa_key_create_from_file (shorten_keyfile); | 235 | short_key = GNUNET_CRYPTO_ecc_key_create_from_file (shorten_keyfile); |
236 | 236 | ||
237 | GNUNET_free(shorten_keyfile); | 237 | GNUNET_free(shorten_keyfile); |
238 | GNUNET_free(private_keyfile); | 238 | GNUNET_free(private_keyfile); |
239 | 239 | ||
240 | GNUNET_CRYPTO_rsa_key_get_public (our_key, &our_pkey); | 240 | GNUNET_CRYPTO_ecc_key_get_public (our_key, &our_pkey); |
241 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 241 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
242 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 242 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
243 | GNUNET_CRYPTO_rsa_key_get_public (priv_key, &priv_pkey); | 243 | GNUNET_CRYPTO_ecc_key_get_public (priv_key, &priv_pkey); |
244 | GNUNET_CRYPTO_rsa_key_get_public (short_key, &short_pkey); | 244 | GNUNET_CRYPTO_ecc_key_get_public (short_key, &short_pkey); |
245 | 245 | ||
246 | GNUNET_CRYPTO_short_hash(&priv_pkey, sizeof(priv_pkey), &priv_zone); | 246 | GNUNET_CRYPTO_short_hash(&priv_pkey, sizeof(priv_pkey), &priv_zone); |
247 | GNUNET_CRYPTO_short_hash(&short_pkey, sizeof(short_pkey), &short_zone); | 247 | GNUNET_CRYPTO_short_hash(&short_pkey, sizeof(short_pkey), &short_zone); |
@@ -318,11 +318,11 @@ void do_check (void *cls, | |||
318 | NULL); | 318 | NULL); |
319 | 319 | ||
320 | GNUNET_free(web); | 320 | GNUNET_free(web); |
321 | GNUNET_CRYPTO_rsa_key_free(our_key); | 321 | GNUNET_CRYPTO_ecc_key_free(our_key); |
322 | GNUNET_CRYPTO_rsa_key_free(bob_key); | 322 | GNUNET_CRYPTO_ecc_key_free(bob_key); |
323 | GNUNET_CRYPTO_rsa_key_free(alice_key); | 323 | GNUNET_CRYPTO_ecc_key_free(alice_key); |
324 | GNUNET_CRYPTO_rsa_key_free(priv_key); | 324 | GNUNET_CRYPTO_ecc_key_free(priv_key); |
325 | GNUNET_CRYPTO_rsa_key_free(short_key); | 325 | GNUNET_CRYPTO_ecc_key_free(short_key); |
326 | 326 | ||
327 | } | 327 | } |
328 | 328 | ||
diff --git a/src/gns/test_gns_simple_srv_lookup.c b/src/gns/test_gns_simple_srv_lookup.c index 40e5aec8d..c0208639d 100644 --- a/src/gns/test_gns_simple_srv_lookup.c +++ b/src/gns/test_gns_simple_srv_lookup.c | |||
@@ -182,12 +182,12 @@ do_check (void *cls, | |||
182 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 182 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
183 | struct GNUNET_TESTING_Peer *peer) | 183 | struct GNUNET_TESTING_Peer *peer) |
184 | { | 184 | { |
185 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 185 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
186 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 186 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
187 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 187 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
188 | struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 188 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
189 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 189 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
190 | struct GNUNET_CRYPTO_RsaSignature *sig; | 190 | struct GNUNET_CRYPTO_EccSignature *sig; |
191 | char* alice_keyfile; | 191 | char* alice_keyfile; |
192 | struct srv_data *srv_data; | 192 | struct srv_data *srv_data; |
193 | struct GNUNET_TIME_Absolute et; | 193 | struct GNUNET_TIME_Absolute et; |
@@ -213,11 +213,11 @@ do_check (void *cls, | |||
213 | return; | 213 | return; |
214 | } | 214 | } |
215 | 215 | ||
216 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 216 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
217 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 217 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
218 | 218 | ||
219 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 219 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
220 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 220 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
221 | 221 | ||
222 | struct GNUNET_NAMESTORE_RecordData rd; | 222 | struct GNUNET_NAMESTORE_RecordData rd; |
223 | char* ip = TEST_IP; | 223 | char* ip = TEST_IP; |
@@ -288,8 +288,8 @@ do_check (void *cls, | |||
288 | GNUNET_free (srv_data); | 288 | GNUNET_free (srv_data); |
289 | GNUNET_free (sipserver); | 289 | GNUNET_free (sipserver); |
290 | GNUNET_free (sig); | 290 | GNUNET_free (sig); |
291 | GNUNET_CRYPTO_rsa_key_free (bob_key); | 291 | GNUNET_CRYPTO_ecc_key_free (bob_key); |
292 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 292 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
293 | } | 293 | } |
294 | 294 | ||
295 | 295 | ||
diff --git a/src/gns/test_gns_simple_zkey_lookup.c b/src/gns/test_gns_simple_zkey_lookup.c index dd1a3f7bd..923664b77 100644 --- a/src/gns/test_gns_simple_zkey_lookup.c +++ b/src/gns/test_gns_simple_zkey_lookup.c | |||
@@ -199,11 +199,11 @@ do_check (void *cls, | |||
199 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 199 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
200 | struct GNUNET_TESTING_Peer *peer) | 200 | struct GNUNET_TESTING_Peer *peer) |
201 | { | 201 | { |
202 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; | 202 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey; |
203 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; | 203 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey; |
204 | struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; | 204 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
205 | struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; | 205 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
206 | struct GNUNET_CRYPTO_RsaSignature *sig; | 206 | struct GNUNET_CRYPTO_EccSignature *sig; |
207 | char* alice_keyfile; | 207 | char* alice_keyfile; |
208 | 208 | ||
209 | cfg = ccfg; | 209 | cfg = ccfg; |
@@ -227,11 +227,11 @@ do_check (void *cls, | |||
227 | return; | 227 | return; |
228 | } | 228 | } |
229 | 229 | ||
230 | alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile); | 230 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
231 | bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB); | 231 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
232 | 232 | ||
233 | GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey); | 233 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); |
234 | GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey); | 234 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); |
235 | 235 | ||
236 | struct GNUNET_NAMESTORE_RecordData rd; | 236 | struct GNUNET_NAMESTORE_RecordData rd; |
237 | char* ip = TEST_IP; | 237 | char* ip = TEST_IP; |
@@ -273,8 +273,8 @@ do_check (void *cls, | |||
273 | GNUNET_free (alice_keyfile); | 273 | GNUNET_free (alice_keyfile); |
274 | GNUNET_free (web); | 274 | GNUNET_free (web); |
275 | GNUNET_free (sig); | 275 | GNUNET_free (sig); |
276 | GNUNET_CRYPTO_rsa_key_free (bob_key); | 276 | GNUNET_CRYPTO_ecc_key_free (bob_key); |
277 | GNUNET_CRYPTO_rsa_key_free (alice_key); | 277 | GNUNET_CRYPTO_ecc_key_free (alice_key); |
278 | } | 278 | } |
279 | 279 | ||
280 | 280 | ||
diff --git a/src/gns/zonefiles/test_zonekey b/src/gns/zonefiles/test_zonekey index cfa760624..870c56315 100644 --- a/src/gns/zonefiles/test_zonekey +++ b/src/gns/zonefiles/test_zonekey | |||
Binary files differ | |||
diff --git a/src/include/block_dns.h b/src/include/block_dns.h index 0ca5a47a5..c7e1fbb55 100644 --- a/src/include/block_dns.h +++ b/src/include/block_dns.h | |||
@@ -47,18 +47,18 @@ struct GNUNET_DNS_Record | |||
47 | /** | 47 | /** |
48 | * Signature of the peer affirming that he is offering the service. | 48 | * Signature of the peer affirming that he is offering the service. |
49 | */ | 49 | */ |
50 | struct GNUNET_CRYPTO_RsaSignature signature; | 50 | struct GNUNET_CRYPTO_EccSignature signature; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * Beginning of signed portion of the record, signs everything until | 53 | * Beginning of signed portion of the record, signs everything until |
54 | * the end of the struct. | 54 | * the end of the struct. |
55 | */ | 55 | */ |
56 | struct GNUNET_CRYPTO_RsaSignaturePurpose purpose; | 56 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; |
57 | 57 | ||
58 | /** | 58 | /** |
59 | * The peer providing this service | 59 | * The peer providing this service |
60 | */ | 60 | */ |
61 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded peer; | 61 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded peer; |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * The descriptor for the service | 64 | * The descriptor for the service |
diff --git a/src/include/block_gns.h b/src/include/block_gns.h index 7b4ceed18..2f864f4d3 100644 --- a/src/include/block_gns.h +++ b/src/include/block_gns.h | |||
@@ -39,12 +39,12 @@ struct GNSNameRecordBlock | |||
39 | /** | 39 | /** |
40 | * The public key of the authority | 40 | * The public key of the authority |
41 | */ | 41 | */ |
42 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; | 42 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key; |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * GNUNET_RSA_Signature using RSA-key generated from the records. | 45 | * GNUNET_RSA_Signature using RSA-key generated from the records. |
46 | */ | 46 | */ |
47 | struct GNUNET_CRYPTO_RsaSignature signature; | 47 | struct GNUNET_CRYPTO_EccSignature signature; |
48 | 48 | ||
49 | /* number of records that follow */ | 49 | /* number of records that follow */ |
50 | uint32_t rd_count GNUNET_PACKED; | 50 | uint32_t rd_count GNUNET_PACKED; |
diff --git a/src/include/gnunet_consensus_service.h b/src/include/gnunet_consensus_service.h index f7f784f6e..66d48e0e2 100644 --- a/src/include/gnunet_consensus_service.h +++ b/src/include/gnunet_consensus_service.h | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 2, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index a3c4e999f..eb16e0120 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -299,10 +299,13 @@ struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded | |||
299 | }; | 299 | }; |
300 | 300 | ||
301 | 301 | ||
302 | /** | ||
303 | * Private ECC key encoded for transmission (with length prefix). | ||
304 | */ | ||
302 | struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded | 305 | struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded |
303 | { | 306 | { |
304 | /** | 307 | /** |
305 | * Overall size of the private key. | 308 | * Overall size of the private key in network byte order. |
306 | */ | 309 | */ |
307 | uint16_t size; | 310 | uint16_t size; |
308 | 311 | ||
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h index 8d2fde3d6..739bfa0f6 100644 --- a/src/include/gnunet_gns_service.h +++ b/src/include/gnunet_gns_service.h | |||
@@ -173,7 +173,7 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | |||
173 | const char * name, | 173 | const char * name, |
174 | enum GNUNET_GNS_RecordType type, | 174 | enum GNUNET_GNS_RecordType type, |
175 | int only_cached, | 175 | int only_cached, |
176 | struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key, | 176 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, |
177 | GNUNET_GNS_LookupResultProcessor proc, | 177 | GNUNET_GNS_LookupResultProcessor proc, |
178 | void *proc_cls); | 178 | void *proc_cls); |
179 | 179 | ||
@@ -199,7 +199,7 @@ GNUNET_GNS_lookup_zone (struct GNUNET_GNS_Handle *handle, | |||
199 | struct GNUNET_CRYPTO_ShortHashCode *zone, | 199 | struct GNUNET_CRYPTO_ShortHashCode *zone, |
200 | enum GNUNET_GNS_RecordType type, | 200 | enum GNUNET_GNS_RecordType type, |
201 | int only_cached, | 201 | int only_cached, |
202 | struct GNUNET_CRYPTO_RsaPrivateKey *shorten_key, | 202 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, |
203 | GNUNET_GNS_LookupResultProcessor proc, | 203 | GNUNET_GNS_LookupResultProcessor proc, |
204 | void *proc_cls); | 204 | void *proc_cls); |
205 | 205 | ||
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 1168e0d13..e969170e5 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h | |||
@@ -53,12 +53,12 @@ extern "C" | |||
53 | * because the user queried for a particular record type only) | 53 | * because the user queried for a particular record type only) |
54 | */ | 54 | */ |
55 | typedef void (*GNUNET_NAMESTORE_RecordIterator) (void *cls, | 55 | typedef void (*GNUNET_NAMESTORE_RecordIterator) (void *cls, |
56 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 56 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
57 | struct GNUNET_TIME_Absolute expire, | 57 | struct GNUNET_TIME_Absolute expire, |
58 | const char *name, | 58 | const char *name, |
59 | unsigned int rd_len, | 59 | unsigned int rd_len, |
60 | const struct GNUNET_NAMESTORE_RecordData *rd, | 60 | const struct GNUNET_NAMESTORE_RecordData *rd, |
61 | const struct GNUNET_CRYPTO_RsaSignature *signature); | 61 | const struct GNUNET_CRYPTO_EccSignature *signature); |
62 | 62 | ||
63 | 63 | ||
64 | /** | 64 | /** |
@@ -88,12 +88,12 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
88 | * @return GNUNET_OK on success, else GNUNET_SYSERR | 88 | * @return GNUNET_OK on success, else GNUNET_SYSERR |
89 | */ | 89 | */ |
90 | int (*put_records) (void *cls, | 90 | int (*put_records) (void *cls, |
91 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 91 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
92 | struct GNUNET_TIME_Absolute expire, | 92 | struct GNUNET_TIME_Absolute expire, |
93 | const char *name, | 93 | const char *name, |
94 | unsigned int rd_len, | 94 | unsigned int rd_len, |
95 | const struct GNUNET_NAMESTORE_RecordData *rd, | 95 | const struct GNUNET_NAMESTORE_RecordData *rd, |
96 | const struct GNUNET_CRYPTO_RsaSignature *signature); | 96 | const struct GNUNET_CRYPTO_EccSignature *signature); |
97 | 97 | ||
98 | 98 | ||
99 | /** | 99 | /** |
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 4267e2044..38083ed9c 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -243,12 +243,12 @@ struct GNUNET_NAMESTORE_RecordData | |||
243 | */ | 243 | */ |
244 | struct GNUNET_NAMESTORE_QueueEntry * | 244 | struct GNUNET_NAMESTORE_QueueEntry * |
245 | GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, | 245 | GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, |
246 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 246 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
247 | const char *name, | 247 | const char *name, |
248 | struct GNUNET_TIME_Absolute freshness, | 248 | struct GNUNET_TIME_Absolute freshness, |
249 | unsigned int rd_count, | 249 | unsigned int rd_count, |
250 | const struct GNUNET_NAMESTORE_RecordData *rd, | 250 | const struct GNUNET_NAMESTORE_RecordData *rd, |
251 | const struct GNUNET_CRYPTO_RsaSignature *signature, | 251 | const struct GNUNET_CRYPTO_EccSignature *signature, |
252 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | 252 | GNUNET_NAMESTORE_ContinuationWithStatus cont, |
253 | void *cont_cls); | 253 | void *cont_cls); |
254 | 254 | ||
@@ -266,12 +266,12 @@ GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, | |||
266 | * @return GNUNET_OK if the signature is valid | 266 | * @return GNUNET_OK if the signature is valid |
267 | */ | 267 | */ |
268 | int | 268 | int |
269 | GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, | 269 | GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *public_key, |
270 | const struct GNUNET_TIME_Absolute freshness, | 270 | const struct GNUNET_TIME_Absolute freshness, |
271 | const char *name, | 271 | const char *name, |
272 | unsigned int rd_count, | 272 | unsigned int rd_count, |
273 | const struct GNUNET_NAMESTORE_RecordData *rd, | 273 | const struct GNUNET_NAMESTORE_RecordData *rd, |
274 | const struct GNUNET_CRYPTO_RsaSignature *signature); | 274 | const struct GNUNET_CRYPTO_EccSignature *signature); |
275 | 275 | ||
276 | 276 | ||
277 | /** | 277 | /** |
@@ -290,7 +290,7 @@ GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_RsaPublicKeyBinary | |||
290 | */ | 290 | */ |
291 | struct GNUNET_NAMESTORE_QueueEntry * | 291 | struct GNUNET_NAMESTORE_QueueEntry * |
292 | GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, | 292 | GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, |
293 | const struct GNUNET_CRYPTO_RsaPrivateKey *pkey, | 293 | const struct GNUNET_CRYPTO_EccPrivateKey *pkey, |
294 | const char *name, | 294 | const char *name, |
295 | const struct GNUNET_NAMESTORE_RecordData *rd, | 295 | const struct GNUNET_NAMESTORE_RecordData *rd, |
296 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | 296 | GNUNET_NAMESTORE_ContinuationWithStatus cont, |
@@ -314,7 +314,7 @@ GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, | |||
314 | */ | 314 | */ |
315 | struct GNUNET_NAMESTORE_QueueEntry * | 315 | struct GNUNET_NAMESTORE_QueueEntry * |
316 | GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, | 316 | GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, |
317 | const struct GNUNET_CRYPTO_RsaPrivateKey *pkey, | 317 | const struct GNUNET_CRYPTO_EccPrivateKey *pkey, |
318 | const char *name, | 318 | const char *name, |
319 | const struct GNUNET_NAMESTORE_RecordData *rd, | 319 | const struct GNUNET_NAMESTORE_RecordData *rd, |
320 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | 320 | GNUNET_NAMESTORE_ContinuationWithStatus cont, |
@@ -338,12 +338,12 @@ GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, | |||
338 | * because the user queried for a particular record type only) | 338 | * because the user queried for a particular record type only) |
339 | */ | 339 | */ |
340 | typedef void (*GNUNET_NAMESTORE_RecordProcessor) (void *cls, | 340 | typedef void (*GNUNET_NAMESTORE_RecordProcessor) (void *cls, |
341 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 341 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
342 | struct GNUNET_TIME_Absolute freshness, | 342 | struct GNUNET_TIME_Absolute freshness, |
343 | const char *name, | 343 | const char *name, |
344 | unsigned int rd_len, | 344 | unsigned int rd_len, |
345 | const struct GNUNET_NAMESTORE_RecordData *rd, | 345 | const struct GNUNET_NAMESTORE_RecordData *rd, |
346 | const struct GNUNET_CRYPTO_RsaSignature *signature); | 346 | const struct GNUNET_CRYPTO_EccSignature *signature); |
347 | 347 | ||
348 | 348 | ||
349 | /** | 349 | /** |
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index a79ec5e78..699df0670 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c | |||
@@ -36,7 +36,7 @@ | |||
36 | /** | 36 | /** |
37 | * Hostkey generation context | 37 | * Hostkey generation context |
38 | */ | 38 | */ |
39 | struct GNUNET_CRYPTO_RsaKeyGenerationContext * keygen; | 39 | struct GNUNET_CRYPTO_EccKeyGenerationContext * keygen; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Handle to the namestore. | 42 | * Handle to the namestore. |
@@ -51,7 +51,7 @@ static struct GNUNET_CRYPTO_ShortHashCode zone; | |||
51 | /** | 51 | /** |
52 | * Private key for the our zone. | 52 | * Private key for the our zone. |
53 | */ | 53 | */ |
54 | static struct GNUNET_CRYPTO_RsaPrivateKey *zone_pkey; | 54 | static struct GNUNET_CRYPTO_EccPrivateKey *zone_pkey; |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * Keyfile to manipulate. | 57 | * Keyfile to manipulate. |
@@ -146,7 +146,7 @@ do_shutdown (void *cls, | |||
146 | { | 146 | { |
147 | if (NULL != keygen) | 147 | if (NULL != keygen) |
148 | { | 148 | { |
149 | GNUNET_CRYPTO_rsa_key_create_stop (keygen); | 149 | GNUNET_CRYPTO_ecc_key_create_stop (keygen); |
150 | keygen = NULL; | 150 | keygen = NULL; |
151 | } | 151 | } |
152 | 152 | ||
@@ -177,7 +177,7 @@ do_shutdown (void *cls, | |||
177 | } | 177 | } |
178 | if (NULL != zone_pkey) | 178 | if (NULL != zone_pkey) |
179 | { | 179 | { |
180 | GNUNET_CRYPTO_rsa_key_free (zone_pkey); | 180 | GNUNET_CRYPTO_ecc_key_free (zone_pkey); |
181 | zone_pkey = NULL; | 181 | zone_pkey = NULL; |
182 | } | 182 | } |
183 | if (NULL != uri) | 183 | if (NULL != uri) |
@@ -267,12 +267,12 @@ del_continuation (void *cls, | |||
267 | */ | 267 | */ |
268 | static void | 268 | static void |
269 | display_record (void *cls, | 269 | display_record (void *cls, |
270 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 270 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
271 | struct GNUNET_TIME_Absolute expire, | 271 | struct GNUNET_TIME_Absolute expire, |
272 | const char *name, | 272 | const char *name, |
273 | unsigned int rd_len, | 273 | unsigned int rd_len, |
274 | const struct GNUNET_NAMESTORE_RecordData *rd, | 274 | const struct GNUNET_NAMESTORE_RecordData *rd, |
275 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 275 | const struct GNUNET_CRYPTO_EccSignature *signature) |
276 | { | 276 | { |
277 | const char *typestring; | 277 | const char *typestring; |
278 | char *s; | 278 | char *s; |
@@ -328,11 +328,11 @@ display_record (void *cls, | |||
328 | 328 | ||
329 | static void | 329 | static void |
330 | key_generation_cb (void *cls, | 330 | key_generation_cb (void *cls, |
331 | struct GNUNET_CRYPTO_RsaPrivateKey *pk, | 331 | struct GNUNET_CRYPTO_EccPrivateKey *pk, |
332 | const char *emsg) | 332 | const char *emsg) |
333 | { | 333 | { |
334 | struct GNUNET_CONFIGURATION_Handle *cfg = cls; | 334 | struct GNUNET_CONFIGURATION_Handle *cfg = cls; |
335 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub; | 335 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pub; |
336 | uint32_t type; | 336 | uint32_t type; |
337 | void *data = NULL; | 337 | void *data = NULL; |
338 | size_t data_size = 0; | 338 | size_t data_size = 0; |
@@ -354,7 +354,7 @@ key_generation_cb (void *cls, | |||
354 | /* nothing more to be done */ | 354 | /* nothing more to be done */ |
355 | fprintf (stderr, | 355 | fprintf (stderr, |
356 | _("No options given\n")); | 356 | _("No options given\n")); |
357 | GNUNET_CRYPTO_rsa_key_free (zone_pkey); | 357 | GNUNET_CRYPTO_ecc_key_free (zone_pkey); |
358 | zone_pkey = NULL; | 358 | zone_pkey = NULL; |
359 | return; | 359 | return; |
360 | } | 360 | } |
@@ -364,7 +364,7 @@ key_generation_cb (void *cls, | |||
364 | _("Failed to read or create private zone key\n")); | 364 | _("Failed to read or create private zone key\n")); |
365 | return; | 365 | return; |
366 | } | 366 | } |
367 | GNUNET_CRYPTO_rsa_key_get_public (zone_pkey, | 367 | GNUNET_CRYPTO_ecc_key_get_public (zone_pkey, |
368 | &pub); | 368 | &pub); |
369 | GNUNET_CRYPTO_short_hash (&pub, sizeof (pub), &zone); | 369 | GNUNET_CRYPTO_short_hash (&pub, sizeof (pub), &zone); |
370 | 370 | ||
@@ -625,7 +625,7 @@ testservice_task (void *cls, | |||
625 | _("Using default zone file `%s'\n"), | 625 | _("Using default zone file `%s'\n"), |
626 | keyfile); | 626 | keyfile); |
627 | } | 627 | } |
628 | keygen = GNUNET_CRYPTO_rsa_key_create_start (keyfile, key_generation_cb, cfg); | 628 | keygen = GNUNET_CRYPTO_ecc_key_create_start (keyfile, key_generation_cb, cfg); |
629 | GNUNET_free (keyfile); | 629 | GNUNET_free (keyfile); |
630 | keyfile = NULL; | 630 | keyfile = NULL; |
631 | if (NULL == keygen) | 631 | if (NULL == keygen) |
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index a14ad923d..02f33679b 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -143,7 +143,7 @@ struct GNUNET_NAMESTORE_CryptoContainer | |||
143 | /** | 143 | /** |
144 | * Zone's private key | 144 | * Zone's private key |
145 | */ | 145 | */ |
146 | struct GNUNET_CRYPTO_RsaPrivateKey *privkey; | 146 | struct GNUNET_CRYPTO_EccPrivateKey *privkey; |
147 | 147 | ||
148 | }; | 148 | }; |
149 | 149 | ||
@@ -205,7 +205,7 @@ struct KeyLoadContext | |||
205 | { | 205 | { |
206 | struct KeyLoadContext *next; | 206 | struct KeyLoadContext *next; |
207 | struct KeyLoadContext *prev; | 207 | struct KeyLoadContext *prev; |
208 | struct GNUNET_CRYPTO_RsaKeyGenerationContext *keygen; | 208 | struct GNUNET_CRYPTO_EccKeyGenerationContext *keygen; |
209 | char *filename; | 209 | char *filename; |
210 | unsigned int *counter; | 210 | unsigned int *counter; |
211 | }; | 211 | }; |
@@ -222,19 +222,19 @@ static int | |||
222 | write_key_to_file (const char *filename, | 222 | write_key_to_file (const char *filename, |
223 | struct GNUNET_NAMESTORE_CryptoContainer *c) | 223 | struct GNUNET_NAMESTORE_CryptoContainer *c) |
224 | { | 224 | { |
225 | struct GNUNET_CRYPTO_RsaPrivateKey *ret = c->privkey; | 225 | struct GNUNET_CRYPTO_EccPrivateKey *ret = c->privkey; |
226 | struct GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded *enc; | 226 | struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded *enc; |
227 | struct GNUNET_DISK_FileHandle *fd; | 227 | struct GNUNET_DISK_FileHandle *fd; |
228 | struct GNUNET_CRYPTO_ShortHashCode zone; | 228 | struct GNUNET_CRYPTO_ShortHashCode zone; |
229 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 229 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
230 | struct GNUNET_CRYPTO_RsaPrivateKey *privkey; | 230 | struct GNUNET_CRYPTO_EccPrivateKey *privkey; |
231 | 231 | ||
232 | fd = GNUNET_DISK_file_open (filename, | 232 | fd = GNUNET_DISK_file_open (filename, |
233 | GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE | GNUNET_DISK_OPEN_FAILIFEXISTS, | 233 | GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE | GNUNET_DISK_OPEN_FAILIFEXISTS, |
234 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); | 234 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); |
235 | if ( (NULL == fd) && (EEXIST == errno) ) | 235 | if ( (NULL == fd) && (EEXIST == errno) ) |
236 | { | 236 | { |
237 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file (filename); | 237 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (filename); |
238 | if (NULL == privkey) | 238 | if (NULL == privkey) |
239 | { | 239 | { |
240 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 240 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -243,9 +243,9 @@ write_key_to_file (const char *filename, | |||
243 | _("file exists but reading key failed")); | 243 | _("file exists but reading key failed")); |
244 | return GNUNET_SYSERR; | 244 | return GNUNET_SYSERR; |
245 | } | 245 | } |
246 | GNUNET_CRYPTO_rsa_key_get_public (privkey, &pubkey); | 246 | GNUNET_CRYPTO_ecc_key_get_public (privkey, &pubkey); |
247 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &zone); | 247 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &zone); |
248 | GNUNET_CRYPTO_rsa_key_free (privkey); | 248 | GNUNET_CRYPTO_ecc_key_free (privkey); |
249 | if (0 == memcmp (&zone, &c->zone, sizeof(zone))) | 249 | if (0 == memcmp (&zone, &c->zone, sizeof(zone))) |
250 | { | 250 | { |
251 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 251 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -264,17 +264,17 @@ write_key_to_file (const char *filename, | |||
264 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "open", filename); | 264 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "open", filename); |
265 | return GNUNET_SYSERR; | 265 | return GNUNET_SYSERR; |
266 | } | 266 | } |
267 | if (GNUNET_YES != GNUNET_DISK_file_lock (fd, 0, sizeof (struct GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded), GNUNET_YES)) | 267 | if (GNUNET_YES != GNUNET_DISK_file_lock (fd, 0, sizeof (struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded), GNUNET_YES)) |
268 | { | 268 | { |
269 | GNUNET_break (GNUNET_YES == GNUNET_DISK_file_close (fd)); | 269 | GNUNET_break (GNUNET_YES == GNUNET_DISK_file_close (fd)); |
270 | return GNUNET_SYSERR; | 270 | return GNUNET_SYSERR; |
271 | } | 271 | } |
272 | enc = GNUNET_CRYPTO_rsa_encode_key (ret); | 272 | enc = GNUNET_CRYPTO_ecc_encode_key (ret); |
273 | GNUNET_assert (NULL != enc); | 273 | GNUNET_assert (NULL != enc); |
274 | GNUNET_assert (ntohs (enc->len) == GNUNET_DISK_file_write (fd, enc, ntohs (enc->len))); | 274 | GNUNET_assert (ntohs (enc->size) == GNUNET_DISK_file_write (fd, enc, ntohs (enc->size))); |
275 | GNUNET_free (enc); | 275 | GNUNET_free (enc); |
276 | GNUNET_DISK_file_sync (fd); | 276 | GNUNET_DISK_file_sync (fd); |
277 | if (GNUNET_YES != GNUNET_DISK_file_unlock (fd, 0, sizeof (struct GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded))) | 277 | if (GNUNET_YES != GNUNET_DISK_file_unlock (fd, 0, sizeof (struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded))) |
278 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename); | 278 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename); |
279 | GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd)); | 279 | GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd)); |
280 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 280 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -308,7 +308,7 @@ zone_to_disk_it (void *cls, | |||
308 | GNUNET_short_h2s (&c->zone)); | 308 | GNUNET_short_h2s (&c->zone)); |
309 | (void) write_key_to_file(c->filename, c); | 309 | (void) write_key_to_file(c->filename, c); |
310 | GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_remove (zonekeys, key, value)); | 310 | GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_remove (zonekeys, key, value)); |
311 | GNUNET_CRYPTO_rsa_key_free (c->privkey); | 311 | GNUNET_CRYPTO_ecc_key_free (c->privkey); |
312 | GNUNET_free (c->filename); | 312 | GNUNET_free (c->filename); |
313 | GNUNET_free (c); | 313 | GNUNET_free (c); |
314 | return GNUNET_OK; | 314 | return GNUNET_OK; |
@@ -323,22 +323,22 @@ zone_to_disk_it (void *cls, | |||
323 | * be taken over or freed and should not be used afterwards) | 323 | * be taken over or freed and should not be used afterwards) |
324 | */ | 324 | */ |
325 | static void | 325 | static void |
326 | learn_private_key (struct GNUNET_CRYPTO_RsaPrivateKey *pkey) | 326 | learn_private_key (struct GNUNET_CRYPTO_EccPrivateKey *pkey) |
327 | { | 327 | { |
328 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub; | 328 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pub; |
329 | struct GNUNET_HashCode long_hash; | 329 | struct GNUNET_HashCode long_hash; |
330 | struct GNUNET_CRYPTO_ShortHashCode pubkey_hash; | 330 | struct GNUNET_CRYPTO_ShortHashCode pubkey_hash; |
331 | struct GNUNET_NAMESTORE_CryptoContainer *cc; | 331 | struct GNUNET_NAMESTORE_CryptoContainer *cc; |
332 | 332 | ||
333 | GNUNET_CRYPTO_rsa_key_get_public (pkey, &pub); | 333 | GNUNET_CRYPTO_ecc_key_get_public (pkey, &pub); |
334 | GNUNET_CRYPTO_short_hash (&pub, | 334 | GNUNET_CRYPTO_short_hash (&pub, |
335 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 335 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
336 | &pubkey_hash); | 336 | &pubkey_hash); |
337 | GNUNET_CRYPTO_short_hash_double (&pubkey_hash, &long_hash); | 337 | GNUNET_CRYPTO_short_hash_double (&pubkey_hash, &long_hash); |
338 | 338 | ||
339 | if (GNUNET_NO != GNUNET_CONTAINER_multihashmap_contains(zonekeys, &long_hash)) | 339 | if (GNUNET_NO != GNUNET_CONTAINER_multihashmap_contains(zonekeys, &long_hash)) |
340 | { | 340 | { |
341 | GNUNET_CRYPTO_rsa_key_free (pkey); | 341 | GNUNET_CRYPTO_ecc_key_free (pkey); |
342 | return; | 342 | return; |
343 | } | 343 | } |
344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -414,7 +414,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
414 | { | 414 | { |
415 | GNUNET_CONTAINER_DLL_remove (kl_head, kl_tail, kl); | 415 | GNUNET_CONTAINER_DLL_remove (kl_head, kl_tail, kl); |
416 | if (NULL != kl->keygen) | 416 | if (NULL != kl->keygen) |
417 | GNUNET_CRYPTO_rsa_key_create_stop (kl->keygen); | 417 | GNUNET_CRYPTO_ecc_key_create_stop (kl->keygen); |
418 | GNUNET_free (kl->filename); | 418 | GNUNET_free (kl->filename); |
419 | GNUNET_free (kl); | 419 | GNUNET_free (kl); |
420 | } | 420 | } |
@@ -570,18 +570,18 @@ struct LookupNameContext | |||
570 | */ | 570 | */ |
571 | static void | 571 | static void |
572 | handle_lookup_name_it (void *cls, | 572 | handle_lookup_name_it (void *cls, |
573 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 573 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
574 | struct GNUNET_TIME_Absolute expire, | 574 | struct GNUNET_TIME_Absolute expire, |
575 | const char *name, | 575 | const char *name, |
576 | unsigned int rd_count, | 576 | unsigned int rd_count, |
577 | const struct GNUNET_NAMESTORE_RecordData *rd, | 577 | const struct GNUNET_NAMESTORE_RecordData *rd, |
578 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 578 | const struct GNUNET_CRYPTO_EccSignature *signature) |
579 | { | 579 | { |
580 | struct LookupNameContext *lnc = cls; | 580 | struct LookupNameContext *lnc = cls; |
581 | struct LookupNameResponseMessage *lnr_msg; | 581 | struct LookupNameResponseMessage *lnr_msg; |
582 | struct GNUNET_NAMESTORE_RecordData *rd_selected; | 582 | struct GNUNET_NAMESTORE_RecordData *rd_selected; |
583 | struct GNUNET_NAMESTORE_CryptoContainer *cc; | 583 | struct GNUNET_NAMESTORE_CryptoContainer *cc; |
584 | struct GNUNET_CRYPTO_RsaSignature *signature_new; | 584 | struct GNUNET_CRYPTO_EccSignature *signature_new; |
585 | struct GNUNET_TIME_Absolute e; | 585 | struct GNUNET_TIME_Absolute e; |
586 | struct GNUNET_TIME_Relative re; | 586 | struct GNUNET_TIME_Relative re; |
587 | struct GNUNET_CRYPTO_ShortHashCode zone_key_hash; | 587 | struct GNUNET_CRYPTO_ShortHashCode zone_key_hash; |
@@ -607,7 +607,7 @@ handle_lookup_name_it (void *cls, | |||
607 | if (NULL != zone_key) | 607 | if (NULL != zone_key) |
608 | { | 608 | { |
609 | GNUNET_CRYPTO_short_hash (zone_key, | 609 | GNUNET_CRYPTO_short_hash (zone_key, |
610 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 610 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
611 | &zone_key_hash); | 611 | &zone_key_hash); |
612 | GNUNET_CRYPTO_short_hash_double (&zone_key_hash, &long_hash); | 612 | GNUNET_CRYPTO_short_hash_double (&zone_key_hash, &long_hash); |
613 | if (NULL != (cc = GNUNET_CONTAINER_multihashmap_get (zonekeys, &long_hash))) | 613 | if (NULL != (cc = GNUNET_CONTAINER_multihashmap_get (zonekeys, &long_hash))) |
@@ -728,7 +728,7 @@ handle_lookup_name_it (void *cls, | |||
728 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (copied_elements, rd_selected); | 728 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (copied_elements, rd_selected); |
729 | name_len = (NULL == name) ? 0 : strlen(name) + 1; | 729 | name_len = (NULL == name) ? 0 : strlen(name) + 1; |
730 | r_size = sizeof (struct LookupNameResponseMessage) + | 730 | r_size = sizeof (struct LookupNameResponseMessage) + |
731 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + | 731 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) + |
732 | name_len + | 732 | name_len + |
733 | rd_ser_len; | 733 | rd_ser_len; |
734 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 734 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -885,7 +885,7 @@ handle_record_put (void *cls, | |||
885 | struct GNUNET_NAMESTORE_Client *nc; | 885 | struct GNUNET_NAMESTORE_Client *nc; |
886 | const struct RecordPutMessage *rp_msg; | 886 | const struct RecordPutMessage *rp_msg; |
887 | struct GNUNET_TIME_Absolute expire; | 887 | struct GNUNET_TIME_Absolute expire; |
888 | const struct GNUNET_CRYPTO_RsaSignature *signature; | 888 | const struct GNUNET_CRYPTO_EccSignature *signature; |
889 | struct RecordPutResponseMessage rpr_msg; | 889 | struct RecordPutResponseMessage rpr_msg; |
890 | struct GNUNET_CRYPTO_ShortHashCode zone_hash; | 890 | struct GNUNET_CRYPTO_ShortHashCode zone_hash; |
891 | size_t name_len; | 891 | size_t name_len; |
@@ -1008,7 +1008,7 @@ struct CreateRecordContext | |||
1008 | /** | 1008 | /** |
1009 | * Zone's public key | 1009 | * Zone's public key |
1010 | */ | 1010 | */ |
1011 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 1011 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
1012 | 1012 | ||
1013 | /** | 1013 | /** |
1014 | * Name for the record to create | 1014 | * Name for the record to create |
@@ -1044,14 +1044,14 @@ struct CreateRecordContext | |||
1044 | */ | 1044 | */ |
1045 | static void | 1045 | static void |
1046 | handle_create_record_it (void *cls, | 1046 | handle_create_record_it (void *cls, |
1047 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pubkey, | 1047 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *pubkey, |
1048 | struct GNUNET_TIME_Absolute expire, | 1048 | struct GNUNET_TIME_Absolute expire, |
1049 | const char *name, | 1049 | const char *name, |
1050 | unsigned int rd_count, | 1050 | unsigned int rd_count, |
1051 | const struct GNUNET_NAMESTORE_RecordData *rd, | 1051 | const struct GNUNET_NAMESTORE_RecordData *rd, |
1052 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 1052 | const struct GNUNET_CRYPTO_EccSignature *signature) |
1053 | { | 1053 | { |
1054 | static struct GNUNET_CRYPTO_RsaSignature dummy_signature; | 1054 | static struct GNUNET_CRYPTO_EccSignature dummy_signature; |
1055 | struct CreateRecordContext *crc = cls; | 1055 | struct CreateRecordContext *crc = cls; |
1056 | struct GNUNET_NAMESTORE_RecordData *rd_new; | 1056 | struct GNUNET_NAMESTORE_RecordData *rd_new; |
1057 | struct GNUNET_TIME_Absolute block_expiration; | 1057 | struct GNUNET_TIME_Absolute block_expiration; |
@@ -1159,7 +1159,7 @@ handle_record_create (void *cls, | |||
1159 | struct GNUNET_NAMESTORE_Client *nc; | 1159 | struct GNUNET_NAMESTORE_Client *nc; |
1160 | const struct RecordCreateMessage *rp_msg; | 1160 | const struct RecordCreateMessage *rp_msg; |
1161 | struct CreateRecordContext crc; | 1161 | struct CreateRecordContext crc; |
1162 | struct GNUNET_CRYPTO_RsaPrivateKey *pkey; | 1162 | struct GNUNET_CRYPTO_EccPrivateKey *pkey; |
1163 | struct RecordCreateResponseMessage rcr_msg; | 1163 | struct RecordCreateResponseMessage rcr_msg; |
1164 | size_t name_len; | 1164 | size_t name_len; |
1165 | size_t msg_size; | 1165 | size_t msg_size; |
@@ -1219,7 +1219,8 @@ handle_record_create (void *cls, | |||
1219 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1219 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1220 | return; | 1220 | return; |
1221 | } | 1221 | } |
1222 | if (NULL == (pkey = GNUNET_CRYPTO_rsa_decode_key (pkey_tmp, key_len))) | 1222 | if (NULL == (pkey = GNUNET_CRYPTO_ecc_decode_key (pkey_tmp, key_len, |
1223 | GNUNET_NO))) | ||
1223 | { | 1224 | { |
1224 | GNUNET_break (0); | 1225 | GNUNET_break (0); |
1225 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1226 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
@@ -1229,15 +1230,15 @@ handle_record_create (void *cls, | |||
1229 | GNUNET_NAMESTORE_records_deserialize (rd_ser_len, rd_ser, rd_count, &rd)) | 1230 | GNUNET_NAMESTORE_records_deserialize (rd_ser_len, rd_ser, rd_count, &rd)) |
1230 | { | 1231 | { |
1231 | GNUNET_break (0); | 1232 | GNUNET_break (0); |
1232 | GNUNET_CRYPTO_rsa_key_free (pkey); | 1233 | GNUNET_CRYPTO_ecc_key_free (pkey); |
1233 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1234 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1234 | return; | 1235 | return; |
1235 | } | 1236 | } |
1236 | 1237 | ||
1237 | /* Extracting and converting private key */ | 1238 | /* Extracting and converting private key */ |
1238 | GNUNET_CRYPTO_rsa_key_get_public (pkey, &crc.pubkey); | 1239 | GNUNET_CRYPTO_ecc_key_get_public (pkey, &crc.pubkey); |
1239 | GNUNET_CRYPTO_short_hash (&crc.pubkey, | 1240 | GNUNET_CRYPTO_short_hash (&crc.pubkey, |
1240 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 1241 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
1241 | &pubkey_hash); | 1242 | &pubkey_hash); |
1242 | learn_private_key (pkey); | 1243 | learn_private_key (pkey); |
1243 | 1244 | ||
@@ -1318,14 +1319,14 @@ struct RemoveRecordContext | |||
1318 | */ | 1319 | */ |
1319 | static void | 1320 | static void |
1320 | handle_record_remove_it (void *cls, | 1321 | handle_record_remove_it (void *cls, |
1321 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 1322 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
1322 | struct GNUNET_TIME_Absolute expire, | 1323 | struct GNUNET_TIME_Absolute expire, |
1323 | const char *name, | 1324 | const char *name, |
1324 | unsigned int rd_count, | 1325 | unsigned int rd_count, |
1325 | const struct GNUNET_NAMESTORE_RecordData *rd, | 1326 | const struct GNUNET_NAMESTORE_RecordData *rd, |
1326 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 1327 | const struct GNUNET_CRYPTO_EccSignature *signature) |
1327 | { | 1328 | { |
1328 | static struct GNUNET_CRYPTO_RsaSignature dummy_signature; | 1329 | static struct GNUNET_CRYPTO_EccSignature dummy_signature; |
1329 | struct RemoveRecordContext *rrc = cls; | 1330 | struct RemoveRecordContext *rrc = cls; |
1330 | unsigned int c; | 1331 | unsigned int c; |
1331 | int found; | 1332 | int found; |
@@ -1364,7 +1365,7 @@ handle_record_remove_it (void *cls, | |||
1364 | "No records left for name `%s', removing name\n", | 1365 | "No records left for name `%s', removing name\n", |
1365 | name); | 1366 | name); |
1366 | GNUNET_CRYPTO_short_hash (zone_key, | 1367 | GNUNET_CRYPTO_short_hash (zone_key, |
1367 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 1368 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
1368 | &pubkey_hash); | 1369 | &pubkey_hash); |
1369 | if (GNUNET_OK != | 1370 | if (GNUNET_OK != |
1370 | GSN_database->remove_records (GSN_database->cls, | 1371 | GSN_database->remove_records (GSN_database->cls, |
@@ -1421,8 +1422,8 @@ handle_record_remove (void *cls, | |||
1421 | struct GNUNET_NAMESTORE_Client *nc; | 1422 | struct GNUNET_NAMESTORE_Client *nc; |
1422 | const struct RecordRemoveMessage *rr_msg; | 1423 | const struct RecordRemoveMessage *rr_msg; |
1423 | struct RecordRemoveResponseMessage rrr_msg; | 1424 | struct RecordRemoveResponseMessage rrr_msg; |
1424 | struct GNUNET_CRYPTO_RsaPrivateKey *pkey; | 1425 | struct GNUNET_CRYPTO_EccPrivateKey *pkey; |
1425 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub; | 1426 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pub; |
1426 | struct GNUNET_CRYPTO_ShortHashCode pubkey_hash; | 1427 | struct GNUNET_CRYPTO_ShortHashCode pubkey_hash; |
1427 | struct GNUNET_NAMESTORE_RecordData rd; | 1428 | struct GNUNET_NAMESTORE_RecordData rd; |
1428 | const char *pkey_tmp; | 1429 | const char *pkey_tmp; |
@@ -1484,15 +1485,16 @@ handle_record_remove (void *cls, | |||
1484 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1485 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1485 | return; | 1486 | return; |
1486 | } | 1487 | } |
1487 | if (NULL == (pkey = GNUNET_CRYPTO_rsa_decode_key (pkey_tmp, key_len))) | 1488 | if (NULL == (pkey = GNUNET_CRYPTO_ecc_decode_key (pkey_tmp, key_len, |
1489 | GNUNET_NO))) | ||
1488 | { | 1490 | { |
1489 | GNUNET_break (0); | 1491 | GNUNET_break (0); |
1490 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1492 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1491 | return; | 1493 | return; |
1492 | } | 1494 | } |
1493 | GNUNET_CRYPTO_rsa_key_get_public (pkey, &pub); | 1495 | GNUNET_CRYPTO_ecc_key_get_public (pkey, &pub); |
1494 | GNUNET_CRYPTO_short_hash (&pub, | 1496 | GNUNET_CRYPTO_short_hash (&pub, |
1495 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 1497 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
1496 | &pubkey_hash); | 1498 | &pubkey_hash); |
1497 | learn_private_key (pkey); | 1499 | learn_private_key (pkey); |
1498 | if (GNUNET_OK != | 1500 | if (GNUNET_OK != |
@@ -1618,12 +1620,12 @@ struct ZoneToNameCtx | |||
1618 | */ | 1620 | */ |
1619 | static void | 1621 | static void |
1620 | handle_zone_to_name_it (void *cls, | 1622 | handle_zone_to_name_it (void *cls, |
1621 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 1623 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
1622 | struct GNUNET_TIME_Absolute expire, | 1624 | struct GNUNET_TIME_Absolute expire, |
1623 | const char *name, | 1625 | const char *name, |
1624 | unsigned int rd_count, | 1626 | unsigned int rd_count, |
1625 | const struct GNUNET_NAMESTORE_RecordData *rd, | 1627 | const struct GNUNET_NAMESTORE_RecordData *rd, |
1626 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 1628 | const struct GNUNET_CRYPTO_EccSignature *signature) |
1627 | { | 1629 | { |
1628 | struct ZoneToNameCtx *ztn_ctx = cls; | 1630 | struct ZoneToNameCtx *ztn_ctx = cls; |
1629 | struct ZoneToNameResponseMessage *ztnr_msg; | 1631 | struct ZoneToNameResponseMessage *ztnr_msg; |
@@ -1658,7 +1660,7 @@ handle_zone_to_name_it (void *cls, | |||
1658 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); | 1660 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); |
1659 | msg_size = sizeof (struct ZoneToNameResponseMessage) + name_len + rd_ser_len; | 1661 | msg_size = sizeof (struct ZoneToNameResponseMessage) + name_len + rd_ser_len; |
1660 | if (NULL != signature) | 1662 | if (NULL != signature) |
1661 | msg_size += sizeof (struct GNUNET_CRYPTO_RsaSignature); | 1663 | msg_size += sizeof (struct GNUNET_CRYPTO_EccSignature); |
1662 | if (msg_size >= GNUNET_SERVER_MAX_MESSAGE_SIZE) | 1664 | if (msg_size >= GNUNET_SERVER_MAX_MESSAGE_SIZE) |
1663 | { | 1665 | { |
1664 | GNUNET_break (0); | 1666 | GNUNET_break (0); |
@@ -1683,7 +1685,7 @@ handle_zone_to_name_it (void *cls, | |||
1683 | GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_tmp); | 1685 | GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_tmp); |
1684 | sig_tmp = &rd_tmp[rd_ser_len]; | 1686 | sig_tmp = &rd_tmp[rd_ser_len]; |
1685 | if (NULL != signature) | 1687 | if (NULL != signature) |
1686 | memcpy (sig_tmp, signature, sizeof (struct GNUNET_CRYPTO_RsaSignature)); | 1688 | memcpy (sig_tmp, signature, sizeof (struct GNUNET_CRYPTO_EccSignature)); |
1687 | ztn_ctx->success = GNUNET_OK; | 1689 | ztn_ctx->success = GNUNET_OK; |
1688 | GNUNET_SERVER_notification_context_unicast (snc, ztn_ctx->nc->client, | 1690 | GNUNET_SERVER_notification_context_unicast (snc, ztn_ctx->nc->client, |
1689 | &ztnr_msg->gns_header.header, | 1691 | &ztnr_msg->gns_header.header, |
@@ -1797,16 +1799,16 @@ struct ZoneIterationProcResult | |||
1797 | */ | 1799 | */ |
1798 | static void | 1800 | static void |
1799 | zone_iteraterate_proc (void *cls, | 1801 | zone_iteraterate_proc (void *cls, |
1800 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 1802 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
1801 | struct GNUNET_TIME_Absolute expire, | 1803 | struct GNUNET_TIME_Absolute expire, |
1802 | const char *name, | 1804 | const char *name, |
1803 | unsigned int rd_count, | 1805 | unsigned int rd_count, |
1804 | const struct GNUNET_NAMESTORE_RecordData *rd, | 1806 | const struct GNUNET_NAMESTORE_RecordData *rd, |
1805 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 1807 | const struct GNUNET_CRYPTO_EccSignature *signature) |
1806 | { | 1808 | { |
1807 | struct ZoneIterationProcResult *proc = cls; | 1809 | struct ZoneIterationProcResult *proc = cls; |
1808 | struct GNUNET_NAMESTORE_RecordData rd_filtered[rd_count]; | 1810 | struct GNUNET_NAMESTORE_RecordData rd_filtered[rd_count]; |
1809 | struct GNUNET_CRYPTO_RsaSignature *new_signature = NULL; | 1811 | struct GNUNET_CRYPTO_EccSignature *new_signature = NULL; |
1810 | struct GNUNET_NAMESTORE_CryptoContainer *cc; | 1812 | struct GNUNET_NAMESTORE_CryptoContainer *cc; |
1811 | struct GNUNET_HashCode long_hash; | 1813 | struct GNUNET_HashCode long_hash; |
1812 | struct GNUNET_CRYPTO_ShortHashCode zone_hash; | 1814 | struct GNUNET_CRYPTO_ShortHashCode zone_hash; |
@@ -1884,7 +1886,7 @@ zone_iteraterate_proc (void *cls, | |||
1884 | /* compute / obtain signature, but only if we (a) have records and (b) expiration times were | 1886 | /* compute / obtain signature, but only if we (a) have records and (b) expiration times were |
1885 | converted to absolute expiration times */ | 1887 | converted to absolute expiration times */ |
1886 | GNUNET_CRYPTO_short_hash (zone_key, | 1888 | GNUNET_CRYPTO_short_hash (zone_key, |
1887 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 1889 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
1888 | &zone_hash); | 1890 | &zone_hash); |
1889 | GNUNET_CRYPTO_short_hash_double (&zone_hash, &long_hash); | 1891 | GNUNET_CRYPTO_short_hash_double (&zone_hash, &long_hash); |
1890 | if (NULL != (cc = GNUNET_CONTAINER_multihashmap_get(zonekeys, &long_hash))) | 1892 | if (NULL != (cc = GNUNET_CONTAINER_multihashmap_get(zonekeys, &long_hash))) |
@@ -2160,7 +2162,7 @@ handle_iteration_next (void *cls, | |||
2160 | 2162 | ||
2161 | static void | 2163 | static void |
2162 | zonekey_it_key_cb (void *cls, | 2164 | zonekey_it_key_cb (void *cls, |
2163 | struct GNUNET_CRYPTO_RsaPrivateKey *pk, | 2165 | struct GNUNET_CRYPTO_EccPrivateKey *pk, |
2164 | const char *emsg) | 2166 | const char *emsg) |
2165 | { | 2167 | { |
2166 | struct KeyLoadContext *kl = cls; | 2168 | struct KeyLoadContext *kl = cls; |
@@ -2201,7 +2203,7 @@ zonekey_file_it (void *cls, const char *filename) | |||
2201 | kl = GNUNET_malloc (sizeof (struct KeyLoadContext)); | 2203 | kl = GNUNET_malloc (sizeof (struct KeyLoadContext)); |
2202 | kl->filename = strdup (filename); | 2204 | kl->filename = strdup (filename); |
2203 | kl->counter = cls; | 2205 | kl->counter = cls; |
2204 | kl->keygen = GNUNET_CRYPTO_rsa_key_create_start (filename, zonekey_it_key_cb, kl); | 2206 | kl->keygen = GNUNET_CRYPTO_ecc_key_create_start (filename, zonekey_it_key_cb, kl); |
2205 | if (NULL == kl->keygen) | 2207 | if (NULL == kl->keygen) |
2206 | { | 2208 | { |
2207 | GNUNET_free (kl->filename); | 2209 | GNUNET_free (kl->filename); |
diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h index 0e7ecfda3..b0d3ffad0 100644 --- a/src/namestore/namestore.h +++ b/src/namestore/namestore.h | |||
@@ -62,8 +62,8 @@ GNUNET_short_h2s (const struct GNUNET_CRYPTO_ShortHashCode * hc); | |||
62 | * | 62 | * |
63 | * @return the signature | 63 | * @return the signature |
64 | */ | 64 | */ |
65 | struct GNUNET_CRYPTO_RsaSignature * | 65 | struct GNUNET_CRYPTO_EccSignature * |
66 | GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | 66 | GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_EccPrivateKey *key, |
67 | struct GNUNET_TIME_Absolute expire, | 67 | struct GNUNET_TIME_Absolute expire, |
68 | const char *name, | 68 | const char *name, |
69 | const struct GNUNET_NAMESTORE_RecordData *rd, | 69 | const struct GNUNET_NAMESTORE_RecordData *rd, |
@@ -212,12 +212,12 @@ struct LookupNameResponseMessage | |||
212 | /** | 212 | /** |
213 | * All zeros if 'contains_sig' is GNUNET_NO. | 213 | * All zeros if 'contains_sig' is GNUNET_NO. |
214 | */ | 214 | */ |
215 | struct GNUNET_CRYPTO_RsaSignature signature; | 215 | struct GNUNET_CRYPTO_EccSignature signature; |
216 | 216 | ||
217 | /** | 217 | /** |
218 | * The public key for the name | 218 | * The public key for the name |
219 | */ | 219 | */ |
220 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; | 220 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key; |
221 | 221 | ||
222 | /* 0-terminated name and serialized record data */ | 222 | /* 0-terminated name and serialized record data */ |
223 | /* rd_len bytes serialized record data */ | 223 | /* rd_len bytes serialized record data */ |
@@ -262,12 +262,12 @@ struct RecordPutMessage | |||
262 | /** | 262 | /** |
263 | * The signature | 263 | * The signature |
264 | */ | 264 | */ |
265 | struct GNUNET_CRYPTO_RsaSignature signature; | 265 | struct GNUNET_CRYPTO_EccSignature signature; |
266 | 266 | ||
267 | /** | 267 | /** |
268 | * The public key | 268 | * The public key |
269 | */ | 269 | */ |
270 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; | 270 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key; |
271 | 271 | ||
272 | /* name (0-terminated) followed by "rd_count" serialized records */ | 272 | /* name (0-terminated) followed by "rd_count" serialized records */ |
273 | 273 | ||
@@ -327,7 +327,7 @@ struct RecordCreateMessage | |||
327 | uint16_t pkey_len; | 327 | uint16_t pkey_len; |
328 | 328 | ||
329 | /* followed by: | 329 | /* followed by: |
330 | * GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded private key with length pkey_len | 330 | * GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded private key with length pkey_len |
331 | * name with length name_len | 331 | * name with length name_len |
332 | * serialized record data with length rd_len | 332 | * serialized record data with length rd_len |
333 | * */ | 333 | * */ |
@@ -383,7 +383,7 @@ struct RecordRemoveMessage | |||
383 | uint16_t pkey_len; | 383 | uint16_t pkey_len; |
384 | 384 | ||
385 | /* followed by: | 385 | /* followed by: |
386 | * GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded private key with length pkey_len | 386 | * GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded private key with length pkey_len |
387 | * name with length name_len | 387 | * name with length name_len |
388 | * serialized record data with length rd_len | 388 | * serialized record data with length rd_len |
389 | * */ | 389 | * */ |
@@ -507,12 +507,12 @@ struct ZoneToNameResponseMessage | |||
507 | /** | 507 | /** |
508 | * Signature | 508 | * Signature |
509 | */ | 509 | */ |
510 | struct GNUNET_CRYPTO_RsaSignature signature; | 510 | struct GNUNET_CRYPTO_EccSignature signature; |
511 | 511 | ||
512 | /** | 512 | /** |
513 | * Publik key | 513 | * Publik key |
514 | */ | 514 | */ |
515 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded zone_key; | 515 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded zone_key; |
516 | 516 | ||
517 | }; | 517 | }; |
518 | 518 | ||
@@ -600,12 +600,12 @@ struct ZoneIterationResponseMessage | |||
600 | /** | 600 | /** |
601 | * All zeros if 'contains_sig' is GNUNET_NO. | 601 | * All zeros if 'contains_sig' is GNUNET_NO. |
602 | */ | 602 | */ |
603 | struct GNUNET_CRYPTO_RsaSignature signature; | 603 | struct GNUNET_CRYPTO_EccSignature signature; |
604 | 604 | ||
605 | /** | 605 | /** |
606 | * The public key | 606 | * The public key |
607 | */ | 607 | */ |
608 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; | 608 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key; |
609 | 609 | ||
610 | 610 | ||
611 | 611 | ||
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 5e82e08ba..7a7c3eabb 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c | |||
@@ -264,9 +264,9 @@ handle_lookup_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe, | |||
264 | { | 264 | { |
265 | const char *name; | 265 | const char *name; |
266 | const char * rd_tmp; | 266 | const char * rd_tmp; |
267 | const struct GNUNET_CRYPTO_RsaSignature *signature; | 267 | const struct GNUNET_CRYPTO_EccSignature *signature; |
268 | struct GNUNET_TIME_Absolute expire; | 268 | struct GNUNET_TIME_Absolute expire; |
269 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key_tmp; | 269 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *public_key_tmp; |
270 | size_t exp_msg_len; | 270 | size_t exp_msg_len; |
271 | size_t msg_len; | 271 | size_t msg_len; |
272 | size_t name_len; | 272 | size_t name_len; |
@@ -282,7 +282,7 @@ handle_lookup_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe, | |||
282 | contains_sig = ntohs (msg->contains_sig); | 282 | contains_sig = ntohs (msg->contains_sig); |
283 | expire = GNUNET_TIME_absolute_ntoh (msg->expire); | 283 | expire = GNUNET_TIME_absolute_ntoh (msg->expire); |
284 | exp_msg_len = sizeof (struct LookupNameResponseMessage) + | 284 | exp_msg_len = sizeof (struct LookupNameResponseMessage) + |
285 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + | 285 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) + |
286 | name_len + rd_len; | 286 | name_len + rd_len; |
287 | if (msg_len != exp_msg_len) | 287 | if (msg_len != exp_msg_len) |
288 | { | 288 | { |
@@ -589,7 +589,7 @@ handle_zone_iteration_response (struct GNUNET_NAMESTORE_ZoneIterator *ze, | |||
589 | const struct ZoneIterationResponseMessage *msg, | 589 | const struct ZoneIterationResponseMessage *msg, |
590 | size_t size) | 590 | size_t size) |
591 | { | 591 | { |
592 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubdummy; | 592 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubdummy; |
593 | size_t msg_len; | 593 | size_t msg_len; |
594 | size_t exp_msg_len; | 594 | size_t exp_msg_len; |
595 | size_t name_len; | 595 | size_t name_len; |
@@ -1003,12 +1003,12 @@ GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h) | |||
1003 | */ | 1003 | */ |
1004 | struct GNUNET_NAMESTORE_QueueEntry * | 1004 | struct GNUNET_NAMESTORE_QueueEntry * |
1005 | GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, | 1005 | GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, |
1006 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 1006 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
1007 | const char *name, | 1007 | const char *name, |
1008 | struct GNUNET_TIME_Absolute freshness, | 1008 | struct GNUNET_TIME_Absolute freshness, |
1009 | unsigned int rd_count, | 1009 | unsigned int rd_count, |
1010 | const struct GNUNET_NAMESTORE_RecordData *rd, | 1010 | const struct GNUNET_NAMESTORE_RecordData *rd, |
1011 | const struct GNUNET_CRYPTO_RsaSignature *signature, | 1011 | const struct GNUNET_CRYPTO_EccSignature *signature, |
1012 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | 1012 | GNUNET_NAMESTORE_ContinuationWithStatus cont, |
1013 | void *cont_cls) | 1013 | void *cont_cls) |
1014 | { | 1014 | { |
@@ -1088,18 +1088,18 @@ GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h, | |||
1088 | * @return GNUNET_OK if the signature is valid | 1088 | * @return GNUNET_OK if the signature is valid |
1089 | */ | 1089 | */ |
1090 | int | 1090 | int |
1091 | GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, | 1091 | GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *public_key, |
1092 | const struct GNUNET_TIME_Absolute freshness, | 1092 | const struct GNUNET_TIME_Absolute freshness, |
1093 | const char *name, | 1093 | const char *name, |
1094 | unsigned int rd_count, | 1094 | unsigned int rd_count, |
1095 | const struct GNUNET_NAMESTORE_RecordData *rd, | 1095 | const struct GNUNET_NAMESTORE_RecordData *rd, |
1096 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 1096 | const struct GNUNET_CRYPTO_EccSignature *signature) |
1097 | { | 1097 | { |
1098 | size_t rd_ser_len; | 1098 | size_t rd_ser_len; |
1099 | size_t name_len; | 1099 | size_t name_len; |
1100 | char *name_tmp; | 1100 | char *name_tmp; |
1101 | char *rd_ser; | 1101 | char *rd_ser; |
1102 | struct GNUNET_CRYPTO_RsaSignaturePurpose *sig_purpose; | 1102 | struct GNUNET_CRYPTO_EccSignaturePurpose *sig_purpose; |
1103 | struct GNUNET_TIME_AbsoluteNBO *expire_tmp; | 1103 | struct GNUNET_TIME_AbsoluteNBO *expire_tmp; |
1104 | struct GNUNET_TIME_AbsoluteNBO expire_nbo = GNUNET_TIME_absolute_hton (freshness); | 1104 | struct GNUNET_TIME_AbsoluteNBO expire_nbo = GNUNET_TIME_absolute_hton (freshness); |
1105 | uint32_t sig_len; | 1105 | uint32_t sig_len; |
@@ -1115,11 +1115,11 @@ GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_RsaPublicKeyBinary | |||
1115 | return GNUNET_SYSERR; | 1115 | return GNUNET_SYSERR; |
1116 | } | 1116 | } |
1117 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); | 1117 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); |
1118 | sig_len = sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + rd_ser_len + name_len; | 1118 | sig_len = sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + rd_ser_len + name_len; |
1119 | { | 1119 | { |
1120 | char sig_buf[sig_len] GNUNET_ALIGN; | 1120 | char sig_buf[sig_len] GNUNET_ALIGN; |
1121 | 1121 | ||
1122 | sig_purpose = (struct GNUNET_CRYPTO_RsaSignaturePurpose *) sig_buf; | 1122 | sig_purpose = (struct GNUNET_CRYPTO_EccSignaturePurpose *) sig_buf; |
1123 | sig_purpose->size = htonl (sig_len); | 1123 | sig_purpose->size = htonl (sig_len); |
1124 | sig_purpose->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN); | 1124 | sig_purpose->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN); |
1125 | expire_tmp = (struct GNUNET_TIME_AbsoluteNBO *) &sig_purpose[1]; | 1125 | expire_tmp = (struct GNUNET_TIME_AbsoluteNBO *) &sig_purpose[1]; |
@@ -1129,7 +1129,7 @@ GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_RsaPublicKeyBinary | |||
1129 | rd_ser = &name_tmp[name_len]; | 1129 | rd_ser = &name_tmp[name_len]; |
1130 | GNUNET_assert (rd_ser_len == | 1130 | GNUNET_assert (rd_ser_len == |
1131 | GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_ser)); | 1131 | GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_ser)); |
1132 | return GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN, sig_purpose, signature, public_key); | 1132 | return GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN, sig_purpose, signature, public_key); |
1133 | } | 1133 | } |
1134 | } | 1134 | } |
1135 | 1135 | ||
@@ -1149,7 +1149,7 @@ GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_RsaPublicKeyBinary | |||
1149 | */ | 1149 | */ |
1150 | struct GNUNET_NAMESTORE_QueueEntry * | 1150 | struct GNUNET_NAMESTORE_QueueEntry * |
1151 | GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, | 1151 | GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, |
1152 | const struct GNUNET_CRYPTO_RsaPrivateKey *pkey, | 1152 | const struct GNUNET_CRYPTO_EccPrivateKey *pkey, |
1153 | const char *name, | 1153 | const char *name, |
1154 | const struct GNUNET_NAMESTORE_RecordData *rd, | 1154 | const struct GNUNET_NAMESTORE_RecordData *rd, |
1155 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | 1155 | GNUNET_NAMESTORE_ContinuationWithStatus cont, |
@@ -1166,7 +1166,7 @@ GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, | |||
1166 | size_t key_len; | 1166 | size_t key_len; |
1167 | uint32_t rid; | 1167 | uint32_t rid; |
1168 | struct RecordCreateMessage * msg; | 1168 | struct RecordCreateMessage * msg; |
1169 | struct GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded * pkey_enc; | 1169 | struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded * pkey_enc; |
1170 | 1170 | ||
1171 | GNUNET_assert (NULL != h); | 1171 | GNUNET_assert (NULL != h); |
1172 | GNUNET_assert (NULL != pkey); | 1172 | GNUNET_assert (NULL != pkey); |
@@ -1190,11 +1190,11 @@ GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, | |||
1190 | qe->op_id = rid; | 1190 | qe->op_id = rid; |
1191 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, qe); | 1191 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, qe); |
1192 | 1192 | ||
1193 | pkey_enc = GNUNET_CRYPTO_rsa_encode_key (pkey); | 1193 | pkey_enc = GNUNET_CRYPTO_ecc_encode_key (pkey); |
1194 | GNUNET_assert (NULL != pkey_enc); | 1194 | GNUNET_assert (NULL != pkey_enc); |
1195 | 1195 | ||
1196 | /* setup msg */ | 1196 | /* setup msg */ |
1197 | key_len = ntohs (pkey_enc->len); | 1197 | key_len = ntohs (pkey_enc->size); |
1198 | rd_ser_len = GNUNET_NAMESTORE_records_get_size(1, rd); | 1198 | rd_ser_len = GNUNET_NAMESTORE_records_get_size(1, rd); |
1199 | msg_size = sizeof (struct RecordCreateMessage) + key_len + name_len + rd_ser_len; | 1199 | msg_size = sizeof (struct RecordCreateMessage) + key_len + name_len + rd_ser_len; |
1200 | pe = GNUNET_malloc(sizeof (struct PendingMessage) + msg_size); | 1200 | pe = GNUNET_malloc(sizeof (struct PendingMessage) + msg_size); |
@@ -1244,14 +1244,14 @@ GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, | |||
1244 | */ | 1244 | */ |
1245 | struct GNUNET_NAMESTORE_QueueEntry * | 1245 | struct GNUNET_NAMESTORE_QueueEntry * |
1246 | GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, | 1246 | GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, |
1247 | const struct GNUNET_CRYPTO_RsaPrivateKey *pkey, | 1247 | const struct GNUNET_CRYPTO_EccPrivateKey *pkey, |
1248 | const char *name, | 1248 | const char *name, |
1249 | const struct GNUNET_NAMESTORE_RecordData *rd, | 1249 | const struct GNUNET_NAMESTORE_RecordData *rd, |
1250 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | 1250 | GNUNET_NAMESTORE_ContinuationWithStatus cont, |
1251 | void *cont_cls) | 1251 | void *cont_cls) |
1252 | { | 1252 | { |
1253 | struct GNUNET_NAMESTORE_QueueEntry *qe; | 1253 | struct GNUNET_NAMESTORE_QueueEntry *qe; |
1254 | struct GNUNET_CRYPTO_RsaPrivateKeyBinaryEncoded * pkey_enc; | 1254 | struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded *pkey_enc; |
1255 | struct PendingMessage *pe; | 1255 | struct PendingMessage *pe; |
1256 | struct RecordRemoveMessage * msg; | 1256 | struct RecordRemoveMessage * msg; |
1257 | char *pkey_tmp; | 1257 | char *pkey_tmp; |
@@ -1282,15 +1282,15 @@ GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, | |||
1282 | qe->op_id = rid; | 1282 | qe->op_id = rid; |
1283 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, qe); | 1283 | GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, qe); |
1284 | 1284 | ||
1285 | pkey_enc = GNUNET_CRYPTO_rsa_encode_key (pkey); | 1285 | pkey_enc = GNUNET_CRYPTO_ecc_encode_key (pkey); |
1286 | GNUNET_assert (NULL != pkey_enc); | 1286 | GNUNET_assert (NULL != pkey_enc); |
1287 | key_len = ntohs (pkey_enc->len); | 1287 | key_len = ntohs (pkey_enc->size); |
1288 | 1288 | ||
1289 | rd_count = (NULL == rd) ? 0 : 1; | 1289 | rd_count = (NULL == rd) ? 0 : 1; |
1290 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); | 1290 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); |
1291 | name_len = strlen (name) + 1; | 1291 | name_len = strlen (name) + 1; |
1292 | msg_size = sizeof (struct RecordRemoveMessage) + key_len + name_len + rd_ser_len; | 1292 | msg_size = sizeof (struct RecordRemoveMessage) + key_len + name_len + rd_ser_len; |
1293 | pe = GNUNET_malloc(sizeof (struct PendingMessage) + msg_size); | 1293 | pe = GNUNET_malloc (sizeof (struct PendingMessage) + msg_size); |
1294 | pe->size = msg_size; | 1294 | pe->size = msg_size; |
1295 | pe->is_init = GNUNET_NO; | 1295 | pe->is_init = GNUNET_NO; |
1296 | msg = (struct RecordRemoveMessage *) &pe[1]; | 1296 | msg = (struct RecordRemoveMessage *) &pe[1]; |
diff --git a/src/namestore/namestore_common.c b/src/namestore/namestore_common.c index 573a8d0a8..826eae504 100644 --- a/src/namestore/namestore_common.c +++ b/src/namestore/namestore_common.c | |||
@@ -279,15 +279,15 @@ GNUNET_NAMESTORE_records_deserialize (size_t len, | |||
279 | * | 279 | * |
280 | * @return the signature | 280 | * @return the signature |
281 | */ | 281 | */ |
282 | struct GNUNET_CRYPTO_RsaSignature * | 282 | struct GNUNET_CRYPTO_EccSignature * |
283 | GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | 283 | GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_EccPrivateKey *key, |
284 | struct GNUNET_TIME_Absolute expire, | 284 | struct GNUNET_TIME_Absolute expire, |
285 | const char *name, | 285 | const char *name, |
286 | const struct GNUNET_NAMESTORE_RecordData *rd, | 286 | const struct GNUNET_NAMESTORE_RecordData *rd, |
287 | unsigned int rd_count) | 287 | unsigned int rd_count) |
288 | { | 288 | { |
289 | struct GNUNET_CRYPTO_RsaSignature *sig; | 289 | struct GNUNET_CRYPTO_EccSignature *sig; |
290 | struct GNUNET_CRYPTO_RsaSignaturePurpose *sig_purpose; | 290 | struct GNUNET_CRYPTO_EccSignaturePurpose *sig_purpose; |
291 | struct GNUNET_TIME_AbsoluteNBO expire_nbo; | 291 | struct GNUNET_TIME_AbsoluteNBO expire_nbo; |
292 | size_t rd_ser_len; | 292 | size_t rd_ser_len; |
293 | size_t name_len; | 293 | size_t name_len; |
@@ -302,7 +302,7 @@ GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key | |||
302 | GNUNET_break (0); | 302 | GNUNET_break (0); |
303 | return NULL; | 303 | return NULL; |
304 | } | 304 | } |
305 | sig = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_RsaSignature)); | 305 | sig = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_EccSignature)); |
306 | name_len = strlen (name) + 1; | 306 | name_len = strlen (name) + 1; |
307 | expire_nbo = GNUNET_TIME_absolute_hton (expire); | 307 | expire_nbo = GNUNET_TIME_absolute_hton (expire); |
308 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); | 308 | rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); |
@@ -311,7 +311,7 @@ GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key | |||
311 | 311 | ||
312 | GNUNET_assert (rd_ser_len == | 312 | GNUNET_assert (rd_ser_len == |
313 | GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_ser)); | 313 | GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_ser)); |
314 | sig_len = sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + rd_ser_len + name_len; | 314 | sig_len = sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + rd_ser_len + name_len; |
315 | sig_purpose = GNUNET_malloc (sig_len); | 315 | sig_purpose = GNUNET_malloc (sig_len); |
316 | sig_purpose->size = htonl (sig_len); | 316 | sig_purpose->size = htonl (sig_len); |
317 | sig_purpose->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN); | 317 | sig_purpose->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_GNS_RECORD_SIGN); |
@@ -321,7 +321,7 @@ GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key | |||
321 | memcpy (name_tmp, name, name_len); | 321 | memcpy (name_tmp, name, name_len); |
322 | rd_tmp = &name_tmp[name_len]; | 322 | rd_tmp = &name_tmp[name_len]; |
323 | memcpy (rd_tmp, rd_ser, rd_ser_len); | 323 | memcpy (rd_tmp, rd_ser, rd_ser_len); |
324 | res = GNUNET_CRYPTO_rsa_sign (key, sig_purpose, sig); | 324 | res = GNUNET_CRYPTO_ecc_sign (key, sig_purpose, sig); |
325 | GNUNET_free (sig_purpose); | 325 | GNUNET_free (sig_purpose); |
326 | } | 326 | } |
327 | if (GNUNET_OK != res) | 327 | if (GNUNET_OK != res) |
diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c index 3cddc952d..070549b33 100644 --- a/src/namestore/plugin_namestore_postgres.c +++ b/src/namestore/plugin_namestore_postgres.c | |||
@@ -269,12 +269,12 @@ namestore_postgres_remove_records (void *cls, | |||
269 | */ | 269 | */ |
270 | static int | 270 | static int |
271 | namestore_postgres_put_records (void *cls, | 271 | namestore_postgres_put_records (void *cls, |
272 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 272 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
273 | struct GNUNET_TIME_Absolute expire, | 273 | struct GNUNET_TIME_Absolute expire, |
274 | const char *name, | 274 | const char *name, |
275 | unsigned int rd_count, | 275 | unsigned int rd_count, |
276 | const struct GNUNET_NAMESTORE_RecordData *rd, | 276 | const struct GNUNET_NAMESTORE_RecordData *rd, |
277 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 277 | const struct GNUNET_CRYPTO_EccSignature *signature) |
278 | { | 278 | { |
279 | struct Plugin *plugin = cls; | 279 | struct Plugin *plugin = cls; |
280 | PGresult *ret; | 280 | PGresult *ret; |
@@ -287,7 +287,7 @@ namestore_postgres_put_records (void *cls, | |||
287 | unsigned int i; | 287 | unsigned int i; |
288 | 288 | ||
289 | GNUNET_CRYPTO_short_hash (zone_key, | 289 | GNUNET_CRYPTO_short_hash (zone_key, |
290 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 290 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
291 | &zone); | 291 | &zone); |
292 | (void) namestore_postgres_remove_records (plugin, &zone, name); | 292 | (void) namestore_postgres_remove_records (plugin, &zone, name); |
293 | name_len = strlen (name); | 293 | name_len = strlen (name); |
@@ -327,12 +327,12 @@ namestore_postgres_put_records (void *cls, | |||
327 | (const char *) &rvalue_be | 327 | (const char *) &rvalue_be |
328 | }; | 328 | }; |
329 | int paramLengths[] = { | 329 | int paramLengths[] = { |
330 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 330 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
331 | name_len, | 331 | name_len, |
332 | sizeof (uint32_t), | 332 | sizeof (uint32_t), |
333 | data_size, | 333 | data_size, |
334 | sizeof (uint64_t), | 334 | sizeof (uint64_t), |
335 | sizeof (struct GNUNET_CRYPTO_RsaSignature), | 335 | sizeof (struct GNUNET_CRYPTO_EccSignature), |
336 | sizeof (struct GNUNET_CRYPTO_ShortHashCode), | 336 | sizeof (struct GNUNET_CRYPTO_ShortHashCode), |
337 | sizeof (struct GNUNET_CRYPTO_ShortHashCode), | 337 | sizeof (struct GNUNET_CRYPTO_ShortHashCode), |
338 | sizeof (struct GNUNET_CRYPTO_ShortHashCode), | 338 | sizeof (struct GNUNET_CRYPTO_ShortHashCode), |
@@ -378,8 +378,8 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
378 | { | 378 | { |
379 | unsigned int record_count; | 379 | unsigned int record_count; |
380 | size_t data_size; | 380 | size_t data_size; |
381 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key; | 381 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key; |
382 | const struct GNUNET_CRYPTO_RsaSignature *sig; | 382 | const struct GNUNET_CRYPTO_EccSignature *sig; |
383 | struct GNUNET_TIME_Absolute expiration; | 383 | struct GNUNET_TIME_Absolute expiration; |
384 | const char *data; | 384 | const char *data; |
385 | const char *name; | 385 | const char *name; |
@@ -406,16 +406,16 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
406 | } | 406 | } |
407 | GNUNET_assert (1 == cnt); | 407 | GNUNET_assert (1 == cnt); |
408 | if ((6 != PQnfields (res)) || | 408 | if ((6 != PQnfields (res)) || |
409 | (sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) != PQgetlength (res, 0, 0)) || | 409 | (sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) != PQgetlength (res, 0, 0)) || |
410 | (sizeof (uint32_t) != PQfsize (res, 2)) || | 410 | (sizeof (uint32_t) != PQfsize (res, 2)) || |
411 | (sizeof (uint64_t) != PQfsize (res, 4)) || | 411 | (sizeof (uint64_t) != PQfsize (res, 4)) || |
412 | (sizeof (struct GNUNET_CRYPTO_RsaSignature) != PQgetlength (res, 0, 5))) | 412 | (sizeof (struct GNUNET_CRYPTO_EccSignature) != PQgetlength (res, 0, 5))) |
413 | { | 413 | { |
414 | GNUNET_break (0); | 414 | GNUNET_break (0); |
415 | PQclear (res); | 415 | PQclear (res); |
416 | return GNUNET_SYSERR; | 416 | return GNUNET_SYSERR; |
417 | } | 417 | } |
418 | zone_key = (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *) PQgetvalue (res, 0, 0); | 418 | zone_key = (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *) PQgetvalue (res, 0, 0); |
419 | name = PQgetvalue (res, 0, 1); | 419 | name = PQgetvalue (res, 0, 1); |
420 | name_len = PQgetlength (res, 0, 1); | 420 | name_len = PQgetlength (res, 0, 1); |
421 | record_count = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2)); | 421 | record_count = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2)); |
@@ -423,7 +423,7 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
423 | data = PQgetvalue (res, 0, 3); | 423 | data = PQgetvalue (res, 0, 3); |
424 | expiration.abs_value = | 424 | expiration.abs_value = |
425 | GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 4)); | 425 | GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 4)); |
426 | sig = (const struct GNUNET_CRYPTO_RsaSignature*) PQgetvalue (res, 0, 5); | 426 | sig = (const struct GNUNET_CRYPTO_EccSignature*) PQgetvalue (res, 0, 5); |
427 | if (record_count > 64 * 1024) | 427 | if (record_count > 64 * 1024) |
428 | { | 428 | { |
429 | /* sanity check, don't stack allocate far too much just | 429 | /* sanity check, don't stack allocate far too much just |
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index f0deb7fa9..f0b801d1e 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c | |||
@@ -450,12 +450,12 @@ namestore_sqlite_remove_records (void *cls, | |||
450 | */ | 450 | */ |
451 | static int | 451 | static int |
452 | namestore_sqlite_put_records (void *cls, | 452 | namestore_sqlite_put_records (void *cls, |
453 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 453 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
454 | struct GNUNET_TIME_Absolute expire, | 454 | struct GNUNET_TIME_Absolute expire, |
455 | const char *name, | 455 | const char *name, |
456 | unsigned int rd_count, | 456 | unsigned int rd_count, |
457 | const struct GNUNET_NAMESTORE_RecordData *rd, | 457 | const struct GNUNET_NAMESTORE_RecordData *rd, |
458 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 458 | const struct GNUNET_CRYPTO_EccSignature *signature) |
459 | { | 459 | { |
460 | struct Plugin *plugin = cls; | 460 | struct Plugin *plugin = cls; |
461 | int n; | 461 | int n; |
@@ -467,7 +467,7 @@ namestore_sqlite_put_records (void *cls, | |||
467 | size_t data_size; | 467 | size_t data_size; |
468 | unsigned int i; | 468 | unsigned int i; |
469 | 469 | ||
470 | GNUNET_CRYPTO_short_hash (zone_key, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &zone); | 470 | GNUNET_CRYPTO_short_hash (zone_key, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &zone); |
471 | (void) namestore_sqlite_remove_records (plugin, &zone, name); | 471 | (void) namestore_sqlite_remove_records (plugin, &zone, name); |
472 | name_len = strlen (name); | 472 | name_len = strlen (name); |
473 | GNUNET_CRYPTO_short_hash (name, name_len, &nh); | 473 | GNUNET_CRYPTO_short_hash (name, name_len, &nh); |
@@ -497,12 +497,12 @@ namestore_sqlite_put_records (void *cls, | |||
497 | GNUNET_break (0); | 497 | GNUNET_break (0); |
498 | return GNUNET_SYSERR; | 498 | return GNUNET_SYSERR; |
499 | } | 499 | } |
500 | if ((SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 1, zone_key, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), SQLITE_STATIC)) || | 500 | if ((SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 1, zone_key, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), SQLITE_STATIC)) || |
501 | (SQLITE_OK != sqlite3_bind_text (plugin->put_records, 2, name, -1, SQLITE_STATIC)) || | 501 | (SQLITE_OK != sqlite3_bind_text (plugin->put_records, 2, name, -1, SQLITE_STATIC)) || |
502 | (SQLITE_OK != sqlite3_bind_int (plugin->put_records, 3, rd_count)) || | 502 | (SQLITE_OK != sqlite3_bind_int (plugin->put_records, 3, rd_count)) || |
503 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 4, data, data_size, SQLITE_STATIC)) || | 503 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 4, data, data_size, SQLITE_STATIC)) || |
504 | (SQLITE_OK != sqlite3_bind_int64 (plugin->put_records, 5, expire.abs_value)) || | 504 | (SQLITE_OK != sqlite3_bind_int64 (plugin->put_records, 5, expire.abs_value)) || |
505 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 6, signature, sizeof (struct GNUNET_CRYPTO_RsaSignature), SQLITE_STATIC)) || | 505 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 6, signature, sizeof (struct GNUNET_CRYPTO_EccSignature), SQLITE_STATIC)) || |
506 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 7, &zone_delegation, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || | 506 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 7, &zone_delegation, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || |
507 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 8, &zone, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || | 507 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 8, &zone, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || |
508 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 9, &nh, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || | 508 | (SQLITE_OK != sqlite3_bind_blob (plugin->put_records, 9, &nh, sizeof (struct GNUNET_CRYPTO_ShortHashCode), SQLITE_STATIC)) || |
@@ -560,8 +560,8 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
560 | int sret; | 560 | int sret; |
561 | unsigned int record_count; | 561 | unsigned int record_count; |
562 | size_t data_size; | 562 | size_t data_size; |
563 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key; | 563 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key; |
564 | const struct GNUNET_CRYPTO_RsaSignature *sig; | 564 | const struct GNUNET_CRYPTO_EccSignature *sig; |
565 | struct GNUNET_TIME_Absolute expiration; | 565 | struct GNUNET_TIME_Absolute expiration; |
566 | const char *data; | 566 | const char *data; |
567 | const char *name; | 567 | const char *name; |
@@ -578,8 +578,8 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
578 | expiration.abs_value = (uint64_t) sqlite3_column_int64 (stmt, 4); | 578 | expiration.abs_value = (uint64_t) sqlite3_column_int64 (stmt, 4); |
579 | sig = sqlite3_column_blob (stmt, 5); | 579 | sig = sqlite3_column_blob (stmt, 5); |
580 | 580 | ||
581 | if ( (sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) != sqlite3_column_bytes (stmt, 0)) || | 581 | if ( (sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) != sqlite3_column_bytes (stmt, 0)) || |
582 | (sizeof (struct GNUNET_CRYPTO_RsaSignature) != sqlite3_column_bytes (stmt, 5)) ) | 582 | (sizeof (struct GNUNET_CRYPTO_EccSignature) != sqlite3_column_bytes (stmt, 5)) ) |
583 | { | 583 | { |
584 | GNUNET_break (0); | 584 | GNUNET_break (0); |
585 | ret = GNUNET_SYSERR; | 585 | ret = GNUNET_SYSERR; |
diff --git a/src/namestore/test_namestore_api.c b/src/namestore/test_namestore_api.c index c290673fa..32dd4844c 100644 --- a/src/namestore/test_namestore_api.c +++ b/src/namestore/test_namestore_api.c | |||
@@ -39,9 +39,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh; | |||
39 | 39 | ||
40 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 40 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_RsaPrivateKey *privkey; | 42 | static struct GNUNET_CRYPTO_EccPrivateKey *privkey; |
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 44 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
45 | 45 | ||
46 | static struct GNUNET_CRYPTO_ShortHashCode zone; | 46 | static struct GNUNET_CRYPTO_ShortHashCode zone; |
47 | 47 | ||
@@ -60,7 +60,7 @@ cleanup () | |||
60 | } | 60 | } |
61 | if (NULL != privkey) | 61 | if (NULL != privkey) |
62 | { | 62 | { |
63 | GNUNET_CRYPTO_rsa_key_free (privkey); | 63 | GNUNET_CRYPTO_ecc_key_free (privkey); |
64 | privkey = NULL; | 64 | privkey = NULL; |
65 | } | 65 | } |
66 | GNUNET_SCHEDULER_shutdown (); | 66 | GNUNET_SCHEDULER_shutdown (); |
@@ -96,12 +96,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
96 | 96 | ||
97 | static void | 97 | static void |
98 | name_lookup_proc (void *cls, | 98 | name_lookup_proc (void *cls, |
99 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 99 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
100 | struct GNUNET_TIME_Absolute expire, | 100 | struct GNUNET_TIME_Absolute expire, |
101 | const char *name, | 101 | const char *name, |
102 | unsigned int rd_count, | 102 | unsigned int rd_count, |
103 | const struct GNUNET_NAMESTORE_RecordData *rd, | 103 | const struct GNUNET_NAMESTORE_RecordData *rd, |
104 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 104 | const struct GNUNET_CRYPTO_EccSignature *signature) |
105 | { | 105 | { |
106 | nsqe = NULL; | 106 | nsqe = NULL; |
107 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 107 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -135,7 +135,7 @@ run (void *cls, | |||
135 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 135 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
136 | struct GNUNET_TESTING_Peer *peer) | 136 | struct GNUNET_TESTING_Peer *peer) |
137 | { | 137 | { |
138 | struct GNUNET_CRYPTO_RsaSignature signature; | 138 | struct GNUNET_CRYPTO_EccSignature signature; |
139 | struct GNUNET_NAMESTORE_RecordData rd; | 139 | struct GNUNET_NAMESTORE_RecordData rd; |
140 | char *hostkey_file; | 140 | char *hostkey_file; |
141 | const char * name = "dummy.dummy.gnunet"; | 141 | const char * name = "dummy.dummy.gnunet"; |
@@ -147,10 +147,10 @@ run (void *cls, | |||
147 | DIR_SEPARATOR_STR, | 147 | DIR_SEPARATOR_STR, |
148 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 148 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
149 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 149 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
150 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file (hostkey_file); | 150 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file); |
151 | GNUNET_free (hostkey_file); | 151 | GNUNET_free (hostkey_file); |
152 | GNUNET_assert (privkey != NULL); | 152 | GNUNET_assert (privkey != NULL); |
153 | GNUNET_CRYPTO_rsa_key_get_public (privkey, &pubkey); | 153 | GNUNET_CRYPTO_ecc_key_get_public (privkey, &pubkey); |
154 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (pubkey), &zone); | 154 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (pubkey), &zone); |
155 | memset (&signature, '\0', sizeof (signature)); | 155 | memset (&signature, '\0', sizeof (signature)); |
156 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value; | 156 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value; |
diff --git a/src/namestore/test_namestore_api_create.c b/src/namestore/test_namestore_api_create.c index 8bdf1338d..6db832149 100644 --- a/src/namestore/test_namestore_api_create.c +++ b/src/namestore/test_namestore_api_create.c | |||
@@ -50,13 +50,13 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
50 | 50 | ||
51 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 51 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
52 | 52 | ||
53 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 53 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
54 | 54 | ||
55 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 55 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
56 | 56 | ||
57 | static struct GNUNET_CRYPTO_RsaSignature *s_signature; | 57 | static struct GNUNET_CRYPTO_EccSignature *s_signature; |
58 | 58 | ||
59 | static struct GNUNET_CRYPTO_RsaSignature *s_signature_updated; | 59 | static struct GNUNET_CRYPTO_EccSignature *s_signature_updated; |
60 | 60 | ||
61 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; | 61 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; |
62 | 62 | ||
@@ -82,7 +82,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
82 | GNUNET_NAMESTORE_disconnect (nsh); | 82 | GNUNET_NAMESTORE_disconnect (nsh); |
83 | nsh = NULL; | 83 | nsh = NULL; |
84 | if (privkey != NULL) | 84 | if (privkey != NULL) |
85 | GNUNET_CRYPTO_rsa_key_free (privkey); | 85 | GNUNET_CRYPTO_ecc_key_free (privkey); |
86 | privkey = NULL; | 86 | privkey = NULL; |
87 | GNUNET_free_non_null (s_name); | 87 | GNUNET_free_non_null (s_name); |
88 | res = 1; | 88 | res = 1; |
@@ -102,7 +102,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
102 | GNUNET_free_non_null (s_second_record); | 102 | GNUNET_free_non_null (s_second_record); |
103 | GNUNET_free_non_null (s_name); | 103 | GNUNET_free_non_null (s_name); |
104 | if (privkey != NULL) | 104 | if (privkey != NULL) |
105 | GNUNET_CRYPTO_rsa_key_free (privkey); | 105 | GNUNET_CRYPTO_ecc_key_free (privkey); |
106 | privkey = NULL; | 106 | privkey = NULL; |
107 | if (nsh != NULL) | 107 | if (nsh != NULL) |
108 | GNUNET_NAMESTORE_disconnect (nsh); | 108 | GNUNET_NAMESTORE_disconnect (nsh); |
@@ -112,12 +112,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
112 | 112 | ||
113 | static void | 113 | static void |
114 | name_lookup_second_proc (void *cls, | 114 | name_lookup_second_proc (void *cls, |
115 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 115 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
116 | struct GNUNET_TIME_Absolute expire, | 116 | struct GNUNET_TIME_Absolute expire, |
117 | const char *n, | 117 | const char *n, |
118 | unsigned int rd_count, | 118 | unsigned int rd_count, |
119 | const struct GNUNET_NAMESTORE_RecordData *rd, | 119 | const struct GNUNET_NAMESTORE_RecordData *rd, |
120 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 120 | const struct GNUNET_CRYPTO_EccSignature *signature) |
121 | { | 121 | { |
122 | static int found = GNUNET_NO; | 122 | static int found = GNUNET_NO; |
123 | int failed = GNUNET_NO; | 123 | int failed = GNUNET_NO; |
@@ -126,7 +126,7 @@ name_lookup_second_proc (void *cls, | |||
126 | if (n != NULL) | 126 | if (n != NULL) |
127 | { | 127 | { |
128 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking returned results\n"); | 128 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking returned results\n"); |
129 | if (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))) | 129 | if (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded))) |
130 | { | 130 | { |
131 | GNUNET_break (0); | 131 | GNUNET_break (0); |
132 | failed = GNUNET_YES; | 132 | failed = GNUNET_YES; |
@@ -172,7 +172,7 @@ name_lookup_second_proc (void *cls, | |||
172 | rd_new[1].flags = 0; /* unset GNUNET_NAMESTORE_RF_AUTHORITY */ | 172 | rd_new[1].flags = 0; /* unset GNUNET_NAMESTORE_RF_AUTHORITY */ |
173 | s_signature_updated = GNUNET_NAMESTORE_create_signature (privkey, expire, s_name, rd_new, 2); | 173 | s_signature_updated = GNUNET_NAMESTORE_create_signature (privkey, expire, s_name, rd_new, 2); |
174 | 174 | ||
175 | if (0 != memcmp (s_signature_updated, signature, sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 175 | if (0 != memcmp (s_signature_updated, signature, sizeof (struct GNUNET_CRYPTO_EccSignature))) |
176 | { | 176 | { |
177 | GNUNET_break (0); | 177 | GNUNET_break (0); |
178 | failed = GNUNET_YES; | 178 | failed = GNUNET_YES; |
@@ -219,12 +219,12 @@ create_second_cont (void *cls, int32_t success, const char *emsg) | |||
219 | 219 | ||
220 | static void | 220 | static void |
221 | name_lookup_initial_proc (void *cls, | 221 | name_lookup_initial_proc (void *cls, |
222 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 222 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
223 | struct GNUNET_TIME_Absolute expire, | 223 | struct GNUNET_TIME_Absolute expire, |
224 | const char *n, | 224 | const char *n, |
225 | unsigned int rd_count, | 225 | unsigned int rd_count, |
226 | const struct GNUNET_NAMESTORE_RecordData *rd, | 226 | const struct GNUNET_NAMESTORE_RecordData *rd, |
227 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 227 | const struct GNUNET_CRYPTO_EccSignature *signature) |
228 | { | 228 | { |
229 | char * name = cls; | 229 | char * name = cls; |
230 | static int found = GNUNET_NO; | 230 | static int found = GNUNET_NO; |
@@ -234,7 +234,7 @@ name_lookup_initial_proc (void *cls, | |||
234 | if (n != NULL) | 234 | if (n != NULL) |
235 | { | 235 | { |
236 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking returned results\n"); | 236 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking returned results\n"); |
237 | if (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))) | 237 | if (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded))) |
238 | { | 238 | { |
239 | GNUNET_break (0); | 239 | GNUNET_break (0); |
240 | failed = GNUNET_YES; | 240 | failed = GNUNET_YES; |
@@ -267,7 +267,7 @@ name_lookup_initial_proc (void *cls, | |||
267 | failed = GNUNET_YES; | 267 | failed = GNUNET_YES; |
268 | } | 268 | } |
269 | 269 | ||
270 | if (0 != memcmp (s_signature, signature, sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 270 | if (0 != memcmp (s_signature, signature, sizeof (struct GNUNET_CRYPTO_EccSignature))) |
271 | { | 271 | { |
272 | GNUNET_break (0); | 272 | GNUNET_break (0); |
273 | failed = GNUNET_YES; | 273 | failed = GNUNET_YES; |
@@ -357,10 +357,10 @@ run (void *cls, | |||
357 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 357 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
358 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 358 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
359 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 359 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
360 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 360 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
361 | GNUNET_free (hostkey_file); | 361 | GNUNET_free (hostkey_file); |
362 | /* get public key */ | 362 | /* get public key */ |
363 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 363 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
364 | 364 | ||
365 | /* create record */ | 365 | /* create record */ |
366 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); | 366 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); |
@@ -373,7 +373,7 @@ run (void *cls, | |||
373 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1); | 373 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1); |
374 | 374 | ||
375 | /* create random zone hash */ | 375 | /* create random zone hash */ |
376 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 376 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone); |
377 | 377 | ||
378 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_short_h2s (&s_zone)); | 378 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_short_h2s (&s_zone)); |
379 | nsh = GNUNET_NAMESTORE_connect (cfg); | 379 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_create_update.c b/src/namestore/test_namestore_api_create_update.c index 2a5c45e75..5df7c4934 100644 --- a/src/namestore/test_namestore_api_create_update.c +++ b/src/namestore/test_namestore_api_create_update.c | |||
@@ -50,11 +50,11 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
50 | 50 | ||
51 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 51 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
52 | 52 | ||
53 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 53 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
54 | 54 | ||
55 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 55 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
56 | 56 | ||
57 | static struct GNUNET_CRYPTO_RsaSignature *s_signature; | 57 | static struct GNUNET_CRYPTO_EccSignature *s_signature; |
58 | 58 | ||
59 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; | 59 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; |
60 | 60 | ||
@@ -80,7 +80,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
80 | GNUNET_NAMESTORE_disconnect (nsh); | 80 | GNUNET_NAMESTORE_disconnect (nsh); |
81 | nsh = NULL; | 81 | nsh = NULL; |
82 | if (privkey != NULL) | 82 | if (privkey != NULL) |
83 | GNUNET_CRYPTO_rsa_key_free (privkey); | 83 | GNUNET_CRYPTO_ecc_key_free (privkey); |
84 | privkey = NULL; | 84 | privkey = NULL; |
85 | GNUNET_free_non_null (s_name); | 85 | GNUNET_free_non_null (s_name); |
86 | res = 1; | 86 | res = 1; |
@@ -99,7 +99,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
99 | GNUNET_free (s_first_record); | 99 | GNUNET_free (s_first_record); |
100 | GNUNET_free_non_null (s_second_record); | 100 | GNUNET_free_non_null (s_second_record); |
101 | if (privkey != NULL) | 101 | if (privkey != NULL) |
102 | GNUNET_CRYPTO_rsa_key_free (privkey); | 102 | GNUNET_CRYPTO_ecc_key_free (privkey); |
103 | privkey = NULL; | 103 | privkey = NULL; |
104 | if (nsh != NULL) | 104 | if (nsh != NULL) |
105 | GNUNET_NAMESTORE_disconnect (nsh); | 105 | GNUNET_NAMESTORE_disconnect (nsh); |
@@ -208,11 +208,11 @@ run (void *cls, | |||
208 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 208 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
209 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 209 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
210 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 210 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
211 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 211 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
212 | GNUNET_free (hostkey_file); | 212 | GNUNET_free (hostkey_file); |
213 | GNUNET_assert (privkey != NULL); | 213 | GNUNET_assert (privkey != NULL); |
214 | /* get public key */ | 214 | /* get public key */ |
215 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 215 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
216 | 216 | ||
217 | /* create record */ | 217 | /* create record */ |
218 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); | 218 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); |
@@ -226,7 +226,7 @@ run (void *cls, | |||
226 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1); | 226 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1); |
227 | 227 | ||
228 | /* create random zone hash */ | 228 | /* create random zone hash */ |
229 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 229 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone); |
230 | 230 | ||
231 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_short_h2s (&s_zone)); | 231 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_short_h2s (&s_zone)); |
232 | nsh = GNUNET_NAMESTORE_connect (cfg); | 232 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_lookup.c b/src/namestore/test_namestore_api_lookup.c index 7d2f86e86..fdd229b23 100644 --- a/src/namestore/test_namestore_api_lookup.c +++ b/src/namestore/test_namestore_api_lookup.c | |||
@@ -43,11 +43,11 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
43 | 43 | ||
44 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 44 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
45 | 45 | ||
46 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 46 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
47 | 47 | ||
48 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 48 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
49 | 49 | ||
50 | static struct GNUNET_CRYPTO_RsaSignature *s_signature; | 50 | static struct GNUNET_CRYPTO_EccSignature *s_signature; |
51 | 51 | ||
52 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; | 52 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; |
53 | 53 | ||
@@ -70,7 +70,7 @@ cleanup () | |||
70 | } | 70 | } |
71 | if (NULL != privkey) | 71 | if (NULL != privkey) |
72 | { | 72 | { |
73 | GNUNET_CRYPTO_rsa_key_free (privkey); | 73 | GNUNET_CRYPTO_ecc_key_free (privkey); |
74 | privkey = NULL; | 74 | privkey = NULL; |
75 | } | 75 | } |
76 | GNUNET_SCHEDULER_shutdown (); | 76 | GNUNET_SCHEDULER_shutdown (); |
@@ -105,12 +105,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
105 | 105 | ||
106 | static void | 106 | static void |
107 | name_lookup_proc (void *cls, | 107 | name_lookup_proc (void *cls, |
108 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 108 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
109 | struct GNUNET_TIME_Absolute expire, | 109 | struct GNUNET_TIME_Absolute expire, |
110 | const char *n, | 110 | const char *n, |
111 | unsigned int rd_count, | 111 | unsigned int rd_count, |
112 | const struct GNUNET_NAMESTORE_RecordData *rd, | 112 | const struct GNUNET_NAMESTORE_RecordData *rd, |
113 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 113 | const struct GNUNET_CRYPTO_EccSignature *signature) |
114 | { | 114 | { |
115 | static int found = GNUNET_NO; | 115 | static int found = GNUNET_NO; |
116 | int c; | 116 | int c; |
@@ -119,13 +119,13 @@ name_lookup_proc (void *cls, | |||
119 | { | 119 | { |
120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking returned results\n"); | 120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking returned results\n"); |
121 | if (0 != memcmp (zone_key, &pubkey, | 121 | if (0 != memcmp (zone_key, &pubkey, |
122 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))) | 122 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded))) |
123 | { | 123 | { |
124 | GNUNET_break (0); | 124 | GNUNET_break (0); |
125 | } | 125 | } |
126 | GNUNET_assert (NULL != signature); | 126 | GNUNET_assert (NULL != signature); |
127 | if (0 != memcmp (signature, s_signature, | 127 | if (0 != memcmp (signature, s_signature, |
128 | sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 128 | sizeof (struct GNUNET_CRYPTO_EccSignature))) |
129 | { | 129 | { |
130 | GNUNET_break (0); | 130 | GNUNET_break (0); |
131 | } | 131 | } |
@@ -222,10 +222,10 @@ run (void *cls, | |||
222 | &endbadly, NULL); | 222 | &endbadly, NULL); |
223 | 223 | ||
224 | /* load privat key from file not included in zonekey dir */ | 224 | /* load privat key from file not included in zonekey dir */ |
225 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file("test_hostkey"); | 225 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file("test_hostkey"); |
226 | GNUNET_assert (NULL != privkey); | 226 | GNUNET_assert (NULL != privkey); |
227 | /* get public key */ | 227 | /* get public key */ |
228 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 228 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
229 | 229 | ||
230 | /* create record */ | 230 | /* create record */ |
231 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); | 231 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); |
@@ -243,7 +243,7 @@ run (void *cls, | |||
243 | 243 | ||
244 | /* create random zone hash */ | 244 | /* create random zone hash */ |
245 | GNUNET_CRYPTO_short_hash (&pubkey, | 245 | GNUNET_CRYPTO_short_hash (&pubkey, |
246 | sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 246 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), |
247 | &s_zone); | 247 | &s_zone); |
248 | nsh = GNUNET_NAMESTORE_connect (cfg); | 248 | nsh = GNUNET_NAMESTORE_connect (cfg); |
249 | GNUNET_break (NULL != nsh); | 249 | GNUNET_break (NULL != nsh); |
diff --git a/src/namestore/test_namestore_api_lookup_specific_type.c b/src/namestore/test_namestore_api_lookup_specific_type.c index 4d2aa1cfe..49988ed3f 100644 --- a/src/namestore/test_namestore_api_lookup_specific_type.c +++ b/src/namestore/test_namestore_api_lookup_specific_type.c | |||
@@ -48,11 +48,11 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
48 | 48 | ||
49 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 49 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
50 | 50 | ||
51 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 51 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
52 | 52 | ||
53 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 53 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
54 | 54 | ||
55 | static struct GNUNET_CRYPTO_RsaSignature *s_signature; | 55 | static struct GNUNET_CRYPTO_EccSignature *s_signature; |
56 | 56 | ||
57 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; | 57 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; |
58 | 58 | ||
@@ -76,7 +76,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
76 | GNUNET_NAMESTORE_disconnect (nsh); | 76 | GNUNET_NAMESTORE_disconnect (nsh); |
77 | nsh = NULL; | 77 | nsh = NULL; |
78 | if (privkey != NULL) | 78 | if (privkey != NULL) |
79 | GNUNET_CRYPTO_rsa_key_free (privkey); | 79 | GNUNET_CRYPTO_ecc_key_free (privkey); |
80 | privkey = NULL; | 80 | privkey = NULL; |
81 | GNUNET_free_non_null (s_name); | 81 | GNUNET_free_non_null (s_name); |
82 | res = 1; | 82 | res = 1; |
@@ -100,7 +100,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
100 | GNUNET_free (s_rd); | 100 | GNUNET_free (s_rd); |
101 | GNUNET_free_non_null (s_name); | 101 | GNUNET_free_non_null (s_name); |
102 | if (privkey != NULL) | 102 | if (privkey != NULL) |
103 | GNUNET_CRYPTO_rsa_key_free (privkey); | 103 | GNUNET_CRYPTO_ecc_key_free (privkey); |
104 | privkey = NULL; | 104 | privkey = NULL; |
105 | if (nsh != NULL) | 105 | if (nsh != NULL) |
106 | GNUNET_NAMESTORE_disconnect (nsh); | 106 | GNUNET_NAMESTORE_disconnect (nsh); |
@@ -110,18 +110,18 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
110 | 110 | ||
111 | static void | 111 | static void |
112 | name_lookup_existing_record_type (void *cls, | 112 | name_lookup_existing_record_type (void *cls, |
113 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 113 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
114 | struct GNUNET_TIME_Absolute expire, | 114 | struct GNUNET_TIME_Absolute expire, |
115 | const char *n, | 115 | const char *n, |
116 | unsigned int rd_count, | 116 | unsigned int rd_count, |
117 | const struct GNUNET_NAMESTORE_RecordData *rd, | 117 | const struct GNUNET_NAMESTORE_RecordData *rd, |
118 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 118 | const struct GNUNET_CRYPTO_EccSignature *signature) |
119 | { | 119 | { |
120 | int failed = GNUNET_NO; | 120 | int failed = GNUNET_NO; |
121 | 121 | ||
122 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Namestore returned %u records\n", rd_count); | 122 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Namestore returned %u records\n", rd_count); |
123 | 123 | ||
124 | if ((NULL == n) || (0 != memcmp(zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))) | 124 | if ((NULL == n) || (0 != memcmp(zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded)))) |
125 | { | 125 | { |
126 | GNUNET_break(0); | 126 | GNUNET_break(0); |
127 | failed = GNUNET_YES; | 127 | failed = GNUNET_YES; |
@@ -156,12 +156,12 @@ name_lookup_existing_record_type (void *cls, | |||
156 | 156 | ||
157 | static void | 157 | static void |
158 | name_lookup_non_existing_record_type (void *cls, | 158 | name_lookup_non_existing_record_type (void *cls, |
159 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 159 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
160 | struct GNUNET_TIME_Absolute expire, | 160 | struct GNUNET_TIME_Absolute expire, |
161 | const char *n, | 161 | const char *n, |
162 | unsigned int rd_count, | 162 | unsigned int rd_count, |
163 | const struct GNUNET_NAMESTORE_RecordData *rd, | 163 | const struct GNUNET_NAMESTORE_RecordData *rd, |
164 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 164 | const struct GNUNET_CRYPTO_EccSignature *signature) |
165 | { | 165 | { |
166 | int failed = GNUNET_NO; | 166 | int failed = GNUNET_NO; |
167 | /* We expect zone key != NULL, name != NULL, rd_count 0, rd NULL, signature NULL */ | 167 | /* We expect zone key != NULL, name != NULL, rd_count 0, rd NULL, signature NULL */ |
@@ -280,11 +280,11 @@ run (void *cls, | |||
280 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 280 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
281 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 281 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
282 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 282 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
283 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 283 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
284 | GNUNET_free (hostkey_file); | 284 | GNUNET_free (hostkey_file); |
285 | GNUNET_assert (privkey != NULL); | 285 | GNUNET_assert (privkey != NULL); |
286 | /* get public key */ | 286 | /* get public key */ |
287 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 287 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
288 | 288 | ||
289 | /* create record */ | 289 | /* create record */ |
290 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); | 290 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); |
@@ -300,7 +300,7 @@ run (void *cls, | |||
300 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | 300 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); |
301 | 301 | ||
302 | /* create random zone hash */ | 302 | /* create random zone hash */ |
303 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 303 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone); |
304 | nsh = GNUNET_NAMESTORE_connect (cfg); | 304 | nsh = GNUNET_NAMESTORE_connect (cfg); |
305 | GNUNET_break (NULL != nsh); | 305 | GNUNET_break (NULL != nsh); |
306 | GNUNET_break (s_rd != NULL); | 306 | GNUNET_break (s_rd != NULL); |
diff --git a/src/namestore/test_namestore_api_put.c b/src/namestore/test_namestore_api_put.c index e4bc5e4bb..df5cb336e 100644 --- a/src/namestore/test_namestore_api_put.c +++ b/src/namestore/test_namestore_api_put.c | |||
@@ -42,9 +42,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
42 | 42 | ||
43 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 43 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
44 | 44 | ||
45 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 45 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
46 | 46 | ||
47 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 47 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
48 | 48 | ||
49 | static struct GNUNET_NAMESTORE_RecordData *s_rd; | 49 | static struct GNUNET_NAMESTORE_RecordData *s_rd; |
50 | 50 | ||
@@ -66,7 +66,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
66 | 66 | ||
67 | if (privkey != NULL) | 67 | if (privkey != NULL) |
68 | { | 68 | { |
69 | GNUNET_CRYPTO_rsa_key_free (privkey); | 69 | GNUNET_CRYPTO_ecc_key_free (privkey); |
70 | privkey = NULL; | 70 | privkey = NULL; |
71 | } | 71 | } |
72 | GNUNET_SCHEDULER_shutdown (); | 72 | GNUNET_SCHEDULER_shutdown (); |
@@ -85,7 +85,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
85 | 85 | ||
86 | if (privkey != NULL) | 86 | if (privkey != NULL) |
87 | { | 87 | { |
88 | GNUNET_CRYPTO_rsa_key_free (privkey); | 88 | GNUNET_CRYPTO_ecc_key_free (privkey); |
89 | privkey = NULL; | 89 | privkey = NULL; |
90 | } | 90 | } |
91 | if (nsh != NULL) | 91 | if (nsh != NULL) |
@@ -136,7 +136,7 @@ run (void *cls, | |||
136 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 136 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
137 | struct GNUNET_TESTING_Peer *peer) | 137 | struct GNUNET_TESTING_Peer *peer) |
138 | { | 138 | { |
139 | struct GNUNET_CRYPTO_RsaSignature *signature; | 139 | struct GNUNET_CRYPTO_EccSignature *signature; |
140 | char * s_name; | 140 | char * s_name; |
141 | int c; | 141 | int c; |
142 | char *hostkey_file; | 142 | char *hostkey_file; |
@@ -147,11 +147,11 @@ run (void *cls, | |||
147 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 147 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
148 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 148 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
149 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 149 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
150 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 150 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
151 | GNUNET_assert (privkey != NULL); | 151 | GNUNET_assert (privkey != NULL); |
152 | GNUNET_free (hostkey_file); | 152 | GNUNET_free (hostkey_file); |
153 | /* get public key */ | 153 | /* get public key */ |
154 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 154 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
155 | nsh = GNUNET_NAMESTORE_connect (cfg); | 155 | nsh = GNUNET_NAMESTORE_connect (cfg); |
156 | GNUNET_break (NULL != nsh); | 156 | GNUNET_break (NULL != nsh); |
157 | /* create record */ | 157 | /* create record */ |
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index 8583e69c9..265a93b81 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -49,11 +49,11 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
49 | 49 | ||
50 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 50 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
51 | 51 | ||
52 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 52 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
53 | 53 | ||
54 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 54 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
55 | 55 | ||
56 | static struct GNUNET_CRYPTO_RsaSignature *s_signature; | 56 | static struct GNUNET_CRYPTO_EccSignature *s_signature; |
57 | 57 | ||
58 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; | 58 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; |
59 | 59 | ||
@@ -77,7 +77,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
77 | GNUNET_NAMESTORE_disconnect (nsh); | 77 | GNUNET_NAMESTORE_disconnect (nsh); |
78 | nsh = NULL; | 78 | nsh = NULL; |
79 | if (privkey != NULL) | 79 | if (privkey != NULL) |
80 | GNUNET_CRYPTO_rsa_key_free (privkey); | 80 | GNUNET_CRYPTO_ecc_key_free (privkey); |
81 | privkey = NULL; | 81 | privkey = NULL; |
82 | GNUNET_free_non_null (s_name); | 82 | GNUNET_free_non_null (s_name); |
83 | res = 1; | 83 | res = 1; |
@@ -98,7 +98,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
98 | GNUNET_free_non_null((void *) s_rd[c].data); | 98 | GNUNET_free_non_null((void *) s_rd[c].data); |
99 | GNUNET_free (s_rd); | 99 | GNUNET_free (s_rd); |
100 | if (privkey != NULL) | 100 | if (privkey != NULL) |
101 | GNUNET_CRYPTO_rsa_key_free (privkey); | 101 | GNUNET_CRYPTO_ecc_key_free (privkey); |
102 | privkey = NULL; | 102 | privkey = NULL; |
103 | if (nsh != NULL) | 103 | if (nsh != NULL) |
104 | GNUNET_NAMESTORE_disconnect (nsh); | 104 | GNUNET_NAMESTORE_disconnect (nsh); |
@@ -109,12 +109,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
109 | 109 | ||
110 | static void | 110 | static void |
111 | name_lookup_proc (void *cls, | 111 | name_lookup_proc (void *cls, |
112 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 112 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
113 | struct GNUNET_TIME_Absolute expire, | 113 | struct GNUNET_TIME_Absolute expire, |
114 | const char *n, | 114 | const char *n, |
115 | unsigned int rd_count, | 115 | unsigned int rd_count, |
116 | const struct GNUNET_NAMESTORE_RecordData *rd, | 116 | const struct GNUNET_NAMESTORE_RecordData *rd, |
117 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 117 | const struct GNUNET_CRYPTO_EccSignature *signature) |
118 | { | 118 | { |
119 | static int found = GNUNET_NO; | 119 | static int found = GNUNET_NO; |
120 | int failed = GNUNET_NO; | 120 | int failed = GNUNET_NO; |
@@ -123,7 +123,7 @@ name_lookup_proc (void *cls, | |||
123 | if (n != NULL) | 123 | if (n != NULL) |
124 | { | 124 | { |
125 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Lookup for name `%s' returned %u records\n", n, rd_count); | 125 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Lookup for name `%s' returned %u records\n", n, rd_count); |
126 | if (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))) | 126 | if (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded))) |
127 | { | 127 | { |
128 | GNUNET_break (0); | 128 | GNUNET_break (0); |
129 | failed = GNUNET_YES; | 129 | failed = GNUNET_YES; |
@@ -254,11 +254,11 @@ run (void *cls, | |||
254 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 254 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
255 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 255 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
256 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 256 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
257 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 257 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
258 | GNUNET_free (hostkey_file); | 258 | GNUNET_free (hostkey_file); |
259 | GNUNET_assert (privkey != NULL); | 259 | GNUNET_assert (privkey != NULL); |
260 | /* get public key */ | 260 | /* get public key */ |
261 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 261 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
262 | 262 | ||
263 | /* create record */ | 263 | /* create record */ |
264 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); | 264 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); |
@@ -273,7 +273,7 @@ run (void *cls, | |||
273 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | 273 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); |
274 | 274 | ||
275 | /* create random zone hash */ | 275 | /* create random zone hash */ |
276 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 276 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone); |
277 | 277 | ||
278 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_short_h2s (&s_zone)); | 278 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_short_h2s (&s_zone)); |
279 | nsh = GNUNET_NAMESTORE_connect (cfg); | 279 | nsh = GNUNET_NAMESTORE_connect (cfg); |
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 973cf94e4..16586240a 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c | |||
@@ -49,11 +49,11 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
49 | 49 | ||
50 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 50 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
51 | 51 | ||
52 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 52 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
53 | 53 | ||
54 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 54 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
55 | 55 | ||
56 | static struct GNUNET_CRYPTO_RsaSignature *s_signature; | 56 | static struct GNUNET_CRYPTO_EccSignature *s_signature; |
57 | 57 | ||
58 | static struct GNUNET_HashCode s_zone; | 58 | static struct GNUNET_HashCode s_zone; |
59 | 59 | ||
@@ -77,7 +77,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
77 | GNUNET_NAMESTORE_disconnect (nsh); | 77 | GNUNET_NAMESTORE_disconnect (nsh); |
78 | nsh = NULL; | 78 | nsh = NULL; |
79 | if (privkey != NULL) | 79 | if (privkey != NULL) |
80 | GNUNET_CRYPTO_rsa_key_free (privkey); | 80 | GNUNET_CRYPTO_ecc_key_free (privkey); |
81 | privkey = NULL; | 81 | privkey = NULL; |
82 | GNUNET_free_non_null (s_name); | 82 | GNUNET_free_non_null (s_name); |
83 | res = 1; | 83 | res = 1; |
@@ -99,7 +99,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
99 | GNUNET_free (s_rd); | 99 | GNUNET_free (s_rd); |
100 | 100 | ||
101 | if (privkey != NULL) | 101 | if (privkey != NULL) |
102 | GNUNET_CRYPTO_rsa_key_free (privkey); | 102 | GNUNET_CRYPTO_ecc_key_free (privkey); |
103 | privkey = NULL; | 103 | privkey = NULL; |
104 | if (nsh != NULL) | 104 | if (nsh != NULL) |
105 | GNUNET_NAMESTORE_disconnect (nsh); | 105 | GNUNET_NAMESTORE_disconnect (nsh); |
@@ -190,11 +190,11 @@ run (void *cls, | |||
190 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 190 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
191 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 191 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
192 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 192 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
193 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 193 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
194 | GNUNET_free (hostkey_file); | 194 | GNUNET_free (hostkey_file); |
195 | GNUNET_assert (privkey != NULL); | 195 | GNUNET_assert (privkey != NULL); |
196 | /* get public key */ | 196 | /* get public key */ |
197 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 197 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
198 | 198 | ||
199 | /* create record */ | 199 | /* create record */ |
200 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); | 200 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); |
@@ -209,7 +209,7 @@ run (void *cls, | |||
209 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | 209 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); |
210 | 210 | ||
211 | /* create random zone hash */ | 211 | /* create random zone hash */ |
212 | GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 212 | GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone); |
213 | 213 | ||
214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_h2s_full(&s_zone)); | 214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_h2s_full(&s_zone)); |
215 | nsh = GNUNET_NAMESTORE_connect (cfg); | 215 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_sign_verify.c b/src/namestore/test_namestore_api_sign_verify.c index 10be25bb4..647cc59be 100644 --- a/src/namestore/test_namestore_api_sign_verify.c +++ b/src/namestore/test_namestore_api_sign_verify.c | |||
@@ -42,9 +42,9 @@ | |||
42 | #define TEST_REMOVE_RECORD_DATA 'b' | 42 | #define TEST_REMOVE_RECORD_DATA 'b' |
43 | 43 | ||
44 | 44 | ||
45 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 45 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
46 | 46 | ||
47 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 47 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
48 | 48 | ||
49 | static struct GNUNET_NAMESTORE_RecordData *s_rd; | 49 | static struct GNUNET_NAMESTORE_RecordData *s_rd; |
50 | 50 | ||
@@ -76,19 +76,19 @@ static void | |||
76 | run (void *cls, char *const *args, const char *cfgfile, | 76 | run (void *cls, char *const *args, const char *cfgfile, |
77 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 77 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
78 | { | 78 | { |
79 | struct GNUNET_CRYPTO_RsaSignature * signature; | 79 | struct GNUNET_CRYPTO_EccSignature * signature; |
80 | 80 | ||
81 | /* load privat key */ | 81 | /* load privat key */ |
82 | char *hostkey_file; | 82 | char *hostkey_file; |
83 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 83 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
84 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 84 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
85 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 85 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
86 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 86 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
87 | GNUNET_free (hostkey_file); | 87 | GNUNET_free (hostkey_file); |
88 | GNUNET_assert (privkey != NULL); | 88 | GNUNET_assert (privkey != NULL); |
89 | struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get(); | 89 | struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get(); |
90 | /* get public key */ | 90 | /* get public key */ |
91 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 91 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
92 | 92 | ||
93 | int res_c; | 93 | int res_c; |
94 | int res_w; | 94 | int res_w; |
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index e61fb67d4..48ac35f71 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c | |||
@@ -37,15 +37,15 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | |||
37 | 37 | ||
38 | static GNUNET_SCHEDULER_TaskIdentifier stopiteration_task; | 38 | static GNUNET_SCHEDULER_TaskIdentifier stopiteration_task; |
39 | 39 | ||
40 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 40 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 42 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
43 | 43 | ||
44 | static struct GNUNET_HashCode zone; | 44 | static struct GNUNET_HashCode zone; |
45 | 45 | ||
46 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey2; | 46 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey2; |
47 | 47 | ||
48 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey2; | 48 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey2; |
49 | 49 | ||
50 | static struct GNUNET_HashCode zone2; | 50 | static struct GNUNET_HashCode zone2; |
51 | 51 | ||
@@ -55,19 +55,19 @@ static int res; | |||
55 | 55 | ||
56 | static int returned_records; | 56 | static int returned_records; |
57 | 57 | ||
58 | static struct GNUNET_CRYPTO_RsaSignature *sig_1; | 58 | static struct GNUNET_CRYPTO_EccSignature *sig_1; |
59 | 59 | ||
60 | static char * s_name_1; | 60 | static char * s_name_1; |
61 | 61 | ||
62 | static struct GNUNET_NAMESTORE_RecordData *s_rd_1; | 62 | static struct GNUNET_NAMESTORE_RecordData *s_rd_1; |
63 | 63 | ||
64 | static struct GNUNET_CRYPTO_RsaSignature *sig_2; | 64 | static struct GNUNET_CRYPTO_EccSignature *sig_2; |
65 | 65 | ||
66 | static char * s_name_2; | 66 | static char * s_name_2; |
67 | 67 | ||
68 | static struct GNUNET_NAMESTORE_RecordData *s_rd_2; | 68 | static struct GNUNET_NAMESTORE_RecordData *s_rd_2; |
69 | 69 | ||
70 | static struct GNUNET_CRYPTO_RsaSignature *sig_3; | 70 | static struct GNUNET_CRYPTO_EccSignature *sig_3; |
71 | 71 | ||
72 | static char * s_name_3; | 72 | static char * s_name_3; |
73 | 73 | ||
@@ -117,11 +117,11 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
117 | } | 117 | } |
118 | 118 | ||
119 | if (privkey != NULL) | 119 | if (privkey != NULL) |
120 | GNUNET_CRYPTO_rsa_key_free (privkey); | 120 | GNUNET_CRYPTO_ecc_key_free (privkey); |
121 | privkey = NULL; | 121 | privkey = NULL; |
122 | 122 | ||
123 | if (privkey2 != NULL) | 123 | if (privkey2 != NULL) |
124 | GNUNET_CRYPTO_rsa_key_free (privkey2); | 124 | GNUNET_CRYPTO_ecc_key_free (privkey2); |
125 | privkey2 = NULL; | 125 | privkey2 = NULL; |
126 | res = 1; | 126 | res = 1; |
127 | } | 127 | } |
@@ -143,11 +143,11 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
143 | } | 143 | } |
144 | 144 | ||
145 | if (privkey != NULL) | 145 | if (privkey != NULL) |
146 | GNUNET_CRYPTO_rsa_key_free (privkey); | 146 | GNUNET_CRYPTO_ecc_key_free (privkey); |
147 | privkey = NULL; | 147 | privkey = NULL; |
148 | 148 | ||
149 | if (privkey2 != NULL) | 149 | if (privkey2 != NULL) |
150 | GNUNET_CRYPTO_rsa_key_free (privkey2); | 150 | GNUNET_CRYPTO_ecc_key_free (privkey2); |
151 | privkey2 = NULL; | 151 | privkey2 = NULL; |
152 | 152 | ||
153 | GNUNET_free (sig_1); | 153 | GNUNET_free (sig_1); |
@@ -179,12 +179,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
179 | 179 | ||
180 | static void | 180 | static void |
181 | zone_proc (void *cls, | 181 | zone_proc (void *cls, |
182 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 182 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
183 | struct GNUNET_TIME_Absolute expire, | 183 | struct GNUNET_TIME_Absolute expire, |
184 | const char *name, | 184 | const char *name, |
185 | unsigned int rd_count, | 185 | unsigned int rd_count, |
186 | const struct GNUNET_NAMESTORE_RecordData *rd, | 186 | const struct GNUNET_NAMESTORE_RecordData *rd, |
187 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 187 | const struct GNUNET_CRYPTO_EccSignature *signature) |
188 | { | 188 | { |
189 | int failed = GNUNET_NO; | 189 | int failed = GNUNET_NO; |
190 | if ((zone_key == NULL) && (name == NULL)) | 190 | if ((zone_key == NULL) && (name == NULL)) |
@@ -204,7 +204,7 @@ zone_proc (void *cls, | |||
204 | if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature (zone_key, expire, name, rd_count, rd, signature)) | 204 | if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature (zone_key, expire, name, rd_count, rd, signature)) |
205 | { | 205 | { |
206 | struct GNUNET_HashCode zone_key_hash; | 206 | struct GNUNET_HashCode zone_key_hash; |
207 | GNUNET_CRYPTO_hash (zone_key, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &zone_key_hash); | 207 | GNUNET_CRYPTO_hash (zone_key, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &zone_key_hash); |
208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Verifying signature for `%s' in zone `%s' with %u records and expiration %llu failed\n", name, GNUNET_h2s(&zone_key_hash), rd_count, expire.abs_value); | 208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Verifying signature for `%s' in zone `%s' with %u records and expiration %llu failed\n", name, GNUNET_h2s(&zone_key_hash), rd_count, expire.abs_value); |
209 | 209 | ||
210 | failed = GNUNET_YES; | 210 | failed = GNUNET_YES; |
@@ -227,7 +227,7 @@ zone_proc (void *cls, | |||
227 | failed = GNUNET_YES; | 227 | failed = GNUNET_YES; |
228 | GNUNET_break (0); | 228 | GNUNET_break (0); |
229 | } | 229 | } |
230 | if (0 != memcmp (signature, sig_1, sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 230 | if (0 != memcmp (signature, sig_1, sizeof (struct GNUNET_CRYPTO_EccSignature))) |
231 | { | 231 | { |
232 | failed = GNUNET_YES; | 232 | failed = GNUNET_YES; |
233 | GNUNET_break (0); | 233 | GNUNET_break (0); |
@@ -248,7 +248,7 @@ zone_proc (void *cls, | |||
248 | failed = GNUNET_YES; | 248 | failed = GNUNET_YES; |
249 | GNUNET_break (0); | 249 | GNUNET_break (0); |
250 | } | 250 | } |
251 | if (0 != memcmp (signature, sig_2, sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 251 | if (0 != memcmp (signature, sig_2, sizeof (struct GNUNET_CRYPTO_EccSignature))) |
252 | { | 252 | { |
253 | failed = GNUNET_YES; | 253 | failed = GNUNET_YES; |
254 | GNUNET_break (0); | 254 | GNUNET_break (0); |
@@ -275,7 +275,7 @@ zone_proc (void *cls, | |||
275 | GNUNET_break (0); | 275 | GNUNET_break (0); |
276 | } | 276 | } |
277 | 277 | ||
278 | if (0 != memcmp (signature, sig_3, sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 278 | if (0 != memcmp (signature, sig_3, sizeof (struct GNUNET_CRYPTO_EccSignature))) |
279 | { | 279 | { |
280 | failed = GNUNET_YES; | 280 | failed = GNUNET_YES; |
281 | GNUNET_break (0); | 281 | GNUNET_break (0); |
@@ -370,12 +370,12 @@ create_record (unsigned int count) | |||
370 | */ | 370 | */ |
371 | static void | 371 | static void |
372 | empty_zone_proc (void *cls, | 372 | empty_zone_proc (void *cls, |
373 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 373 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
374 | struct GNUNET_TIME_Absolute expire, | 374 | struct GNUNET_TIME_Absolute expire, |
375 | const char *name, | 375 | const char *name, |
376 | unsigned int rd_count, | 376 | unsigned int rd_count, |
377 | const struct GNUNET_NAMESTORE_RecordData *rd, | 377 | const struct GNUNET_NAMESTORE_RecordData *rd, |
378 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 378 | const struct GNUNET_CRYPTO_EccSignature *signature) |
379 | { | 379 | { |
380 | char *hostkey_file; | 380 | char *hostkey_file; |
381 | struct GNUNET_TIME_Absolute et; | 381 | struct GNUNET_TIME_Absolute et; |
@@ -387,21 +387,21 @@ empty_zone_proc (void *cls, | |||
387 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 387 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
388 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 388 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
389 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 389 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
390 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 390 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
391 | GNUNET_free (hostkey_file); | 391 | GNUNET_free (hostkey_file); |
392 | GNUNET_assert (privkey != NULL); | 392 | GNUNET_assert (privkey != NULL); |
393 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 393 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
394 | GNUNET_CRYPTO_hash(&pubkey, sizeof (pubkey), &zone); | 394 | GNUNET_CRYPTO_hash(&pubkey, sizeof (pubkey), &zone); |
395 | 395 | ||
396 | 396 | ||
397 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 397 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
398 | "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"); | 398 | "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"); |
399 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 399 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
400 | privkey2 = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 400 | privkey2 = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
401 | GNUNET_free (hostkey_file); | 401 | GNUNET_free (hostkey_file); |
402 | 402 | ||
403 | GNUNET_assert (privkey2 != NULL); | 403 | GNUNET_assert (privkey2 != NULL); |
404 | GNUNET_CRYPTO_rsa_key_get_public(privkey2, &pubkey2); | 404 | GNUNET_CRYPTO_ecc_key_get_public(privkey2, &pubkey2); |
405 | GNUNET_CRYPTO_hash(&pubkey2, sizeof (pubkey), &zone2); | 405 | GNUNET_CRYPTO_hash(&pubkey2, sizeof (pubkey), &zone2); |
406 | 406 | ||
407 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n"); | 407 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n"); |
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 7adf3fe2a..53457cdaa 100644 --- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c +++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c | |||
@@ -37,15 +37,15 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | |||
37 | 37 | ||
38 | static GNUNET_SCHEDULER_TaskIdentifier stopiteration_task; | 38 | static GNUNET_SCHEDULER_TaskIdentifier stopiteration_task; |
39 | 39 | ||
40 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 40 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 42 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_ShortHashCode zone; | 44 | static struct GNUNET_CRYPTO_ShortHashCode zone; |
45 | 45 | ||
46 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey2; | 46 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey2; |
47 | 47 | ||
48 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey2; | 48 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey2; |
49 | 49 | ||
50 | static struct GNUNET_CRYPTO_ShortHashCode zone2; | 50 | static struct GNUNET_CRYPTO_ShortHashCode zone2; |
51 | 51 | ||
@@ -55,19 +55,19 @@ static int res; | |||
55 | 55 | ||
56 | static int returned_records; | 56 | static int returned_records; |
57 | 57 | ||
58 | static struct GNUNET_CRYPTO_RsaSignature *sig_1; | 58 | static struct GNUNET_CRYPTO_EccSignature *sig_1; |
59 | 59 | ||
60 | static char * s_name_1; | 60 | static char * s_name_1; |
61 | 61 | ||
62 | static struct GNUNET_NAMESTORE_RecordData *s_rd_1; | 62 | static struct GNUNET_NAMESTORE_RecordData *s_rd_1; |
63 | 63 | ||
64 | static struct GNUNET_CRYPTO_RsaSignature *sig_2; | 64 | static struct GNUNET_CRYPTO_EccSignature *sig_2; |
65 | 65 | ||
66 | static char * s_name_2; | 66 | static char * s_name_2; |
67 | 67 | ||
68 | static struct GNUNET_NAMESTORE_RecordData *s_rd_2; | 68 | static struct GNUNET_NAMESTORE_RecordData *s_rd_2; |
69 | 69 | ||
70 | static struct GNUNET_CRYPTO_RsaSignature *sig_3; | 70 | static struct GNUNET_CRYPTO_EccSignature *sig_3; |
71 | 71 | ||
72 | static char * s_name_3; | 72 | static char * s_name_3; |
73 | 73 | ||
@@ -115,11 +115,11 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
115 | } | 115 | } |
116 | 116 | ||
117 | if (privkey != NULL) | 117 | if (privkey != NULL) |
118 | GNUNET_CRYPTO_rsa_key_free (privkey); | 118 | GNUNET_CRYPTO_ecc_key_free (privkey); |
119 | privkey = NULL; | 119 | privkey = NULL; |
120 | 120 | ||
121 | if (privkey2 != NULL) | 121 | if (privkey2 != NULL) |
122 | GNUNET_CRYPTO_rsa_key_free (privkey2); | 122 | GNUNET_CRYPTO_ecc_key_free (privkey2); |
123 | privkey2 = NULL; | 123 | privkey2 = NULL; |
124 | res = 1; | 124 | res = 1; |
125 | } | 125 | } |
@@ -139,10 +139,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
139 | endbadly_task = GNUNET_SCHEDULER_NO_TASK; | 139 | endbadly_task = GNUNET_SCHEDULER_NO_TASK; |
140 | } | 140 | } |
141 | if (privkey != NULL) | 141 | if (privkey != NULL) |
142 | GNUNET_CRYPTO_rsa_key_free (privkey); | 142 | GNUNET_CRYPTO_ecc_key_free (privkey); |
143 | privkey = NULL; | 143 | privkey = NULL; |
144 | if (privkey2 != NULL) | 144 | if (privkey2 != NULL) |
145 | GNUNET_CRYPTO_rsa_key_free (privkey2); | 145 | GNUNET_CRYPTO_ecc_key_free (privkey2); |
146 | privkey2 = NULL; | 146 | privkey2 = NULL; |
147 | 147 | ||
148 | GNUNET_free (sig_1); | 148 | GNUNET_free (sig_1); |
@@ -174,12 +174,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
174 | 174 | ||
175 | static void | 175 | static void |
176 | zone_proc (void *cls, | 176 | zone_proc (void *cls, |
177 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 177 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
178 | struct GNUNET_TIME_Absolute expire, | 178 | struct GNUNET_TIME_Absolute expire, |
179 | const char *name, | 179 | const char *name, |
180 | unsigned int rd_count, | 180 | unsigned int rd_count, |
181 | const struct GNUNET_NAMESTORE_RecordData *rd, | 181 | const struct GNUNET_NAMESTORE_RecordData *rd, |
182 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 182 | const struct GNUNET_CRYPTO_EccSignature *signature) |
183 | { | 183 | { |
184 | int failed = GNUNET_NO; | 184 | int failed = GNUNET_NO; |
185 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Callback for zone `%s'\n", GNUNET_short_h2s (&zone)); | 185 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Callback for zone `%s'\n", GNUNET_short_h2s (&zone)); |
@@ -212,7 +212,7 @@ zone_proc (void *cls, | |||
212 | failed = GNUNET_YES; | 212 | failed = GNUNET_YES; |
213 | GNUNET_break (0); | 213 | GNUNET_break (0); |
214 | } | 214 | } |
215 | if (0 != memcmp (signature, sig_1, sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 215 | if (0 != memcmp (signature, sig_1, sizeof (struct GNUNET_CRYPTO_EccSignature))) |
216 | { | 216 | { |
217 | failed = GNUNET_YES; | 217 | failed = GNUNET_YES; |
218 | GNUNET_break (0); | 218 | GNUNET_break (0); |
@@ -233,7 +233,7 @@ zone_proc (void *cls, | |||
233 | failed = GNUNET_YES; | 233 | failed = GNUNET_YES; |
234 | GNUNET_break (0); | 234 | GNUNET_break (0); |
235 | } | 235 | } |
236 | if (0 != memcmp (signature, sig_2, sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 236 | if (0 != memcmp (signature, sig_2, sizeof (struct GNUNET_CRYPTO_EccSignature))) |
237 | { | 237 | { |
238 | failed = GNUNET_YES; | 238 | failed = GNUNET_YES; |
239 | GNUNET_break (0); | 239 | GNUNET_break (0); |
@@ -334,19 +334,19 @@ run (void *cls, | |||
334 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 334 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
335 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 335 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
336 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 336 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
337 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 337 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
338 | GNUNET_free (hostkey_file); | 338 | GNUNET_free (hostkey_file); |
339 | GNUNET_assert (privkey != NULL); | 339 | GNUNET_assert (privkey != NULL); |
340 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 340 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
341 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (pubkey), &zone); | 341 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (pubkey), &zone); |
342 | 342 | ||
343 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 343 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
344 | "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"); | 344 | "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"); |
345 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 345 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
346 | privkey2 = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 346 | privkey2 = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
347 | GNUNET_free (hostkey_file); | 347 | GNUNET_free (hostkey_file); |
348 | GNUNET_assert (privkey2 != NULL); | 348 | GNUNET_assert (privkey2 != NULL); |
349 | GNUNET_CRYPTO_rsa_key_get_public(privkey2, &pubkey2); | 349 | GNUNET_CRYPTO_ecc_key_get_public(privkey2, &pubkey2); |
350 | GNUNET_CRYPTO_short_hash (&pubkey2, sizeof (pubkey), &zone2); | 350 | GNUNET_CRYPTO_short_hash (&pubkey2, sizeof (pubkey), &zone2); |
351 | nsh = GNUNET_NAMESTORE_connect (cfg); | 351 | nsh = GNUNET_NAMESTORE_connect (cfg); |
352 | GNUNET_break (NULL != nsh); | 352 | GNUNET_break (NULL != nsh); |
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c index dcb6f8c7d..666e09ee8 100644 --- a/src/namestore/test_namestore_api_zone_iteration_stop.c +++ b/src/namestore/test_namestore_api_zone_iteration_stop.c | |||
@@ -36,15 +36,15 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | |||
36 | 36 | ||
37 | static GNUNET_SCHEDULER_TaskIdentifier stopiteration_task; | 37 | static GNUNET_SCHEDULER_TaskIdentifier stopiteration_task; |
38 | 38 | ||
39 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 39 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
40 | 40 | ||
41 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 41 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
42 | 42 | ||
43 | static struct GNUNET_HashCode zone; | 43 | static struct GNUNET_HashCode zone; |
44 | 44 | ||
45 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey2; | 45 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey2; |
46 | 46 | ||
47 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey2; | 47 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey2; |
48 | 48 | ||
49 | static struct GNUNET_HashCode zone2; | 49 | static struct GNUNET_HashCode zone2; |
50 | 50 | ||
@@ -54,19 +54,19 @@ static int res; | |||
54 | 54 | ||
55 | static int returned_records; | 55 | static int returned_records; |
56 | 56 | ||
57 | static struct GNUNET_CRYPTO_RsaSignature *sig_1; | 57 | static struct GNUNET_CRYPTO_EccSignature *sig_1; |
58 | 58 | ||
59 | static char * s_name_1; | 59 | static char * s_name_1; |
60 | 60 | ||
61 | static struct GNUNET_NAMESTORE_RecordData *s_rd_1; | 61 | static struct GNUNET_NAMESTORE_RecordData *s_rd_1; |
62 | 62 | ||
63 | static struct GNUNET_CRYPTO_RsaSignature *sig_2; | 63 | static struct GNUNET_CRYPTO_EccSignature *sig_2; |
64 | 64 | ||
65 | static char * s_name_2; | 65 | static char * s_name_2; |
66 | 66 | ||
67 | static struct GNUNET_NAMESTORE_RecordData *s_rd_2; | 67 | static struct GNUNET_NAMESTORE_RecordData *s_rd_2; |
68 | 68 | ||
69 | static struct GNUNET_CRYPTO_RsaSignature *sig_3; | 69 | static struct GNUNET_CRYPTO_EccSignature *sig_3; |
70 | 70 | ||
71 | static char * s_name_3; | 71 | static char * s_name_3; |
72 | 72 | ||
@@ -112,11 +112,11 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
112 | GNUNET_free (s_rd_3); | 112 | GNUNET_free (s_rd_3); |
113 | } | 113 | } |
114 | if (privkey != NULL) | 114 | if (privkey != NULL) |
115 | GNUNET_CRYPTO_rsa_key_free (privkey); | 115 | GNUNET_CRYPTO_ecc_key_free (privkey); |
116 | privkey = NULL; | 116 | privkey = NULL; |
117 | 117 | ||
118 | if (privkey2 != NULL) | 118 | if (privkey2 != NULL) |
119 | GNUNET_CRYPTO_rsa_key_free (privkey2); | 119 | GNUNET_CRYPTO_ecc_key_free (privkey2); |
120 | privkey2 = NULL; | 120 | privkey2 = NULL; |
121 | res = 1; | 121 | res = 1; |
122 | } | 122 | } |
@@ -137,10 +137,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
137 | endbadly_task = GNUNET_SCHEDULER_NO_TASK; | 137 | endbadly_task = GNUNET_SCHEDULER_NO_TASK; |
138 | } | 138 | } |
139 | if (privkey != NULL) | 139 | if (privkey != NULL) |
140 | GNUNET_CRYPTO_rsa_key_free (privkey); | 140 | GNUNET_CRYPTO_ecc_key_free (privkey); |
141 | privkey = NULL; | 141 | privkey = NULL; |
142 | if (privkey2 != NULL) | 142 | if (privkey2 != NULL) |
143 | GNUNET_CRYPTO_rsa_key_free (privkey2); | 143 | GNUNET_CRYPTO_ecc_key_free (privkey2); |
144 | privkey2 = NULL; | 144 | privkey2 = NULL; |
145 | 145 | ||
146 | GNUNET_free (sig_1); | 146 | GNUNET_free (sig_1); |
@@ -177,12 +177,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
177 | 177 | ||
178 | static void | 178 | static void |
179 | zone_proc (void *cls, | 179 | zone_proc (void *cls, |
180 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 180 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
181 | struct GNUNET_TIME_Absolute expire, | 181 | struct GNUNET_TIME_Absolute expire, |
182 | const char *name, | 182 | const char *name, |
183 | unsigned int rd_count, | 183 | unsigned int rd_count, |
184 | const struct GNUNET_NAMESTORE_RecordData *rd, | 184 | const struct GNUNET_NAMESTORE_RecordData *rd, |
185 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 185 | const struct GNUNET_CRYPTO_EccSignature *signature) |
186 | { | 186 | { |
187 | int failed = GNUNET_NO; | 187 | int failed = GNUNET_NO; |
188 | 188 | ||
@@ -383,19 +383,19 @@ run (void *cls, | |||
383 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 383 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
384 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 384 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
385 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 385 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
386 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 386 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
387 | GNUNET_free (hostkey_file); | 387 | GNUNET_free (hostkey_file); |
388 | GNUNET_assert (privkey != NULL); | 388 | GNUNET_assert (privkey != NULL); |
389 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 389 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
390 | GNUNET_CRYPTO_hash(&pubkey, sizeof (pubkey), &zone); | 390 | GNUNET_CRYPTO_hash(&pubkey, sizeof (pubkey), &zone); |
391 | 391 | ||
392 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 392 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
393 | "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"); | 393 | "HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"); |
394 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 394 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
395 | privkey2 = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 395 | privkey2 = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
396 | GNUNET_free (hostkey_file); | 396 | GNUNET_free (hostkey_file); |
397 | GNUNET_assert (privkey2 != NULL); | 397 | GNUNET_assert (privkey2 != NULL); |
398 | GNUNET_CRYPTO_rsa_key_get_public(privkey2, &pubkey2); | 398 | GNUNET_CRYPTO_ecc_key_get_public(privkey2, &pubkey2); |
399 | GNUNET_CRYPTO_hash(&pubkey2, sizeof (pubkey), &zone2); | 399 | GNUNET_CRYPTO_hash(&pubkey2, sizeof (pubkey), &zone2); |
400 | 400 | ||
401 | nsh = GNUNET_NAMESTORE_connect (cfg); | 401 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c index 85620719d..2734ebae8 100644 --- a/src/namestore/test_namestore_api_zone_to_name.c +++ b/src/namestore/test_namestore_api_zone_to_name.c | |||
@@ -43,9 +43,9 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
43 | 43 | ||
44 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 44 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
45 | 45 | ||
46 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 46 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
47 | 47 | ||
48 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 48 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
49 | 49 | ||
50 | static struct GNUNET_TIME_Absolute expire; | 50 | static struct GNUNET_TIME_Absolute expire; |
51 | 51 | ||
@@ -55,7 +55,7 @@ static struct GNUNET_CRYPTO_ShortHashCode s_zone_value; | |||
55 | 55 | ||
56 | static char * s_name; | 56 | static char * s_name; |
57 | 57 | ||
58 | static struct GNUNET_CRYPTO_RsaSignature *s_signature; | 58 | static struct GNUNET_CRYPTO_EccSignature *s_signature; |
59 | 59 | ||
60 | static int res; | 60 | static int res; |
61 | 61 | ||
@@ -73,7 +73,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
73 | GNUNET_NAMESTORE_disconnect (nsh); | 73 | GNUNET_NAMESTORE_disconnect (nsh); |
74 | nsh = NULL; | 74 | nsh = NULL; |
75 | if (privkey != NULL) | 75 | if (privkey != NULL) |
76 | GNUNET_CRYPTO_rsa_key_free (privkey); | 76 | GNUNET_CRYPTO_ecc_key_free (privkey); |
77 | privkey = NULL; | 77 | privkey = NULL; |
78 | res = 1; | 78 | res = 1; |
79 | } | 79 | } |
@@ -88,7 +88,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
88 | endbadly_task = GNUNET_SCHEDULER_NO_TASK; | 88 | endbadly_task = GNUNET_SCHEDULER_NO_TASK; |
89 | } | 89 | } |
90 | if (privkey != NULL) | 90 | if (privkey != NULL) |
91 | GNUNET_CRYPTO_rsa_key_free (privkey); | 91 | GNUNET_CRYPTO_ecc_key_free (privkey); |
92 | privkey = NULL; | 92 | privkey = NULL; |
93 | if (nsh != NULL) | 93 | if (nsh != NULL) |
94 | GNUNET_NAMESTORE_disconnect (nsh); | 94 | GNUNET_NAMESTORE_disconnect (nsh); |
@@ -98,12 +98,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
98 | 98 | ||
99 | static void | 99 | static void |
100 | zone_to_name_proc (void *cls, | 100 | zone_to_name_proc (void *cls, |
101 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 101 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
102 | struct GNUNET_TIME_Absolute expire, | 102 | struct GNUNET_TIME_Absolute expire, |
103 | const char *n, | 103 | const char *n, |
104 | unsigned int rd_count, | 104 | unsigned int rd_count, |
105 | const struct GNUNET_NAMESTORE_RecordData *rd, | 105 | const struct GNUNET_NAMESTORE_RecordData *rd, |
106 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 106 | const struct GNUNET_CRYPTO_EccSignature *signature) |
107 | { | 107 | { |
108 | int fail = GNUNET_NO; | 108 | int fail = GNUNET_NO; |
109 | 109 | ||
@@ -125,7 +125,7 @@ zone_to_name_proc (void *cls, | |||
125 | fail = GNUNET_YES; | 125 | fail = GNUNET_YES; |
126 | GNUNET_break (0); | 126 | GNUNET_break (0); |
127 | } | 127 | } |
128 | if ((zone_key == NULL) || (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))) | 128 | if ((zone_key == NULL) || (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded)))) |
129 | { | 129 | { |
130 | fail = GNUNET_YES; | 130 | fail = GNUNET_YES; |
131 | GNUNET_break (0); | 131 | GNUNET_break (0); |
@@ -175,14 +175,14 @@ run (void *cls, | |||
175 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 175 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
176 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 176 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
177 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 177 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
178 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 178 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
179 | GNUNET_free (hostkey_file); | 179 | GNUNET_free (hostkey_file); |
180 | GNUNET_assert (privkey != NULL); | 180 | GNUNET_assert (privkey != NULL); |
181 | /* get public key */ | 181 | /* get public key */ |
182 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 182 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
183 | 183 | ||
184 | /* zone hash */ | 184 | /* zone hash */ |
185 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 185 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone); |
186 | GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value); | 186 | GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value); |
187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_short_h2s (&s_zone_value)); | 187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_short_h2s (&s_zone_value)); |
188 | 188 | ||
diff --git a/src/namestore/test_plugin_namestore.c b/src/namestore/test_plugin_namestore.c index ea0bc781c..b7d2341e4 100644 --- a/src/namestore/test_plugin_namestore.c +++ b/src/namestore/test_plugin_namestore.c | |||
@@ -95,19 +95,19 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
95 | */ | 95 | */ |
96 | static void | 96 | static void |
97 | test_record (void *cls, | 97 | test_record (void *cls, |
98 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 98 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
99 | struct GNUNET_TIME_Absolute expire, | 99 | struct GNUNET_TIME_Absolute expire, |
100 | const char *name, | 100 | const char *name, |
101 | unsigned int rd_count, | 101 | unsigned int rd_count, |
102 | const struct GNUNET_NAMESTORE_RecordData *rd, | 102 | const struct GNUNET_NAMESTORE_RecordData *rd, |
103 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 103 | const struct GNUNET_CRYPTO_EccSignature *signature) |
104 | { | 104 | { |
105 | int *idp = cls; | 105 | int *idp = cls; |
106 | int id = *idp; | 106 | int id = *idp; |
107 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded tzone_key; | 107 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded tzone_key; |
108 | char tname[64]; | 108 | char tname[64]; |
109 | unsigned int trd_count = 1 + (id % 1024); | 109 | unsigned int trd_count = 1 + (id % 1024); |
110 | struct GNUNET_CRYPTO_RsaSignature tsignature; | 110 | struct GNUNET_CRYPTO_EccSignature tsignature; |
111 | unsigned int i; | 111 | unsigned int i; |
112 | 112 | ||
113 | GNUNET_snprintf (tname, sizeof (tname), | 113 | GNUNET_snprintf (tname, sizeof (tname), |
@@ -122,8 +122,8 @@ test_record (void *cls, | |||
122 | memset (&tzone_key, (id % 241), sizeof (tzone_key)); | 122 | memset (&tzone_key, (id % 241), sizeof (tzone_key)); |
123 | memset (&tsignature, (id % 243), sizeof (tsignature)); | 123 | memset (&tsignature, (id % 243), sizeof (tsignature)); |
124 | GNUNET_assert (0 == strcmp (name, tname)); | 124 | GNUNET_assert (0 == strcmp (name, tname)); |
125 | GNUNET_assert (0 == memcmp (&tzone_key, zone_key, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))); | 125 | GNUNET_assert (0 == memcmp (&tzone_key, zone_key, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded))); |
126 | GNUNET_assert (0 == memcmp (&tsignature, signature, sizeof (struct GNUNET_CRYPTO_RsaSignature))); | 126 | GNUNET_assert (0 == memcmp (&tsignature, signature, sizeof (struct GNUNET_CRYPTO_EccSignature))); |
127 | } | 127 | } |
128 | 128 | ||
129 | 129 | ||
@@ -139,12 +139,12 @@ get_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) | |||
139 | static void | 139 | static void |
140 | put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) | 140 | put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) |
141 | { | 141 | { |
142 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded zone_key; | 142 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded zone_key; |
143 | struct GNUNET_TIME_Absolute expire; | 143 | struct GNUNET_TIME_Absolute expire; |
144 | char name[64]; | 144 | char name[64]; |
145 | unsigned int rd_count = 1 + (id % 1024); | 145 | unsigned int rd_count = 1 + (id % 1024); |
146 | struct GNUNET_NAMESTORE_RecordData rd[rd_count]; | 146 | struct GNUNET_NAMESTORE_RecordData rd[rd_count]; |
147 | struct GNUNET_CRYPTO_RsaSignature signature; | 147 | struct GNUNET_CRYPTO_EccSignature signature; |
148 | unsigned int i; | 148 | unsigned int i; |
149 | 149 | ||
150 | GNUNET_snprintf (name, sizeof (name), | 150 | GNUNET_snprintf (name, sizeof (name), |
@@ -175,7 +175,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
175 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 175 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
176 | { | 176 | { |
177 | struct GNUNET_NAMESTORE_PluginFunctions *nsp; | 177 | struct GNUNET_NAMESTORE_PluginFunctions *nsp; |
178 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded zone_key; | 178 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded zone_key; |
179 | struct GNUNET_CRYPTO_ShortHashCode zone; | 179 | struct GNUNET_CRYPTO_ShortHashCode zone; |
180 | 180 | ||
181 | ok = 0; | 181 | ok = 0; |
diff --git a/src/namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey b/src/namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey index eac1d1e2f..955042ba4 100644 --- a/src/namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey +++ b/src/namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey | |||
Binary files differ | |||
diff --git a/src/namestore/zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey b/src/namestore/zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey index 871fc90ed..8c8c5d54f 100644 --- a/src/namestore/zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey +++ b/src/namestore/zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey | |||
Binary files differ | |||
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c index d550e3511..7eed31ceb 100644 --- a/src/pt/test_gns_vpn.c +++ b/src/pt/test_gns_vpn.c | |||
@@ -363,7 +363,7 @@ run (void *cls, | |||
363 | enum MHD_FLAG flags; | 363 | enum MHD_FLAG flags; |
364 | struct GNUNET_PeerIdentity id; | 364 | struct GNUNET_PeerIdentity id; |
365 | struct GNUNET_CRYPTO_HashAsciiEncoded peername; | 365 | struct GNUNET_CRYPTO_HashAsciiEncoded peername; |
366 | struct GNUNET_CRYPTO_RsaPrivateKey *host_key; | 366 | struct GNUNET_CRYPTO_EccPrivateKey *host_key; |
367 | struct GNUNET_NAMESTORE_RecordData rd; | 367 | struct GNUNET_NAMESTORE_RecordData rd; |
368 | char *rd_string; | 368 | char *rd_string; |
369 | char *zone_keyfile; | 369 | char *zone_keyfile; |
@@ -392,7 +392,7 @@ run (void *cls, | |||
392 | return; | 392 | return; |
393 | } | 393 | } |
394 | 394 | ||
395 | host_key = GNUNET_CRYPTO_rsa_key_create_from_file (zone_keyfile); | 395 | host_key = GNUNET_CRYPTO_ecc_key_create_from_file (zone_keyfile); |
396 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; | 396 | rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; |
397 | GNUNET_asprintf (&rd_string, "6 %s %s", (char*)&peername, "www.gads."); | 397 | GNUNET_asprintf (&rd_string, "6 %s %s", (char*)&peername, "www.gads."); |
398 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_GNS_RECORD_VPN, | 398 | GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_string_to_value (GNUNET_GNS_RECORD_VPN, |
@@ -410,7 +410,7 @@ run (void *cls, | |||
410 | GNUNET_free ((void**)rd.data); | 410 | GNUNET_free ((void**)rd.data); |
411 | GNUNET_free (rd_string); | 411 | GNUNET_free (rd_string); |
412 | GNUNET_free (zone_keyfile); | 412 | GNUNET_free (zone_keyfile); |
413 | GNUNET_CRYPTO_rsa_key_free (host_key); | 413 | GNUNET_CRYPTO_ecc_key_free (host_key); |
414 | } | 414 | } |
415 | 415 | ||
416 | 416 | ||
@@ -561,7 +561,7 @@ main (int argc, char *const *argv) | |||
561 | GNUNET_free (bin_vpn); | 561 | GNUNET_free (bin_vpn); |
562 | GNUNET_free (bin_exit); | 562 | GNUNET_free (bin_exit); |
563 | GNUNET_free (bin_dns); | 563 | GNUNET_free (bin_dns); |
564 | GNUNET_CRYPTO_rsa_setup_hostkey ("test_gns_vpn.conf"); | 564 | GNUNET_CRYPTO_ecc_setup_hostkey ("test_gns_vpn.conf"); |
565 | 565 | ||
566 | dest_ip = "169.254.86.1"; | 566 | dest_ip = "169.254.86.1"; |
567 | dest_af = AF_INET; | 567 | dest_af = AF_INET; |
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c index c8c7317fc..3a675654d 100644 --- a/src/pt/test_gnunet_vpn.c +++ b/src/pt/test_gnunet_vpn.c | |||
@@ -426,7 +426,7 @@ main (int argc, char *const *argv) | |||
426 | 426 | ||
427 | GNUNET_free (vpn_binary); | 427 | GNUNET_free (vpn_binary); |
428 | GNUNET_free (exit_binary); | 428 | GNUNET_free (exit_binary); |
429 | GNUNET_CRYPTO_rsa_setup_hostkey ("test_gnunet_vpn.conf"); | 429 | GNUNET_CRYPTO_ecc_setup_hostkey ("test_gnunet_vpn.conf"); |
430 | bin = argv[0]; | 430 | bin = argv[0]; |
431 | if (NULL != strstr (bin, "lt-")) | 431 | if (NULL != strstr (bin, "lt-")) |
432 | bin = strstr (bin, "lt-") + 4; | 432 | bin = strstr (bin, "lt-") + 4; |