aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gns_pseu_shorten.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/test_gns_pseu_shorten.c')
-rw-r--r--src/gns/test_gns_pseu_shorten.c76
1 files changed, 38 insertions, 38 deletions
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
72static const struct GNUNET_CONFIGURATION_Handle *cfg; 72static const struct GNUNET_CONFIGURATION_Handle *cfg;
73 73
74static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; 74static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey;
75static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey; 75static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey;
76static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey; 76static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded our_pkey;
77static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded priv_pkey; 77static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded priv_pkey;
78static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded short_pkey; 78static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded short_pkey;
79static struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; 79static struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
80static struct GNUNET_CRYPTO_RsaPrivateKey *bob_key; 80static struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
81static struct GNUNET_CRYPTO_RsaPrivateKey *our_key; 81static struct GNUNET_CRYPTO_EccPrivateKey *our_key;
82static struct GNUNET_CRYPTO_RsaPrivateKey *priv_key; 82static struct GNUNET_CRYPTO_EccPrivateKey *priv_key;
83static struct GNUNET_CRYPTO_RsaPrivateKey *short_key; 83static struct GNUNET_CRYPTO_EccPrivateKey *short_key;
84static struct GNUNET_CRYPTO_ShortHashCode alice_hash; 84static struct GNUNET_CRYPTO_ShortHashCode alice_hash;
85static struct GNUNET_CRYPTO_ShortHashCode bob_hash; 85static struct GNUNET_CRYPTO_ShortHashCode bob_hash;
86static struct GNUNET_CRYPTO_ShortHashCode our_zone; 86static struct GNUNET_CRYPTO_ShortHashCode our_zone;
@@ -236,9 +236,9 @@ on_lookup_result(void *cls, uint32_t rd_count,
236static void 236static void
237commence_testing (void *cls, int success) 237commence_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);