diff options
author | Markus Voggenreiter <Markus.Voggenreiter@tum.de> | 2019-10-27 22:43:23 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-01-13 13:31:03 +0100 |
commit | b62682f35d3752eff4b9d7ff52d47e0bfbd6b6f5 (patch) | |
tree | bfa262535f1ed7ce2e343972795a20fd070533db /src/reclaim/reclaim_api.c | |
parent | df903a80b2681567bf0b1afe9f1e3c89b13efbc2 (diff) |
Deletion of Reference Type
Diffstat (limited to 'src/reclaim/reclaim_api.c')
-rw-r--r-- | src/reclaim/reclaim_api.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c index a6ff0237d..7c7261522 100644 --- a/src/reclaim/reclaim_api.c +++ b/src/reclaim/reclaim_api.c @@ -1163,6 +1163,49 @@ GNUNET_RECLAIM_attestation_reference_store ( return op; } +/** + * Delete an attestation reference. Tickets used to share this reference are updated + * accordingly. + * + * @param h handle to the re:claimID service + * @param pkey Private key of the identity to delete the reference from + * @param attr The reference + * @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_reference_delete ( + struct GNUNET_RECLAIM_Handle *h, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, + const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *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_REF_serialize_get_size (attr); + op->env = GNUNET_MQ_msg_extra (dam, + attr_len, + GNUNET_MESSAGE_TYPE_RECLAIM_REFERENCE_DELETE); + dam->identity = *pkey; + dam->id = htonl (op->r_id); + GNUNET_RECLAIM_ATTESTATION_REF_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. |