GNUnet  0.18.1
Collaboration diagram for Reclaim attributes:

Data Structures

struct  GNUNET_RECLAIM_Identifier
 A reclaim identifier FIXME maybe put this in a different namespace. More...
 
struct  GNUNET_RECLAIM_Attribute
 An attribute. More...
 
struct  GNUNET_RECLAIM_Credential
 A credential. More...
 
struct  GNUNET_RECLAIM_Presentation
 A credential presentation. More...
 
struct  GNUNET_RECLAIM_AttributeList
 A list of GNUNET_RECLAIM_Attribute structures. More...
 
struct  GNUNET_RECLAIM_AttributeListEntry
 
struct  GNUNET_RECLAIM_CredentialList
 A list of GNUNET_RECLAIM_Credential structures. More...
 
struct  GNUNET_RECLAIM_CredentialListEntry
 
struct  GNUNET_RECLAIM_PresentationList
 A list of GNUNET_RECLAIM_Presentation structures. More...
 
struct  GNUNET_RECLAIM_PresentationListEntry
 

Macros

#define GNUNET_RECLAIM_ID_LENGTH   (256 / 8)
 We want an ID to be a 256-bit symmetric key. More...
 
#define GNUNET_RECLAIM_id_is_equal(a, b)
 
#define GNUNET_RECLAIM_id_is_zero(a)
 
#define GNUNET_RECLAIM_id_generate(id)
 

Enumerations

enum  GNUNET_RECLAIM_AttributeType { GNUNET_RECLAIM_ATTRIBUTE_TYPE_NONE = 0 , GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING = 1 }
 
enum  GNUNET_RECLAIM_CredentialType { GNUNET_RECLAIM_CREDENTIAL_TYPE_NONE = 0 , GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT = 1 , GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC = 2 }
 

Functions

struct GNUNET_RECLAIM_AttributeGNUNET_RECLAIM_attribute_new (const char *attr_name, const struct GNUNET_RECLAIM_Identifier *credential, uint32_t type, const void *data, size_t data_size)
 Create a new attribute claim. More...
 
size_t GNUNET_RECLAIM_attribute_list_serialize_get_size (const struct GNUNET_RECLAIM_AttributeList *attrs)
 Get required size for serialization buffer. More...
 
void GNUNET_RECLAIM_attribute_list_destroy (struct GNUNET_RECLAIM_AttributeList *attrs)
 Destroy claim list. More...
 
void GNUNET_RECLAIM_attribute_list_add (struct GNUNET_RECLAIM_AttributeList *attrs, const char *attr_name, const struct GNUNET_RECLAIM_Identifier *credential, uint32_t type, const void *data, size_t data_size)
 Add a new attribute to a claim list. More...
 
size_t GNUNET_RECLAIM_attribute_list_serialize (const struct GNUNET_RECLAIM_AttributeList *attrs, char *result)
 Serialize an attribute list. More...
 
struct GNUNET_RECLAIM_AttributeListGNUNET_RECLAIM_attribute_list_deserialize (const char *data, size_t data_size)
 Deserialize an attribute list. More...
 
size_t GNUNET_RECLAIM_attribute_serialize_get_size (const struct GNUNET_RECLAIM_Attribute *attr)
 Get required size for serialization buffer. More...
 
size_t GNUNET_RECLAIM_attribute_serialize (const struct GNUNET_RECLAIM_Attribute *attr, char *result)
 Serialize an attribute. More...
 
ssize_t GNUNET_RECLAIM_attribute_deserialize (const char *data, size_t data_size, struct GNUNET_RECLAIM_Attribute **attr)
 Deserialize an attribute. More...
 
struct GNUNET_RECLAIM_AttributeListGNUNET_RECLAIM_attribute_list_dup (const struct GNUNET_RECLAIM_AttributeList *attrs)
 Make a (deep) copy of a claim list. More...
 
uint32_t GNUNET_RECLAIM_attribute_typename_to_number (const char *typename)
 Convert a type name to the corresponding number. More...
 
int GNUNET_RECLAIM_attribute_string_to_value (uint32_t type, const char *s, void **data, size_t *data_size)
 Convert human-readable version of a 'claim' of an attribute to the binary representation. More...
 
char * GNUNET_RECLAIM_attribute_value_to_string (uint32_t type, const void *data, size_t data_size)
 Convert the 'claim' of an attribute to a string. More...
 
const char * GNUNET_RECLAIM_attribute_number_to_typename (uint32_t type)
 Convert a type number to the corresponding type string. More...
 
size_t GNUNET_RECLAIM_credential_list_serialize_get_size (const struct GNUNET_RECLAIM_CredentialList *credentials)
 Get required size for serialization buffer. More...
 
void GNUNET_RECLAIM_credential_list_destroy (struct GNUNET_RECLAIM_CredentialList *credentials)
 Destroy credential list. More...
 
void GNUNET_RECLAIM_credential_list_add (struct GNUNET_RECLAIM_CredentialList *attrs, const char *att_name, uint32_t type, const void *data, size_t data_size)
 Add a new attribute to a claim list. More...
 
size_t GNUNET_RECLAIM_credential_list_serialize (const struct GNUNET_RECLAIM_CredentialList *credentials, char *result)
 Serialize a credential list. More...
 
struct GNUNET_RECLAIM_CredentialListGNUNET_RECLAIM_credential_list_deserialize (const char *data, size_t data_size)
 Deserialize an attribute list. More...
 
size_t GNUNET_RECLAIM_credential_serialize_get_size (const struct GNUNET_RECLAIM_Credential *credential)
 Get required size for serialization buffer. More...
 
size_t GNUNET_RECLAIM_credential_serialize (const struct GNUNET_RECLAIM_Credential *credential, char *result)
 Serialize an credential. More...
 
struct GNUNET_RECLAIM_CredentialGNUNET_RECLAIM_credential_deserialize (const char *data, size_t data_size)
 Deserialize an credential. More...
 
struct GNUNET_RECLAIM_CredentialGNUNET_RECLAIM_credential_new (const char *name, uint32_t type, const void *data, size_t data_size)
 Create a new credential. More...
 
char * GNUNET_RECLAIM_credential_value_to_string (uint32_t type, const void *data, size_t data_size)
 Convert the 'claim' of an credential to a string. More...
 
int GNUNET_RECLAIM_credential_string_to_value (uint32_t type, const char *s, void **data, size_t *data_size)
 Convert human-readable version of a 'claim' of an credential to the binary representation. More...
 
const char * GNUNET_RECLAIM_credential_number_to_typename (uint32_t type)
 Convert an credential type number to the corresponding credential type string. More...
 
uint32_t GNUNET_RECLAIM_credential_typename_to_number (const char *typename)
 Convert an credential type name to the corresponding number. More...
 
struct GNUNET_RECLAIM_AttributeListGNUNET_RECLAIM_credential_get_attributes (const struct GNUNET_RECLAIM_Credential *cred)
 Convert an credential type name to the corresponding number. More...
 
char * GNUNET_RECLAIM_credential_get_issuer (const struct GNUNET_RECLAIM_Credential *cred)
 
int GNUNET_RECLAIM_credential_get_expiration (const struct GNUNET_RECLAIM_Credential *cred, struct GNUNET_TIME_Absolute *exp)
 
size_t GNUNET_RECLAIM_presentation_list_serialize_get_size (const struct GNUNET_RECLAIM_PresentationList *presentations)
 Get required size for serialization buffer. More...
 
void GNUNET_RECLAIM_presentation_list_destroy (struct GNUNET_RECLAIM_PresentationList *presentations)
 Destroy presentations list. More...
 
size_t GNUNET_RECLAIM_presentation_list_serialize (const struct GNUNET_RECLAIM_PresentationList *presentations, char *result)
 Serialize a presentation list. More...
 
struct GNUNET_RECLAIM_PresentationListGNUNET_RECLAIM_presentation_list_deserialize (const char *data, size_t data_size)
 Deserialize a presentation list. More...
 
size_t GNUNET_RECLAIM_presentation_serialize_get_size (const struct GNUNET_RECLAIM_Presentation *presentation)
 Get required size for serialization buffer. More...
 
size_t GNUNET_RECLAIM_presentation_serialize (const struct GNUNET_RECLAIM_Presentation *presentation, char *result)
 Serialize a presentation. More...
 
struct GNUNET_RECLAIM_PresentationGNUNET_RECLAIM_presentation_deserialize (const char *data, size_t data_size)
 Deserialize a presentation. More...
 
char * GNUNET_RECLAIM_presentation_value_to_string (uint32_t type, const void *data, size_t data_size)
 Convert the 'claim' of a presentation to a string. More...
 
struct GNUNET_RECLAIM_PresentationGNUNET_RECLAIM_presentation_new (uint32_t type, const void *data, size_t data_size)
 
int GNUNET_RECLAIM_presentation_string_to_value (uint32_t type, const char *s, void **data, size_t *data_size)
 Convert human-readable version of a 'claim' of a presentation to the binary representation. More...
 
