aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_reclaim_service.h
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2020-02-04 18:42:04 +0100
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-02-09 20:38:10 +0100
commit55f6d26b7424d660c99bc89f3677b20294e87a27 (patch)
treea8080fdcf0d9688c154417e50c58055e364f8b6b /src/include/gnunet_reclaim_service.h
parent5b6bb2ce4d60635b2af950d72b45f12686fd5218 (diff)
downloadgnunet-55f6d26b7424d660c99bc89f3677b20294e87a27.tar.gz
gnunet-55f6d26b7424d660c99bc89f3677b20294e87a27.zip
Refactoring reclaim attestations
Diffstat (limited to 'src/include/gnunet_reclaim_service.h')
-rw-r--r--src/include/gnunet_reclaim_service.h66
1 files changed, 20 insertions, 46 deletions
diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h
index b20809a49..4ead87003 100644
--- a/src/include/gnunet_reclaim_service.h
+++ b/src/include/gnunet_reclaim_service.h
@@ -114,12 +114,24 @@ typedef void (*GNUNET_RECLAIM_ContinuationWithStatus) (void *cls,
114 * @param cls The callback closure 114 * @param cls The callback closure
115 * @param identity The identity authoritative over the attributes 115 * @param identity The identity authoritative over the attributes
116 * @param attr The attribute 116 * @param attr The attribute
117 * @param attestation The attestation for the attribute (may be NULL)
117 */ 118 */
118typedef void (*GNUNET_RECLAIM_AttributeResult) ( 119typedef void (*GNUNET_RECLAIM_AttributeResult) (
119 void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, 120 void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
120 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, 121 const struct GNUNET_RECLAIM_Attribute *attr,
121 const struct GNUNET_RECLAIM_ATTESTATION_Claim *attest, 122 const struct GNUNET_RECLAIM_Attestation *attestation);
122 const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *reference); 123
124
125/**
126 * Callback used to notify the client of attestation results.
127 *
128 * @param cls The callback closure
129 * @param identity The identity authoritative over the attributes
130 * @param attr The attribute
131 */
132typedef void (*GNUNET_RECLAIM_AttestationResult) (
133 void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *identity,
134 const struct GNUNET_RECLAIM_Attestation *attestation);
123 135
124 136
125/** 137/**
@@ -148,7 +160,7 @@ struct GNUNET_RECLAIM_Operation *
148GNUNET_RECLAIM_attribute_store ( 160GNUNET_RECLAIM_attribute_store (
149 struct GNUNET_RECLAIM_Handle *h, 161 struct GNUNET_RECLAIM_Handle *h,
150 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 162 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
151 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, 163 const struct GNUNET_RECLAIM_Attribute *attr,
152 const struct GNUNET_TIME_Relative *exp_interval, 164 const struct GNUNET_TIME_Relative *exp_interval,
153 GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls); 165 GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
154 166
@@ -169,7 +181,7 @@ struct GNUNET_RECLAIM_Operation *
169GNUNET_RECLAIM_attestation_store ( 181GNUNET_RECLAIM_attestation_store (
170 struct GNUNET_RECLAIM_Handle *h, 182 struct GNUNET_RECLAIM_Handle *h,
171 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 183 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
172 const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr, 184 const struct GNUNET_RECLAIM_Attestation *attestation,
173 const struct GNUNET_TIME_Relative *exp_interval, 185 const struct GNUNET_TIME_Relative *exp_interval,
174 GNUNET_RECLAIM_ContinuationWithStatus cont, 186 GNUNET_RECLAIM_ContinuationWithStatus cont,
175 void *cont_cls); 187 void *cont_cls);
@@ -190,7 +202,7 @@ struct GNUNET_RECLAIM_Operation *
190GNUNET_RECLAIM_attribute_delete ( 202GNUNET_RECLAIM_attribute_delete (
191 struct GNUNET_RECLAIM_Handle *h, 203 struct GNUNET_RECLAIM_Handle *h,
192 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 204 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
193 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, 205 const struct GNUNET_RECLAIM_Attribute *attr,
194 GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls); 206 GNUNET_RECLAIM_ContinuationWithStatus cont, void *cont_cls);
195 207
196/** 208/**
@@ -208,29 +220,11 @@ struct GNUNET_RECLAIM_Operation *
208GNUNET_RECLAIM_attestation_delete ( 220GNUNET_RECLAIM_attestation_delete (
209 struct GNUNET_RECLAIM_Handle *h, 221 struct GNUNET_RECLAIM_Handle *h,
210 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 222 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
211 const struct GNUNET_RECLAIM_ATTESTATION_Claim *attr, 223 const struct GNUNET_RECLAIM_Attestation *attr,
212 GNUNET_RECLAIM_ContinuationWithStatus cont, 224 GNUNET_RECLAIM_ContinuationWithStatus cont,
213 void *cont_cls); 225 void *cont_cls);
214 226
215/** 227/**
216 * Delete an attestation reference. Tickets used to share this reference are updated
217 * accordingly.
218 *
219 * @param h handle to the re:claimID service
220 * @param pkey Private key of the identity to delete the reference from
221 * @param attr The reference
222 * @param cont Continuation to call when done
223 * @param cont_cls Closure for @a cont
224 * @return handle Used to to abort the request
225 */
226struct GNUNET_RECLAIM_Operation *
227GNUNET_RECLAIM_attestation_reference_delete (
228 struct GNUNET_RECLAIM_Handle *h,
229 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
230 const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr,
231 GNUNET_RECLAIM_ContinuationWithStatus cont,
232 void *cont_cls);
233/**
234 * List all attributes for a local identity. 228 * List all attributes for a local identity.
235 * This MUST lock the `struct GNUNET_RECLAIM_Handle` 229 * This MUST lock the `struct GNUNET_RECLAIM_Handle`
236 * for any other calls than #GNUNET_RECLAIM_get_attributes_next() and 230 * for any other calls than #GNUNET_RECLAIM_get_attributes_next() and
@@ -262,26 +256,6 @@ GNUNET_RECLAIM_get_attributes_start (
262 GNUNET_RECLAIM_AttributeResult proc, void *proc_cls, 256 GNUNET_RECLAIM_AttributeResult proc, void *proc_cls,
263 GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls); 257 GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls);
264 258
265/**
266 * Store an attestation reference. If the reference is already present,
267 * it is replaced with the new reference.
268 *
269 * @param h handle to the re:claimID service
270 * @param pkey private key of the identity
271 * @param attr the reference value
272 * @param exp_interval the relative expiration interval for the reference
273 * @param cont continuation to call when done
274 * @param cont_cls closure for @a cont
275 * @return handle to abort the request
276 */
277struct GNUNET_RECLAIM_Operation *
278GNUNET_RECLAIM_attestation_reference_store (
279 struct GNUNET_RECLAIM_Handle *h,
280 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
281 const struct GNUNET_RECLAIM_ATTESTATION_REFERENCE *attr,
282 const struct GNUNET_TIME_Relative *exp_interval,
283 GNUNET_RECLAIM_ContinuationWithStatus cont,
284 void *cont_cls);
285 259
286/** 260/**
287 * Calls the record processor specified in #GNUNET_RECLAIM_get_attributes_start 261 * Calls the record processor specified in #GNUNET_RECLAIM_get_attributes_start
@@ -324,7 +298,7 @@ GNUNET_RECLAIM_ticket_issue (
324 struct GNUNET_RECLAIM_Handle *h, 298 struct GNUNET_RECLAIM_Handle *h,
325 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, 299 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
326 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, 300 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
327 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, 301 const struct GNUNET_RECLAIM_AttributeList *attrs,
328 GNUNET_RECLAIM_TicketCallback cb, void *cb_cls); 302 GNUNET_RECLAIM_TicketCallback cb, void *cb_cls);
329 303
330 304