gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated (f7e2529 -> eb4a3aa)


From: gnunet
Subject: [taler-anastasis] branch master updated (f7e2529 -> eb4a3aa)
Date: Fri, 06 Nov 2020 18:06:25 +0100

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a change to branch master
in repository anastasis.

    from f7e2529  move SQL table creation/destruction into resource files and 
enable GNUnet-style SQL versioning
     new e412d24  add insurance to config
     new 685b531  description
     new dd798cc  reducer - better error handling
     new df5de8f  reducer - worked on payment/upload
     new 2604eaa  initialize truths
     new bc0225d  work on truth upload
     new 411374e  Merge branch 'master' of ssh://git.taler.net/anastasis
     new eb4a3aa  fix db, fix reducer

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/backend/anastasis-httpd.c              |  17 +
 src/backend/anastasis-httpd.h              |   5 +
 src/backend/anastasis-httpd_config.c       |  74 ++--
 src/backend/anastasis.conf                 |   3 +
 src/include/anastasis_redux.h              |   2 +
 src/include/anastasis_service.h            |   4 +-
 src/lib/Makefile.am                        |   1 +
 src/lib/anastasis_api_backup_redux.c       | 649 +++++++++++++++++++++++++++--
 src/lib/anastasis_api_config.c             |  20 +-
 src/lib/anastasis_api_redux.c              | 196 ++++++++-
 src/stasis/plugin_anastasis_postgres.c     |   2 +-
 src/stasis/test_anastasis_db_postgres.conf |   2 +-
 12 files changed, 877 insertions(+), 98 deletions(-)

diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c
index c5d56d5..6f9e529 100644
--- a/src/backend/anastasis-httpd.c
+++ b/src/backend/anastasis-httpd.c
@@ -55,6 +55,11 @@ char *AH_supported_methods;
  */
 struct TALER_Amount AH_annual_fee;
 
+/**
+ * Amount of insurance.
+ */
+struct TALER_Amount AH_insurance;
+
 const struct GNUNET_CONFIGURATION_Handle *AH_cfg;
 
 /**
@@ -560,6 +565,18 @@ run (void *cls,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
+  if (GNUNET_OK !=
+      TALER_config_get_amount (config,
+                               "anastasis",
+                               "INSURANCE",
+                               &AH_insurance))
+  {
+    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+                               "anastasis",
+                               "INSURANCE");
+    GNUNET_SCHEDULER_shutdown ();
+    return;
+  }
   if (GNUNET_OK !=
       TALER_config_get_amount (config,
                                "anastasis",
diff --git a/src/backend/anastasis-httpd.h b/src/backend/anastasis-httpd.h
index b0b6fba..b475bf4 100644
--- a/src/backend/anastasis-httpd.h
+++ b/src/backend/anastasis-httpd.h
@@ -144,6 +144,11 @@ extern unsigned long long AH_upload_limit_mb;
  */
 extern struct TALER_Amount AH_annual_fee;
 
+/**
+ * Amount of insurance.
+ */
+extern struct TALER_Amount AH_insurance;
+
 /**
  * Cost of authentication by question
  */
