#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 20)
/* test records to resolve */
-#define TEST_DOMAIN "www.alice.bob.gads"
+#define TEST_DOMAIN "www.alice.bob.gnu"
#define TEST_IP "127.0.0.1"
#define TEST_RECORD_NAME "www"
#define TEST_AUTHORITY_BOB "bob"
#define TEST_AUTHORITY_ALICE "alice"
#define TEST_ALICE_PSEU "carol"
-#define TEST_EXPECTED_RESULT "www.carol.gads"
+#define TEST_EXPECTED_RESULT "www.carol.gnu"
#define KEYFILE_BOB "../namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey"
#define KEYFILE_ALICE "../namestore/zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"
const struct GNUNET_CONFIGURATION_Handle *cfg;
-struct GNUNET_CRYPTO_EccPublicKey priv_pkey;
-struct GNUNET_CRYPTO_EccPublicKey short_pkey;
+struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey;
+struct GNUNET_CRYPTO_EccPublicSignKey short_pkey;
struct GNUNET_CRYPTO_EccPrivateKey *priv_key;
struct GNUNET_CRYPTO_EccPrivateKey *short_key;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shorten test succeeded!\n");
ok = 0;
}
-
+
GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
}
const struct GNUNET_CONFIGURATION_Handle *ccfg,
struct GNUNET_TESTING_Peer *peer)
{
- struct GNUNET_CRYPTO_EccPublicKey our_pkey;
- struct GNUNET_CRYPTO_EccPublicKey alice_pkey;
- struct GNUNET_CRYPTO_EccPublicKey bob_pkey;
+ struct GNUNET_CRYPTO_EccPublicSignKey our_pkey;
+ struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey;
+ struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey;
struct GNUNET_CRYPTO_EccPrivateKey *our_key;
struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
end_badly_now ();
return;
}
-
+
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
"SHORTEN_ZONEKEY",
&shorten_keyfile))
end_badly_now ();
return;
}
-
+
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
"PRIVATE_ZONEKEY",
&private_keyfile))
GNUNET_free(shorten_keyfile);
GNUNET_free(private_keyfile);
-
- GNUNET_CRYPTO_ecc_key_get_public (our_key, &our_pkey);
- GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey);
- GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey);
- GNUNET_CRYPTO_ecc_key_get_public (priv_key, &priv_pkey);
- GNUNET_CRYPTO_ecc_key_get_public (short_key, &short_pkey);
+
+ GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_pkey);
+ GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey);
+ GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey);
+ GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv_key, &priv_pkey);
+ GNUNET_CRYPTO_ecc_key_get_public_for_signature (short_key, &short_pkey);
GNUNET_CRYPTO_short_hash(&priv_pkey, sizeof(priv_pkey), &priv_zone);
GNUNET_CRYPTO_short_hash(&short_pkey, sizeof(short_pkey), &short_zone);
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
rd.expiration_time = UINT64_MAX;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
-
+
GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &bob_hash;
rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
- rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
-
+ rd.flags = GNUNET_NAMESTORE_RF_NONE;
+
/* put bob into our zone */
GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
our_key,
&rd,
NULL,
NULL);
-
+
/* put alice into bobs zone */
GNUNET_CRYPTO_short_hash(&alice_pkey, sizeof(alice_pkey), &alice_hash);
rd.data = &alice_hash;
sig,
NULL,
NULL);
-
+
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &alice_hash;
rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
NULL);
GNUNET_free(web);
- GNUNET_CRYPTO_ecc_key_free(our_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
- GNUNET_CRYPTO_ecc_key_free(priv_key);
- GNUNET_CRYPTO_ecc_key_free(short_key);
+ GNUNET_free(our_key);
+ GNUNET_free(bob_key);
+ GNUNET_free(alice_key);
+ GNUNET_free(priv_key);
+ GNUNET_free(short_key);
}
"WARNING",
NULL);
GNUNET_TESTING_peer_run ("test-gns-simple-shorten",
- "test_gns_simple_lookup.conf",
+ "test_gns_simple_lookup.conf",
&do_check, NULL);
return ok;
}