gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r30228 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r30228 - gnunet/src/gns
Date: Wed, 16 Oct 2013 19:42:31 +0200

Author: grothoff
Date: 2013-10-16 19:42:31 +0200 (Wed, 16 Oct 2013)
New Revision: 30228

Modified:
   gnunet/src/gns/gnunet-service-gns_resolver.c
Log:
-correctly implement handling of '+' records

Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c        2013-10-16 17:29:27 UTC 
(rev 30227)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c        2013-10-16 17:42:31 UTC 
(rev 30228)
@@ -27,7 +27,7 @@
  * TODO:
  * - GNS: handle special SRV names --- no delegation, direct lookup;
  *        can likely be done in 'resolver_lookup_get_next_label'. (#3003)
- * - revocation checks (use CORE-level broadcasts!), (#3004)
+ * - revocation checks (use REVOCATION service!), (#3004)
  * - DNAME support (#3005)
  */
 #include "platform.h"
@@ -195,7 +195,7 @@
   struct GNUNET_VPN_RedirectionRequest *vpn_request;
 
   /**
-   * Number of records serialized in 'rd_data'.
+   * Number of records serialized in @e rd_data.
    */
   unsigned int rd_count;
 
@@ -205,7 +205,7 @@
   char *rd_data;
 
   /**
-   * Number of bytes in 'rd_data'.
+   * Number of bytes in @e rd_data.
    */
   size_t rd_data_size;
 };
@@ -483,7 +483,7 @@
 /* ************************** Resolution **************************** */
 
 /**
- * Exands a name ending in .+ with the zone of origin.
+ * Expands a name ending in .+ with the zone of origin.
  *
  * @param rh resolution context
  * @param name name to modify (to be free'd or returned)
@@ -664,7 +664,7 @@
  * We had to do a DNS lookup.  Convert the result (if any) and return
  * it.
  *
- * @param cls closure with the 'struct GNS_ResolverHandle'
+ * @param cls closure with the `struct GNS_ResolverHandle`
  * @param addr one of the addresses of the host, NULL for the last address
  * @param addrlen length of the address
  */
@@ -1419,9 +1419,7 @@
        }
        break;
       case GNUNET_GNSRECORD_TYPE_PKEY:
-       /* tigger shortening */
-       if (NULL != rh->shorten_key)
-       {
+        {
          struct GNUNET_CRYPTO_EcdsaPublicKey pub;
 
          if (rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey))
@@ -1430,11 +1428,33 @@
            break;
          }
          memcpy (&pub, rd[i].data, rd[i].data_size);
-         GNS_shorten_start (rh->ac_tail->label,
-                            &pub,
-                            rh->shorten_key);
-       }
-       rd_off++;
+
+          /* tigger shortening */
+          if (NULL != rh->shorten_key)
+          {
+            GNS_shorten_start (rh->ac_tail->label,
+                               &pub,
+                               rh->shorten_key);
+          }
+          rd_off++;
+          if (GNUNET_GNSRECORD_TYPE_PKEY != rh->record_type)
+          {
+            /* try to resolve "+" */
+            struct AuthorityChain *ac;
+
+            ac = GNUNET_new (struct AuthorityChain);
+            ac->rh = rh;
+            ac->gns_authority = GNUNET_YES;
+            ac->authority_info.gns_authority = pub;
+            ac->label = GNUNET_strdup (GNUNET_GNS_MASTERZONE_STR);
+            GNUNET_CONTAINER_DLL_insert_tail (rh->ac_head,
+                                              rh->ac_tail,
+                                              ac);
+            rh->task_id = GNUNET_SCHEDULER_add_now (&recursive_resolution,
+                                                    rh);
+            return;
+          }
+        }
        break;
       default:
        rd_off++;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]