*/
static unsigned long long rid = 0;
+
+/**
+ * Determine if this name is canonical.
+ * i.e.
+ * a.b.gnunet = not canonical
+ * a = canonical
+ *
+ * @param name the name to test
+ * @return 1 if canonical
+ */
+static int
+is_canonical(char* name)
+{
+ uint32_t len = strlen(name);
+ int i;
+
+ for (i=0; i<len; i++)
+ {
+ if (*(name+i) == '.')
+ return 0;
+ }
+ return 1;
+}
+
+
/**
* Namestore calls this function if we have record for this name.
* (or with rd_count=0 to indicate no matches)
auth);
/** try to import pkey if private key available */
- if (rh->priv_key)
+ if (rh->priv_key && is_canonical (rh->name))
process_discovered_authority(name, auth->zone,
rh->authority_chain_tail->zone,
rh->priv_key);
}
-/**
- * Determine if this name is canonical.
- * i.e.
- * a.b.gnunet = not canonical
- * a = canonical
- *
- * @param name the name to test
- * @return 1 if canonical
- */
-static int
-is_canonical(char* name)
-{
- uint32_t len = strlen(name);
- int i;
-
- for (i=0; i<len; i++)
- {
- if (*(name+i) == '.')
- return 0;
- }
- return 1;
-}
-
/**
* Move one level up in the domain hierarchy and return the
* passed top level domain.
/** try to import pkey if private key available
* TODO: Only import last one?
*/
- if (rh->priv_key && (name != NULL))
+ if (rh->priv_key && (name != NULL) && is_canonical (rh->name))
process_discovered_authority((char*)name, auth->zone,
rh->authority_chain_tail->zone,
rh->priv_key);
}
GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_TYPE_A,
+ GNUNET_NO,
&on_lookup_result, TEST_DOMAIN);
}
gh = GNUNET_GNS_connect(alice_cfg);
GNUNET_GNS_lookup(gh, TEST_DOMAIN, GNUNET_GNS_RECORD_TYPE_A,
+ GNUNET_NO,
&on_lookup_result, TEST_DOMAIN);
die_task =
GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, "from lookup");
MAX_DNS_NAME_LENGTH,
"www.doesnotexist-%d.bob.gnunet", i);
GNUNET_GNS_lookup(gns_handle, lookup_name, GNUNET_GNS_RECORD_TYPE_A,
+ GNUNET_NO,
&on_lookup_result_dummy, NULL);
}
GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_TYPE_A,
+ GNUNET_NO,
&on_lookup_result, TEST_DOMAIN);
}
GNUNET_GNS_lookup_zone (gns_handle, TEST_DOMAIN,
&our_zone, &our_zone,
GNUNET_GNS_RECORD_TYPE_A,
+ GNUNET_NO,
&on_lookup_result, TEST_DOMAIN);
}
}
GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_TYPE_A,
+ GNUNET_NO,
&on_lookup_result, TEST_DOMAIN);
}
}
GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_TYPE_A,
+ GNUNET_YES,
&on_lookup_result, TEST_DOMAIN);
}
}
GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_MX,
+ GNUNET_NO,
&on_lookup_result, TEST_DOMAIN);
}
strcpy(pos, GNUNET_GNS_TLD_ZKEY);
GNUNET_GNS_lookup(gns_handle, name, GNUNET_GNS_RECORD_TYPE_A,
+ GNUNET_NO,
&on_lookup_result, NULL);
}