const char * GNUNET_RECLAIM_presentation_number_to_typename (uint32_t type)
 Convert a presentation type number to the corresponding credential type string. More...
 
struct GNUNET_RECLAIM_AttributeListGNUNET_RECLAIM_presentation_get_attributes (const struct GNUNET_RECLAIM_Presentation *cred)
 
char * GNUNET_RECLAIM_presentation_get_issuer (const struct GNUNET_RECLAIM_Presentation *cred)
 
int GNUNET_RECLAIM_presentation_get_expiration (const struct GNUNET_RECLAIM_Presentation *cred, struct GNUNET_TIME_Absolute *exp)
 
int GNUNET_RECLAIM_credential_get_presentation (const struct GNUNET_RECLAIM_Credential *cred, const struct GNUNET_RECLAIM_AttributeList *attrs, struct GNUNET_RECLAIM_Presentation **presentation)
 Create a presentation from a credential and a lift of (selected) attributes in the credential. More...
 

Variables

static const struct GNUNET_RECLAIM_Identifier GNUNET_RECLAIM_ID_ZERO
 

Detailed Description

Macro Definition Documentation

◆ GNUNET_RECLAIM_ID_LENGTH

#define GNUNET_RECLAIM_ID_LENGTH   (256 / 8)

We want an ID to be a 256-bit symmetric key.

Definition at line 77 of file gnunet_reclaim_lib.h.

◆ GNUNET_RECLAIM_id_is_equal

#define GNUNET_RECLAIM_id_is_equal (   a,
 
)
Value:
((0 == \
memcmp (a, \
b, \
? \
@ GNUNET_YES
@ GNUNET_NO
Definition: gnunet_common.h:98
static const struct GNUNET_RECLAIM_Identifier GNUNET_RECLAIM_ID_ZERO

Definition at line 93 of file gnunet_reclaim_lib.h.

◆ GNUNET_RECLAIM_id_is_zero

#define GNUNET_RECLAIM_id_is_zero (   a)
Value:
& \
#define GNUNET_RECLAIM_id_is_equal(a, b)

Definition at line 101 of file gnunet_reclaim_lib.h.

◆ GNUNET_RECLAIM_id_generate

#define GNUNET_RECLAIM_id_generate (   id)
Value:
id, \
void GNUNET_CRYPTO_random_block(enum GNUNET_CRYPTO_Quality mode, void *buffer, size_t length)
Fill block with a random values.
@ GNUNET_CRYPTO_QUALITY_STRONG
High-quality operations are desired.

Definition at line 105 of file gnunet_reclaim_lib.h.

Enumeration Type Documentation

◆ GNUNET_RECLAIM_AttributeType

Enumerator
GNUNET_RECLAIM_ATTRIBUTE_TYPE_NONE 

No value attribute.

GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING 

String attribute.

Definition at line 45 of file gnunet_reclaim_lib.h.

45  {
50 
55 };
@ GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING
String attribute.
@ GNUNET_RECLAIM_ATTRIBUTE_TYPE_NONE
No value attribute.

◆ GNUNET_RECLAIM_CredentialType

Enumerator
GNUNET_RECLAIM_CREDENTIAL_TYPE_NONE 

No value credential.

GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT 

A JSON Web Token credential.

GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC 

libpabc credential

Definition at line 57 of file gnunet_reclaim_lib.h.

57  {
62 
67 
72 };
@ GNUNET_RECLAIM_CREDENTIAL_TYPE_JWT
A JSON Web Token credential.
@ GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC
libpabc credential
@ GNUNET_RECLAIM_CREDENTIAL_TYPE_NONE
No value credential.

Function Documentation

◆ GNUNET_RECLAIM_attribute_new()

struct GNUNET_RECLAIM_Attribute* GNUNET_RECLAIM_attribute_new ( const char *  attr_name,
const struct GNUNET_RECLAIM_Identifier credential,
uint32_t  type,
const void *  data,
size_t  data_size 
)

Create a new attribute claim.

Parameters
attr_namethe attribute name
credentialID of the credential (may be NULL)
typethe attribute type
datathe attribute value. Must be attr_name if credential not NULL
data_sizethe attribute value size
Returns
the new attribute

Definition at line 254 of file reclaim_attribute.c.

260 {
261  struct GNUNET_RECLAIM_Attribute *attr;
262  char *write_ptr;
263  char *attr_name_tmp = GNUNET_strdup (attr_name);
264 
265  GNUNET_STRINGS_utf8_tolower (attr_name, attr_name_tmp);
266 
267  attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_Attribute)
268  + strlen (attr_name_tmp) + 1 + data_size);
269  if (NULL != credential)
270  attr->credential = *credential;
271  attr->type = type;
272  attr->data_size = data_size;
273  attr->flag = 0;
274  write_ptr = (char *) &attr[1];
275  GNUNET_memcpy (write_ptr, attr_name_tmp, strlen (attr_name_tmp) + 1);
276  attr->name = write_ptr;
277  write_ptr += strlen (attr->name) + 1;
278  GNUNET_memcpy (write_ptr, data, data_size);
279  attr->data = write_ptr;
280  GNUNET_free (attr_name_tmp);
281  return attr;
282 }
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
uint32_t data
The data value.
static char * attr_name
The attribute.
static struct GNUNET_RECLAIM_Identifier credential
Credential ID.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
enum GNUNET_GenericReturnValue GNUNET_STRINGS_utf8_tolower(const char *input, char *output)
Convert the utf-8 input string to lower case.
Definition: strings.c:450
const char * name
The name of the attribute.
struct GNUNET_RECLAIM_Identifier credential
Referenced ID of credential (may be GNUNET_RECLAIM_ID_ZERO if self-creded)
uint32_t type
Type of Claim.
const void * data
Binary value stored as attribute value.
size_t data_size
Number of bytes in data.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model

References attr_name, GNUNET_RECLAIM_Attribute::credential, credential, GNUNET_RECLAIM_Attribute::data, data, data_size, GNUNET_RECLAIM_Attribute::data_size, GNUNET_RECLAIM_Attribute::flag, GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_strdup, GNUNET_STRINGS_utf8_tolower(), GNUNET_RECLAIM_Attribute::name, GNUNET_RECLAIM_Attribute::type, and type.

Referenced by attribute_list_merge(), consume_ticket(), GNUNET_RECLAIM_attribute_list_add(), GNUNET_RECLAIM_attribute_list_dup(), iter_cb(), iter_finished(), oidc_attr_collect(), parse_attr(), and parse_jwt().

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

◆ GNUNET_RECLAIM_attribute_list_serialize_get_size()

size_t GNUNET_RECLAIM_attribute_list_serialize_get_size ( const struct GNUNET_RECLAIM_AttributeList al)

Get required size for serialization buffer.

Parameters
attrsthe attribute list to serialize
Returns
the required buffer size

Definition at line 313 of file reclaim_attribute.c.

315 {
317  size_t len = 0;
318 
319  for (ale = al->list_head; NULL != ale; ale = ale->next)
320  {
321  GNUNET_assert (NULL != ale->attribute);
323  }
324  return len;
325 }
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
size_t GNUNET_RECLAIM_attribute_serialize_get_size(const struct GNUNET_RECLAIM_Attribute *attr)
Get required size for serialization buffer.
struct GNUNET_RECLAIM_Attribute * attribute
The attribute claim.
struct GNUNET_RECLAIM_AttributeListEntry * next
DLL.
struct GNUNET_RECLAIM_AttributeListEntry * list_head
List head.

References GNUNET_RECLAIM_AttributeListEntry::attribute, GNUNET_assert, GNUNET_RECLAIM_attribute_serialize_get_size(), len, GNUNET_RECLAIM_AttributeList::list_head, and GNUNET_RECLAIM_AttributeListEntry::next.

Referenced by check_code_challenge(), consume_result_cb(), and GNUNET_RECLAIM_ticket_issue().

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

◆ GNUNET_RECLAIM_attribute_list_destroy()

void GNUNET_RECLAIM_attribute_list_destroy ( struct GNUNET_RECLAIM_AttributeList attrs)

Destroy claim list.

Parameters
attrslist to destroy

Definition at line 425 of file reclaim_attribute.c.

427 {
429  struct GNUNET_RECLAIM_AttributeListEntry *tmp_ale;
430 
431  for (ale = al->list_head; NULL != ale;)
432  {
433  if (NULL != ale->attribute)
434  GNUNET_free (ale->attribute);
435  tmp_ale = ale;
436  ale = ale->next;
437  GNUNET_free (tmp_ale);
438  }
439  GNUNET_free (al);
440 }

References GNUNET_RECLAIM_AttributeListEntry::attribute, GNUNET_free, GNUNET_RECLAIM_AttributeList::list_head, and GNUNET_RECLAIM_AttributeListEntry::next.

Referenced by cleanup_adh(), cleanup_cth(), cleanup_handle(), consume_fail(), cred_collect(), cred_iter_cb(), handle_consume_ticket_result(), handle_issue_ticket_message(), oidc_cred_collect_finished_cb(), and token_endpoint().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attribute_list_add()

void GNUNET_RECLAIM_attribute_list_add ( struct GNUNET_RECLAIM_AttributeList attrs,
const char *  attr_name,
const struct GNUNET_RECLAIM_Identifier credential,
uint32_t  type,
const void *  data,
size_t  data_size 
)

Add a new attribute to a claim list.

Parameters
attrsthe attribute list to add to
attr_namethe name of the new attribute claim
credentialcredential ID (may be NULL)
typethe type of the claim
dataclaim payload
data_sizeclaim payload size

Definition at line 286 of file reclaim_attribute.c.

293 {
295 
297  ale->attribute =
299  type, data, data_size);
300  GNUNET_CONTAINER_DLL_insert (al->list_head,
301  al->list_tail,
302  ale);
303 }
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_RECLAIM_Attribute * GNUNET_RECLAIM_attribute_new(const char *attr_name, const struct GNUNET_RECLAIM_Identifier *credential, uint32_t type, const void *data, size_t data_size)
Create a new attribute claim.

