summaryrefslogtreecommitdiff
path: root/src/gns/gnunet-service-gns_resolver.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-11-05 20:52:02 +0000
committerChristian Grothoff <christian@grothoff.org>2013-11-05 20:52:02 +0000
commitf416ed5cff91ff66dadfb4797562ec5c5a0adc21 (patch)
treef2eec24ae277aba0163d4c01b464defaa4ba7d93 /src/gns/gnunet-service-gns_resolver.c
parentd6dc95fdf0a795338f6dacb0d8141e3970924dc9 (diff)
downloadgnunet-f416ed5cff91ff66dadfb4797562ec5c5a0adc21.tar.gz
gnunet-f416ed5cff91ff66dadfb4797562ec5c5a0adc21.zip
-fixing zkey resolution
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r--src/gns/gnunet-service-gns_resolver.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 6ff4857f6..c881b6b83 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -1999,9 +1999,7 @@ static void
1999start_resolver_lookup (struct GNS_ResolverHandle *rh) 1999start_resolver_lookup (struct GNS_ResolverHandle *rh)
2000{ 2000{
2001 struct AuthorityChain *ac; 2001 struct AuthorityChain *ac;
2002 char *x;
2003 char *y; 2002 char *y;
2004 char *pkey;
2005 2003
2006 if ( ( (GNUNET_YES == is_canonical (rh->name)) && 2004 if ( ( (GNUNET_YES == is_canonical (rh->name)) &&
2007 (0 != strcmp (GNUNET_GNS_TLD, rh->name)) ) || 2005 (0 != strcmp (GNUNET_GNS_TLD, rh->name)) ) ||
@@ -2038,26 +2036,19 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh)
2038 /* Name ends with ".zkey", try to replace authority zone with zkey 2036 /* Name ends with ".zkey", try to replace authority zone with zkey
2039 authority */ 2037 authority */
2040 GNUNET_free (resolver_lookup_get_next_label (rh)); /* will return "zkey" */ 2038 GNUNET_free (resolver_lookup_get_next_label (rh)); /* will return "zkey" */
2041 x = resolver_lookup_get_next_label (rh); /* will return 'x' coordinate */
2042 y = resolver_lookup_get_next_label (rh); /* will return 'y' coordinate */ 2039 y = resolver_lookup_get_next_label (rh); /* will return 'y' coordinate */
2043 GNUNET_asprintf (&pkey, 2040 if ( (NULL == y) ||
2044 "%s%s",
2045 x, y);
2046 if ( (NULL == x) ||
2047 (NULL == y) ||
2048 (GNUNET_OK != 2041 (GNUNET_OK !=
2049 GNUNET_CRYPTO_ecdsa_public_key_from_string (pkey, 2042 GNUNET_CRYPTO_ecdsa_public_key_from_string (y,
2050 strlen (pkey), 2043 strlen (y),
2051 &rh->authority_zone)) ) 2044 &rh->authority_zone)) )
2052 { 2045 {
2053 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 2046 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2054 _("Hostname `%s' is not well-formed, resolution fails\n"), 2047 _("Hostname `%s' is not well-formed, resolution fails\n"),
2055 rh->name); 2048 rh->name);
2056 rh->task_id = GNUNET_SCHEDULER_add_now (&fail_resolution, rh); 2049 rh->task_id = GNUNET_SCHEDULER_add_now (&fail_resolution, rh);
2057 } 2050 }
2058 GNUNET_free_non_null (x);
2059 GNUNET_free_non_null (y); 2051 GNUNET_free_non_null (y);
2060 GNUNET_free (pkey);
2061 } 2052 }
2062 else 2053 else
2063 { 2054 {