489 if (NULL != adh->
ns_it)
491 if (NULL != adh->
ns_qe)
493 if (NULL != adh->
label)
495 if (NULL != adh->
claim)
508 if (NULL != le->
label)
510 if (NULL != le->
data)
526 if (NULL != ash->
ns_qe)
528 if (NULL != ash->
claim)
552 while (NULL != (iss =
idp->issue_op_head))
557 while (NULL != (ct =
idp->consume_op_head))
560 idp->consume_op_tail,
566 while (NULL != (as =
idp->store_op_head))
571 while (NULL != (adh =
idp->delete_op_head))
577 while (NULL != (
ai =
idp->attr_iter_head))
582 while (NULL != (
ai =
idp->cred_iter_head))
589 while (NULL != (rop =
idp->revoke_op_head))
596 while (NULL != (ti =
idp->ticket_iter_head))
599 idp->ticket_iter_tail,
601 if (NULL != ti->
iter)
659 if (NULL != presentations)
669 buf = (
char*) &irm[1];
672 memcpy (buf,
ticket, tkt_len);
676 irm->
id = htonl (r_id);
677 irm->
tkt_len = htons (tkt_len);
680 if (NULL != presentations)
712 tio->client->issue_op_tail,
721 tio->client->issue_op_tail,
746 if (
size != attrs_len + key_len + rp_len +
sizeof(
struct
779 buf = (
char *) &im[1];
786 "Failed to read private key\n");
802 tio->r_id = ntohl (im->
id);
833 "Sending REVOKE_TICKET_RESULT message\n");
836 trm->
id = htonl (rop->
r_id);
892 buf = (
char *) &rm[1];
899 "Failed to read private key\n");
906 rop->
r_id = ntohl (rm->
id);
936 size_t attrs_len = 0;
950 "Sending CONSUME_TICKET_RESULT message\n");
952 attrs_len + pres_len + key_len,
954 crm->
id = htonl (cop->
r_id);
957 crm->
key_len = htons (key_len);
958 crm->
result = htons (success);
959 data_tmp = (
char *) &crm[1];
966 data_tmp += attrs_len;
987 uint16_t rp_uri_size;
990 tkt_size = ntohs (cm->
tkt_len);
1017 buf = (
char*) &cm[1];
1019 rp_uri = buf + ntohs (cm->
tkt_len);
1021 cop->
r_id = ntohl (cm->
id);
1060 "Failed to store attribute %s\n",
1069 acr_msg->
id = htonl (ash->
r_id);
1162 key_len = ntohs (sam->
key_len);
1163 buf = (
char *) &sam[1];
1170 "Failed to read private key\n");
1180 ash->
r_id = ntohl (sam->
id);
1214 "Failed to store credential: %s\n",
1223 acr_msg->
id = htonl (ash->
r_id);
1240 "Failed to check for existing credential.\n");
1272 "Storing new credential under `%s'.\n",
1275 rd_new[0].
data = buf;
1308 "Looking up existing data under label `%s'\n", label);
1363 key_len = ntohs (sam->
key_len);
1364 buf = (
char *) &sam[1];
1371 "Failed to read private key\n");
1380 ash->
r_id = ntohl (sam->
id);
1410 acr_msg->
id = htonl (adh->
r_id);
1440 switch (
rd[i].record_type)
1461 "Ticket to delete found (%s)\n",
1533 "Finished updating tickets, success\n");
1551 "Unable to deserialize record data!\n");
1556 for (i = 0; i < le->rd_count; i++)
1568 "Found attribute %s, re-adding...\n",
1588 "Found presentation for credential %s, re-adding...\n",
1607 "Updating ticket with %d entries (%d before)...\n",
1639 "Error deleting attribute %s\n",
1669 NULL != cle; cle = cle->
next)
1680 "Found attribute with missing credential\n");
1687 "Attributes consistent, updating tickets.\n");
1692 "Attributes inconsistent, deleting offending attribute.\n");
1737 "Namestore error on consistency check\n");
1784 "Error deleting attribute %s\n",
1838 key_len = ntohs (dam->
key_len);
1839 buf = (
char *) &dam[1];
1846 "Failed to read private key\n");
1857 adh->
r_id = ntohl (dam->
id);
1891 "Error deleting credential `%s'\n",
1945 key_len = ntohs (dam->
key_len);
1946 buf = (
char *) &dam[1];
1953 "Failed to read private key\n");
1963 adh->
r_id = ntohl (dam->
id);
2000 arm->
id = htonl (
ai->request_id);
2005 ai->client->attr_iter_tail,
2059 "Sending ATTRIBUTE_RESULT message\n");
2065 arm->
id = htonl (
ai->request_id);
2067 data_tmp = (
char *) &arm[1];
2073 data_tmp += written;
2088 key_len = ntohs (ais_msg->
key_len);
2090 if (
size < key_len +
sizeof(*ais_msg))
2116 "Received ATTRIBUTE_ITERATION_START message\n");
2117 key_len = ntohs (ais_msg->
key_len);
2126 "Failed to read private key.\n");
2131 ai->request_id = ntohl (ais_msg->
id);
2163 "Received `%s' message\n",
2164 "ATTRIBUTE_ITERATION_STOP");
2165 rid = ntohl (ais_msg->
id);
2167 if (
ai->request_id == rid)
2196 "Received ATTRIBUTE_ITERATION_NEXT message\n");
2197 rid = ntohl (ais_msg->
id);
2199 if (
ai->request_id == rid)
2231 arm->
id = htonl (
ai->request_id);
2236 ai->client->cred_iter_tail,
2290 "Sending CREDENTIAL_RESULT message\n");
2296 arm->
id = htonl (
ai->request_id);
2298 arm->
key_len = htons (key_len);
2299 data_tmp = (
char *) &arm[1];
2304 data_tmp += written;
2319 key_len = ntohs (cis_msg->
key_len);
2321 if (
size < key_len +
sizeof(*cis_msg))
2348 "Received CREDENTIAL_ITERATION_START message\n");
2349 key_len = ntohs (ais_msg->
key_len);
2358 "Failed to read private key.\n");
2363 ai->request_id = ntohl (ais_msg->
id);
2397 "Received `%s' message\n",
2398 "CREDENTIAL_ITERATION_STOP");
2399 rid = ntohl (ais_msg->
id);
2401 if (
ai->request_id == rid)
2432 "Received CREDENTIAL_ITERATION_NEXT message\n");
2433 rid = ntohl (ais_msg->
id);
2435 if (
ai->request_id == rid)
2486 trm->
id = htonl (ti->
r_id);
2506 key_len = ntohs (tis_msg->
key_len);
2508 if (
size < key_len +
sizeof(*tis_msg))
2535 "Received TICKET_ITERATION_START message\n");
2536 key_len = ntohs (tis_msg->
key_len);
2545 "Failed to read private key\n");
2550 ti->
r_id = ntohl (tis_msg->
id);
2576 "Received `%s' message\n",
2577 "TICKET_ITERATION_STOP");
2578 rid = ntohl (tis_msg->
id);
2580 if (ti->
r_id == rid)
2612 "Received TICKET_ITERATION_NEXT message\n");
2613 rid = ntohl (tis_msg->
id);
2615 if (ti->
r_id == rid)
2645 "Unable to initialize TICKETS subsystem.\n");
2654 "error connecting to namestore");
struct GNUNET_MQ_Handle * mq
struct GNUNET_MQ_Envelope * env
static struct GNUNET_CADET_ListTunnels * tio
Active tunnel listing operation.
static struct GNUNET_TRANSPORT_AddressIdentifier * ai
Handle to the operation that publishes our address.
static char * data
The data to insert into the dht.
static unsigned int rd_count
Number of records for currently parsed set.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
static size_t data_size
Number of bytes in data.
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
static char * rp
Relying party.
static void handle_ticket_iteration_next(void *cls, const struct TicketIterationNextMessage *tis_msg)
Client requests next result.
static void cred_delete_cont(void *cls, enum GNUNET_ErrorCode ec)
Credential deleted callback.
static void attr_store_cont(void *cls, enum GNUNET_ErrorCode ec)
Attribute store result handler.
static int check_consume_ticket_message(void *cls, const struct ConsumeTicketMessage *cm)
Check a consume ticket message.
static int check_issue_ticket_message(void *cls, const struct IssueTicketMessage *im)
Check issue ticket message.
static void cleanup_adh(struct AttributeDeleteHandle *adh)
Cleanup attribute delete handle.
static void handle_issue_ticket_message(void *cls, const struct IssueTicketMessage *im)
Handle ticket issue message.
static void update_tickets(void *cls)
Recursion prototype for function.
static void consume_result_cb(void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_AttributeList *attrs, const struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg)
Handle a ticket consume result.
static void cred_store_task(void *cls)
Add a new credential.
static void attr_iter_finished(void *cls)
Done iterating over attributes.
static void handle_iteration_start(void *cls, const struct AttributeIterationStartMessage *ais_msg)
Iterate over zone to get attributes.
static int check_credential_store_message(void *cls, const struct AttributeStoreMessage *sam)
Check an credential store message.
static void revoke_result_cb(void *cls, int32_t success)
Handles revocation result.
static void handle_credential_iteration_start(void *cls, const struct CredentialIterationStartMessage *ais_msg)
Iterate over zone to get attributes.
static int check_revoke_ticket_message(void *cls, const struct RevokeTicketMessage *rm)
Check revocation message format.
static int check_attribute_store_message(void *cls, const struct AttributeStoreMessage *sam)
Check an attribute store message.
static void cred_iter_error(void *cls)
Error iterating over credentials.
static struct IdpClient * client_list_tail
Client list.
static void cred_iter_cb(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Got record.
static void consistency_iter(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Namestore iteration within attribute deletion.
static void handle_revoke_ticket_message(void *cls, const struct RevokeTicketMessage *rm)
Handle a revocation message to a ticket.
static const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static void cleanup()
Cleanup task.
static void send_delete_response(struct AttributeDeleteHandle *adh, int32_t success)
Send a deletion success response.
static void offending_attr_delete_cont(void *cls, enum GNUNET_ErrorCode ec)
static void cred_store_cont(void *cls, enum GNUNET_ErrorCode ec)
Credential store result handler.
static void consistency_iter_err(void *cls)
Error collecting affected tickets.
static void cred_error(void *cls)
Error looking up potential credential.
static void handle_attribute_delete_message(void *cls, const struct AttributeDeleteMessage *dam)
Handle attribute deletion.
static void purge_attributes(void *cls)
Delete all attributes which reference credentials that no longer exist.
static void handle_credential_delete_message(void *cls, const struct AttributeDeleteMessage *dam)
Handle credential deletion.
static void handle_credential_iteration_next(void *cls, const struct CredentialIterationNextMessage *ais_msg)
Client requests next credential from iterator.
static void run(void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *server)
Main function that will be run.
static void handle_ticket_iteration_start(void *cls, const struct TicketIterationStartMessage *tis_msg)
Client requests a ticket iteration.
static void do_shutdown(void *cls)
Shutdown task.
static void * client_connect_cb(void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
Add a client to our list of active clients.
static void start_consistency_update(void *cls)
Start processing tickets which may still contain reference to deleted attribute.
static void consistency_iter_fin(void *cls)
Done collecting affected tickets, start updating.
static void ticket_updated(void *cls, enum GNUNET_ErrorCode ec)
Callback called when a ticket was updated.
static void attr_iter_cb(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Got record.
static void handle_credential_store_message(void *cls, const struct AttributeStoreMessage *sam)
Handle a credential store message.
static void attr_delete_cont(void *cls, enum GNUNET_ErrorCode ec)
Attribute deleted callback.
static void issue_ticket_result_cb(void *cls, struct GNUNET_RECLAIM_Ticket *ticket, struct GNUNET_RECLAIM_PresentationList *presentations, int32_t success, const char *emsg)
Issue ticket result.
static void handle_consume_ticket_message(void *cls, const struct ConsumeTicketMessage *cm)
Handle a consume ticket message.
static struct GNUNET_NAMESTORE_Handle * nsh
Namestore handle.
static int check_credential_delete_message(void *cls, const struct AttributeDeleteMessage *dam)
Check credential delete message format.
static void handle_attribute_store_message(void *cls, const struct AttributeStoreMessage *sam)
Handle an attribute store message.
static void cred_iter_finished(void *cls)
Done iterating over credentials.
static void cred_add_cb(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Check for existing record before storing credential.
static struct IdpClient * client_list_head
Client list.
static struct GNUNET_SCHEDULER_Task * timeout_task
Timeout task.
static void attr_iter_error(void *cls)
Error iterating over attributes.
static void send_ticket_result(const struct IdpClient *client, uint32_t r_id, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_PresentationList *presentations, uint32_t success)
Sends a ticket result message to the client.
static void ticket_iter_cb(void *cls, struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri)
static int check_attribute_delete_message(void *cls, const struct AttributeDeleteMessage *dam)
Check attribute delete message format.
static void handle_iteration_stop(void *cls, const struct AttributeIterationStopMessage *ais_msg)
Handle iteration stop message from client.
GNUNET_SERVICE_MAIN(GNUNET_OS_project_data_gnunet(), "reclaim", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_var_size(attribute_store_message, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE, struct AttributeStoreMessage, NULL), GNUNET_MQ_hd_var_size(credential_store_message, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE, struct AttributeStoreMessage, NULL), GNUNET_MQ_hd_var_size(attribute_delete_message, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE, struct AttributeDeleteMessage, NULL), GNUNET_MQ_hd_var_size(credential_delete_message, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE, struct AttributeDeleteMessage, NULL), GNUNET_MQ_hd_var_size(iteration_start, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START, struct AttributeIterationStartMessage, NULL), GNUNET_MQ_hd_fixed_size(iteration_next, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT, struct AttributeIterationNextMessage, NULL), GNUNET_MQ_hd_fixed_size(iteration_stop, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP, struct AttributeIterationStopMessage, NULL), GNUNET_MQ_hd_var_size(credential_iteration_start, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START, struct CredentialIterationStartMessage, NULL), GNUNET_MQ_hd_fixed_size(credential_iteration_next, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT, struct CredentialIterationNextMessage, NULL), GNUNET_MQ_hd_fixed_size(credential_iteration_stop, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP, struct CredentialIterationStopMessage, NULL), GNUNET_MQ_hd_var_size(issue_ticket_message, GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET, struct IssueTicketMessage, NULL), GNUNET_MQ_hd_var_size(consume_ticket_message, GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET, struct ConsumeTicketMessage, NULL), GNUNET_MQ_hd_var_size(ticket_iteration_start, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START, struct TicketIterationStartMessage, NULL), GNUNET_MQ_hd_fixed_size(ticket_iteration_next, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT, struct TicketIterationNextMessage, NULL), GNUNET_MQ_hd_fixed_size(ticket_iteration_stop, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP, struct TicketIterationStopMessage, NULL), GNUNET_MQ_hd_var_size(revoke_ticket_message, GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET, struct RevokeTicketMessage, NULL), GNUNET_MQ_handler_end())
Define "main" method using service macro.
static void attr_store_task(void *cls)
Add a new attribute.
static void client_disconnect_cb(void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx)
Called whenever a client is disconnected.
static enum GNUNET_GenericReturnValue check_iteration_start(void *cls, const struct AttributeIterationStartMessage *ais_msg)
static void handle_credential_iteration_stop(void *cls, const struct CredentialIterationStopMessage *ais_msg)
Handle iteration stop message from client.
static void cleanup_client(struct IdpClient *idp)
Cleanup client.
static void cleanup_as_handle(struct AttributeStoreHandle *ash)
Cleanup attribute store handle.
static enum GNUNET_GenericReturnValue check_credential_iteration_start(void *cls, const struct CredentialIterationStartMessage *cis_msg)
static void handle_iteration_next(void *cls, const struct AttributeIterationNextMessage *ais_msg)
Client requests next attribute from iterator.
static void handle_ticket_iteration_stop(void *cls, const struct TicketIterationStopMessage *tis_msg)
Client has had enough tickets.
static enum GNUNET_GenericReturnValue check_ticket_iteration_start(void *cls, const struct TicketIterationStartMessage *tis_msg)
void RECLAIM_TICKETS_iteration_stop(struct RECLAIM_TICKETS_Iterator *iter)
Stop a running ticket iteration.
void RECLAIM_TICKETS_consume_cancel(struct RECLAIM_TICKETS_ConsumeHandle *cth)
Cancel a consume operation.
struct RECLAIM_TICKETS_Iterator * RECLAIM_TICKETS_iteration_start(const struct GNUNET_CRYPTO_PrivateKey *identity, RECLAIM_TICKETS_TicketIter cb, void *cb_cls)
Iterate over all tickets issued by an identity.
void RECLAIM_TICKETS_revoke_cancel(struct RECLAIM_TICKETS_RevokeHandle *rh)
Cancel a revocation.
int RECLAIM_TICKETS_init(const struct GNUNET_CONFIGURATION_Handle *c)
Initialize tickets component.
void RECLAIM_TICKETS_iteration_next(struct RECLAIM_TICKETS_Iterator *iter)
Continue ticket iteration.
struct RECLAIM_TICKETS_RevokeHandle * RECLAIM_TICKETS_revoke(const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_CRYPTO_PrivateKey *identity, RECLAIM_TICKETS_RevokeCallback cb, void *cb_cls)
Revoke a ticket.
void RECLAIM_TICKETS_issue(const struct GNUNET_CRYPTO_PrivateKey *identity, const struct GNUNET_RECLAIM_AttributeList *attrs, const char *rp, RECLAIM_TICKETS_TicketResult cb, void *cb_cls)
Issue a new reclaim ticket, thereby authorizing the audience to access the set of provided attributes...
struct RECLAIM_TICKETS_ConsumeHandle * RECLAIM_TICKETS_consume(const struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri, RECLAIM_TICKETS_ConsumeCallback cb, void *cb_cls)
Consume a ticket.
void RECLAIM_TICKETS_deinit(void)
Close handles and clean up.
API that can be used to manipulate GNS record data.
Constants for network protocols.
Identity attribute definitions.
reclaim service; implements identity and personal data sharing for GNUnet
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
int GNUNET_GNSRECORD_records_deserialize(size_t len, const char *src, unsigned int rd_count, struct GNUNET_GNSRECORD_Data *dest)
Deserialize the given records to the given destination.
ssize_t GNUNET_GNSRECORD_records_serialize(unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, size_t dest_size, char *dest)
Serialize the given records to the given destination buffer.
ssize_t GNUNET_GNSRECORD_records_get_size(unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Calculate how many bytes we will need to serialize the given records.
@ GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION
This expiration time of the record is a relative time (not an absolute time).
ssize_t GNUNET_CRYPTO_public_key_get_length(const struct GNUNET_CRYPTO_PublicKey *key)
Get the compacted length of a GNUNET_CRYPTO_PublicKey.
#define GNUNET_log(kind,...)
ssize_t GNUNET_CRYPTO_write_public_key_to_buffer(const struct GNUNET_CRYPTO_PublicKey *key, void *buffer, size_t len)
Writes a GNUNET_CRYPTO_PublicKey to a compact buffer.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_key_get_public(const struct GNUNET_CRYPTO_PrivateKey *privkey, struct GNUNET_CRYPTO_PublicKey *key)
Retrieves the public key representation of a private key.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_read_private_key_from_buffer(const void *buffer, size_t len, struct GNUNET_CRYPTO_PrivateKey *key, size_t *read)
Reads a GNUNET_CRYPTO_PrivateKey from a compact buffer.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_log_strerror(level, cmd)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor rm, void *rm_cls)
Lookup an item in the namestore.
struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_record_set_store(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, GNUNET_NAMESTORE_ContinuationWithStatus cont, void *cont_cls)
Store an item in the namestore.
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
void GNUNET_NAMESTORE_zone_iterator_next(struct GNUNET_NAMESTORE_ZoneIterator *it, uint64_t limit)
Calls the record processor specified in GNUNET_NAMESTORE_zone_iteration_start for the next record.
void GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe)
Cancel a namestore operation.
struct GNUNET_NAMESTORE_ZoneIterator * GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *zone, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
void GNUNET_NAMESTORE_zone_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it)
Stops iteration and releases the namestore handle for further calls.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
#define GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT
#define GNUNET_MESSAGE_TYPE_RECLAIM_SUCCESS_RESPONSE
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP
#define GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT
#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
#define GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE
#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET_RESULT
#define GNUNET_RECLAIM_id_is_equal(a, b)
void GNUNET_RECLAIM_attribute_list_destroy(struct GNUNET_RECLAIM_AttributeList *attrs)
Destroy claim list.
struct GNUNET_RECLAIM_Presentation * GNUNET_RECLAIM_presentation_deserialize(const char *data, size_t data_size)
Deserialize a presentation.
void GNUNET_RECLAIM_credential_list_destroy(struct GNUNET_RECLAIM_CredentialList *credentials)
Destroy credential list.
#define GNUNET_RECLAIM_id_is_zero(a)
struct GNUNET_RECLAIM_AttributeList * GNUNET_RECLAIM_attribute_list_deserialize(const char *data, size_t data_size)
Deserialize an attribute list.
#define GNUNET_RECLAIM_id_generate(id)
size_t GNUNET_RECLAIM_attribute_serialize_get_size(const struct GNUNET_RECLAIM_Attribute *attr)
Get required size for serialization buffer.
size_t GNUNET_RECLAIM_attribute_list_serialize(const struct GNUNET_RECLAIM_AttributeList *attrs, char *result)
Serialize an attribute list.
ssize_t GNUNET_RECLAIM_attribute_deserialize(const char *data, size_t data_size, struct GNUNET_RECLAIM_Attribute **attr)
Deserialize an attribute.
size_t GNUNET_RECLAIM_presentation_list_serialize(const struct GNUNET_RECLAIM_PresentationList *presentations, char *result)
Serialize a presentation list.
size_t GNUNET_RECLAIM_credential_serialize(const struct GNUNET_RECLAIM_Credential *credential, char *result)
Serialize an credential.
struct GNUNET_RECLAIM_Credential * GNUNET_RECLAIM_credential_deserialize(const char *data, size_t data_size)
Deserialize an credential.
size_t GNUNET_RECLAIM_presentation_list_serialize_get_size(const struct GNUNET_RECLAIM_PresentationList *presentations)
Get required size for serialization buffer.
size_t GNUNET_RECLAIM_attribute_list_serialize_get_size(const struct GNUNET_RECLAIM_AttributeList *attrs)
Get required size for serialization buffer.
size_t GNUNET_RECLAIM_credential_serialize_get_size(const struct GNUNET_RECLAIM_Credential *credential)
Get required size for serialization buffer.
size_t GNUNET_RECLAIM_attribute_serialize(const struct GNUNET_RECLAIM_Attribute *attr, char *result)
Serialize an attribute.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
void GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c)
Ask the server to disconnect from the given client.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
@ GNUNET_SERVICE_OPTION_NONE
Use defaults.
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
static struct GNUNET_RECLAIM_Handle * idp
Identity Provider.
static unsigned int size
Size of the "table".
Common type definitions for the identity provider service and API.
#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE
identity attribute
#define GNUNET_GNSRECORD_TYPE_RECLAIM_PRESENTATION
Record type for a presentation of a credential.
#define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTRIBUTE_REF
for reclaim records
#define GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL
Record type for an attribute attestation (e.g.
#define GNUNET_GNSRECORD_TYPE_RECLAIM_TICKET
local ticket reference
const char * GNUNET_ErrorCode_get_hint(enum GNUNET_ErrorCode ec)
Returns a hint for a given error code.
GNUNET_ErrorCode
Taler error codes.
@ GNUNET_EC_NONE
No error (success).
Handle for attribute deletion request.
struct GNUNET_RECLAIM_CredentialList * existing_credentials
Existing credentials.
struct GNUNET_CRYPTO_PrivateKey identity
Identity.
struct TicketRecordsEntry * tickets_to_update_tail
Tickets to update.
struct GNUNET_RECLAIM_Attribute * claim
The attribute to delete.
struct AttributeDeleteHandle * next
DLL.
struct IdpClient * client
Client connection.
char * label
Attribute label.
struct GNUNET_NAMESTORE_ZoneIterator * ns_it
Iterator.
struct GNUNET_RECLAIM_AttributeList * existing_attributes
Existing attributes.
struct GNUNET_NAMESTORE_QueueEntry * ns_qe
QueueEntry.
struct AttributeDeleteHandle * prev
DLL.
struct GNUNET_RECLAIM_Credential * credential
The credential to delete.
struct TicketRecordsEntry * tickets_to_update_head
Tickets to update.
Use to delete an identity attribute.
struct GNUNET_MessageHeader header
Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT.
uint16_t key_len
The length of the private key.
uint16_t attr_len
The length of the attribute.
uint32_t id
Unique identifier for this request (for key collisions).
Ask for next result of attribute iteration for the given operation.
uint32_t id
Unique identifier for this request (for key collisions).
Start a attribute iteration for the given identity.
uint16_t key_len
The length of the private key.
uint32_t id
Unique identifier for this request (for key collisions).
struct GNUNET_MessageHeader header
Message.
Stop attribute iteration for the given operation.
uint32_t id
Unique identifier for this request (for key collisions).
Attribute is returned from the idp.
uint16_t attr_len
Length of serialized attribute data.
uint16_t pkey_len
The length of the public key.
uint32_t id
Unique identifier for this request (for key collisions).
Handle for attribute store request.
struct GNUNET_NAMESTORE_QueueEntry * ns_qe
QueueEntry.
struct IdpClient * client
Client connection.
struct GNUNET_CRYPTO_PrivateKey identity
Identity.
struct GNUNET_RECLAIM_Credential * credential
The credential to store.
struct GNUNET_TIME_Relative exp
The attribute expiration interval.
struct GNUNET_CRYPTO_PublicKey identity_pkey
Identity pubkey.
struct AttributeStoreHandle * prev
DLL.
struct AttributeStoreHandle * next
DLL.
struct GNUNET_RECLAIM_Attribute * claim
The attribute to store.
Use to store an identity attribute.
struct GNUNET_MessageHeader header
Type: #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT.
uint64_t exp
The expiration interval of the attribute.
uint16_t key_len
The length of the private key.
uint16_t attr_len
The length of the attribute.
uint32_t id
Unique identifier for this request (for key collisions).
uint32_t id
Unique identifier for this request (for key collisions).
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET.
uint16_t rp_uri_len
RP URI length.
uint16_t tkt_len
The length of the ticket.
Handle for ticket consume request.
struct ConsumeTicketOperation * next
DLL.
struct IdpClient * client
Client connection.
struct ConsumeTicketOperation * prev
DLL.
struct RECLAIM_TICKETS_ConsumeHandle * ch
Ticket consume handle.
Attribute list is returned from the idp.
uint16_t attrs_len
Length of serialized attribute data.
uint16_t presentations_len
Length of presentation data.
uint32_t id
Unique identifier for this request (for key collisions).
uint16_t key_len
The length of the identity public key.
Ask for next result of credential iteration for the given operation.
uint32_t id
Unique identifier for this request (for key collisions).
Start a credential iteration for the given identity.
uint32_t id
Unique identifier for this request (for key collisions).
struct GNUNET_MessageHeader header
Message.
uint16_t key_len
The length of the private key.
Stop credential iteration for the given operation.
uint32_t id
Unique identifier for this request (for key collisions).
Credential is returned from the idp.
uint16_t credential_len
Length of serialized attribute data.
uint32_t id
Unique identifier for this request (for key collisions).
uint16_t key_len
The length of the public key.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
uint32_t record_type
Type of the GNS/DNS record.
const void * data
Binary value stored in the DNS record.
size_t data_size
Number of bytes in data.
enum GNUNET_GNSRECORD_Flags flags
Flags for the record.
uint64_t expiration_time
Expiration time for the DNS record.
Handle to a message queue.
Connection to the NAMESTORE service.
An QueueEntry used to store information for a pending NAMESTORE record operation.
Handle for a zone iterator operation.
struct GNUNET_RECLAIM_Attribute * attribute
The attribute claim.
struct GNUNET_RECLAIM_AttributeListEntry * next
DLL.
A list of GNUNET_RECLAIM_Attribute structures.
struct GNUNET_RECLAIM_AttributeListEntry * list_tail
List tail.
struct GNUNET_RECLAIM_AttributeListEntry * list_head
List head.
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)
struct GNUNET_RECLAIM_Identifier id
ID.
struct GNUNET_RECLAIM_CredentialListEntry * next
DLL.
struct GNUNET_RECLAIM_Credential * credential
The credential.
A list of GNUNET_RECLAIM_Credential structures.
struct GNUNET_RECLAIM_CredentialListEntry * list_head
List head.
struct GNUNET_RECLAIM_CredentialListEntry * list_tail
List tail.
const char * name
The name of the credential.
struct GNUNET_RECLAIM_Identifier id
ID.
struct GNUNET_CLIENT_Connection * client
Socket (if available).
struct GNUNET_MQ_Handle * mq
Connection to service (if available).
A list of GNUNET_RECLAIM_Presentation structures.
A credential presentation.
struct GNUNET_RECLAIM_Identifier credential_id
The credential id of which this is a presentation.
The authorization ticket.
char gns_name[63 *2+2]
The ticket.
Entry in list of pending tasks.
Handle to a client that is connected to a service.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
struct GNUNET_TRANSPORT_AddressIdentifier * next
Kept in a DLL.
struct IdpClient * next
DLL.
struct TicketIteration * ticket_iter_tail
Tail of DLL of ticket iteration ops.
struct GNUNET_SERVICE_Client * client
The client.
struct Iterator * attr_iter_tail
Tail of the DLL of Attribute iteration operations in progress initiated by this client.
struct IdpClient * prev
DLL.
struct TicketRevocationOperation * revoke_op_head
Head of DLL of ticket revocation ops.
struct AttributeStoreHandle * store_op_head
Head of DLL of attribute store ops.
struct TicketIssueOperation * issue_op_tail
Tail of DLL of ticket issue ops.
struct Iterator * cred_iter_tail
Tail of the DLL of Credential iteration operations in progress initiated by this client.
struct AttributeDeleteHandle * delete_op_tail
Tail of DLL of attribute delete ops.
struct TicketRevocationOperation * revoke_op_tail
Tail of DLL of ticket revocation ops.
struct TicketIssueOperation * issue_op_head
Head of DLL of ticket issue ops.
struct AttributeDeleteHandle * delete_op_head
Head of DLL of attribute delete ops.
struct Iterator * cred_iter_head
Head of the DLL of Credential iteration operations in progress initiated by this client.
struct GNUNET_MQ_Handle * mq
Message queue for transmission to client.
struct AttributeStoreHandle * store_op_tail
Tail of DLL of attribute store ops.
struct ConsumeTicketOperation * consume_op_head
Head of DLL of ticket consume ops.
struct ConsumeTicketOperation * consume_op_tail
Tail of DLL of ticket consume ops.
struct TicketIteration * ticket_iter_head
Head of DLL of ticket iteration ops.
struct Iterator * attr_iter_head
Head of the DLL of Attribute iteration operations in progress initiated by this client.
uint32_t id
Unique identifier for this request (for key collisions).
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET.
uint16_t rp_uri_len
The length of the relying party URI.
uint16_t key_len
The length of the identity private key.
uint16_t attr_len
length of serialized attribute list
An attribute iteration operation.
struct Iterator * prev
Previous element in the DLL.
struct GNUNET_NAMESTORE_ZoneIterator * ns_it
Namestore iterator.
struct IdpClient * client
IDP client which initiated this zone iteration.
struct GNUNET_CRYPTO_PrivateKey identity
Key of the zone we are iterating over.
struct Iterator * next
Next element in the DLL.
uint32_t request_id
The operation id for the zone iteration in the response for the client.
Handle to a consume operation.
Ticket revocation request handle.
uint16_t key_len
The length of the private key.
uint32_t id
Unique identifier for this request (for key collisions).
uint16_t tkt_len
The length of the ticket.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET.
uint32_t id
Unique identifier for this request (for key collisions).
uint32_t success
Revocation result.
Attribute store/delete response message.
uint32_t id
Unique identifier for this request (for key collisions).
int32_t op_result
GNUNET_SYSERR on failure, GNUNET_OK on success
Ticket issue operation handle.
struct TicketIssueOperation * next
DLL.
struct IdpClient * client
Client connection.
struct TicketIssueOperation * prev
DLL.
Ask for next result of ticket iteration for the given operation.
uint32_t id
Unique identifier for this request (for key collisions).
Start a ticket iteration for the given identity.
uint16_t key_len
The length of the private key.
uint32_t id
Unique identifier for this request (for key collisions).
struct GNUNET_MessageHeader header
Message.
Stop ticket iteration for the given operation.
uint32_t id
Unique identifier for this request (for key collisions).
A ticket iteration operation.
struct TicketIteration * next
DLL.
struct IdpClient * client
Client which initiated this zone iteration.
uint32_t r_id
The operation id for the iteration in the response for the client.
struct RECLAIM_TICKETS_Iterator * iter
The ticket iterator.
struct TicketIteration * prev
DLL.
size_t data_size
Data size.
unsigned int rd_count
Record count.
uint32_t id
Unique identifier for this request (for key collisions).
uint16_t presentations_len
Length of new presentations created.
uint16_t tkt_len
Ticket length.
uint16_t rp_uri_len
RP URI length.
Ticket revocation request handle.
struct TicketRevocationOperation * next
DLL.
struct RECLAIM_TICKETS_RevokeHandle * rh
Revocation handle.
struct TicketRevocationOperation * prev
DLL.
struct IdpClient * client
Client connection.