GNUnet 0.22.2
Collaboration diagram for Reclaim service:

Data Structures

struct  GNUNET_RECLAIM_Ticket
 The authorization ticket. More...
 

Macros

#define GNUNET_RECLAIM_VERSION   0x00000002
 Version number of the re:claimID API. More...
 
#define GNUNET_RECLAIM_TICKET_RP_URI_MAX_LEN   256
 
#define GNUNET_RECLAIM_TICKET_RP_URI_URN_PREFIX   "urn:gns:"
 

Typedefs

typedef void(* GNUNET_RECLAIM_TicketCallback) (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri)
 Method called when a token has been issued. More...
 
typedef void(* GNUNET_RECLAIM_IssueTicketCallback) (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_PresentationList *presentations)
 Method called when a token has been issued. More...
 
typedef void(* GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, int32_t success, const char *emsg)
 Continuation called to notify client about result of the operation. More...
 
typedef void(* GNUNET_RECLAIM_AttributeResult) (void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr)
 Callback used to notify the client of attribute results. More...
 
typedef void(* GNUNET_RECLAIM_AttributeTicketResult) (void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Presentation *presentation)
 Callback used to notify the client of attribute results. More...
 
typedef void(* GNUNET_RECLAIM_CredentialResult) (void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Credential *credential)
 Callback used to notify the client of credential results. More...
 

Functions

