/* zone update task */
GNUNET_SCHEDULER_TaskIdentifier zone_update_taskid = GNUNET_SCHEDULER_NO_TASK;
+/* automatic pkey import for name shortening */
+static int auto_import_pkey;
+
/**
* Task run during shutdown.
*
clh->unique_id = sh_msg->id;
clh->type = ntohl(sh_msg->type);
- gns_resolver_lookup_record(zone_hash, clh->type, name,
- zone_key,
- &send_lookup_response, clh);
+ if (GNUNET_YES == auto_import_pkey)
+ {
+ gns_resolver_lookup_record(zone_hash, clh->type, name,
+ zone_key,
+ &send_lookup_response, clh);
+ }
+ else
+ {
+ gns_resolver_lookup_record(zone_hash, clh->type, name,
+ NULL,
+ &send_lookup_response, clh);
+ }
}
GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Could not connect to DHT!\n");
}
- if (gns_resolver_init(namestore_handle, dht_handle) == GNUNET_SYSERR)
+ if (GNUNET_YES ==
+ GNUNET_CONFIGURATION_get_value_yesno (c, "gns",
+ "AUTO_IMPORT_PKEY"))
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_INFO,
+ "Automatic PKEY import is enabled.\n");
+ auto_import_pkey = GNUNET_YES;
+
+ }
+
+ if (gns_resolver_init(namestore_handle, dht_handle)
+ == GNUNET_SYSERR)
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
"Unable to initialize resolver!\n");
"Failed to enable the dns interceptor!\n");
}
}
-
+
//put_some_records(); //FIXME for testing
/**
* @param zone the authority
* @param the private key of our authority
*/
-static void process_discovered_authority(char* name, struct GNUNET_CRYPTO_ShortHashCode zone,
- struct GNUNET_CRYPTO_ShortHashCode our_zone,
- struct GNUNET_CRYPTO_RsaPrivateKey *key)
+static void process_discovered_authority(char* name,
+ struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode our_zone,
+ struct GNUNET_CRYPTO_RsaPrivateKey *key)
{
struct GetPseuAuthorityHandle *gph;
size_t namelen;
rh->authority_chain_tail,
auth);
- /** call process new authority */
+ /** try to import pkey if private key available */
if (rh->priv_key)
process_discovered_authority(name, auth->zone,
rh->authority_chain_tail->zone,
Boston, MA 02111-1307, USA.
*/
/**
- * @file gns/test_gns_twopeer.c
- * @brief base testcase for testing DHT service with
- * two running peers.
+ * @file gns/test_gns_dht_delegated_lookup.c
+ * @brief test for record lookup via DHT
*
- * This testcase starts peers using the GNUNET_TESTING_daemons_start
- * function call. On peer start, connects to the peers DHT service
- * by calling GNUNET_DHT_connected. Once notified about all peers
- * being started (by the peers_started_callback function), calls
- * GNUNET_TESTING_connect_topology, which connects the peers in a
- * "straight line" topology. On notification that all peers have
- * been properly connected, calls the do_get function which initiates
- * a GNUNET_DHT_get from the *second* peer. Once the GNUNET_DHT_get
- * function starts, runs the do_put function to insert data at the first peer.
- * If the GET is successful, schedules finish_testing
- * to stop the test and shut down peers. If GET is unsuccessful
- * after GET_TIMEOUT seconds, prints an error message and shuts down
- * the peers.
*/
#include "platform.h"
#include "gnunet_testing_lib.h"
UNIXPATH = /tmp/gnunet-service-gns.sock
HOME = $SERVICEHOME
CONFIG = $DEFAULTCONFIG
-
+AUTO_IMPORT_PKEY = YES
[nse]