gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated (1ef8c4f -> 8547337)


From: gnunet
Subject: [taler-anastasis] branch master updated (1ef8c4f -> 8547337)
Date: Tue, 26 May 2020 13:10:15 +0200

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

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

    from 1ef8c4f  some answers
     new bd66755  worked on splitter....
     new 61f2372  worked on wireframes (with Pencil)
     new 0ea7c6e  worked on poster
     new 8547337  merge

The 4 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:
 doc/poster/Logo_LEDGER.png                         | Bin 0 -> 9757 bytes
 doc/poster/Poster_Anastasis.pdf                    | Bin 0 -> 339069 bytes
 doc/poster/Poster_Anastasis.pptx                   | Bin 0 -> 136819 bytes
 doc/poster/pep.png                                 | Bin 0 -> 2981 bytes
 doc/poster/taler_logo.png                          | Bin 0 -> 13736 bytes
 doc/poster/web3-foundation.jpg                     | Bin 0 -> 24971 bytes
 .../taler.svg => wireframe/logo-2018-dold.svg}     |   0
 doc/wireframe/menu-items.png                       | Bin 0 -> 3475 bytes
 doc/wireframe/png-export/addpolicy.png             | Bin 0 -> 29531 bytes
 doc/wireframe/png-export/addpolicymethod.png       | Bin 0 -> 32358 bytes
 doc/wireframe/png-export/addtruth.png              | Bin 0 -> 34171 bytes
 doc/wireframe/png-export/addtruthmail.png          | Bin 0 -> 40073 bytes
 doc/wireframe/png-export/backupsettings.png        | Bin 0 -> 35877 bytes
 doc/wireframe/png-export/menu.png                  | Bin 0 -> 20556 bytes
 doc/wireframe/png-export/policy.png                | Bin 0 -> 40257 bytes
 doc/wireframe/png-export/settings.png              | Bin 0 -> 64908 bytes
 doc/wireframe/png-export/truth.png                 | Bin 0 -> 43449 bytes
 doc/wireframe/png-export/userid.png                | Bin 0 -> 46595 bytes
 doc/wireframe/settings.png                         | Bin 0 -> 32191 bytes
 doc/wireframe/wireframes.epgz                      | Bin 0 -> 91005 bytes
 src/backend/anastasis.conf                         |  51 ++++-
 src/cli/anastasis-cli-splitter.c                   | 236 +++++++++++++--------
 src/include/anastasis.h                            |   2 +
 src/lib/anastasis.c                                |   1 +
 src/lib/testing_cmd_secret_share.c                 |   2 +
 25 files changed, 201 insertions(+), 91 deletions(-)
 create mode 100644 doc/poster/Logo_LEDGER.png
 create mode 100644 doc/poster/Poster_Anastasis.pdf
 create mode 100644 doc/poster/Poster_Anastasis.pptx
 create mode 100644 doc/poster/pep.png
 create mode 100644 doc/poster/taler_logo.png
 create mode 100644 doc/poster/web3-foundation.jpg
 copy doc/{partner-logos/taler.svg => wireframe/logo-2018-dold.svg} (100%)
 create mode 100644 doc/wireframe/menu-items.png
 create mode 100644 doc/wireframe/png-export/addpolicy.png
 create mode 100644 doc/wireframe/png-export/addpolicymethod.png
 create mode 100644 doc/wireframe/png-export/addtruth.png
 create mode 100644 doc/wireframe/png-export/addtruthmail.png
 create mode 100644 doc/wireframe/png-export/backupsettings.png
 create mode 100644 doc/wireframe/png-export/menu.png
 create mode 100644 doc/wireframe/png-export/policy.png
 create mode 100644 doc/wireframe/png-export/settings.png
 create mode 100644 doc/wireframe/png-export/truth.png
 create mode 100644 doc/wireframe/png-export/userid.png
 create mode 100644 doc/wireframe/settings.png
 create mode 100644 doc/wireframe/wireframes.epgz

