GNUnet 0.22.1
gnunet-abd.c File Reference

command line tool to access command line Credential service More...

#include "gnunet_error_codes.h"
#include "platform.h"
#include <gnunet_util_lib.h>
#include <gnunet_abd_service.h>
#include <gnunet_gnsrecord_lib.h>
#include <gnunet_namestore_service.h>
#include "delegate_misc.h"
#include "abd_serialization.h"
Include dependency graph for gnunet-abd.c:

Go to the source code of this file.

Functions

static void do_shutdown (void *cls)
 Task run on shutdown. More...
 
static void do_timeout (void *cls)
 Task run on timeout. More...
 
static void handle_intermediate_result (void *cls, struct GNUNET_ABD_Delegation *dd, bool is_bw)
 
static void handle_collect_result (void *cls, unsigned int d_count, struct GNUNET_ABD_Delegation *dc, unsigned int c_count, struct GNUNET_ABD_Delegate *dele)
 
static void handle_verify_result (void *cls, unsigned int d_count, struct GNUNET_ABD_Delegation *dc, unsigned int c_count, struct GNUNET_ABD_Delegate *dele)
 
static void identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
 Callback invoked from identity service with ego information. More...
 
static int parse_expiration (const char *expirationstring, int *etime_is_rel_, uint64_t *etime_)
 Parse expiration time. More...
 
static void error_cb (void *cls)
 Function called if lookup fails. More...
 
static void add_continuation (void *cls, enum GNUNET_ErrorCode ec)
 
static void get_existing_record (void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *rec_name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
 
static void store_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
 
static void sign_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
 
static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
 Main function that will be run. More...
 
int main (int argc, char *const *argv)
 The main function for gnunet-gns. More...
 

Variables

static const struct GNUNET_CONFIGURATION_Handlecfg
 Configuration we are using. More...
 
static struct GNUNET_NAMESTORE_Handlens
 Handle to the namestore. More...
 
static struct GNUNET_CRYPTO_PrivateKey zone_pkey
 Private key for the our zone. More...
 
static struct GNUNET_IDENTITY_EgoLookupel
 EgoLookup. More...
 
static struct GNUNET_ABD_Handleabd
 Handle to Credential service. More...
 
static struct GNUNET_TIME_Relative timeout
 Desired timeout for the lookup (default is no timeout). More...
 
static struct GNUNET_ABD_Requestverify_request
 Handle to verify request. More...
 
static struct GNUNET_ABD_Requestcollect_request
 Handle to collect request. More...
 
static struct GNUNET_SCHEDULER_Tasktt
 Task scheduled to handle timeout. More...
 
static int ret = 0
 Return value of the commandline. More...
 
static char * subject
 Subject pubkey string. More...
 
static char * subject_delegate
 Subject delegate string. More...
 
static char * expiration
 Credential TTL. More...
 
struct GNUNET_CRYPTO_PublicKey subject_pkey
 Subject key. More...
 
struct GNUNET_CRYPTO_PublicKey issuer_pkey
 Issuer key. More...
 
static char * issuer_key
 Issuer pubkey string. More...
 
static char * ego_name
 ego More...
 
static char * issuer_attr
 Issuer attribute. More...
 
static int verify
 Verify mode. More...
 
static int collect
 Collect mode. More...
 
static int create_is
 Create mode. More...
 
static int create_ss
 Create mode. More...
 
static int sign_ss
 Create mode. More...
 
static char * import
 Signed issue credentials. More...
 
static int is_private
 Is record private. More...
 
static int forward
 Search direction: forward. More...
 
static int backward
 Search direction: backward. More...
 
enum GNUNET_ABD_AlgoDirectionFlags direction = 0
 API enum, filled and passed for collect/verify. More...
 
static struct GNUNET_NAMESTORE_QueueEntryadd_qe
 Queue entry for the 'add' operation. More...
 
static void * data
 Value in binary format. More...
 
static size_t data_size
 Number of bytes in data. More...
 
static uint32_t type
 Type string converted to DNS type value. More...
 
static char * typestring
 Type of the record to add/remove, NULL to remove all. More...
 
static uint64_t etime
 Expiration string converted to numeric value. More...
 
static int etime_is_rel = GNUNET_SYSERR
 Is expiration time relative or absolute time? More...
 
static const char * record_label
 Record label for storing delegations. More...
 

Detailed Description

command line tool to access command line Credential service

Author
Martin Schanzenbach

Definition in file gnunet-abd.c.

Function Documentation

◆ do_shutdown()

static void do_shutdown ( void *  cls)
static

Task run on shutdown.

Cleans up everything.

Parameters
clsunused

Definition at line 220 of file gnunet-abd.c.

221{
222 if (NULL != verify_request)
223 {
225 verify_request = NULL;
226 }
227 if (NULL != abd)
228 {
230 abd = NULL;
231 }
232 if (NULL != tt)
233 {
235 tt = NULL;
236 }
237 if (NULL != el)
238 {
240 el = NULL;
241 }
242 if (NULL != add_qe)
243 {
245 add_qe = NULL;
246 }
247 if (NULL != ns)
248 {
250 ns = NULL;
251 }
252}
static struct GNUNET_NAMESTORE_QueueEntry * add_qe
Queue entry for the 'add' operation.
Definition: gnunet-abd.c:178
static struct GNUNET_IDENTITY_EgoLookup * el
EgoLookup.
Definition: gnunet-abd.c:52
static struct GNUNET_SCHEDULER_Task * tt
Task scheduled to handle timeout.
Definition: gnunet-abd.c:77
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
Definition: gnunet-abd.c:42
static struct GNUNET_ABD_Handle * abd
Handle to Credential service.
Definition: gnunet-abd.c:57
static struct GNUNET_ABD_Request * verify_request
Handle to verify request.
Definition: gnunet-abd.c:67
void GNUNET_ABD_disconnect(struct GNUNET_ABD_Handle *handle)
Shutdown connection with the ABD service.
Definition: abd_api.c:376
void GNUNET_ABD_request_cancel(struct GNUNET_ABD_Request *lr)
Cancel pending verify request.
Definition: abd_api.c:399
void GNUNET_IDENTITY_ego_lookup_cancel(struct GNUNET_IDENTITY_EgoLookup *el)
Abort ego lookup attempt.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
void GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe)
Cancel a namestore operation.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:979

