From 058c23b93ac49d6b20f910dd2a5d3539cf17766d Mon Sep 17 00:00:00 2001 From: Markus Voggenreiter Date: Wed, 16 Oct 2019 18:01:02 +0200 Subject: [PATCH] Prepare Listing Attestations --- src/include/gnunet_reclaim_service.h | 3 ++- src/reclaim/gnunet-reclaim.c | 6 ++++-- src/reclaim/plugin_rest_openid_connect.c | 6 ++++-- src/reclaim/plugin_rest_reclaim.c | 6 ++++-- src/reclaim/reclaim_api.c | 12 ++++++------ 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h index 0f63b0c96..e7384fd06 100644 --- a/src/include/gnunet_reclaim_service.h +++ b/src/include/gnunet_reclaim_service.h @@ -117,7 +117,8 @@ typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls, */ typedef void (*GNUNET_RECLAIM_AttributeResult) ( void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, - const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr); + const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, + const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest); /** diff --git a/src/reclaim/gnunet-reclaim.c b/src/reclaim/gnunet-reclaim.c index c5f0ed4fa..ca77512d6 100644 --- a/src/reclaim/gnunet-reclaim.c +++ b/src/reclaim/gnunet-reclaim.c @@ -223,7 +223,8 @@ store_attr_cont (void *cls, int32_t success, const char *emsg) static void process_attrs (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, - const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr) + const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, + const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest) { char *value_str; char *id; @@ -435,7 +436,8 @@ iter_finished (void *cls) static void iter_cb (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, - const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr) + const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, + const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest) { struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le; char *attrs_tmp; diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c index a4a368ab5..8e3c205cb 100644 --- a/src/reclaim/plugin_rest_openid_connect.c +++ b/src/reclaim/plugin_rest_openid_connect.c @@ -972,7 +972,8 @@ oidc_collect_finished_cb (void *cls) static void oidc_attr_collect (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, - const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr) + const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, + const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest) { struct RequestHandle *handle = cls; struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry *le; @@ -1847,7 +1848,8 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle, static void consume_ticket (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, - const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr) + const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, + const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest) { struct RequestHandle *handle = cls; char *tmp_value; diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c index a6720d455..4e5914f78 100644 --- a/src/reclaim/plugin_rest_reclaim.c +++ b/src/reclaim/plugin_rest_reclaim.c @@ -752,7 +752,8 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle, static void attr_collect (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, - const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr) + const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, + const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest) { struct RequestHandle *handle = cls; json_t *attr_obj; @@ -983,7 +984,8 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle, static void consume_cont (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, - const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr) + const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, + const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest) { struct RequestHandle *handle = cls; char *val_str; diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c index 36e612245..7bbcf9a65 100644 --- a/src/reclaim/reclaim_api.c +++ b/src/reclaim/reclaim_api.c @@ -503,16 +503,16 @@ handle_consume_ticket_result (void *cls, { if (NULL == attrs) { - op->ar_cb (op->cls, &msg->identity, NULL); + op->ar_cb (op->cls, &msg->identity, NULL, NULL); } else { for (le = attrs->list_head; NULL != le; le = le->next) - op->ar_cb (op->cls, &msg->identity, le->claim); + op->ar_cb (op->cls, &msg->identity, le->claim, NULL); GNUNET_RECLAIM_ATTRIBUTE_list_destroy (attrs); attrs = NULL; } - op->ar_cb (op->cls, NULL, NULL); + op->ar_cb (op->cls, NULL, NULL, NULL); } GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); free_op (op); @@ -596,7 +596,7 @@ handle_attribute_result (void *cls, const struct AttributeResultMessage *msg) if (NULL != op) { if (NULL != op->ar_cb) - op->ar_cb (op->cls, NULL, NULL); + op->ar_cb (op->cls, NULL, NULL, NULL); GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); free_op (op); } @@ -609,12 +609,12 @@ handle_attribute_result (void *cls, const struct AttributeResultMessage *msg) if (NULL != it) { if (NULL != it->proc) - it->proc (it->proc_cls, &msg->identity, attr); + it->proc (it->proc_cls, &msg->identity, attr, NULL); } else if (NULL != op) { if (NULL != op->ar_cb) - op->ar_cb (op->cls, &msg->identity, attr); + op->ar_cb (op->cls, &msg->identity, attr, NULL); } GNUNET_free (attr); return; -- 2.25.1