diff --git a/doc/poster/Logo_LEDGER.png b/doc/poster/Logo_LEDGER.png
new file mode 100644
index 0000000..67de3a7
Binary files /dev/null and b/doc/poster/Logo_LEDGER.png differ
diff --git a/doc/poster/Poster_Anastasis.pdf b/doc/poster/Poster_Anastasis.pdf
new file mode 100644
index 0000000..c40fac6
Binary files /dev/null and b/doc/poster/Poster_Anastasis.pdf differ
diff --git a/doc/poster/Poster_Anastasis.pptx b/doc/poster/Poster_Anastasis.pptx
new file mode 100644
index 0000000..4c652f5
Binary files /dev/null and b/doc/poster/Poster_Anastasis.pptx differ
diff --git a/doc/poster/pep.png b/doc/poster/pep.png
new file mode 100644
index 0000000..9996a1d
Binary files /dev/null and b/doc/poster/pep.png differ
diff --git a/doc/poster/taler_logo.png b/doc/poster/taler_logo.png
new file mode 100644
index 0000000..1177809
Binary files /dev/null and b/doc/poster/taler_logo.png differ
diff --git a/doc/poster/web3-foundation.jpg b/doc/poster/web3-foundation.jpg
new file mode 100644
index 0000000..a81bcc5
Binary files /dev/null and b/doc/poster/web3-foundation.jpg differ
diff --git a/doc/partner-logos/taler.svg b/doc/wireframe/logo-2018-dold.svg
similarity index 100%
copy from doc/partner-logos/taler.svg
copy to doc/wireframe/logo-2018-dold.svg
diff --git a/doc/wireframe/menu-items.png b/doc/wireframe/menu-items.png
new file mode 100644
index 0000000..48cfde2
Binary files /dev/null and b/doc/wireframe/menu-items.png differ
diff --git a/doc/wireframe/png-export/addpolicy.png 
b/doc/wireframe/png-export/addpolicy.png
new file mode 100644
index 0000000..30ab455
Binary files /dev/null and b/doc/wireframe/png-export/addpolicy.png differ
diff --git a/doc/wireframe/png-export/addpolicymethod.png 
b/doc/wireframe/png-export/addpolicymethod.png
new file mode 100644
index 0000000..9b2dd0c
Binary files /dev/null and b/doc/wireframe/png-export/addpolicymethod.png differ
diff --git a/doc/wireframe/png-export/addtruth.png 
b/doc/wireframe/png-export/addtruth.png
new file mode 100644
index 0000000..8c1717a
Binary files /dev/null and b/doc/wireframe/png-export/addtruth.png differ
diff --git a/doc/wireframe/png-export/addtruthmail.png 
b/doc/wireframe/png-export/addtruthmail.png
new file mode 100644
index 0000000..3cfeeee
Binary files /dev/null and b/doc/wireframe/png-export/addtruthmail.png differ
diff --git a/doc/wireframe/png-export/backupsettings.png 
b/doc/wireframe/png-export/backupsettings.png
new file mode 100644
index 0000000..0a7a90e
Binary files /dev/null and b/doc/wireframe/png-export/backupsettings.png differ
diff --git a/doc/wireframe/png-export/menu.png 
b/doc/wireframe/png-export/menu.png
new file mode 100644
index 0000000..daaaad4
Binary files /dev/null and b/doc/wireframe/png-export/menu.png differ
diff --git a/doc/wireframe/png-export/policy.png 
b/doc/wireframe/png-export/policy.png
new file mode 100644
index 0000000..8bbd232
Binary files /dev/null and b/doc/wireframe/png-export/policy.png differ
diff --git a/doc/wireframe/png-export/settings.png 
b/doc/wireframe/png-export/settings.png
new file mode 100644
index 0000000..9a06dd6
Binary files /dev/null and b/doc/wireframe/png-export/settings.png differ
diff --git a/doc/wireframe/png-export/truth.png 
b/doc/wireframe/png-export/truth.png
new file mode 100644
index 0000000..295755c
Binary files /dev/null and b/doc/wireframe/png-export/truth.png differ
diff --git a/doc/wireframe/png-export/userid.png 
b/doc/wireframe/png-export/userid.png
new file mode 100644
index 0000000..14754e7
Binary files /dev/null and b/doc/wireframe/png-export/userid.png differ
diff --git a/doc/wireframe/settings.png b/doc/wireframe/settings.png
new file mode 100644
index 0000000..0379db8
Binary files /dev/null and b/doc/wireframe/settings.png differ
diff --git a/doc/wireframe/wireframes.epgz b/doc/wireframe/wireframes.epgz
new file mode 100644
index 0000000..20e6d1b
Binary files /dev/null and b/doc/wireframe/wireframes.epgz differ
diff --git a/src/backend/anastasis.conf b/src/backend/anastasis.conf
index 6346e60..3bb226e 100644
--- a/src/backend/anastasis.conf
+++ b/src/backend/anastasis.conf
@@ -26,10 +26,13 @@ UNIXPATH_MODE = 660
 # Which database backend do we use?
 DB = postgres
 