References abd, add_qe, el, GNUNET_ABD_disconnect(), GNUNET_ABD_request_cancel(), GNUNET_IDENTITY_ego_lookup_cancel(), GNUNET_NAMESTORE_cancel(), GNUNET_NAMESTORE_disconnect(), GNUNET_SCHEDULER_cancel(), ns, tt, and verify_request.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_timeout()

static void do_timeout ( void *  cls)
static

Task run on timeout.

Triggers shutdown.

Parameters
clsunused

Definition at line 261 of file gnunet-abd.c.

262{
263 tt = NULL;
265}
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:566

References GNUNET_SCHEDULER_shutdown(), and tt.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_intermediate_result()

static void handle_intermediate_result ( void *  cls,
struct GNUNET_ABD_Delegation dd,
bool  is_bw 
)
static

Definition at line 269 of file gnunet-abd.c.

272{
273 const char *prefix = "";
274 if (is_bw)
275 prefix = "Backward -";
276 else
277 prefix = "Forward -";
278
279 printf ("%s Intermediate result: %s.%s <- %s.%s\n",
280 prefix,
285}
static int prefix
If printing the value of PREFIX has been requested.
Definition: gnunet-config.c:66
char * GNUNET_CRYPTO_public_key_to_string(const struct GNUNET_CRYPTO_PublicKey *key)
Creates a (Base32) string representation of the public key.
Definition: crypto_pkey.c:379
struct GNUNET_CRYPTO_PublicKey subject_key
Public key of the subject this attribute was delegated to.
const char * issuer_attribute
The attribute.
const char * subject_attribute
The attribute.
struct GNUNET_CRYPTO_PublicKey issuer_key
The issuer of the delegation.

References GNUNET_CRYPTO_public_key_to_string(), GNUNET_ABD_Delegation::issuer_attribute, GNUNET_ABD_Delegation::issuer_key, prefix, GNUNET_ABD_Delegation::subject_attribute, and GNUNET_ABD_Delegation::subject_key.

Referenced by identity_cb(), and run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_collect_result()

static void handle_collect_result ( void *  cls,
unsigned int  d_count,
struct GNUNET_ABD_Delegation dc,
unsigned int  c_count,
struct GNUNET_ABD_Delegate dele 
)
static

Definition at line 289 of file gnunet-abd.c.

294{
295 int i;
296 char *line;
297
298 verify_request = NULL;
299 if (NULL != dele)
300 {
301 for (i = 0; i < c_count; i++)
302 {
304 printf ("%s\n", line);
306 }
307 }
308 else
309 {
310 printf ("Received NULL\n");
311 }
312
314}
char * GNUNET_ABD_delegate_to_string(const struct GNUNET_ABD_Delegate *cred)
Definition: delegate_misc.c:37
static char * line
Desired phone line (string to be converted to a hash).
#define GNUNET_free(ptr)
Wrapper around free.

References GNUNET_ABD_delegate_to_string(), GNUNET_free, GNUNET_SCHEDULER_shutdown(), line, and verify_request.

Referenced by identity_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_verify_result()

static void handle_verify_result ( void *  cls,
unsigned int  d_count,
struct GNUNET_ABD_Delegation dc,
unsigned int  c_count,
struct GNUNET_ABD_Delegate dele 
)
static

Definition at line 318 of file gnunet-abd.c.

323{
324 int i;
325 char *iss_key;
326 char *sub_key;
327
328 verify_request = NULL;
329 if (NULL == dele)
330 ret = 1;
331 else
332 {
333 printf ("Delegation Chain:\n");
334 for (i = 0; i < d_count; i++)
335 {
337 sub_key = GNUNET_CRYPTO_public_key_to_string (&dc[i].subject_key);
338
339 if (0 != dc[i].subject_attribute_len)
340 {
341 printf ("(%d) %s.%s <- %s.%s\n",
342 i,
343 iss_key,
344 dc[i].issuer_attribute,
345 sub_key,
346 dc[i].subject_attribute);
347 }
348 else
349 {
350 printf ("(%d) %s.%s <- %s\n",
351 i,
352 iss_key,
353 dc[i].issuer_attribute,
354 sub_key);
355 }
356 GNUNET_free (iss_key);
357 GNUNET_free (sub_key);
358 }
359 printf ("\nDelegate(s):\n");
360 for (i = 0; i < c_count; i++)
361 {
363 sub_key = GNUNET_CRYPTO_public_key_to_string (&dele[i].subject_key);
364 printf ("%s.%s <- %s\n", iss_key, dele[i].issuer_attribute, sub_key);
365 GNUNET_free (iss_key);
366 GNUNET_free (sub_key);
367 }
368 printf ("Successful.\n");
369 }
370
372}
static char * issuer_key
Issuer pubkey string.
Definition: gnunet-abd.c:113
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:82
static struct GNUNET_FS_DownloadContext * dc

References dc, GNUNET_CRYPTO_public_key_to_string(), GNUNET_free, GNUNET_SCHEDULER_shutdown(), issuer_key, ret, and verify_request.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ identity_cb()

static void identity_cb ( void *  cls,
struct GNUNET_IDENTITY_Ego ego 
)
static

Callback invoked from identity service with ego information.

An ego of NULL means the ego was not found.

Parameters
clsclosure with the configuration
egoan ego known to identity service, or NULL

Definition at line 383 of file gnunet-abd.c.

384{
385 const struct GNUNET_CRYPTO_PrivateKey *privkey;
386
387 el = NULL;
388 if (NULL == ego)
389 {
390 if (NULL != ego_name)
391 {
392 fprintf (stderr,
393 _ ("Ego `%s' not known to identity service\n"),
394 ego_name);
395 }
397 return;
398 }
399
400 if (GNUNET_YES == collect)
401 {
402
403 if (GNUNET_OK !=
405 &issuer_pkey))
406 {
407 fprintf (stderr,
408 _ ("Issuer public key `%s' is not well-formed\n"),
409 issuer_key);
411 }
413
417 privkey,
418 direction,
420 NULL,
422 NULL);
423 return;
424 }
426}
static struct GNUNET_ABD_Request * collect_request
Handle to collect request.
Definition: gnunet-abd.c:72
static char * issuer_attr
Issuer attribute.
Definition: gnunet-abd.c:123
struct GNUNET_CRYPTO_PublicKey issuer_pkey
Issuer key.
Definition: gnunet-abd.c:107
static int collect
Collect mode.
Definition: gnunet-abd.c:133
static void handle_collect_result(void *cls, unsigned int d_count, struct GNUNET_ABD_Delegation *dc, unsigned int c_count, struct GNUNET_ABD_Delegate *dele)
Definition: gnunet-abd.c:289
static char * ego_name
ego
Definition: gnunet-abd.c:118
enum GNUNET_ABD_AlgoDirectionFlags direction
API enum, filled and passed for collect/verify.
Definition: gnunet-abd.c:173
static void handle_intermediate_result(void *cls, struct GNUNET_ABD_Delegation *dd, bool is_bw)
Definition: gnunet-abd.c:269
struct GNUNET_ABD_Request * GNUNET_ABD_collect(struct GNUNET_ABD_Handle *handle, const struct GNUNET_CRYPTO_PublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_PrivateKey *subject_key, enum GNUNET_ABD_AlgoDirectionFlags direction, GNUNET_ABD_CredentialResultProcessor proc, void *proc_cls, GNUNET_ABD_IntermediateResultProcessor proc2, void *proc2_cls)
Performs attribute collection.
Definition: abd_api.c:423
const struct GNUNET_CRYPTO_PrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
Definition: identity_api.c:517
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_public_key_from_string(const char *str, struct GNUNET_CRYPTO_PublicKey *key)
Parses a (Base32) string representation of the public key.
Definition: crypto_pkey.c:399
@ GNUNET_OK
@ GNUNET_YES
#define _(String)
GNU gettext support macro.
Definition: platform.h:178
A private key for an identity as per LSD0001.

