removing remenants of abstract unix domain socket handling, this finishes addressing...
[oweals/gnunet.git] / src / gns / gnunet-gns-helper-service-w32.c
index 97e94304f3b0ae49b64bfc7629220424854e8a53..26a3f688ab18dea75c3c7cb8ba415f51da89351e 100644 (file)
@@ -61,8 +61,8 @@ struct request
  */
 static struct GNUNET_GNS_Handle *gns;
 
-static struct GNUNET_CRYPTO_EccPublicKey *zone = NULL;
-static struct GNUNET_CRYPTO_ShortHashCode user_zone;
+static struct GNUNET_CRYPTO_EccPublicSignKey *zone = NULL;
+static struct GNUNET_HashCode user_zone;
 struct GNUNET_CRYPTO_EccPrivateKey *shorten_key = NULL;
 
 
@@ -172,7 +172,7 @@ transmit_callback (void *cls, size_t size, void *buf)
  * @param msg message to transmit, will be freed!
  */
 static void
-transmit (struct GNUNET_SERVER_Client *client, 
+transmit (struct GNUNET_SERVER_Client *client,
          struct GNUNET_MessageHeader *msg)
 {
   struct TransmitCallbackContext *tcc;
@@ -188,7 +188,7 @@ transmit (struct GNUNET_SERVER_Client *client,
   tcc->msg = msg;
   if (NULL ==
       (tcc->th =
-       GNUNET_SERVER_notify_transmit_ready (client, 
+       GNUNET_SERVER_notify_transmit_ready (client,
                                            ntohs (msg->size),
                                             GNUNET_TIME_UNIT_FOREVER_REL,
                                             &transmit_callback, tcc)))
@@ -242,7 +242,7 @@ MarshallWSAQUERYSETW (WSAQUERYSETW *qs, GUID *sc)
 
 
 static void
-process_ip_lookup_result (void* cls, 
+process_ip_lookup_result (void* cls,
                          uint32_t rd_count,
                          const struct GNUNET_NAMESTORE_RecordData *rd)
 {
@@ -547,7 +547,7 @@ get_ip_from_hostname (struct GNUNET_SERVER_Client *client,
     namelen = 0;
   if (namelen > 0)
     hostname = (char *) u16_to_u8 (name, namelen + 1, NULL, &strl);
-  
+
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "W32 DNS resolver asked to look up %s for `%s'.\n",
               af == AF_INET ? "IPv4" : af == AF_INET6 ? "IPv6" : "anything",
@@ -631,7 +631,7 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
       sc.Data1, sc.Data2, sc.Data3, data4);
   for (i = 0; i < 8; i++)
     sc.Data4[i] = 0xFF & (data4 >> ((7 - i) * 8));
-  
+
   hostname = (const wchar_t *) &msg[1];
   if (hostname[size - 1] != L'\0')
   {
@@ -663,8 +663,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
 
   char* keyfile;
   struct GNUNET_CRYPTO_EccPrivateKey *key = NULL;
-  struct GNUNET_CRYPTO_EccPublicKey pkey;
-  struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename;
+  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
+  struct GNUNET_CRYPTO_HashAsciiEncoded zonename;
 
   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
                                                            "ZONEKEY", &keyfile))
@@ -678,14 +678,13 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
     if (GNUNET_YES == GNUNET_DISK_file_test (keyfile))
     {
       key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
-      GNUNET_CRYPTO_ecc_key_get_public (key, &pkey);
-      GNUNET_CRYPTO_short_hash(&pkey,
-                         sizeof(struct GNUNET_CRYPTO_EccPublicKey),
-                         &user_zone);
-      GNUNET_CRYPTO_short_hash_to_enc (&user_zone, &zonename);
+      GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey);
+      GNUNET_CRYPTO_hash (&pkey, sizeof(struct GNUNET_CRYPTO_EccPublicSignKey),
+                          &user_zone);
+      GNUNET_CRYPTO_hash_to_enc (&user_zone, &zonename);
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Using zone: %s!\n", &zonename);
-      GNUNET_CRYPTO_ecc_key_free(key);
+      GNUNET_free(key);
     }
     GNUNET_free(keyfile);
   }