make single label resolution work (for pkey at least
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Fri, 17 May 2019 17:18:41 +0000 (19:18 +0200)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Fri, 17 May 2019 17:18:41 +0000 (19:18 +0200)
po/POTFILES.in
src/gns/gns_tld_api.c
src/util/dnsparser.c

index fe69ea13e65d80a8639f3b7943254026273c9f5f..7b6741bf728e580caff679ff640b07e15002fd44 100644 (file)
@@ -4,6 +4,14 @@ src/arm/arm_monitor_api.c
 src/arm/gnunet-arm.c
 src/arm/gnunet-service-arm.c
 src/arm/mockup-service.c
+src/ats-tests/ats-testing-experiment.c
+src/ats-tests/ats-testing-log.c
+src/ats-tests/ats-testing-preferences.c
+src/ats-tests/ats-testing-traffic.c
+src/ats-tests/ats-testing.c
+src/ats-tests/gnunet-ats-sim.c
+src/ats-tests/gnunet-solver-eval.c
+src/ats-tool/gnunet-ats.c
 src/ats/ats_api2_application.c
 src/ats/ats_api2_transport.c
 src/ats/ats_api_connectivity.c
@@ -11,10 +19,10 @@ src/ats/ats_api_performance.c
 src/ats/ats_api_scanner.c
 src/ats/ats_api_scheduling.c
 src/ats/gnunet-ats-solver-eval.c
-src/ats/gnunet-service-ats_addresses.c
+src/ats/gnunet-service-ats-new.c
 src/ats/gnunet-service-ats.c
+src/ats/gnunet-service-ats_addresses.c
 src/ats/gnunet-service-ats_connectivity.c
-src/ats/gnunet-service-ats-new.c
 src/ats/gnunet-service-ats_normalization.c
 src/ats/gnunet-service-ats_performance.c
 src/ats/gnunet-service-ats_plugins.c
@@ -26,14 +34,6 @@ src/ats/plugin_ats2_simple.c
 src/ats/plugin_ats_mlp.c
 src/ats/plugin_ats_proportional.c
 src/ats/plugin_ats_ril.c
-src/ats-tests/ats-testing.c
-src/ats-tests/ats-testing-experiment.c
-src/ats-tests/ats-testing-log.c
-src/ats-tests/ats-testing-preferences.c
-src/ats-tests/ats-testing-traffic.c
-src/ats-tests/gnunet-ats-sim.c
-src/ats-tests/gnunet-solver-eval.c
-src/ats-tool/gnunet-ats.c
 src/auction/gnunet-auction-create.c
 src/auction/gnunet-auction-info.c
 src/auction/gnunet-auction-join.c
@@ -50,8 +50,8 @@ src/cadet/cadet_api_list_peers.c
 src/cadet/cadet_api_list_tunnels.c
 src/cadet/cadet_test_lib.c
 src/cadet/desirability_table.c
-src/cadet/gnunet-cadet.c
 src/cadet/gnunet-cadet-profiler.c
+src/cadet/gnunet-cadet.c
 src/cadet/gnunet-service-cadet.c
 src/cadet/gnunet-service-cadet_channel.c
 src/cadet/gnunet-service-cadet_connection.c
@@ -67,15 +67,15 @@ src/consensus/gnunet-service-consensus.c
 src/consensus/plugin_block_consensus.c
 src/conversation/conversation_api.c
 src/conversation/conversation_api_call.c
-src/conversation/gnunet-conversation.c
 src/conversation/gnunet-conversation-test.c
-src/conversation/gnunet_gst.c
-src/conversation/gnunet_gst_test.c
-src/conversation/gnunet-helper-audio-playback.c
+src/conversation/gnunet-conversation.c
 src/conversation/gnunet-helper-audio-playback-gst.c
-src/conversation/gnunet-helper-audio-record.c
+src/conversation/gnunet-helper-audio-playback.c
 src/conversation/gnunet-helper-audio-record-gst.c
+src/conversation/gnunet-helper-audio-record.c
 src/conversation/gnunet-service-conversation.c
+src/conversation/gnunet_gst.c
+src/conversation/gnunet_gst_test.c
 src/conversation/microphone.c
 src/conversation/plugin_gnsrecord_conversation.c
 src/conversation/speaker.c
@@ -112,7 +112,6 @@ src/dht/dht_api.c
 src/dht/dht_test_lib.c
 src/dht/gnunet-dht-get.c
 src/dht/gnunet-dht-monitor.c
-src/dht/gnunet_dht_profiler.c
 src/dht/gnunet-dht-put.c
 src/dht/gnunet-service-dht.c
 src/dht/gnunet-service-dht_clients.c
@@ -121,6 +120,7 @@ src/dht/gnunet-service-dht_hello.c
 src/dht/gnunet-service-dht_neighbours.c
 src/dht/gnunet-service-dht_nse.c
 src/dht/gnunet-service-dht_routing.c
+src/dht/gnunet_dht_profiler.c
 src/dht/plugin_block_dht.c
 src/dns/dns_api.c
 src/dns/gnunet-dns-monitor.c
@@ -130,8 +130,8 @@ src/dns/gnunet-service-dns.c
 src/dns/gnunet-zonewalk.c
 src/dns/plugin_block_dns.c
 src/exit/gnunet-daemon-exit.c
-src/exit/gnunet-helper-exit.c
 src/exit/gnunet-helper-exit-windows.c
+src/exit/gnunet-helper-exit.c
 src/fragmentation/defragmentation.c
 src/fragmentation/fragmentation.c
 src/fs/fs_api.c
@@ -156,8 +156,8 @@ src/fs/gnunet-auto-share.c
 src/fs/gnunet-daemon-fsprofiler.c
 src/fs/gnunet-directory.c
 src/fs/gnunet-download.c
-src/fs/gnunet-fs.c
 src/fs/gnunet-fs-profiler.c
+src/fs/gnunet-fs.c
 src/fs/gnunet-helper-fs-publish.c
 src/fs/gnunet-publish.c
 src/fs/gnunet-search.c
@@ -177,10 +177,10 @@ src/gns/gns_tld_api.c
 src/gns/gnunet-bcd.c
 src/gns/gnunet-dns2gns.c
 src/gns/gnunet-gns-benchmark.c
-src/gns/gnunet-gns.c
 src/gns/gnunet-gns-helper-service-w32.c
 src/gns/gnunet-gns-import.c
 src/gns/gnunet-gns-proxy.c
+src/gns/gnunet-gns.c
 src/gns/gnunet-service-gns.c
 src/gns/gnunet-service-gns_interceptor.c
 src/gns/gnunet-service-gns_resolver.c
@@ -189,19 +189,19 @@ src/gns/nss/nss_gns_query.c
 src/gns/plugin_block_gns.c
 src/gns/plugin_gnsrecord_gns.c
 src/gns/plugin_rest_gns.c
+src/gns/w32nsp-install.c
+src/gns/w32nsp-resolve.c
+src/gns/w32nsp-uninstall.c
+src/gns/w32nsp.c
 src/gnsrecord/gnsrecord.c
 src/gnsrecord/gnsrecord_crypto.c
 src/gnsrecord/gnsrecord_misc.c
 src/gnsrecord/gnsrecord_serialization.c
 src/gnsrecord/plugin_gnsrecord_dns.c
-src/gns/w32nsp.c
-src/gns/w32nsp-install.c
-src/gns/w32nsp-resolve.c
-src/gns/w32nsp-uninstall.c
 src/hello/address.c
 src/hello/gnunet-hello.c
-src/hello/hello.c
 src/hello/hello-ng.c
+src/hello/hello.c
 src/hostlist/gnunet-daemon-hostlist.c
 src/hostlist/gnunet-daemon-hostlist_client.c
 src/hostlist/gnunet-daemon-hostlist_server.c
@@ -225,8 +225,8 @@ src/namecache/namecache_api.c
 src/namecache/plugin_namecache_flat.c
 src/namecache/plugin_namecache_postgres.c
 src/namecache/plugin_namecache_sqlite.c
-src/namestore/gnunet-namestore.c
 src/namestore/gnunet-namestore-fcfsd.c
+src/namestore/gnunet-namestore.c
 src/namestore/gnunet-service-namestore.c
 src/namestore/gnunet-zoneimport.c
 src/namestore/namestore_api.c
@@ -242,10 +242,10 @@ src/nat-auto/gnunet-service-nat-auto.c
 src/nat-auto/gnunet-service-nat-auto_legacy.c
 src/nat-auto/nat_auto_api.c
 src/nat-auto/nat_auto_api_test.c
-src/nat/gnunet-helper-nat-client.c
 src/nat/gnunet-helper-nat-client-windows.c
-src/nat/gnunet-helper-nat-server.c
+src/nat/gnunet-helper-nat-client.c
 src/nat/gnunet-helper-nat-server-windows.c
+src/nat/gnunet-helper-nat-server.c
 src/nat/gnunet-nat.c
 src/nat/gnunet-service-nat.c
 src/nat/gnunet-service-nat_externalip.c
@@ -254,17 +254,17 @@ src/nat/gnunet-service-nat_mini.c
 src/nat/gnunet-service-nat_stun.c
 src/nat/nat_api.c
 src/nat/nat_api_stun.c
-src/nse/gnunet-nse.c
 src/nse/gnunet-nse-profiler.c
+src/nse/gnunet-nse.c
 src/nse/gnunet-service-nse.c
 src/nse/nse_api.c
 src/nt/nt.c
-src/peerinfo/gnunet-service-peerinfo.c
-src/peerinfo/peerinfo_api.c
-src/peerinfo/peerinfo_api_notify.c
 src/peerinfo-tool/gnunet-peerinfo.c
 src/peerinfo-tool/gnunet-peerinfo_plugins.c
 src/peerinfo-tool/plugin_rest_peerinfo.c
+src/peerinfo/gnunet-service-peerinfo.c
+src/peerinfo/peerinfo_api.c
+src/peerinfo/peerinfo_api_notify.c
 src/peerstore/gnunet-peerstore.c
 src/peerstore/gnunet-service-peerstore.c
 src/peerstore/peerstore_api.c
@@ -312,22 +312,22 @@ src/revocation/gnunet-revocation.c
 src/revocation/gnunet-service-revocation.c
 src/revocation/plugin_block_revocation.c
 src/revocation/revocation_api.c
-src/rps/gnunet-rps.c
 src/rps/gnunet-rps-profiler.c
+src/rps/gnunet-rps.c
 src/rps/gnunet-service-rps.c
 src/rps/gnunet-service-rps_custommap.c
 src/rps/gnunet-service-rps_sampler.c
 src/rps/gnunet-service-rps_sampler_elem.c
 src/rps/gnunet-service-rps_view.c
-src/rps/rps_api.c
 src/rps/rps-sampler_client.c
 src/rps/rps-sampler_common.c
 src/rps/rps-test_util.c
+src/rps/rps_api.c
 src/scalarproduct/gnunet-scalarproduct.c
-src/scalarproduct/gnunet-service-scalarproduct_alice.c
-src/scalarproduct/gnunet-service-scalarproduct_bob.c
 src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
 src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
+src/scalarproduct/gnunet-service-scalarproduct_alice.c
+src/scalarproduct/gnunet-service-scalarproduct_bob.c
 src/scalarproduct/scalarproduct_api.c
 src/secretsharing/gnunet-secretsharing-profiler.c
 src/secretsharing/gnunet-service-secretsharing.c
@@ -353,15 +353,16 @@ src/statistics/gnunet-statistics.c
 src/statistics/statistics_api.c
 src/template/gnunet-service-template.c
 src/template/gnunet-template.c
+src/testbed-logger/gnunet-service-testbed-logger.c
+src/testbed-logger/testbed_logger_api.c
 src/testbed/generate-underlay-topology.c
 src/testbed/gnunet-daemon-latency-logger.c
 src/testbed/gnunet-daemon-testbed-blacklist.c
 src/testbed/gnunet-daemon-testbed-underlay.c
 src/testbed/gnunet-helper-testbed.c
-src/testbed/gnunet_mpi_test.c
 src/testbed/gnunet-service-test-barriers.c
-src/testbed/gnunet-service-testbed_barriers.c
 src/testbed/gnunet-service-testbed.c
+src/testbed/gnunet-service-testbed_barriers.c
 src/testbed/gnunet-service-testbed_cache.c
 src/testbed/gnunet-service-testbed_connectionpool.c
 src/testbed/gnunet-service-testbed_cpustatus.c
@@ -369,20 +370,19 @@ src/testbed/gnunet-service-testbed_links.c
 src/testbed/gnunet-service-testbed_meminfo.c
 src/testbed/gnunet-service-testbed_oc.c
 src/testbed/gnunet-service-testbed_peers.c
-src/testbed/gnunet_testbed_mpi_spawn.c
 src/testbed/gnunet-testbed-profiler.c
-src/testbed-logger/gnunet-service-testbed-logger.c
-src/testbed-logger/testbed_logger_api.c
-src/testbed/testbed_api_barriers.c
+src/testbed/gnunet_mpi_test.c
+src/testbed/gnunet_testbed_mpi_spawn.c
 src/testbed/testbed_api.c
+src/testbed/testbed_api_barriers.c
 src/testbed/testbed_api_hosts.c
 src/testbed/testbed_api_operations.c
 src/testbed/testbed_api_peers.c
 src/testbed/testbed_api_sd.c
 src/testbed/testbed_api_services.c
 src/testbed/testbed_api_statistics.c
-src/testbed/testbed_api_testbed.c
 src/testbed/testbed_api_test.c
+src/testbed/testbed_api_testbed.c
 src/testbed/testbed_api_topology.c
 src/testbed/testbed_api_underlay.c
 src/testing/gnunet-testing.c
@@ -394,35 +394,41 @@ src/transport/gnunet-communicator-tcp.c
 src/transport/gnunet-communicator-udp.c
 src/transport/gnunet-communicator-unix.c
 src/transport/gnunet-helper-transport-bluetooth.c
-src/transport/gnunet-helper-transport-wlan.c
 src/transport/gnunet-helper-transport-wlan-dummy.c
+src/transport/gnunet-helper-transport-wlan.c
 src/transport/gnunet-service-tng.c
-src/transport/gnunet-service-transport_ats.c
 src/transport/gnunet-service-transport.c
+src/transport/gnunet-service-transport_ats.c
 src/transport/gnunet-service-transport_hello.c
 src/transport/gnunet-service-transport_manipulation.c
 src/transport/gnunet-service-transport_neighbours.c
 src/transport/gnunet-service-transport_plugins.c
 src/transport/gnunet-service-transport_validation.c
-src/transport/gnunet-transport.c
 src/transport/gnunet-transport-certificate-creation.c
 src/transport/gnunet-transport-profiler.c
 src/transport/gnunet-transport-wlan-receiver.c
 src/transport/gnunet-transport-wlan-sender.c
+src/transport/gnunet-transport.c
 src/transport/plugin_transport_http_client.c
 src/transport/plugin_transport_http_common.c
 src/transport/plugin_transport_http_server.c
 src/transport/plugin_transport_smtp.c
 src/transport/plugin_transport_tcp.c
 src/transport/plugin_transport_template.c
-src/transport/plugin_transport_udp_broadcasting.c
 src/transport/plugin_transport_udp.c
+src/transport/plugin_transport_udp_broadcasting.c
 src/transport/plugin_transport_unix.c
 src/transport/plugin_transport_wlan.c
 src/transport/tcp_connection_legacy.c
 src/transport/tcp_server_legacy.c
 src/transport/tcp_server_mst_legacy.c
 src/transport/tcp_service_legacy.c
+src/transport/transport-testing-filenames.c
+src/transport/transport-testing-loggers.c
+src/transport/transport-testing-main.c
+src/transport/transport-testing-send.c
+src/transport/transport-testing.c
+src/transport/transport-testing2.c
 src/transport/transport_api2_application.c
 src/transport/transport_api2_communication.c
 src/transport/transport_api2_core.c
@@ -435,12 +441,6 @@ src/transport/transport_api_manipulation.c
 src/transport/transport_api_monitor_peers.c
 src/transport/transport_api_monitor_plugins.c
 src/transport/transport_api_offer_hello.c
-src/transport/transport-testing2.c
-src/transport/transport-testing.c
-src/transport/transport-testing-filenames.c
-src/transport/transport-testing-loggers.c
-src/transport/transport-testing-main.c
-src/transport/transport-testing-send.c
 src/util/bandwidth.c
 src/util/benchmark.c
 src/util/bio.c
@@ -453,8 +453,8 @@ src/util/configuration_loader.c
 src/util/container_bloomfilter.c
 src/util/container_heap.c
 src/util/container_meta_data.c
-src/util/container_multihashmap32.c
 src/util/container_multihashmap.c
+src/util/container_multihashmap32.c
 src/util/container_multipeermap.c
 src/util/container_multishortmap.c
 src/util/crypto_abe.c
@@ -476,16 +476,16 @@ src/util/dnsparser.c
 src/util/dnsstub.c
 src/util/getopt.c
 src/util/getopt_helpers.c
-src/util/gnunet-config.c
 src/util/gnunet-config-diff.c
+src/util/gnunet-config.c
 src/util/gnunet-ecc.c
 src/util/gnunet-helper-w32-console.c
 src/util/gnunet-qr.c
 src/util/gnunet-resolver.c
 src/util/gnunet-scrypt.c
 src/util/gnunet-service-resolver.c
-src/util/gnunet-timeout.c
 src/util/gnunet-timeout-w32.c
+src/util/gnunet-timeout.c
 src/util/gnunet-uri.c
 src/util/helper.c
 src/util/load.c
@@ -514,13 +514,13 @@ src/util/tun.c
 src/util/w32cat.c
 src/util/win.c
 src/util/winproc.c
-src/vpn/gnunet-helper-vpn.c
 src/vpn/gnunet-helper-vpn-windows.c
+src/vpn/gnunet-helper-vpn.c
 src/vpn/gnunet-service-vpn.c
 src/vpn/gnunet-vpn.c
 src/vpn/vpn_api.c
-src/zonemaster/gnunet-service-zonemaster.c
 src/zonemaster/gnunet-service-zonemaster-monitor.c
+src/zonemaster/gnunet-service-zonemaster.c
 src/fs/fs_api.h
 src/include/compat.h
 src/include/gnunet_common.h
index 0dabac60ed458b1dde4d9faee79c14029ed91fa1..e62bc437d9da0a762538f129c3add5a17db779f8 100644 (file)
@@ -35,8 +35,7 @@
 #include "gns_api.h"
 
 
-#define LOG(kind,...) GNUNET_log_from (kind, "gns-tld-api",__VA_ARGS__)
-
+#define LOG(kind, ...) GNUNET_log_from (kind, "gns-tld-api", __VA_ARGS__)
 
 
 /**
@@ -110,8 +109,7 @@ get_tld (const char *name)
 {
   const char *tld;
 
-  tld = strrchr (name,
-                 (unsigned char) '.');
+  tld = strrchr (name, (unsigned char) '.');
   if (NULL == tld)
     tld = name;
   else
@@ -127,19 +125,18 @@ get_tld (const char *name)
  * @param tld what to eat (can be more than just the tld)
  */
 static void
-eat_tld (char *name,
-        const char *tld)
+eat_tld (char *name, const char *tld)
 {
   GNUNET_assert (0 < strlen (name));
-  if (NULL == tld)
+  if ((NULL == tld) ||
+      (strlen (name) == strlen (tld)))
   {
-    strcpy (name,
-            GNUNET_GNS_EMPTY_LABEL_AT);
+    strcpy (name, GNUNET_GNS_EMPTY_LABEL_AT);
   }
   else
   {
     GNUNET_assert (strlen (tld) < strlen (name));
-    name[strlen(name) - strlen(tld) - 1] = '\0';
+    name[strlen (name) - strlen (tld) - 1] = '\0';
   }
 }
 
@@ -154,15 +151,12 @@ eat_tld (char *name,
 static void
 process_lookup_result (void *cls,
                        uint32_t rd_count,
-                      const struct GNUNET_GNSRECORD_Data *rd)
+                       const struct GNUNET_GNSRECORD_Data *rd)
 {
   struct GNUNET_GNS_LookupWithTldRequest *ltr = cls;
 
   ltr->lr = NULL;
-  ltr->lookup_proc (ltr->lookup_proc_cls,
-                   GNUNET_YES,
-                   rd_count,
-                   rd);
+  ltr->lookup_proc (ltr->lookup_proc_cls, GNUNET_YES, rd_count, rd);
   GNUNET_GNS_lookup_with_tld_cancel (ltr);
 }
 
@@ -175,15 +169,15 @@ process_lookup_result (void *cls,
  */
 static void
 lookup_with_public_key (struct GNUNET_GNS_LookupWithTldRequest *ltr,
-                       const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
+                        const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
 {
   ltr->lr = GNUNET_GNS_lookup (ltr->gns_handle,
-                              ltr->name,
-                              pkey,
-                              ltr->type,
-                              ltr->options,
-                              &process_lookup_result,
-                              ltr);
+                               ltr->name,
+                               pkey,
+                               ltr->type,
+                               ltr->options,
+                               &process_lookup_result,
+                               ltr);
 }
 
 
@@ -211,57 +205,48 @@ identity_zone_cb (void *cls,
     {
       /* Final case: TLD matches one of our egos */
       // FIXME: eat all of the match (not just TLD!)
-      if (0 == strcmp (ltr->name,
-                       ltr->longest_match))
+      if (0 == strcmp (ltr->name, ltr->longest_match))
       {
         /* name matches ego name perfectly, only "@" remains */
-        strcpy (ltr->name,
-                GNUNET_GNS_EMPTY_LABEL_AT);
+        strcpy (ltr->name, GNUNET_GNS_EMPTY_LABEL_AT);
       }
       else
       {
         GNUNET_assert (strlen (ltr->longest_match) < strlen (ltr->name));
-        ltr->name[strlen(ltr->name) - strlen (ltr->longest_match) - 1] = '\0';
+        ltr->name[strlen (ltr->name) - strlen (ltr->longest_match) - 1] = '\0';
       }
 
       /* if the name is of the form 'label' (and not 'label.SUBDOMAIN'), never go to the DHT */
       GNUNET_free (ltr->longest_match);
       ltr->longest_match = NULL;
-      if (NULL == strchr (ltr->name,
-                          (unsigned char) '.'))
+      if (NULL == strchr (ltr->name, (unsigned char) '.'))
         ltr->options = GNUNET_GNS_LO_NO_DHT;
       else
         ltr->options = GNUNET_GNS_LO_LOCAL_MASTER;
 
-      GNUNET_IDENTITY_ego_get_public_key (ltr->longest_match_ego,
-                                          &pkey);
+      GNUNET_IDENTITY_ego_get_public_key (ltr->longest_match_ego, &pkey);
       GNUNET_IDENTITY_disconnect (ltr->id_co);
       ltr->id_co = NULL;
-      lookup_with_public_key (ltr,
-                              &pkey);
+      lookup_with_public_key (ltr, &pkey);
     }
     else
     {
       /* no matching ego found */
       GNUNET_IDENTITY_disconnect (ltr->id_co);
       ltr->id_co = NULL;
-      ltr->lookup_proc (ltr->lookup_proc_cls,
-                        GNUNET_NO,
-                        0,
-                        NULL);
+      ltr->lookup_proc (ltr->lookup_proc_cls, GNUNET_NO, 0, NULL);
       GNUNET_GNS_lookup_with_tld_cancel (ltr);
     }
     return;
   }
   else if (NULL != name)
   {
-    if ( (strlen (name) <= strlen (ltr->name)) &&
-         (0 == strcmp (name,
-                       &ltr->name[strlen(ltr->name) - strlen (name)])) &&
-         ( (strlen (name) == strlen (ltr->name)) ||
-           ('.' == ltr->name[strlen(ltr->name) - strlen (name) - 1]) ) &&
-         ( (NULL == ltr->longest_match) ||
-           (strlen (name) > strlen (ltr->longest_match)) ) )
+    if ((strlen (name) <= strlen (ltr->name)) &&
+        (0 == strcmp (name, &ltr->name[strlen (ltr->name) - strlen (name)])) &&
+        ((strlen (name) == strlen (ltr->name)) ||
+         ('.' == ltr->name[strlen (ltr->name) - strlen (name) - 1])) &&
+        ((NULL == ltr->longest_match) ||
+         (strlen (name) > strlen (ltr->longest_match))))
     {
       /* found better match, update! */
       GNUNET_free_non_null (ltr->longest_match);
@@ -287,11 +272,11 @@ identity_zone_cb (void *cls,
  */
 struct GNUNET_GNS_LookupWithTldRequest *
 GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
-                           const char *name,
-                           uint32_t type,
-                           enum GNUNET_GNS_LocalOptions options,
-                           GNUNET_GNS_LookupResultProcessor2 proc,
-                           void *proc_cls)
+                            const char *name,
+                            uint32_t type,
+                            enum GNUNET_GNS_LocalOptions options,
+                            GNUNET_GNS_LookupResultProcessor2 proc,
+                            void *proc_cls)
 {
   struct GNUNET_GNS_LookupWithTldRequest *ltr;
   const char *tld;
@@ -309,63 +294,52 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
   /* start with trivial case: TLD is zkey */
   tld = get_tld (ltr->name);
   if (GNUNET_OK ==
-      GNUNET_CRYPTO_ecdsa_public_key_from_string (tld,
-                                                  strlen (tld),
-                                                  &pkey))
+      GNUNET_CRYPTO_ecdsa_public_key_from_string (tld, strlen (tld), &pkey))
   {
-    eat_tld (ltr->name,
-            tld);
-    lookup_with_public_key (ltr,
-                           &pkey);
+    eat_tld (ltr->name, tld);
+    lookup_with_public_key (ltr, &pkey);
     return ltr;
   }
 
   /* second case: domain is mapped in our configuration file */
-  for (const char *domain = name;
-       NULL != domain;
-       domain = strchr (domain,
-                       (unsigned char) '.'))
+  for (const char *domain = name; NULL != domain;
+       domain = strchr (domain, (unsigned char) '.'))
   {
     if ('.' == domain[0])
       domain++;
-    GNUNET_asprintf (&dot_tld,
-                    ".%s",
-                    domain);
-    if (GNUNET_OK ==
-       GNUNET_CONFIGURATION_get_value_string (handle->cfg,
-                                              "gns",
-                                              dot_tld,
-                                              &zonestr))
+    GNUNET_asprintf (&dot_tld, ".%s", domain);
+    if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (handle->cfg,
+                                                            "gns",
+                                                            dot_tld,
+                                                            &zonestr))
     {
       if (GNUNET_OK !=
-         GNUNET_CRYPTO_ecdsa_public_key_from_string (zonestr,
-                                                     strlen (zonestr),
-                                                     &pkey))
+          GNUNET_CRYPTO_ecdsa_public_key_from_string (zonestr,
+                                                      strlen (zonestr),
+                                                      &pkey))
       {
-       GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-                                  "gns",
-                                  dot_tld,
-                                  _("Expected a base32-encoded public zone key\n"));
-       GNUNET_free (zonestr);
-       GNUNET_free (dot_tld);
-       GNUNET_free (ltr->name);
-       GNUNET_free (ltr);
-       return NULL;
+        GNUNET_log_config_invalid (
+          GNUNET_ERROR_TYPE_ERROR,
+          "gns",
+          dot_tld,
+          _ ("Expected a base32-encoded public zone key\n"));
+        GNUNET_free (zonestr);
+        GNUNET_free (dot_tld);
+        GNUNET_free (ltr->name);
+        GNUNET_free (ltr);
+        return NULL;
       }
-      eat_tld (ltr->name,
-              &dot_tld[1]);
+      eat_tld (ltr->name, &dot_tld[1]);
       GNUNET_free (zonestr);
       GNUNET_free (dot_tld);
-      lookup_with_public_key (ltr,
-                             &pkey);
+      lookup_with_public_key (ltr, &pkey);
       return ltr;
     }
     GNUNET_free (dot_tld);
   }
 
-  ltr->id_co = GNUNET_IDENTITY_connect (ltr->gns_handle->cfg,
-                                        &identity_zone_cb,
-                                        ltr);
+  ltr->id_co =
+    GNUNET_IDENTITY_connect (ltr->gns_handle->cfg, &identity_zone_cb, ltr);
   if (NULL == ltr->id_co)
   {
     GNUNET_free (ltr->name);
index 699f9d59292a52a1355a0021585d9cf9f396c6b8..ec10e3ec389714eaf664fc5eda32763a181eb28f 100644 (file)
@@ -60,6 +60,8 @@ GNUNET_DNSPARSER_check_label (const char *label)
 
   if (NULL != strchr (label, '.'))
     return GNUNET_SYSERR; /* not a label! Did you mean GNUNET_DNSPARSER_check_name? */
+  if (0 == strcmp (label, "@")) /* '@' is reserved for the empty label, see #GNUNET_GNS_EMPTY_LABEL_AT */
+    return GNUNET_SYSERR;
   if (IDNA_SUCCESS != idna_to_ascii_8z (label, &output, IDNA_ALLOW_UNASSIGNED))
     return GNUNET_SYSERR;
   slen = strlen (output);