struct GNUNET_RECLAIM_HandleGNUNET_RECLAIM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
 Connect to the re:claimID service. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attribute_store (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Store an attribute. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_credential_store (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const struct GNUNET_RECLAIM_Credential *credential, const struct GNUNET_TIME_Relative *exp_interval, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Store a credential. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_attribute_delete (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const struct GNUNET_RECLAIM_Attribute *attr, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Delete an attribute. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_credential_delete (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *pkey, const struct GNUNET_RECLAIM_Credential *cred, GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls)
 Delete a credential. More...
 
struct GNUNET_RECLAIM_AttributeIteratorGNUNET_RECLAIM_get_attributes_start (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_AttributeResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
 List all attributes for a local identity. More...
 
void GNUNET_RECLAIM_get_attributes_next (struct GNUNET_RECLAIM_AttributeIterator *it)
 Calls the record processor specified in GNUNET_RECLAIM_get_attributes_start for the next record. More...
 
void GNUNET_RECLAIM_get_attributes_stop (struct GNUNET_RECLAIM_AttributeIterator *it)
 Stops iteration and releases the handle for further calls. More...
 
struct GNUNET_RECLAIM_CredentialIteratorGNUNET_RECLAIM_get_credentials_start (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_CredentialResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
 List all credentials for a local identity. More...
 
void GNUNET_RECLAIM_get_credentials_next (struct GNUNET_RECLAIM_CredentialIterator *ait)
 Calls the record processor specified in GNUNET_RECLAIM_get_credentials_start for the next record. More...
 
void GNUNET_RECLAIM_get_credentials_stop (struct GNUNET_RECLAIM_CredentialIterator *ait)
 Stops iteration and releases the handle for further calls. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_ticket_issue (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *iss, const char *rp_uri, const struct GNUNET_RECLAIM_AttributeList *attrs, GNUNET_RECLAIM_IssueTicketCallback cb, void *cb_cls)
 Issues a ticket to a relying party. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_ticket_revoke (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_ContinuationWithStatus cb, void *cb_cls)
 Revoked an issued ticket. More...
 
struct GNUNET_RECLAIM_OperationGNUNET_RECLAIM_ticket_consume (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri, GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls)
 Consumes an issued ticket. More...
 
struct GNUNET_RECLAIM_TicketIteratorGNUNET_RECLAIM_ticket_iteration_start (struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_TicketCallback proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
 Lists all tickets that have been issued to remote identities (relying parties) More...
 
void GNUNET_RECLAIM_ticket_iteration_next (struct GNUNET_RECLAIM_TicketIterator *it)
 Calls the ticket processor specified in GNUNET_RECLAIM_ticket_iteration_start for the next record. More...
 
void GNUNET_RECLAIM_ticket_iteration_stop (struct GNUNET_RECLAIM_TicketIterator *it)
 Stops iteration and releases the handle for further calls. More...
 
void GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h)
 Disconnect from identity provider service. More...
 
void GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op)
 Cancel an identity provider operation. More...
 

Detailed Description

Macro Definition Documentation

◆ GNUNET_RECLAIM_VERSION

#define GNUNET_RECLAIM_VERSION   0x00000002

Version number of the re:claimID API.

Definition at line 52 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_TICKET_RP_URI_MAX_LEN

#define GNUNET_RECLAIM_TICKET_RP_URI_MAX_LEN   256

Definition at line 65 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_TICKET_RP_URI_URN_PREFIX

#define GNUNET_RECLAIM_TICKET_RP_URI_URN_PREFIX   "urn:gns:"

Definition at line 67 of file gnunet_reclaim_service.h.

Typedef Documentation

◆ GNUNET_RECLAIM_TicketCallback

typedef void(* GNUNET_RECLAIM_TicketCallback) (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const char *rp_uri)

Method called when a token has been issued.

On success returns a ticket that can be given to a relying party in order for it retrieve identity attributes

Parameters
clsclosure
ticketthe ticket
rp_urithe RP URI of the ticket

Definition at line 114 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_IssueTicketCallback

typedef void(* GNUNET_RECLAIM_IssueTicketCallback) (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_PresentationList *presentations)

Method called when a token has been issued.

On success returns a ticket that can be given to a relying party in order for it retrieve identity attributes

Parameters
clsclosure
ticketthe ticket

Definition at line 127 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_ContinuationWithStatus

typedef void(* GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, int32_t success, const char *emsg)

Continuation called to notify client about result of the operation.

Parameters
clsThe callback closure
successGNUNET_SYSERR on failure
emsgNULL on success, otherwise an error message

Definition at line 141 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_AttributeResult

typedef void(* GNUNET_RECLAIM_AttributeResult) (void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr)

Callback used to notify the client of attribute results.

Parameters
clsThe callback closure
identityThe identity authoritative over the attributes
attrThe attribute

Definition at line 152 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_AttributeTicketResult

typedef void(* GNUNET_RECLAIM_AttributeTicketResult) (void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Presentation *presentation)

Callback used to notify the client of attribute results.

Parameters
clsThe callback closure
identityThe identity authoritative over the attributes
attrThe attribute
presentationThe presentation for the credential (may be NULL)

Definition at line 164 of file gnunet_reclaim_service.h.

◆ GNUNET_RECLAIM_CredentialResult

typedef void(* GNUNET_RECLAIM_CredentialResult) (void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Credential *credential)

Callback used to notify the client of credential results.

Parameters
clsThe callback closure
identityThe identity authoritative over the attributes
credentialThe credential
attributesthe parsed attributes

Definition at line 178 of file gnunet_reclaim_service.h.

Function Documentation

◆ GNUNET_RECLAIM_connect()

struct GNUNET_RECLAIM_Handle * GNUNET_RECLAIM_connect ( const struct GNUNET_CONFIGURATION_Handle cfg)

Connect to the re:claimID service.

Parameters
cfgConfiguration to contact the re:claimID service.
Returns
handle to communicate with the service

Connect to the re:claimID service.

Parameters
cfgthe configuration to use
Returns
handle to use

Definition at line 1118 of file reclaim_api.c.

1119{
1120 struct GNUNET_RECLAIM_Handle *h;
1121
1123 h->cfg = cfg;
1124 reconnect (h);
1125 if (NULL == h->mq)
1126 {
1127 GNUNET_free (h);
1128 return NULL;
1129 }
1130 return h;
1131}
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:98
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:108
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
static void reconnect(struct GNUNET_RECLAIM_Handle *h)
Try again to connect to the service.
Definition: reclaim_api.c:1069
struct GNUNET_MQ_Handle * mq
Our connection to the ARM service.
Definition: arm_api.c:107
const struct GNUNET_CONFIGURATION_Handle * cfg
The configuration that we are using.
Definition: arm_api.c:112
Handle to the service.
Definition: reclaim_api.c:316

References cfg, GNUNET_ARM_Handle::cfg, GNUNET_free, GNUNET_new, h, GNUNET_ARM_Handle::mq, and reconnect().

Referenced by REST_openid_init(), REST_reclaim_init(), and run().

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

◆ GNUNET_RECLAIM_attribute_store()

struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attribute_store ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_PrivateKey pkey,
const struct GNUNET_RECLAIM_Attribute attr,
const struct GNUNET_TIME_Relative exp_interval,
GNUNET_RECLAIM_ContinuationWithStatus  cont,
void *  cont_cls 
)

Store an attribute.

If the attribute is already present, it is replaced with the new attribute.

Parameters
hhandle to the reclaim service
pkeyPrivate key of the identity to add an attribute to
attrThe attribute
exp_intervalThe relative expiration interval for the attribute
contContinuation to call when done
cont_clsClosure for cont
Returns
handle Used to to abort the request

Definition at line 1169 of file reclaim_api.c.

1176{
1178 struct AttributeStoreMessage *sam;
1179 size_t attr_len;
1180 size_t key_len;
1181 ssize_t written;
1182 char *buf;
1183
1185 op->h = h;
1186 op->as_cb = cont;
1187 op->cls = cont_cls;
1188 op->r_id = h->r_id_gen++;
1189 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1192 op->env = GNUNET_MQ_msg_extra (sam,
1193 attr_len + key_len,
1195 sam->key_len = htons (key_len);
1196 buf = (char *) &sam[1];
1198 GNUNET_assert (0 < written);
1199 buf += written;
1200 sam->id = htonl (op->r_id);
1202
1204
1205 sam->attr_len = htons (attr_len);
1206 if (NULL != h->mq)
1207 GNUNET_MQ_send_copy (h->mq, op->env);
1208 return op;
1209}
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:143
static char * pkey
Public key of the zone to look in, in ASCII.
static struct GNUNET_TIME_Relative exp_interval
Attribute expiration interval.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
ssize_t GNUNET_CRYPTO_private_key_get_length(const struct GNUNET_CRYPTO_PrivateKey *key)
Get the compacted length of a GNUNET_CRYPTO_PrivateKey.
Definition: crypto_pkey.c:64
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
Definition: common_endian.c:37
ssize_t GNUNET_CRYPTO_write_private_key_to_buffer(const struct GNUNET_CRYPTO_PrivateKey *key, void *buffer, size_t len)
Writes a GNUNET_CRYPTO_PrivateKey to a compact buffer.
Definition: crypto_pkey.c:172
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, const struct GNUNET_MQ_Envelope *ev)
Send a copy of a message with the given message queue.
Definition: mq.c:384
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
Definition: gnunet_mq_lib.h:61
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE
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_serialize(const struct GNUNET_RECLAIM_Attribute *attr, char *result)
Serialize an attribute.
Use to store an identity attribute.
Definition: reclaim.h:41
uint64_t exp
The expiration interval of the attribute.
Definition: reclaim.h:50
uint16_t key_len
The length of the private key.
Definition: reclaim.h:65
uint16_t attr_len
The length of the attribute.
Definition: reclaim.h:60
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:55
struct GNUNET_ARM_Handle * h
ARM handle.
Definition: arm_api.c:55
Handle for an operation with the service.
Definition: reclaim_api.c:40
uint64_t rel_value_us
The actual value.

References AttributeStoreMessage::attr_len, AttributeStoreMessage::exp, exp_interval, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_htonll(), GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_STORE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_attribute_serialize(), GNUNET_RECLAIM_attribute_serialize_get_size(), h, GNUNET_ARM_Operation::h, AttributeStoreMessage::id, AttributeStoreMessage::key_len, GNUNET_ARM_Handle::mq, op, pkey, and GNUNET_TIME_Relative::rel_value_us.

Referenced by add_attribute_cont(), and iter_finished().

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

◆ GNUNET_RECLAIM_credential_store()

struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_credential_store ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_PrivateKey pkey,
const struct GNUNET_RECLAIM_Credential credential,
const struct GNUNET_TIME_Relative exp_interval,
GNUNET_RECLAIM_ContinuationWithStatus  cont,
void *  cont_cls 
)

Store a credential.

If the credential is already present, it is replaced with the new credential.

Parameters
hhandle to the re:claimID service
pkeyprivate key of the identity
credentialthe credential value
exp_intervalthe relative expiration interval for the credential
contcontinuation to call when done
cont_clsclosure for cont
Returns
handle to abort the request

Definition at line 1254 of file reclaim_api.c.

1261{
1263 struct AttributeStoreMessage *sam;
1264 size_t attr_len;
1265 size_t key_len;
1266 ssize_t written;
1267 char *buf;
1268
1270 op->h = h;
1271 op->as_cb = cont;
1272 op->cls = cont_cls;
1273 op->r_id = h->r_id_gen++;
1275 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1277 op->env = GNUNET_MQ_msg_extra (sam,
1278 attr_len + key_len,
1280 sam->key_len = htons (key_len);
1281 buf = (char *) &sam[1];
1283 GNUNET_assert (0 <= written);
1284 buf += written;
1285 sam->id = htonl (op->r_id);
1287
1289
1290 sam->attr_len = htons (attr_len);
1291 if (NULL != h->mq)
1292 GNUNET_MQ_send_copy (h->mq, op->env);
1293 return op;
1294}
static struct GNUNET_RECLAIM_Identifier credential
Credential ID.
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE
size_t GNUNET_RECLAIM_credential_serialize(const struct GNUNET_RECLAIM_Credential *credential, char *result)
Serialize an credential.
size_t GNUNET_RECLAIM_credential_serialize_get_size(const struct GNUNET_RECLAIM_Credential *credential)
Get required size for serialization buffer.

References AttributeStoreMessage::attr_len, credential, AttributeStoreMessage::exp, exp_interval, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_htonll(), GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_credential_serialize(), GNUNET_RECLAIM_credential_serialize_get_size(), h, GNUNET_ARM_Operation::h, AttributeStoreMessage::id, AttributeStoreMessage::key_len, GNUNET_ARM_Handle::mq, op, pkey, and GNUNET_TIME_Relative::rel_value_us.

Referenced by add_credential_cont(), and cred_iter_finished().

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

◆ GNUNET_RECLAIM_attribute_delete()

struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_attribute_delete ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_PrivateKey pkey,
const struct GNUNET_RECLAIM_Attribute attr,
GNUNET_RECLAIM_ContinuationWithStatus  cont,
void *  cont_cls 
)

Delete an attribute.

Tickets used to share this attribute are updated accordingly.

Parameters
hhandle to the re:claimID service
pkeyPrivate key of the identity to add an attribute to
attrThe attribute
contContinuation to call when done
cont_clsClosure for cont
Returns
handle Used to to abort the request

Definition at line 1213 of file reclaim_api.c.

1219{
1221 struct AttributeDeleteMessage *dam;
1222 size_t attr_len;
1223 size_t key_len;
1224 ssize_t written;
1225 char *buf;
1226
1228 op->h = h;
1229 op->as_cb = cont;
1230 op->cls = cont_cls;
1231 op->r_id = h->r_id_gen++;
1232 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1235 op->env = GNUNET_MQ_msg_extra (dam,
1236 attr_len + key_len,
1238 dam->key_len = htons (key_len);
1239 buf = (char *) &dam[1];
1241 GNUNET_assert (0 < written);
1242 buf += written;
1243 dam->id = htonl (op->r_id);
1245
1246 dam->attr_len = htons (attr_len);
1247 if (NULL != h->mq)
1248 GNUNET_MQ_send_copy (h->mq, op->env);
1249 return op;
1250}
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE
Use to delete an identity attribute.
Definition: reclaim.h:77
uint16_t key_len
The length of the private key.
Definition: reclaim.h:96
uint16_t attr_len
The length of the attribute.
Definition: reclaim.h:91
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:86

References AttributeDeleteMessage::attr_len, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_DELETE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_attribute_serialize(), GNUNET_RECLAIM_attribute_serialize_get_size(), h, GNUNET_ARM_Operation::h, AttributeDeleteMessage::id, AttributeDeleteMessage::key_len, GNUNET_ARM_Handle::mq, op, and pkey.

Referenced by delete_attribute_cont(), and iter_finished().

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

◆ GNUNET_RECLAIM_credential_delete()

struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_credential_delete ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_PrivateKey pkey,
const struct GNUNET_RECLAIM_Credential cred,
GNUNET_RECLAIM_ContinuationWithStatus  cont,
void *  cont_cls 
)

Delete a credential.

Tickets used to share a presentation of this credential are updated accordingly.

Parameters
hhandle to the re:claimID service
pkeyPrivate key of the identity to add an attribute to
credThe credential
contContinuation to call when done
cont_clsClosure for cont
Returns
handle Used to to abort the request

Definition at line 1298 of file reclaim_api.c.

1304{
1306 struct AttributeDeleteMessage *dam;
1307 size_t attr_len;
1308 size_t key_len;
1309 ssize_t written;
1310 char *buf;
1311
1313 op->h = h;
1314 op->as_cb = cont;
1315 op->cls = cont_cls;
1316 op->r_id = h->r_id_gen++;
1318 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1320 op->env = GNUNET_MQ_msg_extra (dam,
1321 attr_len + key_len,
1323 dam->key_len = htons (key_len);
1324 buf = (char *) &dam[1];
1326 GNUNET_assert (0 <= written);
1327 buf += written;
1328 dam->id = htonl (op->r_id);
1330
1331 dam->attr_len = htons (attr_len);
1332 if (NULL != h->mq)
1333 GNUNET_MQ_send_copy (h->mq, op->env);
1334 return op;
1335}
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE

References AttributeDeleteMessage::attr_len, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_credential_serialize(), GNUNET_RECLAIM_credential_serialize_get_size(), h, GNUNET_ARM_Operation::h, AttributeDeleteMessage::id, AttributeDeleteMessage::key_len, GNUNET_ARM_Handle::mq, op, and pkey.

Referenced by delete_credential_cont().

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

◆ GNUNET_RECLAIM_get_attributes_start()

struct GNUNET_RECLAIM_AttributeIterator * GNUNET_RECLAIM_get_attributes_start ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_PrivateKey identity,
GNUNET_SCHEDULER_TaskCallback  error_cb,
void *  error_cb_cls,
GNUNET_RECLAIM_AttributeResult  proc,
void *  proc_cls,
GNUNET_SCHEDULER_TaskCallback  finish_cb,
void *  finish_cb_cls 
)

List all attributes for a local identity.

This MUST lock the struct GNUNET_RECLAIM_Handle for any other calls than GNUNET_RECLAIM_get_attributes_next() and GNUNET_RECLAIM_get_attributes_stop. proc will be called once immediately, and then again after GNUNET_RECLAIM_get_attributes_next() is invoked.

On error (disconnect), error_cb will be invoked. On normal completion, finish_cb proc will be invoked.

Parameters
hHandle to the re:claimID service
identityIdentity to iterate over
error_cbFunction to call on error (i.e. disconnect), the handle is afterwards invalid
error_cb_clsClosure for error_cb
procFunction to call on each attribute
proc_clsClosure for proc
finish_cbFunction to call on completion the handle is afterwards invalid
finish_cb_clsClosure for finish_cb
Returns
an iterator Handle to use for iteration

Definition at line 1339 of file reclaim_api.c.

1348{
1350 struct GNUNET_MQ_Envelope *env;
1352 uint32_t rid;
1353 size_t key_len;
1354
1355 rid = h->r_id_gen++;
1357 it->h = h;
1358 it->error_cb = error_cb;
1359 it->error_cb_cls = error_cb_cls;
1360 it->finish_cb = finish_cb;
1361 it->finish_cb_cls = finish_cb_cls;
1362 it->proc = proc;
1363 it->proc_cls = proc_cls;
1364 it->r_id = rid;
1365 it->identity = *identity;
1367 GNUNET_CONTAINER_DLL_insert_tail (h->it_head, h->it_tail, it);
1368 env =
1370 key_len,
1372 msg->id = htonl (rid);
1373 msg->key_len = htons (key_len);
1375 if (NULL == h->mq)
1376 it->env = env;
1377 else
1378 GNUNET_MQ_send (h->mq, env);
1379 return it;
1380}
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
static void error_cb(void *cls)
Function called if lookup fails.
Definition: gnunet-abd.c:480
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:305
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START
Start a attribute iteration for the given identity.
Definition: reclaim.h:202
uint16_t key_len
The length of the private key.
Definition: reclaim.h:221
Handle for a attribute iterator operation.
Definition: reclaim_api.c:181
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:195
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:225
GNUNET_RECLAIM_AttributeResult proc
The continuation to call with the results.
Definition: reclaim_api.c:210
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:231
struct GNUNET_CRYPTO_PrivateKey identity
Private key of the zone.
Definition: reclaim_api.c:236
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:215
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:220
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:200
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:241
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:205

References env, GNUNET_RECLAIM_AttributeIterator::env, error_cb(), GNUNET_RECLAIM_AttributeIterator::error_cb, GNUNET_RECLAIM_AttributeIterator::error_cb_cls, GNUNET_RECLAIM_AttributeIterator::finish_cb, GNUNET_RECLAIM_AttributeIterator::finish_cb_cls, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_START, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, h, GNUNET_RECLAIM_AttributeIterator::h, identity, GNUNET_RECLAIM_AttributeIterator::identity, AttributeIterationStartMessage::key_len, GNUNET_ARM_Handle::mq, msg, GNUNET_RECLAIM_AttributeIterator::proc, GNUNET_RECLAIM_AttributeIterator::proc_cls, and GNUNET_RECLAIM_AttributeIterator::r_id.

Referenced by code_redirect(), cred_iter_finished(), and list_attribute_cont().

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

◆ GNUNET_RECLAIM_get_attributes_next()

void GNUNET_RECLAIM_get_attributes_next ( struct GNUNET_RECLAIM_AttributeIterator it)

Calls the record processor specified in GNUNET_RECLAIM_get_attributes_start for the next record.

Parameters
itThe iterator

Definition at line 1384 of file reclaim_api.c.

1385{
1386 struct GNUNET_RECLAIM_Handle *h = it->h;
1388 struct GNUNET_MQ_Envelope *env;
1389
1390 env =
1392 msg->id = htonl (it->r_id);
1393 GNUNET_MQ_send (h->mq, env);
1394}
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:76
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT
Ask for next result of attribute iteration for the given operation.
Definition: reclaim.h:233

References env, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_AttributeIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_AttributeIterator::r_id.

Referenced by attr_collect(), iter_cb(), and oidc_attr_collect().

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

◆ GNUNET_RECLAIM_get_attributes_stop()

void GNUNET_RECLAIM_get_attributes_stop ( struct GNUNET_RECLAIM_AttributeIterator it)

Stops iteration and releases the handle for further calls.

Must be called on any iteration that has not yet completed prior to calling GNUNET_RECLAIM_disconnect.

Parameters
itthe iterator

Definition at line 1398 of file reclaim_api.c.

1399{
1400 struct GNUNET_RECLAIM_Handle *h = it->h;
1401 struct GNUNET_MQ_Envelope *env;
1403
1404 if (NULL != h->mq)
1405 {
1406 env =
1408 msg->id = htonl (it->r_id);
1409 GNUNET_MQ_send (h->mq, env);
1410 }
1411 free_it (it);
1412}
#define GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP
static void free_it(struct GNUNET_RECLAIM_AttributeIterator *it)
Free it.
Definition: reclaim_api.c:453
Stop attribute iteration for the given operation.
Definition: reclaim.h:315

References env, free_it(), GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_AttributeIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_AttributeIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

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

◆ GNUNET_RECLAIM_get_credentials_start()

struct GNUNET_RECLAIM_CredentialIterator * GNUNET_RECLAIM_get_credentials_start ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_PrivateKey identity,
GNUNET_SCHEDULER_TaskCallback  error_cb,
void *  error_cb_cls,
GNUNET_RECLAIM_CredentialResult  proc,
void *  proc_cls,
GNUNET_SCHEDULER_TaskCallback  finish_cb,
void *  finish_cb_cls 
)

List all credentials for a local identity.

This MUST lock the struct GNUNET_RECLAIM_Handle for any other calls than GNUNET_RECLAIM_get_credentials_next() and GNUNET_RECLAIM_get_credentials_stop. proc will be called once immediately, and then again after GNUNET_RECLAIM_get_credentials_next() is invoked.

On error (disconnect), error_cb will be invoked. On normal completion, finish_cb proc will be invoked.

Parameters
hHandle to the re:claimID service
identityIdentity to iterate over
error_cbFunction to call on error (i.e. disconnect), the handle is afterwards invalid
error_cb_clsClosure for error_cb
procFunction to call on each credential
proc_clsClosure for proc
finish_cbFunction to call on completion the handle is afterwards invalid
finish_cb_clsClosure for finish_cb
Returns
an iterator Handle to use for iteration

Definition at line 1416 of file reclaim_api.c.

1425{
1427 struct GNUNET_MQ_Envelope *env;
1429 uint32_t rid;
1430 size_t key_len;
1431
1432 rid = h->r_id_gen++;
1434 ait->h = h;
1435 ait->error_cb = error_cb;
1436 ait->error_cb_cls = error_cb_cls;
1437 ait->finish_cb = finish_cb;
1438 ait->finish_cb_cls = finish_cb_cls;
1439 ait->proc = proc;
1440 ait->proc_cls = proc_cls;
1441 ait->r_id = rid;
1442 ait->identity = *identity;
1444 GNUNET_CONTAINER_DLL_insert_tail (h->ait_head, h->ait_tail, ait);
1445 env =
1447 key_len,
1449 ;
1450 msg->id = htonl (rid);
1451 msg->key_len = htons (key_len);
1453 if (NULL == h->mq)
1454 ait->env = env;
1455 else
1456 GNUNET_MQ_send (h->mq, env);
1457 return ait;
1458}
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START
Start a credential iteration for the given identity.
Definition: reclaim.h:250
uint16_t key_len
The length of the private key.
Definition: reclaim.h:269
Handle for a credential iterator operation.
Definition: reclaim_api.c:248
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:287
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:267
void * proc_cls
Closure for proc.
Definition: reclaim_api.c:282
GNUNET_RECLAIM_CredentialResult proc
The continuation to call with the results.
Definition: reclaim_api.c:277
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:272
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:308
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:298
struct GNUNET_CRYPTO_PrivateKey identity
Private key of the zone.
Definition: reclaim_api.c:303
struct GNUNET_RECLAIM_Handle * h
Main handle to access the service.
Definition: reclaim_api.c:262
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:292

References env, GNUNET_RECLAIM_CredentialIterator::env, error_cb(), GNUNET_RECLAIM_CredentialIterator::error_cb, GNUNET_RECLAIM_CredentialIterator::error_cb_cls, GNUNET_RECLAIM_CredentialIterator::finish_cb, GNUNET_RECLAIM_CredentialIterator::finish_cb_cls, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, h, GNUNET_RECLAIM_CredentialIterator::h, identity, GNUNET_RECLAIM_CredentialIterator::identity, CredentialIterationStartMessage::key_len, GNUNET_ARM_Handle::mq, msg, GNUNET_RECLAIM_CredentialIterator::proc, GNUNET_RECLAIM_CredentialIterator::proc_cls, and GNUNET_RECLAIM_CredentialIterator::r_id.

Referenced by list_credential_cont(), oidc_attr_collect_finished_cb(), and start_process().

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

◆ GNUNET_RECLAIM_get_credentials_next()

void GNUNET_RECLAIM_get_credentials_next ( struct GNUNET_RECLAIM_CredentialIterator ait)

Calls the record processor specified in GNUNET_RECLAIM_get_credentials_start for the next record.

Parameters
aitthe iterator

Definition at line 1462 of file reclaim_api.c.

1464{
1465 struct GNUNET_RECLAIM_Handle *h = ait->h;
1467 struct GNUNET_MQ_Envelope *env;
1468
1469 env =
1471 msg->id = htonl (ait->r_id);
1472 GNUNET_MQ_send (h->mq, env);
1473}
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT
Ask for next result of credential iteration for the given operation.
Definition: reclaim.h:281

References env, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_CredentialIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_CredentialIterator::r_id.

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

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

◆ GNUNET_RECLAIM_get_credentials_stop()

void GNUNET_RECLAIM_get_credentials_stop ( struct GNUNET_RECLAIM_CredentialIterator ait)

Stops iteration and releases the handle for further calls.

Must be called on any iteration that has not yet completed prior to calling GNUNET_RECLAIM_disconnect.

Parameters
aitthe iterator

Definition at line 1477 of file reclaim_api.c.

1479{
1480 struct GNUNET_RECLAIM_Handle *h = ait->h;
1481 struct GNUNET_MQ_Envelope *env;
1483
1484 if (NULL != h->mq)
1485 {
1486 env =
1489 msg->id = htonl (ait->r_id);
1490 GNUNET_MQ_send (h->mq, env);
1491 }
1492 free_ait (ait);
1493}
#define GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP
static void free_ait(struct GNUNET_RECLAIM_CredentialIterator *ait)
Free it.
Definition: reclaim_api.c:470
Stop credential iteration for the given operation.
Definition: reclaim.h:298

References env, free_ait(), GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_CredentialIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_CredentialIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

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

◆ GNUNET_RECLAIM_ticket_issue()

struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_issue ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_PrivateKey iss,
const char *  rp_uri,
const struct GNUNET_RECLAIM_AttributeList attrs,
GNUNET_RECLAIM_IssueTicketCallback  cb,
void *  cb_cls 
)

