static const struct GNUNET_CONFIGURATION_Handle *cfg;
-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 struct GNUNET_CRYPTO_EccPrivateKey *priv_key;
-static struct GNUNET_CRYPTO_EccPrivateKey *short_key;
+static struct GNUNET_CRYPTO_EcdsaPublicKey alice_pkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey bob_pkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey our_pkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey priv_pkey;
+static struct GNUNET_CRYPTO_EcdsaPublicKey short_pkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *alice_key;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *bob_key;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *our_key;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey *short_key;
static struct GNUNET_CRYPTO_ShortHashCode alice_hash;
static struct GNUNET_CRYPTO_ShortHashCode bob_hash;
static struct GNUNET_CRYPTO_ShortHashCode our_zone;
static void
on_lookup_result (void *cls, uint32_t rd_count,
- const struct GNUNET_NAMESTORE_RecordData *rd)
+ const struct GNUNET_GNSRECORD_Data *rd)
{
struct in_addr a;
int i;
struct GNUNET_HashCode zone_hash_double;
uint32_t rd_payload_length;
char* nrb_data = NULL;
- struct GNUNET_CRYPTO_EccSignature *sig;
- struct GNUNET_NAMESTORE_RecordData rd;
+ struct GNUNET_CRYPTO_EcdsaSignature *sig;
+ struct GNUNET_GNSRECORD_Data rd;
- memset (&rd, 0, sizeof (struct GNUNET_NAMESTORE_RecordData));
+ memset (&rd, 0, sizeof (struct GNUNET_GNSRECORD_Data));
rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
rd.data_size = strlen(TEST_PSEU_ALICE)+1;
rd.data = TEST_PSEU_ALICE;
- rd.record_type = GNUNET_NAMESTORE_TYPE_PSEU;
+ rd.record_type = GNUNET_GNSRECORD_TYPE_PSEU;
rd.flags = 0;
sig = GNUNET_NAMESTORE_create_signature(alice_key,
1,
&rd,
sig));
- rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd);
+ rd_payload_length = GNUNET_GNSRECORD_records_get_size (1, &rd);
nrb = GNUNET_malloc(rd_payload_length + strlen(GNUNET_GNS_MASTERZONE_STR) + 1
+ sizeof(struct GNSNameRecordBlock));
nrb->signature = *sig;
nrb_data = (char*)&nrb[1];
nrb_data += strlen(GNUNET_GNS_MASTERZONE_STR) + 1;
- if (-1 == GNUNET_NAMESTORE_records_serialize (1,
+ if (-1 == GNUNET_GNSRECORD_records_serialize (1,
&rd,
rd_payload_length,
nrb_data))
}
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_EccPublicSignKey),
+ sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
&zone_hash);
GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
struct GNUNET_HashCode zone_hash_double;
uint32_t rd_payload_length;
char* nrb_data = NULL;
- struct GNUNET_CRYPTO_EccSignature *sig;
- struct GNUNET_NAMESTORE_RecordData rd;
+ struct GNUNET_CRYPTO_EcdsaSignature *sig;
+ struct GNUNET_GNSRECORD_Data rd;
char* ip = TEST_IP;
struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
rd.data_size = sizeof(struct in_addr);
rd.data = web;
rd.record_type = GNUNET_DNSPARSER_TYPE_A;
- rd.flags = GNUNET_NAMESTORE_RF_NONE;
+ rd.flags = GNUNET_GNSRECORD_RF_NONE;
sig = GNUNET_NAMESTORE_create_signature(alice_key,
GNUNET_TIME_UNIT_FOREVER_ABS,
1,
&rd,
sig));
- rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd);
+ rd_payload_length = GNUNET_GNSRECORD_records_get_size (1, &rd);
nrb = GNUNET_malloc(rd_payload_length + strlen(TEST_RECORD_NAME) + 1
+ sizeof(struct GNSNameRecordBlock));
nrb->signature = *sig;
nrb_data = (char*)&nrb[1];
nrb_data += strlen(TEST_RECORD_NAME) + 1;
- if (-1 == GNUNET_NAMESTORE_records_serialize (1,
+ if (-1 == GNUNET_GNSRECORD_records_serialize (1,
&rd,
rd_payload_length,
nrb_data))
}
GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash);
GNUNET_CRYPTO_short_hash(&alice_pkey,
- sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
+ sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
&zone_hash);
GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double);
GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
struct GNUNET_HashCode zone_hash_double;
uint32_t rd_payload_length;
char* nrb_data = NULL;
- struct GNUNET_CRYPTO_EccSignature *sig;
- struct GNUNET_NAMESTORE_RecordData rd;
+ struct GNUNET_CRYPTO_EcdsaSignature *sig;
+ struct GNUNET_GNSRECORD_Data 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_NONE;
+ rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
+ rd.flags = GNUNET_GNSRECORD_RF_NONE;
sig = GNUNET_NAMESTORE_create_signature (bob_key,
GNUNET_TIME_UNIT_FOREVER_ABS,
&rd,
1);
- rd_payload_length = GNUNET_NAMESTORE_records_get_size (1, &rd);
+ rd_payload_length = GNUNET_GNSRECORD_records_get_size (1, &rd);
nrb = GNUNET_malloc(rd_payload_length + strlen(TEST_AUTHORITY_ALICE) + 1
+ sizeof(struct GNSNameRecordBlock));
nrb->signature = *sig;
nrb_data = (char*)&nrb[1];
nrb_data += strlen(TEST_AUTHORITY_ALICE) + 1;
- if (-1 == GNUNET_NAMESTORE_records_serialize (1,
+ if (-1 == GNUNET_GNSRECORD_records_serialize (1,
&rd,
rd_payload_length,
nrb_data))
GNUNET_CRYPTO_short_hash (TEST_AUTHORITY_ALICE,
strlen (TEST_AUTHORITY_ALICE), &name_hash);
GNUNET_CRYPTO_short_hash (&bob_pkey,
- sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
+ sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
&zone_hash);
GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double);
GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
static void
fin_init_zone (void *cls, int32_t success, const char *emsg)
{
- struct GNUNET_NAMESTORE_RecordData rd;
+ struct GNUNET_GNSRECORD_Data rd;
rd.expiration_time = UINT64_MAX;
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &bob_hash;
- rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
- rd.flags = GNUNET_NAMESTORE_RF_NONE;
+ rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
+ rd.flags = GNUNET_GNSRECORD_RF_NONE;
GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
our_key,
cont_init_zone (void *cls, int32_t success, const char *emsg)
{
- struct GNUNET_NAMESTORE_RecordData rd;
+ struct GNUNET_GNSRECORD_Data rd;
rd.expiration_time = UINT64_MAX;
rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
rd.data = &short_zone;
- rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
- rd.flags = GNUNET_NAMESTORE_RF_NONE;
+ rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
+ rd.flags = GNUNET_GNSRECORD_RF_NONE;
GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
priv_key,
char *private_keyfile;
char *shorten_keyfile;
char *our_keyfile;
- struct GNUNET_NAMESTORE_RecordData rd;
+ struct GNUNET_GNSRECORD_Data rd;
cfg = ccfg;
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
GNUNET_free (private_keyfile);
return;
}
- our_key = GNUNET_CRYPTO_ecc_key_create_from_file (our_keyfile);
- priv_key = GNUNET_CRYPTO_ecc_key_create_from_file (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 ();
+ our_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (our_keyfile);
+ priv_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (private_keyfile);
+ short_key = GNUNET_CRYPTO_ecdsa_key_create_from_file (shorten_keyfile);
+ bob_key = GNUNET_CRYPTO_ecdsa_key_create ();
+ alice_key = GNUNET_CRYPTO_ecdsa_key_create ();
GNUNET_free (our_keyfile);
GNUNET_free (shorten_keyfile);
GNUNET_free (private_keyfile);
- 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_ecdsa_key_get_public (our_key, &our_pkey);
+ GNUNET_CRYPTO_ecdsa_key_get_public (priv_key, &priv_pkey);
+ GNUNET_CRYPTO_ecdsa_key_get_public (short_key, &short_pkey);
+ GNUNET_CRYPTO_ecdsa_key_get_public (bob_key, &bob_pkey);
+ GNUNET_CRYPTO_ecdsa_key_get_public (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);
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_NONE;
+ rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
+ rd.flags = GNUNET_GNSRECORD_RF_NONE;
GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
our_key,