aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/reclaim_api.c
diff options
context:
space:
mode:
authorMarkus Voggenreiter <Markus.Voggenreiter@tum.de>2019-10-15 09:32:16 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-01-13 13:31:02 +0100
commit0def2d57eabbf00947ede47b0e968c0a395ace50 (patch)
treeb93af20c076aa365df68356fa107d1689d918a8a /src/reclaim/reclaim_api.c
parent2c65283b0bd97a8719f4c71aee8cc091a491129a (diff)
downloadgnunet-0def2d57eabbf00947ede47b0e968c0a395ace50.tar.gz
gnunet-0def2d57eabbf00947ede47b0e968c0a395ace50.zip
Delete Attestation via Service
Diffstat (limited to 'src/reclaim/reclaim_api.c')
-rw-r--r--src/reclaim/reclaim_api.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c
index 988650450..ed07f78e1 100644
--- a/src/reclaim/reclaim_api.c
+++ b/src/reclaim/reclaim_api.c
@@ -973,6 +973,49 @@ GNUNET_RECLAIM_attestation_store (
973} 973}
974 974
975/** 975/**
976 * Delete an attestation. Tickets used to share this attestation are updated
977 * accordingly.
978 *
979 * @param h handle to the re:claimID service
980 * @param pkey Private key of the identity to add an attribute to
981 * @param attr The attestation
982 * @param cont Continuation to call when done
983 * @param cont_cls Closure for @a cont
984 * @return handle Used to to abort the request
985 */
986struct GNUNET_RECLAIM_Operation *
987GNUNET_RECLAIM_attestation_delete (
988 struct GNUNET_RECLAIM_Handle *h,
989 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
990 const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr,
991 GNUNET_RECLAIM_ContinuationWithStatus cont,
992 void *cont_cls)
993{
994 struct GNUNET_RECLAIM_Operation *op;
995 struct AttributeDeleteMessage *dam;
996 size_t attr_len;
997
998 op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
999 op->h = h;
1000 op->as_cb = cont;
1001 op->cls = cont_cls;
1002 op->r_id = h->r_id_gen++;
1003 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1004 attr_len = GNUNET_RECLAIM_ATTESTATION_serialize_get_size (attr);
1005 op->env = GNUNET_MQ_msg_extra (dam,
1006 attr_len,
1007 GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_DELETE);
1008 dam->identity = *pkey;
1009 dam->id = htonl (op->r_id);
1010 GNUNET_RECLAIM_ATTESTATION_serialize (attr, (char *) &dam[1]);
1011
1012 dam->attr_len = htons (attr_len);
1013 if (NULL != h->mq)
1014 GNUNET_MQ_send_copy (h->mq, op->env);
1015 return op;
1016}
1017
1018/**
976 * List all attributes for a local identity. 1019 * List all attributes for a local identity.
977 * This MUST lock the `struct GNUNET_RECLAIM_Handle` 1020 * This MUST lock the `struct GNUNET_RECLAIM_Handle`
978 * for any other calls than #GNUNET_RECLAIM_get_attributes_next() and 1021 * for any other calls than #GNUNET_RECLAIM_get_attributes_next() and