Issues a ticket to a relying party.

The identity may use GNUNET_RECLAIM_ticket_consume to consume the ticket and retrieve the attributes specified in the attribute list.

Parameters
hthe identity provider to use
issthe issuing identity (= the user)
rp_urithe subject of the ticket (= the relying party) see GNUNET_RECLAIM_Ticket
attrsthe attributes that the relying party is given access to
cbthe callback
cb_clsthe callback closure
Returns
handle to abort the operation

Definition at line 1497 of file reclaim_api.c.

1504{
1506 struct IssueTicketMessage *tim;
1507 size_t attr_len;
1508 size_t key_len;
1509 size_t rpk_len;
1510 ssize_t written;
1511 char *buf;
1512
1514 op->h = h;
1515 op->ti_cb = cb;
1516 op->cls = cb_cls;
1517 op->r_id = h->r_id_gen++;
1519 rpk_len = strlen (rp) + 1;
1520 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1522 op->env = GNUNET_MQ_msg_extra (tim,
1523 attr_len + key_len + rpk_len,
1525 tim->key_len = htons (key_len);
1526 tim->rp_uri_len = htons (rpk_len);
1527 buf = (char *) &tim[1];
1529 GNUNET_assert (0 <= written);
1530 buf += written;
1531 memcpy (buf, rp, rpk_len);
1532 written = rpk_len;
1533 GNUNET_assert (0 <= written);
1534 buf += written;
1535 tim->id = htonl (op->r_id);
1536
1538 tim->attr_len = htons (attr_len);
1539 if (NULL != h->mq)
1540 GNUNET_MQ_send_copy (h->mq, op->env);
1541 return op;
1542}
static char * rp
Relying party.
#define GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET
size_t GNUNET_RECLAIM_attribute_list_serialize(const struct GNUNET_RECLAIM_AttributeList *attrs, char *result)
Serialize an attribute list.
size_t GNUNET_RECLAIM_attribute_list_serialize_get_size(const struct GNUNET_RECLAIM_AttributeList *attrs)
Get required size for serialization buffer.
Ticket issue message.
Definition: reclaim.h:396
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:405
uint16_t rp_uri_len
The length of the relying party URI.
Definition: reclaim.h:425
uint16_t key_len
The length of the identity private key.
Definition: reclaim.h:420
uint16_t attr_len
length of serialized attribute list
Definition: reclaim.h:415

References IssueTicketMessage::attr_len, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_MESSAGE_TYPE_RECLAIM_ISSUE_TICKET, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, GNUNET_RECLAIM_attribute_list_serialize(), GNUNET_RECLAIM_attribute_list_serialize_get_size(), h, GNUNET_ARM_Operation::h, IssueTicketMessage::id, IssueTicketMessage::key_len, GNUNET_ARM_Handle::mq, op, rp, and IssueTicketMessage::rp_uri_len.

Referenced by iter_finished(), and oidc_cred_collect_finished_cb().

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

◆ GNUNET_RECLAIM_ticket_revoke()

struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_revoke ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_PrivateKey identity,
const struct GNUNET_RECLAIM_Ticket ticket,
GNUNET_RECLAIM_ContinuationWithStatus  cb,
void *  cb_cls 
)