References _, abd, collect, collect_request, direction, ego_name, el, GNUNET_ABD_collect(), GNUNET_CRYPTO_public_key_from_string(), GNUNET_IDENTITY_ego_get_private_key(), GNUNET_OK, GNUNET_SCHEDULER_shutdown(), GNUNET_YES, handle_collect_result(), handle_intermediate_result(), issuer_attr, issuer_key, and issuer_pkey.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_expiration()

static int parse_expiration ( const char *  expirationstring,
int *  etime_is_rel_,
uint64_t *  etime_ 
)
static

Parse expiration time.

Parameters
expirationstringtext to parse
[out]etime_is_relset to GNUNET_YES if time is relative
[out]etimeset to expiration time (abs or rel)
Returns
GNUNET_OK on success

Definition at line 438 of file gnunet-abd.c.

441{
442 // copied from namestore/gnunet-namestore.c
443 struct GNUNET_TIME_Relative etime_rel;
444 struct GNUNET_TIME_Absolute etime_abs;
445
446 if (0 == strcmp (expirationstring, "never"))
447 {
448 *etime_ = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
449 *etime_is_rel_ = GNUNET_NO;
450 return GNUNET_OK;
451 }
452 if (GNUNET_OK ==
454 {
455 *etime_is_rel_ = GNUNET_YES;
456 *etime_ = etime_rel.rel_value_us;
458 "Storing record with relative expiration time of %s\n",
460 return GNUNET_OK;
461 }
462 if (GNUNET_OK ==
464 {
465 *etime_is_rel_ = GNUNET_NO;
466 *etime_ = etime_abs.abs_value_us;
468 "Storing record with absolute expiration time of %s\n",
470 return GNUNET_OK;
471 }
472 return GNUNET_SYSERR;
473}
static char * expirationstring
Optional expiration string -E.
Definition: gnunet-hello.c:72
#define GNUNET_log(kind,...)
@ GNUNET_NO
@ GNUNET_SYSERR
@ GNUNET_ERROR_TYPE_DEBUG
enum GNUNET_GenericReturnValue GNUNET_STRINGS_fancy_time_to_relative(const char *fancy_time, struct GNUNET_TIME_Relative *rtime)
Convert a given fancy human-readable time to our internal representation.
Definition: strings.c:259
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:579
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
Definition: strings.c:640
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
enum GNUNET_GenericReturnValue GNUNET_STRINGS_fancy_time_to_absolute(const char *fancy_time, struct GNUNET_TIME_Absolute *atime)
Convert a given fancy human-readable time to our internal representation.
Definition: strings.c:301
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.

References GNUNET_TIME_Absolute::abs_value_us, expirationstring, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_STRINGS_absolute_time_to_string(), GNUNET_STRINGS_fancy_time_to_absolute(), GNUNET_STRINGS_fancy_time_to_relative(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_SYSERR, GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_YES, and GNUNET_TIME_Relative::rel_value_us.

Referenced by store_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ error_cb()

static void error_cb ( void *  cls)
static

Function called if lookup fails.

Definition at line 480 of file gnunet-abd.c.

481{
482 fprintf (stderr, "Error occurred during lookup, shutting down.\n");
484 return;
485}

References GNUNET_SCHEDULER_shutdown().

Referenced by GNUNET_NAMESTORE_records_lookup(), GNUNET_NAMESTORE_records_lookup2(), GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_NAMESTORE_zone_iteration_start2(), GNUNET_NAMESTORE_zone_monitor_start(), GNUNET_NAMESTORE_zone_monitor_start2(), GNUNET_NAMESTORE_zone_to_name(), GNUNET_PEERSTORE_monitor_start(), GNUNET_RECLAIM_get_attributes_start(), GNUNET_RECLAIM_get_credentials_start(), GNUNET_RECLAIM_ticket_iteration_start(), records_lookup(), and store_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_continuation()

static void add_continuation ( void *  cls,
enum GNUNET_ErrorCode  ec 
)
static

Definition at line 489 of file gnunet-abd.c.

490{
491 struct GNUNET_NAMESTORE_QueueEntry **qe = cls;
492 *qe = NULL;
493
494 if (GNUNET_EC_NONE == ec)
495 printf ("Adding successful.\n");
496 else
497 fprintf (stderr, "Error: `%s'.\n", GNUNET_ErrorCode_get_hint (ec));
498
500}
static struct GNUNET_DATASTORE_QueueEntry * qe
Current operation.
const char * GNUNET_ErrorCode_get_hint(enum GNUNET_ErrorCode ec)
Returns a hint for a given error code.
@ GNUNET_EC_NONE
No error (success).
An QueueEntry used to store information for a pending NAMESTORE record operation.
Definition: namestore_api.c:49

References GNUNET_EC_NONE, GNUNET_ErrorCode_get_hint(), GNUNET_SCHEDULER_shutdown(), and qe.

Referenced by get_existing_record().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_existing_record()

static void get_existing_record ( void *  cls,
const struct GNUNET_CRYPTO_PrivateKey zone_key,
const char *  rec_name,
unsigned int  rd_count,
const struct GNUNET_GNSRECORD_Data rd 
)
static

Definition at line 504 of file gnunet-abd.c.

509{
510 struct GNUNET_GNSRECORD_Data *rde;
511 struct GNUNET_GNSRECORD_Data*rdn =
512 GNUNET_malloc (sizeof(*rdn) * (rd_count + 1));
513
514 memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data));
515 GNUNET_memcpy (&rdn[1], rd,
516 rd_count * sizeof (struct GNUNET_GNSRECORD_Data));
517 rde = &rdn[0];
518 rde->data = data;
519 rde->data_size = data_size;
520 rde->record_type = type;
521
522 // Set flags
523 if (GNUNET_YES == is_private)
525 rde->expiration_time = etime;
528 else if (GNUNET_NO != etime_is_rel)
530
531 GNUNET_assert (NULL != rec_name);
533 &zone_pkey,
534 rec_name,
535 rd_count + 1,
536 rde,
538 &add_qe);
539 GNUNET_free (rdn);
540 return;
541}
static struct GNUNET_CRYPTO_PrivateKey zone_pkey
Private key for the our zone.
Definition: gnunet-abd.c:47
static int is_private
Is record private.
Definition: gnunet-abd.c:158
static void * data
Value in binary format.
Definition: gnunet-abd.c:183
static void add_continuation(void *cls, enum GNUNET_ErrorCode ec)
Definition: gnunet-abd.c:489
static int etime_is_rel
Is expiration time relative or absolute time?
Definition: gnunet-abd.c:207
static uint32_t type
Type string converted to DNS type value.
Definition: gnunet-abd.c:193
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:188
static uint64_t etime
Expiration string converted to numeric value.
Definition: gnunet-abd.c:202
static unsigned int rd_count
Number of records for currently parsed set.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
@ GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION
This expiration time of the record is a relative time (not an absolute time).
@ GNUNET_GNSRECORD_RF_PRIVATE
This is a private record of this peer and it should thus not be published.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_malloc(size)
Wrapper around malloc.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_record_set_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Store an item in the namestore.
uint32_t record_type
Type of the GNS/DNS record.
const void * data
Binary value stored in the DNS record.
size_t data_size
Number of bytes in data.
enum GNUNET_GNSRECORD_Flags flags
Flags for the record.
uint64_t expiration_time
Expiration time for the DNS record.

