aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gns_dht_three_peers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/test_gns_dht_three_peers.c')
-rw-r--r--src/gns/test_gns_dht_three_peers.c34
1 files changed, 17 insertions, 17 deletions
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
308setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) 308setup_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
374setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) 374setup_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
429setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg) 429setup_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");