Revoked an issued ticket.

The relying party will be unable to retrieve attributes. Other issued tickets remain unaffected. This includes tickets issued to other relying parties as well as to other tickets issued to the audience specified in this ticket.

Parameters
hthe identity provider to use
identitythe issuing identity
ticketthe ticket to revoke
cbthe callback
cb_clsthe callback closure
Returns
handle to abort the operation

Definition at line 1690 of file reclaim_api.c.

1696{
1698 struct RevokeTicketMessage *msg;
1699 uint32_t rid;
1700 size_t key_len;
1701 size_t tkt_len;
1702 ssize_t written;
1703 char *buf;
1704
1705 rid = h->r_id_gen++;
1707 op->h = h;
1708 op->rvk_cb = cb;
1709 op->cls = cb_cls;
1710 op->r_id = rid;
1711 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1713 tkt_len = strlen (ticket->gns_name) + 1;
1714 op->env = GNUNET_MQ_msg_extra (msg,
1715 key_len + tkt_len,
1717 msg->id = htonl (rid);
1718 msg->key_len = htons (key_len);
1719 msg->tkt_len = htons (tkt_len);
1720 buf = (char*) &msg[1];
1722 buf,
1723 key_len);
1724 GNUNET_assert (0 <= written);
1725 buf += written;
1726 memcpy (buf, ticket, tkt_len);
1727 if (NULL != h->mq)
1728 {
1729 GNUNET_MQ_send (h->mq, op->env);
1730 op->env = NULL;
1731 }
1732 return op;
1733}
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
#define GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET
char gns_name[63 *2+2]
The ticket.
Ticket revoke message.
Definition: reclaim.h:438
uint16_t key_len
The length of the private key.
Definition: reclaim.h:452
uint16_t tkt_len
The length of the ticket.
Definition: reclaim.h:457

