diff options
24 files changed, 263 insertions, 386 deletions
diff --git a/src/abe/abe.c b/src/abe/abe.c index d008cc522..3f1f6dc5b 100644 --- a/src/abe/abe.c +++ b/src/abe/abe.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. Copyright (C) 2001-2014 Christian Grothoff | 2 | This file is part of GNUnet. Copyright (C) 2001-2018 Christian Grothoff |
3 | (and other contributing authors) | 3 | (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
@@ -20,9 +20,9 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | /** | 22 | /** |
23 | * @file util/crypto_random.c | 23 | * @file abe/abe.c |
24 | * @brief functions to gather random numbers | 24 | * @brief functions for Attribute-Based Encryption |
25 | * @author Christian Grothoff | 25 | * @author Martin Schanzenbach |
26 | */ | 26 | */ |
27 | 27 | ||
28 | 28 | ||
@@ -146,6 +146,12 @@ aes_128_cbc_decrypt( char* ct, | |||
146 | return len; | 146 | return len; |
147 | } | 147 | } |
148 | 148 | ||
149 | /** | ||
150 | * @ingroup abe | ||
151 | * Create a new CP-ABE master key. Caller must free return value. | ||
152 | * | ||
153 | * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_master_key | ||
154 | */ | ||
149 | struct GNUNET_ABE_AbeMasterKey* | 155 | struct GNUNET_ABE_AbeMasterKey* |
150 | GNUNET_ABE_cpabe_create_master_key (void) | 156 | GNUNET_ABE_cpabe_create_master_key (void) |
151 | { | 157 | { |
@@ -157,6 +163,13 @@ GNUNET_ABE_cpabe_create_master_key (void) | |||
157 | return key; | 163 | return key; |
158 | } | 164 | } |
159 | 165 | ||
166 | /** | ||
167 | * @ingroup abe | ||
168 | * Delete a CP-ABE master key. | ||
169 | * | ||
170 | * @param key the master key | ||
171 | * @return fresh private key; free using #GNUNET_free | ||
172 | */ | ||
160 | void | 173 | void |
161 | GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key) | 174 | GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key) |
162 | { | 175 | { |
@@ -167,6 +180,14 @@ GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key) | |||
167 | GNUNET_free (key); | 180 | GNUNET_free (key); |
168 | } | 181 | } |
169 | 182 | ||
183 | /** | ||
184 | * @ingroup abe | ||
185 | * Create a new CP-ABE key. Caller must free return value. | ||
186 | * | ||
187 | * @param key the master key | ||
188 | * @param attrs the attributes to append to the key | ||
189 | * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_key | ||
190 | */ | ||
170 | struct GNUNET_ABE_AbeKey* | 191 | struct GNUNET_ABE_AbeKey* |
171 | GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key, | 192 | GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key, |
172 | char **attrs) | 193 | char **attrs) |
@@ -184,6 +205,14 @@ GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key, | |||
184 | return prv_key; | 205 | return prv_key; |
185 | } | 206 | } |
186 | 207 | ||
208 | /** | ||
209 | * @ingroup abe | ||
210 | * Delete a CP-ABE key. | ||
211 | * | ||
212 | * @param key the key to delete | ||
213 | * @param delete_pub GNUNE_YES if the public key should also be freed (bug in gabe) | ||
214 | * @return fresh private key; free using #GNUNET_free | ||
215 | */ | ||
187 | void | 216 | void |
188 | GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, | 217 | GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, |
189 | int delete_pub) | 218 | int delete_pub) |
@@ -195,7 +224,7 @@ GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, | |||
195 | GNUNET_free (key); | 224 | GNUNET_free (key); |
196 | } | 225 | } |
197 | 226 | ||
198 | ssize_t | 227 | static ssize_t |
199 | write_cpabe (void **result, | 228 | write_cpabe (void **result, |
200 | uint32_t file_len, | 229 | uint32_t file_len, |
201 | char* cph_buf, | 230 | char* cph_buf, |
@@ -223,7 +252,7 @@ write_cpabe (void **result, | |||
223 | return 12 + cph_buf_len + aes_buf_len; | 252 | return 12 + cph_buf_len + aes_buf_len; |
224 | } | 253 | } |
225 | 254 | ||
226 | ssize_t | 255 | static ssize_t |
227 | read_cpabe (const void *data, | 256 | read_cpabe (const void *data, |
228 | char** cph_buf, | 257 | char** cph_buf, |
229 | int *cph_buf_len, | 258 | int *cph_buf_len, |
@@ -253,6 +282,17 @@ read_cpabe (const void *data, | |||
253 | return buf_len; | 282 | return buf_len; |
254 | } | 283 | } |
255 | 284 | ||
285 | /** | ||
286 | * @ingroup abe | ||
287 | * Encrypt a block using sessionkey. | ||
288 | * | ||
289 | * @param block the block to encrypt | ||
290 | * @param size the size of the @a block | ||
291 | * @param policy the ABE policy | ||
292 | * @param key the key used to encrypt | ||
293 | * @param result the result buffer. Will be allocated. Free using #GNUNET_free | ||
294 | * @return the size of the encrypted block, -1 for errors | ||
295 | */ | ||
256 | ssize_t | 296 | ssize_t |
257 | GNUNET_ABE_cpabe_encrypt (const void *block, | 297 | GNUNET_ABE_cpabe_encrypt (const void *block, |
258 | size_t size, | 298 | size_t size, |
@@ -285,6 +325,16 @@ GNUNET_ABE_cpabe_encrypt (const void *block, | |||
285 | return result_len; | 325 | return result_len; |
286 | } | 326 | } |
287 | 327 | ||
328 | /** | ||
329 | * @ingroup abe | ||
330 | * Decrypt a block using the ABE key. | ||
331 | * | ||
332 | * @param block the block to encrypt | ||
333 | * @param size the size of the @a block | ||
334 | * @param key the key used to decrypt | ||
335 | * @param result the result buffer. Will be allocated. Free using #GNUNET_free | ||
336 | * @return the size of the encrypted block, -1 for errors | ||
337 | */ | ||
288 | ssize_t | 338 | ssize_t |
289 | GNUNET_ABE_cpabe_decrypt (const void *block, | 339 | GNUNET_ABE_cpabe_decrypt (const void *block, |
290 | size_t size, | 340 | size_t size, |
@@ -323,6 +373,14 @@ GNUNET_ABE_cpabe_decrypt (const void *block, | |||
323 | return plt_len; | 373 | return plt_len; |
324 | } | 374 | } |
325 | 375 | ||
376 | /** | ||
377 | * @ingroup abe | ||
378 | * Serialize an ABE key. | ||
379 | * | ||
380 | * @param key the key to serialize | ||
381 | * @param result the result buffer. Will be allocated. Free using #GNUNET_free | ||
382 | * @return the size of the encrypted block, -1 for errors | ||
383 | */ | ||
326 | ssize_t | 384 | ssize_t |
327 | GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, | 385 | GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, |
328 | void **result) | 386 | void **result) |
@@ -345,6 +403,14 @@ GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, | |||
345 | return len; | 403 | return len; |
346 | } | 404 | } |
347 | 405 | ||
406 | /** | ||
407 | * @ingroup abe | ||
408 | * Deserialize a serialized ABE key. | ||
409 | * | ||
410 | * @param data the data to deserialize | ||
411 | * @param len the length of the data. | ||
412 | * @return the ABE key. NULL of unsuccessful | ||
413 | */ | ||
348 | struct GNUNET_ABE_AbeKey* | 414 | struct GNUNET_ABE_AbeKey* |
349 | GNUNET_ABE_cpabe_deserialize_key (const void *data, | 415 | GNUNET_ABE_cpabe_deserialize_key (const void *data, |
350 | size_t len) | 416 | size_t len) |
@@ -369,6 +435,14 @@ GNUNET_ABE_cpabe_deserialize_key (const void *data, | |||
369 | return key; | 435 | return key; |
370 | } | 436 | } |
371 | 437 | ||
438 | /** | ||
439 | * @ingroup abe | ||
440 | * Serialize an ABE master key. | ||
441 | * | ||
442 | * @param key the key to serialize | ||
443 | * @param result the result buffer. Will be allocated. Free using #GNUNET_free | ||
444 | * @return the size of the encrypted block, -1 for errors | ||
445 | */ | ||
372 | ssize_t | 446 | ssize_t |
373 | GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key, | 447 | GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key, |
374 | void **result) | 448 | void **result) |
@@ -391,6 +465,14 @@ GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key | |||
391 | return len; | 465 | return len; |
392 | } | 466 | } |
393 | 467 | ||
468 | /** | ||
469 | * @ingroup abe | ||
470 | * Deserialize an ABE master key. | ||
471 | * | ||
472 | * @param data the data to deserialize | ||
473 | * @param len the length of the data. | ||
474 | * @return the ABE key. NULL of unsuccessful | ||
475 | */ | ||
394 | struct GNUNET_ABE_AbeMasterKey* | 476 | struct GNUNET_ABE_AbeMasterKey* |
395 | GNUNET_ABE_cpabe_deserialize_master_key (const void *data, | 477 | GNUNET_ABE_cpabe_deserialize_master_key (const void *data, |
396 | size_t len) | 478 | size_t len) |
diff --git a/src/credential/credential.h b/src/credential/credential.h index f16249c1b..66a4636fc 100644 --- a/src/credential/credential.h +++ b/src/credential/credential.h | |||
@@ -20,7 +20,7 @@ | |||
20 | /** | 20 | /** |
21 | * @file credential/credential.h | 21 | * @file credential/credential.h |
22 | * @brief IPC messages between CREDENTIAL API and CREDENTIAL service | 22 | * @brief IPC messages between CREDENTIAL API and CREDENTIAL service |
23 | * @author Adnan Husain | 23 | * @author Martin Schanzenbach |
24 | */ | 24 | */ |
25 | #ifndef CREDENTIAL_H | 25 | #ifndef CREDENTIAL_H |
26 | #define CREDENTIAL_H | 26 | #define CREDENTIAL_H |
diff --git a/src/credential/credential_api.c b/src/credential/credential_api.c index ca54137ad..677cb9ad4 100644 --- a/src/credential/credential_api.c +++ b/src/credential/credential_api.c | |||
@@ -20,7 +20,7 @@ | |||
20 | /** | 20 | /** |
21 | * @file credential/credential_api.c | 21 | * @file credential/credential_api.c |
22 | * @brief library to access the CREDENTIAL service | 22 | * @brief library to access the CREDENTIAL service |
23 | * @author Adnan Husain | 23 | * @author Martin Schanzenbach |
24 | */ | 24 | */ |
25 | #include "platform.h" | 25 | #include "platform.h" |
26 | #include "gnunet_util_lib.h" | 26 | #include "gnunet_util_lib.h" |
@@ -189,7 +189,7 @@ mq_error_handler (void *cls, | |||
189 | * Check validity of message received from the CREDENTIAL service | 189 | * Check validity of message received from the CREDENTIAL service |
190 | * | 190 | * |
191 | * @param cls the `struct GNUNET_CREDENTIAL_Handle *` | 191 | * @param cls the `struct GNUNET_CREDENTIAL_Handle *` |
192 | * @param loookup_msg the incoming message | 192 | * @param vr_msg the incoming message |
193 | */ | 193 | */ |
194 | static int | 194 | static int |
195 | check_result (void *cls, | 195 | check_result (void *cls, |
@@ -204,7 +204,7 @@ check_result (void *cls, | |||
204 | * Handler for messages received from the CREDENTIAL service | 204 | * Handler for messages received from the CREDENTIAL service |
205 | * | 205 | * |
206 | * @param cls the `struct GNUNET_CREDENTIAL_Handle *` | 206 | * @param cls the `struct GNUNET_CREDENTIAL_Handle *` |
207 | * @param loookup_msg the incoming message | 207 | * @param vr_msg the incoming message |
208 | */ | 208 | */ |
209 | static void | 209 | static void |
210 | handle_result (void *cls, | 210 | handle_result (void *cls, |
@@ -348,15 +348,15 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle) | |||
348 | * @param lr the verify request to cancel | 348 | * @param lr the verify request to cancel |
349 | */ | 349 | */ |
350 | void | 350 | void |
351 | GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *vr) | 351 | GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr) |
352 | { | 352 | { |
353 | struct GNUNET_CREDENTIAL_Handle *handle = vr->credential_handle; | 353 | struct GNUNET_CREDENTIAL_Handle *handle = lr->credential_handle; |
354 | 354 | ||
355 | GNUNET_CONTAINER_DLL_remove (handle->request_head, | 355 | GNUNET_CONTAINER_DLL_remove (handle->request_head, |
356 | handle->request_tail, | 356 | handle->request_tail, |
357 | vr); | 357 | lr); |
358 | GNUNET_MQ_discard (vr->env); | 358 | GNUNET_MQ_discard (lr->env); |
359 | GNUNET_free (vr); | 359 | GNUNET_free (lr); |
360 | } | 360 | } |
361 | 361 | ||
362 | 362 | ||
@@ -369,8 +369,6 @@ GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *vr) | |||
369 | * @param issuer_key the issuer public key | 369 | * @param issuer_key the issuer public key |
370 | * @param issuer_attribute the issuer attribute | 370 | * @param issuer_attribute the issuer attribute |
371 | * @param subject_key the subject public key | 371 | * @param subject_key the subject public key |
372 | * @param credential_count number of credentials provided | ||
373 | * @param credentials subject credentials | ||
374 | * @param proc function to call on result | 372 | * @param proc function to call on result |
375 | * @param proc_cls closure for processor | 373 | * @param proc_cls closure for processor |
376 | * @return handle to the queued request | 374 | * @return handle to the queued request |
diff --git a/src/credential/credential_misc.c b/src/credential/credential_misc.c index 7849e81e6..c94c33919 100644 --- a/src/credential/credential_misc.c +++ b/src/credential/credential_misc.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | 21 | ||
22 | /** | 22 | /** |
23 | * @file credential/credential_mic.c | 23 | * @file credential/credential_misc.c |
24 | * @brief Misc API for credentials | 24 | * @brief Misc API for credentials |
25 | * | 25 | * |
26 | * @author Martin Schanzenbach | 26 | * @author Martin Schanzenbach |
@@ -113,7 +113,6 @@ GNUNET_CREDENTIAL_credential_from_string (const char* s) | |||
113 | /** | 113 | /** |
114 | * Issue an attribute to a subject | 114 | * Issue an attribute to a subject |
115 | * | 115 | * |
116 | * @param handle handle to the Credential service | ||
117 | * @param issuer the ego that should be used to issue the attribute | 116 | * @param issuer the ego that should be used to issue the attribute |
118 | * @param subject the subject of the attribute | 117 | * @param subject the subject of the attribute |
119 | * @param attribute the name of the attribute | 118 | * @param attribute the name of the attribute |
diff --git a/src/credential/credential_serialization.c b/src/credential/credential_serialization.c index 1fc72c203..1d23bb08c 100644 --- a/src/credential/credential_serialization.c +++ b/src/credential/credential_serialization.c | |||
@@ -34,11 +34,10 @@ | |||
34 | 34 | ||
35 | /** | 35 | /** |
36 | * Calculate how many bytes we will need to serialize | 36 | * Calculate how many bytes we will need to serialize |
37 | * the given delegation chain and credential | 37 | * the given delegation chain |
38 | * | 38 | * |
39 | * @param d_count number of delegation chain entries | 39 | * @param ds_count number of delegation chain entries |
40 | * @param dd array of #GNUNET_CREDENTIAL_Delegation | 40 | * @param dsr array of #GNUNET_CREDENTIAL_DelegationSet |
41 | * @param cd a #GNUNET_CREDENTIAL_Credential | ||
42 | * @return the required size to serialize | 41 | * @return the required size to serialize |
43 | */ | 42 | */ |
44 | size_t | 43 | size_t |
@@ -62,8 +61,7 @@ GNUNET_CREDENTIAL_delegation_set_get_size (unsigned int ds_count, | |||
62 | * Serizalize the given delegation chain entries and credential | 61 | * Serizalize the given delegation chain entries and credential |
63 | * | 62 | * |
64 | * @param d_count number of delegation chain entries | 63 | * @param d_count number of delegation chain entries |
65 | * @param dd array of #GNUNET_CREDENTIAL_Delegation | 64 | * @param dsr array of #GNUNET_CREDENTIAL_DelegationSet |
66 | * @param cd a #GNUNET_CREDENTIAL_Credential | ||
67 | * @param dest_size size of the destination | 65 | * @param dest_size size of the destination |
68 | * @param dest where to store the result | 66 | * @param dest where to store the result |
69 | * @return the size of the data, -1 on failure | 67 | * @return the size of the data, -1 on failure |
@@ -108,8 +106,7 @@ GNUNET_CREDENTIAL_delegation_set_serialize (unsigned int d_count, | |||
108 | * @param len size of the serialized delegation chain and cred | 106 | * @param len size of the serialized delegation chain and cred |
109 | * @param src the serialized data | 107 | * @param src the serialized data |
110 | * @param d_count the number of delegation chain entries | 108 | * @param d_count the number of delegation chain entries |
111 | * @param dd where to put the delegation chain entries | 109 | * @param dsr where to put the delegation chain entries |
112 | * @param cd where to put the credential data | ||
113 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 110 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
114 | */ | 111 | */ |
115 | int | 112 | int |
diff --git a/src/credential/gnunet-credential.c b/src/credential/gnunet-credential.c index 4a6dc5ccd..03f959b95 100644 --- a/src/credential/gnunet-credential.c +++ b/src/credential/gnunet-credential.c | |||
@@ -20,7 +20,7 @@ | |||
20 | /** | 20 | /** |
21 | * @file gnunet-credential.c | 21 | * @file gnunet-credential.c |
22 | * @brief command line tool to access command line Credential service | 22 | * @brief command line tool to access command line Credential service |
23 | * @author Adnan Husain | 23 | * @author Martin Schanzenbach |
24 | */ | 24 | */ |
25 | #include "platform.h" | 25 | #include "platform.h" |
26 | #include <gnunet_util_lib.h> | 26 | #include <gnunet_util_lib.h> |
@@ -158,13 +158,6 @@ do_timeout (void *cls) | |||
158 | GNUNET_SCHEDULER_shutdown (); | 158 | GNUNET_SCHEDULER_shutdown (); |
159 | } | 159 | } |
160 | 160 | ||
161 | /** | ||
162 | * Function called with the result of a Credential lookup. | ||
163 | * | ||
164 | * @param cls the 'const char *' name that was resolved | ||
165 | * @param cd_count number of records returned | ||
166 | * @param cd array of @a cd_count records with the results | ||
167 | */ | ||
168 | static void | 161 | static void |
169 | handle_collect_result (void *cls, | 162 | handle_collect_result (void *cls, |
170 | unsigned int d_count, | 163 | unsigned int d_count, |
@@ -192,13 +185,6 @@ handle_collect_result (void *cls, | |||
192 | } | 185 | } |
193 | 186 | ||
194 | 187 | ||
195 | /** | ||
196 | * Function called with the result of a Credential lookup. | ||
197 | * | ||
198 | * @param cls the 'const char *' name that was resolved | ||
199 | * @param cd_count number of records returned | ||
200 | * @param cd array of @a cd_count records with the results | ||
201 | */ | ||
202 | static void | 188 | static void |
203 | handle_verify_result (void *cls, | 189 | handle_verify_result (void *cls, |
204 | unsigned int d_count, | 190 | unsigned int d_count, |
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index be75e485e..be88839e9 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -18,9 +18,9 @@ | |||
18 | Boston, MA 02110-1301, USA. | 18 | Boston, MA 02110-1301, USA. |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file gns/gnunet-service-credential.c | 21 | * @file credential/gnunet-service-credential.c |
22 | * @brief GNU Credential Service (main service) | 22 | * @brief GNUnet Credential Service (main service) |
23 | * @author Adnan Husain | 23 | * @author Martin Schanzenbach |
24 | */ | 24 | */ |
25 | #include "platform.h" | 25 | #include "platform.h" |
26 | #include "gnunet_util_lib.h" | 26 | #include "gnunet_util_lib.h" |
@@ -377,16 +377,11 @@ cleanup_delegation_set (struct DelegationSetQueueEntry *ds_entry) | |||
377 | } | 377 | } |
378 | GNUNET_free (dq_entry); | 378 | GNUNET_free (dq_entry); |
379 | } | 379 | } |
380 | if (NULL != ds_entry->issuer_key) | 380 | GNUNET_free_non_null (ds_entry->issuer_key); |
381 | GNUNET_free (ds_entry->issuer_key); | 381 | GNUNET_free_non_null (ds_entry->lookup_attribute); |
382 | if (NULL != ds_entry->lookup_attribute) | 382 | GNUNET_free_non_null (ds_entry->issuer_attribute); |
383 | GNUNET_free (ds_entry->lookup_attribute); | 383 | GNUNET_free_non_null (ds_entry->unresolved_attribute_delegation); |
384 | if (NULL != ds_entry->issuer_attribute) | 384 | GNUNET_free_non_null (ds_entry->attr_trailer); |
385 | GNUNET_free (ds_entry->issuer_attribute); | ||
386 | if (NULL != ds_entry->unresolved_attribute_delegation) | ||
387 | GNUNET_free (ds_entry->unresolved_attribute_delegation); | ||
388 | if (NULL != ds_entry->attr_trailer) | ||
389 | GNUNET_free (ds_entry->attr_trailer); | ||
390 | if (NULL != ds_entry->lookup_request) | 385 | if (NULL != ds_entry->lookup_request) |
391 | { | 386 | { |
392 | GNUNET_GNS_lookup_cancel (ds_entry->lookup_request); | 387 | GNUNET_GNS_lookup_cancel (ds_entry->lookup_request); |
@@ -394,10 +389,8 @@ cleanup_delegation_set (struct DelegationSetQueueEntry *ds_entry) | |||
394 | } | 389 | } |
395 | if (NULL != ds_entry->delegation_chain_entry) | 390 | if (NULL != ds_entry->delegation_chain_entry) |
396 | { | 391 | { |
397 | if (NULL != ds_entry->delegation_chain_entry->subject_attribute) | 392 | GNUNET_free_non_null (ds_entry->delegation_chain_entry->subject_attribute); |
398 | GNUNET_free (ds_entry->delegation_chain_entry->subject_attribute); | 393 | GNUNET_free_non_null (ds_entry->delegation_chain_entry->issuer_attribute); |
399 | if (NULL != ds_entry->delegation_chain_entry->issuer_attribute) | ||
400 | GNUNET_free (ds_entry->delegation_chain_entry->issuer_attribute); | ||
401 | GNUNET_free (ds_entry->delegation_chain_entry); | 394 | GNUNET_free (ds_entry->delegation_chain_entry); |
402 | } | 395 | } |
403 | GNUNET_free (ds_entry); | 396 | GNUNET_free (ds_entry); |
@@ -415,8 +408,7 @@ cleanup_handle (struct VerifyRequestHandle *vrh) | |||
415 | vrh->lookup_request = NULL; | 408 | vrh->lookup_request = NULL; |
416 | } | 409 | } |
417 | cleanup_delegation_set (vrh->root_set); | 410 | cleanup_delegation_set (vrh->root_set); |
418 | if (NULL != vrh->issuer_attribute) | 411 | GNUNET_free_non_null (vrh->issuer_attribute); |
419 | GNUNET_free (vrh->issuer_attribute); | ||
420 | for (cr_entry = vrh->cred_chain_head; | 412 | for (cr_entry = vrh->cred_chain_head; |
421 | NULL != vrh->cred_chain_head; | 413 | NULL != vrh->cred_chain_head; |
422 | cr_entry = vrh->cred_chain_head) | 414 | cr_entry = vrh->cred_chain_head) |
@@ -424,19 +416,12 @@ cleanup_handle (struct VerifyRequestHandle *vrh) | |||
424 | GNUNET_CONTAINER_DLL_remove (vrh->cred_chain_head, | 416 | GNUNET_CONTAINER_DLL_remove (vrh->cred_chain_head, |
425 | vrh->cred_chain_tail, | 417 | vrh->cred_chain_tail, |
426 | cr_entry); | 418 | cr_entry); |
427 | if (NULL != cr_entry->credential); | 419 | GNUNET_free_non_null (cr_entry->credential); |
428 | GNUNET_free (cr_entry->credential); | ||
429 | GNUNET_free (cr_entry); | 420 | GNUNET_free (cr_entry); |
430 | } | 421 | } |
431 | GNUNET_free (vrh); | 422 | GNUNET_free (vrh); |
432 | } | 423 | } |
433 | 424 | ||
434 | /** | ||
435 | * Task run during shutdown. | ||
436 | * | ||
437 | * @param cls unused | ||
438 | * @param tc unused | ||
439 | */ | ||
440 | static void | 425 | static void |
441 | shutdown_task (void *cls) | 426 | shutdown_task (void *cls) |
442 | { | 427 | { |
@@ -475,11 +460,6 @@ shutdown_task (void *cls) | |||
475 | 460 | ||
476 | 461 | ||
477 | 462 | ||
478 | /** | ||
479 | * Send. | ||
480 | * | ||
481 | * @param handle the handle to the request | ||
482 | */ | ||
483 | static void | 463 | static void |
484 | send_lookup_response (struct VerifyRequestHandle *vrh) | 464 | send_lookup_response (struct VerifyRequestHandle *vrh) |
485 | { | 465 | { |
@@ -491,12 +471,11 @@ send_lookup_response (struct VerifyRequestHandle *vrh) | |||
491 | struct CredentialRecordEntry *cd; | 471 | struct CredentialRecordEntry *cd; |
492 | struct CredentialRecordEntry *tmp; | 472 | struct CredentialRecordEntry *tmp; |
493 | size_t size; | 473 | size_t size; |
494 | int i; | ||
495 | 474 | ||
496 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 475 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
497 | "Sending response\n"); | 476 | "Sending response\n"); |
498 | dce = vrh->delegation_chain_head; | 477 | dce = vrh->delegation_chain_head; |
499 | for (i=0;i<vrh->delegation_chain_size;i++) | 478 | for (uint32_t i=0;i<vrh->delegation_chain_size;i++) |
500 | { | 479 | { |
501 | dd[i].issuer_key = dce->issuer_key; | 480 | dd[i].issuer_key = dce->issuer_key; |
502 | dd[i].subject_key = dce->subject_key; | 481 | dd[i].subject_key = dce->subject_key; |
@@ -537,7 +516,7 @@ send_lookup_response (struct VerifyRequestHandle *vrh) | |||
537 | * Append at the end of rmsg | 516 | * Append at the end of rmsg |
538 | */ | 517 | */ |
539 | cd = vrh->cred_chain_head; | 518 | cd = vrh->cred_chain_head; |
540 | for (i=0;i<vrh->cred_chain_size;i++) | 519 | for (uint32_t i=0;i<vrh->cred_chain_size;i++) |
541 | { | 520 | { |
542 | cred[i].issuer_key = cd->credential->issuer_key; | 521 | cred[i].issuer_key = cd->credential->issuer_key; |
543 | cred[i].subject_key = cd->credential->subject_key; | 522 | cred[i].subject_key = cd->credential->subject_key; |
@@ -598,8 +577,6 @@ backward_resolution (void* cls, | |||
598 | struct DelegationQueueEntry *dq_entry; | 577 | struct DelegationQueueEntry *dq_entry; |
599 | char *expanded_attr; | 578 | char *expanded_attr; |
600 | char *lookup_attribute; | 579 | char *lookup_attribute; |
601 | int i; | ||
602 | int j; | ||
603 | 580 | ||
604 | 581 | ||
605 | current_set = cls; | 582 | current_set = cls; |
@@ -610,7 +587,7 @@ backward_resolution (void* cls, | |||
610 | "Got %d attrs\n", rd_count); | 587 | "Got %d attrs\n", rd_count); |
611 | 588 | ||
612 | // Each OR | 589 | // Each OR |
613 | for (i=0; i < rd_count; i++) | 590 | for (uint32_t i=0; i < rd_count; i++) |
614 | { | 591 | { |
615 | if (GNUNET_GNSRECORD_TYPE_ATTRIBUTE != rd[i].record_type) | 592 | if (GNUNET_GNSRECORD_TYPE_ATTRIBUTE != rd[i].record_type) |
616 | continue; | 593 | continue; |
@@ -637,7 +614,7 @@ backward_resolution (void* cls, | |||
637 | current_set->queue_entries_tail, | 614 | current_set->queue_entries_tail, |
638 | dq_entry); | 615 | dq_entry); |
639 | // Each AND | 616 | // Each AND |
640 | for (j=0; j<ntohl(sets->set_count); j++) | 617 | for (uint32_t j=0; j<ntohl(sets->set_count); j++) |
641 | { | 618 | { |
642 | ds_entry = GNUNET_new (struct DelegationSetQueueEntry); | 619 | ds_entry = GNUNET_new (struct DelegationSetQueueEntry); |
643 | if (NULL != current_set->attr_trailer) | 620 | if (NULL != current_set->attr_trailer) |
@@ -793,8 +770,6 @@ backward_resolution (void* cls, | |||
793 | * Result from GNS lookup. | 770 | * Result from GNS lookup. |
794 | * | 771 | * |
795 | * @param cls the closure (our client lookup handle) | 772 | * @param cls the closure (our client lookup handle) |
796 | * @param rd_count the number of records in @a rd | ||
797 | * @param rd the record data | ||
798 | */ | 773 | */ |
799 | static void | 774 | static void |
800 | delegation_chain_resolution_start (void* cls) | 775 | delegation_chain_resolution_start (void* cls) |
@@ -858,13 +833,6 @@ delegation_chain_resolution_start (void* cls) | |||
858 | ds_entry); | 833 | ds_entry); |
859 | } | 834 | } |
860 | 835 | ||
861 | /** | ||
862 | * Checks a #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY message | ||
863 | * | ||
864 | * @param cls client sending the message | ||
865 | * @param v_msg message of type `struct VerifyMessage` | ||
866 | * @return #GNUNET_OK if @a v_msg is well-formed | ||
867 | */ | ||
868 | static int | 836 | static int |
869 | check_verify (void *cls, | 837 | check_verify (void *cls, |
870 | const struct VerifyMessage *v_msg) | 838 | const struct VerifyMessage *v_msg) |
@@ -893,13 +861,6 @@ check_verify (void *cls, | |||
893 | return GNUNET_OK; | 861 | return GNUNET_OK; |
894 | } | 862 | } |
895 | 863 | ||
896 | /** | ||
897 | * Handle Credential verification requests from client | ||
898 | * | ||
899 | * @param cls the closure | ||
900 | * @param client the client | ||
901 | * @param message the message | ||
902 | */ | ||
903 | static void | 864 | static void |
904 | handle_verify (void *cls, | 865 | handle_verify (void *cls, |
905 | const struct VerifyMessage *v_msg) | 866 | const struct VerifyMessage *v_msg) |
@@ -909,7 +870,6 @@ handle_verify (void *cls, | |||
909 | struct CredentialRecordEntry *cr_entry; | 870 | struct CredentialRecordEntry *cr_entry; |
910 | uint32_t credentials_count; | 871 | uint32_t credentials_count; |
911 | uint32_t credential_data_size; | 872 | uint32_t credential_data_size; |
912 | int i; | ||
913 | char attr[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; | 873 | char attr[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; |
914 | char issuer_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; | 874 | char issuer_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; |
915 | char *attrptr = attr; | 875 | char *attrptr = attr; |
@@ -958,7 +918,7 @@ handle_verify (void *cls, | |||
958 | return; | 918 | return; |
959 | } | 919 | } |
960 | 920 | ||
961 | for (i=0;i<credentials_count;i++) { | 921 | for (uint32_t i=0;i<credentials_count;i++) { |
962 | cr_entry = GNUNET_new (struct CredentialRecordEntry); | 922 | cr_entry = GNUNET_new (struct CredentialRecordEntry); |
963 | cr_entry->credential = GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_Credential) + | 923 | cr_entry->credential = GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_Credential) + |
964 | credentials[i].issuer_attribute_len); | 924 | credentials[i].issuer_attribute_len); |
@@ -979,9 +939,6 @@ handle_verify (void *cls, | |||
979 | 939 | ||
980 | } | 940 | } |
981 | 941 | ||
982 | /** | ||
983 | * We encountered an error while collecting | ||
984 | */ | ||
985 | static void | 942 | static void |
986 | handle_cred_collection_error_cb (void *cls) | 943 | handle_cred_collection_error_cb (void *cls) |
987 | { | 944 | { |
@@ -1001,9 +958,6 @@ collect_next (void *cls) | |||
1001 | GNUNET_NAMESTORE_zone_iterator_next (vrh->cred_collection_iter); | 958 | GNUNET_NAMESTORE_zone_iterator_next (vrh->cred_collection_iter); |
1002 | } | 959 | } |
1003 | 960 | ||
1004 | /** | ||
1005 | * Store credential | ||
1006 | */ | ||
1007 | static void | 961 | static void |
1008 | handle_cred_collection_cb (void *cls, | 962 | handle_cred_collection_cb (void *cls, |
1009 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | 963 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, |
@@ -1015,10 +969,9 @@ handle_cred_collection_cb (void *cls, | |||
1015 | struct GNUNET_CREDENTIAL_Credential *crd; | 969 | struct GNUNET_CREDENTIAL_Credential *crd; |
1016 | struct CredentialRecordEntry *cr_entry; | 970 | struct CredentialRecordEntry *cr_entry; |
1017 | int cred_record_count; | 971 | int cred_record_count; |
1018 | int i; | ||
1019 | 972 | ||
1020 | cred_record_count = 0; | 973 | cred_record_count = 0; |
1021 | for (i=0; i < rd_count; i++) | 974 | for (uint32_t i=0; i < rd_count; i++) |
1022 | { | 975 | { |
1023 | if (GNUNET_GNSRECORD_TYPE_CREDENTIAL != rd[i].record_type) | 976 | if (GNUNET_GNSRECORD_TYPE_CREDENTIAL != rd[i].record_type) |
1024 | continue; | 977 | continue; |
@@ -1042,9 +995,6 @@ handle_cred_collection_cb (void *cls, | |||
1042 | vrh); | 995 | vrh); |
1043 | } | 996 | } |
1044 | 997 | ||
1045 | /** | ||
1046 | * We encountered an error while collecting | ||
1047 | */ | ||
1048 | static void | 998 | static void |
1049 | handle_cred_collection_finished_cb (void *cls) | 999 | handle_cred_collection_finished_cb (void *cls) |
1050 | { | 1000 | { |
@@ -1055,13 +1005,6 @@ handle_cred_collection_finished_cb (void *cls) | |||
1055 | delegation_chain_resolution_start (vrh); | 1005 | delegation_chain_resolution_start (vrh); |
1056 | } | 1006 | } |
1057 | 1007 | ||
1058 | /** | ||
1059 | * Handle Credential collection requests from client | ||
1060 | * | ||
1061 | * @param cls the closure | ||
1062 | * @param client the client | ||
1063 | * @param message the message | ||
1064 | */ | ||
1065 | static void | 1008 | static void |
1066 | handle_collect (void *cls, | 1009 | handle_collect (void *cls, |
1067 | const struct CollectMessage *c_msg) | 1010 | const struct CollectMessage *c_msg) |
@@ -1113,13 +1056,6 @@ handle_collect (void *cls, | |||
1113 | } | 1056 | } |
1114 | 1057 | ||
1115 | 1058 | ||
1116 | /** | ||
1117 | * Checks a #GNUNET_MESSAGE_TYPE_CREDENTIAL_COLLECT message | ||
1118 | * | ||
1119 | * @param cls client sending the message | ||
1120 | * @param v_msg message of type `struct CollectMessage` | ||
1121 | * @return #GNUNET_OK if @a v_msg is well-formed | ||
1122 | */ | ||
1123 | static int | 1059 | static int |
1124 | check_collect (void *cls, | 1060 | check_collect (void *cls, |
1125 | const struct CollectMessage *c_msg) | 1061 | const struct CollectMessage *c_msg) |
@@ -1149,12 +1085,6 @@ check_collect (void *cls, | |||
1149 | return GNUNET_OK; | 1085 | return GNUNET_OK; |
1150 | } | 1086 | } |
1151 | 1087 | ||
1152 | /** | ||
1153 | * One of our clients disconnected, clean up after it. | ||
1154 | * | ||
1155 | * @param cls NULL | ||
1156 | * @param client the client that disconnected | ||
1157 | */ | ||
1158 | static void | 1088 | static void |
1159 | client_disconnect_cb (void *cls, | 1089 | client_disconnect_cb (void *cls, |
1160 | struct GNUNET_SERVICE_Client *client, | 1090 | struct GNUNET_SERVICE_Client *client, |
@@ -1165,14 +1095,6 @@ client_disconnect_cb (void *cls, | |||
1165 | client); | 1095 | client); |
1166 | } | 1096 | } |
1167 | 1097 | ||
1168 | /** | ||
1169 | * Add a client to our list of active clients. | ||
1170 | * | ||
1171 | * @param cls NULL | ||
1172 | * @param client client to add | ||
1173 | * @param mq message queue for @a client | ||
1174 | * @return this client | ||
1175 | */ | ||
1176 | static void * | 1098 | static void * |
1177 | client_connect_cb (void *cls, | 1099 | client_connect_cb (void *cls, |
1178 | struct GNUNET_SERVICE_Client *client, | 1100 | struct GNUNET_SERVICE_Client *client, |
@@ -1188,8 +1110,8 @@ client_connect_cb (void *cls, | |||
1188 | * Process Credential requests. | 1110 | * Process Credential requests. |
1189 | * | 1111 | * |
1190 | * @param cls closure | 1112 | * @param cls closure |
1191 | * @param server the initialized server | ||
1192 | * @param c configuration to use | 1113 | * @param c configuration to use |
1114 | * @param handle service handle | ||
1193 | */ | 1115 | */ |
1194 | static void | 1116 | static void |
1195 | run (void *cls, | 1117 | run (void *cls, |
diff --git a/src/credential/plugin_gnsrecord_credential.c b/src/credential/plugin_gnsrecord_credential.c index 72d6b53f5..342790b7a 100644 --- a/src/credential/plugin_gnsrecord_credential.c +++ b/src/credential/plugin_gnsrecord_credential.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file credential/plugin_gnsrecord_credential.c | 22 | * @file credential/plugin_gnsrecord_credential.c |
23 | * @brief gnsrecord plugin to provide the API for CREDENTIAL records | 23 | * @brief gnsrecord plugin to provide the API for CREDENTIAL records |
24 | * @author Adnan Husain | 24 | * @author Martin Schanzenbach |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
diff --git a/src/credential/plugin_rest_credential.c b/src/credential/plugin_rest_credential.c index 48d48fba0..480658822 100644 --- a/src/credential/plugin_rest_credential.c +++ b/src/credential/plugin_rest_credential.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Martin Schanzenbach | 21 | * @author Martin Schanzenbach |
22 | * @file gns/plugin_rest_credential.c | 22 | * @file credential/plugin_rest_credential.c |
23 | * @brief GNUnet CREDENTIAL REST plugin | 23 | * @brief GNUnet CREDENTIAL REST plugin |
24 | * | 24 | * |
25 | */ | 25 | */ |
@@ -194,12 +194,6 @@ cleanup_handle (struct RequestHandle *handle) | |||
194 | } | 194 | } |
195 | 195 | ||
196 | 196 | ||
197 | /** | ||
198 | * Task run on shutdown. Cleans up everything. | ||
199 | * | ||
200 | * @param cls unused | ||
201 | * @param tc scheduler context | ||
202 | */ | ||
203 | static void | 197 | static void |
204 | do_error (void *cls) | 198 | do_error (void *cls) |
205 | { | 199 | { |
@@ -213,7 +207,8 @@ do_error (void *cls) | |||
213 | 207 | ||
214 | /** | 208 | /** |
215 | * Attribute delegation to JSON | 209 | * Attribute delegation to JSON |
216 | * @param attr the attribute | 210 | * |
211 | * @param delegation_chain_entry the DSE | ||
217 | * @return JSON, NULL if failed | 212 | * @return JSON, NULL if failed |
218 | */ | 213 | */ |
219 | static json_t* | 214 | static json_t* |
@@ -257,6 +252,7 @@ attribute_delegation_to_json (struct GNUNET_CREDENTIAL_Delegation *delegation_ch | |||
257 | 252 | ||
258 | /** | 253 | /** |
259 | * JSONAPI resource to Credential | 254 | * JSONAPI resource to Credential |
255 | * | ||
260 | * @param res the JSONAPI resource | 256 | * @param res the JSONAPI resource |
261 | * @return the resulting credential, NULL if failed | 257 | * @return the resulting credential, NULL if failed |
262 | */ | 258 | */ |
@@ -327,6 +323,7 @@ json_to_credential (json_t *res) | |||
327 | 323 | ||
328 | /** | 324 | /** |
329 | * Credential to JSON | 325 | * Credential to JSON |
326 | * | ||
330 | * @param cred the credential | 327 | * @param cred the credential |
331 | * @return the resulting json, NULL if failed | 328 | * @return the resulting json, NULL if failed |
332 | */ | 329 | */ |
@@ -373,13 +370,6 @@ credential_to_json (struct GNUNET_CREDENTIAL_Credential *cred) | |||
373 | return cred_obj; | 370 | return cred_obj; |
374 | } | 371 | } |
375 | 372 | ||
376 | /** | ||
377 | * Function called with the result of a Credential lookup. | ||
378 | * | ||
379 | * @param cls the 'const char *' name that was resolved | ||
380 | * @param cd_count number of records returned | ||
381 | * @param cd array of @a cd_count records with the results | ||
382 | */ | ||
383 | static void | 373 | static void |
384 | handle_collect_response (void *cls, | 374 | handle_collect_response (void *cls, |
385 | unsigned int d_count, | 375 | unsigned int d_count, |
@@ -470,13 +460,6 @@ subject_ego_lookup (void *cls, | |||
470 | 460 | ||
471 | 461 | ||
472 | 462 | ||
473 | /** | ||
474 | * Function called with the result of a Credential lookup. | ||
475 | * | ||
476 | * @param cls the 'const char *' name that was resolved | ||
477 | * @param cd_count number of records returned | ||
478 | * @param cd array of @a cd_count records with the results | ||
479 | */ | ||
480 | static void | 463 | static void |
481 | handle_verify_response (void *cls, | 464 | handle_verify_response (void *cls, |
482 | unsigned int d_count, | 465 | unsigned int d_count, |
@@ -1062,11 +1045,6 @@ issue_cred_cont (struct GNUNET_REST_RequestHandle *conndata_handle, | |||
1062 | handle); | 1045 | handle); |
1063 | } | 1046 | } |
1064 | 1047 | ||
1065 | /** | ||
1066 | * Handle rest request | ||
1067 | * | ||
1068 | * @param handle the lookup handle | ||
1069 | */ | ||
1070 | static void | 1048 | static void |
1071 | options_cont (struct GNUNET_REST_RequestHandle *con_handle, | 1049 | options_cont (struct GNUNET_REST_RequestHandle *con_handle, |
1072 | const char* url, | 1050 | const char* url, |
@@ -1087,17 +1065,6 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
1087 | } | 1065 | } |
1088 | 1066 | ||
1089 | 1067 | ||
1090 | /** | ||
1091 | * Function processing the REST call | ||
1092 | * | ||
1093 | * @param method HTTP method | ||
1094 | * @param url URL of the HTTP request | ||
1095 | * @param data body of the HTTP request (optional) | ||
1096 | * @param data_size length of the body | ||
1097 | * @param proc callback function for the result | ||
1098 | * @param proc_cls closure for callback function | ||
1099 | * @return GNUNET_OK if request accepted | ||
1100 | */ | ||
1101 | static void | 1068 | static void |
1102 | rest_credential_process_request(struct GNUNET_REST_RequestHandle *conndata_handle, | 1069 | rest_credential_process_request(struct GNUNET_REST_RequestHandle *conndata_handle, |
1103 | GNUNET_REST_ResultProcessor proc, | 1070 | GNUNET_REST_ResultProcessor proc, |
diff --git a/src/identity-attribute/identity_attribute.c b/src/identity-attribute/identity_attribute.c index a8aae6ced..cf50d058e 100644 --- a/src/identity-attribute/identity_attribute.c +++ b/src/identity-attribute/identity_attribute.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file identity-provider/identity_attribute.c | 22 | * @file identity-attribute/identity_attribute.c |
23 | * @brief helper library to manage identity attributes | 23 | * @brief helper library to manage identity attributes |
24 | * @author Martin Schanzenbach | 24 | * @author Martin Schanzenbach |
25 | */ | 25 | */ |
@@ -206,7 +206,7 @@ GNUNET_IDENTITY_ATTRIBUTE_value_to_string (uint32_t type, | |||
206 | /** | 206 | /** |
207 | * Create a new attribute. | 207 | * Create a new attribute. |
208 | * | 208 | * |
209 | * @param name the attribute name | 209 | * @param attr_name the attribute name |
210 | * @param type the attribute type | 210 | * @param type the attribute type |
211 | * @param data the attribute value | 211 | * @param data the attribute value |
212 | * @param data_size the attribute value size | 212 | * @param data_size the attribute value size |
@@ -214,7 +214,7 @@ GNUNET_IDENTITY_ATTRIBUTE_value_to_string (uint32_t type, | |||
214 | */ | 214 | */ |
215 | struct GNUNET_IDENTITY_ATTRIBUTE_Claim * | 215 | struct GNUNET_IDENTITY_ATTRIBUTE_Claim * |
216 | GNUNET_IDENTITY_ATTRIBUTE_claim_new (const char* attr_name, | 216 | GNUNET_IDENTITY_ATTRIBUTE_claim_new (const char* attr_name, |
217 | uint32_t attr_type, | 217 | uint32_t type, |
218 | const void* data, | 218 | const void* data, |
219 | size_t data_size) | 219 | size_t data_size) |
220 | { | 220 | { |
@@ -224,7 +224,7 @@ GNUNET_IDENTITY_ATTRIBUTE_claim_new (const char* attr_name, | |||
224 | attr = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_ATTRIBUTE_Claim) + | 224 | attr = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_ATTRIBUTE_Claim) + |
225 | strlen (attr_name) + 1 + | 225 | strlen (attr_name) + 1 + |
226 | data_size); | 226 | data_size); |
227 | attr->type = attr_type; | 227 | attr->type = type; |
228 | attr->data_size = data_size; | 228 | attr->data_size = data_size; |
229 | attr->version = 0; | 229 | attr->version = 0; |
230 | write_ptr = (char*)&attr[1]; | 230 | write_ptr = (char*)&attr[1]; |
diff --git a/src/identity-attribute/identity_attribute.h b/src/identity-attribute/identity_attribute.h index 046321807..8dfc17521 100644 --- a/src/identity-attribute/identity_attribute.h +++ b/src/identity-attribute/identity_attribute.h | |||
@@ -19,8 +19,8 @@ | |||
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Martin Schanzenbach | 21 | * @author Martin Schanzenbach |
22 | * @file identity-provider/identity_attribute.h | 22 | * @file identity-attribute/identity_attribute.h |
23 | * @brief GNUnet Identity Provider library | 23 | * @brief GNUnet Identity attributes |
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | #ifndef IDENTITY_ATTRIBUTE_H | 26 | #ifndef IDENTITY_ATTRIBUTE_H |
diff --git a/src/identity-attribute/plugin_identity_attribute_gnuid.c b/src/identity-attribute/plugin_identity_attribute_gnuid.c index 0ff44d199..006b45ea2 100644 --- a/src/identity-attribute/plugin_identity_attribute_gnuid.c +++ b/src/identity-attribute/plugin_identity_attribute_gnuid.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file identity-provider/plugin_identity_attribute_gnuid.c | 22 | * @file identity-attribute/plugin_identity_attribute_gnuid.c |
23 | * @brief identity attribute plugin to provide the API for fundamental | 23 | * @brief identity attribute plugin to provide the API for fundamental |
24 | * attribute types. | 24 | * attribute types. |
25 | * | 25 | * |
diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/identity-provider/gnunet-service-identity-provider.c index 351308c3a..4e1de36cd 100644 --- a/src/identity-provider/gnunet-service-identity-provider.c +++ b/src/identity-provider/gnunet-service-identity-provider.c | |||
@@ -637,10 +637,8 @@ cleanup() | |||
637 | GNUNET_NAMESTORE_disconnect (ns_handle); | 637 | GNUNET_NAMESTORE_disconnect (ns_handle); |
638 | if (NULL != stats_handle) | 638 | if (NULL != stats_handle) |
639 | GNUNET_STATISTICS_destroy (stats_handle, GNUNET_NO); | 639 | GNUNET_STATISTICS_destroy (stats_handle, GNUNET_NO); |
640 | if (NULL != token) | 640 | GNUNET_free_non_null (token); |
641 | GNUNET_free (token); | 641 | GNUNET_free_non_null (label); |
642 | if (NULL != label) | ||
643 | GNUNET_free (label); | ||
644 | 642 | ||
645 | } | 643 | } |
646 | 644 | ||
@@ -648,7 +646,6 @@ cleanup() | |||
648 | * Shutdown task | 646 | * Shutdown task |
649 | * | 647 | * |
650 | * @param cls NULL | 648 | * @param cls NULL |
651 | * @param tc task context | ||
652 | */ | 649 | */ |
653 | static void | 650 | static void |
654 | do_shutdown (void *cls) | 651 | do_shutdown (void *cls) |
@@ -732,9 +729,8 @@ bootstrap_abe_result (void *cls, | |||
732 | { | 729 | { |
733 | struct AbeBootstrapHandle *abh = cls; | 730 | struct AbeBootstrapHandle *abh = cls; |
734 | struct GNUNET_ABE_AbeMasterKey *abe_key; | 731 | struct GNUNET_ABE_AbeMasterKey *abe_key; |
735 | int i; | ||
736 | 732 | ||
737 | for (i=0;i<rd_count;i++) { | 733 | for (uint32_t i=0;i<rd_count;i++) { |
738 | if (GNUNET_GNSRECORD_TYPE_ABE_MASTER != rd[i].record_type) | 734 | if (GNUNET_GNSRECORD_TYPE_ABE_MASTER != rd[i].record_type) |
739 | continue; | 735 | continue; |
740 | abe_key = GNUNET_ABE_cpabe_deserialize_master_key (rd[i].data, | 736 | abe_key = GNUNET_ABE_cpabe_deserialize_master_key (rd[i].data, |
@@ -964,7 +960,7 @@ issue_ticket_after_abe_bootstrap (void *cls, | |||
964 | char *label; | 960 | char *label; |
965 | char *policy; | 961 | char *policy; |
966 | int attrs_len; | 962 | int attrs_len; |
967 | int i; | 963 | uint32_t i; |
968 | size_t code_record_len; | 964 | size_t code_record_len; |
969 | 965 | ||
970 | //Create new ABE key for RP | 966 | //Create new ABE key for RP |
@@ -1021,13 +1017,6 @@ issue_ticket_after_abe_bootstrap (void *cls, | |||
1021 | } | 1017 | } |
1022 | 1018 | ||
1023 | 1019 | ||
1024 | /** | ||
1025 | * Checks a ticket issue message | ||
1026 | * | ||
1027 | * @param cls client sending the message | ||
1028 | * @param im message of type `struct TicketIssueMessage` | ||
1029 | * @return #GNUNET_OK if @a im is well-formed | ||
1030 | */ | ||
1031 | static int | 1020 | static int |
1032 | check_issue_ticket_message(void *cls, | 1021 | check_issue_ticket_message(void *cls, |
1033 | const struct IssueTicketMessage *im) | 1022 | const struct IssueTicketMessage *im) |
@@ -1044,14 +1033,6 @@ check_issue_ticket_message(void *cls, | |||
1044 | } | 1033 | } |
1045 | 1034 | ||
1046 | 1035 | ||
1047 | /** | ||
1048 | * | ||
1049 | * Handler for ticket issue message | ||
1050 | * | ||
1051 | * @param cls unused | ||
1052 | * @param client who sent the message | ||
1053 | * @param message the message | ||
1054 | */ | ||
1055 | static void | 1036 | static void |
1056 | handle_issue_ticket_message (void *cls, | 1037 | handle_issue_ticket_message (void *cls, |
1057 | const struct IssueTicketMessage *im) | 1038 | const struct IssueTicketMessage *im) |
@@ -1083,26 +1064,31 @@ handle_issue_ticket_message (void *cls, | |||
1083 | 1064 | ||
1084 | /** | 1065 | /** |
1085 | * Cleanup revoke handle | 1066 | * Cleanup revoke handle |
1067 | * | ||
1068 | * @param rh the ticket revocation handle | ||
1086 | */ | 1069 | */ |
1087 | static void | 1070 | static void |
1088 | cleanup_revoke_ticket_handle (struct TicketRevocationHandle *handle) | 1071 | cleanup_revoke_ticket_handle (struct TicketRevocationHandle *rh) |
1089 | { | 1072 | { |
1090 | if (NULL != handle->attrs) | 1073 | if (NULL != rh->attrs) |
1091 | GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs); | 1074 | GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->attrs); |
1092 | if (NULL != handle->rvk_attrs) | 1075 | if (NULL != rh->rvk_attrs) |
1093 | GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->rvk_attrs); | 1076 | GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->rvk_attrs); |
1094 | if (NULL != handle->abe_key) | 1077 | if (NULL != rh->abe_key) |
1095 | GNUNET_ABE_cpabe_delete_master_key (handle->abe_key); | 1078 | GNUNET_ABE_cpabe_delete_master_key (rh->abe_key); |
1096 | if (NULL != handle->ns_qe) | 1079 | if (NULL != rh->ns_qe) |
1097 | GNUNET_NAMESTORE_cancel (handle->ns_qe); | 1080 | GNUNET_NAMESTORE_cancel (rh->ns_qe); |
1098 | if (NULL != handle->ns_it) | 1081 | if (NULL != rh->ns_it) |
1099 | GNUNET_NAMESTORE_zone_iteration_stop (handle->ns_it); | 1082 | GNUNET_NAMESTORE_zone_iteration_stop (rh->ns_it); |
1100 | GNUNET_free (handle); | 1083 | GNUNET_free (rh); |
1101 | } | 1084 | } |
1102 | 1085 | ||
1103 | 1086 | ||
1104 | /** | 1087 | /** |
1105 | * Send revocation result | 1088 | * Send revocation result |
1089 | * | ||
1090 | * @param rh ticket revocation handle | ||
1091 | * @param success GNUNET_OK if successful result | ||
1106 | */ | 1092 | */ |
1107 | static void | 1093 | static void |
1108 | send_revocation_finished (struct TicketRevocationHandle *rh, | 1094 | send_revocation_finished (struct TicketRevocationHandle *rh, |
@@ -1190,7 +1176,7 @@ ticket_reissue_proc (void *cls, | |||
1190 | char *label; | 1176 | char *label; |
1191 | char *policy; | 1177 | char *policy; |
1192 | int attrs_len; | 1178 | int attrs_len; |
1193 | int i; | 1179 | uint32_t i; |
1194 | int reissue_ticket; | 1180 | int reissue_ticket; |
1195 | size_t code_record_len; | 1181 | size_t code_record_len; |
1196 | 1182 | ||
@@ -1476,13 +1462,6 @@ get_ticket_after_abe_bootstrap (void *cls, | |||
1476 | rh); | 1462 | rh); |
1477 | } | 1463 | } |
1478 | 1464 | ||
1479 | /** | ||
1480 | * Checks a ticket revocation message | ||
1481 | * | ||
1482 | * @param cls client sending the message | ||
1483 | * @param im message of type `struct RevokeTicketMessage` | ||
1484 | * @return #GNUNET_OK if @a im is well-formed | ||
1485 | */ | ||
1486 | static int | 1465 | static int |
1487 | check_revoke_ticket_message(void *cls, | 1466 | check_revoke_ticket_message(void *cls, |
1488 | const struct RevokeTicketMessage *im) | 1467 | const struct RevokeTicketMessage *im) |
@@ -1497,14 +1476,7 @@ check_revoke_ticket_message(void *cls, | |||
1497 | } | 1476 | } |
1498 | return GNUNET_OK; | 1477 | return GNUNET_OK; |
1499 | } | 1478 | } |
1500 | /** | 1479 | |
1501 | * | ||
1502 | * Handler for ticket revocation message | ||
1503 | * | ||
1504 | * @param cls unused | ||
1505 | * @param client who sent the message | ||
1506 | * @param message the message | ||
1507 | */ | ||
1508 | static void | 1480 | static void |
1509 | handle_revoke_ticket_message (void *cls, | 1481 | handle_revoke_ticket_message (void *cls, |
1510 | const struct RevokeTicketMessage *rm) | 1482 | const struct RevokeTicketMessage *rm) |
@@ -1544,13 +1516,6 @@ cleanup_consume_ticket_handle (struct ConsumeTicketHandle *handle) | |||
1544 | 1516 | ||
1545 | 1517 | ||
1546 | 1518 | ||
1547 | /** | ||
1548 | * Checks a ticket consume message | ||
1549 | * | ||
1550 | * @param cls client sending the message | ||
1551 | * @param im message of type `struct ConsumeTicketMessage` | ||
1552 | * @return #GNUNET_OK if @a im is well-formed | ||
1553 | */ | ||
1554 | static int | 1519 | static int |
1555 | check_consume_ticket_message(void *cls, | 1520 | check_consume_ticket_message(void *cls, |
1556 | const struct ConsumeTicketMessage *cm) | 1521 | const struct ConsumeTicketMessage *cm) |
@@ -1782,14 +1747,6 @@ process_consume_abe_key (void *cls, uint32_t rd_count, | |||
1782 | } | 1747 | } |
1783 | 1748 | ||
1784 | 1749 | ||
1785 | /** | ||
1786 | * | ||
1787 | * Handler for ticket issue message | ||
1788 | * | ||
1789 | * @param cls unused | ||
1790 | * @param client who sent the message | ||
1791 | * @param message the message | ||
1792 | */ | ||
1793 | static void | 1750 | static void |
1794 | handle_consume_ticket_message (void *cls, | 1751 | handle_consume_ticket_message (void *cls, |
1795 | const struct ConsumeTicketMessage *cm) | 1752 | const struct ConsumeTicketMessage *cm) |
@@ -1941,13 +1898,6 @@ store_after_abe_bootstrap (void *cls, | |||
1941 | GNUNET_SCHEDULER_add_now (&attr_store_task, ash); | 1898 | GNUNET_SCHEDULER_add_now (&attr_store_task, ash); |
1942 | } | 1899 | } |
1943 | 1900 | ||
1944 | /** | ||
1945 | * Checks a store message | ||
1946 | * | ||
1947 | * @param cls client sending the message | ||
1948 | * @param sam message of type `struct AttributeStoreMessage` | ||
1949 | * @return #GNUNET_OK if @a im is well-formed | ||
1950 | */ | ||
1951 | static int | 1901 | static int |
1952 | check_attribute_store_message(void *cls, | 1902 | check_attribute_store_message(void *cls, |
1953 | const struct AttributeStoreMessage *sam) | 1903 | const struct AttributeStoreMessage *sam) |
@@ -1964,14 +1914,6 @@ check_attribute_store_message(void *cls, | |||
1964 | } | 1914 | } |
1965 | 1915 | ||
1966 | 1916 | ||
1967 | /** | ||
1968 | * | ||
1969 | * Handler for store message | ||
1970 | * | ||
1971 | * @param cls unused | ||
1972 | * @param client who sent the message | ||
1973 | * @param message the message | ||
1974 | */ | ||
1975 | static void | 1917 | static void |
1976 | handle_attribute_store_message (void *cls, | 1918 | handle_attribute_store_message (void *cls, |
1977 | const struct AttributeStoreMessage *sam) | 1919 | const struct AttributeStoreMessage *sam) |
@@ -2125,12 +2067,6 @@ iterate_next_after_abe_bootstrap (void *cls, | |||
2125 | 2067 | ||
2126 | 2068 | ||
2127 | 2069 | ||
2128 | /** | ||
2129 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ITERATION_START message | ||
2130 | * | ||
2131 | * @param cls the client sending the message | ||
2132 | * @param zis_msg message from the client | ||
2133 | */ | ||
2134 | static void | 2070 | static void |
2135 | handle_iteration_start (void *cls, | 2071 | handle_iteration_start (void *cls, |
2136 | const struct AttributeIterationStartMessage *ais_msg) | 2072 | const struct AttributeIterationStartMessage *ais_msg) |
@@ -2153,12 +2089,6 @@ handle_iteration_start (void *cls, | |||
2153 | } | 2089 | } |
2154 | 2090 | ||
2155 | 2091 | ||
2156 | /** | ||
2157 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ITERATION_STOP message | ||
2158 | * | ||
2159 | * @param cls the client sending the message | ||
2160 | * @param ais_msg message from the client | ||
2161 | */ | ||
2162 | static void | 2092 | static void |
2163 | handle_iteration_stop (void *cls, | 2093 | handle_iteration_stop (void *cls, |
2164 | const struct AttributeIterationStopMessage *ais_msg) | 2094 | const struct AttributeIterationStopMessage *ais_msg) |
@@ -2188,12 +2118,6 @@ handle_iteration_stop (void *cls, | |||
2188 | } | 2118 | } |
2189 | 2119 | ||
2190 | 2120 | ||
2191 | /** | ||
2192 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT message | ||
2193 | * | ||
2194 | * @param cls the client sending the message | ||
2195 | * @param message message from the client | ||
2196 | */ | ||
2197 | static void | 2121 | static void |
2198 | handle_iteration_next (void *cls, | 2122 | handle_iteration_next (void *cls, |
2199 | const struct AttributeIterationNextMessage *ais_msg) | 2123 | const struct AttributeIterationNextMessage *ais_msg) |
@@ -2351,12 +2275,6 @@ run_ticket_iteration_round (struct TicketIteration *ti) | |||
2351 | cleanup_ticket_iter_handle (ti); | 2275 | cleanup_ticket_iter_handle (ti); |
2352 | } | 2276 | } |
2353 | 2277 | ||
2354 | /** | ||
2355 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_START message | ||
2356 | * | ||
2357 | * @param cls the client sending the message | ||
2358 | * @param tis_msg message from the client | ||
2359 | */ | ||
2360 | static void | 2278 | static void |
2361 | handle_ticket_iteration_start (void *cls, | 2279 | handle_ticket_iteration_start (void *cls, |
2362 | const struct TicketIterationStartMessage *tis_msg) | 2280 | const struct TicketIterationStartMessage *tis_msg) |
@@ -2381,12 +2299,6 @@ handle_ticket_iteration_start (void *cls, | |||
2381 | } | 2299 | } |
2382 | 2300 | ||
2383 | 2301 | ||
2384 | /** | ||
2385 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP message | ||
2386 | * | ||
2387 | * @param cls the client sending the message | ||
2388 | * @param tis_msg message from the client | ||
2389 | */ | ||
2390 | static void | 2302 | static void |
2391 | handle_ticket_iteration_stop (void *cls, | 2303 | handle_ticket_iteration_stop (void *cls, |
2392 | const struct TicketIterationStopMessage *tis_msg) | 2304 | const struct TicketIterationStopMessage *tis_msg) |
@@ -2416,12 +2328,6 @@ handle_ticket_iteration_stop (void *cls, | |||
2416 | } | 2328 | } |
2417 | 2329 | ||
2418 | 2330 | ||
2419 | /** | ||
2420 | * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT message | ||
2421 | * | ||
2422 | * @param cls the client sending the message | ||
2423 | * @param message message from the client | ||
2424 | */ | ||
2425 | static void | 2331 | static void |
2426 | handle_ticket_iteration_next (void *cls, | 2332 | handle_ticket_iteration_next (void *cls, |
2427 | const struct TicketIterationNextMessage *tis_msg) | 2333 | const struct TicketIterationNextMessage *tis_msg) |
@@ -2453,9 +2359,8 @@ handle_ticket_iteration_next (void *cls, | |||
2453 | * Main function that will be run | 2359 | * Main function that will be run |
2454 | * | 2360 | * |
2455 | * @param cls closure | 2361 | * @param cls closure |
2456 | * @param args remaining command-line arguments | 2362 | * @param c the configuration used |
2457 | * @param cfgfile name of the configuration file used (for saving, can be NULL) | 2363 | * @param server the service handle |
2458 | * @param c configuration | ||
2459 | */ | 2364 | */ |
2460 | static void | 2365 | static void |
2461 | run (void *cls, | 2366 | run (void *cls, |
diff --git a/src/identity-provider/identity_provider.h b/src/identity-provider/identity_provider.h index be9fdc6f5..b1fe6e1fd 100644 --- a/src/identity-provider/identity_provider.h +++ b/src/identity-provider/identity_provider.h | |||
@@ -248,7 +248,7 @@ struct TicketIterationStopMessage | |||
248 | struct IssueTicketMessage | 248 | struct IssueTicketMessage |
249 | { | 249 | { |
250 | /** | 250 | /** |
251 | * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE | 251 | * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET |
252 | */ | 252 | */ |
253 | struct GNUNET_MessageHeader header; | 253 | struct GNUNET_MessageHeader header; |
254 | 254 | ||
@@ -281,7 +281,7 @@ struct IssueTicketMessage | |||
281 | struct RevokeTicketMessage | 281 | struct RevokeTicketMessage |
282 | { | 282 | { |
283 | /** | 283 | /** |
284 | * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE | 284 | * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET |
285 | */ | 285 | */ |
286 | struct GNUNET_MessageHeader header; | 286 | struct GNUNET_MessageHeader header; |
287 | 287 | ||
@@ -309,7 +309,7 @@ struct RevokeTicketMessage | |||
309 | struct RevokeTicketResultMessage | 309 | struct RevokeTicketResultMessage |
310 | { | 310 | { |
311 | /** | 311 | /** |
312 | * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE | 312 | * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT |
313 | */ | 313 | */ |
314 | struct GNUNET_MessageHeader header; | 314 | struct GNUNET_MessageHeader header; |
315 | 315 | ||
@@ -348,7 +348,7 @@ struct TicketResultMessage | |||
348 | struct ConsumeTicketMessage | 348 | struct ConsumeTicketMessage |
349 | { | 349 | { |
350 | /** | 350 | /** |
351 | * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE | 351 | * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET |
352 | */ | 352 | */ |
353 | struct GNUNET_MessageHeader header; | 353 | struct GNUNET_MessageHeader header; |
354 | 354 | ||
diff --git a/src/identity-provider/identity_provider_api.c b/src/identity-provider/identity_provider_api.c index 6fc8d228a..d0ece80fe 100644 --- a/src/identity-provider/identity_provider_api.c +++ b/src/identity-provider/identity_provider_api.c | |||
@@ -317,14 +317,13 @@ struct GNUNET_IDENTITY_PROVIDER_Handle | |||
317 | 317 | ||
318 | }; | 318 | }; |
319 | 319 | ||
320 | |||
321 | /** | 320 | /** |
322 | * Try again to connect to the service. | 321 | * Try again to connect to the service. |
323 | * | 322 | * |
324 | * @param cls handle to the service. | 323 | * @param h handle to the identity provider service. |
325 | */ | 324 | */ |
326 | static void | 325 | static void |
327 | reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle); | 326 | reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h); |
328 | 327 | ||
329 | /** | 328 | /** |
330 | * Reconnect | 329 | * Reconnect |
@@ -344,7 +343,7 @@ reconnect_task (void *cls) | |||
344 | /** | 343 | /** |
345 | * Disconnect from service and then reconnect. | 344 | * Disconnect from service and then reconnect. |
346 | * | 345 | * |
347 | * @param handle our handle | 346 | * @param handle our service |
348 | */ | 347 | */ |
349 | static void | 348 | static void |
350 | force_reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle) | 349 | force_reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle) |
@@ -775,7 +774,7 @@ handle_revoke_ticket_result (void *cls, | |||
775 | /** | 774 | /** |
776 | * Try again to connect to the service. | 775 | * Try again to connect to the service. |
777 | * | 776 | * |
778 | * @param cls handle to the identity provider service. | 777 | * @param h handle to the identity provider service. |
779 | */ | 778 | */ |
780 | static void | 779 | static void |
781 | reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h) | 780 | reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h) |
@@ -895,8 +894,7 @@ GNUNET_IDENTITY_PROVIDER_disconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h) | |||
895 | * | 894 | * |
896 | * @param h handle to the identity provider | 895 | * @param h handle to the identity provider |
897 | * @param pkey private key of the identity | 896 | * @param pkey private key of the identity |
898 | * @param name the attribute name | 897 | * @param attr the attribute value |
899 | * @param value the attribute value | ||
900 | * @param cont continuation to call when done | 898 | * @param cont continuation to call when done |
901 | * @param cont_cls closure for @a cont | 899 | * @param cont_cls closure for @a cont |
902 | * @return handle to abort the request | 900 | * @return handle to abort the request |
@@ -1061,7 +1059,7 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_stop (struct GNUNET_IDENTITY_PROVIDER_At | |||
1061 | * @param h the identity provider to use | 1059 | * @param h the identity provider to use |
1062 | * @param iss the issuing identity | 1060 | * @param iss the issuing identity |
1063 | * @param rp the subject of the ticket (the relying party) | 1061 | * @param rp the subject of the ticket (the relying party) |
1064 | * @param attr the attributes that the relying party is given access to | 1062 | * @param attrs the attributes that the relying party is given access to |
1065 | * @param cb the callback | 1063 | * @param cb the callback |
1066 | * @param cb_cls the callback closure | 1064 | * @param cb_cls the callback closure |
1067 | * @return handle to abort the operation | 1065 | * @return handle to abort the operation |
@@ -1108,7 +1106,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h | |||
1108 | * Consumes an issued ticket. The ticket is persisted | 1106 | * Consumes an issued ticket. The ticket is persisted |
1109 | * and used to retrieve identity information from the issuer | 1107 | * and used to retrieve identity information from the issuer |
1110 | * | 1108 | * |
1111 | * @param id the identity provider to use | 1109 | * @param h the identity provider to use |
1112 | * @param identity the identity that is the subject of the issued ticket (the relying party) | 1110 | * @param identity the identity that is the subject of the issued ticket (the relying party) |
1113 | * @param ticket the issued ticket to consume | 1111 | * @param ticket the issued ticket to consume |
1114 | * @param cb the callback to call | 1112 | * @param cb the callback to call |
@@ -1218,7 +1216,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER | |||
1218 | * Lists all tickets that have been issued to remote | 1216 | * Lists all tickets that have been issued to remote |
1219 | * identites (relying parties) | 1217 | * identites (relying parties) |
1220 | * | 1218 | * |
1221 | * @param id the identity provider to use | 1219 | * @param h the identity provider to use |
1222 | * @param identity the issuing identity | 1220 | * @param identity the issuing identity |
1223 | * @param error_cb function to call on error (i.e. disconnect), | 1221 | * @param error_cb function to call on error (i.e. disconnect), |
1224 | * the handle is afterwards invalid | 1222 | * the handle is afterwards invalid |
@@ -1324,7 +1322,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_stop (struct GNUNET_IDENTITY_PROVIDER_ | |||
1324 | * Revoked an issued ticket. The relying party will be unable to retrieve | 1322 | * Revoked an issued ticket. The relying party will be unable to retrieve |
1325 | * updated attributes. | 1323 | * updated attributes. |
1326 | * | 1324 | * |
1327 | * @param id the identity provider to use | 1325 | * @param h the identity provider to use |
1328 | * @param identity the issuing identity | 1326 | * @param identity the issuing identity |
1329 | * @param ticket the ticket to revoke | 1327 | * @param ticket the ticket to revoke |
1330 | * @param cb the callback | 1328 | * @param cb the callback |
diff --git a/src/identity-provider/plugin_gnsrecord_identity_provider.c b/src/identity-provider/plugin_gnsrecord_identity_provider.c index ad5a95dc7..6ed0b0852 100644 --- a/src/identity-provider/plugin_gnsrecord_identity_provider.c +++ b/src/identity-provider/plugin_gnsrecord_identity_provider.c | |||
@@ -19,9 +19,9 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file identity/plugin_gnsrecord_identity.c | 22 | * @file identity-provider/plugin_gnsrecord_identity_provider.c |
23 | * @brief gnsrecord plugin to provide the API for identity records | 23 | * @brief gnsrecord plugin to provide the API for identity records |
24 | * @author Christian Grothoff | 24 | * @author Martin Schanzenbach |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
diff --git a/src/identity-provider/plugin_identity_provider_sqlite.c b/src/identity-provider/plugin_identity_provider_sqlite.c index 594e4788d..0071528b9 100644 --- a/src/identity-provider/plugin_identity_provider_sqlite.c +++ b/src/identity-provider/plugin_identity_provider_sqlite.c | |||
@@ -368,6 +368,7 @@ database_shutdown (struct Plugin *plugin) | |||
368 | * | 368 | * |
369 | * @param cls closure (internal context for the plugin) | 369 | * @param cls closure (internal context for the plugin) |
370 | * @param ticket the ticket to persist | 370 | * @param ticket the ticket to persist |
371 | * @param attrs the attributes associated with the ticket | ||
371 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | 372 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR |
372 | */ | 373 | */ |
373 | static int | 374 | static int |
@@ -581,8 +582,7 @@ get_ticket_and_call_iterator (struct Plugin *plugin, | |||
581 | * Lookup tickets in the datastore. | 582 | * Lookup tickets in the datastore. |
582 | * | 583 | * |
583 | * @param cls closure (internal context for the plugin) | 584 | * @param cls closure (internal context for the plugin) |
584 | * @param zone private key of the zone | 585 | * @param ticket the ticket to retrieve attributes for |
585 | * @param label name of the record in the zone | ||
586 | * @param iter function to call with the result | 586 | * @param iter function to call with the result |
587 | * @param iter_cls closure for @a iter | 587 | * @param iter_cls closure for @a iter |
588 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | 588 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR |
diff --git a/src/identity-provider/plugin_rest_identity_provider.c b/src/identity-provider/plugin_rest_identity_provider.c index c27662a0d..6eb856435 100644 --- a/src/identity-provider/plugin_rest_identity_provider.c +++ b/src/identity-provider/plugin_rest_identity_provider.c | |||
@@ -1103,17 +1103,6 @@ list_ego (void *cls, | |||
1103 | 1103 | ||
1104 | } | 1104 | } |
1105 | 1105 | ||
1106 | /** | ||
1107 | * Function processing the REST call | ||
1108 | * | ||
1109 | * @param method HTTP method | ||
1110 | * @param url URL of the HTTP request | ||
1111 | * @param data body of the HTTP request (optional) | ||
1112 | * @param data_size length of the body | ||
1113 | * @param proc callback function for the result | ||
1114 | * @param proc_cls closure for callback function | ||
1115 | * @return GNUNET_OK if request accepted | ||
1116 | */ | ||
1117 | static void | 1106 | static void |
1118 | rest_identity_process_request(struct GNUNET_REST_RequestHandle *rest_handle, | 1107 | rest_identity_process_request(struct GNUNET_REST_RequestHandle *rest_handle, |
1119 | GNUNET_REST_ResultProcessor proc, | 1108 | GNUNET_REST_ResultProcessor proc, |
diff --git a/src/include/gnunet_abe_lib.h b/src/include/gnunet_abe_lib.h index 77b0f9e99..f73ea2431 100644 --- a/src/include/gnunet_abe_lib.h +++ b/src/include/gnunet_abe_lib.h | |||
@@ -19,8 +19,8 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file include/gnunet_crypto_lib.h | 22 | * @file include/gnunet_abe_lib.h |
23 | * @brief cryptographic primitives for GNUnet | 23 | * @brief Attribute-Based Encryption primitives for GNUnet |
24 | * | 24 | * |
25 | * @author Martin Schanzenbach | 25 | * @author Martin Schanzenbach |
26 | * | 26 | * |
@@ -57,10 +57,18 @@ struct GNUNET_CRYPTO_AbeKey; | |||
57 | * @ingroup abe | 57 | * @ingroup abe |
58 | * Create a new CP-ABE master key. Caller must free return value. | 58 | * Create a new CP-ABE master key. Caller must free return value. |
59 | * | 59 | * |
60 | * @return fresh private key; free using #GNUNET_free | 60 | * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_master_key |
61 | */ | 61 | */ |
62 | struct GNUNET_ABE_AbeMasterKey * | 62 | struct GNUNET_ABE_AbeMasterKey * |
63 | GNUNET_ABE_cpabe_create_master_key (void); | 63 | GNUNET_ABE_cpabe_create_master_key (void); |
64 | |||
65 | /** | ||
66 | * @ingroup abe | ||
67 | * Delete a CP-ABE master key. | ||
68 | * | ||
69 | * @param key the master key | ||
70 | * @return fresh private key; free using #GNUNET_free | ||
71 | */ | ||
64 | void | 72 | void |
65 | GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key); | 73 | GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key); |
66 | 74 | ||
@@ -68,11 +76,22 @@ GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key); | |||
68 | * @ingroup abe | 76 | * @ingroup abe |
69 | * Create a new CP-ABE key. Caller must free return value. | 77 | * Create a new CP-ABE key. Caller must free return value. |
70 | * | 78 | * |
71 | * @return fresh private key; free using #GNUNET_free | 79 | * @param key the master key |
80 | * @param attrs the attributes to append to the key | ||
81 | * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_key | ||
72 | */ | 82 | */ |
73 | struct GNUNET_ABE_AbeKey * | 83 | struct GNUNET_ABE_AbeKey * |
74 | GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *msk, | 84 | GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key, |
75 | char **attrs); | 85 | char **attrs); |
86 | |||
87 | /** | ||
88 | * @ingroup abe | ||
89 | * Delete a CP-ABE key. | ||
90 | * | ||
91 | * @param key the key to delete | ||
92 | * @param delete_pub GNUNE_YES if the public key should also be freed (bug in gabe) | ||
93 | * @return fresh private key; free using #GNUNET_free | ||
94 | */ | ||
76 | void | 95 | void |
77 | GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, | 96 | GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, |
78 | int delete_pub); | 97 | int delete_pub); |
@@ -84,9 +103,9 @@ GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, | |||
84 | * | 103 | * |
85 | * @param block the block to encrypt | 104 | * @param block the block to encrypt |
86 | * @param size the size of the @a block | 105 | * @param size the size of the @a block |
87 | * @param sessionkey the key used to encrypt | 106 | * @param policy the ABE policy |
88 | * @param iv the initialization vector to use, use INITVALUE | 107 | * @param key the key used to encrypt |
89 | * for streams. | 108 | * @param result the result buffer. Will be allocated. Free using #GNUNET_free |
90 | * @return the size of the encrypted block, -1 for errors | 109 | * @return the size of the encrypted block, -1 for errors |
91 | */ | 110 | */ |
92 | ssize_t | 111 | ssize_t |
@@ -98,13 +117,12 @@ GNUNET_ABE_cpabe_encrypt (const void *block, | |||
98 | 117 | ||
99 | /** | 118 | /** |
100 | * @ingroup abe | 119 | * @ingroup abe |
101 | * Encrypt a block using sessionkey. | 120 | * Decrypt a block using the ABE key. |
102 | * | 121 | * |
103 | * @param block the block to encrypt | 122 | * @param block the block to encrypt |
104 | * @param size the size of the @a block | 123 | * @param size the size of the @a block |
105 | * @param sessionkey the key used to encrypt | 124 | * @param key the key used to decrypt |
106 | * @param iv the initialization vector to use, use INITVALUE | 125 | * @param result the result buffer. Will be allocated. Free using #GNUNET_free |
107 | * for streams. | ||
108 | * @return the size of the encrypted block, -1 for errors | 126 | * @return the size of the encrypted block, -1 for errors |
109 | */ | 127 | */ |
110 | ssize_t | 128 | ssize_t |
@@ -113,18 +131,50 @@ GNUNET_ABE_cpabe_decrypt (const void *block, | |||
113 | const struct GNUNET_ABE_AbeKey *key, | 131 | const struct GNUNET_ABE_AbeKey *key, |
114 | void **result); | 132 | void **result); |
115 | 133 | ||
134 | /** | ||
135 | * @ingroup abe | ||
136 | * Serialize an ABE key. | ||
137 | * | ||
138 | * @param key the key to serialize | ||
139 | * @param result the result buffer. Will be allocated. Free using #GNUNET_free | ||
140 | * @return the size of the encrypted block, -1 for errors | ||
141 | */ | ||
116 | ssize_t | 142 | ssize_t |
117 | GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, | 143 | GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, |
118 | void **result); | 144 | void **result); |
119 | 145 | ||
146 | /** | ||
147 | * @ingroup abe | ||
148 | * Deserialize a serialized ABE key. | ||
149 | * | ||
150 | * @param data the data to deserialize | ||
151 | * @param len the length of the data. | ||
152 | * @return the ABE key. NULL of unsuccessful | ||
153 | */ | ||
120 | struct GNUNET_ABE_AbeKey* | 154 | struct GNUNET_ABE_AbeKey* |
121 | GNUNET_ABE_cpabe_deserialize_key (const void *data, | 155 | GNUNET_ABE_cpabe_deserialize_key (const void *data, |
122 | size_t len); | 156 | size_t len); |
123 | 157 | ||
158 | /** | ||
159 | * @ingroup abe | ||
160 | * Serialize an ABE master key. | ||
161 | * | ||
162 | * @param key the key to serialize | ||
163 | * @param result the result buffer. Will be allocated. Free using #GNUNET_free | ||
164 | * @return the size of the encrypted block, -1 for errors | ||
165 | */ | ||
124 | ssize_t | 166 | ssize_t |
125 | GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key, | 167 | GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key, |
126 | void **result); | 168 | void **result); |
127 | 169 | ||
170 | /** | ||
171 | * @ingroup abe | ||
172 | * Deserialize an ABE master key. | ||
173 | * | ||
174 | * @param data the data to deserialize | ||
175 | * @param len the length of the data. | ||
176 | * @return the ABE key. NULL of unsuccessful | ||
177 | */ | ||
128 | struct GNUNET_ABE_AbeMasterKey* | 178 | struct GNUNET_ABE_AbeMasterKey* |
129 | GNUNET_ABE_cpabe_deserialize_master_key (const void *data, | 179 | GNUNET_ABE_cpabe_deserialize_master_key (const void *data, |
130 | size_t len); | 180 | size_t len); |
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_credential_service.h index 67c2f2b4c..7d6f9e973 100644 --- a/src/include/gnunet_credential_service.h +++ b/src/include/gnunet_credential_service.h | |||
@@ -20,7 +20,6 @@ | |||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @author Martin Schanzenbach | 22 | * @author Martin Schanzenbach |
23 | * @author Adnan Husain | ||
24 | * | 23 | * |
25 | * @file | 24 | * @file |
26 | * API to the Credential service | 25 | * API to the Credential service |
@@ -274,7 +273,8 @@ typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls, | |||
274 | * @param issuer_key the issuer public key | 273 | * @param issuer_key the issuer public key |
275 | * @param issuer_attribute the issuer attribute | 274 | * @param issuer_attribute the issuer attribute |
276 | * @param subject_key the subject public key | 275 | * @param subject_key the subject public key |
277 | * @param subject_attribute the attribute claimed by the subject | 276 | * @param credential_count number of credentials |
277 | * @param credentials the subject credentials | ||
278 | * @param proc function to call on result | 278 | * @param proc function to call on result |
279 | * @param proc_cls closure for processor | 279 | * @param proc_cls closure for processor |
280 | * @return handle to the queued request | 280 | * @return handle to the queued request |
@@ -305,6 +305,8 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, | |||
305 | * @param attribute the name of the attribute to delegate | 305 | * @param attribute the name of the attribute to delegate |
306 | * @param subject the subject of the delegation | 306 | * @param subject the subject of the delegation |
307 | * @param delegated_attribute the name of the attribute that is delegated to | 307 | * @param delegated_attribute the name of the attribute that is delegated to |
308 | * @param proc the result callback | ||
309 | * @param proc_cls the result closure context | ||
308 | * @return handle to the queued request | 310 | * @return handle to the queued request |
309 | */ | 311 | */ |
310 | struct GNUNET_CREDENTIAL_Request * | 312 | struct GNUNET_CREDENTIAL_Request * |
@@ -322,6 +324,8 @@ GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | |||
322 | * @param handle handle to the Credential service | 324 | * @param handle handle to the Credential service |
323 | * @param issuer the ego that was used to delegate the attribute | 325 | * @param issuer the ego that was used to delegate the attribute |
324 | * @param attribute the name of the attribute that is delegated | 326 | * @param attribute the name of the attribute that is delegated |
327 | * @param proc the callback | ||
328 | * @param proc_cls callback closure | ||
325 | * @return handle to the queued request | 329 | * @return handle to the queued request |
326 | */ | 330 | */ |
327 | struct GNUNET_CREDENTIAL_Request * | 331 | struct GNUNET_CREDENTIAL_Request * |
@@ -336,7 +340,6 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | |||
336 | /** | 340 | /** |
337 | * Issue an attribute to a subject | 341 | * Issue an attribute to a subject |
338 | * | 342 | * |
339 | * @param handle handle to the Credential service | ||
340 | * @param issuer the ego that should be used to issue the attribute | 343 | * @param issuer the ego that should be used to issue the attribute |
341 | * @param subject the subject of the attribute | 344 | * @param subject the subject of the attribute |
342 | * @param attribute the name of the attribute | 345 | * @param attribute the name of the attribute |
@@ -344,32 +347,12 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, | |||
344 | * @return handle to the queued request | 347 | * @return handle to the queued request |
345 | */ | 348 | */ |
346 | struct GNUNET_CREDENTIAL_Credential* | 349 | struct GNUNET_CREDENTIAL_Credential* |
347 | GNUNET_CREDENTIAL_credential_issue ( | 350 | GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, |
348 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | ||
349 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, | 351 | struct GNUNET_CRYPTO_EcdsaPublicKey *subject, |
350 | const char *attribute, | 352 | const char *attribute, |
351 | struct GNUNET_TIME_Absolute *expiration); | 353 | struct GNUNET_TIME_Absolute *expiration); |
352 | 354 | ||
353 | 355 | ||
354 | /** | ||
355 | * Remove a credential | ||
356 | * | ||
357 | * @param handle handle to the Credential service | ||
358 | * @param issuer the identity that issued the credential | ||
359 | * @param subject the subject of the credential | ||
360 | * @param credential the name of the credential | ||
361 | * @return handle to the queued request | ||
362 | */ | ||
363 | /** | ||
364 | struct GNUNET_CREDENTIAL_IssueRequest * | ||
365 | GNUNET_CREDENTIAL_remove (struct GNUNET_CREDENTIAL_Handle *handle, | ||
366 | struct GNUNET_IDENTITY_Ego *issuer, | ||
367 | struct GNUNET_IDENTITY_Ego *subject, | ||
368 | const char *credential, | ||
369 | GNUNET_CREDENTIAL_IssueResultProcessor proc, | ||
370 | void *proc_cls); | ||
371 | */ | ||
372 | |||
373 | 356 | ||
374 | /** | 357 | /** |
375 | * Cancel pending lookup request | 358 | * Cancel pending lookup request |
@@ -377,7 +360,7 @@ GNUNET_CREDENTIAL_credential_issue ( | |||
377 | * @param lr the lookup request to cancel | 360 | * @param lr the lookup request to cancel |
378 | */ | 361 | */ |
379 | void | 362 | void |
380 | GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *vr); | 363 | GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr); |
381 | 364 | ||
382 | 365 | ||
383 | #if 0 /* keep Emacsens' auto-indent happy */ | 366 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_identity_attribute_lib.h b/src/include/gnunet_identity_attribute_lib.h index a6c9e1f1c..316b0bf95 100644 --- a/src/include/gnunet_identity_attribute_lib.h +++ b/src/include/gnunet_identity_attribute_lib.h | |||
@@ -122,7 +122,7 @@ struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry | |||
122 | /** | 122 | /** |
123 | * Create a new attribute claim. | 123 | * Create a new attribute claim. |
124 | * | 124 | * |
125 | * @param name the attribute name | 125 | * @param attr_name the attribute name |
126 | * @param type the attribute type | 126 | * @param type the attribute type |
127 | * @param data the attribute value | 127 | * @param data the attribute value |
128 | * @param data_size the attribute value size | 128 | * @param data_size the attribute value size |
diff --git a/src/include/gnunet_identity_provider_service.h b/src/include/gnunet_identity_provider_service.h index 6bc05d0f4..be935e898 100644 --- a/src/include/gnunet_identity_provider_service.h +++ b/src/include/gnunet_identity_provider_service.h | |||
@@ -131,6 +131,7 @@ GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle | |||
131 | * Process an attribute that was stored in the idp. | 131 | * Process an attribute that was stored in the idp. |
132 | * | 132 | * |
133 | * @param cls closure | 133 | * @param cls closure |
134 | * @param identity the identity | ||
134 | * @param attr the attribute | 135 | * @param attr the attribute |
135 | */ | 136 | */ |
136 | typedef void | 137 | typedef void |
@@ -211,19 +212,19 @@ typedef void | |||
211 | 212 | ||
212 | /** | 213 | /** |
213 | * Issues a ticket to another identity. The identity may use | 214 | * Issues a ticket to another identity. The identity may use |
214 | * @GNUNET_IDENTITY_PROVIDER_authorization_ticket_consume to consume the ticket | 215 | * GNUNET_IDENTITY_PROVIDER_ticket_consume to consume the ticket |
215 | * and retrieve the attributes specified in the AttributeList. | 216 | * and retrieve the attributes specified in the AttributeList. |
216 | * | 217 | * |
217 | * @param id the identity provider to use | 218 | * @param h the identity provider to use |
218 | * @param iss the issuing identity | 219 | * @param iss the issuing identity |
219 | * @param rp the subject of the ticket (the relying party) | 220 | * @param rp the subject of the ticket (the relying party) |
220 | * @param attr the attributes that the relying party is given access to | 221 | * @param attrs the attributes that the relying party is given access to |
221 | * @param cb the callback | 222 | * @param cb the callback |
222 | * @param cb_cls the callback closure | 223 | * @param cb_cls the callback closure |
223 | * @return handle to abort the operation | 224 | * @return handle to abort the operation |
224 | */ | 225 | */ |
225 | struct GNUNET_IDENTITY_PROVIDER_Operation * | 226 | struct GNUNET_IDENTITY_PROVIDER_Operation * |
226 | GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *id, | 227 | GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h, |
227 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, | 228 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, |
228 | const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, | 229 | const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, |
229 | const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, | 230 | const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, |
@@ -234,7 +235,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *i | |||
234 | * Revoked an issued ticket. The relying party will be unable to retrieve | 235 | * Revoked an issued ticket. The relying party will be unable to retrieve |
235 | * updated attributes. | 236 | * updated attributes. |
236 | * | 237 | * |
237 | * @param id the identity provider to use | 238 | * @param h the identity provider to use |
238 | * @param identity the issuing identity | 239 | * @param identity the issuing identity |
239 | * @param ticket the ticket to revoke | 240 | * @param ticket the ticket to revoke |
240 | * @param cb the callback | 241 | * @param cb the callback |
@@ -242,7 +243,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *i | |||
242 | * @return handle to abort the operation | 243 | * @return handle to abort the operation |
243 | */ | 244 | */ |
244 | struct GNUNET_IDENTITY_PROVIDER_Operation * | 245 | struct GNUNET_IDENTITY_PROVIDER_Operation * |
245 | GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *id, | 246 | GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *h, |
246 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | 247 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, |
247 | const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, | 248 | const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, |
248 | GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cb, | 249 | GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cb, |
@@ -254,7 +255,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle * | |||
254 | * Consumes an issued ticket. The ticket is persisted | 255 | * Consumes an issued ticket. The ticket is persisted |
255 | * and used to retrieve identity information from the issuer | 256 | * and used to retrieve identity information from the issuer |
256 | * | 257 | * |
257 | * @param id the identity provider to use | 258 | * @param h the identity provider to use |
258 | * @param identity the identity that is the subject of the issued ticket (the audience) | 259 | * @param identity the identity that is the subject of the issued ticket (the audience) |
259 | * @param ticket the issued ticket to consume | 260 | * @param ticket the issued ticket to consume |
260 | * @param cb the callback to call | 261 | * @param cb the callback to call |
@@ -262,7 +263,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle * | |||
262 | * @return handle to abort the operation | 263 | * @return handle to abort the operation |
263 | */ | 264 | */ |
264 | struct GNUNET_IDENTITY_PROVIDER_Operation * | 265 | struct GNUNET_IDENTITY_PROVIDER_Operation * |
265 | GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *id, | 266 | GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *h, |
266 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, | 267 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, |
267 | const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, | 268 | const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, |
268 | GNUNET_IDENTITY_PROVIDER_AttributeResult cb, | 269 | GNUNET_IDENTITY_PROVIDER_AttributeResult cb, |
@@ -299,7 +300,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER | |||
299 | * Lists all tickets that have been issued to remote | 300 | * Lists all tickets that have been issued to remote |
300 | * identites (relying parties) | 301 | * identites (relying parties) |
301 | * | 302 | * |
302 | * @param id the identity provider to use | 303 | * @param h the identity provider to use |
303 | * @param identity the issuing identity | 304 | * @param identity the issuing identity |
304 | * @param error_cb function to call on error (i.e. disconnect), | 305 | * @param error_cb function to call on error (i.e. disconnect), |
305 | * the handle is afterwards invalid | 306 | * the handle is afterwards invalid |
diff --git a/src/include/gnunet_rest_lib.h b/src/include/gnunet_rest_lib.h index a4dbb0696..e571eead3 100644 --- a/src/include/gnunet_rest_lib.h +++ b/src/include/gnunet_rest_lib.h | |||
@@ -89,7 +89,7 @@ typedef void (*GNUNET_REST_ResultProcessor) (void *cls, | |||
89 | * | 89 | * |
90 | * @param url URL to check | 90 | * @param url URL to check |
91 | * @param namespace namespace to check against | 91 | * @param namespace namespace to check against |
92 | * @retun GNUNET_YES if namespace matches | 92 | * @return GNUNET_YES if namespace matches |
93 | */ | 93 | */ |
94 | int | 94 | int |
95 | GNUNET_REST_namespace_match (const char *url, const char *namespace); | 95 | GNUNET_REST_namespace_match (const char *url, const char *namespace); |
@@ -98,7 +98,7 @@ GNUNET_REST_namespace_match (const char *url, const char *namespace); | |||
98 | * Create REST MHD response | 98 | * Create REST MHD response |
99 | * | 99 | * |
100 | * @param data result | 100 | * @param data result |
101 | * @retun MHD response | 101 | * @return MHD response |
102 | */ | 102 | */ |
103 | struct MHD_Response* | 103 | struct MHD_Response* |
104 | GNUNET_REST_create_response (const char *data); | 104 | GNUNET_REST_create_response (const char *data); |
diff --git a/src/include/gnunet_rest_plugin.h b/src/include/gnunet_rest_plugin.h index ecd5f66f1..424dbb1fc 100644 --- a/src/include/gnunet_rest_plugin.h +++ b/src/include/gnunet_rest_plugin.h | |||
@@ -57,7 +57,7 @@ struct GNUNET_REST_Plugin | |||
57 | 57 | ||
58 | /** | 58 | /** |
59 | * Plugin name. Used as the namespace for the API. | 59 | * Plugin name. Used as the namespace for the API. |
60 | * e.g. http://hostname:port/<name> | 60 | * e.g. http://hostname:port/name |
61 | */ | 61 | */ |
62 | char *name; | 62 | char *name; |
63 | 63 | ||