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/gns/gnunet-gns.c | |
parent | b62eb443ee3af84f87030fad9fd11a948b1a2503 (diff) | |
download | gnunet-022002438e4047d235a688cfd9da7b63ab990103.tar.gz gnunet-022002438e4047d235a688cfd9da7b63ab990103.zip |
-switching GNS from RSA to ECC
Diffstat (limited to 'src/gns/gnunet-gns.c')
-rw-r--r-- | src/gns/gnunet-gns.c | 32 |
1 files changed, 16 insertions, 16 deletions
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) |