References add_continuation(), add_qe, data, GNUNET_GNSRECORD_Data::data, data_size, GNUNET_GNSRECORD_Data::data_size, etime, etime_is_rel, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_Data::flags, GNUNET_assert, GNUNET_free, GNUNET_GNSRECORD_RF_PRIVATE, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_malloc, GNUNET_memcpy, GNUNET_NAMESTORE_record_set_store(), GNUNET_NO, GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_YES, is_private, ns, rd, rd_count, GNUNET_GNSRECORD_Data::record_type, type, and zone_pkey.

Referenced by store_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ store_cb()

static void store_cb ( void *  cls,
struct GNUNET_IDENTITY_Ego ego 
)
static

Definition at line 545 of file gnunet-abd.c.

546{
547 const struct GNUNET_CONFIGURATION_Handle *cfg_ = cls;
549 struct GNUNET_CRYPTO_PublicKey zone_pubkey;
550 char *subject_pubkey_str;
551 char *zone_pubkey_str;
552
553 el = NULL;
554
556 if (NULL == ns)
557 {
559 _ ("Failed to connect to namestore\n"));
561 return;
562 }
563
564 if (NULL == ego)
565 {
567 _ ("Ego does not exist!\n"));
569 return;
570 }
571
572 // Key handling
574
576 {
577 // Parse import
579
580 if (NULL == cred)
581 {
582 fprintf (stderr,
583 "%s is not a valid credential\n", import);
585 return;
586 }
587
588 // Get import subject public key string
589 subject_pubkey_str =
591
592 // Get zone public key string
593 GNUNET_IDENTITY_ego_get_public_key (ego, &zone_pubkey);
594 zone_pubkey_str =
596
597 // Check if the subject key in the signed import matches the zone's key it is issued to
598 if (strcmp (zone_pubkey_str, subject_pubkey_str) != 0)
599 {
600 fprintf (stderr,
601 "Import signed delegate does not match this ego's public key.\n")
602 ;
605 return;
606 }
607
608 // Expiration
609 etime = cred->expiration.abs_value_us;
611
612 // Prepare the data to be store in the record
615 }
616 else
617 {
618 // For all other types e.g. GNUNET_GNSRECORD_TYPE_ATTRIBUTE
619 if (GNUNET_OK !=
621 {
622 if (typestring == NULL)
623 {
624 fputs ("Value for unknown record type not well-formed.\n", stderr);
625 }
626 else if (subject == NULL)
627 {
628 fprintf (stderr,
629 "Value for record type `%s' not well-formed.\n",
630 typestring);
631 }
632 else
633 {
634 fprintf (stderr,
635 "Value `%s' invalid for record type `%s'\n",
636 subject,
637 typestring);
638 }
640 return;
641 }
642
643 // Take care of expiration
644 if (NULL == expiration)
645 {
646 fprintf (stderr, "Missing option -e for operation 'create'\n");
648 return;
649 }
651 {
652 fprintf (stderr, "Invalid time format `%s'\n", expiration);
654 return;
655 }
656 }
657
658 // Start lookup
660 &zone_pkey,
662 &error_cb,
663 NULL,
665 NULL);
666 return;
667}
int GNUNET_ABD_delegate_serialize(struct GNUNET_ABD_Delegate *dele, char **data)
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_from_string(const char *s)
Definition: delegate_misc.c:82
static const char * record_label
Record label for storing delegations.
Definition: gnunet-abd.c:212
static char * expiration
Credential TTL.
Definition: gnunet-abd.c:97
static int parse_expiration(const char *expirationstring, int *etime_is_rel_, uint64_t *etime_)
Parse expiration time.
Definition: gnunet-abd.c:438
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:480
static char * subject
Subject pubkey string.
Definition: gnunet-abd.c:87
static void get_existing_record(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *rec_name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Definition: gnunet-abd.c:504
static char * typestring
Type of the record to add/remove, NULL to remove all.
Definition: gnunet-abd.c:198
static gnutls_certificate_credentials_t cred
The credential.
int GNUNET_GNSRECORD_string_to_value(uint32_t type, const char *s, void **data, size_t *data_size)
Convert human-readable version of the value s of a record of type type to the respective binary repre...
Definition: gnsrecord.c:177
void GNUNET_IDENTITY_ego_get_public_key(struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_CRYPTO_PublicKey *pk)
Get the identifier (public key) of an ego.
Definition: identity_api.c:529
@ GNUNET_ERROR_TYPE_ERROR
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_cls)
Lookup an item in the namestore.
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
#define GNUNET_GNSRECORD_TYPE_DELEGATE
For ABD policies.
An identity key as per LSD0001.

