static const struct GNUNET_CONFIGURATION_Handle *cfg;
-static struct GNUNET_CRYPTO_EccPublicKey alice_pkey;
-static struct GNUNET_CRYPTO_EccPublicKey bob_pkey;
-static struct GNUNET_CRYPTO_EccPublicKey our_pkey;
-static struct GNUNET_CRYPTO_EccPublicKey priv_pkey;
-static struct GNUNET_CRYPTO_EccPublicKey short_pkey;
+static struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey;
+static struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey;
+static struct GNUNET_CRYPTO_EccPublicSignKey our_pkey;
+static struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey;
+static struct GNUNET_CRYPTO_EccPublicSignKey short_pkey;
static struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
static struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
static struct GNUNET_CRYPTO_EccPrivateKey *our_key;
}
-static void
+static void
shutdown_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct in_addr a;
int i;
char* addr;
-
+
if (rd_count == 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
static void
commence_testing (void *cls, int success)
{
- GNUNET_CRYPTO_ecc_key_free(our_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
+ GNUNET_free(our_key);
+ GNUNET_free(bob_key);
+ GNUNET_free(alice_key);
GNUNET_NAMESTORE_disconnect (namestore_handle);
namestore_handle = NULL;
gns_handle = GNUNET_GNS_connect(cfg);
char* nrb_data = NULL;
struct GNUNET_CRYPTO_EccSignature *sig;
struct GNUNET_NAMESTORE_RecordData rd;
-
+
memset (&rd, 0, sizeof (struct GNUNET_NAMESTORE_RecordData));
rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
rd.data_size = strlen(TEST_PSEU_ALICE)+1;
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n");
ok = 3;
- GNUNET_CRYPTO_ecc_key_free(our_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
+ GNUNET_free(our_key);
+ GNUNET_free(bob_key);
+ GNUNET_free(alice_key);
GNUNET_free(sig);
GNUNET_free (nrb);
end_badly_now ();
}
GNUNET_CRYPTO_short_hash(GNUNET_GNS_MASTERZONE_STR, strlen(GNUNET_GNS_MASTERZONE_STR), &name_hash);
GNUNET_CRYPTO_short_hash(&alice_pkey,
- sizeof(struct GNUNET_CRYPTO_EccPublicKey),
+ sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
&zone_hash);
GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
DHT_OPERATION_TIMEOUT,
&commence_testing,
NULL);
-
+
GNUNET_free(sig);
GNUNET_free (nrb);
}
struct GNUNET_NAMESTORE_RecordData rd;
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
-
+
rd.expiration_time = UINT64_MAX;
GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
rd.data_size = sizeof(struct in_addr);
rd.data = web;
rd.record_type = GNUNET_DNSPARSER_TYPE_A;
- rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
-
+ rd.flags = GNUNET_NAMESTORE_RF_NONE;
+
sig = GNUNET_NAMESTORE_create_signature(alice_key,
GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_RECORD_NAME,
&rd, 1);
-
+
GNUNET_break (GNUNET_OK == GNUNET_NAMESTORE_verify_signature (&alice_pkey,
GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_RECORD_NAME,
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n");
ok = 3;
- GNUNET_CRYPTO_ecc_key_free(our_key);
- GNUNET_CRYPTO_ecc_key_free(bob_key);
- GNUNET_CRYPTO_ecc_key_free(alice_key);
+ GNUNET_free(our_key);
+ GNUNET_free(bob_key);
+ GNUNET_free(alice_key);
GNUNET_free (sig);
GNUNET_free(web);
GNUNET_free (nrb);
}
GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash);
GNUNET_CRYPTO_short_hash(&alice_pkey,
- sizeof(struct GNUNET_CRYPTO_EccPublicKey),
+ sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
&zone_hash);
GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double);
GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
char* nrb_data = NULL;
struct GNUNET_CRYPTO_EccSignature *sig;
struct GNUNET_NAMESTORE_RecordData rd;
-
+
rd.expiration_time = UINT64_MAX;
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &alice_hash;
rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
- rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
-
+ rd.flags = GNUNET_NAMESTORE_RF_NONE;
+
sig = GNUNET_NAMESTORE_create_signature (bob_key,
GNUNET_TIME_UNIT_FOREVER_ABS,
TEST_AUTHORITY_ALICE,
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n");
ok = 3;
-
- GNUNET_CRYPTO_ecc_key_free (our_key);
- GNUNET_CRYPTO_ecc_key_free (bob_key);
- GNUNET_CRYPTO_ecc_key_free (alice_key);
+
+ GNUNET_free (our_key);
+ GNUNET_free (bob_key);
+ GNUNET_free (alice_key);
GNUNET_free (sig);
GNUNET_free (nrb);
end_badly_now ();
GNUNET_CRYPTO_short_hash (TEST_AUTHORITY_ALICE,
strlen (TEST_AUTHORITY_ALICE), &name_hash);
GNUNET_CRYPTO_short_hash (&bob_pkey,
- sizeof(struct GNUNET_CRYPTO_EccPublicKey),
+ sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
&zone_hash);
GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double);
GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
- GNUNET_CRYPTO_hash_xor(&zone_hash_double, &name_hash_double, &xor_hash);
+ GNUNET_CRYPTO_hash_xor(&zone_hash_double, &name_hash_double, &xor_hash);
rd_payload_length += sizeof(struct GNSNameRecordBlock) +
strlen(TEST_AUTHORITY_ALICE) + 1;
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;
+
GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
our_key,
TEST_AUTHORITY_BOB,
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &short_zone;
rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
- rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
+ rd.flags = GNUNET_NAMESTORE_RF_NONE;
GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
priv_key,
char *shorten_keyfile;
char *our_keyfile;
struct GNUNET_NAMESTORE_RecordData rd;
-
+
cfg = ccfg;
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
end_badly_now();
return;
}
-
+
/* dht */
dht_handle = GNUNET_DHT_connect(cfg, 1);
if (NULL == dht_handle)
GNUNET_free (our_keyfile);
return;
}
-
+
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
"SHORTEN_ZONEKEY",
&shorten_keyfile))
GNUNET_free (shorten_keyfile);
return;
}
-
+
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
"PRIVATE_ZONEKEY",
&private_keyfile))
short_key = GNUNET_CRYPTO_ecc_key_create_from_file (shorten_keyfile);
bob_key = GNUNET_CRYPTO_ecc_key_create ();
alice_key = GNUNET_CRYPTO_ecc_key_create ();
-
+
GNUNET_free (our_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 (priv_key, &priv_pkey);
- GNUNET_CRYPTO_ecc_key_get_public (short_key, &short_pkey);
- GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey);
- GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey);
+ GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_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_ecc_key_get_public_for_signature (bob_key, &bob_pkey);
+ GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey);
GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash);
GNUNET_CRYPTO_short_hash (&alice_pkey, sizeof(alice_pkey), &alice_hash);
GNUNET_CRYPTO_short_hash (&our_pkey, sizeof(our_pkey), &our_zone);
GNUNET_CRYPTO_short_hash (&priv_pkey, sizeof(priv_pkey), &priv_zone);
GNUNET_CRYPTO_short_hash (&short_pkey, sizeof(short_pkey), &short_zone);
-
+
rd.expiration_time = UINT64_MAX;
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &priv_zone;
rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
- rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
+ rd.flags = GNUNET_NAMESTORE_RF_NONE;
GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
our_key,