reclaim-credential-plugin-pabc attribute plugin to provide the API for pabc credentials. More...
#include "gnunet_common.h"
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_reclaim_plugin.h"
#include <inttypes.h>
#include <jansson.h>
#include <pabc/pabc.h>
#include "pabc_helper.h"
Go to the source code of this file.
Functions | |
static char * | pabc_value_to_string (void *cls, uint32_t type, const void *data, size_t data_size) |
Convert the 'value' of an credential to a string. More... | |
static int | pabc_string_to_value (void *cls, uint32_t type, const char *s, void **data, size_t *data_size) |
Convert human-readable version of a 'value' of an credential to the binary representation. More... | |
static uint32_t | pabc_typename_to_number (void *cls, const char *pabc_typename) |
Convert a type name to the corresponding number. More... | |
static const char * | pabc_number_to_typename (void *cls, uint32_t type) |
Convert a type number (i.e. More... | |
static void | inspect_attrs (char const *const key, char const *const value, void *ctx) |
static struct GNUNET_RECLAIM_AttributeList * | pabc_parse_attributes (void *cls, const char *data, size_t data_size) |
Parse a pabc and return the respective claim value as Attribute. More... | |
static struct GNUNET_RECLAIM_AttributeList * | pabc_parse_attributes_c (void *cls, const struct GNUNET_RECLAIM_Credential *cred) |
Parse a pabc and return the respective claim value as Attribute. More... | |
static struct GNUNET_RECLAIM_AttributeList * | pabc_parse_attributes_p (void *cls, const struct GNUNET_RECLAIM_Presentation *cred) |
Parse a pabc and return the respective claim value as Attribute. More... | |
static char * | pabc_get_issuer (void *cls, const char *data, size_t data_size) |
Parse a pabc and return the issuer. More... | |
static char * | pabc_get_issuer_c (void *cls, const struct GNUNET_RECLAIM_Credential *cred) |
Parse a pabc and return the issuer. More... | |
static char * | pabc_get_issuer_p (void *cls, const struct GNUNET_RECLAIM_Presentation *cred) |
Parse a pabc and return the issuer. More... | |
static enum GNUNET_GenericReturnValue | pabc_get_expiration (void *cls, const char *data, size_t data_size, struct GNUNET_TIME_Absolute *exp) |
Parse a pabc and return the expiration. More... | |
static enum GNUNET_GenericReturnValue | pabc_get_expiration_c (void *cls, const struct GNUNET_RECLAIM_Credential *cred, struct GNUNET_TIME_Absolute *exp) |
Parse a pabc and return the expiration. More... | |
static enum GNUNET_GenericReturnValue | pabc_get_expiration_p (void *cls, const struct GNUNET_RECLAIM_Presentation *cred, struct GNUNET_TIME_Absolute *exp) |
Parse a pabc and return the expiration. More... | |
static enum GNUNET_GenericReturnValue | pabc_create_presentation (void *cls, const struct GNUNET_RECLAIM_Credential *credential, const struct GNUNET_RECLAIM_AttributeList *attrs, struct GNUNET_RECLAIM_Presentation **presentation) |
void * | libgnunet_plugin_reclaim_credential_pabc_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_reclaim_credential_pabc_done (void *cls) |
Exit point from the plugin. More... | |
Variables | |
struct { | |
const char * name | |
uint32_t number | |
} | pabc_cred_name_map [] |
Mapping of credential type numbers to human-readable credential type names. More... | |
reclaim-credential-plugin-pabc attribute plugin to provide the API for pabc credentials.
Definition in file plugin_reclaim_credential_pabc.c.
|
static |
Convert the 'value' of an credential to a string.
cls | closure, unused |
type | type of the credential |
data | value in binary encoding |
data_size | number of bytes in data |
Definition at line 47 of file plugin_reclaim_credential_pabc.c.
References data, data_size, GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, GNUNET_strndup, and type.
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
|
static |
Convert human-readable version of a 'value' of an credential to the binary representation.
cls | closure, unused |
type | type of the credential |
s | human-readable string |
data | set to value in binary encoding (will be allocated) |
data_size | set to number of bytes in data |
Definition at line 75 of file plugin_reclaim_credential_pabc.c.
References data, data_size, GNUNET_OK, GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, GNUNET_strdup, GNUNET_SYSERR, and type.
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
|
static |
Convert a type name to the corresponding number.
cls | closure, unused |
pabc_typename | name to convert |
Definition at line 115 of file plugin_reclaim_credential_pabc.c.
References name, and pabc_cred_name_map.
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
|
static |
Convert a type number (i.e.
1) to the corresponding type string
cls | closure, unused |
type | number of a type to convert |
Definition at line 135 of file plugin_reclaim_credential_pabc.c.
References name, number, pabc_cred_name_map, and type.
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
|
static |
Definition at line 149 of file plugin_reclaim_credential_pabc.c.
References ctx, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_RECLAIM_attribute_list_add(), GNUNET_RECLAIM_ATTRIBUTE_TYPE_STRING, key, and value.
Referenced by pabc_parse_attributes().
|
static |
Parse a pabc and return the respective claim value as Attribute.
cls | the plugin |
cred | the pabc credential |
Definition at line 183 of file plugin_reclaim_credential_pabc.c.
References data, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, and inspect_attrs().
Referenced by pabc_parse_attributes_c(), and pabc_parse_attributes_p().
|
static |
Parse a pabc and return the respective claim value as Attribute.
cls | the plugin |
cred | the pabc credential |
Definition at line 207 of file plugin_reclaim_credential_pabc.c.
References cred, GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, and pabc_parse_attributes().
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
|
static |
Parse a pabc and return the respective claim value as Attribute.
cls | the plugin |
cred | the pabc credential |
Definition at line 224 of file plugin_reclaim_credential_pabc.c.
References cred, GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, and pabc_parse_attributes().
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
|
static |
Parse a pabc and return the issuer.
cls | the plugin |
cred | the pabc credential |
Definition at line 241 of file plugin_reclaim_credential_pabc.c.
Referenced by pabc_get_issuer_c(), and pabc_get_issuer_p().
|
static |
Parse a pabc and return the issuer.
cls | the plugin |
cred | the pabc credential |
Definition at line 262 of file plugin_reclaim_credential_pabc.c.
References cred, GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, and pabc_get_issuer().
Referenced by libgnunet_plugin_reclaim_credential_pabc_init(), and pabc_create_presentation().
|
static |
Parse a pabc and return the issuer.
cls | the plugin |
cred | the pabc credential |
Definition at line 279 of file plugin_reclaim_credential_pabc.c.
References cred, GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, and pabc_get_issuer().
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
|
static |
Parse a pabc and return the expiration.
cls | the plugin |
cred | the pabc credential |
Definition at line 296 of file plugin_reclaim_credential_pabc.c.
References GNUNET_TIME_Absolute::abs_value_us, data, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_OK, and GNUNET_SYSERR.
Referenced by pabc_get_expiration_c(), and pabc_get_expiration_p().
|
static |
Parse a pabc and return the expiration.
cls | the plugin |
cred | the pabc credential |
Definition at line 334 of file plugin_reclaim_credential_pabc.c.
References cred, GNUNET_NO, GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, and pabc_get_expiration().
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
|
static |
Parse a pabc and return the expiration.
cls | the plugin |
cred | the pabc credential |
Definition at line 352 of file plugin_reclaim_credential_pabc.c.
References cred, GNUNET_NO, GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, and pabc_get_expiration().
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
|
static |
Definition at line 363 of file plugin_reclaim_credential_pabc.c.
References GNUNET_RECLAIM_AttributeListEntry::attribute, cred, credential, ctx, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_RECLAIM_CREDENTIAL_TYPE_PABC, GNUNET_RECLAIM_presentation_new(), GNUNET_STRINGS_base64_encode(), GNUNET_SYSERR, GNUNET_RECLAIM_AttributeList::list_head, GNUNET_RECLAIM_Attribute::name, GNUNET_RECLAIM_AttributeListEntry::next, pabc_get_issuer_c(), PABC_load_public_parameters(), PABC_read_usr_ctx(), proof, status, and subject.
Referenced by libgnunet_plugin_reclaim_credential_pabc_init().
void * libgnunet_plugin_reclaim_credential_pabc_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | NULL |
Definition at line 535 of file plugin_reclaim_credential_pabc.c.
References GNUNET_RECLAIM_CredentialPluginFunctions::create_presentation, GNUNET_RECLAIM_CredentialPluginFunctions::get_attributes, GNUNET_RECLAIM_CredentialPluginFunctions::get_attributes_p, GNUNET_RECLAIM_CredentialPluginFunctions::get_expiration, GNUNET_RECLAIM_CredentialPluginFunctions::get_expiration_p, GNUNET_RECLAIM_CredentialPluginFunctions::get_issuer, GNUNET_RECLAIM_CredentialPluginFunctions::get_issuer_p, GNUNET_new, GNUNET_RECLAIM_CredentialPluginFunctions::number_to_typename, GNUNET_RECLAIM_CredentialPluginFunctions::number_to_typename_p, pabc_create_presentation(), pabc_get_expiration_c(), pabc_get_expiration_p(), pabc_get_issuer_c(), pabc_get_issuer_p(), pabc_number_to_typename(), pabc_parse_attributes_c(), pabc_parse_attributes_p(), pabc_string_to_value(), pabc_typename_to_number(), pabc_value_to_string(), GNUNET_RECLAIM_CredentialPluginFunctions::string_to_value, GNUNET_RECLAIM_CredentialPluginFunctions::string_to_value_p, GNUNET_RECLAIM_CredentialPluginFunctions::typename_to_number, GNUNET_RECLAIM_CredentialPluginFunctions::typename_to_number_p, GNUNET_RECLAIM_CredentialPluginFunctions::value_to_string, and GNUNET_RECLAIM_CredentialPluginFunctions::value_to_string_p.
void * libgnunet_plugin_reclaim_credential_pabc_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the return value from libgnunet_plugin_block_test_init() |
Definition at line 568 of file plugin_reclaim_credential_pabc.c.
References GNUNET_RECLAIM_CredentialPluginFunctions::cls, and GNUNET_free.
const char* name |
Definition at line 102 of file plugin_reclaim_credential_pabc.c.
Referenced by pabc_number_to_typename(), and pabc_typename_to_number().
uint32_t number |
Definition at line 103 of file plugin_reclaim_credential_pabc.c.
Referenced by pabc_number_to_typename().
struct { ... } pabc_cred_name_map[] |
Mapping of credential type numbers to human-readable credential type names.
Referenced by pabc_number_to_typename(), and pabc_typename_to_number().