GNUnet 0.22.2
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...
 
uint32_t GNUNET_RECLAIM_presentation_typename_to_number (const char *typename)
 Convert an presentation type name to the corresponding number. 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)
 
struct GNUNET_RECLAIM_PresentationListGNUNET_RECLAIM_presentation_list_dup (const struct GNUNET_RECLAIM_PresentationList *al)
 Make a (deep) copy of the presentation list. More...
 
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...
 
struct GNUNET_RECLAIM_CredentialListGNUNET_RECLAIM_credential_list_dup (const struct GNUNET_RECLAIM_CredentialList *al)
 

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 78 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
static const struct GNUNET_RECLAIM_Identifier GNUNET_RECLAIM_ID_ZERO

Definition at line 94 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 102 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 106 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 46 of file gnunet_reclaim_lib.h.

46 {
51
56};
@ 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 58 of file gnunet_reclaim_lib.h.

58 {
63
68
73};
@ 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 247 of file reclaim_attribute.c.

253{
254 struct GNUNET_RECLAIM_Attribute *attr;
255 char *write_ptr;
256 char *attr_name_tmp = GNUNET_strdup (attr_name);
257
258 GNUNET_STRINGS_utf8_tolower (attr_name, attr_name_tmp);
259
260 attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_Attribute)
261 + strlen (attr_name_tmp) + 1 + data_size);
262 if (NULL != credential)
263 attr->credential = *credential;
264 attr->type = type;
265 attr->data_size = data_size;
266 attr->flag = 0;
267 write_ptr = (char *) &attr[1];
268 GNUNET_memcpy (write_ptr, attr_name_tmp, strlen (attr_name_tmp) + 1);
269 attr->name = write_ptr;
270 write_ptr += strlen (attr->name) + 1;
271 GNUNET_memcpy (write_ptr, data, data_size);
272 attr->data = write_ptr;
273 GNUNET_free (attr_name_tmp);
274 return attr;
275}
static char * data
The data to insert into the dht.
static uint32_t type
Type string converted to DNS type value.
static size_t data_size
Number of bytes in data.
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:459
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.

References attr_name, credential, GNUNET_RECLAIM_Attribute::credential, data, GNUNET_RECLAIM_Attribute::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, type, and GNUNET_RECLAIM_Attribute::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(), and parse_attr().

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 306 of file reclaim_attribute.c.

308{
310 size_t len = 0;
311
312 for (ale = al->list_head; NULL != ale; ale = ale->next)
313 {
314 GNUNET_assert (NULL != ale->attribute);
316 }
317 return len;
318}
#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(), GNUNET_RECLAIM_AttributeList::list_head, and GNUNET_RECLAIM_AttributeListEntry::next.

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

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 418 of file reclaim_attribute.c.

420{
422 struct GNUNET_RECLAIM_AttributeListEntry *tmp_ale;
423
424 for (ale = al->list_head; NULL != ale;)
425 {
426 if (NULL != ale->attribute)
427 GNUNET_free (ale->attribute);
428 tmp_ale = ale;
429 ale = ale->next;
430 GNUNET_free (tmp_ale);
431 }
432 GNUNET_free (al);
433}

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(), do_cleanup(), 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 279 of file reclaim_attribute.c.

286{
288
290 ale->attribute =
293 GNUNET_CONTAINER_DLL_insert (al->list_head,
294 al->list_tail,
295 ale);
296}
#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 322 of file reclaim_attribute.c.

325{
327 size_t len;
328 size_t total_len;
329 char *write_ptr;
330 write_ptr = result;
331 total_len = 0;
332 for (ale = attrs->list_head; NULL != ale; ale = ale->next)
333 {
334 GNUNET_assert (NULL != ale->attribute);
335 len = GNUNET_RECLAIM_attribute_serialize (ale->attribute, write_ptr);
336 total_len += len;
337 write_ptr += len;
338 }
339 return total_len;
340}
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(), GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_AttributeListEntry::next, and result.

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

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 351 of file reclaim_attribute.c.

