diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-01-04 15:28:02 +0100 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-01-04 15:29:45 +0100 |
commit | 78705d5a49d7066a01b832546d2507456a3c5d2c (patch) | |
tree | b0e5f72bdde4574f20c0b89ee56295f83b954800 /src/credential | |
parent | 272921672ec094644a1ddbbfacb96581e72ed443 (diff) | |
download | gnunet-78705d5a49d7066a01b832546d2507456a3c5d2c.tar.gz gnunet-78705d5a49d7066a01b832546d2507456a3c5d2c.zip |
-cleanup doc; fixes
Diffstat (limited to 'src/credential')
-rw-r--r-- | src/credential/credential.h | 2 | ||||
-rw-r--r-- | src/credential/credential_api.c | 18 | ||||
-rw-r--r-- | src/credential/credential_misc.c | 3 | ||||
-rw-r--r-- | src/credential/credential_serialization.c | 13 | ||||
-rw-r--r-- | src/credential/gnunet-credential.c | 16 | ||||
-rw-r--r-- | src/credential/gnunet-service-credential.c | 116 | ||||
-rw-r--r-- | src/credential/plugin_gnsrecord_credential.c | 2 | ||||
-rw-r--r-- | src/credential/plugin_rest_credential.c | 43 |
8 files changed, 41 insertions, 172 deletions
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, |