References attr_name, GNUNET_RECLAIM_AttributeListEntry::attribute, credential, data, data_size, GNUNET_CONTAINER_DLL_insert, GNUNET_new, GNUNET_RECLAIM_attribute_new(), GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_AttributeList::list_tail, and type.

Referenced by inspect_attrs(), and jwt_parse_attributes().

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

◆ GNUNET_RECLAIM_attribute_list_serialize()

size_t GNUNET_RECLAIM_attribute_list_serialize ( const struct GNUNET_RECLAIM_AttributeList attrs,
char *  result 
)

Serialize an attribute list.

Parameters
attrsthe attribute list to serialize
resultthe serialized attribute
Returns
length of serialized data

Definition at line 329 of file reclaim_attribute.c.

332 {
334  size_t len;
335  size_t total_len;
336  char *write_ptr;
337  write_ptr = result;
338  total_len = 0;
339  for (ale = attrs->list_head; NULL != ale; ale = ale->next)
340  {
341  GNUNET_assert (NULL != ale->attribute);
343  total_len += len;
344  write_ptr += len;
345  }
346  return total_len;
347 }
static int result
Global testing status.
size_t GNUNET_RECLAIM_attribute_serialize(const struct GNUNET_RECLAIM_Attribute *attr, char *result)
Serialize an attribute.

References GNUNET_RECLAIM_AttributeListEntry::attribute, GNUNET_assert, GNUNET_RECLAIM_attribute_serialize(), len, GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_AttributeListEntry::next, and result.

Referenced by check_code_challenge(), consume_result_cb(), and GNUNET_RECLAIM_ticket_issue().

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

◆ GNUNET_RECLAIM_attribute_list_deserialize()

struct GNUNET_RECLAIM_AttributeList* GNUNET_RECLAIM_attribute_list_deserialize ( const char *  data,
size_t  data_size 
)

Deserialize an attribute list.

Parameters
datathe serialized attribute list
data_sizethe length of the serialized data
Returns
a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller

Definition at line 358 of file reclaim_attribute.c.

359 {
360  struct GNUNET_RECLAIM_AttributeList *al;
362  size_t attr_len;
363  const char *read_ptr;
364  size_t left = data_size;
365 
367  if (data_size < sizeof(struct Attribute))
368  return al;
369  read_ptr = data;
370  while (left >= sizeof(struct Attribute))
371  {
373  attr_len =
375  left,
376  &ale->attribute);
377  if (-1 == attr_len)
378  {
380  "Failed to deserialize malformed attribute.\n");
381  GNUNET_free (ale);
382  return al;
383  }
384  left -= attr_len;
386  read_ptr += attr_len;
387  }
388  return al;
389 }
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_WARNING
ssize_t GNUNET_RECLAIM_attribute_deserialize(const char *data, size_t data_size, struct GNUNET_RECLAIM_Attribute **attr)
Deserialize an attribute.
Serialized claim.
A list of GNUNET_RECLAIM_Attribute structures.
struct GNUNET_RECLAIM_AttributeListEntry * list_tail
List tail.

References GNUNET_RECLAIM_AttributeListEntry::attribute, data, data_size, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_RECLAIM_attribute_deserialize(), GNUNET_RECLAIM_AttributeList::list_head, and GNUNET_RECLAIM_AttributeList::list_tail.

Referenced by handle_consume_ticket_result(), handle_issue_ticket_message(), and OIDC_parse_authz_code().

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

◆ GNUNET_RECLAIM_attribute_serialize_get_size()

size_t GNUNET_RECLAIM_attribute_serialize_get_size ( const struct GNUNET_RECLAIM_Attribute attr)

Get required size for serialization buffer.

Parameters
attrthe attribute to serialize
Returns
the required buffer size

Definition at line 450 of file reclaim_attribute.c.

452 {
453  return sizeof(struct Attribute) + strlen (attr->name) + attr->data_size;
454 }
const char * name

References data_size, and name.

Referenced by attr_store_task(), GNUNET_RECLAIM_attribute_delete(), GNUNET_RECLAIM_attribute_list_serialize_get_size(), GNUNET_RECLAIM_attribute_store(), and rvk_move_attr_cb().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attribute_serialize()

size_t GNUNET_RECLAIM_attribute_serialize ( const struct GNUNET_RECLAIM_Attribute attr,
char *  result 
)

Serialize an attribute.

Parameters
attrthe attribute to serialize
resultthe serialized attribute
Returns
length of serialized data

Definition at line 465 of file reclaim_attribute.c.

468 {
469  size_t data_len_ser;
470  size_t name_len;
471  struct Attribute *attr_ser;
472  char *write_ptr;
473 
474  attr_ser = (struct Attribute *) result;
475  attr_ser->attribute_type = htonl (attr->type);
476  attr_ser->attribute_flag = htonl (attr->flag);
477  attr_ser->attribute_id = attr->id;
478  attr_ser->credential_id = attr->credential;
479  name_len = strlen (attr->name);
480  attr_ser->name_len = htons (name_len);
481  write_ptr = (char *) &attr_ser[1];
482  GNUNET_memcpy (write_ptr, attr->name, name_len);
483  write_ptr += name_len;
484  // TODO plugin-ize
485  // data_len_ser = plugin->serialize_attribute_value (attr,
486  // &attr_ser[1]);
487  data_len_ser = attr->data_size;
488  GNUNET_memcpy (write_ptr, attr->data, attr->data_size);
489  attr_ser->data_size = htons (data_len_ser);
490 
491  return sizeof(struct Attribute) + strlen (attr->name) + attr->data_size;
492 }
struct GNUNET_RECLAIM_Identifier attribute_id
Attribute ID.
uint16_t name_len
Name length.
uint16_t data_size
Data size.
uint32_t attribute_type
Attribute type.
struct GNUNET_RECLAIM_Identifier credential_id
Credential ID.
uint32_t attribute_flag
Attribute flag.
struct GNUNET_RECLAIM_Identifier id
ID.

References Attribute::attribute_flag, Attribute::attribute_id, Attribute::attribute_type, GNUNET_RECLAIM_Attribute::credential, Attribute::credential_id, GNUNET_RECLAIM_Attribute::data, data_size, GNUNET_RECLAIM_Attribute::data_size, Attribute::data_size, GNUNET_RECLAIM_Attribute::flag, GNUNET_memcpy, GNUNET_RECLAIM_Attribute::id, name, GNUNET_RECLAIM_Attribute::name, Attribute::name_len, result, and GNUNET_RECLAIM_Attribute::type.

Referenced by attr_store_task(), GNUNET_RECLAIM_attribute_delete(), GNUNET_RECLAIM_attribute_list_serialize(), GNUNET_RECLAIM_attribute_store(), and rvk_move_attr_cb().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attribute_deserialize()

ssize_t GNUNET_RECLAIM_attribute_deserialize ( const char *  data,
size_t  data_size,
struct GNUNET_RECLAIM_Attribute **  attr 
)

Deserialize an attribute.

Parameters
datathe serialized attribute
data_sizethe length of the serialized data
attrdeserialized attribute. Will be allocated. Must be free'd
Returns
number of bytes read or -1 for error
Parameters
datathe serialized attribute
data_sizethe length of the serialized data
Returns
a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller

Definition at line 504 of file reclaim_attribute.c.

