From 483bc7e3095dff908fe8c032ea96995d44304868 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 58f8cd6e2..c8ce1d722 100644 --- a/src/reclaim/gnunet-reclaim.c +++ b/src/reclaim/gnunet-reclaim.c @@ -226,7 +226,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; @@ -445,7 +446,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 92a1de621..2dde89950 100644 --- a/src/reclaim/plugin_rest_openid_connect.c +++ b/src/reclaim/plugin_rest_openid_connect.c @@ -978,7 +978,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; @@ -1862,7 +1863,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 b847b773c..5e586152c 100644 --- a/src/reclaim/plugin_rest_reclaim.c +++ b/src/reclaim/plugin_rest_reclaim.c @@ -755,7 +755,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; @@ -987,7 +988,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 ed07f78e1..a66bb69f2 100644 --- a/src/reclaim/reclaim_api.c +++ b/src/reclaim/reclaim_api.c @@ -504,16 +504,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); @@ -597,7 +597,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); } @@ -610,12 +610,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