- minor changes
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 19 Mar 2012 19:10:10 +0000 (19:10 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 19 Mar 2012 19:10:10 +0000 (19:10 +0000)
src/namestore/gnunet-service-namestore.c
src/namestore/test_namestore_api_lookup.c
src/namestore/test_namestore_api_zone_to_name.c

index 012555539c7301b63abe8c7966b9ae58976462cf..519814e77f307b3e0d58983e9924cd1b60a52a9a 100644 (file)
@@ -1346,11 +1346,11 @@ static void handle_zone_to_name (void *cls,
   ztn_ctx.rid = rid;
   ztn_ctx.nc = nc;
 
-  char * z_tmp = strdup (GNUNET_short_h2s (&ztn_msg->zone));
+  struct GNUNET_CRYPTO_ShortHashAsciiEncoded z_tmp;
+  GNUNET_CRYPTO_short_hash_to_enc(&ztn_msg->zone, &z_tmp);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Looking up name for zone `%s' in zone `%s'\n",
-      z_tmp,
+      (char *) &z_tmp,
       GNUNET_short_h2s (&ztn_msg->value_zone));
-  GNUNET_free (z_tmp);
 
   GSN_database->zone_to_name (GSN_database->cls, &ztn_msg->zone, &ztn_msg->value_zone, &handle_zone_to_name_it, &ztn_ctx);
 
@@ -1633,7 +1633,6 @@ int zonekey_file_it (void *cls, const char *filename)
      GNUNET_CRYPTO_rsa_key_get_public(privkey, c->pubkey);
      GNUNET_CRYPTO_short_hash(c->pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &c->zone);
 
-     //GNUNET_CRYPTO_short_hash_to_enc (&name_hase, &name_enc);
      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found zonefile for zone `%s'\n", GNUNET_short_h2s (&c->zone));
      GNUNET_CRYPTO_short_hash_double (&c->zone, &long_hash);
      GNUNET_CONTAINER_multihashmap_put(zonekeys, &long_hash, c, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
index 5be939a89c780c78f50487878dd66d061ca0c0f1..b6b6815667701f33c70ea5bf53ed210fce501611 100644 (file)
@@ -255,7 +255,7 @@ run (void *cls, char *const *args, const char *cfgfile,
 
   size_t rd_ser_len;
 
-  /* load privat key */
+  /* load privat key from file not included in zonekey dir */
   privkey = GNUNET_CRYPTO_rsa_key_create_from_file("test_hostkey");
   GNUNET_assert (privkey != NULL);
   /* get public key */
@@ -274,7 +274,6 @@ run (void *cls, char *const *args, const char *cfgfile,
 
   /* create random zone hash */
   GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
-
   start_arm (cfgfile);
   GNUNET_assert (arm != NULL);
 
index 60168f82dfb65a53d6d6f9b80b875afea0c1a7f0..be90663f03e473ecbc4a93981dbd4a8039ccdb1e 100644 (file)
@@ -233,6 +233,7 @@ run (void *cls, char *const *args, const char *cfgfile,
   /* zone hash */
   GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone);
   GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_short_h2s (&s_zone_value));
 
   struct GNUNET_NAMESTORE_RecordData rd;
   rd.expiration = GNUNET_TIME_absolute_get();