506 {
507  struct Attribute *attr_ser;
508  struct GNUNET_RECLAIM_Attribute *attribute;
509  size_t data_len;
510  size_t name_len;
511  char *write_ptr;
512 
513  if (data_size < sizeof(struct Attribute))
514  return -1;
515 
516  attr_ser = (struct Attribute *) data;
517  data_len = ntohs (attr_ser->data_size);
518  name_len = ntohs (attr_ser->name_len);
519  if (data_size < sizeof(struct Attribute) + data_len + name_len)
520  {
522  "Buffer too small to deserialize\n");
523  return -1;
524  }
525  attribute = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_Attribute)
526  + data_len + name_len + 1);
527  attribute->type = ntohl (attr_ser->attribute_type);
528  attribute->flag = ntohl (attr_ser->attribute_flag);
529  attribute->id = attr_ser->attribute_id;
530  attribute->credential = attr_ser->credential_id;
531  attribute->data_size = data_len;
532 
533  write_ptr = (char *) &attribute[1];
534  GNUNET_memcpy (write_ptr, &attr_ser[1], name_len);
535  write_ptr[name_len] = '\0';
536  attribute->name = write_ptr;
537 
538  write_ptr += name_len + 1;
539  GNUNET_memcpy (write_ptr, (char *) &attr_ser[1] + name_len,
540  attribute->data_size);
541  *attr = attribute;
542  attribute->data = write_ptr;
543  return sizeof(struct Attribute) + data_len + name_len;
544 }
@ GNUNET_ERROR_TYPE_ERROR

References Attribute::attribute_flag, Attribute::attribute_id, Attribute::attribute_type, GNUNET_RECLAIM_Attribute::credential, Attribute::credential_id, GNUNET_RECLAIM_Attribute::data, data, data_size, GNUNET_RECLAIM_Attribute::data_size, Attribute::data_size, GNUNET_RECLAIM_Attribute::flag, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_RECLAIM_Attribute::id, GNUNET_RECLAIM_Attribute::name, Attribute::name_len, and GNUNET_RECLAIM_Attribute::type.

Referenced by consistency_iter(), GNUNET_RECLAIM_attribute_list_deserialize(), handle_attribute_delete_message(), handle_attribute_result(), handle_attribute_store_message(), process_parallel_lookup_result(), and rvk_move_attr_cb().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_attribute_list_dup()

struct GNUNET_RECLAIM_AttributeList* GNUNET_RECLAIM_attribute_list_dup ( const struct GNUNET_RECLAIM_AttributeList attrs)

Make a (deep) copy of a claim list.

Parameters
attrsclaim list to copy
Returns
copied claim list

Definition at line 393 of file reclaim_attribute.c.

395 {
397  struct GNUNET_RECLAIM_AttributeListEntry *result_ale;
399 
401  for (ale = attrs->list_head; NULL != ale; ale = ale->next)
402  {
403  result_ale = GNUNET_new (struct GNUNET_RECLAIM_AttributeListEntry);
404  GNUNET_assert (NULL != ale->attribute);
405  {
406  result_ale->attribute =
408  &ale->attribute->credential,
409  ale->attribute->type,
410  ale->attribute->data,
411  ale->attribute->data_size);
412 
413  result_ale->attribute->id = ale->attribute->id;
414  result_ale->attribute->flag = ale->attribute->flag;
415  }
417  result->list_tail,
418  result_ale);
419  }
420  return result;
421 }

References GNUNET_RECLAIM_AttributeListEntry::attribute, GNUNET_RECLAIM_Attribute::credential, GNUNET_RECLAIM_Attribute::data, GNUNET_RECLAIM_Attribute::data_size, GNUNET_RECLAIM_Attribute::flag, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_new, GNUNET_RECLAIM_attribute_new(), GNUNET_RECLAIM_Attribute::id, GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_Attribute::name, GNUNET_RECLAIM_AttributeListEntry::next, result, and GNUNET_RECLAIM_Attribute::type.

Referenced by RECLAIM_TICKETS_issue().

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

◆ GNUNET_RECLAIM_attribute_typename_to_number()

uint32_t GNUNET_RECLAIM_attribute_typename_to_number ( const char *  typename)

Convert a type name to the corresponding number.

Parameters
typenamename to convert
Returns
corresponding number, UINT32_MAX on error

Definition at line 145 of file reclaim_attribute.c.

146 {
147  unsigned int i;
148  struct Plugin *plugin;
149  uint32_t ret;
150 
151  init ();
152  for (i = 0; i < num_plugins; i++)
153  {
154  plugin = attr_plugins[i];
155  if (UINT32_MAX !=
156  (ret = plugin->api->typename_to_number (plugin->api->cls, typename)))
157  return ret;
158  }
159  return UINT32_MAX;
160 }
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
struct Plugin * plugin
The process handle to the testbed service.
static struct Plugin ** attr_plugins
Plugins.
static unsigned int num_plugins
Number of plugins.
static void init()
Load plugins.
void * cls
Closure for all of the callbacks.
Handle for a plugin.
Definition: block.c:38
struct GNUNET_BLOCK_PluginFunctions * api
Plugin API.
Definition: block.c:47

References Plugin::api, attr_plugins, GNUNET_BLOCK_PluginFunctions::cls, init(), num_plugins, plugin, and ret.

Referenced by iter_finished(), parse_attr(), and parse_jwt().

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

◆ GNUNET_RECLAIM_attribute_string_to_value()

int GNUNET_RECLAIM_attribute_string_to_value ( uint32_t  type,
const char *  s,
void **  data,
size_t *  data_size 
)

Convert human-readable version of a 'claim' of an attribute to the binary representation.

Parameters
typetype of the claim
shuman-readable string
dataset to value in binary encoding (will be allocated)
data_sizeset to number of bytes in data
Returns
GNUNET_OK on success

Definition at line 199 of file reclaim_attribute.c.

203 {
204  unsigned int i;
205  struct Plugin *plugin;
206 
207  init ();
208  for (i = 0; i < num_plugins; i++)
209  {
210  plugin = attr_plugins[i];
211  if (GNUNET_OK == plugin->api->string_to_value (plugin->api->cls,
212  type,
213  s,
214  data,
215  data_size))
216  return GNUNET_OK;
217  }
218  return GNUNET_SYSERR;
219 }
@ GNUNET_OK
Definition: gnunet_common.h:99
@ GNUNET_SYSERR
Definition: gnunet_common.h:97

References Plugin::api, attr_plugins, GNUNET_BLOCK_PluginFunctions::cls, data, data_size, GNUNET_OK, GNUNET_SYSERR, init(), num_plugins, plugin, and type.

Referenced by iter_finished(), parse_attr(), and parse_jwt().

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

◆ GNUNET_RECLAIM_attribute_value_to_string()

char* GNUNET_RECLAIM_attribute_value_to_string ( uint32_t  type,
const void *  data,
size_t  data_size 
)

Convert the 'claim' of an attribute to a string.

Parameters
typethe type of attribute
dataclaim in binary encoding
data_sizenumber of bytes in data
Returns
NULL on error, otherwise human-readable representation of the claim

Definition at line 231 of file reclaim_attribute.c.

234 {
235  unsigned int i;
236  struct Plugin *plugin;
237  char *ret;
238 
239  init ();
240  for (i = 0; i < num_plugins; i++)
241  {
242  plugin = attr_plugins[i];
243  if (NULL != (ret = plugin->api->value_to_string (plugin->api->cls,
244  type,
245  data,
246  data_size)))
247  return ret;
248  }
249  return NULL;
250 }

References Plugin::api, attr_plugins, GNUNET_BLOCK_PluginFunctions::cls, data, data_size, init(), num_plugins, plugin, ret, and type.

Referenced by attr_collect(), consume_cont(), cred_collect(), cred_iter_cb(), generate_userinfo_json(), iter_cb(), and process_attrs().

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

◆ GNUNET_RECLAIM_attribute_number_to_typename()

const char* GNUNET_RECLAIM_attribute_number_to_typename ( uint32_t  type)

Convert a type number to the corresponding type string.

Parameters
typenumber of a type
Returns
corresponding typestring, NULL on error

Definition at line 170 of file reclaim_attribute.c.

171 {
172  unsigned int i;
173  struct Plugin *plugin;
174  const char *ret;
175 
176  init ();
177  for (i = 0; i < num_plugins; i++)
178  {
179  plugin = attr_plugins[i];
180  if (NULL !=
181  (ret = plugin->api->number_to_typename (plugin->api->cls, type)))
182  return ret;
183  }
184  return NULL;
185 }

References Plugin::api, attr_plugins, GNUNET_BLOCK_PluginFunctions::cls, init(), num_plugins, plugin, ret, and type.

Referenced by attr_collect(), cred_collect(), iter_cb(), and process_attrs().

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

◆ GNUNET_RECLAIM_credential_list_serialize_get_size()

size_t GNUNET_RECLAIM_credential_list_serialize_get_size ( const struct GNUNET_RECLAIM_CredentialList credentials)

Get required size for serialization buffer.

Parameters
credentialsthe attribute list to serialize
Returns
the required buffer size
Parameters
attrsthe attribute list to serialize
Returns
the required buffer size

Definition at line 288 of file reclaim_credential.c.

