From 324d77d9a7f318705a862dbeb733d7a2af9e1cfd Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Mon, 19 Mar 2012 19:10:10 +0000 Subject: [PATCH] - minor changes --- src/namestore/gnunet-service-namestore.c | 7 +++---- src/namestore/test_namestore_api_lookup.c | 3 +-- src/namestore/test_namestore_api_zone_to_name.c | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 012555539..519814e77 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -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); diff --git a/src/namestore/test_namestore_api_lookup.c b/src/namestore/test_namestore_api_lookup.c index 5be939a89..b6b681566 100644 --- a/src/namestore/test_namestore_api_lookup.c +++ b/src/namestore/test_namestore_api_lookup.c @@ -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); diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c index 60168f82d..be90663f0 100644 --- a/src/namestore/test_namestore_api_zone_to_name.c +++ b/src/namestore/test_namestore_api_zone_to_name.c @@ -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(); -- 2.25.1