+# Annual fee for an account
+ANNUAL_FEE = TESTKUDOS:0.1
+
 # Upload limit per backup, in megabytes
 UPLOAD_LIMIT_MB = 16
 
-# Fulfillment URL of the SYNC service itself.
+# Fulfillment URL of the ANASTASIS service itself.
 FULFILLMENT_URL = taler://fulfillment-success
 
 # Base URL of our payment backend
@@ -41,6 +44,52 @@ TRUTH_EXPIRATION = 63115200000000
 # Server salt 256 bits
 SERVER_SALT = 
gUfO1KGOKYIFlFQgBv9NeYqiSgS16Y0dcgj74YewVnSEsEkXaG5duaGphWXgQGI84OOezaS9tlffQ0J27u6iAcvWMMdR8oANz5GeoWZFAAQDW65qMrUoTfDK170hY7krj6GZ04PFgBzBRtNAyGqPTkRbOFQ04lu6pa0bYF9JAwmwrFD0csVliuvapL33ukOwHdKDyg81FQuRW1bNbj9D0GMPoVcacJUrOXk0mIWhyG3Q2OoVOfW1LiIaXwfitLGd
 
+# Supported methods
+SUPPORTED_METHODS = question
+
 # Configuration for postgres database.
 [anastasisdb-postgres]
 CONFIG = postgres:///anastasis
+
+[taler]
+# Currency
+CURRENCY = KUDOS
+
+[exchange]
+# Our public key
+MASTER_PUBLIC_KEY = WEC7J41PBGDN24JTNRVBFXK5JRV6CK9B8YRTWW7QGFH2GERBGH1G
+
+[PATHS]
+# The PATHS section is special, as filenames including $-expression are
+# expanded using the values from PATHS or the system environment (PATHS
+# is checked first).  libgnunetutil supports expanding $-expressions using
+# defaults with the syntax "${VAR:-default}".  Here, "default" can again
+# be a $-expression.
+#
+# We usually want $HOME for $ANASTASIS_HOME
+#
+ANASTASIS_HOME = ${HOME:-${USERPROFILE}}
+
+# see XDG Base Directory Specification at
+# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+# for how these should be used.
+
+# Persistent data storage
+ANASTASIS_DATA_HOME = ${XDG_DATA_HOME:-$ANASTASIS_HOME/.local/share}/ANASTASIS/
+
+# Configuration files
+ANASTASIS_CONFIG_HOME = ${XDG_CONFIG_HOME:-$ANASTASIS_HOME/.config}/ANASTASIS/
+
+# Cached data, no big deal if lost
+ANASTASIS_CACHE_HOME = ${XDG_CACHE_HOME:-$ANASTASIS_HOME/.cache}/ANASTASIS/
+
+# Runtime data (i.e UNIX domain sockets, locks, always lost on system boot)
+ANASTASIS_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/ANASTASIS-runtime/
+
+# Directory to use for temporary files.
+ANASTASIS_TMP = ${TMPDIR:-${TMP:-/tmp}}/ANASTASIS/
+
+# DEFAULTCONFIG = /etc/ANASTASIS.conf
+# If 'DEFAULTCONFIG' is not defined, the current
+# configuration file is assumed to be the default,
+# which is what we want by default...
diff --git a/src/cli/anastasis-cli-splitter.c b/src/cli/anastasis-cli-splitter.c
index 370df4c..776dd51 100644
--- a/src/cli/anastasis-cli-splitter.c
+++ b/src/cli/anastasis-cli-splitter.c
@@ -111,7 +111,7 @@ struct TruthUploadState
   /**
    * Truth object
    */