References GNUNET_RECLAIM_Ticket::gns_name, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_MESSAGE_TYPE_RECLAIM_REVOKE_TICKET, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, h, GNUNET_ARM_Operation::h, identity, RevokeTicketMessage::key_len, GNUNET_ARM_Handle::mq, msg, op, ticket, and RevokeTicketMessage::tkt_len.

Referenced by iter_finished(), and revoke_ticket_cont().

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

◆ GNUNET_RECLAIM_ticket_consume()

struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_consume ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_RECLAIM_Ticket ticket,
const char *  rp_uri,
GNUNET_RECLAIM_AttributeTicketResult  cb,
void *  cb_cls 
)

Consumes an issued ticket.

The ticket is used to retrieve identity information from the issuer

Parameters
hthe identity provider to use
ticketthe issued ticket to consume
rp_urithe RP URI
cbthe callback to call
cb_clsthe callback closure
Returns
handle to abort the operation

Definition at line 1546 of file reclaim_api.c.

1552{
1554 struct ConsumeTicketMessage *ctm;
1555 size_t tkt_len;
1556 size_t rp_uri_len;
1557 char *buf;
1558
1560 op->h = h;
1561 op->atr_cb = cb;
1562 op->cls = cb_cls;
1563 op->r_id = h->r_id_gen++;
1564 tkt_len = strlen (ticket->gns_name) + 1;
1565 rp_uri_len = strlen (rp_uri) + 1;
1566 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1567 op->env = GNUNET_MQ_msg_extra (ctm,
1570 buf = (char*) &ctm[1];
1571 ctm->rp_uri_len = htons (rp_uri_len);
1572 ctm->tkt_len = htons (tkt_len);
1573 memcpy (buf, ticket, tkt_len);
1574 buf += tkt_len;
1575 memcpy (buf, rp_uri, rp_uri_len);
1576 ctm->id = htonl (op->r_id);
1577 if (NULL != h->mq)
1578 GNUNET_MQ_send_copy (h->mq, op->env);
1579 else
1580 reconnect (h);
1581 return op;
1582}
#define GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET
Ticket consume message.
Definition: reclaim.h:529
uint32_t id
Unique identifier for this request (for key collisions).
Definition: reclaim.h:538
uint16_t rp_uri_len
RP URI length.
Definition: reclaim.h:548
uint16_t tkt_len
The length of the ticket.
Definition: reclaim.h:543

References GNUNET_RECLAIM_Ticket::gns_name, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET, GNUNET_MQ_msg_extra, GNUNET_MQ_send_copy(), GNUNET_new, h, GNUNET_ARM_Operation::h, ConsumeTicketMessage::id, GNUNET_ARM_Handle::mq, op, reconnect(), ConsumeTicketMessage::rp_uri_len, ticket, and ConsumeTicketMessage::tkt_len.

Referenced by consume_ticket_cont(), iter_finished(), and userinfo_endpoint().

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

◆ GNUNET_RECLAIM_ticket_iteration_start()

struct GNUNET_RECLAIM_TicketIterator * GNUNET_RECLAIM_ticket_iteration_start ( struct GNUNET_RECLAIM_Handle h,
const struct GNUNET_CRYPTO_PrivateKey identity,
GNUNET_SCHEDULER_TaskCallback  error_cb,
void *  error_cb_cls,
GNUNET_RECLAIM_TicketCallback  proc,
void *  proc_cls,
GNUNET_SCHEDULER_TaskCallback  finish_cb,
void *  finish_cb_cls 
)

Lists all tickets that have been issued to remote identities (relying parties)

Parameters
hthe identity provider to use
identitythe issuing identity
error_cbfunction to call on error (i.e. disconnect), the handle is afterwards invalid
error_cb_clsclosure for error_cb
procfunction to call on each ticket; it will be called repeatedly with a value (if available)
proc_clsclosure for proc
finish_cbfunction to call on completion the handle is afterwards invalid
finish_cb_clsclosure for finish_cb
Returns
an iterator handle to use for iteration

Definition at line 1586 of file reclaim_api.c.

1595{
1597 struct GNUNET_MQ_Envelope *env;
1599 uint32_t rid;
1600 size_t key_len;
1601
1602 rid = h->r_id_gen++;
1604 it->h = h;
1605 it->error_cb = error_cb;
1606 it->error_cb_cls = error_cb_cls;
1607 it->finish_cb = finish_cb;
1608 it->finish_cb_cls = finish_cb_cls;
1609 it->tr_cb = proc;
1610 it->cls = proc_cls;
1611 it->r_id = rid;
1612
1614 GNUNET_CONTAINER_DLL_insert_tail (h->ticket_it_head, h->ticket_it_tail, it);
1616 key_len,
1618 ;
1619 msg->id = htonl (rid);
1620 msg->key_len = htons (key_len);
1622 &msg[1],
1623 key_len);
1624 if (NULL == h->mq)
1625 it->env = env;
1626 else
1627 GNUNET_MQ_send (h->mq, env);
1628 return it;
1629}
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START
Handle for a ticket iterator operation.
Definition: reclaim_api.c:118
GNUNET_RECLAIM_TicketCallback tr_cb
The continuation to call with the results.
Definition: reclaim_api.c:147
uint32_t r_id
The operation id this zone iteration operation has.
Definition: reclaim_api.c:173
void * error_cb_cls
Closure for error_cb.
Definition: reclaim_api.c:162
struct GNUNET_RECLAIM_Handle * h
Main handle to access the idp.
Definition: reclaim_api.c:132
GNUNET_SCHEDULER_TaskCallback finish_cb
Function to call on completion.
Definition: reclaim_api.c:137
void * finish_cb_cls
Closure for finish_cb.
Definition: reclaim_api.c:142
struct GNUNET_MQ_Envelope * env
Envelope of the message to send to the service, if not yet sent.
Definition: reclaim_api.c:168
void * cls
Closure for tr_cb.
Definition: reclaim_api.c:152
GNUNET_SCHEDULER_TaskCallback error_cb
Function to call on errors.
Definition: reclaim_api.c:157
Start a ticket iteration for the given identity.
Definition: reclaim.h:331
uint16_t key_len
The length of the private key.
Definition: reclaim.h:350

