GNUnet  0.11.x
Functions | Variables
gnunet-abd.c File Reference

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

#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, const 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, int32_t success, const char *emsg)
 
static void get_existing_record (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, const char *rec_name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
 
static void store_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
 
static void sign_cb (void *cls, const 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_EcdsaPrivateKey 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_EcdsaPublicKey subject_pkey
 Subject key. More...
 
struct GNUNET_CRYPTO_EcdsaPublicKey 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 int key_length = 52
 Fixed size of the public/private keys. More...
 
static 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 224 of file gnunet-abd.c.

References GNUNET_ABD_disconnect(), GNUNET_ABD_request_cancel(), GNUNET_IDENTITY_ego_lookup_cancel(), GNUNET_NAMESTORE_cancel(), GNUNET_NAMESTORE_disconnect(), and GNUNET_SCHEDULER_cancel().

Referenced by run().

225 {
226  if (NULL != verify_request)
227  {
229  verify_request = NULL;
230  }
231  if (NULL != abd)
232  {
234  abd = NULL;
235  }
236  if (NULL != tt)
237  {
239  tt = NULL;
240  }
241  if (NULL != el)
242  {
244  el = NULL;
245  }
246  if (NULL != add_qe)
247  {
249  add_qe = NULL;
250  }
251  if (NULL != ns)
252  {
254  ns = NULL;
255  }
256 }
void GNUNET_IDENTITY_ego_lookup_cancel(struct GNUNET_IDENTITY_EgoLookup *el)
Abort ego lookup attempt.
static struct GNUNET_SCHEDULER_Task * tt
Task scheduled to handle timeout.
Definition: gnunet-abd.c:76
void GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe)
Cancel a namestore operation.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
Definition: gnunet-abd.c:41
static struct GNUNET_ABD_Handle * abd
Handle to Credential service.
Definition: gnunet-abd.c:56
void GNUNET_ABD_request_cancel(struct GNUNET_ABD_Request *lr)
Cancel pending verify request.
Definition: abd_api.c:395
static struct GNUNET_NAMESTORE_QueueEntry * add_qe
Queue entry for the &#39;add&#39; operation.
Definition: gnunet-abd.c:177
static struct GNUNET_ABD_Request * verify_request
Handle to verify request.
Definition: gnunet-abd.c:66
void GNUNET_ABD_disconnect(struct GNUNET_ABD_Handle *handle)
Shutdown connection with the ABD service.
Definition: abd_api.c:372
static struct GNUNET_IDENTITY_EgoLookup * el
EgoLookup.
Definition: gnunet-abd.c:51
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:966
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 265 of file gnunet-abd.c.

References GNUNET_SCHEDULER_shutdown().

Referenced by run().

266 {
267  tt = NULL;
269 }
static struct GNUNET_SCHEDULER_Task * tt
Task scheduled to handle timeout.
Definition: gnunet-abd.c:76
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:526
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 272 of file gnunet-abd.c.

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

Referenced by identity_cb(), and run().

275 {
276  char *prefix = "";
277  if(is_bw)
278  prefix = "Backward -";
279  else
280  prefix = "Forward -";
281 
282  printf ("%s Intermediate result: %s.%s <- %s.%s\n",
283  prefix,
285  dd->issuer_attribute,
287  dd->subject_attribute);
288 }
struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key
The issuer of the delegation.
char * GNUNET_CRYPTO_ecdsa_public_key_to_string(const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Convert a public key to a string.
Definition: crypto_ecc.c:332
const char * subject_attribute
The attribute.
struct GNUNET_CRYPTO_EcdsaPublicKey subject_key
Public key of the subject this attribute was delegated to.
const char * issuer_attribute
The attribute.
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 291 of file gnunet-abd.c.

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

Referenced by identity_cb().

296 {
297  int i;
298  char *line;
299 
300  verify_request = NULL;
301  if (NULL != dele)
302  {
303  for (i = 0; i < c_count; i++)
304  {
305  line = GNUNET_ABD_delegate_to_string (&dele[i]);
306  printf ("%s\n", line);
307  GNUNET_free (line);
308  }
309  }
310  else
311  {
312  printf ("Received NULL\n");
313  }
314 
316 }
char * GNUNET_ABD_delegate_to_string(const struct GNUNET_ABD_Delegate *cred)
Definition: delegate_misc.c:37
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:526
static char * line
Desired phone line (string to be converted to a hash).
static struct GNUNET_ABD_Request * verify_request
Handle to verify request.
Definition: gnunet-abd.c:66
#define GNUNET_free(ptr)
Wrapper around free.
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 320 of file gnunet-abd.c.

References GNUNET_CRYPTO_ecdsa_public_key_to_string(), GNUNET_free, GNUNET_SCHEDULER_shutdown(), issuer_key, and ret.

Referenced by run().

325 {
326  int i;
327  char *iss_key;
328  char *sub_key;
329 
330  verify_request = NULL;
331  if (NULL == dele)
332  ret = 1;
333  else
334  {
335  printf ("Delegation Chain:\n");
336  for (i = 0; i < d_count; i++)
337  {
339  sub_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&dc[i].subject_key);
340 
341  if (0 != dc[i].subject_attribute_len)
342  {
343  printf ("(%d) %s.%s <- %s.%s\n",
344  i,
345  iss_key,
346  dc[i].issuer_attribute,
347  sub_key,
348  dc[i].subject_attribute);
349  }
350  else
351  {
352  printf ("(%d) %s.%s <- %s\n",
353  i,
354  iss_key,
355  dc[i].issuer_attribute,
356  sub_key);
357  }
358  GNUNET_free (iss_key);
359  GNUNET_free (sub_key);
360  }
361  printf ("\nDelegate(s):\n");
362  for (i = 0; i < c_count; i++)
363  {
365  sub_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&dele[i].subject_key);
366  printf ("%s.%s <- %s\n", iss_key, dele[i].issuer_attribute, sub_key);
367  GNUNET_free (iss_key);
368  GNUNET_free (sub_key);
369  }
370  printf ("Successful.\n");
371  }
372 
374 }
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:526
char * GNUNET_CRYPTO_ecdsa_public_key_to_string(const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Convert a public key to a string.
Definition: crypto_ecc.c:332
static char * issuer_key
Issuer pubkey string.
Definition: gnunet-abd.c:112
static struct GNUNET_ABD_Request * verify_request
Handle to verify request.
Definition: gnunet-abd.c:66
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ identity_cb()

static void identity_cb ( void *  cls,
const 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 384 of file gnunet-abd.c.

References _, collect, direction, ego_name, GNUNET_ABD_collect(), GNUNET_CRYPTO_ecdsa_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().

385 {
386  const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
387 
388  el = NULL;
389  if (NULL == ego)
390  {
391  if (NULL != ego_name)
392  {
393  fprintf (stderr,
394  _ ("Ego `%s' not known to identity service\n"),
395  ego_name);
396  }
398  return;
399  }
400 
401  if (GNUNET_YES == collect)
402  {
403 
404  if (GNUNET_OK !=
406  strlen (issuer_key),
407  &issuer_pkey))
408  {
409  fprintf (stderr,
410  _ ("Issuer public key `%s' is not well-formed\n"),
411  issuer_key);
413  }
414  privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
415 
417  &issuer_pkey,
418  issuer_attr,
419  privkey,
420  direction,
422  NULL,
424  NULL);
425  return;
426  }
428 }
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:291
static void handle_intermediate_result(void *cls, struct GNUNET_ABD_Delegation *dd, bool is_bw)
Definition: gnunet-abd.c:272
const struct GNUNET_CRYPTO_EcdsaPrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
Definition: identity_api.c:555
struct GNUNET_ABD_Request * GNUNET_ABD_collect(struct GNUNET_ABD_Handle *handle, const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_EcdsaPrivateKey *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:419
struct GNUNET_CRYPTO_EcdsaPublicKey issuer_pkey
Issuer key.
Definition: gnunet-abd.c:106
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
Private ECC key encoded for transmission.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:526
enum GNUNET_ABD_AlgoDirectionFlags direction
API enum, filled and passed for collect/verify.
Definition: gnunet-abd.c:172
#define _(String)
GNU gettext support macro.
Definition: platform.h:181
static char * issuer_key
Issuer pubkey string.
Definition: gnunet-abd.c:112
static int collect
Collect mode.
Definition: gnunet-abd.c:132
static struct GNUNET_ABD_Request * collect_request
Handle to collect request.
Definition: gnunet-abd.c:71
static struct GNUNET_ABD_Handle * abd
Handle to Credential service.
Definition: gnunet-abd.c:56
int GNUNET_CRYPTO_ecdsa_public_key_from_string(const char *enc, size_t enclen, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Convert a string representing a public key to a public key.
Definition: crypto_ecc.c:466
#define GNUNET_YES
Definition: gnunet_common.h:77
static struct GNUNET_IDENTITY_EgoLookup * el
EgoLookup.
Definition: gnunet-abd.c:51
static char * ego_name
ego
Definition: gnunet-abd.c:117
static char * issuer_attr
Issuer attribute.
Definition: gnunet-abd.c:122
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
etime_is_rel[out]set to GNUNET_YES if time is relative
etime[out]set to expiration time (abs or rel)
Returns
GNUNET_OK on success

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

References GNUNET_TIME_Absolute::abs_value_us, 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().

442 {
443  // copied from namestore/gnunet-namestore.c
444  struct GNUNET_TIME_Relative etime_rel;
445  struct GNUNET_TIME_Absolute etime_abs;
446 
447  if (0 == strcmp (expirationstring, "never"))
448  {
449  *etime = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
451  return GNUNET_OK;
452  }
453  if (GNUNET_OK ==
455  {
457  *etime = etime_rel.rel_value_us;
459  "Storing record with relative expiration time of %s\n",
461  return GNUNET_OK;
462  }
463  if (GNUNET_OK ==
465  {
467  *etime = etime_abs.abs_value_us;
469  "Storing record with absolute expiration time of %s\n",
471  return GNUNET_OK;
472  }
473  return GNUNET_SYSERR;
474 }
int 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:351
int 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:402
#define GNUNET_NO
Definition: gnunet_common.h:78
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
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:687
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
static char * expirationstring
Desired expiration time.
#define GNUNET_log(kind,...)
Time for absolute times used by GNUnet, in microseconds.
#define GNUNET_YES
Definition: gnunet_common.h:77
static int etime_is_rel
Is expiration time relative or absolute time?
Definition: gnunet-abd.c:206
static uint64_t etime
Expiration string converted to numeric value.
Definition: gnunet-abd.c:201
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
Definition: strings.c:742
Time for relative time used by GNUnet, in microseconds.
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.

References GNUNET_SCHEDULER_shutdown().

Referenced by GNUNET_RECLAIM_get_attributes_start(), GNUNET_RECLAIM_ticket_iteration_start(), and store_cb().

481 {
482  fprintf (stderr, "Error occured during lookup, shutting down.\n");
484  return;
485 }
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:526
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_continuation()

static void add_continuation ( void *  cls,
int32_t  success,
const char *  emsg 
)
static

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

References GNUNET_OK, GNUNET_SCHEDULER_shutdown(), and qe.

Referenced by get_existing_record().

488 {
489  struct GNUNET_NAMESTORE_QueueEntry **qe = cls;
490  *qe = NULL;
491 
492  if(GNUNET_OK == success)
493  printf ("Adding successful.\n");
494  else
495  fprintf (stderr, "Error occured during adding, shutting down.\n");
496 
498 }
static struct GNUNET_DATASTORE_QueueEntry * qe
Current operation.
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:526
An QueueEntry used to store information for a pending NAMESTORE record operation. ...
Definition: namestore_api.c:53
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_EcdsaPrivateKey zone_key,
const char *  rec_name,
unsigned int  rd_count,
const struct GNUNET_GNSRECORD_Data rd 
)
static

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

References add_continuation(), 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_GNSRECORD_RF_PRIVATE, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_memcpy, GNUNET_NAMESTORE_records_store(), GNUNET_NO, GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_YES, is_private, GNUNET_GNSRECORD_Data::record_type, type, and zone_pkey.

Referenced by store_cb().

506 {
507  struct GNUNET_GNSRECORD_Data rdn[rd_count + 1];
508  struct GNUNET_GNSRECORD_Data *rde;
509 
510  memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data));
511  GNUNET_memcpy (&rdn[1], rd, rd_count * sizeof (struct GNUNET_GNSRECORD_Data));
512  rde = &rdn[0];
513  rde->data = data;
514  rde->data_size = data_size;
515  rde->record_type = type;
516 
517  // Set flags
518  if (GNUNET_YES == is_private)
520  rde->expiration_time = etime;
521  if (GNUNET_YES == etime_is_rel)
523  else if (GNUNET_NO != etime_is_rel)
524  rde->expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
525 
526  GNUNET_assert (NULL != rec_name);
528  &zone_pkey,
529  rec_name,
530  rd_count + 1,
531  rde,
533  &add_qe);
534 
535  return;
536 }
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_NO
Definition: gnunet_common.h:78
size_t data_size
Number of bytes in data.
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *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.
const void * data
Binary value stored in the DNS record.
uint64_t expiration_time
Expiration time for the DNS record.
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
Definition: gnunet-abd.c:41
static int is_private
Is record private.
Definition: gnunet-abd.c:157
This is a private record of this peer and it should thus not be handed out to other peers...
static void * data
Value in binary format.
Definition: gnunet-abd.c:182
static struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey
Private key for the our zone.
Definition: gnunet-abd.c:46
uint32_t record_type
Type of the GNS/DNS record.
static struct GNUNET_NAMESTORE_QueueEntry * add_qe
Queue entry for the &#39;add&#39; operation.
Definition: gnunet-abd.c:177
static uint32_t type
Type string converted to DNS type value.
Definition: gnunet-abd.c:192
#define GNUNET_YES
Definition: gnunet_common.h:77
static int etime_is_rel
Is expiration time relative or absolute time?
Definition: gnunet-abd.c:206
enum GNUNET_GNSRECORD_Flags flags
Flags for the record.
This flag is currently unused; former RF_PENDING flag.
static uint64_t etime
Expiration string converted to numeric value.
Definition: gnunet-abd.c:201
static void add_continuation(void *cls, int32_t success, const char *emsg)
Definition: gnunet-abd.c:487
Here is the call graph for this function:
Here is the caller graph for this function:

