From c2a7a669d9c014b86d6e046f7d297fc5556d9fd4 Mon Sep 17 00:00:00 2001 From: jospaeth Date: Wed, 2 Sep 2020 21:59:37 +0200 Subject: ESCROW_get() does not need method (as it is stored in anchor) --- src/escrow/plugin_escrow_plaintext.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/escrow/plugin_escrow_plaintext.c') diff --git a/src/escrow/plugin_escrow_plaintext.c b/src/escrow/plugin_escrow_plaintext.c index 623504a6b..8e2c2204b 100644 --- a/src/escrow/plugin_escrow_plaintext.c +++ b/src/escrow/plugin_escrow_plaintext.c @@ -121,6 +121,7 @@ start_cont (void *cls) struct ESCROW_PlaintextPluginOperation *p_op; p_op = (struct ESCROW_PlaintextPluginOperation*)plugin_op_wrap->plugin_op; + p_op->sched_task = NULL; p_op->cont (p_op->anchor_wrap); cleanup_plugin_operation (plugin_op_wrap); @@ -203,6 +204,7 @@ verify_cont (void *cls) struct ESCROW_PlaintextPluginOperation *p_op; p_op = (struct ESCROW_PlaintextPluginOperation*)plugin_op_wrap->plugin_op; + p_op->sched_task = NULL; p_op->cont (p_op->verify_wrap); cleanup_plugin_operation (plugin_op_wrap); @@ -257,10 +259,17 @@ verify_plaintext_key_escrow (struct GNUNET_ESCROW_Handle *h, p_op->sched_task = GNUNET_SCHEDULER_add_now (&verify_cont, plugin_op_wrap); return plugin_op_wrap; } + if (GNUNET_ESCROW_KEY_PLAINTEXT != anchor->method) + { + w->verificationResult = GNUNET_ESCROW_INVALID; + w->emsg = _ ("This anchor was not created using plaintext escrow!\n"); + p_op->sched_task = GNUNET_SCHEDULER_add_now (&verify_cont, plugin_op_wrap); + return plugin_op_wrap; + } if (0 != strcmp (ego->name, anchor->egoName)) { w->verificationResult = GNUNET_ESCROW_INVALID; - w->emsg = _ ("This anchor was not created when putting ego that in escrow!\n"); + w->emsg = _ ("This anchor was not created when putting that ego in escrow!\n"); p_op->sched_task = GNUNET_SCHEDULER_add_now (&verify_cont, plugin_op_wrap); return plugin_op_wrap; } @@ -355,6 +364,7 @@ handle_restore_error (void *cls) struct ESCROW_PlaintextPluginOperation *p_op; p_op = (struct ESCROW_PlaintextPluginOperation*)plugin_op_wrap->plugin_op; + p_op->sched_task = NULL; p_op->cont (p_op->ego_wrap); cleanup_plugin_operation (plugin_op_wrap); -- cgit v1.2.3