diff options
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 ( | |||
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 | */ | ||
1177 | struct GNUNET_RECLAIM_Operation * | ||
1178 | GNUNET_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. |