diff --git a/src/backend/anastasis-httpd_config.c 
b/src/backend/anastasis-httpd_config.c
index 97b184c..3517586 100644
--- a/src/backend/anastasis-httpd_config.c
+++ b/src/backend/anastasis-httpd_config.c
@@ -38,77 +38,70 @@ AH_handler_config (struct TMH_RequestHandler *rh,
 {
   json_t *methods = json_object ();
   json_t *method_arr = json_array ();
+  struct ANASTASIS_CRYPTO_PowSalt salt;
 
   if (! method_arr)
     return MHD_HTTP_BAD_GATEWAY;
+  GNUNET_memcpy (&salt,
+                 AH_server_salt,
+                 strlen (AH_server_salt));
 
   if (strstr (AH_supported_methods, "question"))
   {
-    json_t *question = json_object ();
+    json_t *question = json_pack ("{s:s, s:o}",
+                                  "method",
+                                  "question",
+                                  "cost",
+                                  TALER_JSON_from_amount (&AH_question_cost));
 
-    json_object_set_new (question,
-                         "method",
-                         json_string ("question"));
-    json_object_set_new (question,
-                         "cost",
-                         TALER_JSON_from_amount (&AH_question_cost));
     GNUNET_assert (
       0 ==
       json_array_append_new (method_arr, question));
   }
   if (strstr (AH_supported_methods, "sms"))
   {
-    json_t *sms = json_object ();
+    json_t *sms = json_pack ("{s:s, s:o}",
+                             "method",
+                             "sms",
+                             "cost",
+                             TALER_JSON_from_amount (&AH_sms_cost));
 
-    json_object_set_new (sms,
-                         "method",
-                         json_string ("sms"));
-    json_object_set_new (sms,
-                         "cost",
-                         TALER_JSON_from_amount (&AH_sms_cost));
     GNUNET_assert (
       0 ==
       json_array_append_new (method_arr, sms));
   }
   if (strstr (AH_supported_methods, "email"))
   {
-    json_t *email = json_object ();
+    json_t *email = json_pack ("{s:s, s:o}",
+                               "method",
+                               "email",
+                               "cost",
+                               TALER_JSON_from_amount (&AH_email_cost));
 
-    json_object_set_new (email,
-                         "method",
-                         json_string ("email"));
-    json_object_set_new (email,
-                         "cost",
-                         TALER_JSON_from_amount (&AH_email_cost));
     GNUNET_assert (
       0 ==
       json_array_append_new (method_arr, email));
   }
   if (strstr (AH_supported_methods, "video"))
   {
-    json_t *video = json_object ();
+    json_t *video = json_pack ("{s:s, s:o}",
+                               "method",
+                               "video",
+                               "cost",
+                               TALER_JSON_from_amount (&AH_video_cost));
 
-    json_object_set_new (video,
-                         "method",
-                         json_string ("video"));
-    json_object_set_new (video,
-                         "cost",
-                         TALER_JSON_from_amount (&AH_video_cost));
     GNUNET_assert (
       0 ==
       json_array_append_new (method_arr, video));
   }
   if (strstr (AH_supported_methods, "post"))
   {
-    json_t *post = json_object ();
+    json_t *post = json_pack ("{s:s, s:o}",
+                              "method",
+                              "post",
+                              "cost",
+                              TALER_JSON_from_amount (&AH_post_cost));
 
-
-    json_object_set_new (post,
-                         "method",
-                         json_string ("post"));
-    json_object_set_new (post,
-                         "cost",
-                         TALER_JSON_from_amount (&AH_post_cost));
     GNUNET_assert (
       0 ==
       json_array_append_new (method_arr, post));
@@ -116,8 +109,9 @@ AH_handler_config (struct TMH_RequestHandler *rh,
   json_object_set_new (methods, "methods", method_arr);
   return TALER_MHD_reply_json_pack (connection,
                                     MHD_HTTP_OK,
-                                    "{s:s, s:s, s:I, s:s, s:o, s:s}",
-                                    "name", "anastasis",
+                                    "{s:s, s:s, s:I, s:s, s:o, s:o, s:o, s:s}",
+                                    "name",
+                                    "anastasis",
                                     "methods",
                                     json_dumps (methods, JSON_COMPACT),
                                     "storage_limit_in_megabytes",
@@ -126,6 +120,10 @@ AH_handler_config (struct TMH_RequestHandler *rh,
                                     (char *) AH_currency,
                                     "annual_fee",
                                     TALER_JSON_from_amount (&AH_annual_fee),
+                                    "insurance",
+                                    TALER_JSON_from_amount (&AH_insurance),
+                                    "server_salt",
+                                    GNUNET_JSON_from_data_auto (&salt),
                                     "version", "0:0:0");
 }
 
diff --git a/src/backend/anastasis.conf b/src/backend/anastasis.conf
index eef9860..c76e94a 100644
--- a/src/backend/anastasis.conf
+++ b/src/backend/anastasis.conf
@@ -29,6 +29,9 @@ DB = postgres
 # Annual fee for an account
 ANNUAL_FEE = TESTKUDOS:0.1
 
+# Insurance
+INSURANCE = TESTKUDOS:1.0
+
 # Upload limit per backup, in megabytes
 UPLOAD_LIMIT_MB = 16
 
diff --git a/src/include/anastasis_redux.h b/src/include/anastasis_redux.h
index 61d151c..d7e8050 100644
--- a/src/include/anastasis_redux.h
+++ b/src/include/anastasis_redux.h
@@ -25,8 +25,10 @@
 
 #include <jansson.h>
 #include <gnunet/gnunet_util_lib.h>
+#include <taler/taler_mhd_lib.h>
 #include "anastasis_error_codes.h"
 #include "anastasis_service.h"
+#include "anastasis.h"
 #include <regex.h>
 
 #define ANASTASIS_GENERIC_STATES(REDUX_STATE) \
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 2a3411c..52bb12f 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -243,7 +243,9 @@ typedef void
                             unsigned int http_status,
                             const json_t *methods,
                             const char *conf_currency,
-                            const struct TALER_Amount *annual_fee);
+                            const struct TALER_Amount *annual_fee,
+                            const struct TALER_Amount *insurance,
+                            const struct ANASTASIS_CRYPTO_PowSalt 
*server_salt);
 
 
 /**
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index bab381d..eabe66a 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -111,6 +111,7 @@ libanastasisredux_la_LIBADD = \
   -lgnunetjson \
   -lgnunetcurl \
   -lgnunetutil \
+  -ltalermhd \
   -ltalerutil \
   -ltalerjson \
   -lanastasisrest \
diff --git a/src/lib/anastasis_api_backup_redux.c 
b/src/lib/anastasis_api_backup_redux.c
index 8814956..54c7d28 100644
--- a/src/lib/anastasis_api_backup_redux.c
+++ b/src/lib/anastasis_api_backup_redux.c
@@ -82,6 +82,69 @@ ANASTASIS_backup_state_to_string (enum ANASTASIS_BackupState 
bs)
 }
 
 
+/**
+ * State for a "truth upload" CMD.
+ */
+struct TruthUploadState
+{
+  /**
+   * URL of the anastasis backend.
+   */
+  const char *anastasis_url;
+
+  /**
+   * The ID data to generate user identifier
+   */
+  const json_t *id_data;
+
+  /**
+   * The escrow method
+   */
+  const char *method;
+
+  /**
+   * Instructions to be returned to client/user
+   * (e.g. "Look at your smartphone. SMS was sent to you")
+   */
+  const char *instructions;
+
+  /**
+   * Mime type of truth_data (eg. jpeg, string etc.)
+   */
+  const char *mime_type;
+
+  /**
+   * The truth_data (e.g. hash of answer to a secure question)
+   */
+  const void *truth_data;
+
+  /**
+   * Size of truth_data
+   */
+  size_t truth_data_size;
+
+  /**
+   * Expected status code.
+   */
+  unsigned int http_status;
+
+  /**
+   * The /truth POST operation handle.
+   */
+  struct ANASTASIS_TruthUpload *tuo;
+
+  /**
+   * closure for the payment callback
+   */
+  void *tpc_cls;
+
+  /**
+   * Truth object
+   */
+  struct ANASTASIS_Truth *truth;
+};
+
+
 /**
  * Callback function FIXME: Description.
  *
@@ -111,8 +174,9 @@ set_state (json_t *state,
 
 
 /**
- * Returns an initial ANASTASIS backup state.
+ * Returns an initial ANASTASIS backup state (CONTINENT_SELECTING).
  *
+ * @param cfg handle for gnunet configuration
  * @return NULL on failure
  */
 json_t *
@@ -170,6 +234,18 @@ ANASTASIS_backup_start (const struct 
GNUNET_CONFIGURATION_Handle *cfg)
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "add_authentication" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 add_authentication (json_t *state,
                     const json_t *arguments,
@@ -177,9 +253,52 @@ add_authentication (json_t *state,
                     ANASTASIS_ActionCallback cb,
                     void *cb_cls)
 {
+  json_t *auth_providers = json_object_get (state,
+                                            "authentication_providers");
+
+  GNUNET_assert (NULL != auth_providers);
   json_t *method = json_object_get (arguments, "authentication_method");
-  GNUNET_assert (NULL != method); // FIXME: cb with error code (text: 
authentication_method required)
-  // FIXME: validate 'method' is well-formed!
+
+  if (NULL == method)
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Authentication method required!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
+  const char *method_type = json_string_value (json_object_get (method,
+                                                                "method"));
+  if (! json_object_get (auth_providers,
+                         method_type))
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_PARAMETER_MALFORMED,
+                               "hint",
+                               "Authentication method not supported!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
+  if (! json_object_get (method,
+                         "data"))
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_PARAMETER_MALFORMED,
+                               "hint",
+                               "Authentication data missing!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
   json_t *auth_method_arr = json_object_get (state,
                                              "authentication_methods");
   if (NULL == auth_method_arr)
@@ -189,7 +308,6 @@ add_authentication (json_t *state,
   GNUNET_assert (0 == json_object_set (state,
                                        "authentication_methods",
                                        auth_method_arr));
-
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       state);
@@ -421,6 +539,18 @@ method_candidate (struct PolicyBuilder *pb,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "done_authentication" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 done_authentication (json_t *state,
                      const json_t *arguments,
@@ -476,6 +606,18 @@ done_authentication (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "del_authentication" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 del_authentication (json_t *state,
                     const json_t *arguments,
@@ -483,40 +625,38 @@ del_authentication (json_t *state,
                     ANASTASIS_ActionCallback cb,
                     void *cb_cls)
 {
-  json_t *method;
-  size_t arr_index;
-  GNUNET_assert (NULL != arguments);
-  json_t *method_arr = json_deep_copy (json_object_get (state,
-                                                        
"authentication_methods"));
-  GNUNET_assert (NULL != method_arr);
-  json_t *del_method = json_object_get (arguments, "authentication_method");
-  GNUNET_assert (NULL != del_method);
-
-  json_array_foreach (method_arr, arr_index, method)
+  if (NULL == arguments)
   {
-    json_t *method_type = json_object_get (method, "method");
-    if (1 == json_equal (method_type, json_object_get (del_method, "method")))
-    {
-      const char *key;
-      json_t *value;
-      json_t *method_data = json_object_get (method, "data");
-      GNUNET_assert (NULL != method_data);
-      json_t *del_method_value = json_object_get (del_method, "value");
-      GNUNET_assert (NULL != del_method_value);
-
-      json_object_foreach (method_data, key, value)
-      {
-        if (1 == json_equal (del_method_value, value))
-        {
-          GNUNET_assert (0 == json_array_remove (method_arr, arr_index));
-          break;
-        }
-      }
-    }
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Arguments missing!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
   }
-  GNUNET_assert (0 == json_object_set_new (state,
-                                           "authentication_methods",
-                                           method_arr));
+  size_t index = (size_t) json_integer_value (
+    json_object_get (arguments,
+                     "auth_method_index"));
+  json_t *auth_method_arr = json_object_get (state,
+                                             "authentication_methods");
+
+  GNUNET_assert (json_is_array (auth_method_arr));
+  if (0 != json_array_remove (auth_method_arr, index))
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Operation failed");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
+
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       state);
@@ -524,6 +664,18 @@ del_authentication (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "add_policy" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 add_policy (json_t *state,
             const json_t *arguments,
@@ -531,6 +683,19 @@ add_policy (json_t *state,
             ANASTASIS_ActionCallback cb,
             void *cb_cls)
 {
+  if (NULL == arguments)
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Arguments missing!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
+
   size_t index;
   json_t *method;
   struct TALER_Amount recovery_cost;
@@ -546,8 +711,18 @@ add_policy (json_t *state,
   GNUNET_assert (json_is_array (policies));
   json_t *arg_array = json_object_get (arguments,
                                        "policy");
-
-  GNUNET_assert (json_is_array (arg_array));
+  if (! json_is_array (arg_array))
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_PARAMETER_MALFORMED,
+                               "hint",
+                               "Policy is malformed!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
   GNUNET_assert (GNUNET_OK ==
                  TALER_amount_get_zero (
                    json_string_value (json_object_get (state,
@@ -624,6 +799,18 @@ add_policy (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "del_policy" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 del_policy (json_t *state,
             const json_t *arguments,
@@ -631,7 +818,38 @@ del_policy (json_t *state,
             ANASTASIS_ActionCallback cb,
             void *cb_cls)
 {
-  // FIXME: implement
+  if (NULL == arguments)
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Arguments missing!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
+
+  size_t index = (size_t) json_integer_value (
+    json_object_get (arguments,
+                     "policy_index"));
+  json_t *policy_arr = json_object_get (state,
+                                        "policies");
+
+  GNUNET_assert (json_is_array (policy_arr));
+  if (0 != json_array_remove (policy_arr, index))
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Operation failed");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       state);
@@ -639,6 +857,18 @@ del_policy (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "done_policy_review" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 done_policy_review (json_t *state,
                     const json_t *arguments,
@@ -646,7 +876,11 @@ done_policy_review (json_t *state,
                     ANASTASIS_ActionCallback cb,
                     void *cb_cls)
 {
-  // FIXME: implement
+  GNUNET_assert (NULL != state);
+  set_state (state,
+             ANASTASIS_backup_state_to_string (
+               ANASTASIS_BACKUP_STATE_SECRET_EDITING));
+
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       state);
@@ -654,6 +888,203 @@ done_policy_review (json_t *state,
 }
 
 
+/**
+ * Initialize data for #ANASTASIS_truth_upload.
+ *
+ * @param state actual state to extract truth information from.
+ * @return json containing truth information
+ */
+static json_t *
+initialize_truths (json_t *state)
+{
+  size_t policy_index;
+  json_t *policy;
+  json_t *truths = json_array ();
+
+  GNUNET_assert (json_is_array (truths));
+  json_t *authentication_methods =
+    json_object_get (state,
+                     "authentication_methods");
+
+  GNUNET_assert (json_is_array (authentication_methods));
+  json_t *provider_methods = json_object_get (state,
+                                              "authentication_providers");
+
+  GNUNET_assert (NULL != provider_methods);
+  json_t *policy_json_array = json_object_get (state,
+                                               "policies");
+
+  GNUNET_assert (json_is_array (policy_json_array));
+  json_array_foreach (policy_json_array, policy_index, policy)
+  {
+    size_t index;
+    json_t *method;
+    json_t *policy_methods = json_object_get (policy,
+                                              "methods");
+
+    GNUNET_assert (json_is_array (policy_methods));
+    json_array_foreach (policy_methods, index, method)
+    {
+      const char *instructions;
+      const char *mime_type;
+      const char *backend_url;
+      const char *backend_salt;
+      size_t provider_index;
+      size_t check_index;
+      json_t *check_truth;
+      json_t *supported_provider;
+      size_t auth_method_index = json_integer_value (
+        json_object_get (method,
+                         "authentication_method"));
+      json_t *auth_method = json_array_get (authentication_methods,
+                                            auth_method_index);
+      GNUNET_assert (NULL != auth_method);
+      const char *method = json_string_value (json_object_get (auth_method,
+                                                               "method"));
+      json_t *truth_data = json_object_get (auth_method,
+                                            "data");
+      const char *backend_id = json_string_value (json_object_get (method,
+                                                                   
"provider"));
+      json_t *supported_providers = json_object_get (provider_methods,
+                                                     method);
+
+      GNUNET_assert (json_is_array (supported_providers));
+      json_array_foreach (supported_providers, provider_index,
+                          supported_provider)
+      {
+        json_t *provider_data =
+          json_object_get (supported_provider,
+                           backend_id);
+        if (NULL != provider_data)
+        {
+          backend_url = json_object_get (provider_data,
+                                         "provider_url");
+          backend_salt = json_string_value (json_object_get (provider_data,
+                                                             "provider_salt"));
+          break;
+        }
+      }
+
+      if (0 == strcmp (method, "question"))
+      {
+        instructions = json_string_value (json_object_get (truth_data,
+                                                           "question"));
+        mime_type = "text";
+      }
+      else if (0 == strcmp (method, "sms"))
+      {
+        instructions = "Please look at your phone.";
+        mime_type = "text";
+      }
+      else if (0 == strcmp (method, "email"))
+      {
+        instructions = "Please look at your emails.";
+        mime_type = "text";
+      }
+      else if (0 == strcmp (method, "post"))
+      {
+        instructions = "Please look into your post box.";
+        mime_type = "text";
+      }
+      else if (0 == strcmp (method, "video"))
+      {
+        instructions = "Please look into the camera.";
+        mime_type = "image";
+      }
+      else
+      {
+        GNUNET_break (0);
+        return NULL;
+      }
+
+      json_t *truth = json_pack ("{s:I, s:s, s:s, s:s, s:o, s:s, s:s, s:s}",
+                                 "auth_method_index",
+                                 (json_int_t) auth_method_index,
+                                 "backend_url",
+                                 backend_url,
+                                 "backend_id",
+                                 backend_id,
+                                 "method",
+                                 method,
+                                 "truth_data",
+                                 truth_data,
+                                 "instructions",
+                                 instructions,
+                                 "mime_type",
+                                 mime_type,
+                                 "backend_salt");
+      // check if truths allready contains this truth
+      bool existing = false;
+      json_array_foreach (truths, check_index, check_truth)
+      {
+        if (1 == json_equal (truth, check_truth))
+        {
+          existing = true;
+          break;
+        }
+      }
+      if (! existing)
+        GNUNET_assert (0 == json_array_append_new (truths, truth));
+    }
+  }
+  return truths;
+}
+
+
+/**
+* Upload information
+* caller MUST free 't' using ANASTASIS_truth_free()
+*
+* @param cls closure for callback
+* @param t Truth object (contains provider url and truth public key)
+*/
+static void
+truth_upload_cb (void *cls,
+                 struct ANASTASIS_Truth *t)
+{
+  struct TruthUploadState *tus = cls;
+  tus->tuo = NULL;
+
+  if (NULL == t)
+  {
+    GNUNET_break (0);
+    return;
+  }
+  tus->truth = t;
+}
+
+
+/**
+ * Initiates a callback for the payment of the truth upload
+ *
+ * @param cls closure
+ * @param taler_pay_url payment link for the transaction (taler://pay/Foo)
+ * @param ec status code of the request
+ */
+static void
+truth_payment_cb (void *cls,
+                  const char *taler_pay_url,
+                  enum TALER_ErrorCode ec)
+{
+  struct TruthUploadState *tus = cls;
+  tus->tuo = NULL;
+  // FIXME: Payment handling
+  return;
+}
+
+
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "enter_secret" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 enter_secret (json_t *state,
               const json_t *arguments,
@@ -661,7 +1092,102 @@ enter_secret (json_t *state,
               ANASTASIS_ActionCallback cb,
               void *cb_cls)
 {
-  // FIXME: implement
+  if (NULL == arguments)
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Arguments missing!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
+  GNUNET_assert (NULL != state);
+
+  if ((NULL == json_object_get (arguments,"secret"))
+      || (NULL == json_object_get (arguments, "type")))
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_PARAMETER_MALFORMED,
+                               "hint",
+                               "Secret is malformed!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
+  GNUNET_assert (0 ==
+                 json_object_set (state,
+                                  "core_secret",
+                                  arguments));
+  // {
+  //   // upload truths
+  //   size_t truth_index;
+  //   json_t *truth;
+  //   json_t *truths = initialize_truths (state);
+
+  //   GNUNET_assert (json_is_array (truths));
+  //   json_array_foreach (truths, truth_index, truth)
+  //   {
+  //     struct TruthUploadState *tus = GNUNET_new (struct TruthUploadState);
+  //     struct ANASTASIS_CRYPTO_PowSalt backend_salt;
+  //     struct ANASTASIS_CRYPTO_UserIdentifierP user_id;
+  //     const char *backend_url = json_string_value (json_object_get (truth,
+  //                                                                   
"backend_url"));
+
+  //     tus->method = json_string_value (json_object_get (truth,
+  //                                                       "method"));
+  //     tus->instructions = json_string_value (json_object_get (truth,
+  //                                                             
"instructions"));
+  //     tus->mime_type = json_string_value (json_object_get (truth,
+  //                                                          "mime_type"));
+  //     const char *salt_str = json_string_value (json_object_get (truth,
+  //                                                                
"backen_salt"));
+  //     GNUNET_STRINGS_string_to_data (salt_str,
+  //                                    strlen (salt_str),
+  //                                    &backend_salt,
+  //                                    sizeof (struct 
ANASTASIS_CRYPTO_PowSalt));
+
+  //     tus->id_data = json_object_get (state,
+  //                                     "identity_attributes");
+
+  //     if (0 == strcmp ("question", tus->method))
+  //     {
+  //       json_t *truth_data = json_object_get (truth,
+  //                                             "truth_data");
+  //       // FIXME: hash secure question or salt into truth_data?
+  //       tus->truth_data = json_string_value (json_object_get (truth_data,
+  //                                                             "answer"));
+  //       tus->truth_data_size = strlen (tus->truth_data);
+  //     }
+  //     // FIXME: other method types
+
+  //     ANASTASIS_CRYPTO_user_identifier_derive (tus->id_data,
+  //                                              &backend_salt,
+  //                                              &user_id);
+  //     tus->tuo = ANASTASIS_truth_upload (ctx,
+  //                                        &user_id,
+  //                                        backend_url,
+  //                                        tus->method,
+  //                                        tus->mime_type,
+  //                                        &backend_salt,
+  //                                        tus->truth_data,
+  //                                        tus->truth_data_size,
+  //                                        &truth_payment_cb,
+  //                                        tus->tpc_cls,
+  //                                        &truth_upload_cb,
+  //                                        tus);
+  //   }
+  // }
+
+  // try uploading recovery document
+  set_state (state,
+             ANASTASIS_backup_state_to_string (
+               ANASTASIS_BACKUP_STATE_POLICIES_PAYING));
+
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       state);
@@ -669,6 +1195,18 @@ enter_secret (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "pay_policy" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 pay_policy (json_t *state,
             const json_t *arguments,
@@ -676,6 +1214,18 @@ pay_policy (json_t *state,
             ANASTASIS_ActionCallback cb,
             void *cb_cls)
 {
+  if (NULL == arguments)
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Arguments missing!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
   // FIXME: implement
   cb (cb_cls,
       ANASTASIS_EC_NONE,
@@ -684,6 +1234,18 @@ pay_policy (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "back" action if state is "FINISHED".
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 back_finished (json_t *state,
                const json_t *arguments,
@@ -692,6 +1254,11 @@ back_finished (json_t *state,
                void *cb_cls)
 {
   // FIXME: implement
+  GNUNET_assert (NULL != state);
+  set_state (state,
+             ANASTASIS_backup_state_to_string (
+               ANASTASIS_BACKUP_STATE_SECRET_EDITING));
+
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       state);
diff --git a/src/lib/anastasis_api_config.c b/src/lib/anastasis_api_config.c
index a1b5e6a..5c66868 100644
--- a/src/lib/anastasis_api_config.c
+++ b/src/lib/anastasis_api_config.c
@@ -64,6 +64,11 @@ struct ANASTASIS_ConfigOperation
    */
   struct TALER_Amount cost;
 
+  /**
+   * Insurance.
+   */
+  struct TALER_Amount insurance;
+
   /**
    * Supported methods.
    */
@@ -73,6 +78,11 @@ struct ANASTASIS_ConfigOperation
    * Currency of the cost;
    */
   const char *currency;
+
+  /**
+   * Server salt.
+   */
+  struct ANASTASIS_CRYPTO_PowSalt salt;
 };
 
 
@@ -106,7 +116,8 @@ handle_config_finished (void *cls,
       struct GNUNET_JSON_Specification spec[] = {
         GNUNET_JSON_spec_string ("currency", &co->currency),
         TALER_JSON_spec_amount ("annual_fee", &co->cost),
-        // FIXME add configs
+        TALER_JSON_spec_amount ("insurance", &co->insurance),
+        GNUNET_JSON_spec_fixed_auto ("server_salt", &co->salt),
         GNUNET_JSON_spec_end ()
       };
 
@@ -126,8 +137,11 @@ handle_config_finished (void *cls,
               response_code,
               co->methods,
               co->currency,
-              &co->cost
+              &co->cost,
+              &co->insurance,
+              &co->salt
               );
+      json_decref (co->methods);
       GNUNET_JSON_parse_free (spec);
       ANASTASIS_config_cancel (co);
       return;
@@ -158,6 +172,8 @@ handle_config_finished (void *cls,
             response_code,
             NULL,
             NULL,
+            NULL,
+            NULL,
             NULL);
     co->cb = NULL;
   }
diff --git a/src/lib/anastasis_api_redux.c b/src/lib/anastasis_api_redux.c
index 9a392d1..1959ae5 100644
--- a/src/lib/anastasis_api_redux.c
+++ b/src/lib/anastasis_api_redux.c
@@ -124,6 +124,11 @@ struct ConfigRequest
    */
   struct TALER_Amount backend_cost;
 
+  /**
+   * salt of the provider server used for generation of user identifier.
+   */
+  struct ANASTASIS_CRYPTO_PowSalt backend_salt;
+
   /**
    * Supported methods.
    */
@@ -161,13 +166,15 @@ const json_t *redux_id_attr;
 
 
 /**
- * Callback function FIXME: Description.
+ * Callback function which is called by the reducer in dependence of
+ * given state and action.
  *
- * @param state FIXME: Description
- * @param arguments FIXME: Description
+ * @param state the previous state to operate on
+ * @param arguments the arguments needed by operation to operate on state
  * @param ctx Curl context
- * @param cb FIXME: Description
- * @param cb_cls FIXME: Description
+ * @param cb Callback function which returns the new state
+ * @param cb_cls closure for @a cb
+ * @return handle to cancel async actions, NULL if @a cb was already called
  */
 typedef struct ANASTASIS_ReduxAction *
 (*DispatchHandler)(json_t *state,
@@ -177,6 +184,11 @@ typedef struct ANASTASIS_ReduxAction *
                    void *cb_cls);
 
 
+/**
+ * Function to free a #ConfigRequest an async operation.
+ *
+ * @param cr state for a "get config" operation
+ */
 static void
 free_config_request (struct ConfigRequest *cr)
 {
@@ -185,11 +197,19 @@ free_config_request (struct ConfigRequest *cr)
   if (NULL != cr->tt)
     GNUNET_SCHEDULER_cancel (cr->tt);
   GNUNET_free (cr->backend_currency);
+  GNUNET_free (cr->backend_url);
+  GNUNET_free (cr->backend_id);
+  GNUNET_free (cr->backend_name);
   json_decref (cr->backend_methods);
   GNUNET_free (cr);
 }
 
 
+/**
+ * Function to free a #SelectCountryHandle.
+ *
+ * @param cls closure for a #SelectCountryHandle.
+ */
 static void
 free_select_country (void *cls)
 {
@@ -208,6 +228,13 @@ free_select_country (void *cls)
 }
 
 
+/**
+ * Adds the server configuration from async #ConfigRequest
+ * to the json state.
+ *
+ * @param cr the config request
+ * @param state the json state to operate on
+ */
 static void
 add_config_to_state (struct ConfigRequest *cr,
                      json_t *state)
@@ -245,17 +272,25 @@ add_config_to_state (struct ConfigRequest *cr,
                                           method_type,
                                           ma_arr = json_array ()));
     }
-    prov = json_pack ("{s:o, s:o, s:s, s:s}",
-                      // FIXME: add insurance here...
+    char *provider_salt = GNUNET_STRINGS_data_to_string_alloc (
+      &cr->backend_salt,
+      sizeof (struct
+              ANASTASIS_CRYPTO_PowSalt));
+    prov = json_pack ("{s:o, s:o, s:o, s:s, s:s, s:s}",
                       "method_cost",
                       json_object_get (method,
                                        "cost"),
                       "annual_cost",
                       TALER_JSON_from_amount (&cr->backend_cost),
+                      "insurance",
+                      TALER_JSON_from_amount (&cr->backend_insurance),
                       "provider_url",
                       cr->backend_url,
                       "provider_name",
-                      cr->backend_name);
+                      cr->backend_name,
+                      "provider_salt",
+                      provider_salt);
+    GNUNET_free (provider_salt);
     GNUNET_assert (0 == json_object_set_new (ma,
                                              cr->backend_id,
                                              prov));
@@ -264,6 +299,12 @@ add_config_to_state (struct ConfigRequest *cr,
 }
 
 
+/**
+ * Function which collects all configurations from the different
+ * servers and calls the #ANASTASIS_ActionCallback.
+ *
+ * @param sch a handle to a country selection action
+ */
 static void
 conclude_select_country (struct SelectCountryHandle *sch)
 {
@@ -294,10 +335,14 @@ conclude_select_country (struct SelectCountryHandle *sch)
   sch->cb (NULL,
            ANASTASIS_EC_NONE,
            sch->state);
-  // free_select_country (sch);
 }
 
 
+/**
+ * Retries a "get config" after timeout.
+ *
+ * @param cls closure for a "get config" request
+ */
 static void
 config_request_timeout (void *cls)
 {
@@ -317,13 +362,17 @@ config_request_timeout (void *cls)
  * @param http_status HTTP status of the request
  * @param methods supported methods by this provider
  * @param annual_fee Annual fee of this service
+ * @param insurance Amount of insurance of this service
+ * @param salt Salt of this provider server
  */
 static void
 config_cb (void *cls,
            unsigned int http_status,
            const json_t *methods,
            const char *conf_currency,
-           const struct TALER_Amount *annual_fee)
+           const struct TALER_Amount *annual_fee,
+           const struct TALER_Amount *insurance,
+           const struct ANASTASIS_CRYPTO_PowSalt *salt)
 {
   struct ConfigRequest *cr = cls;
   struct SelectCountryHandle *sch = cr->sch;
@@ -340,7 +389,8 @@ config_cb (void *cls,
     cr->backend_methods = json_incref ((json_t *) methods);
     cr->backend_cost = *annual_fee;
     cr->backend_currency = GNUNET_strdup (conf_currency);
-    // FIXME: set cr->backend_insurance?
+    cr->backend_insurance = *insurance;
+    cr->backend_salt = *salt;
   }
   conclude_select_country (sch);
 }
@@ -410,6 +460,7 @@ ANASTASIS_redux_countries_init_ (void)
 
 /**
  * Function to validate an AHV number.
+ *
  * @param ahv_number ahv number to validate
  * @param regexp regular expression to validate form of ahv number
  * @return true if validation passed, else false
@@ -544,6 +595,18 @@ redux_id_attr_init (const char *country_code)
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "select_continent" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 select_continent (json_t *state,
                   const json_t *arguments,
@@ -551,6 +614,19 @@ select_continent (json_t *state,
                   ANASTASIS_ActionCallback cb,
                   void *cb_cls)
 {
+  if (NULL == arguments)
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Arguments missing!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
+
   size_t index;
   json_t *country;
   json_t *redux_countries = ANASTASIS_redux_countries_init_ ();
@@ -599,6 +675,18 @@ select_continent (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "select_country" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return #ANASTASIS_ReduxAction
+ */
 static struct ANASTASIS_ReduxAction *
 select_country (json_t *state,
                 const json_t *arguments,
@@ -606,6 +694,19 @@ select_country (json_t *state,
                 ANASTASIS_ActionCallback cb,
                 void *cb_cls)
 {
+  if (NULL == arguments)
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Arguments missing!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
+
   json_t *root;
   json_t *provider_list;
   char *dn;
@@ -650,14 +751,14 @@ select_country (json_t *state,
   {
     char *path;
 
-    path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_PREFIX);
+    path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
     if (NULL == path)
     {
       GNUNET_break (0);
       return NULL;
     }
     GNUNET_asprintf (&dn,
-                     "%s/share/anastasis/provider-list.json",
+                     "%s/provider-list.json",
                      path);
     GNUNET_free (path);
   }
@@ -674,6 +775,7 @@ select_country (json_t *state,
     GNUNET_free (dn);
     return NULL;
   }
+  GNUNET_free (dn);
 
   // get configs from providers
   {
@@ -696,6 +798,7 @@ select_country (json_t *state,
                                                                       
"provider_name"));
       const char *provider_id = json_string_value (json_object_get (provider,
                                                                     
"provider_id"));
+
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Url is: %s\n", url);
       cr->backend_url = GNUNET_strdup (url);
@@ -720,6 +823,7 @@ select_country (json_t *state,
                                                cr);
       }
     }
+    json_decref (provider_list);
     conclude_select_country (sch);
     {
       struct ANASTASIS_ReduxAction *ra;
@@ -733,6 +837,18 @@ select_country (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "unselect_country" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 unselect_country (json_t *state,
                   const json_t *arguments,
@@ -756,6 +872,18 @@ unselect_country (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "unselect_continent" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 unselect_continent (json_t *state,
                     const json_t *arguments,
@@ -780,6 +908,18 @@ unselect_continent (json_t *state,
 }
 
 
+/**
+ * DispatchHandler/Callback function which is called for a
+ * "enter_user_attributes" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 static struct ANASTASIS_ReduxAction *
 enter_user_attributes (json_t *state,
                        const json_t *arguments,
@@ -787,7 +927,18 @@ enter_user_attributes (json_t *state,
                        ANASTASIS_ActionCallback cb,
                        void *cb_cls)
 {
-  GNUNET_assert (NULL != arguments);
+  if (NULL == arguments)
+  {
+    json_t *error = json_pack ("{s:I, s:s}",
+                               "code",
+                               (json_int_t) ANASTASIS_EC_INVALID,
+                               "hint",
+                               "Arguments missing!");
+    cb (cb_cls,
+        ANASTASIS_EC_INVALID,
+        error);
+    return NULL;
+  }
   json_t *attributes = json_object_get (arguments,
                                         "identity_attributes");
   GNUNET_assert (NULL != attributes);
@@ -855,6 +1006,18 @@ enter_user_attributes (json_t *state,
 }
 
 
+/**
+ * A generic DispatchHandler/Callback function which is called for a
+ * "back" action.
+ * Returns an #ANASTASIS_ReduxAction if operation is async.
+ *
+ * @param state state to operate on
+ * @param arguments arguments to use for operation on state
+ * @param ctx CURL context
+ * @param cb callback (#DispatchHandler) to call during/after operation
+ * @param cb_cls callback closure
+ * @return NULL
+ */
 struct ANASTASIS_ReduxAction *
 ANASTASIS_back_generic_decrement_ (json_t *state,
                                    const json_t *arguments,
@@ -1029,6 +1192,11 @@ ANASTASIS_redux_action (const json_t *state,
 }
 
 
+/**
+ * Function to cancel an async activity.
+ *
+ * @param ra generic container for async activities
+ */
 void
 ANASTASIS_redux_action_cancel (struct ANASTASIS_ReduxAction *ra)
 {
diff --git a/src/stasis/plugin_anastasis_postgres.c 
b/src/stasis/plugin_anastasis_postgres.c
index f9f4eed..edec66f 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -2096,7 +2096,7 @@ libanastasis_plugin_db_postgres_init (void *cls)
                             ",expiration"
                             ") VALUES "
                             "($1, $2, $3, $4, $5, $6);",
-                            7),
+                            6),
     GNUNET_PQ_make_prepare ("recovery_document_insert",
                             "INSERT INTO anastasis_recoverydocument "
                             "(user_id"
diff --git a/src/stasis/test_anastasis_db_postgres.conf 
b/src/stasis/test_anastasis_db_postgres.conf
index 8971a62..a1e3d88 100644
--- a/src/stasis/test_anastasis_db_postgres.conf
+++ b/src/stasis/test_anastasis_db_postgres.conf
@@ -1,6 +1,6 @@
 [anastasis]
 #The DB plugin to use
-DB = postgres
+DB = anastasischeck
 
 [taler]
 CURRENCY = EUR

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]