References GNUNET_RECLAIM_TicketIterator::cls, env, GNUNET_RECLAIM_TicketIterator::env, error_cb(), GNUNET_RECLAIM_TicketIterator::error_cb, GNUNET_RECLAIM_TicketIterator::error_cb_cls, GNUNET_RECLAIM_TicketIterator::finish_cb, GNUNET_RECLAIM_TicketIterator::finish_cb_cls, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CRYPTO_private_key_get_length(), GNUNET_CRYPTO_write_private_key_to_buffer(), GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_START, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, h, GNUNET_RECLAIM_TicketIterator::h, identity, TicketIterationStartMessage::key_len, GNUNET_ARM_Handle::mq, msg, GNUNET_RECLAIM_TicketIterator::r_id, and GNUNET_RECLAIM_TicketIterator::tr_cb.

Referenced by list_tickets_cont(), and start_process().

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

◆ GNUNET_RECLAIM_ticket_iteration_next()

void GNUNET_RECLAIM_ticket_iteration_next ( struct GNUNET_RECLAIM_TicketIterator it)

Calls the ticket processor specified in GNUNET_RECLAIM_ticket_iteration_start for the next record.

Parameters
itthe iterator

Definition at line 1639 of file reclaim_api.c.

1640{
1641 struct GNUNET_RECLAIM_Handle *h = it->h;
1643 struct GNUNET_MQ_Envelope *env;
1644
1646 msg->id = htonl (it->r_id);
1647 GNUNET_MQ_send (h->mq, env);
1648}
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT
Ask for next result of ticket iteration for the given operation.
Definition: reclaim.h:362

