aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjospaeth <spaethj@in.tum.de>2020-09-02 13:45:57 +0200
committerjospaeth <spaethj@in.tum.de>2020-09-02 13:45:57 +0200
commit05105a45b9c3ce79818c27749cf012b69800026d (patch)
tree64738f49c2f521d08c3e4de4ca70bbeb6b06f93e
parent7c40b060786c96fca289ab9d2ba4bee760c8ac0f (diff)
downloadgnunet-05105a45b9c3ce79818c27749cf012b69800026d.tar.gz
gnunet-05105a45b9c3ce79818c27749cf012b69800026d.zip
use anchor struct in restore_private_key()
-rw-r--r--src/escrow/plugin_escrow_gns.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/escrow/plugin_escrow_gns.c b/src/escrow/plugin_escrow_gns.c
index 8cf0aac61..9aecf8c54 100644
--- a/src/escrow/plugin_escrow_gns.c
+++ b/src/escrow/plugin_escrow_gns.c
@@ -1313,7 +1313,7 @@ get_user_secret_from_anchor (const struct GNUNET_ESCROW_Anchor *anchor)
1313 1313
1314static void 1314static void
1315restore_private_key (struct ESCROW_PluginOperationWrapper *plugin_op_wrap, 1315restore_private_key (struct ESCROW_PluginOperationWrapper *plugin_op_wrap,
1316 struct GNUNET_ESCROW_Anchor *anchor, // TODO: use anchor?? 1316 struct GNUNET_ESCROW_Anchor *anchor,
1317 PkContinuation cont, 1317 PkContinuation cont,
1318 void *cont_cls) 1318 void *cont_cls)
1319{ 1319{
@@ -1333,6 +1333,7 @@ restore_private_key (struct ESCROW_PluginOperationWrapper *plugin_op_wrap,
1333 p_op->restored_keyshares = GNUNET_malloc (sizeof (sss_Keyshare) * p_op->shares); 1333 p_op->restored_keyshares = GNUNET_malloc (sizeof (sss_Keyshare) * p_op->shares);
1334 // ensure that the array is initialized with 0, as this is needed for counting the shares 1334 // ensure that the array is initialized with 0, as this is needed for counting the shares
1335 memset (p_op->restored_keyshares, 0, sizeof (sss_Keyshare) * p_op->shares); 1335 memset (p_op->restored_keyshares, 0, sizeof (sss_Keyshare) * p_op->shares);
1336 p_op->userSecret = get_user_secret_from_anchor (anchor);
1336 1337
1337 label = get_label (p_op->userSecret); 1338 label = get_label (p_op->userSecret);
1338 1339
@@ -1341,7 +1342,7 @@ restore_private_key (struct ESCROW_PluginOperationWrapper *plugin_op_wrap,
1341 1342
1342 for (uint8_t i = 0; i < p_op->shares; i++) 1343 for (uint8_t i = 0; i < p_op->shares; i++)
1343 { 1344 {
1344 curr_escrow_pk = derive_private_key (p_op->egoName, p_op->userSecret, i); 1345 curr_escrow_pk = derive_private_key (anchor->egoName, p_op->userSecret, i);
1345 1346
1346 curr_gns_lr = GNUNET_new (struct GnsLookupRequestEntry); 1347 curr_gns_lr = GNUNET_new (struct GnsLookupRequestEntry);
1347 curr_gns_lr->plugin_op_wrap = plugin_op_wrap; 1348 curr_gns_lr->plugin_op_wrap = plugin_op_wrap;
@@ -1442,7 +1443,6 @@ verify_gns_key_escrow (struct GNUNET_ESCROW_Handle *h,
1442 p_op->cont = cb; 1443 p_op->cont = cb;
1443 p_op->ego = ego; 1444 p_op->ego = ego;
1444 p_op->egoName = GNUNET_strdup (ego->name); 1445 p_op->egoName = GNUNET_strdup (ego->name);
1445 p_op->userSecret = get_user_secret_from_anchor (anchor);
1446 1446
1447 w = GNUNET_new (struct ESCROW_Plugin_VerifyContinuationWrapper); 1447 w = GNUNET_new (struct ESCROW_Plugin_VerifyContinuationWrapper);
1448 w->h = h; 1448 w->h = h;
@@ -1597,7 +1597,6 @@ restore_gns_key_escrow (struct GNUNET_ESCROW_Handle *h,
1597 // set cont here (has to be scheduled from the IDENTITY service when it finished) 1597 // set cont here (has to be scheduled from the IDENTITY service when it finished)
1598 p_op->cont = cb; 1598 p_op->cont = cb;
1599 p_op->egoName = GNUNET_strdup (anchor->egoName); 1599 p_op->egoName = GNUNET_strdup (anchor->egoName);
1600 p_op->userSecret = get_user_secret_from_anchor (anchor);
1601 1600
1602 w = GNUNET_new (struct ESCROW_Plugin_EgoContinuationWrapper); 1601 w = GNUNET_new (struct ESCROW_Plugin_EgoContinuationWrapper);
1603 w->h = h; 1602 w->h = h;