References _, add_qe, cred, data, data_size, el, error_cb(), etime, etime_is_rel, expiration, get_existing_record(), GNUNET_ABD_delegate_from_string(), GNUNET_ABD_delegate_serialize(), GNUNET_CRYPTO_public_key_to_string(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_string_to_value(), GNUNET_GNSRECORD_TYPE_DELEGATE, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_IDENTITY_ego_get_public_key(), GNUNET_log, GNUNET_NAMESTORE_connect(), GNUNET_NAMESTORE_records_lookup(), GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_shutdown(), ns, parse_expiration(), record_label, subject, type, typestring, and zone_pkey.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sign_cb()

static void sign_cb ( void *  cls,
struct GNUNET_IDENTITY_Ego ego 
)
static

Definition at line 671 of file gnunet-abd.c.

672{
673 const struct GNUNET_CRYPTO_PrivateKey *privkey;
674 struct GNUNET_ABD_Delegate *dele;
675 struct GNUNET_TIME_Absolute etime_abs;
676 char *res;
677 char *subject_pubkey_str;
678 char *subject_attr = NULL;
679 char *token;
680
681 el = NULL;
682
683 // work on expiration time
684 if (NULL == expiration)
685 {
686 fprintf (stderr, "Please specify a TTL\n");
688 return;
689 }
690 else if (GNUNET_OK !=
692 {
693 fprintf (stderr,
694 "%s is not a valid ttl! Only absolute times are accepted!\n",
695 expiration);
697 return;
698 }
699
700 // If contains a space - split it by the first space only - assume first entry is subject followed by attribute(s)
701
702 // Subject Public Key
703 token = strtok (subject, " ");
704 subject_pubkey_str = token;
705 // Subject Attribute(s)
706 token = strtok (NULL, " ");
707 if (NULL != token)
708 {
709 subject_attr = token;
710 }
711
712 // work on keys
714
715 if (NULL == subject_pubkey_str)
716 {
717 fprintf (stderr,
718 "Subject pubkey not given\n");
720 return;
721 }
722 if (GNUNET_OK !=
723 GNUNET_CRYPTO_public_key_from_string (subject_pubkey_str,
724 &subject_pkey))
725 {
726 fprintf (stderr,
727 "Subject public key `%s' is not well-formed\n",
728 subject_pubkey_str);
730 return;
731 }
732
733 // Sign delegate
734 dele = GNUNET_ABD_delegate_issue (privkey,
737 subject_attr,
738 &etime_abs);
740 GNUNET_free (dele);
741 printf ("%s\n", res);
742
744 ego_name = NULL;
745
747}
struct GNUNET_CRYPTO_PublicKey subject_pkey
Subject key.
Definition: gnunet-abd.c:102
static char * res
Currently read line or NULL on EOF.
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_issue(const struct GNUNET_CRYPTO_PrivateKey *issuer, struct GNUNET_CRYPTO_PublicKey *subject, const char *iss_attr, const char *sub_attr, struct GNUNET_TIME_Absolute *expiration)
Issue an attribute to a subject.

References ego_name, el, expiration, GNUNET_ABD_delegate_issue(), GNUNET_ABD_delegate_to_string(), GNUNET_CRYPTO_public_key_from_string(), GNUNET_free, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_OK, GNUNET_SCHEDULER_shutdown(), GNUNET_STRINGS_fancy_time_to_absolute(), issuer_attr, res, subject, and subject_pkey.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

static void run ( void *  cls,
char *const *  args,
const char *  cfgfile,
const struct GNUNET_CONFIGURATION_Handle c 
)
static

Main function that will be run.

Parameters
clsclosure
argsremaining command-line arguments
cfgfilename of the configuration file used (for saving, can be NULL!)
cconfiguration

Definition at line 759 of file gnunet-abd.c.

763{
764 cfg = c;
765
768
769 // Check relevant cmdline parameters
770 if (GNUNET_YES == create_is)
771 {
772 if (NULL == ego_name)
773 {
774 fprintf (stderr, "Missing option '-ego'\n");
776 return;
777 }
778 if (NULL == issuer_attr)
779 {
780 fprintf (stderr, "Missing option '-attribute' for issuer attribute\n");
782 return;
783 }
784 if (NULL == subject)
785 {
786 fprintf (stderr, "Missing option -subject for operation 'create'.'\n");
788 return;
789 }
790
791 // Lookup ego, on success call store_cb and store as ATTRIBUTE type
795 return;
796 }
797
798 if (GNUNET_YES == create_ss)
799 {
800
801 // check if signed parameter has been passed in cmd line call
802 if (NULL == import)
803 {
804 fprintf (stderr, "'import' required\n");
806 return;
807 }
808
811 // Store subject side
813
814 return;
815 }
816
817 if (GNUNET_YES == sign_ss)
818 {
819 if (NULL == ego_name)
820 {
821 fprintf (stderr, "ego required\n");
823 return;
824 }
825 if (NULL == subject)
826 {
827 fprintf (stderr, "Subject public key needed\n");
829 return;
830 }
831
832 // lookup ego and call function sign_cb on success
834 return;
835 }
836
837 if ((GNUNET_NO == forward) && (GNUNET_NO == backward))
838 {
839 // set default: bidirectional
842 }
843 if (GNUNET_YES == forward)
845 if (GNUNET_YES == backward)
847
848 if (GNUNET_YES == collect)
849 {
850 if (NULL == issuer_key)
851 {
852 fprintf (stderr, _ ("Issuer public key not well-formed\n"));
854 return;
855 }
856
858
859 if (NULL == abd)
860 {
861 fprintf (stderr, _ ("Failed to connect to ABD\n"));
863 return;
864 }
865 if (NULL == issuer_attr)
866 {
867 fprintf (stderr, _ ("You must provide issuer the attribute\n"));
869 return;
870 }
871
872 if (NULL == ego_name)
873 {
874 fprintf (stderr, _ ("ego required\n"));
876 return;
877 }
879 return;
880 }
881
882 if (NULL == subject)
883 {
884 fprintf (stderr, _ ("Subject public key needed\n"));
886 return;
887 }
889 &subject_pkey))
890 {
891 fprintf (stderr,
892 _ ("Subject public key `%s' is not well-formed\n"),
893 subject);
895 return;
896 }
897
898 if (GNUNET_YES == verify)
899 {
900 if (NULL == issuer_key)
901 {
902 fprintf (stderr, _ ("Issuer public key not well-formed\n"));
904 return;
905 }
906 if (GNUNET_OK !=
908 &issuer_pkey))
909 {
910 fprintf (stderr,
911 _ ("Issuer public key `%s' is not well-formed\n"),
912 issuer_key);
914 return;
915 }
917
918 if (NULL == abd)
919 {
920 fprintf (stderr, _ ("Failed to connect to ABD\n"));
922 return;
923 }
924 if ((NULL == issuer_attr) || (NULL == subject_delegate))
925 {
926 fprintf (stderr, _ ("You must provide issuer and subject attributes\n"));
928 return;
929 }
930
931 // Subject credentials are comma separated
932 {
933 struct GNUNET_ABD_Delegate *delegates;
934 struct GNUNET_ABD_Delegate *dele;
935 char *tmp = GNUNET_strdup (subject_delegate);
936 char *tok = strtok (tmp, ",");
937 int count = 1;
938 int i;
939 if (NULL == tok)
940 {
941 fprintf (stderr, "Invalid subject credentials\n");
942 GNUNET_free (tmp);
944 return;
945 }
946 while (NULL != (tok = strtok (NULL, ",")))
947 count++;
948 delegates = GNUNET_malloc (sizeof(*delegates) * count);
949 GNUNET_free (tmp);
951 tok = strtok (tmp, ",");
952 for (i = 0; i < count; i++)
953 {
955 GNUNET_memcpy (&delegates[i],
956 dele,
957 sizeof (struct GNUNET_ABD_Delegate));
958 delegates[i].issuer_attribute = GNUNET_strdup (dele->issuer_attribute);
959 tok = strtok (NULL, ",");
960 GNUNET_free (dele);
961 }
962
967 count,
968 delegates,
969 direction,
971 NULL,
973 NULL);
974 for (i = 0; i < count; i++)
975 {
976 GNUNET_free_nz ((char *) delegates[i].issuer_attribute);
977 delegates[i].issuer_attribute = NULL;
978 }
979 GNUNET_free (tmp);
980 GNUNET_free (delegates);
981 }
982 }
983 else
984 {
985 fprintf (stderr,
986 _ (
987 "Please specify name to lookup, subject key and issuer key!\n"));
989 }
990 return;
991}
static void handle_verify_result(void *cls, unsigned int d_count, struct GNUNET_ABD_Delegation *dc, unsigned int c_count, struct GNUNET_ABD_Delegate *dele)
Definition: gnunet-abd.c:318
static int create_ss
Create mode.
Definition: gnunet-abd.c:143
static int create_is
Create mode.
Definition: gnunet-abd.c:138
static void identity_cb(void *cls, struct GNUNET_IDENTITY_Ego *ego)
Callback invoked from identity service with ego information.
Definition: gnunet-abd.c:383
static char * subject_delegate
Subject delegate string.
Definition: gnunet-abd.c:92
static void do_timeout(void *cls)
Task run on timeout.
Definition: gnunet-abd.c:261
static void sign_cb(void *cls, struct GNUNET_IDENTITY_Ego *ego)
Definition: gnunet-abd.c:671
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:37
static int sign_ss
Create mode.
Definition: gnunet-abd.c:148
static void store_cb(void *cls, struct GNUNET_IDENTITY_Ego *ego)
Definition: gnunet-abd.c:545
static void do_shutdown(void *cls)
Task run on shutdown.
Definition: gnunet-abd.c:220
static int backward
Search direction: backward.
Definition: gnunet-abd.c:168
static int verify
Verify mode.
Definition: gnunet-abd.c:128
static int forward
Search direction: forward.
Definition: gnunet-abd.c:163
static struct GNUNET_TIME_Relative timeout
Desired timeout for the lookup (default is no timeout).
Definition: gnunet-abd.c:62
struct GNUNET_ABD_Handle * GNUNET_ABD_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the connection with the ABD service.
Definition: abd_api.c:354
struct GNUNET_ABD_Request * GNUNET_ABD_verify(struct GNUNET_ABD_Handle *handle, const struct GNUNET_CRYPTO_PublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_PublicKey *subject_key, uint32_t delegate_count, const struct GNUNET_ABD_Delegate *delegates, enum GNUNET_ABD_AlgoDirectionFlags direction, GNUNET_ABD_CredentialResultProcessor proc, void *proc_cls, GNUNET_ABD_IntermediateResultProcessor proc2, void *proc2_cls)
Performs attribute verification.
Definition: abd_api.c:497
@ GNUNET_ABD_FLAG_BACKWARD
@ GNUNET_ABD_FLAG_FORWARD
#define GNUNET_GNS_EMPTY_LABEL_AT
String we use to indicate an empty label (top-level entry in the zone).
struct GNUNET_IDENTITY_EgoLookup * GNUNET_IDENTITY_ego_lookup(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *name, GNUNET_IDENTITY_EgoCallback cb, void *cb_cls)
Lookup an ego by name.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_free_nz(ptr)
Wrapper around free.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
Definition: scheduler.c:1338
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1276
#define GNUNET_GNSRECORD_TYPE_ATTRIBUTE
For ABD reverse lookups.
const char * issuer_attribute
The issuer attribute.