352{
355 size_t attr_len;
356 const char *read_ptr;
357 size_t left = data_size;
358
360 if (data_size < sizeof(struct Attribute))
361 return al;
362 read_ptr = data;
363 while (left >= sizeof(struct Attribute))
364 {
366 attr_len =
368 left,
369 &ale->attribute);
370 if (-1 == attr_len)
371 {
373 "Failed to deserialize malformed attribute.\n");
374 GNUNET_free (ale);
375 return al;
376 }
377 left -= attr_len;
379 read_ptr += attr_len;
380 }
381 return al;
382}
#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 443 of file reclaim_attribute.c.

445{
446 return sizeof(struct Attribute) + strlen (attr->name) + attr->data_size;
447}
static char * name
Name (label) of the records to list.

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 458 of file reclaim_attribute.c.

461{
462 size_t data_len_ser;
463 size_t name_len;
464 struct Attribute *attr_ser;
465 char *write_ptr;
466
467 attr_ser = (struct Attribute *) result;
468 attr_ser->attribute_type = htonl (attr->type);
469 attr_ser->attribute_flag = htonl (attr->flag);
470 attr_ser->attribute_id = attr->id;
471 attr_ser->credential_id = attr->credential;
472 name_len = strlen (attr->name);
473 attr_ser->name_len = htons (name_len);
474 write_ptr = (char *) &attr_ser[1];
475 GNUNET_memcpy (write_ptr, attr->name, name_len);
476 write_ptr += name_len;
477 // TODO plugin-ize
478 // data_len_ser = plugin->serialize_attribute_value (attr,
479 // &attr_ser[1]);
480 data_len_ser = attr->data_size;
481 GNUNET_memcpy (write_ptr, attr->data, attr->data_size);
482 attr_ser->data_size = htons (data_len_ser);
483
484 return sizeof(struct Attribute) + strlen (attr->name) + attr->data_size;
485}
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 497 of file reclaim_attribute.c.

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

References Attribute::attribute_flag, Attribute::attribute_id, Attribute::attribute_type, GNUNET_RECLAIM_Attribute::credential, Attribute::credential_id, data, GNUNET_RECLAIM_Attribute::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 386 of file reclaim_attribute.c.

388{
390 struct GNUNET_RECLAIM_AttributeListEntry *result_ale;
392
394 for (ale = attrs->list_head; NULL != ale; ale = ale->next)
395 {
396 result_ale = GNUNET_new (struct GNUNET_RECLAIM_AttributeListEntry);
397 GNUNET_assert (NULL != ale->attribute);
398 {
399 result_ale->attribute =
401 &ale->attribute->credential,
402 ale->attribute->type,
403 ale->attribute->data,
404 ale->attribute->data_size);
405
406 result_ale->attribute->id = ale->attribute->id;
407 result_ale->attribute->flag = ale->attribute->flag;
408 }
410 result->list_tail,
411 result_ale);
412 }
413 return result;
414}

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 138 of file reclaim_attribute.c.

139{
140 unsigned int i;
141 struct Plugin *plugin;
142 uint32_t ret;
143
144 init ();
145 for (i = 0; i < num_plugins; i++)
146 {
147 plugin = attr_plugins[i];
148 if (UINT32_MAX !=
149 (ret = plugin->api->typename_to_number (plugin->api->cls, typename)))
150 return ret;
151 }
152 return UINT32_MAX;
153}
static int ret
Final status code.
Definition: gnunet-arm.c:93
static struct GNUNET_TESTING_PluginFunctions * plugin
Plugin to dynamically load a test case.
static struct Plugin ** attr_plugins
Plugins.
static unsigned int num_plugins
Number of plugins.
static void init()
Load plugins.
void * cls
Closure to pass to start_testcase.
Handle for a plugin.
Definition: block.c:38

References attr_plugins, GNUNET_TESTING_PluginFunctions::cls, init(), num_plugins, plugin, and ret.

Referenced by iter_finished(), and parse_attr().

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 192 of file reclaim_attribute.c.

196{
197 unsigned int i;
198 struct Plugin *plugin;
199
200 init ();
201 for (i = 0; i < num_plugins; i++)
202 {
203 plugin = attr_plugins[i];
204 if (GNUNET_OK == plugin->api->string_to_value (plugin->api->cls,
205 type,
206 s,
207 data,
208 data_size))
209 return GNUNET_OK;
210 }
211 return GNUNET_SYSERR;
212}
@ GNUNET_OK
@ GNUNET_SYSERR

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