◆ store_cb()

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

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

References _, GNUNET_TIME_Absolute::abs_value_us, data, data_size, error_cb(), etime, etime_is_rel, expiration, GNUNET_ABD_Delegate::expiration, get_existing_record(), GNUNET_ABD_delegate_from_string(), GNUNET_ABD_delegate_serialize(), GNUNET_CRYPTO_ecdsa_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(), parse_expiration(), record_label, subject, GNUNET_ABD_Delegate::subject_key, type, typestring, and zone_pkey.

Referenced by run().

540 {
541  const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
542 
543  el = NULL;
544 
546  if (NULL == ns)
547  {
549  _ ("Failed to connect to namestore\n"));
551  return;
552  }
553 
554  // Key handling
556 
558  {
559  // Parse import
560  struct GNUNET_ABD_Delegate *cred;
561  cred = GNUNET_ABD_delegate_from_string (import);
562 
563  // Get import subject public key string
564  char *subject_pubkey_str =
566 
567  // Get zone public key string
568  struct GNUNET_CRYPTO_EcdsaPublicKey zone_pubkey;
569  GNUNET_IDENTITY_ego_get_public_key (ego, &zone_pubkey);
570  char *zone_pubkey_str =
572 
573  // Check if the subject key in the signed import matches the zone's key it is issued to
574  if (strcmp (zone_pubkey_str, subject_pubkey_str) != 0)
575  {
576  fprintf (stderr,
577  "Import signed delegate does not match this ego's public key.\n");
579  return;
580  }
581 
582  // Expiration
583  etime = cred->expiration.abs_value_us;
585 
586  // Prepare the data to be store in the record
587  data_size = GNUNET_ABD_delegate_serialize (cred, (char **) &data);
588  GNUNET_free (cred);
589  }
590  else
591  {
592  // For all other types e.g. GNUNET_GNSRECORD_TYPE_ATTRIBUTE
593  if (GNUNET_OK !=
595  {
596  fprintf (stderr,
597  "Value `%s' invalid for record type `%s'\n",
598  subject,
599  typestring);
601  return;
602  }
603 
604  // Take care of expiration
605  if (NULL == expiration)
606  {
607  fprintf (stderr, "Missing option -e for operation 'create'\n");
609  return;
610  }
612  {
613  fprintf (stderr, "Invalid time format `%s'\n", expiration);
615  return;
616  }
617  }
618 
619  // Start lookup
621  &zone_pkey,
622  record_label,
623  &error_cb,
624  NULL,
626  NULL);
627  return;
628 }
static char * typestring
Type of the record to add/remove, NULL to remove all.
Definition: gnunet-abd.c:197
struct GNUNET_CRYPTO_EcdsaPublicKey subject_key
Public key of the subject this credential was issued to.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *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.
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:480
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
const struct GNUNET_CRYPTO_EcdsaPrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
Definition: identity_api.c:555
#define GNUNET_NO
Definition: gnunet_common.h:78
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:526
uint64_t abs_value_us
The actual value.
#define _(String)
GNU gettext support macro.
Definition: platform.h:181
static int parse_expiration(const char *expirationstring, int *etime_is_rel, uint64_t *etime)
Parse expiration time.
Definition: gnunet-abd.c:439
int GNUNET_ABD_delegate_serialize(struct GNUNET_ABD_Delegate *dele, char **data)
#define GNUNET_GNSRECORD_TYPE_DELEGATE
65546 reserved
static char * record_label
Record label for storing delegations.
Definition: gnunet-abd.c:216
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_from_string(const char *s)
Definition: delegate_misc.c:79
static struct GNUNET_NAMESTORE_Handle * ns
Handle to the namestore.
Definition: gnunet-abd.c:41
int GNUNET_GNSRECORD_string_to_value(uint32_t type, const char *s, void **data, size_t *data_size)
Convert human-readable version of a &#39;value&#39; of a record to the binary representation.
Definition: gnsrecord.c:175
static char * expiration
Credential TTL.
Definition: gnunet-abd.c:96
char * GNUNET_CRYPTO_ecdsa_public_key_to_string(const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Convert a public key to a string.
Definition: crypto_ecc.c:332
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
static void * data
Value in binary format.
Definition: gnunet-abd.c:182
void GNUNET_IDENTITY_ego_get_public_key(const struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_CRYPTO_EcdsaPublicKey *pk)
Get the identifier (public key) of an ego.
Definition: identity_api.c:568
static struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey
Private key for the our zone.
Definition: gnunet-abd.c:46
static char * subject
Subject pubkey string.
Definition: gnunet-abd.c:86
configuration data
Definition: configuration.c:85
static struct GNUNET_NAMESTORE_QueueEntry * add_qe
Queue entry for the &#39;add&#39; operation.
Definition: gnunet-abd.c:177
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
static uint32_t type
Type string converted to DNS type value.
Definition: gnunet-abd.c:192
#define GNUNET_log(kind,...)
struct GNUNET_TIME_Absolute expiration
Expiration of this credential.
static int etime_is_rel
Is expiration time relative or absolute time?
Definition: gnunet-abd.c:206
static uint64_t etime
Expiration string converted to numeric value.
Definition: gnunet-abd.c:201
static struct GNUNET_IDENTITY_EgoLookup * el
EgoLookup.
Definition: gnunet-abd.c:51
static void get_existing_record(void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, const char *rec_name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Definition: gnunet-abd.c:501
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sign_cb()

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

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

References ego_name, expiration, GNUNET_ABD_delegate_issue(), GNUNET_ABD_delegate_to_string(), GNUNET_CRYPTO_ecdsa_public_key_from_string(), GNUNET_free, GNUNET_free_non_null, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_OK, GNUNET_SCHEDULER_shutdown(), GNUNET_STRINGS_fancy_time_to_absolute(), issuer_attr, key_length, res, subject, and subject_pkey.

Referenced by run().

632 {
633  const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
634  struct GNUNET_ABD_Delegate *dele;
635  struct GNUNET_TIME_Absolute etime_abs;
636  char *res;
637 
638  el = NULL;
639 
640  // work on expiration time
641  if (NULL == expiration)
642  {
643  fprintf (stderr, "Please specify a TTL\n");
645  return;
646  }
647  else if (GNUNET_OK !=
649  {
650  fprintf (stderr,
651  "%s is not a valid ttl! Only absolute times are accepted!\n",
652  expiration);
654  return;
655  }
656 
657  // If contains a space - split it by the first space only - assume first entry is subject followed by attribute(s)
658  char *subject_pubkey_str;
659  char *subject_attr = NULL;
660  char *token;
661 
662  // Subject Public Key
663  token = strtok (subject, " ");
664  if (key_length == strlen (token))
665  {
666  subject_pubkey_str = token;
667  }
668  else
669  {
670  fprintf (stderr, "Key error, wrong length: %ld!\n", strlen (token));
672  return;
673  }
674  // Subject Attribute(s)
675  token = strtok (NULL, " ");
676  if (NULL != token)
677  {
678  subject_attr = token;
679  }
680 
681  // work on keys
682  privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
683 
684  if (GNUNET_OK !=
685  GNUNET_CRYPTO_ecdsa_public_key_from_string (subject_pubkey_str,
686  strlen (subject_pubkey_str),
687  &subject_pkey))
688  {
689  fprintf (stderr,
690  "Subject public key `%s' is not well-formed\n",
691  subject_pubkey_str);
693  return;
694  }
695 
696  // Sign delegate
697  dele = GNUNET_ABD_delegate_issue (privkey,
698  &subject_pkey,
699  issuer_attr,
700  subject_attr,
701  &etime_abs);
702  res = GNUNET_ABD_delegate_to_string (dele);
703  GNUNET_free (dele);
704  printf ("%s\n", res);
705 
707  ego_name = NULL;
708 
710 }
char * GNUNET_ABD_delegate_to_string(const struct GNUNET_ABD_Delegate *cred)
Definition: delegate_misc.c:37
const struct GNUNET_CRYPTO_EcdsaPrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
Definition: identity_api.c:555
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_issue(const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, struct GNUNET_CRYPTO_EcdsaPublicKey *subject, const char *iss_attr, const char *sub_attr, struct GNUNET_TIME_Absolute *expiration)
Issue an attribute to a subject.
int 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:402
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#define GNUNET_free_non_null(ptr)
Free the memory pointed to by ptr if ptr is not NULL.
Private ECC key encoded for transmission.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:526
static const int key_length
Fixed size of the public/private keys.
Definition: gnunet-abd.c:211
struct GNUNET_CRYPTO_EcdsaPublicKey subject_pkey
Subject key.
Definition: gnunet-abd.c:101
static char * expiration
Credential TTL.
Definition: gnunet-abd.c:96
static int res
static char * subject
Subject pubkey string.
Definition: gnunet-abd.c:86
int GNUNET_CRYPTO_ecdsa_public_key_from_string(const char *enc, size_t enclen, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Convert a string representing a public key to a public key.
Definition: crypto_ecc.c:466
Time for absolute times used by GNUnet, in microseconds.
static struct GNUNET_IDENTITY_EgoLookup * el
EgoLookup.
Definition: gnunet-abd.c:51
static char * ego_name
ego
Definition: gnunet-abd.c:117
static char * issuer_attr
Issuer attribute.
Definition: gnunet-abd.c:122
#define GNUNET_free(ptr)
Wrapper around free.
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 721 of file gnunet-abd.c.

References _, backward, collect, create_is, create_ss, direction, do_shutdown(), do_timeout(), ego_name, forward, GNUNET_ABD_connect(), GNUNET_ABD_delegate_from_string(), GNUNET_ABD_FLAG_BACKWARD, GNUNET_ABD_FLAG_FORWARD, GNUNET_ABD_verify(), GNUNET_CRYPTO_ecdsa_public_key_from_string(), GNUNET_free, GNUNET_GNS_EMPTY_LABEL_AT, GNUNET_GNSRECORD_TYPE_ATTRIBUTE, GNUNET_GNSRECORD_TYPE_DELEGATE, GNUNET_IDENTITY_ego_lookup(), 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, type, and verify.

Referenced by adjust_running_peers(), and main().

725 {
726  cfg = c;
727 
730 
731  // Check relevant cmdline parameters
732  if (GNUNET_YES == create_is)
733  {
734  if (NULL == ego_name)
735  {
736  fprintf (stderr, "Missing option '-ego'\n");
738  return;
739  }
740  if (NULL == issuer_attr)
741  {
742  fprintf (stderr, "Missing option '-attribute' for issuer attribute\n");
744  return;
745  }
746  if (NULL == subject)
747  {
748  fprintf (stderr, "Missing option -subject for operation 'create'.'\n");
750  return;
751  }
752 
753  // Lookup ego, on success call store_cb and store as ATTRIBUTE type
757  return;
758  }
759 
760  if (GNUNET_YES == create_ss)
761  {
762 
763  // check if signed parameter has been passed in cmd line call
764  if (NULL == import)
765  {
766  fprintf (stderr, "'import' required\n");
768  return;
769  }
770 
773  // Store subject side
775 
776  return;
777  }
778 
779  if (GNUNET_YES == sign_ss)
780  {
781  if (NULL == ego_name)
782  {
783  fprintf (stderr, "ego required\n");
785  return;
786  }
787  if (NULL == subject)
788  {
789  fprintf (stderr, "Subject public key needed\n");
791  return;
792  }
793 
794  // lookup ego and call function sign_cb on success
796  return;
797  }
798 
799  if (GNUNET_NO == forward && GNUNET_NO == backward)
800  {
801  // set default: bidirectional
804  }
805  if (GNUNET_YES == forward)
807  if (GNUNET_YES == backward)
809 
810  if (GNUNET_YES == collect)
811  {
812  if (NULL == issuer_key)
813  {
814  fprintf (stderr, _ ("Issuer public key not well-formed\n"));
816  return;
817  }
818 
820 
821  if (NULL == abd)
822  {
823  fprintf (stderr, _ ("Failed to connect to ABD\n"));
825  return;
826  }
827  if (NULL == issuer_attr)
828  {
829  fprintf (stderr, _ ("You must provide issuer the attribute\n"));
831  return;
832  }
833 
834  if (NULL == ego_name)
835  {
836  fprintf (stderr, _ ("ego required\n"));
838  return;
839  }
841  return;
842  }
843 
844  if (NULL == subject)
845  {
846  fprintf (stderr, _ ("Subject public key needed\n"));
848  return;
849  }
851  strlen (subject),
852  &subject_pkey))
853  {
854  fprintf (stderr,
855  _ ("Subject public key `%s' is not well-formed\n"),
856  subject);
858  return;
859  }
860 
861  if (GNUNET_YES == verify)
862  {
863  if (NULL == issuer_key)
864  {
865  fprintf (stderr, _ ("Issuer public key not well-formed\n"));
867  return;
868  }
869  if (GNUNET_OK !=
871  strlen (issuer_key),
872  &issuer_pkey))
873  {
874  fprintf (stderr,
875  _ ("Issuer public key `%s' is not well-formed\n"),
876  issuer_key);
878  return;
879  }
881 
882  if (NULL == abd)
883  {
884  fprintf (stderr, _ ("Failed to connect to ABD\n"));
886  return;
887  }
888  if (NULL == issuer_attr || NULL == subject_delegate)
889  {
890  fprintf (stderr, _ ("You must provide issuer and subject attributes\n"));
892  return;
893  }
894 
895  //Subject credentials are comma separated
896  char *tmp = GNUNET_strdup (subject_delegate);
897  char *tok = strtok (tmp, ",");
898  if (NULL == tok)
899  {
900  fprintf (stderr, "Invalid subject credentials\n");
901  GNUNET_free (tmp);
903  return;
904  }
905  int count = 1;
906  int i;
907  while (NULL != (tok = strtok (NULL, ",")))
908  count++;
909  struct GNUNET_ABD_Delegate delegates[count];
910  struct GNUNET_ABD_Delegate *dele;
911  GNUNET_free (tmp);
913  tok = strtok (tmp, ",");
914  for (i = 0; i < count; i++)
915  {
916  dele = GNUNET_ABD_delegate_from_string (tok);
917  GNUNET_memcpy (&delegates[i],
918  dele,
919  sizeof (struct GNUNET_ABD_Delegate));
920  delegates[i].issuer_attribute = GNUNET_strdup (dele->issuer_attribute);
921  tok = strtok (NULL, ",");
922  GNUNET_free (dele);
923  }
924 
926  &issuer_pkey,
927  issuer_attr,
928  &subject_pkey,
929  count,
930  delegates,
931  direction,
933  NULL,
935  NULL);
936  for (i = 0; i < count; i++)
937  {
938  GNUNET_free ((char *) delegates[i].issuer_attribute);
939  }
940  GNUNET_free (tmp);
941  }
942  else
943  {
944  fprintf (stderr,
945  _ (
946  "Please specify name to lookup, subject key and issuer key!\n"));
948  }
949  return;
950 }
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:320
static int create_is
Create mode.
Definition: gnunet-abd.c:137
struct GNUNET_ABD_Handle * GNUNET_ABD_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the connection with the ABD service.
Definition: abd_api.c:350
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
#define GNUNET_GNS_EMPTY_LABEL_AT
String we use to indicate an empty label (top-level entry in the zone).
static struct GNUNET_SCHEDULER_Task * tt
Task scheduled to handle timeout.
Definition: gnunet-abd.c:76
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, or when GNUNET_SCHEDULER_shutdown() is being invoked.
Definition: scheduler.c:1300
static void handle_intermediate_result(void *cls, struct GNUNET_ABD_Delegation *dd, bool is_bw)
Definition: gnunet-abd.c:272
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_NO
Definition: gnunet_common.h:78
struct GNUNET_CRYPTO_EcdsaPublicKey issuer_pkey
Issuer key.
Definition: gnunet-abd.c:106
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:526
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
enum GNUNET_ABD_AlgoDirectionFlags direction
API enum, filled and passed for collect/verify.
Definition: gnunet-abd.c:172
#define _(String)
GNU gettext support macro.
Definition: platform.h:181
static void do_timeout(void *cls)
Task run on timeout.
Definition: gnunet-abd.c:265
#define GNUNET_GNSRECORD_TYPE_DELEGATE
65546 reserved
static char * record_label
Record label for storing delegations.
Definition: gnunet-abd.c:216
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:1253
static struct GNUNET_TIME_Relative timeout
Desired timeout for the lookup (default is no timeout).
Definition: gnunet-abd.c:61
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_from_string(const char *s)
Definition: delegate_misc.c:79
static char * subject_delegate
Subject delegate string.
Definition: gnunet-abd.c:91
static void sign_cb(void *cls, const struct GNUNET_IDENTITY_Ego *ego)
Definition: gnunet-abd.c:631
struct GNUNET_CRYPTO_EcdsaPublicKey subject_pkey
Subject key.
Definition: gnunet-abd.c:101
static int forward
Search direction: forward.
Definition: gnunet-abd.c:162
static void do_shutdown(void *cls)
Task run on shutdown.
Definition: gnunet-abd.c:224
static char * issuer_key
Issuer pubkey string.
Definition: gnunet-abd.c:112
static int collect
Collect mode.
Definition: gnunet-abd.c:132
static int create_ss
Create mode.
Definition: gnunet-abd.c:142
static struct GNUNET_ABD_Handle * abd
Handle to Credential service.
Definition: gnunet-abd.c:56
static void store_cb(void *cls, const struct GNUNET_IDENTITY_Ego *ego)
Definition: gnunet-abd.c:539
static int backward
Search direction: backward.
Definition: gnunet-abd.c:167
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.
static char * subject
Subject pubkey string.
Definition: gnunet-abd.c:86
int GNUNET_CRYPTO_ecdsa_public_key_from_string(const char *enc, size_t enclen, struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Convert a string representing a public key to a public key.
Definition: crypto_ecc.c:466
static struct GNUNET_ABD_Request * verify_request
Handle to verify request.
Definition: gnunet-abd.c:66
static uint32_t type
Type string converted to DNS type value.
Definition: gnunet-abd.c:192
#define GNUNET_GNSRECORD_TYPE_ATTRIBUTE
Record type for reverse lookups.
#define GNUNET_YES
Definition: gnunet_common.h:77
const char * issuer_attribute
The issuer attribute.
static int sign_ss
Create mode.
Definition: gnunet-abd.c:147
struct GNUNET_ABD_Request * GNUNET_ABD_verify(struct GNUNET_ABD_Handle *handle, const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_EcdsaPublicKey *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:491
static int verify
Verify mode.
Definition: gnunet-abd.c:127
static struct GNUNET_IDENTITY_EgoLookup * el
EgoLookup.
Definition: gnunet-abd.c:51
static char * ego_name
ego
Definition: gnunet-abd.c:117
static char * issuer_attr
Issuer attribute.
Definition: gnunet-abd.c:122
#define GNUNET_free(ptr)
Wrapper around free.
static void identity_cb(void *cls, const struct GNUNET_IDENTITY_Ego *ego)
Callback invoked from identity service with ego information.
Definition: gnunet-abd.c:384
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 961 of file gnunet-abd.c.

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

962 {
965  "verify",
966  gettext_noop (
967  "verify credential against attribute"),
968  &verify),
970  's',
971  "subject",
972  "PKEY",
973  gettext_noop (
974  "The public key of the subject to lookup the"
975  "credential for, or for issuer side storage: subject and its attributes"),
976  &subject),
978  'd',
979  "delegate",
980  "DELE",
981  gettext_noop ("The private, signed delegate presented by the subject"),
984  'i',
985  "issuer",
986  "PKEY",
987  gettext_noop (
988  "The public key of the authority to verify the credential against"),
989  &issuer_key),
991  "ego",
992  "EGO",
993  gettext_noop ("The ego/zone name to use"),
994  &ego_name),
996  'a',
997  "attribute",
998  "ATTR",
999  gettext_noop ("The issuer attribute to verify against or to issue"),
1000  &issuer_attr),
1002  "ttl",
1003  "EXP",
1004  gettext_noop (
1005  "The time to live for the credential."
1006  "e.g. 5m, 6h, \"1990-12-30 12:00:00\""),
1007  &expiration),
1009  "collect",
1010  gettext_noop ("collect credentials"),
1011  &collect),
1013  "createIssuerSide",
1014  gettext_noop (
1015  "Create and issue a credential issuer side."),
1016  &create_is),
1018  "createSubjectSide",
1019  gettext_noop (
1020  "Issue a credential subject side."),
1021  &create_ss),
1023  'S',
1024  "signSubjectSide",
1025  gettext_noop ("Create, sign and return a credential subject side."),
1026  &sign_ss),
1028  'x',
1029  "import",
1030  "IMP",
1031  gettext_noop (
1032  "Import signed credentials that should be issued to a zone/ego"),
1033  &import),
1035  "private",
1036  gettext_noop ("Create private record entry."),
1037  &is_private),
1039  'F',
1040  "forward",
1041  gettext_noop (
1042  "Indicates that the collect/verify process is done via forward search."),
1043  &forward),
1045  'B',
1046  "backward",
1047  gettext_noop (
1048  "Indicates that the collect/verify process is done via forward search."),
1049  &backward),
1051 
1052 
1054  if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
1055  return 2;
1056 
1057  GNUNET_log_setup ("gnunet-abd", "WARNING", NULL);
1058  if (GNUNET_OK != GNUNET_PROGRAM_run (argc,
1059  argv,
1060  "gnunet-abd",
1061  _ ("GNUnet abd resolver tool"),
1062  options,
1063  &run,
1064  NULL))
1065  ret = 1;
1066  GNUNET_free ((void *) argv);
1067  return ret;
1068 }
static int create_is
Create mode.
Definition: gnunet-abd.c:137
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
int GNUNET_STRINGS_get_utf8_args(int argc, char *const *argv, int *u8argc, char *const **u8argv)
Returns utf-8 encoded arguments.
Definition: strings.c:1440
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
Definition of a command line option.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
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.
#define _(String)
GNU gettext support macro.
Definition: platform.h:181
static struct GNUNET_TIME_Relative timeout
Desired timeout for the lookup (default is no timeout).
Definition: gnunet-abd.c:61
static char * subject_delegate
Subject delegate string.
Definition: gnunet-abd.c:91
static int is_private
Is record private.
Definition: gnunet-abd.c:157
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
static int forward
Search direction: forward.
Definition: gnunet-abd.c:162
static char * expiration
Credential TTL.
Definition: gnunet-abd.c:96
static char * issuer_key
Issuer pubkey string.
Definition: gnunet-abd.c:112
static int collect
Collect mode.
Definition: gnunet-abd.c:132
static int create_ss
Create mode.
Definition: gnunet-abd.c:142
static int backward
Search direction: backward.
Definition: gnunet-abd.c:167
static char * subject
Subject pubkey string.
Definition: gnunet-abd.c:86
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.
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:721
int 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, parse options).
Definition: program.c:368
int GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile)
Setup logging.
static int sign_ss
Create mode.
Definition: gnunet-abd.c:147
static int verify
Verify mode.
Definition: gnunet-abd.c:127
static char * ego_name
ego
Definition: gnunet-abd.c:117
static char * issuer_attr
Issuer attribute.
Definition: gnunet-abd.c:122
#define GNUNET_free(ptr)
Wrapper around free.
#define gettext_noop(String)
Definition: gettext.h:69
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 36 of file gnunet-abd.c.