-  const struct ANASTASIS_Truth *truth;
+  struct ANASTASIS_Truth *truth;
 };
 
 /**
@@ -132,7 +132,7 @@ struct ServerInfo
   /**
    * supported methods of the anastasis backend.
    */
-  const char *backend_methods;
+  char *backend_methods;
 
   /**
    * server salt of the anastasis backend.
@@ -243,18 +243,13 @@ struct SecretShareState
   /**
    * The core secret to backup/recover.
    */
-  const void *core_secret;
+  void *core_secret;
 
   /**
    * Size of core_secret.
    */
   size_t core_secret_size;
 
-  /**
-   * URL of the anastasis backend.
-   */
-  const char *anastasis_url;
-
   /**
    * Expected status code.
    */
@@ -283,7 +278,12 @@ struct SecretShareState
   /**
    * Details of a past payment
    */
-  struct ANASTASIS_PaymentDetails *pd;
+  const struct ANASTASIS_PaymentDetails *pds;
+
+  /**
+   * Length of pds.
+   */
+  unsigned int pds_len;
 };
 
 
@@ -342,6 +342,16 @@ static struct PolicyCreateState *pc_states;
  */
 static unsigned int pc_states_length = 0;
 
+/**
+ * PaymentDetails.
+ */
+static struct ANASTASIS_PaymentDetails *pds;
+
+/**
+ * Amount of pds.
+ */
+static unsigned int pds_length = 0;
+
 
 static void
 start_read_keyboard (void);
@@ -352,11 +362,13 @@ start_read_keyboard (void);
  *
  * @param cls closure
  * @param taler_pay_url url for the payment (taler://pay/Foo)
+ * @param server_url url of the server to pay for
  * @param ec status of the request
  */
 static void
 secret_share_payment_cb (void *cls,
                          const char *taler_pay_url,
+                         const char *server_url,
                          enum TALER_ErrorCode ec)
 {
   const char *m;
@@ -375,6 +387,8 @@ secret_share_payment_cb (void *cls,
                 __FILE__,
                 __LINE__);
     GNUNET_break (0);
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
 
@@ -387,6 +401,8 @@ secret_share_payment_cb (void *cls,
                 "/-/-/",
                 taler_pay_url);
     GNUNET_break (0);
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
   m = strstr (taler_pay_url, "/-/-/");
@@ -410,7 +426,17 @@ secret_share_payment_cb (void *cls,
               "At %s:%d Order ID from Anastasis service is %s\n",
               __FILE__, __LINE__,
               sss->payment_order_id);
-
+  for (unsigned int i = 0; i < sss->pds_len; i++)
+  {
+    if (0 == strcmp (sss->pds[i].provider_url,
+                     server_url))
+    {
+      printf ("Server#%u failure: 402 payment required: %s %s\n",
+              i,
+              taler_pay_url,
+              TALER_amount_to_string (servers[i].backend_cost));
+    }
+  }
   keyboard_task = NULL;
   start_read_keyboard ();
 }
@@ -457,13 +483,15 @@ secret_share_result_cb (void *cls,
                   __FILE__,
                   __LINE__);
       GNUNET_break (0);
+      keyboard_task = NULL;
+      start_read_keyboard ();
       return;
     }
-    keyboard_task = NULL;
-    start_read_keyboard ();
-    return;
   }
+  printf ("Thank you for using Anastasis");
   GNUNET_break (0);
+  keyboard_task = NULL;
+  start_read_keyboard ();
   return;
 }
 
