diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-05-29 08:18:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-05-29 08:18:55 +0000 |
commit | 022002438e4047d235a688cfd9da7b63ab990103 (patch) | |
tree | 8d0cb444a3ab376b5a8f614fb87bdeb31e7b3327 /src/namestore/test_namestore_api_zone_iteration_stop.c | |
parent | b62eb443ee3af84f87030fad9fd11a948b1a2503 (diff) | |
download | gnunet-022002438e4047d235a688cfd9da7b63ab990103.tar.gz gnunet-022002438e4047d235a688cfd9da7b63ab990103.zip |
-switching GNS from RSA to ECC
Diffstat (limited to 'src/namestore/test_namestore_api_zone_iteration_stop.c')
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration_stop.c | 34 |
1 files changed, 17 insertions, 17 deletions
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); |