GNUnet 0.25.2-11-g84e94e98c
 
Loading...
Searching...
No Matches
gnunet-abd.c File Reference

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

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.
 
static void do_timeout (void *cls)
 Task run on timeout.
 
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.
 
static int parse_expiration (const char *expirationstring, int *etime_is_rel_, uint64_t *etime_)
 Parse expiration time.
 
static void error_cb (void *cls)
 Function called if lookup fails.
 
static void add_continuation (void *cls, enum GNUNET_ErrorCode ec)
 
static void get_existing_record (void *cls, const struct GNUNET_CRYPTO_BlindablePrivateKey *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.
 
int main (int argc, char *const *argv)
 The main function for gnunet-gns.
 

Variables

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

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:980

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.

Here is the call 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:567

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.
char * GNUNET_CRYPTO_blindable_public_key_to_string(const struct GNUNET_CRYPTO_BlindablePublicKey *key)
Creates a (Base32) string representation of the public key.
struct GNUNET_CRYPTO_BlindablePublicKey subject_key
Public key of the subject this attribute was delegated to.
const char * issuer_attribute
The attribute.
struct GNUNET_CRYPTO_BlindablePublicKey issuer_key
The issuer of the delegation.
const char * subject_attribute
The attribute.

References GNUNET_CRYPTO_blindable_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)
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 ;
338 sub_key = GNUNET_CRYPTO_blindable_public_key_to_string (&dc[i].subject_key
339 );
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 issuer_key);
367 subject_key);
368 printf ("%s.%s <- %s\n", iss_key, dele[i].issuer_attribute, sub_key);
369 GNUNET_free (iss_key);
370 GNUNET_free (sub_key);
371 }
372 printf ("Successful.\n");
373 }
374
376}
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_blindable_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 387 of file gnunet-abd.c.

388{
389 const struct GNUNET_CRYPTO_BlindablePrivateKey *privkey;
390
391 el = NULL;
392 if (NULL == ego)
393 {
394 if (NULL != ego_name)
395 {
396 fprintf (stderr,
397 _ ("Ego `%s' not known to identity service\n"),
398 ego_name);
399 }
401 return;
402 }
403
404 if (GNUNET_YES == collect)
405 {
406
407 if (GNUNET_OK !=
409 &issuer_pkey))
410 {
411 fprintf (stderr,
412 _ ("Issuer public key `%s' is not well-formed\n"),
413 issuer_key);
415 }
417
421 privkey,
422 direction,
424 NULL,
426 NULL);
427 return;
428 }
430}
static struct GNUNET_ABD_Request * collect_request
Handle to collect request.
Definition gnunet-abd.c:72
struct GNUNET_CRYPTO_BlindablePublicKey issuer_pkey
Issuer key.
Definition gnunet-abd.c:107
static char * issuer_attr
Issuer attribute.
Definition gnunet-abd.c:123
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_BlindablePublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_BlindablePrivateKey *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_BlindablePrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blindable_public_key_from_string(const char *str, struct GNUNET_CRYPTO_BlindablePublicKey *key)
Parses a (Base32) string representation of the public key.
@ GNUNET_OK
@ GNUNET_YES
#define _(String)
GNU gettext support macro.
Definition platform.h:179
A private key for an identity as per LSD0001.

References _, abd, collect, collect_request, direction, ego_name, el, GNUNET_ABD_collect(), GNUNET_CRYPTO_blindable_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 442 of file gnunet-abd.c.

