gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 02/03: worked on splitter


From: gnunet
Subject: [taler-anastasis] 02/03: worked on splitter
Date: Wed, 20 May 2020 23:51:49 +0200

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

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

commit 6a8d070446857c7334ae5058c82d94901fb1f57e
Author: Dennis Neufeld <address@hidden>
AuthorDate: Wed May 20 18:23:23 2020 +0000

    worked on splitter
---
 .gitignore                           |   4 +
 src/backend/anastasis-httpd_config.c |   2 +-
 src/backend/anastasis-httpd_truth.c  |   4 +-
 src/cli/anastasis-cli-assembler.c    |   2 +-
 src/cli/anastasis-cli-splitter.c     | 383 +++++++++++++++++++++++------------
 src/lib/test_anastasis.c             |   6 +-
 src/lib/test_anastasis_api.c         |   2 +-
 src/lib/test_anastasis_api.conf      |   2 +-
 8 files changed, 272 insertions(+), 133 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5c131a5..0364a3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,3 +96,7 @@ src/cli/anastasis-assembler
 src/cli/.deps/
 src/cli/.deps/anastasis-cli-splitter.Po
 src/cli/.deps/anastasis-cli-assembler.Po
+src/cli/.libs/
+src/cli/.libs/anastasis-assembler
+src/cli/.libs/anastasis-splitter
+
diff --git a/src/backend/anastasis-httpd_config.c 
b/src/backend/anastasis-httpd_config.c
index a33ef56..d5b0840 100644
--- a/src/backend/anastasis-httpd_config.c
+++ b/src/backend/anastasis-httpd_config.c
@@ -46,7 +46,7 @@ AH_handler_config (struct TMH_RequestHandler *rh,
                                     MHD_HTTP_OK,
                                     "{s:s, s:I, s:o, s:s}",
                                     "methods",
-                                    AH_supported_methods,
+                                    (char *) AH_supported_methods,
                                     "storage_limit_in_megabytes",
                                     (json_int_t) AH_upload_limit_mb,
                                     "annual_fee",
diff --git a/src/backend/anastasis-httpd_truth.c 
b/src/backend/anastasis-httpd_truth.c
index 350d621..e4e48fa 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -137,11 +137,11 @@ AH_handler_truth_get (struct MHD_Connection *connection,
   }
   {
     // validate challenge response
-    GNUNET_assert (strlen (method) == strlen ("Secure-Question"));
+    GNUNET_assert (strlen (method) == strlen ("question"));
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Method from db: %s\n",
                 method);
-    if (strncmp (method, "Secure-Question", strlen ("Secure-Question")) == 0)
+    if (strncmp (method, "question", strlen ("question")) == 0)
     {
       GNUNET_CRYPTO_hash_from_string (challenge_response_s,
                                       &challenge_response);
diff --git a/src/cli/anastasis-cli-assembler.c 
b/src/cli/anastasis-cli-assembler.c
index 95bcc12..c3b4425 100644
--- a/src/cli/anastasis-cli-assembler.c
+++ b/src/cli/anastasis-cli-assembler.c
@@ -425,7 +425,7 @@ run (void *cls,
   rc = GNUNET_CURL_gnunet_rc_create (ctx);
   // FIXME
   json_error_t error;
-  rss->id_data = json_load_file (import_id, JSON_DECODE_ANY,&error);
+  rss->id_data = json_load_file (import_id, JSON_DECODE_ANY, &error);
   rss->version = import_recovery_version;
   rss->anastasis_url = import_recovery_document;
   rss->http_status_salt = MHD_HTTP_OK;
diff --git a/src/cli/anastasis-cli-splitter.c b/src/cli/anastasis-cli-splitter.c
index df3277c..a1310eb 100644
--- a/src/cli/anastasis-cli-splitter.c
+++ b/src/cli/anastasis-cli-splitter.c
@@ -32,36 +32,6 @@
  */
 struct TruthUploadState
 {
-  /**
-   * URL of the anastasis backend.
-   */
-  char *backend_url;
-
-  /**
-   * label of the anastasis backend.
-   */
-  const char *backend_label;
-
-  /**
-   * supported methods of the anastasis backend.
-   */
-  const char *backend_methods;
-
-  /**
-   * server salt of the anastasis backend.
-   */
-  const struct ANASTASIS_CRYPTO_SaltP *backend_salt;
-
-  /**
-   * insurance of the anastasis backend.
-   */
-  const struct TALER_Amount *backend_insurance;
-
-  /**
-   * cost of using the anastasis backend.
-   */
-  const struct TALER_Amount *backend_cost;
-
   /**
    * Label of this command.
    */
@@ -75,38 +45,38 @@ struct TruthUploadState
   /**
    * The escrow method
    */
-  const char *method;
+  char *method;
 
   /**
    * A secret question
    */
-  const char *secret_question;
+  char *secret_question;
 
   /**
    * Answer to secret question
    */
-  const char *secret_answer;
+  char *secret_answer;
 
   /**
    * Phonenumber for method SMS
    */
-  const char *phone;
+  char *phone;
 
   /**
    * E-Mail address
    */
-  const char *mail;
+  char *mail;
 
   /**
    * Instructions to be returned to client/user
    * (e.g. "Look at your smartphone. SMS was sent to you")
    */
-  const char *instructions;
+  char *instructions;
 
   /**
    * Mime type of truth_data (eg. jpeg, string etc.)
    */
-  const char *mime_type;
+  char *mime_type;
 
   /**
    * The truth_data (e.g. hash of answer to a secure question)
@@ -144,6 +114,42 @@ struct TruthUploadState
   const struct ANASTASIS_Truth *truth;
 };
 
+/**
+ * Server information
+ */
+struct ServerInfo
+{
+  /**
+   * URL of the anastasis backend.
+   */
+  char *backend_url;
+
+  /**
+   * label of the anastasis backend.
+   */
+  const char *backend_label;
+
+  /**
+   * supported methods of the anastasis backend.
+   */
+  const char *backend_methods;
+
+  /**
+   * server salt of the anastasis backend.
+   */
+  const struct ANASTASIS_CRYPTO_SaltP *backend_salt;
+
+  /**
+   * insurance of the anastasis backend.
+   */
+  const struct TALER_Amount *backend_insurance;
+
+  /**
+   * cost of using the anastasis backend.
+   */
+  const struct TALER_Amount *backend_cost;
+};
+
 /**
  * State for a "salt" CMD.
  */
@@ -165,9 +171,9 @@ struct SaltState
   struct ANASTASIS_CRYPTO_SaltP salt;
 
   /**
-   * Reference to a TruthUploadState.
+   * Reference to a ServerInfo.
    */
-  struct TruthUploadState *tus;
+  struct ServerInfo *server;
 };
 
 /**
@@ -186,9 +192,9 @@ struct ConfigState
   struct ANASTASIS_ConfigOperation *co;
 
   /**
-   * Reference to a TruthUploadState.
+   * Reference to a ServerInfo.
    */
-  struct TruthUploadState *tus;
+  struct ServerInfo *server;
 
   /**
    * Cost.
@@ -198,7 +204,7 @@ struct ConfigState
   /**
    * Supported methods.
    */
-  const char *methods;
+  char *methods;
 
   // FIXME add configs
 };
@@ -206,7 +212,7 @@ struct ConfigState
 /**
  * Global option '--me' to import json containing details of user.
  */
-static int import_id;
+static char *import_id;
 
 /**
  * Global option '--import' to import json containing recovery document.
@@ -233,16 +239,73 @@ static struct GNUNET_CURL_RescheduleContext *rc;
  */
 static struct TruthUploadState *tu_states;
 
+/**
+ * Information about the servers.
+ */
+static struct ServerInfo *servers;
+
 /**
  * Amount of truth upload states
  */
 static unsigned int tu_states_length = 0;
 
+/**
+ * Amount of servers
+ */
+static unsigned int servers_length = 0;
+
 
 static void
 start_read_keyboard (void);
 
 
+/**
+ * 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
+  keyboard_task = NULL;
+  start_read_keyboard ();
+  return;
+}
+
+
+/**
+* Upload information
+* caller MUST free 't' using ANASTASIS_truth_free()
+*
+* @param cls closure for callback
+* @param t Truth object (contains provider url and uuid)
+*/
+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;
+  }
+  keyboard_task = NULL;
+  start_read_keyboard ();
+  return;
+
+}
+
+
 /**
  * Function called with the results of a #ANASTASIS_get_config().
  *
@@ -262,7 +325,7 @@ config_cb (void *cls,
   cs->co = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "At %s:%d url is %s\n", __FILE__, __LINE__,
-              cs->tus->backend_url);
+              cs->server->backend_url);
   if (http_status != cs->http_status)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -271,7 +334,9 @@ config_cb (void *cls,
                 __FILE__,
                 __LINE__);
     printf ("Server #%u is not available!\n",
-            tu_states_length);
+            servers_length);
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
   if (NULL == cost)
@@ -291,17 +356,20 @@ config_cb (void *cls,
     return;
   }
   cs->cost = *cost;
-  cs->methods = methods;
+  cs->methods = GNUNET_malloc (strlen (methods) + 1);
+  GNUNET_strlcpy (cs->methods,
+                  methods,
+                  strlen (methods) + 1);
   printf ("Server #%u is available\n",
-          tu_states_length);
+          servers_length);
 
-  cs->tus->backend_methods = cs->methods;
-  cs->tus->backend_cost = &cs->cost;
+  cs->server->backend_methods = cs->methods;
+  cs->server->backend_cost = &cs->cost;
   // FIXME add config max insurance amount
 
-  GNUNET_array_append (tu_states,
-                       tu_states_length,
-                       *cs->tus);
+  GNUNET_array_append (servers,
+                       servers_length,
+                       *cs->server);
   keyboard_task = NULL;
   start_read_keyboard ();
 }
@@ -325,7 +393,7 @@ salt_cb (void *cls,
   ss->so = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "At %s:%d url is %s\n", __FILE__, __LINE__,
-              ss->tus->backend_url);
+              ss->server->backend_url);
   if (http_status != ss->http_status)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -334,16 +402,18 @@ salt_cb (void *cls,
                 __FILE__,
                 __LINE__);
     printf ("Server #%u is not available!\n",
-            tu_states_length);
+            servers_length);
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
   ss->salt = *salt;
-  ss->tus->backend_salt = &ss->salt;
+  ss->server->backend_salt = &ss->salt;
 
-  cs->tus = ss->tus;
+  cs->server = ss->server;
   cs->http_status = MHD_HTTP_OK;
   cs->co = ANASTASIS_get_config (ctx,
-                                 cs->tus->backend_url,
+                                 cs->server->backend_url,
                                  config_cb,
                                  cs);
   if (NULL == cs->co)
@@ -384,6 +454,7 @@ read_keyboard_command (void *cls)
       GNUNET_SCHEDULER_shutdown ();
       free (buffer);
       buffer = NULL;
+      keyboard_task = NULL;
       return;
     case 'o':
       printf (
@@ -410,8 +481,10 @@ read_keyboard_command (void *cls)
                buffer[0]);
       GNUNET_free (buffer);
       buffer = NULL;
+      keyboard_task = NULL;
       break;
     }
+    keyboard_task = NULL;
     start_read_keyboard ();
     return;
   }
@@ -422,17 +495,17 @@ read_keyboard_command (void *cls)
       && (characters == strlen ("server")))
   {
     // FIXME "server" logic here
-    if (NULL != tu_states)
+    if (NULL != servers)
     {
-      for (unsigned int i = 0; i < tu_states_length; i++)
+      for (unsigned int i = 0; i < servers_length; i++)
       {
-        if (NULL != tu_states[i].backend_url)
+        if (NULL != servers[i].backend_url)
           printf ("server#%u: %s %s, insured up to: %s, cost: %s\n",
                   i,
-                  tu_states[i].backend_url,
-                  tu_states[i].backend_methods,
+                  servers[i].backend_url,
+                  servers[i].backend_methods,
                   "test_insurance_amount", // FIXME
-                  TALER_amount_to_string (tu_states[i].backend_cost)
+                  TALER_amount_to_string (servers[i].backend_cost)
                   );
       }
     }
@@ -441,6 +514,8 @@ read_keyboard_command (void *cls)
 
     free (buffer);
     buffer = NULL;
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
   if (0 == strncmp ("server add",
@@ -448,26 +523,24 @@ read_keyboard_command (void *cls)
                     strlen ("server add")))
   {
     // FIXME "server add" logic here
-    struct TruthUploadState *tus;
-    struct SaltState *ss;
+    struct ServerInfo *server = GNUNET_new (struct ServerInfo);
+    struct SaltState *ss = GNUNET_new (struct SaltState);
 
     size_t url_len = characters - strlen ("server add ");
-    ss = GNUNET_new (struct SaltState);
-    tus = GNUNET_new (struct TruthUploadState);
 
     char *url = &buffer[strlen ("server add ")];
-    tus->backend_url = GNUNET_malloc (url_len);
-    strncpy (tus->backend_url,
+    server->backend_url = GNUNET_malloc (url_len);
+    strncpy (server->backend_url,
              url,
              url_len);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "At %s:%d url is %s\n", __FILE__, __LINE__,
-                tus->backend_url);
+                server->backend_url);
 
     ss->http_status = MHD_HTTP_OK;
-    ss->tus = tus;
+    ss->server = server;
     ss->so = ANASTASIS_salt (ctx,
-                             tus->backend_url,
+                             server->backend_url,
                              salt_cb,
                              ss);
     if (NULL == ss->so)
@@ -475,9 +548,10 @@ read_keyboard_command (void *cls)
       GNUNET_break (0);
       return;
     }
-    start_read_keyboard ();
     GNUNET_free (buffer);
     buffer = NULL;
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
 
@@ -491,29 +565,29 @@ read_keyboard_command (void *cls)
     {
       for (unsigned int i = 0; i < tu_states_length; i++)
       {
-        if (NULL != tu_states[i].truth)
+        if ((NULL != tu_states[i].method) &&
+            (0 == strcmp ("sms", tu_states[i].method)))
+          printf ("truth#%u: %s %s\n",
+                  i,
+                  tu_states[i].method,
+                  tu_states[i].phone);
+        if ((NULL != tu_states[i].method) &&
+            (0 == strcmp ("question", tu_states[i].method)))
         {
-          if (0 == strcmp ("SMS", tu_states[i].method))
-            printf ("truth#%u: %s %s\n",
-                    i,
-                    tu_states[i].method,
-                    tu_states[i].phone);
-          if (0 == strcmp ("Secure-Question", tu_states[i].method))
-          {
-            printf ("truth#%u: %s \"%s\" <OMITTED>\n",
-                    i,
-                    tu_states[i].method,
-                    tu_states[i].secret_question);
-          }
+          printf ("truth#%u: %s \"%s\" <OMITTED>\n",
+                  i,
+                  tu_states[i].method,
+                  tu_states[i].secret_question);
         }
       }
     }
     else
       printf ("Please add a truth before!\n");
 
-    start_read_keyboard ();
     GNUNET_free (buffer);
     buffer = NULL;
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
   if (0 == strncmp ("truth add",
@@ -521,9 +595,9 @@ read_keyboard_command (void *cls)
                     strlen ("truth add")))
   {
     // FIXME "truth add" logic here
-    if (NULL != tu_states)
+    if (NULL != servers)
     {
-      // FIXME
+      struct TruthUploadState *tus = GNUNET_new (struct TruthUploadState);
       char *truth_details = &buffer[strlen ("truth add ")];
       char *token = strtok (truth_details, " ");
       int server_num;
@@ -540,58 +614,112 @@ read_keyboard_command (void *cls)
                     "At %s:%d server number is %u\n", __FILE__, __LINE__,
                     server_num);
         token = strtok (NULL, " ");
-        char *method = GNUNET_malloc (strlen (token));
-        strcpy (method, token);
+        tus->method = GNUNET_malloc (strlen (token) + 1);
+        GNUNET_strlcpy (tus->method,
+                        token,
+                        strlen (token) + 1);
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     "At %s:%d method is %s\n", __FILE__, __LINE__,
-                    method);
+                    tus->method);
 
-        if (NULL != strstr (tu_states[server_num].backend_methods,
-                            method))
+        if (NULL != strstr (servers[server_num].backend_methods,
+                            tus->method))
         {
-          if (0 == strcmp ("question", method))
+          if (0 == strcmp ("question", tus->method))
           {
             token = strtok (NULL, "\"");
-            char *question = GNUNET_malloc (strlen (token));
-            strcpy (question, token);
+            tus->secret_question = GNUNET_malloc (strlen (token) + 1);
+            GNUNET_strlcpy (tus->secret_question,
+                            token,
+                            strlen (token) + 1);
             GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                         "At %s:%d question is %s\n", __FILE__, __LINE__,
-                        question);
+                        tus->secret_question);
 
             token = strtok (NULL, "\"");
             token = strtok (NULL, "\"");
-            char *answer = GNUNET_malloc (strlen (token));
-            strcpy (answer, token);
+            tus->secret_answer = GNUNET_malloc (strlen (token) + 1);
+            GNUNET_strlcpy (tus->secret_answer,
+                            token,
+                            strlen (token) + 1);
             GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                         "At %s:%d answer is %s\n", __FILE__, __LINE__,
-                        answer);
-
-            tu_states[server_num].method = "Secure-Question";
-            tu_states[server_num].secret_question = question;
-            tu_states[server_num].secret_answer = answer;
+                        tus->secret_answer);
+
+            tus->instructions = "Please answer the question.";
+            tus->mime_type = "text/plain";
+            struct GNUNET_HashCode truth_data;
+            GNUNET_CRYPTO_hash (tus->secret_answer,
+                                strlen (tus->secret_answer),
+                                &truth_data);
+            tus->truth_data = &truth_data;
+            tus->truth_data_size = sizeof (truth_data);
+          }
+          if (0 == strcmp ("sms", tus->method))
+          {
+            token = strtok (NULL, " ");
+            tus->phone = GNUNET_malloc (strlen (token) + 1);
+            GNUNET_strlcpy (tus->phone,
+                            token,
+                            strlen (token) + 1);
+            tus->instructions = "SMS was sent to you. Please type in the 
Code.";
+            tus->mime_type = "text/plain";
+            tus->truth_data = tus->phone;
+            tus->truth_data_size = strlen (tus->phone);
+          }
+          json_error_t error;
+          if (NULL == (tus->id_data = json_load_file (import_id,
+                                                      JSON_DECODE_ANY,
+                                                      &error)))
+          {
+            GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                        "Failed to parse `%s': %s at %d:%d (%d)\n",
+                        import_id,
+                        error.text,
+                        error.line,
+                        error.column,
+                        error.position);
+            return;
           }
-          if (0 == strcmp ("sms", method))
+
+          tus->tuo = ANASTASIS_truth_upload (ctx,
+                                             tus->id_data,
+                                             servers[server_num].backend_url,
+                                             tus->method,
+                                             tus->instructions,
+                                             tus->mime_type,
+                                             servers[server_num].backend_salt,
+                                             tus->truth_data,
+                                             tus->truth_data_size,
+                                             &truth_payment_cb,
+                                             tus->tpc_cls,
+                                             &truth_upload_cb,
+                                             tus);
+
+          if (NULL == tus->tuo)
           {
-            char *phone = strtok (NULL, " ");
-            tu_states[server_num].method = "SMS";
-            tu_states[server_num].phone = phone;
+            GNUNET_break (0);
+            return;
           }
+          GNUNET_array_append (tu_states,
+                               tu_states_length,
+                               *tus);
+          printf ("Truth #%u added",
+                  tu_states_length);
         }
         else
           printf ("Sorry, server#%u does not support '%s'\n",
                   server_num,
-                  method);
+                  tus->method);
       }
-
-
-
     }
     else
       printf ("Please add a server before!\n");
 
-    start_read_keyboard ();
     GNUNET_free (buffer);
     buffer = NULL;
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
   if ((0 == strncmp ("truth add question",
@@ -607,9 +735,10 @@ read_keyboard_command (void *cls)
     else
       printf ("Please add a server before!\n");
 
-    start_read_keyboard ();
     GNUNET_free (buffer);
     buffer = NULL;
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
   if (0 == strncmp ("truth --secrets",
@@ -628,7 +757,7 @@ read_keyboard_command (void *cls)
                   tu_states[i].method,
                   tu_states[i].phone);
         if ((NULL != tu_states[i].method) &&
-            (0 == strcmp ("Secure-Question", tu_states[i].method)))
+            (0 == strcmp ("question", tu_states[i].method)))
         {
           printf ("truth#%u: %s \"%s\" \"%s\"\n",
                   i,
@@ -641,9 +770,10 @@ read_keyboard_command (void *cls)
     else
       printf ("Please add a truth before!\n");
 
-    start_read_keyboard ();
     GNUNET_free (buffer);
     buffer = NULL;
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
 
@@ -653,9 +783,10 @@ read_keyboard_command (void *cls)
       && (characters == strlen ("policy")))
   {
     // FIXME "policy" logic here
-    start_read_keyboard ();
     GNUNET_free (buffer);
     buffer = NULL;
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
   if (0 == strncmp ("policy add",
@@ -663,9 +794,10 @@ read_keyboard_command (void *cls)
                     strlen ("policy add")))
   {
     // FIXME "policy add" logic here
-    start_read_keyboard ();
     GNUNET_free (buffer);
     buffer = NULL;
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
 
@@ -675,9 +807,10 @@ read_keyboard_command (void *cls)
       && (characters == strlen ("publish")))
   {
     // FIXME "publish" logic here
-    start_read_keyboard ();
     GNUNET_free (buffer);
     buffer = NULL;
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
 
@@ -686,6 +819,7 @@ read_keyboard_command (void *cls)
            (char*) buffer);
   GNUNET_free (buffer);
   buffer = NULL;
+  keyboard_task = NULL;
   start_read_keyboard ();
 }
 
@@ -790,10 +924,11 @@ main (int argc,
   /* the available command line options */
   struct GNUNET_GETOPT_CommandLineOption options[] = {
     // FIXME json is not an int...
-    GNUNET_GETOPT_option_flag ('m',
-                               "me",
-                               "import json file containing details to create 
user identifier",
-                               &import_id),
+    GNUNET_GETOPT_option_filename ('m',
+                                   "me",
+                                   "import json file containing details to 
create user identifier",
+                                   "import json file containing details to 
create user identifier",
+                                   &import_id),
     // FIXME recovery document also is not a int...
     GNUNET_GETOPT_option_flag ('i',
                                "import",
diff --git a/src/lib/test_anastasis.c b/src/lib/test_anastasis.c
index 839ee51..c2f4b8e 100644
--- a/src/lib/test_anastasis.c
+++ b/src/lib/test_anastasis.c
@@ -193,7 +193,7 @@ run (void *cls,
                                         anastasis_url,
                                         ANASTASIS_TESTING_make_id_data_example 
(
                                           "MaxMuster123456789"),
-                                        "Secure-Question",
+                                        "question",
                                         "You have to answer the secure 
question.",
                                         "string",
                                         "HashOfSomeTruth1",
@@ -210,7 +210,7 @@ run (void *cls,
                                         anastasis_url,
                                         ANASTASIS_TESTING_make_id_data_example 
(
                                           "MaxMuster123456789"),
-                                        "Secure-Question",
+                                        "question",
                                         "You have to answer the secure 
question.",
                                         "string",
                                         "HashOfSomeTruth2",
@@ -227,7 +227,7 @@ run (void *cls,
                                         anastasis_url,
                                         ANASTASIS_TESTING_make_id_data_example 
(
                                           "MaxMuster123456789"),
-                                        "Secure-Question",
+                                        "question",
                                         "You have to answer the secure 
question.",
                                         "string",
                                         "HashOfSomeTruth3",
diff --git a/src/lib/test_anastasis_api.c b/src/lib/test_anastasis_api.c
index 2ecfd21..0aeff30 100644
--- a/src/lib/test_anastasis_api.c
+++ b/src/lib/test_anastasis_api.c
@@ -238,7 +238,7 @@ run (void *cls,
                                        MHD_HTTP_NO_CONTENT,
                                        ANASTASIS_TESTING_TSO_NONE,
                                        ANASTASIS_TESTING_make_truth_example (
-                                         "Secure-Question",
+                                         "question",
                                          "Truth mime",
                                          ANASTASIS_TESTING_make_hashed_answer (
                                            "Hashed-Answer",
diff --git a/src/lib/test_anastasis_api.conf b/src/lib/test_anastasis_api.conf
index 3a9fee2..8aa1c8f 100644
--- a/src/lib/test_anastasis_api.conf
+++ b/src/lib/test_anastasis_api.conf
@@ -42,7 +42,7 @@ ANNUAL_FEE = EUR:4.99
 # Upload limit
 UPLOAD_LIMIT_MB = 1
 
-SUPPORTED_METHODS = Secure-Question
+SUPPORTED_METHODS = question
 
 # This specifies which database the postgres backend uses.
 [anastasisdb-postgres]

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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