summaryrefslogtreecommitdiff
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)
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 (
}
/**
+ * Delete an attestation. Tickets used to share this attestation are updated
+ * accordingly.
+ *
+ * @param h handle to the re:claimID service
+ * @param pkey Private key of the identity to add an attribute to
+ * @param attr The attestation
+ * @param cont Continuation to call when done
+ * @param cont_cls Closure for @a cont
+ * @return handle Used to to abort the request
+ */
+struct GNUNET_RECLAIM_Operation *
+GNUNET_RECLAIM_attestation_delete (
+ struct GNUNET_RECLAIM_Handle *h,
+ const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
+ const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr,
+ GNUNET_RECLAIM_ContinuationWithStatus cont,
+ void *cont_cls)
+{
+ struct GNUNET_RECLAIM_Operation *op;
+ struct AttributeDeleteMessage *dam;
+ size_t attr_len;
+
+ op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
+ op->h = h;
+ op->as_cb = cont;
+ op->cls = cont_cls;
+ op->r_id = h->r_id_gen++;
+ GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
+ attr_len = GNUNET_RECLAIM_ATTESTATION_serialize_get_size (attr);
+ op->env = GNUNET_MQ_msg_extra (dam,
+ attr_len,
+ GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_DELETE);
+ dam->identity = *pkey;
+ dam->id = htonl (op->r_id);
+ GNUNET_RECLAIM_ATTESTATION_serialize (attr, (char *) &dam[1]);
+
+ dam->attr_len = htons (attr_len);
+ if (NULL != h->mq)
+ GNUNET_MQ_send_copy (h->mq, op->env);
+ return op;
+}
+
+/**
* List all attributes for a local identity.
* This MUST lock the `struct GNUNET_RECLAIM_Handle`
* for any other calls than #GNUNET_RECLAIM_get_attributes_next() and