Referenced by iter_finished(), and parse_attr().

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 224 of file reclaim_attribute.c.

227{
228 unsigned int i;
229 struct Plugin *plugin;
230 char *ret;
231
232 init ();
233 for (i = 0; i < num_plugins; i++)
234 {
235 plugin = attr_plugins[i];
236 if (NULL != (ret = plugin->api->value_to_string (plugin->api->cls,
237 type,
238 data,
239 data_size)))
240 return ret;
241 }
242 return NULL;
243}

References attr_plugins, GNUNET_TESTING_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 163 of file reclaim_attribute.c.

164{
165 unsigned int i;
166 struct Plugin *plugin;
167 const char *ret;
168
169 init ();
170 for (i = 0; i < num_plugins; i++)
171 {
172 plugin = attr_plugins[i];
173 if (NULL !=
174 (ret = plugin->api->number_to_typename (plugin->api->cls, type)))
175 return ret;
176 }
177 return NULL;
178}

References attr_plugins, GNUNET_TESTING_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 281 of file reclaim_credential.c.

283{
285 size_t len = 0;
286
287 for (le = credentials->list_head; NULL != le; le = le->next)
288 {
289 GNUNET_assert (NULL != le->credential);
291 len += sizeof(struct GNUNET_RECLAIM_CredentialListEntry);
292 }
293 return len;
294}
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(), 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 384 of file reclaim_credential.c.

386{
389
390 for (ale = credentials->list_head; NULL != ale;)
391 {
392 if (NULL != ale->credential)
393 GNUNET_free (ale->credential);
394 tmp_ale = ale;
395 ale = ale->next;
396 GNUNET_free (tmp_ale);
397 }
398 GNUNET_free (credentials);
399}

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 298 of file reclaim_credential.c.

301{
303 size_t len;
304 size_t total_len;
305 char *write_ptr;
306 write_ptr = result;
307 total_len = 0;
308 for (le = credentials->list_head; NULL != le; le = le->next)
309 {
310 GNUNET_assert (NULL != le->credential);
311 len = GNUNET_RECLAIM_credential_serialize (le->credential, write_ptr);
312 total_len += len;
313 write_ptr += len;
314 }
315 return total_len;
316}
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(), 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 320 of file reclaim_credential.c.

321{
324 size_t att_len;
325 const char *read_ptr;
326
328
329 if ((data_size < sizeof(struct
331 + sizeof(struct GNUNET_RECLAIM_CredentialListEntry)))
332 return al;
333
334 read_ptr = data;
335 while (((data + data_size) - read_ptr) >= sizeof(struct Credential))
336 {
338 ale->credential =
340 data_size - (read_ptr - data));
341 if (NULL == ale->credential)
342 {
344 "Failed to deserialize malformed credential.\n");
345 GNUNET_free (ale);
346 return al;
347 }
350 read_ptr += att_len;
351 }
352 return al;
353}
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 409 of file reclaim_credential.c.

411{
412 return sizeof(struct Credential) + strlen (credential->name)
414}

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 418 of file reclaim_credential.c.

421{
422 size_t data_len_ser;
423 size_t name_len;
424 struct Credential *atts;
425 char *write_ptr;
426
427 atts = (struct Credential *) result;
428 atts->credential_type = htonl (credential->type);
429 atts->credential_flag = htonl (credential->flag);
430 atts->credential_id = credential->id;
431 name_len = strlen (credential->name);
432 atts->name_len = htons (name_len);
433 write_ptr = (char *) &atts[1];
434 GNUNET_memcpy (write_ptr, credential->name, name_len);
435 write_ptr += name_len;
436 // TODO plugin-ize
437 // data_len_ser = plugin->serialize_attribute_value (attr,
438 // &attr_ser[1]);
439 data_len_ser = credential->data_size;
440 GNUNET_memcpy (write_ptr, credential->data, credential->data_size);
441 atts->data_size = htons (data_len_ser);
442
443 return sizeof(struct Credential) + strlen (credential->name)
445}
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 457 of file reclaim_credential.c.