References env, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_NEXT, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_TicketIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_TicketIterator::r_id.

Referenced by ticket_collect(), and ticket_iter().

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

◆ GNUNET_RECLAIM_ticket_iteration_stop()

void GNUNET_RECLAIM_ticket_iteration_stop ( struct GNUNET_RECLAIM_TicketIterator it)

Stops iteration and releases the handle for further calls.

Must be called on any iteration that has not yet completed prior to calling GNUNET_RECLAIM_disconnect.

Parameters
itthe iterator

Definition at line 1659 of file reclaim_api.c.

1660{
1661 struct GNUNET_RECLAIM_Handle *h = it->h;
1662 struct GNUNET_MQ_Envelope *env;
1664
1665 if (NULL != h->mq)
1666 {
1667 env =
1669 msg->id = htonl (it->r_id);
1670 GNUNET_MQ_send (h->mq, env);
1671 }
1672 GNUNET_free (it);
1673}
#define GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP
Stop ticket iteration for the given operation.
Definition: reclaim.h:379

References env, GNUNET_free, GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_ITERATION_STOP, GNUNET_MQ_msg, GNUNET_MQ_send(), h, GNUNET_RECLAIM_TicketIterator::h, GNUNET_ARM_Handle::mq, msg, and GNUNET_RECLAIM_TicketIterator::r_id.

