summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-01-21 21:42:23 +0100
committerChristian Grothoff <christian@grothoff.org>2022-01-21 21:42:23 +0100
commitff8f70962f43cfe01ab9444cae77b4301f3b171a (patch)
treebe1bc74e0455d0f312e2696978442bf4317adbbb /src
parent77ccde74a92c64f5fb4d164b67effd26e244c123 (diff)
downloadanastasis-ff8f70962f43cfe01ab9444cae77b4301f3b171a.tar.gz
anastasis-ff8f70962f43cfe01ab9444cae77b4301f3b171a.tar.bz2
anastasis-ff8f70962f43cfe01ab9444cae77b4301f3b171a.zip
-get test to pass again
Diffstat (limited to 'src')
-rwxr-xr-xsrc/cli/test_anastasis_reducer_recovery_no_pay.sh17
-rw-r--r--src/lib/anastasis_recovery.c5
-rw-r--r--src/reducer/anastasis_api_recovery_redux.c4
3 files changed, 22 insertions, 4 deletions
diff --git a/src/cli/test_anastasis_reducer_recovery_no_pay.sh b/src/cli/test_anastasis_reducer_recovery_no_pay.sh
index a80b030..6a1ed0f 100755
--- a/src/cli/test_anastasis_reducer_recovery_no_pay.sh
+++ b/src/cli/test_anastasis_reducer_recovery_no_pay.sh
@@ -220,7 +220,6 @@ anastasis-reducer -a '{"provider_url" : "http://localhost:8086/" }' add_provider
echo " OK"
echo -n "Selecting secret to recover"
-bash
anastasis-reducer -a '{"version": 0, "mask": 0, "provider_url" : "http://localhost:8086/" }' next < $R1FILE > $R2FILE
STATE=`jq -r -e .recovery_state < $R2FILE`
@@ -230,6 +229,22 @@ then
fi
echo " OK"
+echo -n "Synchronizing providers"
+anastasis-reducer sync_providers < $R2FILE > $R1FILE
+anastasis-reducer sync_providers < $R1FILE > $R2FILE
+# This one will fail, as we should now have all 3 providers
+# used by the policy in sync!
+anastasis-reducer sync_providers < $R2FILE > $R1FILE 2> /dev/null || true
+# Note: continue with $R2FILE, the last one that was valid!
+
+CODE=`jq -r -e .code < $R1FILE`
+if test "$CODE" != "8400"
+then
+ exit_fail "Expected to be synced, instead the code is '$CODE'"
+fi
+echo " OK"
+
+
echo -n "Running challenge logic ..."
UUID0=`jq -r -e .recovery_information.challenges[0].uuid < $R2FILE`
diff --git a/src/lib/anastasis_recovery.c b/src/lib/anastasis_recovery.c
index 3a7943e..9e5d1ca 100644
--- a/src/lib/anastasis_recovery.c
+++ b/src/lib/anastasis_recovery.c
@@ -1095,7 +1095,7 @@ ANASTASIS_recovery_serialize (const struct ANASTASIS_Recovery *r)
* @param cs_arr serialized data to parse
* @return #GNUNET_OK on success
*/
-static int
+static enum GNUNET_GenericReturnValue
parse_cs_array (struct ANASTASIS_Recovery *r,
json_t *cs_arr)
{
@@ -1173,7 +1173,6 @@ parse_cs_array (struct ANASTASIS_Recovery *r,
}
}
}
-
return GNUNET_OK;
}
@@ -1185,7 +1184,7 @@ parse_cs_array (struct ANASTASIS_Recovery *r,
* @param dps_arr serialized data to parse
* @return #GNUNET_OK on success
*/
-static int
+static enum GNUNET_GenericReturnValue
parse_dps_array (struct ANASTASIS_Recovery *r,
json_t *dps_arr)
{
diff --git a/src/reducer/anastasis_api_recovery_redux.c b/src/reducer/anastasis_api_recovery_redux.c
index 86f05e4..5f087f3 100644
--- a/src/reducer/anastasis_api_recovery_redux.c
+++ b/src/reducer/anastasis_api_recovery_redux.c
@@ -1990,6 +1990,10 @@ sync_progress (void *cls,
struct SyncEntry *se = cls;
struct MasterSync *ms = se->ms;
+ GNUNET_CONTAINER_DLL_remove (ms->se_head,
+ ms->se_tail,
+ se);
+ GNUNET_free (se);
ms->cb (ms->cb_cls,
error,
new_state);