458{
460 struct Credential *atts;
461 size_t data_len;
462 size_t name_len;
463 char *write_ptr;
464
465 if (data_size < sizeof(struct Credential))
466 return NULL;
467
468 atts = (struct Credential *) data;
469 data_len = ntohs (atts->data_size);
470 name_len = ntohs (atts->name_len);
471 if (data_size < sizeof(struct Credential) + data_len + name_len)
472 {
474 "Buffer too small to deserialize\n");
475 return NULL;
476 }
478 + data_len + name_len + 1);
479 credential->type = ntohl (atts->credential_type);
480 credential->flag = ntohl (atts->credential_flag);
481 credential->id = atts->credential_id;
482 credential->data_size = data_len;
483
484 write_ptr = (char *) &credential[1];
485 GNUNET_memcpy (write_ptr, &atts[1], name_len);
486 write_ptr[name_len] = '\0';
487 credential->name = write_ptr;
488
489 write_ptr += name_len + 1;
490 GNUNET_memcpy (write_ptr, (char *) &atts[1] + name_len,
491 credential->data_size);
492 credential->data = write_ptr;
493 return credential;
494}

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 247 of file reclaim_credential.c.

251{
252 struct GNUNET_RECLAIM_Credential *attr;
253 char *write_ptr;
254 char *attr_name_tmp = GNUNET_strdup (attr_name);
255
256 GNUNET_STRINGS_utf8_tolower (attr_name, attr_name_tmp);
257
258 attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_Credential)
259 + strlen (attr_name_tmp) + 1 + data_size);
260 attr->type = type;
261 attr->data_size = data_size;
262 attr->flag = 0;
263 write_ptr = (char *) &attr[1];
264 GNUNET_memcpy (write_ptr, attr_name_tmp, strlen (attr_name_tmp) + 1);
265 attr->name = write_ptr;
266 write_ptr += strlen (attr->name) + 1;
267 GNUNET_memcpy (write_ptr, data, data_size);
268 attr->data = write_ptr;
269 GNUNET_free (attr_name_tmp);
270 return attr;
271}
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, data, GNUNET_RECLAIM_Credential::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, type, and GNUNET_RECLAIM_Credential::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 224 of file reclaim_credential.c.

227{
228 unsigned int i;
229 struct Plugin *plugin;
230 char *ret;
231
232 init ();
233 for (i = 0; i < num_plugins; i++)
234 {
236 if (NULL != (ret = plugin->api->value_to_string (plugin->api->cls,
237 type,
238 data,
239 data_size)))
240 return ret;
241 }
242 return NULL;
243}
static unsigned int num_plugins
Number of plugins.
static void init()
Load plugins.
static struct Plugin ** credential_plugins
Plugins.

References GNUNET_TESTING_PluginFunctions::cls, credential_plugins, data, data_size, 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_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 192 of file reclaim_credential.c.

196{
197 unsigned int i;
198 struct Plugin *plugin;
199
200 init ();
201 for (i = 0; i < num_plugins; i++)
202 {
204 if (GNUNET_OK == plugin->api->string_to_value (plugin->api->cls,
205 type,
206 s,
207 data,
208 data_size))
209 return GNUNET_OK;
210 }
211 return GNUNET_SYSERR;
212}

References GNUNET_TESTING_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 163 of file reclaim_credential.c.

164{
165 unsigned int i;
166 struct Plugin *plugin;
167 const char *ret;
168
169 init ();
170 for (i = 0; i < num_plugins; i++)
171 {
173 if (NULL !=
174 (ret = plugin->api->number_to_typename (plugin->api->cls, type)))
175 return ret;
176 }
177 return NULL;
178}

References GNUNET_TESTING_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 138 of file reclaim_credential.c.

139{
140 unsigned int i;
141 struct Plugin *plugin;
142 uint32_t ret;
143 init ();
144 for (i = 0; i < num_plugins; i++)
145 {
147 if (UINT32_MAX !=
148 (ret = plugin->api->typename_to_number (plugin->api->cls,
149 typename)))
150 return ret;
151 }
152 return UINT32_MAX;
153}

References GNUNET_TESTING_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 498 of file reclaim_credential.c.

