diff options
author | jospaeth <spaethj@in.tum.de> | 2020-07-18 14:35:59 +0200 |
---|---|---|
committer | jospaeth <spaethj@in.tum.de> | 2020-07-18 14:35:59 +0200 |
commit | 15ad508b20fbca46d8b9a8682a723b34098545bf (patch) | |
tree | 7800b9fd2cf6e6b36797bb8dc29356ae00a6f497 /src/escrow/escrow_api.c | |
parent | 646beac5ca85327b150affa034a5e9d1559382b1 (diff) | |
download | gnunet-15ad508b20fbca46d8b9a8682a723b34098545bf.tar.gz gnunet-15ad508b20fbca46d8b9a8682a723b34098545bf.zip |
pass only ESCROW_Operation to the plugins
Diffstat (limited to 'src/escrow/escrow_api.c')
-rw-r--r-- | src/escrow/escrow_api.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/escrow/escrow_api.c b/src/escrow/escrow_api.c index 1706d2a5a..ccd314db1 100644 --- a/src/escrow/escrow_api.c +++ b/src/escrow/escrow_api.c | |||
@@ -197,9 +197,10 @@ GNUNET_ESCROW_put (struct GNUNET_ESCROW_Handle *h, | |||
197 | op = GNUNET_new (struct GNUNET_ESCROW_Operation); | 197 | op = GNUNET_new (struct GNUNET_ESCROW_Operation); |
198 | op->h = h; | 198 | op->h = h; |
199 | op->cb_put = cb; | 199 | op->cb_put = cb; |
200 | op->cb_cls = cb_cls; | ||
200 | 201 | ||
201 | api = init_plugin (h, method); | 202 | api = init_plugin (h, method); |
202 | api->start_key_escrow (h, ego, cb, cb_cls); | 203 | api->start_key_escrow (op, ego); |
203 | 204 | ||
204 | return op; | 205 | return op; |
205 | } | 206 | } |
@@ -231,7 +232,7 @@ GNUNET_ESCROW_renew (struct GNUNET_ESCROW_Handle *h, | |||
231 | op->cb_renew = cb; | 232 | op->cb_renew = cb; |
232 | 233 | ||
233 | api = init_plugin (h, method); | 234 | api = init_plugin (h, method); |
234 | api->renew_key_escrow (h, escrowAnchor, cb, cb_cls); | 235 | api->renew_key_escrow (op, escrowAnchor); |
235 | 236 | ||
236 | return op; | 237 | return op; |
237 | } | 238 | } |
@@ -265,7 +266,7 @@ GNUNET_ESCROW_get (struct GNUNET_ESCROW_Handle *h, | |||
265 | op->cb_get = cb; | 266 | op->cb_get = cb; |
266 | 267 | ||
267 | api = init_plugin (h, method); | 268 | api = init_plugin (h, method); |
268 | api->restore_key (h, escrowAnchor, egoName, cb, cb_cls); | 269 | api->restore_key (op, escrowAnchor, egoName); |
269 | 270 | ||
270 | return op; | 271 | return op; |
271 | } | 272 | } |
@@ -299,7 +300,7 @@ GNUNET_ESCROW_verify (struct GNUNET_ESCROW_Handle *h, | |||
299 | op->cb_verify = cb; | 300 | op->cb_verify = cb; |
300 | 301 | ||
301 | api = init_plugin (h, method); | 302 | api = init_plugin (h, method); |
302 | api->verify_key_escrow (h, ego, escrowAnchor, cb, cb_cls); | 303 | api->verify_key_escrow (op, ego, escrowAnchor); |
303 | 304 | ||
304 | return op; | 305 | return op; |
305 | } | 306 | } |
@@ -323,5 +324,29 @@ GNUNET_ESCROW_anchor_string_to_data (struct GNUNET_ESCROW_Handle *h, | |||
323 | struct GNUNET_ESCROW_KeyPluginFunctions *api; | 324 | struct GNUNET_ESCROW_KeyPluginFunctions *api; |
324 | 325 | ||
325 | api = init_plugin (h, method); | 326 | api = init_plugin (h, method); |
326 | return api->anchor_string_to_data (anchorString); | 327 | return api->anchor_string_to_data (h, anchorString); |
327 | } | 328 | } |
329 | |||
330 | |||
331 | /** | ||
332 | * Serialize an escrow anchor (struct GNUNET_ESCROW_Anchor) into a string | ||
333 | * | ||
334 | * @param h the handle for the escrow component | ||
335 | * @param escrowAnchor the escrow anchor struct | ||
336 | * @param method the escrow method to use | ||
337 | * | ||
338 | * @return the encoded escrow anchor string | ||
339 | */ | ||
340 | char * | ||
341 | GNUNET_ESCROW_anchor_data_to_string (struct GNUNET_ESCROW_Handle *h, | ||
342 | struct GNUNET_ESCROW_Anchor *escrowAnchor, | ||
343 | enum GNUNET_ESCROW_Key_Escrow_Method method) | ||
344 | { | ||
345 | struct GNUNET_ESCROW_KeyPluginFunctions *api; | ||
346 | |||
347 | api = init_plugin (h, method); | ||
348 | return api->anchor_data_to_string (h, escrowAnchor); | ||
349 | } | ||
350 | |||
351 | |||
352 | /* end of escrow_api.c */ | ||