esac
done
-# By default, we create three GNS zones:
+# By default, we create two GNS zones:
gnunet-identity -C master-zone $options
-gnunet-identity -C short-zone $options
gnunet-identity -C private-zone $options
# Additionally, we create the FS SKS zone
&my_zone,
GNUNET_GNSRECORD_TYPE_PHONE,
GNUNET_NO,
- NULL /* FIXME: add shortening support */,
&handle_gns_response, call);
GNUNET_assert (NULL != call->gns_lookup);
return call;
EXTRA_DIST = \
test_gns_defaults.conf \
test_gns_lookup.conf \
- test_gns_nick_shorten.conf \
test_gns_proxy.conf \
test_gns_simple_lookup.conf \
gns-helper-service-w32.conf \
gnunet_service_gns_SOURCES = \
gnunet-service-gns.c \
gnunet-service-gns_resolver.c gnunet-service-gns_resolver.h \
- gnunet-service-gns_reverser.c gnunet-service-gns_reverser.h \
- gnunet-service-gns_shorten.c gnunet-service-gns_shorten.h \
gnunet-service-gns_interceptor.c gnunet-service-gns_interceptor.h
gnunet_service_gns_LDADD = \
-lm \
test_gns_gns2dns_lookup.sh \
test_gns_dht_lookup.sh\
test_gns_delegated_lookup.sh \
- test_gns_nick_shorten.sh\
test_gns_plus_lookup.sh\
test_gns_zkey_lookup.sh\
test_gns_rel_expiration.sh\
test_gns_soa_lookup.sh\
test_gns_revocation.sh\
- test_gns_cname_lookup.sh \
- test_gns_reverse_lookup.sh
+ test_gns_cname_lookup.sh
if ENABLE_TEST_RUN
if HAVE_SQLITE
int16_t options GNUNET_PACKED;
/**
- * Is a shorten key attached?
+ * Always 0.
*/
- int16_t have_key GNUNET_PACKED;
+ int16_t reserved GNUNET_PACKED;
/**
* the type of record to look up
*/
int32_t type GNUNET_PACKED;
- /**
- * The key for shorten, if @e have_key is set
- */
- struct GNUNET_CRYPTO_EcdsaPrivateKey shorten_key;
-
/* Followed by the zero-terminated name to look up */
};
-/**
- * Message from client to GNS service to lookup records.
- */
-struct ReverseLookupMessage
-{
- /**
- * Header of type #GNUNET_MESSAGE_TYPE_GNS_REVERSE_LOOKUP
- */
- struct GNUNET_MessageHeader header;
-
- /**
- * Unique identifier for this request (for key collisions).
- */
- uint32_t id GNUNET_PACKED;
-
- /**
- * Zone that is target for reverse lookup
- */
- struct GNUNET_CRYPTO_EcdsaPublicKey zone_pkey;
-
- /**
- * Root zone
- */
- struct GNUNET_CRYPTO_EcdsaPublicKey root_pkey;
-};
-
/**
* Message from GNS service to client: new results.
*/
};
-/**
- * Message from GNS service to client: new results.
- */
-struct ReverseLookupResultMessage
-{
- /**
- * Header of type #GNUNET_MESSAGE_TYPE_GNS_REVERSE_LOOKUP_RESULT
- */
- struct GNUNET_MessageHeader header;
-
- /**
- * Unique identifier for this request (for key collisions).
- */
- uint32_t id GNUNET_PACKED;
-
- /* followed by the resulting name of the reverse lookup */
-};
-
GNUNET_NETWORK_STRUCT_END
};
-/**
- * Handle to a lookup request
- */
-struct GNUNET_GNS_ReverseLookupRequest
-{
-
- /**
- * DLL
- */
- struct GNUNET_GNS_ReverseLookupRequest *next;
-
- /**
- * DLL
- */
- struct GNUNET_GNS_ReverseLookupRequest *prev;
-
- /**
- * handle to gns
- */
- struct GNUNET_GNS_Handle *gns_handle;
-
- /**
- * processor to call on lookup result
- */
- GNUNET_GNS_ReverseLookupResultProcessor lookup_proc;
-
- /**
- * @e lookup_proc closure
- */
- void *proc_cls;
-
- /**
- * Envelope with the message for this queue entry.
- */
- struct GNUNET_MQ_Envelope *env;
-
- /**
- * request id
- */
- uint32_t r_id;
-
-};
-
/**
* Connection to the GNS service.
*/
struct GNUNET_GNS_LookupRequest *lookup_tail;
- /**
- * Head of linked list of active reverse lookup requests.
- */
- struct GNUNET_GNS_ReverseLookupRequest *rev_lookup_head;
-
- /**
- * Tail of linked list of active reverse lookup requests.
- */
- struct GNUNET_GNS_ReverseLookupRequest *rev_lookup_tail;
/**
* Reconnect task
*/
enum GNUNET_MQ_Error error)
{
struct GNUNET_GNS_Handle *handle = cls;
- LOG (GNUNET_ERROR_TYPE_WARNING, "Problem with message queue. error: %i\n",
+
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "Problem with message queue. error: %i\n",
error);
force_reconnect (handle);
}
-/**
- * Check validity of message received from the GNS service
- *
- * @param cls the `struct GNUNET_GNS_Handle *`
- * @param loookup_msg the incoming message
- */
-static int
-check_rev_result (void *cls,
- const struct ReverseLookupResultMessage *lookup_msg)
-{
- size_t mlen = ntohs (lookup_msg->header.size) - sizeof (*lookup_msg);
- char *name;
-
- name = (char*) &lookup_msg[1];
- if ('\0' != name[mlen-1])
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
- return GNUNET_OK;
-}
-
-
-/**
- * Handler for messages received from the GNS service
- *
- * @param cls the `struct GNUNET_GNS_Handle *`
- * @param loookup_msg the incoming message
- */
-static void
-handle_rev_result (void *cls,
- const struct ReverseLookupResultMessage *lookup_msg)
-{
- struct GNUNET_GNS_Handle *handle = cls;
- char *name;
- uint32_t r_id = ntohl (lookup_msg->id);
- struct GNUNET_GNS_ReverseLookupRequest *rlr;
- GNUNET_GNS_ReverseLookupResultProcessor proc;
- void *proc_cls;
-
- name = (char*)&lookup_msg[1];
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Received reverse lookup reply from GNS service (%s)\n",
- name);
- for (rlr = handle->rev_lookup_head; NULL != rlr; rlr = rlr->next)
- if (rlr->r_id == r_id)
- break;
- if (NULL == rlr)
- return;
- proc = rlr->lookup_proc;
- proc_cls = rlr->proc_cls;
- GNUNET_CONTAINER_DLL_remove (handle->rev_lookup_head,
- handle->rev_lookup_tail,
- rlr);
- GNUNET_free (rlr);
- proc (proc_cls,
- name);
-}
-
-
/**
* Check validity of message received from the GNS service
GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT,
struct LookupResultMessage,
handle),
- GNUNET_MQ_hd_var_size (rev_result,
- GNUNET_MESSAGE_TYPE_GNS_REVERSE_LOOKUP_RESULT,
- struct ReverseLookupResultMessage,
- handle),
GNUNET_MQ_handler_end ()
};
struct GNUNET_GNS_LookupRequest *lh;
- struct GNUNET_GNS_ReverseLookupRequest *rlh;
GNUNET_assert (NULL == handle->mq);
LOG (GNUNET_ERROR_TYPE_DEBUG,
for (lh = handle->lookup_head; NULL != lh; lh = lh->next)
GNUNET_MQ_send_copy (handle->mq,
lh->env);
- for (rlh = handle->rev_lookup_head; NULL != rlh; rlh = rlh->next)
- GNUNET_MQ_send_copy (handle->mq,
- rlh->env);
}
handle->reconnect_task = NULL;
}
GNUNET_assert (NULL == handle->lookup_head);
- GNUNET_assert (NULL == handle->rev_lookup_head);
GNUNET_free (handle);
}
GNUNET_free (lr);
}
-/**
- * Cancel pending reverse lookup request
- *
- * @param lr the lookup request to cancel
- */
-void
-GNUNET_GNS_reverse_lookup_cancel (struct GNUNET_GNS_ReverseLookupRequest *lr)
-{
- struct GNUNET_GNS_Handle *handle = lr->gns_handle;
-
- GNUNET_CONTAINER_DLL_remove (handle->rev_lookup_head,
- handle->rev_lookup_tail,
- lr);
- GNUNET_MQ_discard (lr->env);
- GNUNET_free (lr);
-}
/**
* Perform an asynchronous lookup operation on the GNS.
* @param zone the zone to start the resolution in
* @param type the record type to look up
* @param options local options for the lookup
- * @param shorten_zone_key the private key of the shorten zone (can be NULL)
* @param proc processor to call on result
* @param proc_cls closure for @a proc
* @return handle to the get request
const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
uint32_t type,
enum GNUNET_GNS_LocalOptions options,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone_key,
GNUNET_GNS_LookupResultProcessor proc,
void *proc_cls)
{
lookup_msg->options = htons ((uint16_t) options);
lookup_msg->zone = *zone;
lookup_msg->type = htonl (type);
- if (NULL != shorten_zone_key)
- {
- lookup_msg->have_key = htons (GNUNET_YES);
- lookup_msg->shorten_key = *shorten_zone_key;
- }
GNUNET_memcpy (&lookup_msg[1],
name,
nlen);
return lr;
}
-/**
- * Perform an asynchronous reverse lookup operation on the GNS.
- *
- * @param handle handle to the GNS service
- * @param zone_key zone to find a name for
- * @param root_key our zone
- * @param proc processor to call on result
- * @param proc_cls closure for @a proc
- * @return handle to the request
- */
-struct GNUNET_GNS_ReverseLookupRequest*
-GNUNET_GNS_reverse_lookup (struct GNUNET_GNS_Handle *handle,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *root_key,
- GNUNET_GNS_ReverseLookupResultProcessor proc,
- void *proc_cls)
-{
- /* IPC to shorten gns names, return shorten_handle */
- struct ReverseLookupMessage *rev_lookup_msg;
- struct GNUNET_GNS_ReverseLookupRequest *lr;
-
- if ((NULL == zone_key) || (NULL == root_key))
- {
- GNUNET_break (0);
- return NULL;
- }
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Trying to reverse lookup in GNS\n");
- lr = GNUNET_new (struct GNUNET_GNS_ReverseLookupRequest);
- lr->gns_handle = handle;
- lr->lookup_proc = proc;
- lr->proc_cls = proc_cls;
- lr->r_id = handle->r_id_gen++;
- lr->env = GNUNET_MQ_msg (rev_lookup_msg,
- GNUNET_MESSAGE_TYPE_GNS_REVERSE_LOOKUP);
- rev_lookup_msg->id = htonl (lr->r_id);
- rev_lookup_msg->zone_pkey = *zone_key;
- rev_lookup_msg->root_pkey = *root_key;
- GNUNET_CONTAINER_DLL_insert (handle->rev_lookup_head,
- handle->rev_lookup_tail,
- lr);
- if (NULL != handle->mq)
- GNUNET_MQ_send_copy (handle->mq,
- lr->env);
- return lr;
-}
/* end of gns_api.c */
&my_zone,
type,
GNUNET_NO,
- NULL /* no shorten */,
&result_processor,
request);
}
if (NULL != listen_socket4)
{
struct sockaddr_in v4;
-
+
memset (&v4, 0, sizeof (v4));
v4.sin_family = AF_INET;
#if HAVE_SOCKADDR_IN_SIN_LEN
if (NULL != listen_socket6)
{
struct sockaddr_in6 v6;
-
+
memset (&v6, 0, sizeof (v6));
v6.sin6_family = AF_INET6;
#if HAVE_SOCKADDR_IN_SIN_LEN
* Headers from response
*/
struct HttpResponseHeader *header_tail;
-
+
/**
* SSL Certificate status
*/
*/
static struct GNUNET_CRYPTO_EcdsaPublicKey local_gns_zone;
-/**
- * The users local shorten zone
- */
-static struct GNUNET_CRYPTO_EcdsaPrivateKey local_shorten_zone;
-
-/**
- * Is shortening enabled?
- */
-static int do_shorten;
-
/**
* The CA for SSL certificate generation
*/
gnutls_x509_crt_t x509_cert;
int rc;
const char *name;
-
+
s5r->ssl_checked = GNUNET_YES;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "XXXXXX\n");
if (CURLE_OK !=
size_t delta_cdomain;
int domain_matched;
char *tok;
-
+
/* first, check SSL certificate */
if ((GNUNET_YES != s5r->ssl_checked) &&
(HTTPS_PORT == s5r->port))
if (GNUNET_OK != check_ssl_certificate (s5r))
return 0;
}
-
+
ndup = GNUNET_strndup (buffer, bytes);
hdr_type = strtok (ndup, ":");
if (NULL == hdr_type)
struct Socks5Request *s5r = cls;
size_t len = size * nmemb;
size_t to_copy;
-
+
if ( (0 == s5r->io_len) &&
(SOCKS5_SOCKET_UPLOAD_DONE != s5r->state) )
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Processing %u bytes UPLOAD\n",
(unsigned int) *upload_data_size);
-
+
/* FIXME: This must be set or a header with Transfer-Encoding: chunked. Else
* upload callback is not called!
*/
&local_gns_zone,
GNUNET_DNSPARSER_TYPE_A,
GNUNET_NO /* only cached */,
- (GNUNET_YES == do_shorten) ? &local_shorten_zone : NULL,
&handle_gns_result,
s5r);
break;
}
-/**
- * Method called to inform about the egos of the shorten zone of this peer.
- *
- * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get,
- * this function is only called ONCE, and 'NULL' being passed in
- * @a ego does indicate an error (i.e. name is taken or no default
- * value is known). If @a ego is non-NULL and if '*ctx'
- * is set in those callbacks, the value WILL be passed to a subsequent
- * call to the identity callback of #GNUNET_IDENTITY_connect (if
- * that one was not NULL).
- *
- * @param cls closure, NULL
- * @param ego ego handle
- * @param ctx context for application to store data for this ego
- * (during the lifetime of this process, initially NULL)
- * @param name name assigned by the user for this ego,
- * NULL if the user just deleted the ego and it
- * must thus no longer be used
- */
-static void
-identity_shorten_cb (void *cls,
- struct GNUNET_IDENTITY_Ego *ego,
- void **ctx,
- const char *name)
-{
- id_op = NULL;
- if (NULL == ego)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _("No ego configured for `shorten-zone`\n"));
- }
- else
- {
- local_shorten_zone = *GNUNET_IDENTITY_ego_get_private_key (ego);
- do_shorten = GNUNET_YES;
- }
- run_cont ();
-}
-
-
/**
* Method called to inform about the egos of the master zone of this peer.
*
}
GNUNET_IDENTITY_ego_get_public_key (ego,
&local_gns_zone);
- id_op = GNUNET_IDENTITY_get (identity,
- "gns-short",
- &identity_shorten_cb,
- NULL);
+ run_cont ();
}
* @param c configuration
*/
static void
-run (void *cls, char *const *args, const char *cfgfile,
+run (void *cls,
+ char *const *args,
+ const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
char* cafile_cfg = NULL;
"</head><body>cURL fail</body></html>";
int ret;
- if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
+ if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
return 2;
- GNUNET_log_setup ("gnunet-gns-proxy", "WARNING", NULL);
- curl_failure_response = MHD_create_response_from_buffer (strlen (page),
- (void*)page,
- MHD_RESPMEM_PERSISTENT);
+ GNUNET_log_setup ("gnunet-gns-proxy",
+ "WARNING",
+ NULL);
+ curl_failure_response
+ = MHD_create_response_from_buffer (strlen (page),
+ (void *) page,
+ MHD_RESPMEM_PERSISTENT);
ret =
(GNUNET_OK ==
- GNUNET_PROGRAM_run (argc, argv, "gnunet-gns-proxy",
+ GNUNET_PROGRAM_run (argc, argv,
+ "gnunet-gns-proxy",
_("GNUnet GNS proxy"),
options,
&run, NULL)) ? 0 : 1;
MHD_destroy_response (curl_failure_response);
GNUNET_free_non_null ((char *) argv);
- GNUNET_CRYPTO_ecdsa_key_clear (&local_shorten_zone);
return ret;
}
/*
This file is part of GNUnet.
- Copyright (C) 2012-2013 GNUnet e.V.
+ Copyright (C) 2012-2013, 2017 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
*/
static char *public_key;
-/**
- * Reverse key
- */
-static char *reverse_key;
-
-/**
- * Reverse key
- */
-static struct GNUNET_CRYPTO_EcdsaPublicKey rkey;
-
/**
* Set to GNUNET_GNS_LO_LOCAL_MASTER if we are looking up in the master zone.
*/
*/
static struct GNUNET_GNS_LookupRequest *lookup_request;
-/**
- * Handle to reverse lookup request
- */
-static struct GNUNET_GNS_ReverseLookupRequest *rev_lookup_request;
-
/**
* Lookup an ego with the identity service.
*/
GNUNET_SCHEDULER_shutdown ();
}
-static void
-process_reverse_result (void *cls,
- const char *name)
-{
- rev_lookup_request = NULL;
- if (NULL == name)
- {
- printf ("No name found.\n");
- return;
- }
- if (raw)
- printf ("%s\n", name);
- else
- printf ("%s is known as %s\n",
- reverse_key,
- name);
- GNUNET_SCHEDULER_shutdown ();
-}
/**
* Function called with the result of a GNS lookup.
* @param rd array of @a rd_count records with the results
*/
static void
-process_lookup_result (void *cls, uint32_t rd_count,
+process_lookup_result (void *cls,
+ uint32_t rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
{
const char *name = cls;
* identified by the given public key and the shorten zone.
*
* @param pkey public key to use for the zone, can be NULL
- * @param shorten_key private key used for shortening, can be NULL
*/
static void
-lookup_with_keys (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key)
+lookup_with_public_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
{
if (NULL != lookup_type)
rtype = GNUNET_GNSRECORD_typename_to_number (lookup_type);
pkey,
rtype,
local_options,
- shorten_key,
&process_lookup_result,
lookup_name);
}
- else if (NULL != reverse_key)
- {
- rev_lookup_request = GNUNET_GNS_reverse_lookup (gns,
- &rkey,
- pkey,
- &process_reverse_result,
- NULL);
- }
else
{
fprintf (stderr,
}
-/**
- * Method called to with the ego we are to use for shortening
- * during the lookup.
- *
- * @param cls closure contains the public key to use
- * @param ego ego handle, NULL if not found
- * @param ctx context for application to store data for this ego
- * (during the lifetime of this process, initially NULL)
- * @param name name assigned by the user for this ego,
- * NULL if the user just deleted the ego and it
- * must thus no longer be used
- */
-static void
-identity_shorten_cb (void *cls,
- struct GNUNET_IDENTITY_Ego *ego,
- void **ctx,
- const char *name)
-{
- struct GNUNET_CRYPTO_EcdsaPublicKey *pkeym = cls;
-
- id_op = NULL;
- if (NULL == ego)
- lookup_with_keys (pkeym, NULL);
- else
- lookup_with_keys (pkeym,
- GNUNET_IDENTITY_ego_get_private_key (ego));
- GNUNET_free (pkeym);
-}
-
-
-/**
- * Perform the actual resolution, starting with the zone
- * identified by the given public key.
- *
- * @param pkey public key to use for the zone
- */
-static void
-lookup_with_public_key (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey)
-{
- struct GNUNET_CRYPTO_EcdsaPublicKey *pkeym;
-
- GNUNET_assert (NULL != pkey);
- pkeym = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPublicKey);
- *pkeym = *pkey;
- GNUNET_break (NULL == id_op);
- id_op = GNUNET_IDENTITY_get (identity,
- "gns-short",
- &identity_shorten_cb,
- pkeym);
- if (NULL == id_op)
- {
- GNUNET_break (0);
- lookup_with_keys (pkey, NULL);
- }
-}
-
-
/**
* Method called to with the ego we are to use for the lookup,
* when the ego is determined by a name.
cfg = c;
gns = GNUNET_GNS_connect (cfg);
- identity = GNUNET_IDENTITY_connect (cfg, NULL, NULL);
if (NULL == gns)
{
fprintf (stderr,
return;
}
tt = GNUNET_SCHEDULER_add_delayed (timeout,
- &do_timeout, NULL);
- GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
- if (NULL != reverse_key)
- {
- if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_public_key_from_string (reverse_key,
- strlen (reverse_key),
- &rkey))
- {
- fprintf (stderr,
- _("Reverse key `%s' is not well-formed\n"),
- reverse_key);
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
- }
+ &do_timeout,
+ NULL);
+ GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
+ NULL);
+ identity = GNUNET_IDENTITY_connect (cfg,
+ NULL,
+ NULL);
if (NULL != public_key)
{
if (GNUNET_OK !=
lookup_with_public_key (&pkey);
return;
}
- if (NULL != reverse_key)
- {
- if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_public_key_from_string (reverse_key,
- strlen (reverse_key),
- &rkey))
- {
- fprintf (stderr,
- _("Reverse key `%s' is not well-formed\n"),
- reverse_key);
- GNUNET_SCHEDULER_shutdown ();
- return;
- }
- }
if (NULL != zone_ego_name)
{
el = GNUNET_IDENTITY_ego_lookup (cfg,
* @return 0 ok, 1 on error
*/
int
-main (int argc, char *const *argv)
+main (int argc,
+ char *const *argv)
{
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'u', "lookup", "NAME",
{'z', "zone", "NAME",
gettext_noop ("Specify the name of the ego of the zone to lookup the record in"), 1,
&GNUNET_GETOPT_set_string, &zone_ego_name},
- {'R', "reverse", "PKEY",
- gettext_noop ("Specify the public key of the zone to reverse lookup a name for"), 1,
- &GNUNET_GETOPT_set_string, &reverse_key},
GNUNET_GETOPT_OPTION_END
};
int ret;
timeout = GNUNET_TIME_UNIT_FOREVER_REL;
- if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
+ if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
return 2;
- GNUNET_log_setup ("gnunet-gns", "WARNING", NULL);
+ GNUNET_log_setup ("gnunet-gns",
+ "WARNING",
+ NULL);
ret =
(GNUNET_OK ==
- GNUNET_PROGRAM_run (argc, argv, "gnunet-gns",
+ GNUNET_PROGRAM_run (argc, argv,
+ "gnunet-gns",
_("GNUnet GNS resolver tool"),
options,
&run, NULL)) ? 0 : 1;
* We keep these in a DLL.
*/
struct ClientLookupHandle *prev;
-
+
/**
* Client handle
*/
*/
struct GNS_ResolverHandle *lookup;
- /**
- * Active handle for a reverse lookup
- */
- struct GNS_ReverserHandle *rev_lookup;
-
/**
* request id
*/
identity_handle = NULL;
}
GNS_resolver_done ();
- GNS_reverse_done ();
- GNS_shorten_done ();
if (NULL != statistics)
{
GNUNET_STATISTICS_destroy (statistics,
{
if (NULL != clh->lookup)
GNS_resolver_lookup_cancel (clh->lookup);
- if (NULL != clh->rev_lookup)
- GNS_reverse_lookup_cancel (clh->rev_lookup);
GNUNET_CONTAINER_DLL_remove (gc->clh_head,
gc->clh_tail,
clh);
GNUNET_free (clh);
}
- GNUNET_free (gc);
+ GNUNET_free (gc);
}
(char*) &rmsg[1]);
GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(clh->gc->client),
env);
- GNUNET_CONTAINER_DLL_remove (clh->gc->clh_head, clh->gc->clh_tail, clh);
+ GNUNET_CONTAINER_DLL_remove (clh->gc->clh_head,
+ clh->gc->clh_tail,
+ clh);
GNUNET_free (clh);
GNUNET_STATISTICS_update (statistics,
"Completed lookups", 1,
GNUNET_NO);
}
-/**
- * Reply to client with the result from our reverse lookup.
- *
- * @param cls the closure (our client lookup handle)
- * @param rd_count the number of records in @a rd
- * @param rd the record data
- */
-static void
-send_reverse_lookup_response (void* cls,
- const char *name)
-{
- struct ClientLookupHandle *clh = cls;
- struct GNUNET_MQ_Envelope *env;
- struct ReverseLookupResultMessage *rmsg;
- size_t len;
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Sending LOOKUP_RESULT message with %s\n",
- name);
-
- if (NULL == name)
- len = 1;
- else
- len = strlen (name) + 1;
- env = GNUNET_MQ_msg_extra (rmsg,
- len,
- GNUNET_MESSAGE_TYPE_GNS_REVERSE_LOOKUP_RESULT);
- rmsg->id = clh->request_id;
- if (1 < len)
- GNUNET_memcpy ((char*) &rmsg[1],
- name,
- strlen (name));
- GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(clh->gc->client),
- env);
- GNUNET_CONTAINER_DLL_remove (clh->gc->clh_head, clh->gc->clh_tail, clh);
- GNUNET_free (clh);
- GNUNET_STATISTICS_update (statistics,
- "Completed reverse lookups", 1,
- GNUNET_NO);
-}
-
/**
* Checks a #GNUNET_MESSAGE_TYPE_GNS_LOOKUP message
return GNUNET_OK;
}
+
/**
* Handle lookup requests from client
*
struct ClientLookupHandle *clh;
char *nameptr = name;
const char *utf_in;
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *key;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received LOOKUP message\n");
GNUNET_SERVICE_client_continue (gc->client);
- if (GNUNET_YES == ntohs (sh_msg->have_key))
- key = &sh_msg->shorten_key;
- else
- key = NULL;
utf_in = (const char *) &sh_msg[1];
GNUNET_STRINGS_utf8_tolower (utf_in, nameptr);
clh = GNUNET_new (struct ClientLookupHandle);
- GNUNET_CONTAINER_DLL_insert (gc->clh_head, gc->clh_tail, clh);
+ GNUNET_CONTAINER_DLL_insert (gc->clh_head,
+ gc->clh_tail,
+ clh);
clh->gc = gc;
clh->request_id = sh_msg->id;
if ( (GNUNET_DNSPARSER_TYPE_A == ntohl (sh_msg->type)) &&
clh->lookup = GNS_resolver_lookup (&sh_msg->zone,
ntohl (sh_msg->type),
name,
- key,
(enum GNUNET_GNS_LocalOptions) ntohs (sh_msg->options),
&send_lookup_response, clh);
GNUNET_STATISTICS_update (statistics,
1, GNUNET_NO);
}
-/**
- * Handle reverse lookup requests from client
- *
- * @param cls the closure
- * @param client the client
- * @param message the message
- */
-static void
-handle_rev_lookup (void *cls,
- const struct ReverseLookupMessage *sh_msg)
-{
- struct GnsClient *gc = cls;
- struct ClientLookupHandle *clh;
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Received REVERSE_LOOKUP message\n");
- GNUNET_SERVICE_client_continue (gc->client);
-
- clh = GNUNET_new (struct ClientLookupHandle);
- GNUNET_CONTAINER_DLL_insert (gc->clh_head, gc->clh_tail, clh);
- clh->gc = gc;
- clh->request_id = sh_msg->id;
- clh->rev_lookup = GNS_reverse_lookup (&sh_msg->zone_pkey,
- &sh_msg->root_pkey,
- &send_reverse_lookup_response,
- clh);
- GNUNET_STATISTICS_update (statistics,
- "Reverse lookup attempts",
- 1, GNUNET_NO);
-}
-
-
-/**
- * Method called to inform about the ego to be used for the master zone
- * for DNS interceptions.
- *
- * This function is only called ONCE, and 'NULL' being passed in
- * @a ego does indicate that interception is not configured.
- * If @a ego is non-NULL, we should start to intercept DNS queries
- * and resolve ".gnu" queries using the given ego as the master zone.
- *
- * @param cls closure, our `const struct GNUNET_CONFIGURATION_Handle *c`
- * @param ego ego handle
- * @param ctx context for application to store data for this ego
- * (during the lifetime of this process, initially NULL)
- * @param name name assigned by the user for this ego,
- * NULL if the user just deleted the ego and it
- * must thus no longer be used
- */
-static void
-identity_reverse_cb (void *cls,
- struct GNUNET_IDENTITY_Ego *ego,
- void **ctx,
- const char *name)
-{
- identity_op = NULL;
-
- if (NULL == ego)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("No ego configured for `%s`\n"),
- "gns-master");
-
- return;
- }
- if (GNUNET_SYSERR ==
- GNS_reverse_init (namestore_handle,
- GNUNET_IDENTITY_ego_get_private_key (ego),
- name))
- {
- GNUNET_break (0);
- GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
- return;
- }
-}
-
/**
* Method called to inform about the ego to be used for the master zone
{
const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
struct GNUNET_CRYPTO_EcdsaPublicKey dns_root;
- identity_op = NULL;
+ identity_op = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Looking for gns-intercept ego\n");
- identity_op = GNUNET_IDENTITY_get (identity_handle,
- "gns-reverse",
- &identity_reverse_cb,
- (void*)cfg);
-
-
if (NULL == ego)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
GNUNET_IDENTITY_ego_get_public_key (ego,
&dns_root);
if (GNUNET_SYSERR ==
- GNS_interceptor_init (&dns_root, cfg))
+ GNS_interceptor_init (&dns_root,
+ cfg))
{
GNUNET_break (0);
- GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+ GNUNET_SCHEDULER_add_now (&shutdown_task,
+ NULL);
return;
}
}
unsigned long long max_parallel_bg_queries = 16;
v6_enabled = GNUNET_NETWORK_test_pf (PF_INET6);
- v4_enabled = GNUNET_NETWORK_test_pf (PF_INET);
+ v4_enabled = GNUNET_NETWORK_test_pf (PF_INET);
namestore_handle = GNUNET_NAMESTORE_connect (c);
if (NULL == namestore_handle)
{
dht_handle,
c,
max_parallel_bg_queries);
- GNS_shorten_init (namestore_handle,
- namecache_handle,
- dht_handle);
statistics = GNUNET_STATISTICS_create ("gns", c);
- GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
}
GNUNET_MESSAGE_TYPE_GNS_LOOKUP,
struct LookupMessage,
NULL),
- GNUNET_MQ_hd_fixed_size (rev_lookup,
- GNUNET_MESSAGE_TYPE_GNS_REVERSE_LOOKUP,
- struct ReverseLookupMessage,
- NULL),
GNUNET_MQ_handler_end());
ilh->lookup = GNS_resolver_lookup (&zone,
p->queries[0].type,
p->queries[0].name,
- NULL /* FIXME: enable shorten for DNS intercepts? */,
GNUNET_NO,
&reply_to_dns, ilh);
return;
*/
struct AuthorityChain *ac_tail;
- /**
- * Private key of the shorten zone, NULL to not shorten.
- */
- struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key;
-
/**
* ID of a task associated with the resolution process.
*/
} /* end: switch */
} /* end: for rd_count */
- /* trigger shortening */
- if ((NULL != rh->shorten_key) &&
- (NULL != shorten_ac) &&
- (GNUNET_NO == shorten_ac->shortening_started) &&
- (NULL != shorten_ac->suggested_shortening_label))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Start shortening for label `%s' based on nick `%s'\n",
- shorten_ac->label,
- shorten_ac->suggested_shortening_label);
- shorten_ac->shortening_started = GNUNET_YES;
- GNS_shorten_start (shorten_ac->label,
- shorten_ac->suggested_shortening_label,
- &shorten_ac->authority_info.gns_authority,
- rh->shorten_key);
- }
-
/* yes, we are done, return result */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Returning GNS response for `%s' with %u answers\n",
* @param zone the zone to perform the lookup in
* @param record_type the record type to look up
* @param name the name to look up
- * @param shorten_key a private key for use with PSEU import (can be NULL)
* @param options local options to control local lookup
* @param proc the processor to call on result
* @param proc_cls the closure to pass to @a proc
GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
uint32_t record_type,
const char *name,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key,
enum GNUNET_GNS_LocalOptions options,
GNS_ResultProcessor proc, void *proc_cls)
{
struct GNS_ResolverHandle *rh;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- (NULL == shorten_key)
- ? "Starting lookup for `%s' with shortening disabled\n"
- : "Starting lookup for `%s' with shortening enabled\n",
+ "Starting lookup for `%s'\n",
name);
rh = GNUNET_new (struct GNS_ResolverHandle);
GNUNET_CONTAINER_DLL_insert (rlh_head,
rh->record_type = record_type;
rh->name = GNUNET_strdup (name);
rh->name_resolution_pos = strlen (name);
- if (NULL != shorten_key)
- {
- rh->shorten_key = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
- *rh->shorten_key = *shorten_key;
- }
start_resolver_lookup (rh);
return rh;
}
dr);
GNUNET_free (dr);
}
- GNUNET_free_non_null (rh->shorten_key);
GNUNET_free (rh->name);
GNUNET_free (rh);
}
* @param rd_count number of records in @a rd
* @param rd records returned for the lookup
*/
-typedef void (*GNS_ResultProcessor)(void *cls,
- uint32_t rd_count,
- const struct GNUNET_GNSRECORD_Data *rd);
+typedef void
+(*GNS_ResultProcessor)(void *cls,
+ uint32_t rd_count,
+ const struct GNUNET_GNSRECORD_Data *rd);
/**
* @param zone the zone to perform the lookup in
* @param record_type the record type to look up
* @param name the name to look up
- * @param shorten_key optional private key for authority caching, can be NULL
* @param options options set to control local lookup
* @param proc the processor to call
* @param proc_cls the closure to pass to @a proc
GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
uint32_t record_type,
const char *name,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key,
enum GNUNET_GNS_LocalOptions options,
GNS_ResultProcessor proc,
void *proc_cls);
GNS_resolver_lookup_cancel (struct GNS_ResolverHandle *rh);
-
-
/**
* Generic function to check for TLDs. Checks if "name" ends in ".tld"
*
* identified by the given public key and the shorten zone.
*
* @param pkey public key to use for the zone, can be NULL
- * @param shorten_key private key used for shortening, can be NULL
*/
static void
-lookup_with_keys (struct LookupHandle *handle, const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key)
+lookup_with_public_key (struct LookupHandle *handle)
{
if (UINT32_MAX == handle->type)
{
&handle->pkey,
handle->type,
handle->options,
- shorten_key,
&process_lookup_result,
handle);
}
}
}
-/**
- * Method called to with the ego we are to use for shortening
- * during the lookup.
- *
- * @param cls closure contains the public key to use
- * @param ego ego handle, NULL if not found
- * @param ctx context for application to store data for this ego
- * (during the lifetime of this process, initially NULL)
- * @param name name assigned by the user for this ego,
- * NULL if the user just deleted the ego and it
- * must thus no longer be used
- */
-static void
-identity_shorten_cb (void *cls,
- struct GNUNET_IDENTITY_Ego *ego,
- void **ctx,
- const char *name)
-{
- struct LookupHandle *handle = cls;
-
- handle->id_op = NULL;
- if (NULL == ego)
- lookup_with_keys (handle, NULL);
- else
- lookup_with_keys (handle,
- GNUNET_IDENTITY_ego_get_private_key (ego));
-}
-
-/**
- * Perform the actual resolution, starting with the zone
- * identified by the given public key.
- *
- * @param pkey public key to use for the zone
- */
-static void
-lookup_with_public_key (struct LookupHandle *handle)
-{
- handle->pkeym = handle->pkey;
- GNUNET_break (NULL == handle->id_op);
- handle->id_op = GNUNET_IDENTITY_get (handle->identity,
- "gns-short",
- &identity_shorten_cb,
- handle);
- if (NULL == handle->id_op)
- {
- GNUNET_break (0);
- lookup_with_keys (handle, NULL);
- }
-}
/**
* Method called to with the ego we are to use for the lookup,
json_decref(handle->json_root);
}
+
/**
* Method called to with the ego we are to use for the lookup,
* when the ego is the one for the default master zone.
+++ /dev/null
-#!/bin/bash
-trap "gnunet-arm -e -c test_gns_nick_shorten.conf" SIGINT
-which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
-
-# This test tests shortening functionality based on NICK records:
-#
-# zone "delegatedego": Alice's zone
-# zone "testego": Local zone with delegation to alice
-
-LOCATION=$(which gnunet-config)
-if [ -z $LOCATION ]
-then
- LOCATION="gnunet-config"
-fi
-$LOCATION --version 1> /dev/null
-if test $? != 0
-then
- echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
- exit 77
-fi
-
-# Deleting home directory from previous runs
-TEST_CONFIG="test_gns_nick_shorten.conf "
-rm -rf /tmp/test-gnunet-gns-peer-1/
-TEST_IP="127.0.0.1"
-TEST_IP="127.0.0.2"
-TEST_NICK_EGO="ego"
-TEST_NICK_DELEGATED="alice"
-TEST_NAME="www.mybestfriendalice.gnu"
-TEST_NAME_SHORT="www.alice.short.gnu"
-
-# export GNUNET_FORCE_LOG="namestore;;;;DEBUG/gns;;;;DEBUG/;;;;WARNING"
-
-# Start gnunet
-echo "Starting arm with configuration $TEST_CONFIG"
-gnunet-arm -s -c $TEST_CONFIG
-
-# Create initial identities: short-zone, delegated-zone, testego
-echo "Creating identities"
-gnunet-identity -d -c $TEST_CONFIG
-gnunet-identity -C short-zone -c $TEST_CONFIG
-gnunet-identity -C delegatedego -c $TEST_CONFIG
-gnunet-identity -e short-zone -s gns-short -c $TEST_CONFIG
-gnunet-identity -C testego -c $TEST_CONFIG
-
-echo "Adding nick names for identities"
-gnunet-namestore -z testego -i $TEST_NICK_EGO -c $TEST_CONFIG
-gnunet-namestore -z delegatedego -i $TEST_NICK_DELEGATED -c $TEST_CONFIG
-
-# Adding label www in Alice's delegatedego zone
-echo "Adding www record with IP $TEST_IP"
-gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_nick_shorten.conf
-
-# Retrieve PKEYs for delegation
-DELEGATED_PKEY=$(gnunet-identity -d -c $TEST_CONFIG| grep delegatedego | awk '{print $3}')
-echo "Alice's PKEY is $DELEGATED_PKEY"
-
-SHORTEN_PKEY=$(gnunet-identity -c test_gns_nick_shorten.conf -d | grep short-zone | awk '{print $3}')
-echo "Shorten PKEY is $SHORTEN_PKEY"
-
-# Delegate the name "short" to shortenzone
-gnunet-namestore -p -z testego -a -n short -t PKEY -V $SHORTEN_PKEY -e never -c test_gns_nick_shorten.conf
-
-# Delegate the name "mybestfriendalice" to alice
-gnunet-namestore -p -z testego -a -n mybestfriendalice -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_nick_shorten.conf
-
-# Perform lookup to shorten
-echo "Start gns..."
-gnunet-arm -c test_gns_nick_shorten.conf -i gns
-
-
-RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u $TEST_NAME -t A -c test_gns_nick_shorten.conf`
-
-sleep 1
-
-echo "Lookup shortened names"
-PKEY_SHORT_RES=$($DO_TIMEOUT gnunet-gns --raw -c test_gns_nick_shorten.conf -z short-zone -u alice.gnu -t PKEY)
-echo "Resolving alice's PKEY in shorten zone: $PKEY_SHORT_RES"
-PKEY_RES=$($DO_TIMEOUT gnunet-gns --raw -c test_gns_nick_shorten.conf -z testego -u alice.short.gnu -t PKEY)
-echo "Resolving alice's PKEY in master zone: $PKEY_RES"
-
-RES=0
-if [ "$DELEGATED_PKEY" == "$PKEY_SHORT_RES" ]
-then
- echo "PASS: Resolved delegation for shorten name in shortened zone"
-else
- echo "FAIL: Expected PKEY in $DELEGATED_PKEY, received PKEY '$PKEY_SHORT_RES' in shorten zone."
- RES=1
-fi
-
-if [ "$DELEGATED_PKEY" == "$PKEY_RES" ]
-then
- echo "PASS: Resolved delegation for shorten name in master zone"
-else
- echo "FAIL: Expected PKEY in $DELEGATED_PKEY, received PKEY $PKEY_SHORT_RES in master zone."
- RES=1
-fi
-
-if [ $RES -eq 0 ]
-then
- RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u $TEST_NAME_SHORT -t A -c test_gns_nick_shorten.conf`
- if [ "$RES_IP" == "$TEST_IP" ]
- then
- echo "PASS: Received $TEST_IP for $TEST_NAME_SHORT"
- else
- echo "FAIL: Expected IP in $TEST_IP, received IP '$RES_IP' for $TEST_SHORT_NAME."
- RES=1
- fi
-fi
-
-
-# Clean up
-echo "Clean up..."
-gnunet-namestore -z testego -d -n mybestfriendalice -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_nick_shorten.conf
-gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_nick_shorten.conf
-gnunet-identity -D -z testego -c $TEST_CONFIG
-gnunet-identity -D -z delegatedego -c $TEST_CONFIG
-gnunet-identity -D -z short-zone -c $TEST_CONFIG
-
-gnunet-arm -e -c test_gns_nick_shorten.conf
-rm -rf /tmp/test-gnunet-gns-peer-1/
-
-exit $RES
-
+++ /dev/null
-#!/bin/bash
-trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
-which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
-
-LOCATION=$(which gnunet-config)
-if [ -z $LOCATION ]
-then
- LOCATION="gnunet-config"
-fi
-$LOCATION --version 1> /dev/null
-if test $? != 0
-then
- echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
- exit 77
-fi
-
-TEST_NAME="dave.bob.alice.gnu"
-gnunet-arm -s -c test_gns_lookup.conf
-gnunet-identity -C bob -c test_gns_lookup.conf
-BOB_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep bob | awk '{print $3}')
-gnunet-identity -C daveego -c test_gns_lookup.conf
-DAVE_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep dave | awk '{print $3}')
-gnunet-identity -C aliceego -c test_gns_lookup.conf
-ALICE_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep alice | awk '{print $3}')
-gnunet-identity -C testego -c test_gns_lookup.conf
-ROOT_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep testego | awk '{print $3}')
-
-gnunet-identity -s gns-reverse -e bob -c test_gns_lookup.conf
-
-gnunet-namestore -p -z testego -a -n alice -t PKEY -V $ALICE_PKEY -e never -c test_gns_lookup.conf
-gnunet-namestore -p -z aliceego -a -n bob -t PKEY -V $BOB_PKEY -e never -c test_gns_lookup.conf
-gnunet-namestore -p -z aliceego -a -n + -t REVERSE -V "alice $ROOT_PKEY 0" -e never -c test_gns_lookup.conf
-gnunet-namestore -p -z bob -a -n dave -t PKEY -V $DAVE_PKEY -e never -c test_gns_lookup.conf
-gnunet-namestore -p -z bob -a -n alice -t PKEY -V $ALICE_PKEY -e never -c test_gns_lookup.conf
-#gnunet-namestore -p -z bob -a -n + -t REVERSE -V "bob $ALICE_PKEY 0" -e never -c test_gns_lookup.conf
-gnunet-namestore -p -z daveego -a -n + -t REVERSE -V "dave $BOB_PKEY 0" -e never -c test_gns_lookup.conf
-gnunet-namestore -p -z daveego -a -n bob -t PKEY -V $BOB_PKEY -e never -c test_gns_lookup.conf
-gnunet-arm -i gns -c test_gns_lookup.conf
-sleep 10
-RES_NAME=`$DO_TIMEOUT gnunet-gns --raw -z testego -R $DAVE_PKEY -c test_gns_lookup.conf`
-gnunet-arm -e -c test_gns_lookup.conf
-rm -rf /tmp/test-gnunet-gns-peer-1/
-
-if [ "$RES_NAME" == "$TEST_NAME" ]
-then
- exit 0
-else
- echo "Failed to resolve to proper IP, got $RES_IP."
- exit 1
-fi
GNUNET_CONTAINER_DLL_insert (attr->val_head,
attr->val_tail,
val);
- GNUNET_assert (GNUNET_OK ==
+ GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_put (ego_entry->attr_map,
&key,
attr,
struct IssueResultMessage *irm;
char *tmp_str;
size_t len;
-
+
GNUNET_asprintf (&tmp_str, "%s,%s,%s", label, ticket, token);
len = strlen (tmp_str) + 1;
env = GNUNET_MQ_msg_extra (irm,
return GNUNET_SYSERR;
}
return GNUNET_OK;
-}
+}
/**
*
&xchange_handle->ticket->payload->identity_key,
GNUNET_GNSRECORD_TYPE_ID_TOKEN,
GNUNET_GNS_LO_LOCAL_MASTER,
- NULL,
&process_lookup_result,
xchange_handle);
GNUNET_free (lookup_query);
/*
This file is part of GNUnet
- Copyright (C) 2012-2014 GNUnet e.V.
+ Copyright (C) 2012-2014, 2017 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
uint32_t rd_count,
const struct GNUNET_GNSRECORD_Data *rd);
-/**
- * Iterator called on obtained result for a GNS lookup.
- *
- * @param cls closure
- * @param name result of the reverse lookup
- */
-typedef void
-(*GNUNET_GNS_ReverseLookupResultProcessor) (void *cls,
- const char* name);
-
/**
* Options for the GNS lookup.
* @param zone zone to look in
* @param type the GNS record type to look for
* @param options local options for the lookup
- * @param shorten_zone_key the private key of the shorten zone (can be NULL);
- * specify to enable automatic shortening (given a PSEU
- * record, if a given pseudonym is not yet used in the
- * shorten zone, we automatically add the respective zone
- * under that name)
* @param proc function to call on result
- * @param proc_cls closure for processor
+ * @param proc_cls closure for @a proc
* @return handle to the queued request
*/
struct GNUNET_GNS_LookupRequest *
const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
uint32_t type,
enum GNUNET_GNS_LocalOptions options,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone_key,
GNUNET_GNS_LookupResultProcessor proc,
void *proc_cls);
-/**
- * Perform an asynchronous reverse lookup operation on the GNS.
- *
- * @param handle handle to the GNS service
- * @param zone_key zone to find a name for
- * @param root_key our zone
- * @param proc processor to call on result
- * @param proc_cls closure for @a proc
- * @return handle to the request
- */
-struct GNUNET_GNS_ReverseLookupRequest *
-GNUNET_GNS_reverse_lookup (struct GNUNET_GNS_Handle *handle,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *root_key,
- GNUNET_GNS_ReverseLookupResultProcessor proc,
- void *proc_cls);
-
/**
* Cancel pending lookup request
GNUNET_memcpy (gcls->password, password, password_size);
}
- GNUNET_GNS_lookup (gns, gns_name, &greq->ego_pub_key,
- GNUNET_GNSRECORD_TYPE_PLACE, GNUNET_GNS_LO_DEFAULT,
- NULL, gns_result_guest_enter, gcls);
+ GNUNET_GNS_lookup (gns, gns_name,
+ &greq->ego_pub_key,
+ GNUNET_GNSRECORD_TYPE_PLACE,
+ GNUNET_GNS_LO_DEFAULT,
+ &gns_result_guest_enter, gcls);
}