Referenced by cleanup_handle(), and do_cleanup().

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

◆ GNUNET_RECLAIM_disconnect()

void GNUNET_RECLAIM_disconnect ( struct GNUNET_RECLAIM_Handle h)

Disconnect from identity provider service.

Parameters
hidentity provider service to disconnect

Disconnect from identity provider service.

Parameters
hhandle to destroy

Definition at line 1150 of file reclaim_api.c.

1151{
1152 GNUNET_assert (NULL != h);
1153 if (NULL != h->mq)
1154 {
1156 h->mq = NULL;
1157 }
1158 if (NULL != h->reconnect_task)
1159 {
1161 h->reconnect_task = NULL;
1162 }
1163 GNUNET_assert (NULL == h->op_head);
1164 GNUNET_free (h);
1165}
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition: mq.c:700
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:980
struct GNUNET_SCHEDULER_Task * reconnect_task
ID of the reconnect task (if any).
Definition: arm_api.c:147

References GNUNET_assert, GNUNET_free, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_cancel(), h, GNUNET_ARM_Handle::mq, and GNUNET_ARM_Handle::reconnect_task.

Referenced by do_cleanup(), REST_openid_done(), and REST_reclaim_done().

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

◆ GNUNET_RECLAIM_cancel()

void GNUNET_RECLAIM_cancel ( struct GNUNET_RECLAIM_Operation op)

Cancel an identity provider operation.

Note that the operation MAY still be executed; this merely cancels the continuation; if the request was already transmitted, the service may still choose to complete the operation.

Parameters
opoperation to cancel

Definition at line 1135 of file reclaim_api.c.

1136{
1137 struct GNUNET_RECLAIM_Handle *h = op->h;
1138
1139 GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op);
1140 free_op (op);
1141}
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
static void free_op(struct GNUNET_RECLAIM_Operation *op)
Free op.
Definition: reclaim_api.c:487

References free_op(), GNUNET_CONTAINER_DLL_remove, h, GNUNET_ARM_Operation::h, and op.

Referenced by cleanup_handle(), consume_fail(), and do_cleanup().

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