500{
501 unsigned int i;
502 struct Plugin *plugin;
504 init ();
505 for (i = 0; i < num_plugins; i++)
506 {
508 if (NULL !=
509 (ret = plugin->api->get_attributes (plugin->api->cls,
510 credential)))
511 return ret;
512 }
513 return NULL;
514}

References GNUNET_TESTING_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 518 of file reclaim_credential.c.

520{
521 unsigned int i;
522 struct Plugin *plugin;
523 char *ret;
524 init ();
525 for (i = 0; i < num_plugins; i++)
526 {
528 if (NULL !=
529 (ret = plugin->api->get_issuer (plugin->api->cls,
530 credential)))
531 return ret;
532 }
533 return NULL;
534}

References GNUNET_TESTING_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 538 of file reclaim_credential.c.

541{
542 unsigned int i;
543 struct Plugin *plugin;
544 init ();
545 for (i = 0; i < num_plugins; i++)
546 {
548 if (GNUNET_OK != plugin->api->get_expiration (plugin->api->cls,
550 exp))
551 continue;
552 return GNUNET_OK;
553 }
554 return GNUNET_SYSERR;
555}

References GNUNET_TESTING_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 687 of file reclaim_credential.c.

689{
691 size_t len = 0;
692
693 for (le = presentations->list_head; NULL != le; le = le->next)
694 {
695 GNUNET_assert (NULL != le->presentation);
697 }
698 return len;
699}
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(), GNUNET_RECLAIM_PresentationList::list_head, GNUNET_RECLAIM_PresentationListEntry::next, and GNUNET_RECLAIM_PresentationListEntry::presentation.

Referenced by consume_result_cb(), OIDC_build_authz_code(), 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 795 of file reclaim_credential.c.

797{
800
801 for (ale = presentations->list_head; NULL != ale;)
802 {
803 if (NULL != ale->presentation)
805 tmp_ale = ale;
806 ale = ale->next;
807 GNUNET_free (tmp_ale);
808 }
809 GNUNET_free (presentations);
810}

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 703 of file reclaim_credential.c.

706{
708 size_t len;
709 size_t total_len;
710 char *write_ptr;
711 write_ptr = result;
712 total_len = 0;
713 for (le = presentations->list_head; NULL != le; le = le->next)
714 {
715 GNUNET_assert (NULL != le->presentation);
717 total_len += len;
718 write_ptr += len;
719 }
720 return total_len;
721}
size_t GNUNET_RECLAIM_presentation_serialize(const struct GNUNET_RECLAIM_Presentation *presentation, char *result)
Serialize a presentation.

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

Referenced by consume_result_cb(), OIDC_build_authz_code(), 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 732 of file reclaim_credential.c.

734{
737 size_t att_len;
738 const char *read_ptr;
739
741
742 if (data_size < sizeof(struct Presentation))
743 return al;
744
745 read_ptr = data;
746 while (((data + data_size) - read_ptr) >= sizeof(struct Presentation))
747 {
749 ale->presentation =
751 data_size - (read_ptr - data));
752 if (NULL == ale->presentation)
753 {
755 "Failed to deserialize malformed presentation.\n");
756 GNUNET_free (ale);
757 return al;
758 }
761 ale->presentation);
762 read_ptr += att_len;
763 }
764 return al;
765}
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 820 of file reclaim_credential.c.

822{
823 return sizeof(struct Presentation) + presentation->data_size;
824}

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 828 of file reclaim_credential.c.

831{
832 struct Presentation *atts;
833 char *write_ptr;
834
835 atts = (struct Presentation *) result;
836 atts->presentation_type = htonl (presentation->type);
837 atts->credential_id = presentation->credential_id;
838 write_ptr = (char *) &atts[1];
839 GNUNET_memcpy (write_ptr, presentation->data, presentation->data_size);
840 atts->data_size = htons (presentation->data_size);
841
842 return sizeof(struct Presentation) + presentation->data_size;
843}
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 855 of file reclaim_credential.c.

