aboutsummaryrefslogtreecommitdiff
path: root/src/escrow/plugin_escrow_gns.c
diff options
context:
space:
mode:
authorjospaeth <spaethj@in.tum.de>2020-08-10 19:27:42 +0200
committerjospaeth <spaethj@in.tum.de>2020-08-10 19:27:42 +0200
commit2c21c75bd151d9265f5cca2fab721a16afff7e10 (patch)
tree57cb6fdc9195b8dbe79d725866f6b3b74a408ecb /src/escrow/plugin_escrow_gns.c
parentf2fb911d529db3787b15e39b8a41e081ea626e41 (diff)
downloadgnunet-2c21c75bd151d9265f5cca2fab721a16afff7e10.tar.gz
gnunet-2c21c75bd151d9265f5cca2fab721a16afff7e10.zip
some error messages
Diffstat (limited to 'src/escrow/plugin_escrow_gns.c')
-rw-r--r--src/escrow/plugin_escrow_gns.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/escrow/plugin_escrow_gns.c b/src/escrow/plugin_escrow_gns.c
index 2d3343389..306dd5d83 100644
--- a/src/escrow/plugin_escrow_gns.c
+++ b/src/escrow/plugin_escrow_gns.c
@@ -262,7 +262,8 @@ cleanup_plugin_operation (struct ESCROW_PluginOperationWrapper *plugin_op_wrap)
262 GNUNET_free (curr_ns_qe); 262 GNUNET_free (curr_ns_qe);
263 } 263 }
264 /* disconnect from namestore service */ 264 /* disconnect from namestore service */
265 GNUNET_NAMESTORE_disconnect (p_op->ns_h); 265 if (NULL != p_op->ns_h)
266 GNUNET_NAMESTORE_disconnect (p_op->ns_h);
266 GNUNET_free (p_op); 267 GNUNET_free (p_op);
267 GNUNET_free (plugin_op_wrap); 268 GNUNET_free (plugin_op_wrap);
268} 269}
@@ -332,6 +333,7 @@ keyshare_distributed (void *cls,
332 "Failed to store keyshare %s\n", 333 "Failed to store keyshare %s\n",
333 emsg); 334 emsg);
334 p_op->anchor_wrap->escrowAnchor = NULL; 335 p_op->anchor_wrap->escrowAnchor = NULL;
336 p_op->anchor_wrap->emsg = _ ("Keyshare distribution failed!\n");
335 p_op->cont (p_op->anchor_wrap); 337 p_op->cont (p_op->anchor_wrap);
336 // this also cancels all running namestore operations 338 // this also cancels all running namestore operations
337 cleanup_plugin_operation (plugin_op_wrap); 339 cleanup_plugin_operation (plugin_op_wrap);
@@ -398,6 +400,7 @@ escrow_ids_finished (struct ESCROW_PluginOperationWrapper *plugin_op_wrap)
398 if (NULL == keyshares) 400 if (NULL == keyshares)
399 { 401 {
400 p_op->anchor_wrap->escrowAnchor = NULL; 402 p_op->anchor_wrap->escrowAnchor = NULL;
403 p_op->anchor_wrap->emsg = _ ("Failed to split the key!\n");
401 start_cont (plugin_op_wrap); 404 start_cont (plugin_op_wrap);
402 return; 405 return;
403 } 406 }
@@ -406,6 +409,7 @@ escrow_ids_finished (struct ESCROW_PluginOperationWrapper *plugin_op_wrap)
406 if (GNUNET_OK != distribute_keyshares (plugin_op_wrap, keyshares)) 409 if (GNUNET_OK != distribute_keyshares (plugin_op_wrap, keyshares))
407 { 410 {
408 p_op->anchor_wrap->escrowAnchor = NULL; 411 p_op->anchor_wrap->escrowAnchor = NULL;
412 p_op->anchor_wrap->emsg = _ ("Failed to distribute the keyshares!\n");
409 start_cont (plugin_op_wrap); 413 start_cont (plugin_op_wrap);
410 return; 414 return;
411 } 415 }
@@ -430,11 +434,14 @@ escrow_id_created (void *cls,
430 if (NULL == pk) 434 if (NULL == pk)
431 { 435 {
432 if (NULL != emsg) 436 if (NULL != emsg)
437 {
433 fprintf (stderr, 438 fprintf (stderr,
434 "Identity create operation returned with error: %s\n", 439 "Identity create operation returned with error: %s\n",
435 emsg); 440 emsg);
441 p_op->anchor_wrap->emsg = _ ("Identity create failed!\n");
442 }
436 else 443 else
437 fprintf (stderr, "Failed to create ego!"); 444 p_op->anchor_wrap->emsg = _ ("Failed to create ego!\n");
438 p_op->anchor_wrap->escrowAnchor = NULL; 445 p_op->anchor_wrap->escrowAnchor = NULL;
439 p_op->cont (p_op->anchor_wrap); 446 p_op->cont (p_op->anchor_wrap);
440 // this also cancels all running identity operations 447 // this also cancels all running identity operations
@@ -568,6 +575,8 @@ create_escrow_identities (struct ESCROW_PluginOperationWrapper *plugin_op_wrap,
568 if (GNUNET_SYSERR == exists_ret) 575 if (GNUNET_SYSERR == exists_ret)
569 { 576 {
570 p_op->anchor_wrap->escrowAnchor = NULL; 577 p_op->anchor_wrap->escrowAnchor = NULL;
578 p_op->anchor_wrap->emsg = _ ("An escrow identity with the same name \
579but wrong pk already exists!\n");
571 p_op->cont (p_op->anchor_wrap); 580 p_op->cont (p_op->anchor_wrap);
572 // this also cancels all running identity operations 581 // this also cancels all running identity operations
573 cleanup_plugin_operation (plugin_op_wrap); 582 cleanup_plugin_operation (plugin_op_wrap);
@@ -643,6 +652,10 @@ start_gns_key_escrow (struct GNUNET_ESCROW_Handle *h,
643 if (NULL == ego || NULL == userSecret) 652 if (NULL == ego || NULL == userSecret)
644 { 653 {
645 w->escrowAnchor = NULL; 654 w->escrowAnchor = NULL;
655 if (NULL == ego)
656 w->emsg = _ ("ESCROW_put was called with ego == NULL\n");
657 else if (NULL == userSecret)
658 w->emsg = _ ("GNS escrow needs a user secret!\n");
646 p_op->sched_task = GNUNET_SCHEDULER_add_now (&start_cont, plugin_op_wrap); 659 p_op->sched_task = GNUNET_SCHEDULER_add_now (&start_cont, plugin_op_wrap);
647 return plugin_op_wrap; 660 return plugin_op_wrap;
648 } 661 }