445{
446 // copied from namestore/gnunet-namestore.c
447 struct GNUNET_TIME_Relative etime_rel;
448 struct GNUNET_TIME_Absolute etime_abs;
449
450 if (0 == strcmp (expirationstring, "never"))
451 {
453 *etime_is_rel_ = GNUNET_NO;
454 return GNUNET_OK;
455 }
456 if (GNUNET_OK ==
458 {
459 *etime_is_rel_ = GNUNET_YES;
460 *etime_ = etime_rel.rel_value_us;
462 "Storing record with relative expiration time of %s\n",
464 return GNUNET_OK;
465 }
466 if (GNUNET_OK ==
468 {
469 *etime_is_rel_ = GNUNET_NO;
470 *etime_ = etime_abs.abs_value_us;
472 "Storing record with absolute expiration time of %s\n",
474 return GNUNET_OK;
475 }
476 return GNUNET_SYSERR;
477}
static char * expirationstring
Optional expiration string -E.
#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:599
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
Definition strings.c:660
#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:303
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
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 484 of file gnunet-abd.c.

485{
486 fprintf (stderr, "Error occurred during lookup, shutting down.\n");
488 return;
489}

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 493 of file gnunet-abd.c.

494{
495 struct GNUNET_NAMESTORE_QueueEntry **qe = cls;
496 *qe = NULL;
497
498 if (GNUNET_EC_NONE == ec)
499 printf ("Adding successful.\n");
500 else
501 fprintf (stderr, "Error: `%s'.\n", GNUNET_ErrorCode_get_hint (ec));
502
504}
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.

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_BlindablePrivateKey zone_key,
const char *  rec_name,
unsigned int  rd_count,
const struct GNUNET_GNSRECORD_Data rd 
)
static

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

513{
514 struct GNUNET_GNSRECORD_Data *rde;
515 struct GNUNET_GNSRECORD_Data*rdn =
516 GNUNET_malloc (sizeof(*rdn) * (rd_count + 1));
517
518 memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data));
519 GNUNET_memcpy (&rdn[1], rd,
520 rd_count * sizeof (struct GNUNET_GNSRECORD_Data));
521 rde = &rdn[0];
522 rde->data = data;
523 rde->data_size = data_size;
524 rde->record_type = type;
525
526 // Set flags
527 if (GNUNET_YES == is_private)
529 rde->expiration_time = etime;
532 else if (GNUNET_NO != etime_is_rel)
534
535 GNUNET_assert (NULL != rec_name);
537 &zone_pkey,
538 rec_name,
539 rd_count + 1,
540 rde,
542 &add_qe);
543 GNUNET_free (rdn);
544 return;
545}
static struct GNUNET_CRYPTO_BlindablePrivateKey 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:493
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_BlindablePrivateKey *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 549 of file gnunet-abd.c.