290 {
292  size_t len = 0;
293 
294  for (le = credentials->list_head; NULL != le; le = le->next)
295  {
296  GNUNET_assert (NULL != le->credential);
298  len += sizeof(struct GNUNET_RECLAIM_CredentialListEntry);
299  }
300  return len;
301 }
size_t GNUNET_RECLAIM_credential_serialize_get_size(const struct GNUNET_RECLAIM_Credential *credential)
Get required size for serialization buffer.
struct GNUNET_RECLAIM_CredentialListEntry * next
DLL.
struct GNUNET_RECLAIM_Credential * credential
The credential.
struct GNUNET_RECLAIM_CredentialListEntry * list_head
List head.

References GNUNET_RECLAIM_CredentialListEntry::credential, GNUNET_assert, GNUNET_RECLAIM_credential_serialize_get_size(), len, GNUNET_RECLAIM_CredentialList::list_head, and GNUNET_RECLAIM_CredentialListEntry::next.

Here is the call graph for this function:

◆ GNUNET_RECLAIM_credential_list_destroy()

void GNUNET_RECLAIM_credential_list_destroy ( struct GNUNET_RECLAIM_CredentialList credentials)

Destroy credential list.

Parameters
credentialslist to destroy

Definition at line 396 of file reclaim_credential.c.

398 {
400  struct GNUNET_RECLAIM_CredentialListEntry *tmp_ale;
401 
402  for (ale = credentials->list_head; NULL != ale;)
403  {
404  if (NULL != ale->credential)
405  GNUNET_free (ale->credential);
406  tmp_ale = ale;
407  ale = ale->next;
408  GNUNET_free (tmp_ale);
409  }
410  GNUNET_free (credentials);
411 }

References GNUNET_RECLAIM_CredentialListEntry::credential, GNUNET_free, GNUNET_RECLAIM_CredentialList::list_head, and GNUNET_RECLAIM_CredentialListEntry::next.

Referenced by cleanup_adh(), and cleanup_handle().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_credential_list_add()

void GNUNET_RECLAIM_credential_list_add ( struct GNUNET_RECLAIM_CredentialList attrs,
const char *  att_name,
uint32_t  type,
const void *  data,
size_t  data_size 
)

Add a new attribute to a claim list.

Parameters
attr_namethe name of the new attribute claim
typethe type of the claim
dataclaim payload
data_sizeclaim payload size

◆ GNUNET_RECLAIM_credential_list_serialize()

size_t GNUNET_RECLAIM_credential_list_serialize ( const struct GNUNET_RECLAIM_CredentialList credentials,
char *  result 
)

Serialize a credential list.

Parameters
credentialsthe credential list to serialize
resultthe serialized credential
Returns
length of serialized data

Definition at line 305 of file reclaim_credential.c.

308 {
310  size_t len;
311  size_t total_len;
312  char *write_ptr;
313  write_ptr = result;
314  total_len = 0;
315  for (le = credentials->list_head; NULL != le; le = le->next)
316  {
317  GNUNET_assert (NULL != le->credential);
319  total_len += len;
320  write_ptr += len;
321  }
322  return total_len;
323 }
size_t GNUNET_RECLAIM_credential_serialize(const struct GNUNET_RECLAIM_Credential *credential, char *result)
Serialize an credential.

References GNUNET_RECLAIM_CredentialListEntry::credential, GNUNET_assert, GNUNET_RECLAIM_credential_serialize(), len, GNUNET_RECLAIM_CredentialList::list_head, GNUNET_RECLAIM_CredentialListEntry::next, and result.

Here is the call graph for this function:

◆ GNUNET_RECLAIM_credential_list_deserialize()

struct GNUNET_RECLAIM_CredentialList* GNUNET_RECLAIM_credential_list_deserialize ( const char *  data,
size_t  data_size 
)

Deserialize an attribute list.

Parameters
datathe serialized attribute list
data_sizethe length of the serialized data
Returns
a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller

Definition at line 327 of file reclaim_credential.c.

328 {
331  size_t att_len;
332  const char *read_ptr;
333 
335 
336  if ((data_size < sizeof(struct
337  Credential)
338  + sizeof(struct GNUNET_RECLAIM_CredentialListEntry)))
339  return al;
340 
341  read_ptr = data;
342  while (((data + data_size) - read_ptr) >= sizeof(struct Credential))
343  {
345  ale->credential =
347  data_size - (read_ptr - data));
348  if (NULL == ale->credential)
349  {
351  "Failed to deserialize malformed credential.\n");
352  GNUNET_free (ale);
353  return al;
354  }
357  read_ptr += att_len;
358  }
359  return al;
360 }
struct GNUNET_RECLAIM_Credential * GNUNET_RECLAIM_credential_deserialize(const char *data, size_t data_size)
Deserialize an credential.
Serialized credential claim.
A list of GNUNET_RECLAIM_Credential structures.
struct GNUNET_RECLAIM_CredentialListEntry * list_tail
List tail.

References GNUNET_RECLAIM_CredentialListEntry::credential, data, data_size, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_RECLAIM_credential_deserialize(), GNUNET_RECLAIM_credential_serialize_get_size(), GNUNET_RECLAIM_CredentialList::list_head, and GNUNET_RECLAIM_CredentialList::list_tail.

Here is the call graph for this function:

◆ GNUNET_RECLAIM_credential_serialize_get_size()

size_t GNUNET_RECLAIM_credential_serialize_get_size ( const struct GNUNET_RECLAIM_Credential credential)

Get required size for serialization buffer.

Parameters
credentialthe credential to serialize
Returns
the required buffer size
Parameters
attrthe credential to serialize
Returns
the required buffer size

Definition at line 421 of file reclaim_credential.c.

423 {
424  return sizeof(struct Credential) + strlen (credential->name)
426 }

References credential, data_size, and name.

Referenced by cred_add_cb(), GNUNET_RECLAIM_credential_delete(), GNUNET_RECLAIM_credential_list_deserialize(), GNUNET_RECLAIM_credential_list_serialize_get_size(), GNUNET_RECLAIM_credential_store(), and rvk_move_attr_cb().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_credential_serialize()

size_t GNUNET_RECLAIM_credential_serialize ( const struct GNUNET_RECLAIM_Credential credential,
char *  result 
)

Serialize an credential.

Parameters
credentialthe credential to serialize
resultthe serialized credential
Returns
length of serialized data

Definition at line 430 of file reclaim_credential.c.

433 {
434  size_t data_len_ser;
435  size_t name_len;
436  struct Credential *atts;
437  char *write_ptr;
438 
439  atts = (struct Credential *) result;
440  atts->credential_type = htonl (credential->type);
441  atts->credential_flag = htonl (credential->flag);
442  atts->credential_id = credential->id;
443  name_len = strlen (credential->name);
444  atts->name_len = htons (name_len);
445  write_ptr = (char *) &atts[1];
446  GNUNET_memcpy (write_ptr, credential->name, name_len);
447  write_ptr += name_len;
448  // TODO plugin-ize
449  // data_len_ser = plugin->serialize_attribute_value (attr,
450  // &attr_ser[1]);
451  data_len_ser = credential->data_size;
452  GNUNET_memcpy (write_ptr, credential->data, credential->data_size);
453  atts->data_size = htons (data_len_ser);
454 
455  return sizeof(struct Credential) + strlen (credential->name)
457 }
uint16_t name_len
Name length.
struct GNUNET_RECLAIM_Identifier credential_id
Credential ID.
uint32_t credential_type
Credential type.
uint32_t credential_flag
Credential flag.
uint16_t data_size
Data size.

References credential, Credential::credential_flag, Credential::credential_id, Credential::credential_type, data_size, Credential::data_size, GNUNET_memcpy, GNUNET_RECLAIM_Identifier::id, name, Credential::name_len, and result.

Referenced by cred_add_cb(), GNUNET_RECLAIM_credential_delete(), GNUNET_RECLAIM_credential_list_serialize(), GNUNET_RECLAIM_credential_store(), and rvk_move_attr_cb().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_credential_deserialize()

struct GNUNET_RECLAIM_Credential* GNUNET_RECLAIM_credential_deserialize ( const char *  data,
size_t  data_size 
)

Deserialize an credential.

Parameters
datathe serialized credential
data_sizethe length of the serialized data
Returns
a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller

Definition at line 469 of file reclaim_credential.c.

470 {
472  struct Credential *atts;
473  size_t data_len;
474  size_t name_len;
475  char *write_ptr;
476 
477  if (data_size < sizeof(struct Credential))
478  return NULL;
479 
480  atts = (struct Credential *) data;
481  data_len = ntohs (atts->data_size);
482  name_len = ntohs (atts->name_len);
483  if (data_size < sizeof(struct Credential) + data_len + name_len)
484  {
486  "Buffer too small to deserialize\n");
487  return NULL;
488  }
490  + data_len + name_len + 1);
491  credential->type = ntohl (atts->credential_type);
492  credential->flag = ntohl (atts->credential_flag);
493  credential->id = atts->credential_id;
494  credential->data_size = data_len;
495 
496  write_ptr = (char *) &credential[1];
497  GNUNET_memcpy (write_ptr, &atts[1], name_len);
498  write_ptr[name_len] = '\0';
499  credential->name = write_ptr;
500 
501  write_ptr += name_len + 1;
502  GNUNET_memcpy (write_ptr, (char *) &atts[1] + name_len,
503  credential->data_size);
504  credential->data = write_ptr;
505  return credential;
506 }