References _, abd, backward, cfg, collect, create_is, create_ss, direction, do_shutdown(), do_timeout(), ego_name, el, forward, GNUNET_ABD_connect(), GNUNET_ABD_delegate_from_string(), GNUNET_ABD_FLAG_BACKWARD, GNUNET_ABD_FLAG_FORWARD, GNUNET_ABD_verify(), GNUNET_CRYPTO_public_key_from_string(), GNUNET_free, GNUNET_free_nz, GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNSRECORD_TYPE_ATTRIBUTE, GNUNET_GNSRECORD_TYPE_DELEGATE, GNUNET_IDENTITY_ego_lookup(), GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_strdup, GNUNET_YES, handle_intermediate_result(), handle_verify_result(), identity_cb(), issuer_attr, GNUNET_ABD_Delegate::issuer_attribute, issuer_key, issuer_pkey, record_label, sign_cb(), sign_ss, store_cb(), subject, subject_delegate, subject_pkey, timeout, tt, type, verify, and verify_request.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *const *  argv 
)

The main function for gnunet-gns.

Parameters
argcnumber of arguments from the command line
argvcommand line arguments
Returns
0 ok, 1 on error

Definition at line 1002 of file gnunet-abd.c.

1003{
1006 "verify",
1007 gettext_noop (
1008 "verify credential against attribute"),
1009 &verify),
1011 's',
1012 "subject",
1013 "PKEY",
1014 gettext_noop (
1015 "The public key of the subject to lookup the"
1016 "credential for, or for issuer side storage: subject and its attributes")
1017 ,
1018 &subject),
1020 'd',
1021 "delegate",
1022 "DELE",
1023 gettext_noop ("The private, signed delegate presented by the subject"),
1026 'i',
1027 "issuer",
1028 "PKEY",
1029 gettext_noop (
1030 "The public key of the authority to verify the credential against"),
1031 &issuer_key),
1033 "ego",
1034 "EGO",
1035 gettext_noop ("The ego/zone name to use"),
1036 &ego_name),
1038 'a',
1039 "attribute",
1040 "ATTR",
1041 gettext_noop ("The issuer attribute to verify against or to issue"),
1042 &issuer_attr),
1044 "ttl",
1045 "EXP",
1046 gettext_noop (
1047 "The time to live for the credential."
1048 "e.g. 5m, 6h, \"1990-12-30 12:00:00\""),
1049 &expiration),
1051 "collect",
1052 gettext_noop ("collect credentials"),
1053 &collect),
1055 "createIssuerSide",
1056 gettext_noop (
1057 "Create and issue a credential issuer side."),
1058 &create_is),
1060 "createSubjectSide",
1061 gettext_noop (
1062 "Issue a credential subject side."),
1063 &create_ss),
1065 'S',
1066 "signSubjectSide",
1067 gettext_noop ("Create, sign and return a credential subject side."),
1068 &sign_ss),
1070 'x',
1071 "import",
1072 "IMP",
1073 gettext_noop (
1074 "Import signed credentials that should be issued to a zone/ego"),
1075 &import),
1077 "private",
1078 gettext_noop ("Create private record entry."),
1079 &is_private),
1081 'F',
1082 "forward",
1083 gettext_noop (
1084 "Indicates that the collect/verify process is done via forward search."),
1085 &forward),
1087 'B',
1088 "backward",
1089 gettext_noop (
1090 "Indicates that the collect/verify process is done via forward search."),
1091 &backward),
1093
1094
1096 GNUNET_log_setup ("gnunet-abd", "WARNING", NULL);
1097 if (GNUNET_OK != GNUNET_PROGRAM_run (argc,
1098 argv,
1099 "gnunet-abd",
1100 _ ("GNUnet abd resolver tool"),
1101 options,
1102 &run,
1103 NULL))
1104 ret = 1;
1105 return ret;
1106}
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
#define gettext_noop(String)
Definition: gettext.h:74
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
Main function that will be run.
Definition: gnunet-abd.c:759
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
enum GNUNET_GenericReturnValue GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile)
Setup logging.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
Definition: program.c:400
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
Definition of a command line option.