550{
551 const struct GNUNET_CONFIGURATION_Handle *cfg_ = cls;
553 struct GNUNET_CRYPTO_BlindablePublicKey zone_pubkey;
554 char *subject_pubkey_str;
555 char *zone_pubkey_str;
556
557 el = NULL;
558
560 if (NULL == ns)
561 {
563 _ ("Failed to connect to namestore\n"));
565 return;
566 }
567
568 if (NULL == ego)
569 {
571 _ ("Ego does not exist!\n"));
573 return;
574 }
575
576 // Key handling
578
580 {
581 // Parse import
583
584 if (NULL == cred)
585 {
586 fprintf (stderr,
587 "%s is not a valid credential\n", import);
589 return;
590 }
591
592 // Get import subject public key string
593 subject_pubkey_str =
595
596 // Get zone public key string
597 GNUNET_IDENTITY_ego_get_public_key (ego, &zone_pubkey);
598 zone_pubkey_str =
600
601 // Check if the subject key in the signed import matches the zone's key it is issued to
602 if (strcmp (zone_pubkey_str, subject_pubkey_str) != 0)
603 {
604 fprintf (stderr,
605 "Import signed delegate does not match this ego's public key.\n")
606 ;
609 return;
610 }
611
612 // Expiration
613 etime = cred->expiration.abs_value_us;
615
616 // Prepare the data to be store in the record
619 }
620 else
621 {
622 // For all other types e.g. GNUNET_GNSRECORD_TYPE_ATTRIBUTE
623 if (GNUNET_OK !=
625 {
626 if (typestring == NULL)
627 {
628 fputs ("Value for unknown record type not well-formed.\n", stderr);
629 }
630 else if (subject == NULL)
631 {
632 fprintf (stderr,
633 "Value for record type `%s' not well-formed.\n",
634 typestring);
635 }
636 else
637 {
638 fprintf (stderr,
639 "Value `%s' invalid for record type `%s'\n",
640 subject,
641 typestring);
642 }
644 return;
645 }
646
647 // Take care of expiration
648 if (NULL == expiration)
649 {
650 fprintf (stderr, "Missing option -e for operation 'create'\n");
652 return;
653 }
655 {
656 fprintf (stderr, "Invalid time format `%s'\n", expiration);
658 return;
659 }
660 }
661
662 // Start lookup
664 &zone_pkey,
666 &error_cb,
667 NULL,
669 NULL);
670 return;
671}
int GNUNET_ABD_delegate_serialize(struct GNUNET_ABD_Delegate *dele, char **data)
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_from_string(const char *s)
#define GNUNET_GNSRECORD_TYPE_DELEGATE
For ABD policies.
static const char * record_label
Record label for storing delegations.
Definition gnunet-abd.c:212
static void get_existing_record(void *cls, const struct GNUNET_CRYPTO_BlindablePrivateKey *zone_key, const char *rec_name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Definition gnunet-abd.c:508
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:442
static void error_cb(void *cls)
Function called if lookup fails.
Definition gnunet-abd.c:484
static char * subject
Subject pubkey string.
Definition gnunet-abd.c:87
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:169
void GNUNET_IDENTITY_ego_get_public_key(struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_CRYPTO_BlindablePublicKey *pk)
Get the identifier (public key) of an ego.
@ GNUNET_ERROR_TYPE_ERROR
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_BlindablePrivateKey *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.
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_blindable_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 675 of file gnunet-abd.c.

676{
677 const struct GNUNET_CRYPTO_BlindablePrivateKey *privkey;
678 struct GNUNET_ABD_Delegate *dele;
679 struct GNUNET_TIME_Absolute etime_abs;
680 char *res;
681 char *subject_pubkey_str;
682 char *subject_attr = NULL;
683 char *token;
684
685 el = NULL;
686
687 // work on expiration time
688 if (NULL == expiration)
689 {
690 fprintf (stderr, "Please specify a TTL\n");
692 return;
693 }
694 else if (GNUNET_OK !=
696 {
697 fprintf (stderr,
698 "%s is not a valid ttl! Only absolute times are accepted!\n",
699 expiration);
701 return;
702 }
703
704 // If contains a space - split it by the first space only - assume first entry is subject followed by attribute(s)
705
706 // Subject Public Key
707 token = strtok (subject, " ");
708 subject_pubkey_str = token;
709 // Subject Attribute(s)
710 token = strtok (NULL, " ");
711 if (NULL != token)
712 {
713 subject_attr = token;
714 }
715
716 // work on keys
718
719 if (NULL == subject_pubkey_str)
720 {
721 fprintf (stderr,
722 "Subject pubkey not given\n");
724 return;
725 }
726 if (GNUNET_OK !=
728 &subject_pkey))
729 {
730 fprintf (stderr,
731 "Subject public key `%s' is not well-formed\n",
732 subject_pubkey_str);
734 return;
735 }
736
737 // Sign delegate
738 dele = GNUNET_ABD_delegate_issue (privkey,
741 subject_attr,
742 &etime_abs);
744 GNUNET_free (dele);
745 printf ("%s\n", res);
746
748 ego_name = NULL;
749
751}
struct GNUNET_CRYPTO_BlindablePublicKey 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_BlindablePrivateKey *issuer, struct GNUNET_CRYPTO_BlindablePublicKey *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_blindable_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 763 of file gnunet-abd.c.

767{
768 cfg = c;
769
772
773 // Check relevant cmdline parameters
774 if (GNUNET_YES == create_is)
775 {
776 if (NULL == ego_name)
777 {
778 fprintf (stderr, "Missing option '-ego'\n");
780 return;
781 }
782 if (NULL == issuer_attr)
783 {
784 fprintf (stderr, "Missing option '-attribute' for issuer attribute\n");
786 return;
787 }
788 if (NULL == subject)
789 {
790 fprintf (stderr, "Missing option -subject for operation 'create'.'\n");
792 return;
793 }
794
795 // Lookup ego, on success call store_cb and store as ATTRIBUTE type
799 return;
800 }
801
802 if (GNUNET_YES == create_ss)
803 {
804
805 // check if signed parameter has been passed in cmd line call
806 if (NULL == import)
807 {
808 fprintf (stderr, "'import' required\n");
810 return;
811 }
812
815 // Store subject side
817
818 return;
819 }
820
821 if (GNUNET_YES == sign_ss)
822 {
823 if (NULL == ego_name)
824 {
825 fprintf (stderr, "ego required\n");
827 return;
828 }
829 if (NULL == subject)
830 {
831 fprintf (stderr, "Subject public key needed\n");
833 return;
834 }
835
836 // lookup ego and call function sign_cb on success
838 return;
839 }
840
841 if ((GNUNET_NO == forward) && (GNUNET_NO == backward))
842 {
843 // set default: bidirectional
846 }
847 if (GNUNET_YES == forward)
849 if (GNUNET_YES == backward)
851
852 if (GNUNET_YES == collect)
853 {
854 if (NULL == issuer_key)
855 {
856 fprintf (stderr, _ ("Issuer public key not well-formed\n"));
858 return;
859 }
860
862
863 if (NULL == abd)
864 {
865 fprintf (stderr, _ ("Failed to connect to ABD\n"));
867 return;
868 }
869 if (NULL == issuer_attr)
870 {
871 fprintf (stderr, _ ("You must provide issuer the attribute\n"));
873 return;
874 }
875
876 if (NULL == ego_name)
877 {
878 fprintf (stderr, _ ("ego required\n"));
880 return;
881 }
883 return;
884 }
885
886 if (NULL == subject)
887 {
888 fprintf (stderr, _ ("Subject public key needed\n"));
890 return;
891 }
894 ))
895 {
896 fprintf (stderr,
897 _ ("Subject public key `%s' is not well-formed\n"),
898 subject);
900 return;
901 }
902
903 if (GNUNET_YES == verify)
904 {
905 if (NULL == issuer_key)
906 {
907 fprintf (stderr, _ ("Issuer public key not well-formed\n"));
909 return;
910 }
911 if (GNUNET_OK !=
913 &issuer_pkey))
914 {
915 fprintf (stderr,
916 _ ("Issuer public key `%s' is not well-formed\n"),
917 issuer_key);
919 return;
920 }
922
923 if (NULL == abd)
924 {
925 fprintf (stderr, _ ("Failed to connect to ABD\n"));
927 return;
928 }
929 if ((NULL == issuer_attr) || (NULL == subject_delegate))
930 {
931 fprintf (stderr, _ ("You must provide issuer and subject attributes\n"));
933 return;
934 }
935
936 // Subject credentials are comma separated
937 {
938 struct GNUNET_ABD_Delegate *delegates;
939 struct GNUNET_ABD_Delegate *dele;
940 char *tmp = GNUNET_strdup (subject_delegate);
941 char *tok = strtok (tmp, ",");
942 int count = 1;
943 int i;
944 if (NULL == tok)
945 {
946 fprintf (stderr, "Invalid subject credentials\n");
947 GNUNET_free (tmp);
949 return;
950 }
951 while (NULL != (tok = strtok (NULL, ",")))
952 count++;
953 delegates = GNUNET_malloc (sizeof(*delegates) * count);
954 GNUNET_free (tmp);
956 tok = strtok (tmp, ",");
957 for (i = 0; i < count; i++)
958 {
960 GNUNET_memcpy (&delegates[i],
961 dele,
962 sizeof (struct GNUNET_ABD_Delegate));
963 delegates[i].issuer_attribute = GNUNET_strdup (dele->issuer_attribute);
964 tok = strtok (NULL, ",");
965 GNUNET_free (dele);
966 }
967
972 count,
973 delegates,
974 direction,
976 NULL,
978 NULL);
979 for (i = 0; i < count; i++)
980 {
981 GNUNET_free_nz ((char *) delegates[i].issuer_attribute);
982 delegates[i].issuer_attribute = NULL;
983 }
984 GNUNET_free (tmp);
985 GNUNET_free (delegates);
986 }
987 }
988 else
989 {
990 fprintf (stderr,
991 _ (
992 "Please specify name to lookup, subject key and issuer key!\n"));
994 }
995 return;
996}
#define GNUNET_GNSRECORD_TYPE_ATTRIBUTE
For ABD reverse lookups.
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:387
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:675
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:549
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
static int do_shutdown
Set to GNUNET_YES if we are shutting down.
struct GNUNET_ABD_Request * GNUNET_ABD_verify(struct GNUNET_ABD_Handle *handle, const struct GNUNET_CRYPTO_BlindablePublicKey *issuer_key, const char *issuer_attribute, const struct GNUNET_CRYPTO_BlindablePublicKey *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
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
@ 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:1339
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:1277
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_blindable_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 1007 of file gnunet-abd.c.

1008{
1011 "verify",
1012 gettext_noop (
1013 "verify credential against attribute"),
1014 &verify),
1016 's',
1017 "subject",
1018 "PKEY",
1019 gettext_noop (
1020 "The public key of the subject to lookup the"
1021 "credential for, or for issuer side storage: subject and its attributes")
1022 ,
1023 &subject),
1025 'd',
1026 "delegate",
1027 "DELE",
1028 gettext_noop ("The private, signed delegate presented by the subject"),
1031 'i',
1032 "issuer",
1033 "PKEY",
1034 gettext_noop (
1035 "The public key of the authority to verify the credential against"),
1036 &issuer_key),
1038 "ego",
1039 "EGO",
1040 gettext_noop ("The ego/zone name to use"),
1041 &ego_name),
1043 'a',
1044 "attribute",
1045 "ATTR",
1046 gettext_noop ("The issuer attribute to verify against or to issue"),
1047 &issuer_attr),
1049 "ttl",
1050 "EXP",
1051 gettext_noop (
1052 "The time to live for the credential."
1053 "e.g. 5m, 6h, \"1990-12-30 12:00:00\""),
1054 &expiration),
1056 "collect",
1057 gettext_noop ("collect credentials"),
1058 &collect),
1060 "createIssuerSide",
1061 gettext_noop (
1062 "Create and issue a credential issuer side."),
1063 &create_is),
1065 "createSubjectSide",
1066 gettext_noop (
1067 "Issue a credential subject side."),
1068 &create_ss),
1070 'S',
1071 "signSubjectSide",
1072 gettext_noop ("Create, sign and return a credential subject side."),
1073 &sign_ss),
1075 'x',
1076 "import",
1077 "IMP",
1078 gettext_noop (
1079 "Import signed credentials that should be issued to a zone/ego"),
1080 &import),
1082 "private",
1083 gettext_noop ("Create private record entry."),
1084 &is_private),
1086 'F',
1087 "forward",
1088 gettext_noop (
1089 "Indicates that the collect/verify process is done via forward search."),
1090 &forward),
1092 'B',
1093 "backward",
1094 gettext_noop (
1095 "Indicates that the collect/verify process is done via forward search."),
1096 &backward),
1098
1099
1101 GNUNET_log_setup ("gnunet-abd", "WARNING", NULL);
1103 argc,
1104 argv,
1105 "gnunet-abd",
1106 _ ("GNUnet abd resolver tool"),
1107 options,
1108 &run,
1109 NULL))
1110 ret = 1;
1111 return ret;
1112}
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:763
#define GNUNET_GETOPT_OPTION_END
Marker for the end of the list of options.
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.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(const struct GNUNET_OS_ProjectData *pd, 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:407
#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_OS_project_data_gnunet(), 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_BlindablePrivateKey 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

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().