key = lookup_private_key(&sh_msg->zone);
csh->zone_key = key;
}
- gns_resolver_shorten_name(zone, name, key,
+ gns_resolver_shorten_name(zone, zone, name, key,
&send_shorten_response, csh);
}
else
- gns_resolver_shorten_name(zone, name, NULL,
+ gns_resolver_shorten_name(zone, zone, name, NULL,
&send_shorten_response, csh);
}
strlen(name)-strlen(GNUNET_GNS_TLD));
/* Start delegation resolution in our namestore */
- gns_resolver_get_authority(zone_hash, name, &send_get_auth_response, cah);
+ gns_resolver_get_authority(zone_hash, zone_hash, name, &send_get_auth_response, cah);
}
clh->zone_key = key;
}
- gns_resolver_lookup_record(zone, clh->type, name,
+ gns_resolver_lookup_record(zone, zone, clh->type, name,
key,
default_lookup_timeout,
&send_lookup_response, clh);
}
else
{
- gns_resolver_lookup_record(zone, clh->type, name,
+ gns_resolver_lookup_record(zone, zone, clh->type, name,
NULL,
default_lookup_timeout,
&send_lookup_response, clh);
ilh->request_handle = request;
/* Start resolution in our zone */
- gns_resolver_lookup_record(our_zone, q->type, q->name,
+ gns_resolver_lookup_record(our_zone, our_zone, q->type, q->name,
our_key,
default_lookup_timeout,
&reply_to_dns, ilh);
rh->id, new_name, rlh->record_type);
gns_resolver_lookup_record(rh->authority,
+ rh->private_local_zone,
rlh->record_type,
new_name,
rh->priv_key,
rh->id, rh->name, rlh->record_type);
gns_resolver_lookup_record(rh->authority,
+ rh->private_local_zone,
rlh->record_type,
new_name,
rh->priv_key,
*/
if (rh->status & (RSL_RECORD_EXPIRED | !RSL_RECORD_EXISTS) &&
GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
- &local_zone) &&
+ &rh->private_local_zone) &&
(strcmp(rh->name, "+") == 0))
{
rh->proc = &handle_record_dht;
**/
if (((rh->status & RSL_RECORD_EXISTS) && (!(rh->status & RSL_RECORD_EXPIRED)))
|| !GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
- &local_zone))
+ &rh->private_local_zone))
{
if (is_canonical(rh->name))
{
* calls lookup result processor on result
*
* @param zone the root zone
+ * @param pzone the private local zone
* @param record_type the record type to look up
* @param name the name to look up
* @param key a private key for use with PSEU import (can be NULL)
*/
void
gns_resolver_lookup_record(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
uint32_t record_type,
const char* name,
struct GNUNET_CRYPTO_RsaPrivateKey *key,
rh->priv_key = key;
rh->timeout = timeout;
rh->get_handle = NULL;
+ rh->private_local_zone = pzone;
+
if (timeout.rel_value != GNUNET_TIME_UNIT_FOREVER_REL.rel_value)
{
/*
free_resolver_handle(rh);
}
else if (GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
- &local_zone) == 0)
+ &rh->private_local_zone) == 0)
{
/* our zone, just append .gnunet */
answer_len = strlen(rh->name) + strlen(GNUNET_GNS_TLD) + 2;
"PKEY resolved as far as possible in ns up to %s!\n", rh->name);
if (GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
- &local_zone) == 0)
+ &rh->private_local_zone) == 0)
{
/**
* This is our zone append .gnunet unless name is empty
* Shorten api from resolver
*
* @param zone the zone to use
+ * @param pzone the private local zone
* @param name the name to shorten
* @param key optional private key for background lookups and PSEU import
* @param proc the processor to call with result
*/
void
gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
const char* name,
struct GNUNET_CRYPTO_RsaPrivateKey *key,
ShortenResultProcessor proc,
rh->proc = &handle_delegation_ns_shorten;
rh->proc_cls = nsh;
rh->id = rid++;
+ rh->private_local_zone = pzone;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Checking for TLD...\n");
* in our namestore
*
* @param zone the root zone to look up for
+ * @param pzone the private local zone
* @param name the name to lookup up
* @param proc the processor to call when finished
* @param proc_cls the closure to pass to the processor
*/
void
gns_resolver_get_authority(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
const char* name,
GetAuthorityResultProcessor proc,
void* proc_cls)
rh = GNUNET_malloc(sizeof (struct ResolverHandle));
rh->authority = zone;
rh->id = rid++;
+ rh->private_local_zone = pzone;
if (strcmp(GNUNET_GNS_TLD, name) == 0)
{
/* status of the resolution result */
enum ResolutionStatus status;
+ /* The provate local zone of this request */
+ struct GNUNET_CRYPTO_ShortHashCode private_local_zone;
+
/**
* private key of an/our authoritative zone
* can be NULL but automatical PKEY import will not work
* calls RecordLookupProcessor on result or timeout
*
* @param zone the root zone
+ * @param pzone the private local zone
* @param record_type the record type to look up
* @param name the name to look up
* @param key optional private key for authority caching
*/
void
gns_resolver_lookup_record(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
uint32_t record_type,
const char* name,
struct GNUNET_CRYPTO_RsaPrivateKey *key,
* actually be canonical/short etc.
*
* @param zone the zone to perform the operation in
+ * @param pzone the private local zone
* @param name name to shorten
* @param key optional private key for background lookups and PSEU import
* @param proc the processor to call on shorten result
*/
void
gns_resolver_shorten_name(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
const char* name,
struct GNUNET_CRYPTO_RsaPrivateKey *key,
ShortenResultProcessor proc,
* in our namestore
*
* @param zone the root zone to look up for
+ * @param pzone the private local zone
* @param name the name to lookup up
* @param proc the processor to call when finished
* @param proc_cls the closure to pass to the processor
*/
void
gns_resolver_get_authority(struct GNUNET_CRYPTO_ShortHashCode zone,
+ struct GNUNET_CRYPTO_ShortHashCode pzone,
const char* name,
GetAuthorityResultProcessor proc,
void* proc_cls);