Referenced by connect_check_run(), create_internal(), default_ego_cb(), GAS_plugin_init(), GCP_set_hello(), GNUNET_ABD_connect(), GNUNET_ARM_connect(), GNUNET_ATS_connectivity_init(), GNUNET_ATS_performance_init(), GNUNET_ATS_scheduling_init(), GNUNET_ATS_solvers_experimentation_load(), GNUNET_ATS_TEST_experimentation_load(), GNUNET_CLIENT_connect(), GNUNET_CONFIGURATION_parse_and_run(), GNUNET_CONNECTION_create_from_connect(), GNUNET_CONNECTION_create_from_connect_to_unixpath(), GNUNET_CONVERSATION_phone_create(), GNUNET_CORE_connect(), GNUNET_CRYPTO_eddsa_setup_key(), GNUNET_DATASTORE_connect(), GNUNET_DHT_connect(), GNUNET_DNS_connect(), GNUNET_FS_start(), GNUNET_GNS_connect(), GNUNET_IDENTITY_connect(), GNUNET_NAMECACHE_connect(), GNUNET_NAMESTORE_connect(), GNUNET_NAT_AUTO_test_start(), GNUNET_NAT_register(), GNUNET_NAT_test_start(), GNUNET_PEERINFO_connect(), GNUNET_RECLAIM_connect(), GNUNET_RESOLVER_connect(), GNUNET_RPS_connect(), GNUNET_SERVICE_run_(), GNUNET_SERVICE_start(), GNUNET_SET_listen(), GNUNET_STATISTICS_create(), GNUNET_TESTBED_controller_connect(), GNUNET_TESTBED_controller_start(), GNUNET_TESTBED_extract_config_(), GNUNET_TESTBED_peer_create(), GNUNET_TESTING_configuration_create_(), GNUNET_TESTING_service_run(), GNUNET_TIME_absolute_get_monotonic(), GNUNET_TRANSPORT_application_init(), GNUNET_TRANSPORT_communicator_connect(), GNUNET_TRANSPORT_core_connect(), GNUNET_TRANSPORT_core_get_mq(), GPI_plugins_load(), handle_link_controllers_result(), handle_peer_create(), handle_peer_reconfigure(), handle_slave_get_config(), id_connect_cb(), identity_cb(), libgnunet_plugin_block_revocation_init(), main_task(), parse_configuration_file(), parse_shared_services(), print_option(), run(), tokenizer_cb(), and update_peer_config().