@@ -507,6 +535,8 @@ truth_upload_cb (void *cls,
   if (NULL == t)
   {
     GNUNET_break (0);
+    keyboard_task = NULL;
+    start_read_keyboard ();
     return;
   }
   tus->truth = t;
@@ -531,6 +561,8 @@ config_cb (void *cls,
            const struct TALER_Amount *cost)
 {
   struct ConfigState *cs = cls;
+  struct ANASTASIS_PaymentDetails *pd = GNUNET_new (struct
+                                                    ANASTASIS_PaymentDetails);
 
   cs->co = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -549,22 +581,7 @@ config_cb (void *cls,
     start_read_keyboard ();
     return;
   }
-  if (NULL == cost)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Cost is NULL in %s:%u\n",
-                __FILE__,
-                __LINE__);
-    return;
-  }
-  if (NULL == methods)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Methods is NULL in %s:%u\n",
-                __FILE__,
-                __LINE__);
-    return;
-  }
+
   cs->cost = *cost;
   cs->methods = GNUNET_malloc (strlen (methods) + 1);
   GNUNET_strlcpy (cs->methods,
@@ -575,6 +592,10 @@ config_cb (void *cls,
 
   cs->server->backend_methods = cs->methods;
   cs->server->backend_cost = &cs->cost;
+  pd->provider_url = cs->server->backend_url;
+  GNUNET_array_append (pds,
+                       pds_length,
+                       *pd);
   // FIXME add config max insurance amount
 
   GNUNET_array_append (servers,
@@ -629,6 +650,7 @@ salt_cb (void *cls,
   if (NULL == cs->co)
   {
     GNUNET_break (0);
+    keyboard_task = NULL;
     return;
   }
 }
@@ -643,6 +665,7 @@ static void
 read_keyboard_command (void *cls)
 {
   (void) cls;
+
   char *buffer = readline ("anastasis-splitter> ");
   size_t characters = strlen (buffer);
 
@@ -664,7 +687,6 @@ read_keyboard_command (void *cls)
       GNUNET_SCHEDULER_shutdown ();
       free (buffer);
       buffer = NULL;
-      keyboard_task = NULL;
       return;
     case 'o':
       printf (
@@ -683,18 +705,14 @@ read_keyboard_command (void *cls)
         "\n"
         );
       free (buffer);
-      buffer = NULL;
       break;
     default:
       fprintf (stderr,
                "Unknown command '%c'\n",
                buffer[0]);
-      GNUNET_free (buffer);
-      buffer = NULL;
-      keyboard_task = NULL;
+      free (buffer);
       break;
     }
-    keyboard_task = NULL;
     start_read_keyboard ();
     return;
   }
@@ -724,7 +742,6 @@ read_keyboard_command (void *cls)
 
     free (buffer);
     buffer = NULL;
-    keyboard_task = NULL;
     start_read_keyboard ();
     return;
   }
@@ -756,12 +773,11 @@ read_keyboard_command (void *cls)
     if (NULL == ss->so)
     {
       GNUNET_break (0);
+      free (buffer);
+      keyboard_task = NULL;
       return;
     }
-    GNUNET_free (buffer);
-    buffer = NULL;
-    keyboard_task = NULL;
-    start_read_keyboard ();
+    free (buffer);
     return;
   }
 
@@ -794,7 +810,7 @@ read_keyboard_command (void *cls)
     else
       printf ("Please add a truth before!\n");
 
-    GNUNET_free (buffer);
+    free (buffer);
     buffer = NULL;
     keyboard_task = NULL;
     start_read_keyboard ();
@@ -889,6 +905,8 @@ read_keyboard_command (void *cls)
                         error.line,
                         error.column,
                         error.position);
+            free (buffer);
+            GNUNET_SCHEDULER_shutdown ();
             return;
           }
           tus->index = (tu_states_length > 0) ? tu_states_length - 1 : 0;