856{
857 struct GNUNET_RECLAIM_Presentation *presentation;
858 struct Presentation *atts;
859 size_t data_len;
860 char *write_ptr;
861
862 if (data_size < sizeof(struct Presentation))
863 return NULL;
864
865 atts = (struct Presentation *) data;
866 data_len = ntohs (atts->data_size);
867 if (data_size < sizeof(struct Presentation) + data_len)
868 {
870 "Buffer too small to deserialize\n");
871 return NULL;
872 }
873 presentation = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_Presentation)
874 + data_len);
875 presentation->type = ntohl (atts->presentation_type);
876 presentation->credential_id = atts->credential_id;
877 presentation->data_size = data_len;
878
879 write_ptr = (char *) &presentation[1];
880 GNUNET_memcpy (write_ptr, &atts[1], data_len);
881 presentation->data = write_ptr;
882 return presentation;
883}
A credential presentation.

References GNUNET_RECLAIM_Presentation::credential_id, Presentation::credential_id, data, GNUNET_RECLAIM_Presentation::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 639 of file reclaim_credential.c.

642{
643 unsigned int i;
644 struct Plugin *plugin;
645 char *ret;
646
647 init ();
648 for (i = 0; i < num_plugins; i++)
649 {
651 if (NULL != (ret = plugin->api->value_to_string_p (plugin->api->cls,
652 type,
653 data,
654 data_size)))
655 return ret;
656 }
657 return NULL;
658}

References GNUNET_TESTING_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 662 of file reclaim_credential.c.

665{
666 struct GNUNET_RECLAIM_Presentation *attr;
667 char *write_ptr;
668
669 attr = GNUNET_malloc (sizeof(struct GNUNET_RECLAIM_Presentation)
670 + data_size);
671 attr->type = type;
672 attr->data_size = data_size;
673 write_ptr = (char *) &attr[1];
674 GNUNET_memcpy (write_ptr, data, data_size);
675 attr->data = write_ptr;
676 return attr;
677}

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

Referenced by consume_ticket(), GNUNET_RECLAIM_presentation_list_dup(), jwt_create_presentation(), 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 607 of file reclaim_credential.c.

611{
612 unsigned int i;
613 struct Plugin *plugin;
614
615 init ();
616 for (i = 0; i < num_plugins; i++)
617 {
619 if (GNUNET_OK == plugin->api->string_to_value_p (plugin->api->cls,
620 type,
621 s,
622 data,
623 data_size))
624 return GNUNET_OK;
625 }
626 return GNUNET_SYSERR;
627}

References GNUNET_TESTING_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 578 of file reclaim_credential.c.

579{
580 unsigned int i;
581 struct Plugin *plugin;
582 const char *ret;
583
584 init ();
585 for (i = 0; i < num_plugins; i++)
586 {
588 if (NULL !=
589 (ret = plugin->api->number_to_typename_p (plugin->api->cls, type)))
590 return ret;
591 }
592 return NULL;
593}

References GNUNET_TESTING_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_typename_to_number()

uint32_t GNUNET_RECLAIM_presentation_typename_to_number ( const char *  typename)

Convert an presentation type name to the corresponding number.

Parameters
typenamename to convert
Returns
corresponding number, UINT32_MAX on error

Definition at line 559 of file reclaim_credential.c.

560{
561 unsigned int i;
562 struct Plugin *plugin;
563 uint32_t ret;
564 init ();
565 for (i = 0; i < num_plugins; i++)
566 {
568 if (UINT32_MAX !=
569 (ret = plugin->api->typename_to_number_p (plugin->api->cls,
570 typename)))
571 return ret;
572 }
573 return UINT32_MAX;
574}

References GNUNET_TESTING_PluginFunctions::cls, credential_plugins, init(), num_plugins, plugin, and ret.

Here is the call 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 887 of file reclaim_credential.c.

890{
891 unsigned int i;
892 struct Plugin *plugin;
894 init ();
895 for (i = 0; i < num_plugins; i++)
896 {
898 if (NULL !=
899 (ret = plugin->api->get_attributes_p (plugin->api->cls,
900 presentation)))
901 return ret;
902 }
903 return NULL;
904}

References GNUNET_TESTING_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 908 of file reclaim_credential.c.

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

References GNUNET_TESTING_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 929 of file reclaim_credential.c.

933{
934 unsigned int i;
935 struct Plugin *plugin;
936 init ();
937 for (i = 0; i < num_plugins; i++)
938 {
940 if (GNUNET_OK != plugin->api->get_expiration_p (plugin->api->cls,
941 presentation,
942 exp))
943 continue;
944 return GNUNET_OK;
945 }
946 return GNUNET_SYSERR;
947}