References credential, Credential::credential_flag, Credential::credential_id, Credential::credential_type, data, data_size, Credential::data_size, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_RECLAIM_Identifier::id, and Credential::name_len.

Referenced by consistency_iter(), filter_tickets_cb(), GNUNET_RECLAIM_credential_list_deserialize(), handle_credential_delete_message(), handle_credential_result(), handle_credential_store_message(), and rvk_move_attr_cb().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_credential_new()

struct GNUNET_RECLAIM_Credential* GNUNET_RECLAIM_credential_new ( const char *  name,
uint32_t  type,
const void *  data,
size_t  data_size 
)

Create a new credential.

Parameters
namethe credential name
typethe credential type
datathe credential value
data_sizethe credential value size
Returns
the new credential

Definition at line 254 of file reclaim_credential.c.

258 {
259  struct GNUNET_RECLAIM_Credential *attr;
260  char *write_ptr;
261  char *attr_name_tmp = GNUNET_strdup (attr_name);
262 
263  GNUNET_STRINGS_utf8_tolower (attr_name, attr_name_tmp);
264 
265  attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_Credential)
266  + strlen (attr_name_tmp) + 1 + data_size);
267  attr->type = type;
268  attr->data_size = data_size;
269  attr->flag = 0;
270  write_ptr = (char *) &attr[1];
271  GNUNET_memcpy (write_ptr, attr_name_tmp, strlen (attr_name_tmp) + 1);
272  attr->name = write_ptr;
273  write_ptr += strlen (attr->name) + 1;
274  GNUNET_memcpy (write_ptr, data, data_size);
275  attr->data = write_ptr;
276  GNUNET_free (attr_name_tmp);
277  return attr;
278 }
uint32_t type
Type/Format of Claim.
const char * name
The name of the credential.
const void * data
Binary value stored as credential value.
size_t data_size
Number of bytes in data.

References attr_name, GNUNET_RECLAIM_Credential::data, data, data_size, GNUNET_RECLAIM_Credential::data_size, GNUNET_RECLAIM_Credential::flag, GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_strdup, GNUNET_STRINGS_utf8_tolower(), GNUNET_RECLAIM_Credential::name, GNUNET_RECLAIM_Credential::type, and type.

Referenced by cred_iter_finished(), GNUNET_RECLAIM_credential_list_dup(), oidc_cred_collect(), and parse_credential().

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

◆ GNUNET_RECLAIM_credential_value_to_string()

char* GNUNET_RECLAIM_credential_value_to_string ( uint32_t  type,
const void *  data,
size_t  data_size 
)

Convert the 'claim' of an credential to a string.

Parameters
typethe type of credential
dataclaim in binary encoding
data_sizenumber of bytes in data
Returns
NULL on error, otherwise human-readable representation of the claim

Definition at line 231 of file reclaim_credential.c.

234 {
235  unsigned int i;
236  struct Plugin *plugin;
237  char *ret;
238 
239  init ();
240  for (i = 0; i < num_plugins; i++)
241  {
243  if (NULL != (ret = plugin->api->value_to_string (plugin->api->cls,
244  type,
245  data,
246  data_size)))
247  return ret;
248  }
249  return NULL;
250 }
static unsigned int num_plugins
Number of plugins.
static void init()
Load plugins.
static struct Plugin ** credential_plugins
Plugins.

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, data, data_size, init(), num_plugins, plugin, ret, and type.

Referenced by cred_collect(), cred_iter_cb(), and parse_jwt().

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

◆ GNUNET_RECLAIM_credential_string_to_value()

int GNUNET_RECLAIM_credential_string_to_value ( uint32_t  type,
const char *  s,
void **  data,
size_t *  data_size 
)

Convert human-readable version of a 'claim' of an credential to the binary representation.

Parameters
typetype of the claim
shuman-readable string
dataset to value in binary encoding (will be allocated)
data_sizeset to number of bytes in data
Returns
GNUNET_OK on success

Definition at line 199 of file reclaim_credential.c.