References _, backward, collect, create_is, create_ss, ego_name, expiration, forward, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_log_setup(), GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_TIME_UNIT_FOREVER_REL, is_private, issuer_attr, issuer_key, options, ret, run(), sign_ss, subject, subject_delegate, timeout, and verify.

Here is the call graph for this function:

Variable Documentation

◆ cfg

const struct GNUNET_CONFIGURATION_Handle* cfg
static

Configuration we are using.

Definition at line 37 of file gnunet-abd.c.

Referenced by run().

◆ ns

struct GNUNET_NAMESTORE_Handle* ns
static

Handle to the namestore.

Definition at line 42 of file gnunet-abd.c.

Referenced by do_shutdown(), get_existing_record(), and store_cb().

◆ zone_pkey

struct GNUNET_CRYPTO_PrivateKey zone_pkey
static

Private key for the our zone.

Definition at line 47 of file gnunet-abd.c.

Referenced by get_existing_record(), and store_cb().

◆ el

struct GNUNET_IDENTITY_EgoLookup* el
static

EgoLookup.

Definition at line 52 of file gnunet-abd.c.

Referenced by do_shutdown(), identity_cb(), run(), sign_cb(), and store_cb().

◆ abd

struct GNUNET_ABD_Handle* abd
static

Handle to Credential service.