References GNUNET_TESTING_PluginFunctions::cls, credential_plugins, GNUNET_OK, GNUNET_SYSERR, init(), num_plugins, and plugin.

Here is the call graph for this function:

◆ GNUNET_RECLAIM_presentation_list_dup()

struct GNUNET_RECLAIM_PresentationList * GNUNET_RECLAIM_presentation_list_dup ( const struct GNUNET_RECLAIM_PresentationList al)

Make a (deep) copy of the presentation list.

Parameters
attrsclaim list to copy
Returns
copied claim list

Definition at line 769 of file reclaim_credential.c.

771{
773 struct GNUNET_RECLAIM_PresentationListEntry *result_ale;
775
777 for (ale = al->list_head; NULL != ale; ale = ale->next)
778 {
780 GNUNET_assert (NULL != ale->presentation);
781 result_ale->presentation =
783 ale->presentation->data,
784 ale->presentation->data_size);
787 result->list_tail,
788 result_ale);
789 }
790 return result;
791}
struct GNUNET_RECLAIM_Presentation * GNUNET_RECLAIM_presentation_new(uint32_t type, const void *data, size_t data_size)

References GNUNET_RECLAIM_Presentation::credential_id, GNUNET_RECLAIM_Presentation::data, GNUNET_RECLAIM_Presentation::data_size, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_new, GNUNET_RECLAIM_presentation_new(), GNUNET_RECLAIM_PresentationList::list_head, GNUNET_RECLAIM_PresentationListEntry::next, GNUNET_RECLAIM_PresentationListEntry::presentation, result, and GNUNET_RECLAIM_Presentation::type.

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 961 of file reclaim_credential.c.

965{
966 unsigned int i;
967 struct Plugin *plugin;
968 init ();
969 for (i = 0; i < num_plugins; i++)
970 {
972 if (GNUNET_OK != plugin->api->create_presentation (plugin->api->cls,
973 cred,
974 attrs,
975 presentation))
976 continue;
977 (*presentation)->credential_id = cred->id;
978 return GNUNET_OK;
979 }
980 return GNUNET_SYSERR;
981}
static gnutls_certificate_credentials_t cred
The credential.

References GNUNET_TESTING_PluginFunctions::cls, cred, credential_plugins, GNUNET_OK, GNUNET_SYSERR, 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:

◆ GNUNET_RECLAIM_credential_list_dup()

struct GNUNET_RECLAIM_CredentialList * GNUNET_RECLAIM_credential_list_dup ( const struct GNUNET_RECLAIM_CredentialList al)

Definition at line 357 of file reclaim_credential.c.

359{
361 struct GNUNET_RECLAIM_CredentialListEntry *result_ale;
363
365 for (ale = al->list_head; NULL != ale; ale = ale->next)
366 {
368 GNUNET_assert (NULL != ale->credential);
369 result_ale->credential =
371 ale->credential->type,
372 ale->credential->data,
373 ale->credential->data_size);
374 result_ale->credential->id = ale->credential->id;
376 result->list_tail,
377 result_ale);
378 }
379 return result;
380}
struct GNUNET_RECLAIM_Credential * GNUNET_RECLAIM_credential_new(const char *attr_name, uint32_t type, const void *data, size_t data_size)
Create a new credential.
struct GNUNET_RECLAIM_Identifier id
ID.

References GNUNET_RECLAIM_CredentialListEntry::credential, GNUNET_RECLAIM_Credential::data, GNUNET_RECLAIM_Credential::data_size, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_new, GNUNET_RECLAIM_credential_new(), GNUNET_RECLAIM_Credential::id, GNUNET_RECLAIM_CredentialList::list_head, GNUNET_RECLAIM_Credential::name, GNUNET_RECLAIM_CredentialListEntry::next, result, and GNUNET_RECLAIM_Credential::type.

Here is the call graph for this function:

Variable Documentation

◆ GNUNET_RECLAIM_ID_ZERO

const struct GNUNET_RECLAIM_Identifier GNUNET_RECLAIM_ID_ZERO
static

Definition at line 92 of file gnunet_reclaim_lib.h.

Referenced by start_process().