203 {
204  unsigned int i;
205  struct Plugin *plugin;
206 
207  init ();
208  for (i = 0; i < num_plugins; i++)
209  {
211  if (GNUNET_OK == plugin->api->string_to_value (plugin->api->cls,
212  type,
213  s,
214  data,
215  data_size))
216  return GNUNET_OK;
217  }
218  return GNUNET_SYSERR;
219 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, data, data_size, GNUNET_OK, GNUNET_SYSERR, init(), num_plugins, plugin, and type.

Referenced by parse_credential().

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

◆ GNUNET_RECLAIM_credential_number_to_typename()

const char* GNUNET_RECLAIM_credential_number_to_typename ( uint32_t  type)

Convert an credential type number to the corresponding credential type string.

Parameters
typenumber of a type
Returns
corresponding typestring, NULL on error

Definition at line 170 of file reclaim_credential.c.

171 {
172  unsigned int i;
173  struct Plugin *plugin;
174  const char *ret;
175 
176  init ();
177  for (i = 0; i < num_plugins; i++)
178  {
180  if (NULL !=
181  (ret = plugin->api->number_to_typename (plugin->api->cls, type)))
182  return ret;
183  }
184  return NULL;
185 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, init(), num_plugins, plugin, ret, and type.

Referenced by cred_collect(), and cred_iter_cb().

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

◆ GNUNET_RECLAIM_credential_typename_to_number()

uint32_t GNUNET_RECLAIM_credential_typename_to_number ( const char *  typename)

Convert an credential type name to the corresponding number.

Parameters
typenamename to convert
Returns
corresponding number, UINT32_MAX on error

Definition at line 145 of file reclaim_credential.c.

146 {
147  unsigned int i;
148  struct Plugin *plugin;
149  uint32_t ret;
150  init ();
151  for (i = 0; i < num_plugins; i++)
152  {
154  if (UINT32_MAX !=
155  (ret = plugin->api->typename_to_number (plugin->api->cls,
156  typename)))
157  return ret;
158  }
159  return UINT32_MAX;
160 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, init(), num_plugins, plugin, and ret.

Referenced by cred_iter_finished(), and parse_credential().

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

◆ GNUNET_RECLAIM_credential_get_attributes()

struct GNUNET_RECLAIM_AttributeList* GNUNET_RECLAIM_credential_get_attributes ( const struct GNUNET_RECLAIM_Credential cred)

Convert an credential type name to the corresponding number.

Parameters
typenamename to convert
Returns
corresponding number, UINT32_MAX on error

Definition at line 510 of file reclaim_credential.c.

512 {
513  unsigned int i;
514  struct Plugin *plugin;
516  init ();
517  for (i = 0; i < num_plugins; i++)
518  {
520  if (NULL !=
521  (ret = plugin->api->get_attributes (plugin->api->cls,
522  credential)))
523  return ret;
524  }
525  return NULL;
526 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential, credential_plugins, init(), num_plugins, plugin, and ret.

Referenced by cred_collect(), and cred_iter_cb().

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

◆ GNUNET_RECLAIM_credential_get_issuer()

char* GNUNET_RECLAIM_credential_get_issuer ( const struct GNUNET_RECLAIM_Credential cred)

Definition at line 530 of file reclaim_credential.c.

532 {
533  unsigned int i;
534  struct Plugin *plugin;
535  char *ret;
536  init ();
537  for (i = 0; i < num_plugins; i++)
538  {
540  if (NULL !=
541  (ret = plugin->api->get_issuer (plugin->api->cls,
542  credential)))
543  return ret;
544  }
545  return NULL;
546 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential, credential_plugins, init(), num_plugins, plugin, and ret.

Referenced by cred_collect().

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

◆ GNUNET_RECLAIM_credential_get_expiration()

int GNUNET_RECLAIM_credential_get_expiration ( const struct GNUNET_RECLAIM_Credential cred,
struct GNUNET_TIME_Absolute exp 
)

Definition at line 550 of file reclaim_credential.c.

553 {
554  unsigned int i;
555  struct Plugin *plugin;
556  init ();
557  for (i = 0; i < num_plugins; i++)
558  {
560  if (GNUNET_OK != plugin->api->get_expiration (plugin->api->cls,
561  credential,
562  exp))
563  continue;
564  return GNUNET_OK;
565  }
566  return GNUNET_SYSERR;
567 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential, credential_plugins, GNUNET_OK, GNUNET_SYSERR, init(), num_plugins, and plugin.

Referenced by cred_collect().

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

◆ GNUNET_RECLAIM_presentation_list_serialize_get_size()

size_t GNUNET_RECLAIM_presentation_list_serialize_get_size ( const struct GNUNET_RECLAIM_PresentationList presentations)

Get required size for serialization buffer.

Parameters
presentationsthe presentation list to serialize
Returns
the required buffer size
Parameters
attrsthe attribute list to serialize
Returns
the required buffer size

Definition at line 705 of file reclaim_credential.c.

707 {
709  size_t len = 0;
710 
711  for (le = presentations->list_head; NULL != le; le = le->next)
712  {
713  GNUNET_assert (NULL != le->presentation);
715  }
716  return len;
717 }
size_t GNUNET_RECLAIM_presentation_serialize_get_size(const struct GNUNET_RECLAIM_Presentation *presentation)
Get required size for serialization buffer.
struct GNUNET_RECLAIM_Presentation * presentation
The credential.
struct GNUNET_RECLAIM_PresentationListEntry * next
DLL.
struct GNUNET_RECLAIM_PresentationListEntry * list_head
List head.

References GNUNET_assert, GNUNET_RECLAIM_presentation_serialize_get_size(), len, GNUNET_RECLAIM_PresentationList::list_head, GNUNET_RECLAIM_PresentationListEntry::next, and GNUNET_RECLAIM_PresentationListEntry::presentation.

Referenced by check_code_challenge(), consume_result_cb(), and send_ticket_result().

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

◆ GNUNET_RECLAIM_presentation_list_destroy()

void GNUNET_RECLAIM_presentation_list_destroy ( struct GNUNET_RECLAIM_PresentationList presentations)

Destroy presentations list.

Parameters
presentationslist to destroy

Definition at line 818 of file reclaim_credential.c.

820 {
822  struct GNUNET_RECLAIM_PresentationListEntry *tmp_ale;
823 
824  for (ale = presentations->list_head; NULL != ale;)
825  {
826  if (NULL != ale->presentation)
827  GNUNET_free (ale->presentation);
828  tmp_ale = ale;
829  ale = ale->next;
830  GNUNET_free (tmp_ale);
831  }
832  GNUNET_free (presentations);
833 }

References GNUNET_free, GNUNET_RECLAIM_PresentationList::list_head, GNUNET_RECLAIM_PresentationListEntry::next, and GNUNET_RECLAIM_PresentationListEntry::presentation.

Referenced by cleanup_cth(), cleanup_handle(), consume_fail(), filter_tickets_cb(), handle_consume_ticket_result(), handle_ticket_result(), and token_endpoint().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_presentation_list_serialize()

size_t GNUNET_RECLAIM_presentation_list_serialize ( const struct GNUNET_RECLAIM_PresentationList presentations,
char *  result 
)

Serialize a presentation list.

Parameters
presentationsthe attribute list to serialize
resultthe serialized list
Returns
length of serialized data

Definition at line 721 of file reclaim_credential.c.

724 {
726  size_t len;
727  size_t total_len;
728  char *write_ptr;
729  write_ptr = result;
730  total_len = 0;
731  for (le = presentations->list_head; NULL != le; le = le->next)
732  {
733  GNUNET_assert (NULL != le->presentation);
735  total_len += len;
736  write_ptr += len;
737  }
738  return total_len;
739 }
size_t GNUNET_RECLAIM_presentation_serialize(const struct GNUNET_RECLAIM_Presentation *presentation, char *result)
Serialize a presentation.

References GNUNET_assert, GNUNET_RECLAIM_presentation_serialize(), len, GNUNET_RECLAIM_PresentationList::list_head, GNUNET_RECLAIM_PresentationListEntry::next, GNUNET_RECLAIM_PresentationListEntry::presentation, and result.

Referenced by check_code_challenge(), consume_result_cb(), and send_ticket_result().

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

◆ GNUNET_RECLAIM_presentation_list_deserialize()

struct GNUNET_RECLAIM_PresentationList* GNUNET_RECLAIM_presentation_list_deserialize ( const char *  data,
size_t  data_size 
)

Deserialize a presentation list.

Parameters
datathe serialized list
data_sizethe length of the serialized data
Returns
a GNUNET_RECLAIM_PresentationList, must be free'd by caller

Deserialize a presentation list.

Parameters
datathe serialized attribute list
data_sizethe length of the serialized data
Returns
a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller

Definition at line 750 of file reclaim_credential.c.

752 {
755  size_t att_len;
756  const char *read_ptr;
757 
759 
760  if (data_size < sizeof(struct Presentation))
761  return al;
762 
763  read_ptr = data;
764  while (((data + data_size) - read_ptr) >= sizeof(struct Presentation))
765  {
767  ale->presentation =
769  data_size - (read_ptr - data));
770  if (NULL == ale->presentation)
771  {
773  "Failed to deserialize malformed presentation.\n");
774  GNUNET_free (ale);
775  return al;
776  }
779  ale->presentation);
780  read_ptr += att_len;
781  }
782  return al;
783 }
struct GNUNET_RECLAIM_Presentation * GNUNET_RECLAIM_presentation_deserialize(const char *data, size_t data_size)
Deserialize an presentation.
A list of GNUNET_RECLAIM_Presentation structures.
struct GNUNET_RECLAIM_PresentationListEntry * list_tail
List tail.
Serialized presentation claim.

References data, data_size, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_RECLAIM_presentation_deserialize(), GNUNET_RECLAIM_presentation_serialize_get_size(), GNUNET_RECLAIM_PresentationList::list_head, GNUNET_RECLAIM_PresentationList::list_tail, and GNUNET_RECLAIM_PresentationListEntry::presentation.

Referenced by handle_consume_ticket_result(), handle_ticket_result(), and OIDC_parse_authz_code().

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

◆ GNUNET_RECLAIM_presentation_serialize_get_size()

size_t GNUNET_RECLAIM_presentation_serialize_get_size ( const struct GNUNET_RECLAIM_Presentation presentation)

Get required size for serialization buffer.

Parameters
presentationthe presentation to serialize
Returns
the required buffer size
Parameters
attrthe presentation to serialize
Returns
the required buffer size

Definition at line 843 of file reclaim_credential.c.

845 {
846  return sizeof(struct Presentation) + presentation->data_size;
847 }

References data_size.

Referenced by GNUNET_RECLAIM_presentation_list_deserialize(), GNUNET_RECLAIM_presentation_list_serialize_get_size(), and issue_ticket().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_presentation_serialize()

size_t GNUNET_RECLAIM_presentation_serialize ( const struct GNUNET_RECLAIM_Presentation presentation,
char *  result 
)

Serialize a presentation.

Parameters
presentationthe presentation to serialize
resultthe serialized presentation
Returns
length of serialized data

Definition at line 851 of file reclaim_credential.c.

854 {
855  struct Presentation *atts;
856  char *write_ptr;
857 
858  atts = (struct Presentation *) result;
859  atts->presentation_type = htonl (presentation->type);
860  atts->credential_id = presentation->credential_id;
861  write_ptr = (char *) &atts[1];
862  GNUNET_memcpy (write_ptr, presentation->data, presentation->data_size);
863  atts->data_size = htons (presentation->data_size);
864 
865  return sizeof(struct Presentation) + presentation->data_size;
866 }
const void * data
Binary value stored as presentation value.
uint32_t type
Type/Format of Claim.
size_t data_size
Number of bytes in data.
struct GNUNET_RECLAIM_Identifier credential_id
The credential id of which this is a presentation.
struct GNUNET_RECLAIM_Identifier credential_id
Credential ID.
uint16_t data_size
Data size.
uint32_t presentation_type
Presentation type.

References GNUNET_RECLAIM_Presentation::credential_id, Presentation::credential_id, GNUNET_RECLAIM_Presentation::data, data_size, GNUNET_RECLAIM_Presentation::data_size, Presentation::data_size, GNUNET_memcpy, Presentation::presentation_type, result, and GNUNET_RECLAIM_Presentation::type.

Referenced by GNUNET_RECLAIM_presentation_list_serialize(), and issue_ticket().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_presentation_deserialize()

struct GNUNET_RECLAIM_Presentation* GNUNET_RECLAIM_presentation_deserialize ( const char *  data,
size_t  data_size 
)

Deserialize a presentation.

Parameters
datathe serialized presentation
data_sizethe length of the serialized data
Returns
a GNUNET_RECLAIM_Presentation, must be free'd by caller

Deserialize a presentation.

Parameters
datathe serialized presentation
data_sizethe length of the serialized data
Returns
a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller

Definition at line 878 of file reclaim_credential.c.

879 {
880  struct GNUNET_RECLAIM_Presentation *presentation;
881  struct Presentation *atts;
882  size_t data_len;
883  char *write_ptr;
884 
885  if (data_size < sizeof(struct Presentation))
886  return NULL;
887 
888  atts = (struct Presentation *) data;
889  data_len = ntohs (atts->data_size);
890  if (data_size < sizeof(struct Presentation) + data_len)
891  {
893  "Buffer too small to deserialize\n");
894  return NULL;
895  }
896  presentation = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_Presentation)
897  + data_len);
898  presentation->type = ntohl (atts->presentation_type);
899  presentation->credential_id = atts->credential_id;
900  presentation->data_size = data_len;
901 
902  write_ptr = (char *) &presentation[1];
903  GNUNET_memcpy (write_ptr, &atts[1], data_len);
904  presentation->data = write_ptr;
905  return presentation;
906 }
A credential presentation.