@@ -909,6 +927,7 @@ read_keyboard_command (void *cls)
           if (NULL == tus->tuo)
           {
             GNUNET_break (0);
+            free (buffer);
             return;
           }
           GNUNET_array_append (tu_states,
@@ -917,6 +936,8 @@ read_keyboard_command (void *cls)
           printf ("Truth #%u added for server #%u\n",
                   tus->index,
                   server_num);
+          free (buffer);
+          return;
         }
         else
           printf ("Sorry, server#%u does not support '%s'\n",
@@ -927,27 +948,7 @@ read_keyboard_command (void *cls)
     else
       printf ("Please add a server before!\n");
 
-    GNUNET_free (buffer);
-    buffer = NULL;
-    keyboard_task = NULL;
-    start_read_keyboard ();
-    return;
-  }
-  if ((0 == strncmp ("truth add question",
-                     buffer,
-                     strlen ("truth add question")))
-      && (characters == strlen ("truth add question") + sizeof (char)))
-  {
-    // FIXME "truth add question" logic here
-    if (NULL != tu_states)
-    {
-
-    }
-    else
-      printf ("Please add a server before!\n");
-
-    GNUNET_free (buffer);
-    buffer = NULL;
+    free (buffer);
     keyboard_task = NULL;
     start_read_keyboard ();
     return;
@@ -981,9 +982,7 @@ read_keyboard_command (void *cls)
     else
       printf ("Please add a truth before!\n");
 
-    GNUNET_free (buffer);
-    buffer = NULL;
-    keyboard_task = NULL;
+    free (buffer);
     start_read_keyboard ();
     return;
   }
@@ -996,7 +995,7 @@ read_keyboard_command (void *cls)
     // FIXME "policy" logic here
     if (NULL != pc_states)
     {
-      for (unsigned int i = 0; i < servers_length; i++)
+      for (unsigned int i = 0; i < pc_states_length; i++)
       {
         if (NULL != pc_states[i].tu_states)
         {
@@ -1011,9 +1010,7 @@ read_keyboard_command (void *cls)
     }
     else
       printf ("Please add a policy before!\n");
-    GNUNET_free (buffer);
-    buffer = NULL;
-    keyboard_task = NULL;
+    free (buffer);
     start_read_keyboard ();
     return;
   }
@@ -1033,9 +1030,7 @@ read_keyboard_command (void *cls)
                         strlen ("truth#")))
       {
         printf ("Wrong argument: %s!\n", token);
-        GNUNET_free (buffer);
-        buffer = NULL;
-        keyboard_task = NULL;
+        free (buffer);
         start_read_keyboard ();
         return;
       }
@@ -1052,18 +1047,14 @@ read_keyboard_command (void *cls)
                          *pcs);
     printf ("Policy #%u defined\n",
             (pc_states_length > 0) ? pc_states_length - 1 : 0);
-
-    GNUNET_free (buffer);
-    buffer = NULL;
-    keyboard_task = NULL;
+    free (buffer);
     start_read_keyboard ();
     return;
   }
 
-  if ((0 == strncmp ("publish",
-                     buffer,
-                     strlen ("publish")))
-      && (characters == strlen ("publish")))
+  if (0 == strncmp ("publish",
+                    buffer,
+                    strlen ("publish")))
   {
     // FIXME "publish" logic here
     if (NULL != pc_states)
@@ -1098,18 +1089,55 @@ read_keyboard_command (void *cls)
                     error.line,
                     error.column,
                     error.position);
+        free (buffer);
+        GNUNET_SCHEDULER_shutdown ();
         return;
       }
       // core secret here is just for testing, if payment is needed
-      sss->core_secret = "test_payment";
-      sss->core_secret_size = strlen ("test_payment");
+      if (characters > strlen ("publish"))
+      {
+        char *token_start = &buffer[strlen ("publish ")];
+        char *token = strtok (token_start, "\"");
+        sss->core_secret = GNUNET_malloc (strlen (token) + 1);
+        sss->core_secret_size = strlen (token) + 1;
+        GNUNET_strlcpy (sss->core_secret,
+                        token,
+                        sss->core_secret_size);
+        sss->http_status = MHD_HTTP_NO_CONTENT;
+      }
+      if (characters == strlen ("publish"))
+      {
+        sss->core_secret = "test_payment";
+        sss->core_secret_size = strlen ("test_payment");
+        sss->http_status = MHD_HTTP_PAYMENT_REQUIRED;
+      }
+
+      for (unsigned int i = 0; i < servers_length; i++)
+      {
+        printf ("To skip following press enter\n");
+        printf ("Please type in PaymentSecret for Server#%u: ", i);
+        buffer = readline ((char *) NULL);
+        characters = strlen (buffer);
+        if (characters > 1)
+        {
+          add_history (buffer);
+          pds[i].payment_order_id = GNUNET_malloc (characters + 1);
+          GNUNET_strlcpy (pds[i].payment_order_id,
+                          buffer,
+                          characters);
+          free (buffer);
+        }
+        printf ("\n");
+      }
+      sss->pds = pds;
+      sss->pds_len = pds_length;
       sss->sso = ANASTASIS_secret_share (ctx,
                                          sss->id_data,
                                          NULL,
                                          policies,
                                          pc_states_length,
-                                         NULL,
-                                         NULL,
+                                         &sss->pds,
+                                         sss->pds_len,
                                          &secret_share_payment_cb,
                                          sss,
                                          &secret_share_result_cb,
@@ -1119,22 +1147,20 @@ read_keyboard_command (void *cls)
       if (NULL == sss->sso)
       {
         GNUNET_break (0);
+        free (buffer);
         return;
       }
+      free (buffer);
       return;
     }
