aboutsummaryrefslogtreecommitdiff
path: root/src/escrow/escrow_api.c
diff options
context:
space:
mode:
authorjospaeth <spaethj@in.tum.de>2020-08-08 21:29:12 +0200
committerjospaeth <spaethj@in.tum.de>2020-08-08 21:29:12 +0200
commita2280bff1c996cfe70326602c0204f8637c2c20b (patch)
tree084bfa8c580b1470ffb0b43dfb6c3b895bd21fe8 /src/escrow/escrow_api.c
parent7dc7d65cd35ac00c7495d81da4456b73c1928b11 (diff)
downloadgnunet-a2280bff1c996cfe70326602c0204f8637c2c20b.tar.gz
gnunet-a2280bff1c996cfe70326602c0204f8637c2c20b.zip
store escrow status to config
Diffstat (limited to 'src/escrow/escrow_api.c')
-rw-r--r--src/escrow/escrow_api.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/escrow/escrow_api.c b/src/escrow/escrow_api.c
index 49f5c3dea..acf17c500 100644
--- a/src/escrow/escrow_api.c
+++ b/src/escrow/escrow_api.c
@@ -108,6 +108,9 @@ init_plugin (struct GNUNET_ESCROW_Handle *h,
108 anastasis_api = GNUNET_PLUGIN_load ("libgnunet_plugin_escrow_anastasis", 108 anastasis_api = GNUNET_PLUGIN_load ("libgnunet_plugin_escrow_anastasis",
109 (void *)h->cfg); 109 (void *)h->cfg);
110 return anastasis_api; 110 return anastasis_api;
111 case GNUNET_ESCROW_KEY_NONE: // error case
112 fprintf (stderr, "incorrect escrow method!");
113 return NULL;
111 } 114 }
112 // should never be reached 115 // should never be reached
113 return NULL; 116 return NULL;
@@ -141,7 +144,7 @@ GNUNET_ESCROW_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
141 struct GNUNET_ESCROW_Handle *h; 144 struct GNUNET_ESCROW_Handle *h;
142 145
143 h = GNUNET_new (struct GNUNET_ESCROW_Handle); 146 h = GNUNET_new (struct GNUNET_ESCROW_Handle);
144 h->cfg = cfg; 147 h->cfg = GNUNET_CONFIGURATION_dup (cfg);
145 h->op_head = NULL; 148 h->op_head = NULL;
146 h->op_tail = NULL; 149 h->op_tail = NULL;
147 return h; 150 return h;
@@ -193,6 +196,9 @@ GNUNET_ESCROW_fini (struct GNUNET_ESCROW_Handle *h)
193 GNUNET_ESCROW_cancel (op); 196 GNUNET_ESCROW_cancel (op);
194 } 197 }
195 198
199 /* free the configuration */
200 GNUNET_free (h->cfg);
201
196 /* free the escrow handle */ 202 /* free the escrow handle */
197 GNUNET_free (h); 203 GNUNET_free (h);
198} 204}
@@ -233,7 +239,7 @@ handle_start_escrow_result (void *cls)
233 */ 239 */
234struct GNUNET_ESCROW_Operation * 240struct GNUNET_ESCROW_Operation *
235GNUNET_ESCROW_put (struct GNUNET_ESCROW_Handle *h, 241GNUNET_ESCROW_put (struct GNUNET_ESCROW_Handle *h,
236 const struct GNUNET_IDENTITY_Ego *ego, 242 struct GNUNET_IDENTITY_Ego *ego,
237 enum GNUNET_ESCROW_Key_Escrow_Method method, 243 enum GNUNET_ESCROW_Key_Escrow_Method method,
238 GNUNET_ESCROW_AnchorContinuation cb, 244 GNUNET_ESCROW_AnchorContinuation cb,
239 void *cb_cls) 245 void *cb_cls)
@@ -383,21 +389,19 @@ GNUNET_ESCROW_verify (struct GNUNET_ESCROW_Handle *h,
383 * 389 *
384 * @param h the handle for the escrow component 390 * @param h the handle for the escrow component
385 * @param ego the identity ego of which the escrow status has to be determined 391 * @param ego the identity ego of which the escrow status has to be determined
386 * @param escrowAnchor the escrow anchor returned by the GNUNET_ESCROW_put method
387 * @param method the escrow method to use 392 * @param method the escrow method to use
388 * 393 *
389 * @return the status of the escrow packed into a GNUNET_ESCROW_Status struct 394 * @return the status of the escrow packed into a GNUNET_ESCROW_Status struct
390 */ 395 */
391struct GNUNET_ESCROW_Status * 396struct GNUNET_ESCROW_Status *
392GNUNET_ESCROW_get_status (struct GNUNET_ESCROW_Handle *h, 397GNUNET_ESCROW_get_status (struct GNUNET_ESCROW_Handle *h,
393 const struct GNUNET_IDENTITY_Ego *ego, 398 struct GNUNET_IDENTITY_Ego *ego,
394 struct GNUNET_ESCROW_Anchor *escrowAnchor,
395 enum GNUNET_ESCROW_Key_Escrow_Method method) 399 enum GNUNET_ESCROW_Key_Escrow_Method method)
396{ 400{
397 const struct GNUNET_ESCROW_KeyPluginFunctions *api; 401 const struct GNUNET_ESCROW_KeyPluginFunctions *api;
398 402
399 api = init_plugin (h, method); 403 api = init_plugin (h, method);
400 return api->get_status (h, ego, escrowAnchor); 404 return api->get_status (h, ego);
401} 405}
402 406
403 407