References GNUNET_RECLAIM_Presentation::credential_id, Presentation::credential_id, GNUNET_RECLAIM_Presentation::data, data, data_size, GNUNET_RECLAIM_Presentation::data_size, Presentation::data_size, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_malloc, GNUNET_memcpy, Presentation::presentation_type, and GNUNET_RECLAIM_Presentation::type.

Referenced by filter_tickets_cb(), GNUNET_RECLAIM_presentation_list_deserialize(), issue_ticket(), lookup_authz_cb(), and update_tickets().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_presentation_value_to_string()

char* GNUNET_RECLAIM_presentation_value_to_string ( uint32_t  type,
const void *  data,
size_t  data_size 
)

Convert the 'claim' of a presentation to a string.

Parameters
typethe type of presentation
datapresentation in binary encoding
data_sizenumber of bytes in data
Returns
NULL on error, otherwise human-readable representation of the claim

Convert the 'claim' of a presentation to a string.

Parameters
typethe type of presentation
dataclaim in binary encoding
data_sizenumber of bytes in data
Returns
NULL on error, otherwise human-readable representation of the claim

Definition at line 657 of file reclaim_credential.c.

660 {
661  unsigned int i;
662  struct Plugin *plugin;
663  char *ret;
664 
665  init ();
666  for (i = 0; i < num_plugins; i++)
667  {
669  if (NULL != (ret = plugin->api->value_to_string_p (plugin->api->cls,
670  type,
671  data,
672  data_size)))
673  return ret;
674  }
675  return NULL;
676 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, data, data_size, init(), num_plugins, plugin, ret, and type.

Referenced by generate_userinfo_json().

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

◆ GNUNET_RECLAIM_presentation_new()

struct GNUNET_RECLAIM_Presentation* GNUNET_RECLAIM_presentation_new ( uint32_t  type,
const void *  data,
size_t  data_size 
)

Definition at line 680 of file reclaim_credential.c.

683 {
684  struct GNUNET_RECLAIM_Presentation *attr;
685  char *write_ptr;
686 
687  attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_Presentation)
688  + data_size);
689  attr->type = type;
690  attr->data_size = data_size;
691  write_ptr = (char *) &attr[1];
692  GNUNET_memcpy (write_ptr, data, data_size);
693  attr->data = write_ptr;
694  return attr;
695 }

References GNUNET_RECLAIM_Presentation::data, data, data_size, GNUNET_RECLAIM_Presentation::data_size, GNUNET_malloc, GNUNET_memcpy, GNUNET_RECLAIM_Presentation::type, and type.

Referenced by consume_ticket(), GNUNET_RECLAIM_presentation_list_dup(), and pabc_create_presentation().

Here is the caller graph for this function:

◆ GNUNET_RECLAIM_presentation_string_to_value()

int GNUNET_RECLAIM_presentation_string_to_value ( uint32_t  type,
const char *  s,
void **  data,
size_t *  data_size 
)

Convert human-readable version of a 'claim' of a presentation to the binary representation.

Parameters
typetype of the presentation
shuman-readable string
dataset to value in binary encoding (will be allocated)
data_sizeset to number of bytes in data
Returns
GNUNET_OK on success

Convert human-readable version of a 'claim' of a presentation to the binary representation.

Parameters
typetype of the claim
shuman-readable string
dataset to value in binary encoding (will be allocated)
data_sizeset to number of bytes in data
Returns
GNUNET_OK on success

Definition at line 625 of file reclaim_credential.c.

629 {
630  unsigned int i;
631  struct Plugin *plugin;
632 
633  init ();
634  for (i = 0; i < num_plugins; i++)
635  {
637  if (GNUNET_OK == plugin->api->string_to_value_p (plugin->api->cls,
638  type,
639  s,
640  data,
641  data_size))
642  return GNUNET_OK;
643  }
644  return GNUNET_SYSERR;
645 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, data, data_size, GNUNET_OK, GNUNET_SYSERR, init(), num_plugins, plugin, and type.

Here is the call graph for this function:

◆ GNUNET_RECLAIM_presentation_number_to_typename()

const char* GNUNET_RECLAIM_presentation_number_to_typename ( uint32_t  type)

Convert a presentation type number to the corresponding credential type string.

Parameters
typenumber of a type
Returns
corresponding typestring, NULL on error

Definition at line 596 of file reclaim_credential.c.

597 {
598  unsigned int i;
599  struct Plugin *plugin;
600  const char *ret;
601 
602  init ();
603  for (i = 0; i < num_plugins; i++)
604  {
606  if (NULL !=
607  (ret = plugin->api->number_to_typename_p (plugin->api->cls, type)))
608  return ret;
609  }
610  return NULL;
611 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, init(), num_plugins, plugin, ret, and type.

Referenced by generate_userinfo_json().

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

◆ GNUNET_RECLAIM_presentation_get_attributes()

struct GNUNET_RECLAIM_AttributeList* GNUNET_RECLAIM_presentation_get_attributes ( const struct GNUNET_RECLAIM_Presentation cred)

Definition at line 910 of file reclaim_credential.c.

913 {
914  unsigned int i;
915  struct Plugin *plugin;
917  init ();
918  for (i = 0; i < num_plugins; i++)
919  {
921  if (NULL !=
922  (ret = plugin->api->get_attributes_p (plugin->api->cls,
923  presentation)))
924  return ret;
925  }
926  return NULL;
927 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, init(), num_plugins, plugin, and ret.

Referenced by process_attrs().

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

◆ GNUNET_RECLAIM_presentation_get_issuer()

char* GNUNET_RECLAIM_presentation_get_issuer ( const struct GNUNET_RECLAIM_Presentation cred)

Definition at line 931 of file reclaim_credential.c.

934 {
935  unsigned int i;
936  struct Plugin *plugin;
937  char *ret;
938  init ();
939  for (i = 0; i < num_plugins; i++)
940  {
942  if (NULL !=
943  (ret = plugin->api->get_issuer_p (plugin->api->cls,
944  presentation)))
945  return ret;
946  }
947  return NULL;
948 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, init(), num_plugins, plugin, and ret.

Here is the call graph for this function:

◆ GNUNET_RECLAIM_presentation_get_expiration()

int GNUNET_RECLAIM_presentation_get_expiration ( const struct GNUNET_RECLAIM_Presentation cred,
struct GNUNET_TIME_Absolute exp 
)

Definition at line 952 of file reclaim_credential.c.

956 {
957  unsigned int i;
958  struct Plugin *plugin;
959  init ();
960  for (i = 0; i < num_plugins; i++)
961  {
963  if (GNUNET_OK != plugin->api->get_expiration_p (plugin->api->cls,
964  presentation,
965  exp))
966  continue;
967  return GNUNET_OK;
968  }
969  return GNUNET_SYSERR;
970 }

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, GNUNET_OK, GNUNET_SYSERR, init(), num_plugins, and plugin.

Here is the call graph for this function:

◆ GNUNET_RECLAIM_credential_get_presentation()

int GNUNET_RECLAIM_credential_get_presentation ( const struct GNUNET_RECLAIM_Credential cred,
const struct GNUNET_RECLAIM_AttributeList attrs,
struct GNUNET_RECLAIM_Presentation **  presentation 
)

Create a presentation from a credential and a lift of (selected) attributes in the credential.

FIXME not yet implemented

Parameters
credthe credential to use
attrsthe attributes to present from the credential
presentationthe credential presentation presenting the attributes according to the presentation mechanism of the credential or NULL on error.
Returns
GNUNET_OK on success.
Parameters
credthe credential to use
attrsthe attributes to present from the credential
Returns
the credential presentation presenting the attributes according to the presentation mechanism of the credential or NULL on error.

Definition at line 984 of file reclaim_credential.c.

988 {
989  unsigned int i;
990  struct Plugin *plugin;
991  init ();
992  for (i = 0; i < num_plugins; i++)
993  {
995  if (GNUNET_OK != plugin->api->create_presentation (plugin->api->cls,
996  cred,
997  attrs,
998  presentation))
999  continue;
1000  (*presentation)->credential_id = cred->id;
1001  return GNUNET_OK;
1002  }
1003  return GNUNET_SYSERR;
1004 }
struct GNUNET_RECLAIM_Identifier id
ID.

References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, credential_plugins, GNUNET_OK, GNUNET_SYSERR, GNUNET_RECLAIM_Credential::id, init(), num_plugins, and plugin.

Referenced by filter_tickets_cb().

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

Variable Documentation

◆ GNUNET_RECLAIM_ID_ZERO

const struct GNUNET_RECLAIM_Identifier GNUNET_RECLAIM_ID_ZERO
static

Definition at line 1 of file gnunet_reclaim_lib.h.

Referenced by start_process().