-    GNUNET_free (buffer);
-    buffer = NULL;
-    keyboard_task = NULL;
-    start_read_keyboard ();
+    free (buffer);
     return;
   }
 
   fprintf (stderr,
            "Unknown command '%s'\n",
            (char*) buffer);
-  GNUNET_free (buffer);
-  buffer = NULL;
+  free (buffer);
   keyboard_task = NULL;
   start_read_keyboard ();
 }
@@ -1180,11 +1206,41 @@ shutdown_task (void *cls)
               "Shutdown initiated\n");
 
   // FIXME shutdown routine here
+  if (NULL != keyboard_task)
+  {
+    GNUNET_SCHEDULER_cancel (keyboard_task);
+    keyboard_task = NULL;
+  }
   if (NULL != ctx)
   {
     GNUNET_CURL_fini (ctx);
     ctx = NULL;
   }
+  if (NULL != rc)
+  {
+    GNUNET_CURL_gnunet_rc_destroy (rc);
+    rc = NULL;
+  }
+
+  if (NULL != tu_states)
+  {
+    for (unsigned int i = 0; i < tu_states_length; i++)
+    {
+      GNUNET_free (tu_states[i].truth);
+      GNUNET_free (tu_states[i].method);
+      GNUNET_free_non_null (tu_states[i].secret_question);
+      GNUNET_free_non_null (tu_states[i].secret_answer);
+    }
+  }
+
+  if (NULL != servers)
+  {
+    for (unsigned int i = 0; i < servers_length; i++)
+    {
+      GNUNET_free (servers[i].backend_url);
+      GNUNET_free (servers[i].backend_methods);
+    }
+  }
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Shutdown complete\n");
diff --git a/src/include/anastasis.h b/src/include/anastasis.h
index 5037575..2fe1e35 100644
--- a/src/include/anastasis.h
+++ b/src/include/anastasis.h
@@ -379,11 +379,13 @@ typedef void
 *
 * @param cls closure for the callback
 * @param taler_pay_url url for the payment (taler://pay/Foo)
+* @param server_url url of the server to pay for
 * @param ec status of the request
 */
 typedef void
 (*ANASTASIS_SharePaymentCallback)(void *cls,
                                   const char *taler_pay_url,
+                                  const char *server_url,
                                   enum TALER_ErrorCode ec);
 
 /**
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index 30c880c..a686c34 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -1483,6 +1483,7 @@ policy_store_cb (void *cls,
         {
           pss->ss->spc (pss->ss->spc_cls,
                         ud->details.payment_request,
+                        pss->anastasis_url,
                         ec);
           pss->ss->spc = NULL;
         }
diff --git a/src/lib/testing_cmd_secret_share.c 
b/src/lib/testing_cmd_secret_share.c
index d9cd8dc..4b8068c 100644
--- a/src/lib/testing_cmd_secret_share.c
+++ b/src/lib/testing_cmd_secret_share.c
@@ -119,11 +119,13 @@ struct SecretShareState
  *
  * @param cls closure
  * @param taler_pay_url url for the payment (taler://pay/Foo)
+ * @param server_url url of the server to pay for
  * @param ec status of the request
  */
 static void
 secret_share_payment_cb (void *cls,
                          const char *taler_pay_url,
+                         const char *server_url,
                          enum TALER_ErrorCode ec)
 {
   const char *m;

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



reply via email to

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