◆ ns

struct GNUNET_NAMESTORE_Handle* ns
static

◆ zone_pkey

struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey
static

Private key for the our zone.

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

Referenced by get_existing_record(), and store_cb().

◆ el

struct GNUNET_IDENTITY_EgoLookup* el
static

◆ abd

struct GNUNET_ABD_Handle* abd
static

Handle to Credential service.

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

◆ timeout

struct GNUNET_TIME_Relative timeout
static

◆ verify_request

struct GNUNET_ABD_Request* verify_request
static

Handle to verify request.

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

◆ collect_request

struct GNUNET_ABD_Request* collect_request
static

Handle to collect request.

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

◆ tt

struct GNUNET_SCHEDULER_Task* tt
static

Task scheduled to handle timeout.

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

Referenced by GNUNET_STRINGS_absolute_time_to_string().

◆ ret

int ret = 0
static

Return value of the commandline.

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

Referenced by __attribute__(), access_handler_callback(), add_address_to_hello(), add_address_to_uri(), add_record(), add_services(), add_valid_peer(), address_generator(), address_to_regex(), append_port(), bound_priority(), build_dns_query(), child_death_task(), cleanup_expired_records(), client_message_tokenizer_callback(), client_run(), close_all_files(), cmd_read(), compute_chk_offset(), compute_policy(), compute_rand_delay(), compute_scalar_product(), conversation_value_to_string(), convert_with_table(), copy_from_reader(), create_meter(), create_peer_ctx(), create_response(), db_read_whitelist(), decide_capacity(), delta_match(), demultiplex_with_cmc(), deserialize_fi_node(), deserialize_file_information(), do_delete_entry(), do_send(), do_transmit(), download_hostlist(), estimate_latency(), execute_get(), execute_select(), extract_fixed_blob(), extract_rsa_pub(), extract_rsa_sig(), extract_var_blob(), fh_reader(), fill_s_reply(), fork_and_exec(), GCP_2s(), GCP_iterate_indirect_paths(), GCP_iterate_paths(), GCP_iterate_paths_at(), GCT_handle_kx(), GCT_handle_kx_auth(), get_bootstrap_server(), get_cb(), get_delay_randomization(), get_latest(), get_next_free_ctn(), get_peer_ctx(), get_random_peer_from_peermap(), get_randomized_delay(), get_read_handle(), get_records_and_call_iterator(), get_serialization_file_name(), get_serialization_file_name_in_dir(), get_server_addresses(), get_target_peers(), get_transmit_delay(), get_update_information_directory(), get_valid_peers(), get_write_handle(), get_write_handle_in_dir(), getPRK(), gns_resolve_name(), GNUNET_ABD_delegates_get_size(), GNUNET_ABD_delegation_chain_get_size(), GNUNET_ABD_delegation_set_get_size(), GNUNET_ARM_request_service_start(), GNUNET_asprintf(), GNUNET_BANDWIDTH_tracker_get_delay(), GNUNET_BANDWIDTH_value_get_delay_for(), GNUNET_BANDWIDTH_value_init(), GNUNET_BIO_flush(), GNUNET_BIO_read(), GNUNET_BIO_write_close(), GNUNET_BLOCK_group_merge(), GNUNET_CADET_get_channel_cancel(), GNUNET_CADET_get_path_cancel(), GNUNET_CADET_list_peers_cancel(), GNUNET_CADET_list_tunnels_cancel(), GNUNET_CLIENT_test(), GNUNET_CONFIGURATION_deserialize(), GNUNET_CONFIGURATION_dup(), GNUNET_CONFIGURATION_get_value_time(), GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_CONFIGURATION_iterate_value_filenames(), GNUNET_CONFIGURATION_parse(), GNUNET_CONFIGURATION_parse_and_run(), GNUNET_CONFIGURATION_write_diffs(), GNUNET_CONTAINER_heap_remove_node(), GNUNET_CONTAINER_heap_remove_root(), GNUNET_CONTAINER_meta_data_duplicate(), GNUNET_CONTAINER_meta_data_get_first_by_types(), GNUNET_CONTAINER_meta_data_get_serialized_size(), GNUNET_CONTAINER_multihashmap32_create(), GNUNET_CONTAINER_multihashmap32_remove_all(), GNUNET_CONTAINER_multihashmap_clear(), GNUNET_CONTAINER_multihashmap_remove_all(), GNUNET_CONTAINER_multipeermap_remove_all(), GNUNET_CONTAINER_multishortmap_remove_all(), GNUNET_CONTAINER_multiuuidmap_remove_all(), GNUNET_copy_message(), GNUNET_CRYPTO_ecdh_eddsa(), GNUNET_CRYPTO_ecdsa_ecdh(), GNUNET_CRYPTO_ecdsa_private_key_derive(), GNUNET_CRYPTO_eddsa_ecdh(), GNUNET_CRYPTO_hkdf(), GNUNET_CRYPTO_hkdf_v(), GNUNET_CRYPTO_kdf(), GNUNET_CRYPTO_random_permute(), GNUNET_CRYPTO_random_u32(), GNUNET_CRYPTO_random_u64(), GNUNET_CRYPTO_rsa_blind(), GNUNET_CRYPTO_rsa_private_key_cmp(), GNUNET_CRYPTO_rsa_private_key_create(), GNUNET_CRYPTO_rsa_public_key_cmp(), GNUNET_CRYPTO_rsa_public_key_decode(), GNUNET_CRYPTO_rsa_signature_cmp(), GNUNET_CRYPTO_rsa_signature_decode(), GNUNET_CRYPTO_rsa_signature_dup(), GNUNET_CRYPTO_rsa_unblind(), GNUNET_DATACACHE_create(), GNUNET_DISK_directory_create(), GNUNET_DISK_directory_create_for_file(), GNUNET_DISK_directory_scan(), GNUNET_DISK_directory_test(), GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_read_non_blocking(), GNUNET_DISK_file_size(), GNUNET_DISK_file_test(), GNUNET_DISK_file_unmap(), GNUNET_DISK_file_write_blocking(), GNUNET_DISK_fn_read(), GNUNET_DISK_fn_write(), GNUNET_DISK_pipe(), GNUNET_DISK_pipe_close(), GNUNET_DISK_pipe_close_end(), GNUNET_DISK_pipe_detach_end(), GNUNET_DISK_pipe_from_fd(), GNUNET_DNSPARSER_bin_to_hex(), GNUNET_DNSPARSER_builder_add_query(), GNUNET_DNSPARSER_builder_add_soa(), GNUNET_DNSPARSER_builder_add_srv(), GNUNET_DNSPARSER_pack(), GNUNET_FRIENDS_write(), GNUNET_FRIENDS_write_stop(), GNUNET_FS_data_reader_file_(), GNUNET_FS_directory_builder_add(), GNUNET_FS_directory_builder_create(), GNUNET_FS_directory_builder_finish(), GNUNET_FS_file_information_create_empty_directory(), GNUNET_FS_file_information_create_from_file(), GNUNET_FS_file_information_create_from_reader(), GNUNET_FS_make_top(), GNUNET_FS_meta_data_suggest_filename(), GNUNET_FS_meta_data_test_for_directory(), GNUNET_FS_publish_start(), GNUNET_FS_search_make_status_(), GNUNET_FS_search_start(), GNUNET_FS_start(), GNUNET_FS_tree_calculate_block_size(), GNUNET_FS_tree_compute_iblock_size(), GNUNET_FS_uri_dup(), GNUNET_FS_uri_ksk_create_from_meta_data(), GNUNET_FS_uri_ksk_merge(), GNUNET_FS_uri_ksk_to_string_fancy(), GNUNET_FS_uri_loc_get_uri(), GNUNET_FS_uri_parse(), GNUNET_FS_uri_test_equal(), GNUNET_GNS_lookup_cancel(), GNUNET_GNS_lookup_with_tld_cancel(), GNUNET_GNSRECORD_number_to_typename(), GNUNET_GNSRECORD_pkey_to_zkey(), GNUNET_GNSRECORD_records_get_size(), GNUNET_GNSRECORD_typename_to_number(), GNUNET_GNSRECORD_value_to_string(), GNUNET_h2s_full(), GNUNET_HELLO_address_cmp(), GNUNET_HELLO_create(), GNUNET_HELLO_get_header(), GNUNET_HELLO_get_id(), GNUNET_HELLO_get_last_expiration(), GNUNET_HELLO_iterate_addresses(), GNUNET_HELLO_size(), GNUNET_HELPER_kill(), GNUNET_HELPER_wait(), GNUNET_i2s(), GNUNET_i2s2(), GNUNET_i2s_full(), GNUNET_JSON_from_rsa_public_key(), GNUNET_JSON_from_rsa_signature(), GNUNET_JSON_from_time_abs(), GNUNET_JSON_from_time_rel(), GNUNET_JSON_post_parser(), GNUNET_JSON_spec_absolute_time(), GNUNET_JSON_spec_absolute_time_nbo(), GNUNET_JSON_spec_boolean(), GNUNET_JSON_spec_end(), GNUNET_JSON_spec_fixed(), GNUNET_JSON_spec_gnsrecord(), GNUNET_JSON_spec_json(), GNUNET_JSON_spec_mark_optional(), GNUNET_JSON_spec_relative_time(), GNUNET_JSON_spec_rsa_public_key(), GNUNET_JSON_spec_rsa_signature(), GNUNET_JSON_spec_string(), GNUNET_JSON_spec_uint16(), GNUNET_JSON_spec_uint32(), GNUNET_JSON_spec_uint64(), GNUNET_JSON_spec_uint8(), GNUNET_JSON_spec_varsize(), GNUNET_LOAD_value_init(), GNUNET_MQ_env_combine_options(), GNUNET_MQ_inject_message(), GNUNET_MST_create(), GNUNET_MST_from_buffer(), GNUNET_MST_read(), GNUNET_MY_extract_result(), GNUNET_NAT_stun_handle_packet_(), GNUNET_NETWORK_socket_accept(), GNUNET_NETWORK_socket_bind(), GNUNET_NETWORK_socket_box_native(), GNUNET_NETWORK_socket_close(), GNUNET_NETWORK_socket_connect(), GNUNET_NETWORK_socket_create(), GNUNET_NETWORK_socket_disable_corking(), GNUNET_NETWORK_socket_getsockopt(), GNUNET_NETWORK_socket_listen(), GNUNET_NETWORK_socket_recv(), GNUNET_NETWORK_socket_recvfrom(), GNUNET_NETWORK_socket_send(), GNUNET_NETWORK_socket_sendto(), GNUNET_NETWORK_socket_setsockopt(), GNUNET_NETWORK_socket_shutdown(), GNUNET_NETWORK_test_pf(), GNUNET_NETWORK_test_port_free(), GNUNET_NETWORK_unix_precheck(), GNUNET_OS_process_kill(), GNUNET_OS_process_wait(), GNUNET_OS_start_process(), GNUNET_OS_start_process_va(), GNUNET_PEER_intern(), GNUNET_PLUGIN_load(), GNUNET_PLUGIN_unload(), GNUNET_PQ_eval_prepared_multi_select(), GNUNET_PQ_exec_prepared(), GNUNET_PQ_extract_result(), GNUNET_PQ_prepare_statements(), GNUNET_PROGRAM_run2(), gnunet_read(), GNUNET_RECLAIM_ATTRIBUTE_number_to_typename(), GNUNET_RECLAIM_ATTRIBUTE_typename_to_number(), GNUNET_RECLAIM_ATTRIBUTE_value_to_string(), GNUNET_RECLAIM_JSON_spec_claim(), GNUNET_RECLAIM_JSON_spec_ticket(), GNUNET_RESOLVER_local_fqdn_get(), GNUNET_SCHEDULER_add_now_with_lifeness(), GNUNET_SCHEDULER_cancel(), GNUNET_SCHEDULER_get_load(), GNUNET_SERVER_mst_create(), GNUNET_SERVER_mst_receive(), GNUNET_SERVICE_run_(), GNUNET_SIGNAL_handler_install(), GNUNET_snprintf(), GNUNET_SQ_prepare(), GNUNET_STRINGS_base64_decode(), GNUNET_STRINGS_base64_encode(), GNUNET_STRINGS_byte_size_fancy(), GNUNET_STRINGS_conv(), GNUNET_STRINGS_fancy_time_to_relative(), GNUNET_STRINGS_parse_ipv6_policy(), GNUNET_STRINGS_string_to_data(), GNUNET_STRINGS_to_address_ipv6(), GNUNET_TESTBED_extract_config_(), GNUNET_TESTBED_test_run(), GNUNET_TESTBED_underlay_construct_(), GNUNET_TESTING_get_testname_from_underscore(), GNUNET_TESTING_peer_wait(), GNUNET_TESTING_reserve_port(), GNUNET_TIME_absolute_add(), GNUNET_TIME_absolute_get(), GNUNET_TIME_absolute_get_difference(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_absolute_get_remaining(), GNUNET_TIME_absolute_hton(), GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_absolute_subtract(), GNUNET_TIME_calculate_eta(), GNUNET_TIME_relative_add(), GNUNET_TIME_relative_divide(), GNUNET_TIME_relative_hton(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_relative_ntoh(), GNUNET_TIME_relative_saturating_multiply(), GNUNET_TIME_relative_subtract(), GNUNET_TIME_relative_to_absolute(), GNUNET_TIME_year_to_time(), GNUNET_TRANSPORT_TESTING_get_config_name(), GNUNET_TRANSPORT_TESTING_get_test_name(), GNUNET_TRANSPORT_TESTING_get_test_plugin_name(), GNUNET_TRANSPORT_TESTING_main_(), GNUNET_xmalloc_(), GNUNET_xmemdup_(), GNUNET_xnew_array_2d_(), GNUNET_xnew_array_3d_(), GSC_TYPEMAP_extend(), GSC_TYPEMAP_get_from_message(), GST_neighbours_calculate_receive_delay(), GST_receive_callback(), GST_validation_handle_ping(), habitability_check(), handle_lookup_block(), handle_request_connection_reversal(), handle_revoke_message(), handle_verify_result(), http_common_plugin_address_pretty_printer(), inflate_data(), insert_in_view(), ipv4_to_regex(), ipv6_to_regex(), iterator_cb(), kwait(), libgnunet_plugin_transport_tcp_init(), load_cert_from_file(), load_key_from_file(), load_plugin(), load_quota(), mac_set(), main(), maint_child_death(), make_peer(), make_serialization_file_name(), make_serialization_file_name_in_dir(), make_udp_socket(), monitor_iteration_next(), mst_create(), mst_receive(), mysql_plugin_estimate_size(), mysql_plugin_get_keys(), namecache_sqlite_lookup_block(), namestore_postgres_store_records(), namestore_sqlite_store_records(), nibble_to_regex(), notify_connect(), notify_send_probe(), num_to_regex(), ogg_demux_and_decode(), op_get_element(), open_socket(), os_get_exec_path(), os_get_gnunet_path(), parent_control_handler(), parse_configuration_file(), parse_hello_uri(), parse_name(), parse_quota(), pass_plaintext_to_core(), peerstore_sqlite_delete_records(), percent_decode_keyword(), perform_dht_put(), port_to_regex(), postgres_plugin_estimate_size(), postgres_plugin_put(), postgres_plugin_remove_key(), prepare_daemon(), process_data(), process_incoming(), process_payload(), process_status(), queue(), receive_ready(), recursive_dns_resolution(), repl_proc(), reply_to_dns(), reservations_reserve(), resolver_lookup_get_next_label(), resume_client_receive(), rfn_noncontested(), run(), run_zbar(), s2i_full(), secret_ready_cb(), select_del(), select_read_cb(), send_client_element(), serve_main_page(), server_get_addresses(), server_schedule(), service_client_recv(), service_manage_result_cb(), set_result_cb(), setup_db(), setup_service(), sigchld_handler(), sockaddr_to_udpaddr_string(), sqlite_plugin_get_keys(), sqlite_plugin_put(), start_process(), store_and_free_entries(), store_peer_presistently_iterator(), store_valid_peers(), stun_read_task(), test_service_configuration(), test_wlan_interface(), tokenizer_cb(), translate_dot_plus(), transmit_content(), transmit_ping_if_allowed(), transmit_ready(), unix_plugin_address_pretty_printer(), unix_plugin_do_read(), updateUsage(), uri_chk_parse(), uri_chk_to_string(), uri_ksk_parse(), uri_ksk_to_string(), uri_loc_to_string(), uri_sks_parse(), uri_sks_to_string(), wlan_plugin_address_pretty_printer(), write_data(), and write_wav_header().

◆ subject

char* subject
static

Subject pubkey string.

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

Referenced by GNUNET_ABD_delegate_issue(), main(), OIDC_id_token_new(), run(), sign_cb(), and store_cb().

◆ subject_delegate

char* subject_delegate
static

Subject delegate string.

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

Referenced by main(), and run().

◆ expiration

char* expiration
static

◆ subject_pkey

struct GNUNET_CRYPTO_EcdsaPublicKey subject_pkey

◆ issuer_pkey

struct GNUNET_CRYPTO_EcdsaPublicKey issuer_pkey

Issuer key.

Definition at line 106 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 112 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 117 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 122 of file gnunet-abd.c.

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

◆ verify

int verify
static

Verify mode.

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

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

◆ collect

int collect
static

Collect mode.

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

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

◆ create_is

int create_is
static

Create mode.

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

Referenced by main(), and run().

◆ create_ss

int create_ss
static

Create mode.

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

Referenced by main(), and run().

◆ sign_ss

int sign_ss
static

Create mode.

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

Referenced by main(), and run().

◆ import

char* import
static

Signed issue credentials.

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

◆ is_private

int is_private
static

Is record private.

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

Referenced by get_existing_record(), and main().

◆ forward

int forward
static

Search direction: forward.

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

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

◆ backward

int backward
static

Search direction: backward.

Definition at line 167 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 172 of file gnunet-abd.c.

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

◆ add_qe

struct GNUNET_NAMESTORE_QueueEntry* add_qe
static

Queue entry for the 'add' operation.

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

◆ data

void* data
static

Value in binary format.

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

Referenced by get_existing_record(), and store_cb().

◆ data_size

size_t data_size
static

◆ type

uint32_t type
static

Type string converted to DNS type value.

Definition at line 192 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 197 of file gnunet-abd.c.

Referenced by display_records_from_block(), and store_cb().

◆ etime

uint64_t etime
static

Expiration string converted to numeric value.

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

Referenced by generate_gns_certificate(), 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 206 of file gnunet-abd.c.

Referenced by get_existing_record(), and store_cb().

◆ key_length

const int key_length = 52
static

Fixed size of the public/private keys.

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

Referenced by sign_cb().

◆ record_label

char* record_label
static

Record label for storing delegations.

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

Referenced by run(), and store_cb().