From 78705d5a49d7066a01b832546d2507456a3c5d2c Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Thu, 4 Jan 2018 15:28:02 +0100 Subject: [PATCH] -cleanup doc; fixes --- src/abe/abe.c | 94 ++++++++++- src/credential/credential.h | 2 +- src/credential/credential_api.c | 18 +-- src/credential/credential_misc.c | 3 +- src/credential/credential_serialization.c | 13 +- src/credential/gnunet-credential.c | 16 +- src/credential/gnunet-service-credential.c | 116 +++----------- src/credential/plugin_gnsrecord_credential.c | 2 +- src/credential/plugin_rest_credential.c | 43 +---- src/identity-attribute/identity_attribute.c | 8 +- src/identity-attribute/identity_attribute.h | 4 +- .../plugin_identity_attribute_gnuid.c | 2 +- .../gnunet-service-identity-provider.c | 147 ++++-------------- src/identity-provider/identity_provider.h | 8 +- src/identity-provider/identity_provider_api.c | 20 ++- .../plugin_gnsrecord_identity_provider.c | 4 +- .../plugin_identity_provider_sqlite.c | 4 +- .../plugin_rest_identity_provider.c | 11 -- src/include/gnunet_abe_lib.h | 74 +++++++-- src/include/gnunet_credential_service.h | 33 +--- src/include/gnunet_identity_attribute_lib.h | 2 +- .../gnunet_identity_provider_service.h | 19 +-- src/include/gnunet_rest_lib.h | 4 +- src/include/gnunet_rest_plugin.h | 2 +- 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 @@ /* - This file is part of GNUnet. Copyright (C) 2001-2014 Christian Grothoff + This file is part of GNUnet. Copyright (C) 2001-2018 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify @@ -20,9 +20,9 @@ */ /** - * @file util/crypto_random.c - * @brief functions to gather random numbers - * @author Christian Grothoff + * @file abe/abe.c + * @brief functions for Attribute-Based Encryption + * @author Martin Schanzenbach */ @@ -146,6 +146,12 @@ aes_128_cbc_decrypt( char* ct, return len; } +/** + * @ingroup abe + * Create a new CP-ABE master key. Caller must free return value. + * + * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_master_key + */ struct GNUNET_ABE_AbeMasterKey* GNUNET_ABE_cpabe_create_master_key (void) { @@ -157,6 +163,13 @@ GNUNET_ABE_cpabe_create_master_key (void) return key; } +/** + * @ingroup abe + * Delete a CP-ABE master key. + * + * @param key the master key + * @return fresh private key; free using #GNUNET_free + */ void GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key) { @@ -167,6 +180,14 @@ GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key) GNUNET_free (key); } +/** + * @ingroup abe + * Create a new CP-ABE key. Caller must free return value. + * + * @param key the master key + * @param attrs the attributes to append to the key + * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_key + */ struct GNUNET_ABE_AbeKey* GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key, char **attrs) @@ -184,6 +205,14 @@ GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key, return prv_key; } +/** + * @ingroup abe + * Delete a CP-ABE key. + * + * @param key the key to delete + * @param delete_pub GNUNE_YES if the public key should also be freed (bug in gabe) + * @return fresh private key; free using #GNUNET_free + */ void GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, int delete_pub) @@ -195,7 +224,7 @@ GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, GNUNET_free (key); } -ssize_t +static ssize_t write_cpabe (void **result, uint32_t file_len, char* cph_buf, @@ -223,7 +252,7 @@ write_cpabe (void **result, return 12 + cph_buf_len + aes_buf_len; } -ssize_t +static ssize_t read_cpabe (const void *data, char** cph_buf, int *cph_buf_len, @@ -253,6 +282,17 @@ read_cpabe (const void *data, return buf_len; } +/** + * @ingroup abe + * Encrypt a block using sessionkey. + * + * @param block the block to encrypt + * @param size the size of the @a block + * @param policy the ABE policy + * @param key the key used to encrypt + * @param result the result buffer. Will be allocated. Free using #GNUNET_free + * @return the size of the encrypted block, -1 for errors + */ ssize_t GNUNET_ABE_cpabe_encrypt (const void *block, size_t size, @@ -285,6 +325,16 @@ GNUNET_ABE_cpabe_encrypt (const void *block, return result_len; } +/** + * @ingroup abe + * Decrypt a block using the ABE key. + * + * @param block the block to encrypt + * @param size the size of the @a block + * @param key the key used to decrypt + * @param result the result buffer. Will be allocated. Free using #GNUNET_free + * @return the size of the encrypted block, -1 for errors + */ ssize_t GNUNET_ABE_cpabe_decrypt (const void *block, size_t size, @@ -323,6 +373,14 @@ GNUNET_ABE_cpabe_decrypt (const void *block, return plt_len; } +/** + * @ingroup abe + * Serialize an ABE key. + * + * @param key the key to serialize + * @param result the result buffer. Will be allocated. Free using #GNUNET_free + * @return the size of the encrypted block, -1 for errors + */ ssize_t GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, void **result) @@ -345,6 +403,14 @@ GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, return len; } +/** + * @ingroup abe + * Deserialize a serialized ABE key. + * + * @param data the data to deserialize + * @param len the length of the data. + * @return the ABE key. NULL of unsuccessful + */ struct GNUNET_ABE_AbeKey* GNUNET_ABE_cpabe_deserialize_key (const void *data, size_t len) @@ -369,6 +435,14 @@ GNUNET_ABE_cpabe_deserialize_key (const void *data, return key; } +/** + * @ingroup abe + * Serialize an ABE master key. + * + * @param key the key to serialize + * @param result the result buffer. Will be allocated. Free using #GNUNET_free + * @return the size of the encrypted block, -1 for errors + */ ssize_t GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key, void **result) @@ -391,6 +465,14 @@ GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key return len; } +/** + * @ingroup abe + * Deserialize an ABE master key. + * + * @param data the data to deserialize + * @param len the length of the data. + * @return the ABE key. NULL of unsuccessful + */ struct GNUNET_ABE_AbeMasterKey* GNUNET_ABE_cpabe_deserialize_master_key (const void *data, 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 @@ /** * @file credential/credential.h * @brief IPC messages between CREDENTIAL API and CREDENTIAL service - * @author Adnan Husain + * @author Martin Schanzenbach */ #ifndef CREDENTIAL_H #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 @@ /** * @file credential/credential_api.c * @brief library to access the CREDENTIAL service - * @author Adnan Husain + * @author Martin Schanzenbach */ #include "platform.h" #include "gnunet_util_lib.h" @@ -189,7 +189,7 @@ mq_error_handler (void *cls, * Check validity of message received from the CREDENTIAL service * * @param cls the `struct GNUNET_CREDENTIAL_Handle *` - * @param loookup_msg the incoming message + * @param vr_msg the incoming message */ static int check_result (void *cls, @@ -204,7 +204,7 @@ check_result (void *cls, * Handler for messages received from the CREDENTIAL service * * @param cls the `struct GNUNET_CREDENTIAL_Handle *` - * @param loookup_msg the incoming message + * @param vr_msg the incoming message */ static void handle_result (void *cls, @@ -348,15 +348,15 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle) * @param lr the verify request to cancel */ void -GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *vr) +GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr) { - struct GNUNET_CREDENTIAL_Handle *handle = vr->credential_handle; + struct GNUNET_CREDENTIAL_Handle *handle = lr->credential_handle; GNUNET_CONTAINER_DLL_remove (handle->request_head, handle->request_tail, - vr); - GNUNET_MQ_discard (vr->env); - GNUNET_free (vr); + lr); + GNUNET_MQ_discard (lr->env); + GNUNET_free (lr); } @@ -369,8 +369,6 @@ GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *vr) * @param issuer_key the issuer public key * @param issuer_attribute the issuer attribute * @param subject_key the subject public key - * @param credential_count number of credentials provided - * @param credentials subject credentials * @param proc function to call on result * @param proc_cls closure for processor * @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 @@ /** - * @file credential/credential_mic.c + * @file credential/credential_misc.c * @brief Misc API for credentials * * @author Martin Schanzenbach @@ -113,7 +113,6 @@ GNUNET_CREDENTIAL_credential_from_string (const char* s) /** * Issue an attribute to a subject * - * @param handle handle to the Credential service * @param issuer the ego that should be used to issue the attribute * @param subject the subject of the attribute * @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 @@ /** * Calculate how many bytes we will need to serialize - * the given delegation chain and credential + * the given delegation chain * - * @param d_count number of delegation chain entries - * @param dd array of #GNUNET_CREDENTIAL_Delegation - * @param cd a #GNUNET_CREDENTIAL_Credential + * @param ds_count number of delegation chain entries + * @param dsr array of #GNUNET_CREDENTIAL_DelegationSet * @return the required size to serialize */ size_t @@ -62,8 +61,7 @@ GNUNET_CREDENTIAL_delegation_set_get_size (unsigned int ds_count, * Serizalize the given delegation chain entries and credential * * @param d_count number of delegation chain entries - * @param dd array of #GNUNET_CREDENTIAL_Delegation - * @param cd a #GNUNET_CREDENTIAL_Credential + * @param dsr array of #GNUNET_CREDENTIAL_DelegationSet * @param dest_size size of the destination * @param dest where to store the result * @return the size of the data, -1 on failure @@ -108,8 +106,7 @@ GNUNET_CREDENTIAL_delegation_set_serialize (unsigned int d_count, * @param len size of the serialized delegation chain and cred * @param src the serialized data * @param d_count the number of delegation chain entries - * @param dd where to put the delegation chain entries - * @param cd where to put the credential data + * @param dsr where to put the delegation chain entries * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ 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 @@ /** * @file gnunet-credential.c * @brief command line tool to access command line Credential service - * @author Adnan Husain + * @author Martin Schanzenbach */ #include "platform.h" #include @@ -158,13 +158,6 @@ do_timeout (void *cls) GNUNET_SCHEDULER_shutdown (); } -/** - * Function called with the result of a Credential lookup. - * - * @param cls the 'const char *' name that was resolved - * @param cd_count number of records returned - * @param cd array of @a cd_count records with the results - */ static void handle_collect_result (void *cls, unsigned int d_count, @@ -192,13 +185,6 @@ handle_collect_result (void *cls, } -/** - * Function called with the result of a Credential lookup. - * - * @param cls the 'const char *' name that was resolved - * @param cd_count number of records returned - * @param cd array of @a cd_count records with the results - */ static void handle_verify_result (void *cls, 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 @@ Boston, MA 02110-1301, USA. */ /** - * @file gns/gnunet-service-credential.c - * @brief GNU Credential Service (main service) - * @author Adnan Husain + * @file credential/gnunet-service-credential.c + * @brief GNUnet Credential Service (main service) + * @author Martin Schanzenbach */ #include "platform.h" #include "gnunet_util_lib.h" @@ -377,16 +377,11 @@ cleanup_delegation_set (struct DelegationSetQueueEntry *ds_entry) } GNUNET_free (dq_entry); } - if (NULL != ds_entry->issuer_key) - GNUNET_free (ds_entry->issuer_key); - if (NULL != ds_entry->lookup_attribute) - GNUNET_free (ds_entry->lookup_attribute); - if (NULL != ds_entry->issuer_attribute) - GNUNET_free (ds_entry->issuer_attribute); - if (NULL != ds_entry->unresolved_attribute_delegation) - GNUNET_free (ds_entry->unresolved_attribute_delegation); - if (NULL != ds_entry->attr_trailer) - GNUNET_free (ds_entry->attr_trailer); + GNUNET_free_non_null (ds_entry->issuer_key); + GNUNET_free_non_null (ds_entry->lookup_attribute); + GNUNET_free_non_null (ds_entry->issuer_attribute); + GNUNET_free_non_null (ds_entry->unresolved_attribute_delegation); + GNUNET_free_non_null (ds_entry->attr_trailer); if (NULL != ds_entry->lookup_request) { GNUNET_GNS_lookup_cancel (ds_entry->lookup_request); @@ -394,10 +389,8 @@ cleanup_delegation_set (struct DelegationSetQueueEntry *ds_entry) } if (NULL != ds_entry->delegation_chain_entry) { - if (NULL != ds_entry->delegation_chain_entry->subject_attribute) - GNUNET_free (ds_entry->delegation_chain_entry->subject_attribute); - if (NULL != ds_entry->delegation_chain_entry->issuer_attribute) - GNUNET_free (ds_entry->delegation_chain_entry->issuer_attribute); + GNUNET_free_non_null (ds_entry->delegation_chain_entry->subject_attribute); + GNUNET_free_non_null (ds_entry->delegation_chain_entry->issuer_attribute); GNUNET_free (ds_entry->delegation_chain_entry); } GNUNET_free (ds_entry); @@ -415,8 +408,7 @@ cleanup_handle (struct VerifyRequestHandle *vrh) vrh->lookup_request = NULL; } cleanup_delegation_set (vrh->root_set); - if (NULL != vrh->issuer_attribute) - GNUNET_free (vrh->issuer_attribute); + GNUNET_free_non_null (vrh->issuer_attribute); for (cr_entry = vrh->cred_chain_head; NULL != vrh->cred_chain_head; cr_entry = vrh->cred_chain_head) @@ -424,19 +416,12 @@ cleanup_handle (struct VerifyRequestHandle *vrh) GNUNET_CONTAINER_DLL_remove (vrh->cred_chain_head, vrh->cred_chain_tail, cr_entry); - if (NULL != cr_entry->credential); - GNUNET_free (cr_entry->credential); + GNUNET_free_non_null (cr_entry->credential); GNUNET_free (cr_entry); } GNUNET_free (vrh); } -/** - * Task run during shutdown. - * - * @param cls unused - * @param tc unused - */ static void shutdown_task (void *cls) { @@ -475,11 +460,6 @@ shutdown_task (void *cls) -/** - * Send. - * - * @param handle the handle to the request - */ static void send_lookup_response (struct VerifyRequestHandle *vrh) { @@ -491,12 +471,11 @@ send_lookup_response (struct VerifyRequestHandle *vrh) struct CredentialRecordEntry *cd; struct CredentialRecordEntry *tmp; size_t size; - int i; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending response\n"); dce = vrh->delegation_chain_head; - for (i=0;idelegation_chain_size;i++) + for (uint32_t i=0;idelegation_chain_size;i++) { dd[i].issuer_key = dce->issuer_key; dd[i].subject_key = dce->subject_key; @@ -537,7 +516,7 @@ send_lookup_response (struct VerifyRequestHandle *vrh) * Append at the end of rmsg */ cd = vrh->cred_chain_head; - for (i=0;icred_chain_size;i++) + for (uint32_t i=0;icred_chain_size;i++) { cred[i].issuer_key = cd->credential->issuer_key; cred[i].subject_key = cd->credential->subject_key; @@ -598,8 +577,6 @@ backward_resolution (void* cls, struct DelegationQueueEntry *dq_entry; char *expanded_attr; char *lookup_attribute; - int i; - int j; current_set = cls; @@ -610,7 +587,7 @@ backward_resolution (void* cls, "Got %d attrs\n", rd_count); // Each OR - for (i=0; i < rd_count; i++) + for (uint32_t i=0; i < rd_count; i++) { if (GNUNET_GNSRECORD_TYPE_ATTRIBUTE != rd[i].record_type) continue; @@ -637,7 +614,7 @@ backward_resolution (void* cls, current_set->queue_entries_tail, dq_entry); // Each AND - for (j=0; jset_count); j++) + for (uint32_t j=0; jset_count); j++) { ds_entry = GNUNET_new (struct DelegationSetQueueEntry); if (NULL != current_set->attr_trailer) @@ -793,8 +770,6 @@ backward_resolution (void* cls, * Result from GNS lookup. * * @param cls the closure (our client lookup handle) - * @param rd_count the number of records in @a rd - * @param rd the record data */ static void delegation_chain_resolution_start (void* cls) @@ -858,13 +833,6 @@ delegation_chain_resolution_start (void* cls) ds_entry); } -/** - * Checks a #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY message - * - * @param cls client sending the message - * @param v_msg message of type `struct VerifyMessage` - * @return #GNUNET_OK if @a v_msg is well-formed - */ static int check_verify (void *cls, const struct VerifyMessage *v_msg) @@ -893,13 +861,6 @@ check_verify (void *cls, return GNUNET_OK; } -/** - * Handle Credential verification requests from client - * - * @param cls the closure - * @param client the client - * @param message the message - */ static void handle_verify (void *cls, const struct VerifyMessage *v_msg) @@ -909,7 +870,6 @@ handle_verify (void *cls, struct CredentialRecordEntry *cr_entry; uint32_t credentials_count; uint32_t credential_data_size; - int i; char attr[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; char issuer_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; char *attrptr = attr; @@ -958,7 +918,7 @@ handle_verify (void *cls, return; } - for (i=0;icredential = GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_Credential) + credentials[i].issuer_attribute_len); @@ -979,9 +939,6 @@ handle_verify (void *cls, } -/** - * We encountered an error while collecting - */ static void handle_cred_collection_error_cb (void *cls) { @@ -1001,9 +958,6 @@ collect_next (void *cls) GNUNET_NAMESTORE_zone_iterator_next (vrh->cred_collection_iter); } -/** - * Store credential - */ static void handle_cred_collection_cb (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, @@ -1015,10 +969,9 @@ handle_cred_collection_cb (void *cls, struct GNUNET_CREDENTIAL_Credential *crd; struct CredentialRecordEntry *cr_entry; int cred_record_count; - int i; cred_record_count = 0; - for (i=0; i < rd_count; i++) + for (uint32_t i=0; i < rd_count; i++) { if (GNUNET_GNSRECORD_TYPE_CREDENTIAL != rd[i].record_type) continue; @@ -1042,9 +995,6 @@ handle_cred_collection_cb (void *cls, vrh); } -/** - * We encountered an error while collecting - */ static void handle_cred_collection_finished_cb (void *cls) { @@ -1055,13 +1005,6 @@ handle_cred_collection_finished_cb (void *cls) delegation_chain_resolution_start (vrh); } -/** - * Handle Credential collection requests from client - * - * @param cls the closure - * @param client the client - * @param message the message - */ static void handle_collect (void *cls, const struct CollectMessage *c_msg) @@ -1113,13 +1056,6 @@ handle_collect (void *cls, } -/** - * Checks a #GNUNET_MESSAGE_TYPE_CREDENTIAL_COLLECT message - * - * @param cls client sending the message - * @param v_msg message of type `struct CollectMessage` - * @return #GNUNET_OK if @a v_msg is well-formed - */ static int check_collect (void *cls, const struct CollectMessage *c_msg) @@ -1149,12 +1085,6 @@ check_collect (void *cls, return GNUNET_OK; } -/** - * One of our clients disconnected, clean up after it. - * - * @param cls NULL - * @param client the client that disconnected - */ static void client_disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *client, @@ -1165,14 +1095,6 @@ client_disconnect_cb (void *cls, client); } -/** - * Add a client to our list of active clients. - * - * @param cls NULL - * @param client client to add - * @param mq message queue for @a client - * @return this client - */ static void * client_connect_cb (void *cls, struct GNUNET_SERVICE_Client *client, @@ -1188,8 +1110,8 @@ client_connect_cb (void *cls, * Process Credential requests. * * @param cls closure - * @param server the initialized server * @param c configuration to use + * @param handle service handle */ static void 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 @@ /** * @file credential/plugin_gnsrecord_credential.c * @brief gnsrecord plugin to provide the API for CREDENTIAL records - * @author Adnan Husain + * @author Martin Schanzenbach */ #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 @@ */ /** * @author Martin Schanzenbach - * @file gns/plugin_rest_credential.c + * @file credential/plugin_rest_credential.c * @brief GNUnet CREDENTIAL REST plugin * */ @@ -194,12 +194,6 @@ cleanup_handle (struct RequestHandle *handle) } -/** - * Task run on shutdown. Cleans up everything. - * - * @param cls unused - * @param tc scheduler context - */ static void do_error (void *cls) { @@ -213,7 +207,8 @@ do_error (void *cls) /** * Attribute delegation to JSON - * @param attr the attribute + * + * @param delegation_chain_entry the DSE * @return JSON, NULL if failed */ static json_t* @@ -257,6 +252,7 @@ attribute_delegation_to_json (struct GNUNET_CREDENTIAL_Delegation *delegation_ch /** * JSONAPI resource to Credential + * * @param res the JSONAPI resource * @return the resulting credential, NULL if failed */ @@ -327,6 +323,7 @@ json_to_credential (json_t *res) /** * Credential to JSON + * * @param cred the credential * @return the resulting json, NULL if failed */ @@ -373,13 +370,6 @@ credential_to_json (struct GNUNET_CREDENTIAL_Credential *cred) return cred_obj; } -/** - * Function called with the result of a Credential lookup. - * - * @param cls the 'const char *' name that was resolved - * @param cd_count number of records returned - * @param cd array of @a cd_count records with the results - */ static void handle_collect_response (void *cls, unsigned int d_count, @@ -470,13 +460,6 @@ subject_ego_lookup (void *cls, -/** - * Function called with the result of a Credential lookup. - * - * @param cls the 'const char *' name that was resolved - * @param cd_count number of records returned - * @param cd array of @a cd_count records with the results - */ static void handle_verify_response (void *cls, unsigned int d_count, @@ -1062,11 +1045,6 @@ issue_cred_cont (struct GNUNET_REST_RequestHandle *conndata_handle, handle); } -/** - * Handle rest request - * - * @param handle the lookup handle - */ static void options_cont (struct GNUNET_REST_RequestHandle *con_handle, const char* url, @@ -1087,17 +1065,6 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle, } -/** - * Function processing the REST call - * - * @param method HTTP method - * @param url URL of the HTTP request - * @param data body of the HTTP request (optional) - * @param data_size length of the body - * @param proc callback function for the result - * @param proc_cls closure for callback function - * @return GNUNET_OK if request accepted - */ static void rest_credential_process_request(struct GNUNET_REST_RequestHandle *conndata_handle, 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 @@ */ /** - * @file identity-provider/identity_attribute.c + * @file identity-attribute/identity_attribute.c * @brief helper library to manage identity attributes * @author Martin Schanzenbach */ @@ -206,7 +206,7 @@ GNUNET_IDENTITY_ATTRIBUTE_value_to_string (uint32_t type, /** * Create a new attribute. * - * @param name the attribute name + * @param attr_name the attribute name * @param type the attribute type * @param data the attribute value * @param data_size the attribute value size @@ -214,7 +214,7 @@ GNUNET_IDENTITY_ATTRIBUTE_value_to_string (uint32_t type, */ struct GNUNET_IDENTITY_ATTRIBUTE_Claim * GNUNET_IDENTITY_ATTRIBUTE_claim_new (const char* attr_name, - uint32_t attr_type, + uint32_t type, const void* data, size_t data_size) { @@ -224,7 +224,7 @@ GNUNET_IDENTITY_ATTRIBUTE_claim_new (const char* attr_name, attr = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_ATTRIBUTE_Claim) + strlen (attr_name) + 1 + data_size); - attr->type = attr_type; + attr->type = type; attr->data_size = data_size; attr->version = 0; 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 @@ */ /** * @author Martin Schanzenbach - * @file identity-provider/identity_attribute.h - * @brief GNUnet Identity Provider library + * @file identity-attribute/identity_attribute.h + * @brief GNUnet Identity attributes * */ #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 @@ */ /** - * @file identity-provider/plugin_identity_attribute_gnuid.c + * @file identity-attribute/plugin_identity_attribute_gnuid.c * @brief identity attribute plugin to provide the API for fundamental * attribute types. * 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() GNUNET_NAMESTORE_disconnect (ns_handle); if (NULL != stats_handle) GNUNET_STATISTICS_destroy (stats_handle, GNUNET_NO); - if (NULL != token) - GNUNET_free (token); - if (NULL != label) - GNUNET_free (label); + GNUNET_free_non_null (token); + GNUNET_free_non_null (label); } @@ -648,7 +646,6 @@ cleanup() * Shutdown task * * @param cls NULL - * @param tc task context */ static void do_shutdown (void *cls) @@ -732,9 +729,8 @@ bootstrap_abe_result (void *cls, { struct AbeBootstrapHandle *abh = cls; struct GNUNET_ABE_AbeMasterKey *abe_key; - int i; - for (i=0;iattrs) - GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->attrs); - if (NULL != handle->rvk_attrs) - GNUNET_IDENTITY_ATTRIBUTE_list_destroy (handle->rvk_attrs); - if (NULL != handle->abe_key) - GNUNET_ABE_cpabe_delete_master_key (handle->abe_key); - if (NULL != handle->ns_qe) - GNUNET_NAMESTORE_cancel (handle->ns_qe); - if (NULL != handle->ns_it) - GNUNET_NAMESTORE_zone_iteration_stop (handle->ns_it); - GNUNET_free (handle); +cleanup_revoke_ticket_handle (struct TicketRevocationHandle *rh) +{ + if (NULL != rh->attrs) + GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->attrs); + if (NULL != rh->rvk_attrs) + GNUNET_IDENTITY_ATTRIBUTE_list_destroy (rh->rvk_attrs); + if (NULL != rh->abe_key) + GNUNET_ABE_cpabe_delete_master_key (rh->abe_key); + if (NULL != rh->ns_qe) + GNUNET_NAMESTORE_cancel (rh->ns_qe); + if (NULL != rh->ns_it) + GNUNET_NAMESTORE_zone_iteration_stop (rh->ns_it); + GNUNET_free (rh); } /** * Send revocation result + * + * @param rh ticket revocation handle + * @param success GNUNET_OK if successful result */ static void send_revocation_finished (struct TicketRevocationHandle *rh, @@ -1190,7 +1176,7 @@ ticket_reissue_proc (void *cls, char *label; char *policy; int attrs_len; - int i; + uint32_t i; int reissue_ticket; size_t code_record_len; @@ -1476,13 +1462,6 @@ get_ticket_after_abe_bootstrap (void *cls, rh); } -/** - * Checks a ticket revocation message - * - * @param cls client sending the message - * @param im message of type `struct RevokeTicketMessage` - * @return #GNUNET_OK if @a im is well-formed - */ static int check_revoke_ticket_message(void *cls, const struct RevokeTicketMessage *im) @@ -1497,14 +1476,7 @@ check_revoke_ticket_message(void *cls, } return GNUNET_OK; } -/** - * - * Handler for ticket revocation message - * - * @param cls unused - * @param client who sent the message - * @param message the message - */ + static void handle_revoke_ticket_message (void *cls, const struct RevokeTicketMessage *rm) @@ -1544,13 +1516,6 @@ cleanup_consume_ticket_handle (struct ConsumeTicketHandle *handle) -/** - * Checks a ticket consume message - * - * @param cls client sending the message - * @param im message of type `struct ConsumeTicketMessage` - * @return #GNUNET_OK if @a im is well-formed - */ static int check_consume_ticket_message(void *cls, const struct ConsumeTicketMessage *cm) @@ -1782,14 +1747,6 @@ process_consume_abe_key (void *cls, uint32_t rd_count, } -/** - * - * Handler for ticket issue message - * - * @param cls unused - * @param client who sent the message - * @param message the message - */ static void handle_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm) @@ -1941,13 +1898,6 @@ store_after_abe_bootstrap (void *cls, GNUNET_SCHEDULER_add_now (&attr_store_task, ash); } -/** - * Checks a store message - * - * @param cls client sending the message - * @param sam message of type `struct AttributeStoreMessage` - * @return #GNUNET_OK if @a im is well-formed - */ static int check_attribute_store_message(void *cls, const struct AttributeStoreMessage *sam) @@ -1964,14 +1914,6 @@ check_attribute_store_message(void *cls, } -/** - * - * Handler for store message - * - * @param cls unused - * @param client who sent the message - * @param message the message - */ static void handle_attribute_store_message (void *cls, const struct AttributeStoreMessage *sam) @@ -2125,12 +2067,6 @@ iterate_next_after_abe_bootstrap (void *cls, -/** - * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ITERATION_START message - * - * @param cls the client sending the message - * @param zis_msg message from the client - */ static void handle_iteration_start (void *cls, const struct AttributeIterationStartMessage *ais_msg) @@ -2153,12 +2089,6 @@ handle_iteration_start (void *cls, } -/** - * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ITERATION_STOP message - * - * @param cls the client sending the message - * @param ais_msg message from the client - */ static void handle_iteration_stop (void *cls, const struct AttributeIterationStopMessage *ais_msg) @@ -2188,12 +2118,6 @@ handle_iteration_stop (void *cls, } -/** - * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ATTRIBUTE_ITERATION_NEXT message - * - * @param cls the client sending the message - * @param message message from the client - */ static void handle_iteration_next (void *cls, const struct AttributeIterationNextMessage *ais_msg) @@ -2351,12 +2275,6 @@ run_ticket_iteration_round (struct TicketIteration *ti) cleanup_ticket_iter_handle (ti); } -/** - * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_START message - * - * @param cls the client sending the message - * @param tis_msg message from the client - */ static void handle_ticket_iteration_start (void *cls, const struct TicketIterationStartMessage *tis_msg) @@ -2381,12 +2299,6 @@ handle_ticket_iteration_start (void *cls, } -/** - * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_STOP message - * - * @param cls the client sending the message - * @param tis_msg message from the client - */ static void handle_ticket_iteration_stop (void *cls, const struct TicketIterationStopMessage *tis_msg) @@ -2416,12 +2328,6 @@ handle_ticket_iteration_stop (void *cls, } -/** - * Handles a #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ITERATION_NEXT message - * - * @param cls the client sending the message - * @param message message from the client - */ static void handle_ticket_iteration_next (void *cls, const struct TicketIterationNextMessage *tis_msg) @@ -2453,9 +2359,8 @@ handle_ticket_iteration_next (void *cls, * Main function that will be run * * @param cls closure - * @param args remaining command-line arguments - * @param cfgfile name of the configuration file used (for saving, can be NULL) - * @param c configuration + * @param c the configuration used + * @param server the service handle */ static void 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 struct IssueTicketMessage { /** - * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE + * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_TICKET */ struct GNUNET_MessageHeader header; @@ -281,7 +281,7 @@ struct IssueTicketMessage struct RevokeTicketMessage { /** - * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE + * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET */ struct GNUNET_MessageHeader header; @@ -309,7 +309,7 @@ struct RevokeTicketMessage struct RevokeTicketResultMessage { /** - * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE + * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT */ struct GNUNET_MessageHeader header; @@ -348,7 +348,7 @@ struct TicketResultMessage struct ConsumeTicketMessage { /** - * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_TICKET_ISSUE + * Type will be #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_CONSUME_TICKET */ struct GNUNET_MessageHeader header; 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 }; - /** * Try again to connect to the service. * - * @param cls handle to the service. + * @param h handle to the identity provider service. */ static void -reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle); +reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h); /** * Reconnect @@ -344,7 +343,7 @@ reconnect_task (void *cls) /** * Disconnect from service and then reconnect. * - * @param handle our handle + * @param handle our service */ static void force_reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *handle) @@ -775,7 +774,7 @@ handle_revoke_ticket_result (void *cls, /** * Try again to connect to the service. * - * @param cls handle to the identity provider service. + * @param h handle to the identity provider service. */ static void reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h) @@ -895,8 +894,7 @@ GNUNET_IDENTITY_PROVIDER_disconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h) * * @param h handle to the identity provider * @param pkey private key of the identity - * @param name the attribute name - * @param value the attribute value + * @param attr the attribute value * @param cont continuation to call when done * @param cont_cls closure for @a cont * @return handle to abort the request @@ -1061,7 +1059,7 @@ GNUNET_IDENTITY_PROVIDER_get_attributes_stop (struct GNUNET_IDENTITY_PROVIDER_At * @param h the identity provider to use * @param iss the issuing identity * @param rp the subject of the ticket (the relying party) - * @param attr the attributes that the relying party is given access to + * @param attrs the attributes that the relying party is given access to * @param cb the callback * @param cb_cls the callback closure * @return handle to abort the operation @@ -1108,7 +1106,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h * Consumes an issued ticket. The ticket is persisted * and used to retrieve identity information from the issuer * - * @param id the identity provider to use + * @param h the identity provider to use * @param identity the identity that is the subject of the issued ticket (the relying party) * @param ticket the issued ticket to consume * @param cb the callback to call @@ -1218,7 +1216,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER * Lists all tickets that have been issued to remote * identites (relying parties) * - * @param id the identity provider to use + * @param h the identity provider to use * @param identity the issuing identity * @param error_cb function to call on error (i.e. disconnect), * the handle is afterwards invalid @@ -1324,7 +1322,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_stop (struct GNUNET_IDENTITY_PROVIDER_ * Revoked an issued ticket. The relying party will be unable to retrieve * updated attributes. * - * @param id the identity provider to use + * @param h the identity provider to use * @param identity the issuing identity * @param ticket the ticket to revoke * @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 @@ */ /** - * @file identity/plugin_gnsrecord_identity.c + * @file identity-provider/plugin_gnsrecord_identity_provider.c * @brief gnsrecord plugin to provide the API for identity records - * @author Christian Grothoff + * @author Martin Schanzenbach */ #include "platform.h" #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) * * @param cls closure (internal context for the plugin) * @param ticket the ticket to persist + * @param attrs the attributes associated with the ticket * @return #GNUNET_OK on success, else #GNUNET_SYSERR */ static int @@ -581,8 +582,7 @@ get_ticket_and_call_iterator (struct Plugin *plugin, * Lookup tickets in the datastore. * * @param cls closure (internal context for the plugin) - * @param zone private key of the zone - * @param label name of the record in the zone + * @param ticket the ticket to retrieve attributes for * @param iter function to call with the result * @param iter_cls closure for @a iter * @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, } -/** - * Function processing the REST call - * - * @param method HTTP method - * @param url URL of the HTTP request - * @param data body of the HTTP request (optional) - * @param data_size length of the body - * @param proc callback function for the result - * @param proc_cls closure for callback function - * @return GNUNET_OK if request accepted - */ static void rest_identity_process_request(struct GNUNET_REST_RequestHandle *rest_handle, 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 @@ */ /** - * @file include/gnunet_crypto_lib.h - * @brief cryptographic primitives for GNUnet + * @file include/gnunet_abe_lib.h + * @brief Attribute-Based Encryption primitives for GNUnet * * @author Martin Schanzenbach * @@ -57,10 +57,18 @@ struct GNUNET_CRYPTO_AbeKey; * @ingroup abe * Create a new CP-ABE master key. Caller must free return value. * - * @return fresh private key; free using #GNUNET_free + * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_master_key */ struct GNUNET_ABE_AbeMasterKey * GNUNET_ABE_cpabe_create_master_key (void); + +/** + * @ingroup abe + * Delete a CP-ABE master key. + * + * @param key the master key + * @return fresh private key; free using #GNUNET_free + */ void GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key); @@ -68,11 +76,22 @@ GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key); * @ingroup abe * Create a new CP-ABE key. Caller must free return value. * - * @return fresh private key; free using #GNUNET_free + * @param key the master key + * @param attrs the attributes to append to the key + * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_key */ struct GNUNET_ABE_AbeKey * -GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *msk, +GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key, char **attrs); + +/** + * @ingroup abe + * Delete a CP-ABE key. + * + * @param key the key to delete + * @param delete_pub GNUNE_YES if the public key should also be freed (bug in gabe) + * @return fresh private key; free using #GNUNET_free + */ void GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, int delete_pub); @@ -84,9 +103,9 @@ GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, * * @param block the block to encrypt * @param size the size of the @a block - * @param sessionkey the key used to encrypt - * @param iv the initialization vector to use, use INITVALUE - * for streams. + * @param policy the ABE policy + * @param key the key used to encrypt + * @param result the result buffer. Will be allocated. Free using #GNUNET_free * @return the size of the encrypted block, -1 for errors */ ssize_t @@ -98,13 +117,12 @@ GNUNET_ABE_cpabe_encrypt (const void *block, /** * @ingroup abe - * Encrypt a block using sessionkey. + * Decrypt a block using the ABE key. * * @param block the block to encrypt * @param size the size of the @a block - * @param sessionkey the key used to encrypt - * @param iv the initialization vector to use, use INITVALUE - * for streams. + * @param key the key used to decrypt + * @param result the result buffer. Will be allocated. Free using #GNUNET_free * @return the size of the encrypted block, -1 for errors */ ssize_t @@ -113,18 +131,50 @@ GNUNET_ABE_cpabe_decrypt (const void *block, const struct GNUNET_ABE_AbeKey *key, void **result); +/** + * @ingroup abe + * Serialize an ABE key. + * + * @param key the key to serialize + * @param result the result buffer. Will be allocated. Free using #GNUNET_free + * @return the size of the encrypted block, -1 for errors + */ ssize_t GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, void **result); +/** + * @ingroup abe + * Deserialize a serialized ABE key. + * + * @param data the data to deserialize + * @param len the length of the data. + * @return the ABE key. NULL of unsuccessful + */ struct GNUNET_ABE_AbeKey* GNUNET_ABE_cpabe_deserialize_key (const void *data, size_t len); +/** + * @ingroup abe + * Serialize an ABE master key. + * + * @param key the key to serialize + * @param result the result buffer. Will be allocated. Free using #GNUNET_free + * @return the size of the encrypted block, -1 for errors + */ ssize_t GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key, void **result); +/** + * @ingroup abe + * Deserialize an ABE master key. + * + * @param data the data to deserialize + * @param len the length of the data. + * @return the ABE key. NULL of unsuccessful + */ struct GNUNET_ABE_AbeMasterKey* GNUNET_ABE_cpabe_deserialize_master_key (const void *data, 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 @@ /** * @author Martin Schanzenbach - * @author Adnan Husain * * @file * API to the Credential service @@ -274,7 +273,8 @@ typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls, * @param issuer_key the issuer public key * @param issuer_attribute the issuer attribute * @param subject_key the subject public key - * @param subject_attribute the attribute claimed by the subject + * @param credential_count number of credentials + * @param credentials the subject credentials * @param proc function to call on result * @param proc_cls closure for processor * @return handle to the queued request @@ -305,6 +305,8 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, * @param attribute the name of the attribute to delegate * @param subject the subject of the delegation * @param delegated_attribute the name of the attribute that is delegated to + * @param proc the result callback + * @param proc_cls the result closure context * @return handle to the queued request */ struct GNUNET_CREDENTIAL_Request * @@ -322,6 +324,8 @@ GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle, * @param handle handle to the Credential service * @param issuer the ego that was used to delegate the attribute * @param attribute the name of the attribute that is delegated + * @param proc the callback + * @param proc_cls callback closure * @return handle to the queued request */ struct GNUNET_CREDENTIAL_Request * @@ -336,7 +340,6 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, /** * Issue an attribute to a subject * - * @param handle handle to the Credential service * @param issuer the ego that should be used to issue the attribute * @param subject the subject of the attribute * @param attribute the name of the attribute @@ -344,32 +347,12 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle, * @return handle to the queued request */ struct GNUNET_CREDENTIAL_Credential* -GNUNET_CREDENTIAL_credential_issue ( - const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, +GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, struct GNUNET_CRYPTO_EcdsaPublicKey *subject, const char *attribute, struct GNUNET_TIME_Absolute *expiration); -/** - * Remove a credential - * - * @param handle handle to the Credential service - * @param issuer the identity that issued the credential - * @param subject the subject of the credential - * @param credential the name of the credential - * @return handle to the queued request - */ -/** - struct GNUNET_CREDENTIAL_IssueRequest * - GNUNET_CREDENTIAL_remove (struct GNUNET_CREDENTIAL_Handle *handle, - struct GNUNET_IDENTITY_Ego *issuer, - struct GNUNET_IDENTITY_Ego *subject, - const char *credential, - GNUNET_CREDENTIAL_IssueResultProcessor proc, - void *proc_cls); - */ - /** * Cancel pending lookup request @@ -377,7 +360,7 @@ GNUNET_CREDENTIAL_credential_issue ( * @param lr the lookup request to cancel */ void -GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *vr); +GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr); #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 /** * Create a new attribute claim. * - * @param name the attribute name + * @param attr_name the attribute name * @param type the attribute type * @param data the attribute value * @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 * Process an attribute that was stored in the idp. * * @param cls closure + * @param identity the identity * @param attr the attribute */ typedef void @@ -211,19 +212,19 @@ typedef void /** * Issues a ticket to another identity. The identity may use - * @GNUNET_IDENTITY_PROVIDER_authorization_ticket_consume to consume the ticket + * GNUNET_IDENTITY_PROVIDER_ticket_consume to consume the ticket * and retrieve the attributes specified in the AttributeList. * - * @param id the identity provider to use + * @param h the identity provider to use * @param iss the issuing identity * @param rp the subject of the ticket (the relying party) - * @param attr the attributes that the relying party is given access to + * @param attrs the attributes that the relying party is given access to * @param cb the callback * @param cb_cls the callback closure * @return handle to abort the operation */ struct GNUNET_IDENTITY_PROVIDER_Operation * -GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *id, +GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, @@ -234,7 +235,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *i * Revoked an issued ticket. The relying party will be unable to retrieve * updated attributes. * - * @param id the identity provider to use + * @param h the identity provider to use * @param identity the issuing identity * @param ticket the ticket to revoke * @param cb the callback @@ -242,7 +243,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *i * @return handle to abort the operation */ struct GNUNET_IDENTITY_PROVIDER_Operation * -GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *id, +GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cb, @@ -254,7 +255,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle * * Consumes an issued ticket. The ticket is persisted * and used to retrieve identity information from the issuer * - * @param id the identity provider to use + * @param h the identity provider to use * @param identity the identity that is the subject of the issued ticket (the audience) * @param ticket the issued ticket to consume * @param cb the callback to call @@ -262,7 +263,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle * * @return handle to abort the operation */ struct GNUNET_IDENTITY_PROVIDER_Operation * -GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *id, +GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *h, const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, GNUNET_IDENTITY_PROVIDER_AttributeResult cb, @@ -299,7 +300,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER * Lists all tickets that have been issued to remote * identites (relying parties) * - * @param id the identity provider to use + * @param h the identity provider to use * @param identity the issuing identity * @param error_cb function to call on error (i.e. disconnect), * 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, * * @param url URL to check * @param namespace namespace to check against - * @retun GNUNET_YES if namespace matches + * @return GNUNET_YES if namespace matches */ int GNUNET_REST_namespace_match (const char *url, const char *namespace); @@ -98,7 +98,7 @@ GNUNET_REST_namespace_match (const char *url, const char *namespace); * Create REST MHD response * * @param data result - * @retun MHD response + * @return MHD response */ struct MHD_Response* 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 /** * Plugin name. Used as the namespace for the API. - * e.g. http://hostname:port/ + * e.g. http://hostname:port/name */ char *name; -- 2.25.1