aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/reclaim_api.c
diff options
context:
space:
mode:
authorMarkus Voggenreiter <Markus.Voggenreiter@tum.de>2019-10-27 22:43:23 +0100
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-01-13 13:31:03 +0100
commitb62682f35d3752eff4b9d7ff52d47e0bfbd6b6f5 (patch)
treebfa262535f1ed7ce2e343972795a20fd070533db /src/reclaim/reclaim_api.c
parentdf903a80b2681567bf0b1afe9f1e3c89b13efbc2 (diff)
downloadgnunet-b62682f35d3752eff4b9d7ff52d47e0bfbd6b6f5.tar.gz
gnunet-b62682f35d3752eff4b9d7ff52d47e0bfbd6b6f5.zip
Deletion of Reference Type
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 a6ff0237d..7c7261522 100644
--- a/src/reclaim/reclaim_api.c
+++ b/src/reclaim/reclaim_api.c
@@ -1163,6 +1163,49 @@ GNUNET_RECLAIM_attestation_reference_store (
1163 return op; 1163 return op;
1164} 1164}
1165 1165
1166/**
1167 * Delete an attestation reference. Tickets used to share this reference are updated
1168 * accordingly.
1169 *
1170 * @param h handle to the re:claimID service
1171 * @param pkey Private key of the identity to delete the reference from
1172 * @param attr The reference
1173 * @param cont Continuation to call when done
1174 * @param cont_cls Closure for @a cont
1175 * @return handle Used to to abort the request
1176 */
1177struct GNUNET_RECLAIM_Operation *
1178GNUNET_RECLAIM_attestation_reference_delete (
1179 struct GNUNET_RECLAIM_Handle *h,
1180 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
1181 const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr,
1182 GNUNET_RECLAIM_ContinuationWithStatus cont,
1183 void *cont_cls)
1184{
1185
1186 struct GNUNET_RECLAIM_Operation *op;
1187 struct AttributeDeleteMessage *dam;
1188 size_t attr_len;
1189
1190 op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1191 op->h = h;
1192 op->as_cb = cont;
1193 op->cls = cont_cls;
1194 op->r_id = h->r_id_gen++;
1195 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1196 attr_len = GNUNET_RECLAIM_ATTESTATION_REF_serialize_get_size (attr);
1197 op->env = GNUNET_MQ_msg_extra (dam,
1198 attr_len,
1199 GNUNET_MESSAGE_TYPE_RECLAIM_REFERENCE_DELETE);
1200 dam->identity = *pkey;
1201 dam->id = htonl (op->r_id);
1202 GNUNET_RECLAIM_ATTESTATION_REF_serialize (attr, (char *) &dam[1]);
1203
1204 dam->attr_len = htons (attr_len);
1205 if (NULL != h->mq)
1206 GNUNET_MQ_send_copy (h->mq, op->env);
1207 return op;
1208}
1166 1209
1167/** 1210/**
1168 * List all attributes for a local identity. 1211 * List all attributes for a local identity.