Definition at line 57 of file gnunet-abd.c.

Referenced by do_shutdown(), identity_cb(), and run().

◆ timeout

struct GNUNET_TIME_Relative timeout
static

Desired timeout for the lookup (default is no timeout).

Definition at line 62 of file gnunet-abd.c.

Referenced by main(), and run().

◆ verify_request

struct GNUNET_ABD_Request* verify_request
static

Handle to verify request.

Definition at line 67 of file gnunet-abd.c.

Referenced by do_shutdown(), handle_collect_result(), handle_verify_result(), and run().

◆ collect_request

struct GNUNET_ABD_Request* collect_request
static

Handle to collect request.

Definition at line 72 of file gnunet-abd.c.

Referenced by identity_cb().

◆ tt

struct GNUNET_SCHEDULER_Task* tt
static

Task scheduled to handle timeout.

Definition at line 77 of file gnunet-abd.c.

Referenced by do_shutdown(), do_timeout(), and run().

◆ ret

int ret = 0
static

Return value of the commandline.

Definition at line 82 of file gnunet-abd.c.

Referenced by handle_verify_result(), and main().

◆ subject

char* subject
static

◆ subject_delegate

char* subject_delegate
static

Subject delegate string.

Definition at line 92 of file gnunet-abd.c.

Referenced by main(), and run().

◆ expiration

char* expiration
static

Credential TTL.

Definition at line 97 of file gnunet-abd.c.

Referenced by main(), sign_cb(), and store_cb().

◆ subject_pkey

◆ issuer_pkey

struct GNUNET_CRYPTO_PublicKey issuer_pkey

Issuer key.

Definition at line 107 of file gnunet-abd.c.

Referenced by GNUNET_ABD_delegate_from_string(), GNUNET_ABD_delegate_to_string(), identity_cb(), and run().

◆ issuer_key

char* issuer_key
static

Issuer pubkey string.

Definition at line 113 of file gnunet-abd.c.

Referenced by GNUNET_ABD_collect(), GNUNET_ABD_verify(), handle_verify_result(), identity_cb(), main(), and run().

◆ ego_name

char* ego_name
static

ego

Definition at line 118 of file gnunet-abd.c.

Referenced by identity_cb(), main(), run(), and sign_cb().

◆ issuer_attr

char* issuer_attr
static

Issuer attribute.

Definition at line 123 of file gnunet-abd.c.

Referenced by identity_cb(), main(), run(), and sign_cb().

◆ verify

int verify
static

Verify mode.

Definition at line 128 of file gnunet-abd.c.

Referenced by check_ssl_certificate(), get_store_peer_of(), main(), run(), and verify_store_peer().

◆ collect

int collect
static

Collect mode.

Definition at line 133 of file gnunet-abd.c.

Referenced by identity_cb(), main(), and run().

◆ create_is

int create_is
static

Create mode.

Definition at line 138 of file gnunet-abd.c.

Referenced by main(), and run().

◆ create_ss

int create_ss
static

Create mode.

Definition at line 143 of file gnunet-abd.c.

Referenced by main(), and run().

◆ sign_ss

int sign_ss
static

Create mode.

Definition at line 148 of file gnunet-abd.c.

Referenced by main(), and run().

◆ import

char* import
static

Signed issue credentials.

Definition at line 153 of file gnunet-abd.c.

◆ is_private

int is_private
static

Is record private.

Definition at line 158 of file gnunet-abd.c.

Referenced by get_existing_record(), and main().

◆ forward

int forward
static

Search direction: forward.

Definition at line 163 of file gnunet-abd.c.

Referenced by main(), request_room_message_step(), and run().

◆ backward

int backward
static

Search direction: backward.

Definition at line 168 of file gnunet-abd.c.

Referenced by main(), and run().

◆ direction

enum GNUNET_ABD_AlgoDirectionFlags direction = 0

API enum, filled and passed for collect/verify.

Definition at line 173 of file gnunet-abd.c.

Referenced by check_get(), GNUNET_ABD_collect(), GNUNET_ABD_verify(), handle_get(), identity_cb(), and run().

◆ add_qe

struct GNUNET_NAMESTORE_QueueEntry* add_qe
static

Queue entry for the 'add' operation.

Definition at line 178 of file gnunet-abd.c.

Referenced by do_shutdown(), get_existing_record(), and store_cb().

◆ data

void* data
static

Value in binary format.

Definition at line 183 of file gnunet-abd.c.

Referenced by get_existing_record(), and store_cb().

◆ data_size

size_t data_size
static

Number of bytes in data.

Definition at line 188 of file gnunet-abd.c.

Referenced by get_existing_record(), and store_cb().

◆ type

uint32_t type
static

Type string converted to DNS type value.

Definition at line 193 of file gnunet-abd.c.

Referenced by get_existing_record(), run(), and store_cb().

◆ typestring

char* typestring
static

Type of the record to add/remove, NULL to remove all.

Definition at line 198 of file gnunet-abd.c.

Referenced by store_cb().

◆ etime

uint64_t etime
static

Expiration string converted to numeric value.

Definition at line 202 of file gnunet-abd.c.

Referenced by get_existing_record(), and store_cb().

◆ etime_is_rel

int etime_is_rel = GNUNET_SYSERR
static

Is expiration time relative or absolute time?

Definition at line 207 of file gnunet-abd.c.

Referenced by get_existing_record(), and store_cb().

◆ record_label

const char* record_label
static

Record label for storing delegations.

Definition at line 212 of file gnunet-abd.c.

Referenced by run(), and store_cb().