-typo
[oweals/gnunet.git] / src / gns / test_gns_dht_delegated_lookup.c
index 1eb77d821aabfff48c7792c60c28aa36e04b4f2e..104c6e01dea0ff586c73fdab78c35991e3d7afed 100644 (file)
@@ -65,10 +65,10 @@ static struct GNUNET_DHT_Handle *dht_handle;
 
 static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
-static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey;
-static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey;
-static struct GNUNET_CRYPTO_RsaPrivateKey *alice_key;
-static struct GNUNET_CRYPTO_RsaPrivateKey *bob_key;
+static struct GNUNET_CRYPTO_EccPublicKey alice_pkey;
+static struct GNUNET_CRYPTO_EccPublicKey bob_pkey;
+static struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
+static struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
 
 
 /**
@@ -156,7 +156,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_A)
+      if (rd[i].record_type == GNUNET_DNSPARSER_TYPE_A)
       {
         memcpy(&a, rd[i].data, sizeof(a));
         addr = inet_ntoa(a);
@@ -198,7 +198,7 @@ commence_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     return;
   }
 
-  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
+  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_DNSPARSER_TYPE_A,
                     GNUNET_NO,
                     NULL,
                     &on_lookup_result, TEST_DOMAIN);
@@ -216,7 +216,7 @@ put_dht(void *cls, int32_t success, const char *emsg)
   struct GNUNET_HashCode zone_hash_double;
   uint32_t rd_payload_length;
   char* nrb_data = NULL;
-  struct GNUNET_CRYPTO_RsaSignature *sig;
+  struct GNUNET_CRYPTO_EccSignature *sig;
   struct GNUNET_NAMESTORE_RecordData rd;
   char* ip = TEST_IP;
   struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
@@ -262,7 +262,7 @@ put_dht(void *cls, int32_t success, const char *emsg)
   }
   GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash);
   GNUNET_CRYPTO_short_hash(&bob_pkey,
-                     sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
+                     sizeof(struct GNUNET_CRYPTO_EccPublicKey),
                      &zone_hash);
   GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double);
   GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double);
@@ -330,28 +330,28 @@ do_check (void *cls,
     return;
   }
 
-  alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (alice_keyfile);
-  bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB);
+  alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile);
+  bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB);
   
   GNUNET_free(alice_keyfile);
 
-  GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey);
-  GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey);
+  GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey);
+  GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey);
   GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
 
   struct GNUNET_NAMESTORE_RecordData rd;
   rd.expiration_time = UINT64_MAX;
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
-  rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
-  GNUNET_NAMESTORE_record_create (namestore_handle,
-                                  alice_key,
-                                  TEST_AUTHORITY_NAME,
-                                  &rd,
-                                  &put_dht,
-                                  NULL);
+  GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
+                                           alice_key,
+                                           TEST_AUTHORITY_NAME,
+                                           1, &rd,
+                                           &put_dht,
+                                           NULL);
 }