gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: last uuid fixes


From: gnunet
Subject: [taler-anastasis] branch master updated: last uuid fixes
Date: Tue, 07 Jul 2020 00:51:28 +0200

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

ds-meister pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 6237f82  last uuid fixes
6237f82 is described below

commit 6237f8266cf5c1aefce673da8df4840258a0d28c
Author: Dominik Meister <dominiksamuel.meister@students.bfh.ch>
AuthorDate: Tue Jul 7 00:51:22 2020 +0200

    last uuid fixes
---
 src/cli/anastasis-cli-assembler.c | 18 +++++++++++-------
 src/cli/anastasis-cli-splitter.c  |  6 +++---
 src/include/anastasis.h           |  1 +
 src/lib/anastasis.c               |  1 +
 4 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/cli/anastasis-cli-assembler.c 
b/src/cli/anastasis-cli-assembler.c
index 408ba76..111ed65 100644
--- a/src/cli/anastasis-cli-assembler.c
+++ b/src/cli/anastasis-cli-assembler.c
@@ -336,12 +336,13 @@ read_keyboard_command (void *cls)
       char **currencies;
       unsigned int costs_len = 0;
 
-      for (unsigned int j = 0; j < policies[i].uuids_length; j++)
+      for (unsigned int j = 0; j < policies[i].nonces_length; j++)
       {
         for (unsigned int k = 0; k < challenges_length; k++)
         {
-          if (0 == uuid_compare (policies[i].escrow_uuids[j],
-                                 *challenges[k].uuid))
+          if (0 == memcmp (&policies[i].nonces[j],
+                           challenges[k].nonce,
+                           sizeof(struct ANASTASIS_CRYPTO_NonceP)))
           {
             unsigned int new_currency = 1;
             unsigned int index = 0;
@@ -402,12 +403,13 @@ read_keyboard_command (void *cls)
       {
         printf ("%s ", TALER_amount_to_string (&costs[l]));
       }
-      for (unsigned int j = 0; j < policies[i].uuids_length; j++)
+      for (unsigned int j = 0; j < policies[i].nonces_length; j++)
       {
         for (unsigned int k = 0; k < challenges_length; k++)
         {
-          if (0 == uuid_compare (policies[i].escrow_uuids[j],
-                                 *challenges[k].uuid))
+          if (0 == memcmp (&policies[i].nonces[j],
+                           challenges[k].nonce,
+                           sizeof(struct ANASTASIS_CRYPTO_NonceP)))
             if (1 != *challenges[k].solved)
               printf ("truth#%u ", k);
         }
@@ -601,7 +603,9 @@ config_cb (void *cls,
   unsigned int contains = 0;
   for (unsigned int i = 0; i < challenges_length; i++)
   {
-    if (0 == uuid_compare (*challenges[i].uuid, *cs->ci->uuid))
+    if (0 == memcmp (challenges[i].nonce,
+                     cs->ci->nonce,
+                     sizeof(struct ANASTASIS_CRYPTO_NonceP)))
     {
       contains = 1;
       break;
diff --git a/src/cli/anastasis-cli-splitter.c b/src/cli/anastasis-cli-splitter.c
index 37d3b91..bcd889c 100644
--- a/src/cli/anastasis-cli-splitter.c
+++ b/src/cli/anastasis-cli-splitter.c
@@ -526,7 +526,7 @@ truth_payment_cb (void *cls,
 * caller MUST free 't' using ANASTASIS_truth_free()
 *
 * @param cls closure for callback
-* @param t Truth object (contains provider url and uuid)
+* @param t Truth object (contains provider url and truth public key)
 * @param t_size size of t
 */
 static void
@@ -1145,7 +1145,7 @@ read_keyboard_command (void *cls)
           GNUNET_strlcpy (payment_order_id,
                           buffer,
                           characters);
-          pds[i].payment_order_id = (const char*) payment_order_id;
+          pds[i].payment_order_id = (const char *) payment_order_id;
           free (buffer);
         }
         printf ("\n");
@@ -1180,7 +1180,7 @@ read_keyboard_command (void *cls)
 
   fprintf (stderr,
            "Unknown command '%s'\n",
-           (char*) buffer);
+           (char *) buffer);
   free (buffer);
   keyboard_task = NULL;
   start_read_keyboard ();
diff --git a/src/include/anastasis.h b/src/include/anastasis.h
index 6a382d0..407a999 100644
--- a/src/include/anastasis.h
+++ b/src/include/anastasis.h
@@ -155,6 +155,7 @@ struct ANASTASIS_ChallengeInformation
   struct TALER_Amount *cost;
   const unsigned int *solved;
   const struct ANASTASIS_CRYPTO_TruthPublicKeyP *truth_public_key;
+  const struct ANASTASIS_CRYPTO_NonceP *nonce;
   char *currency;
   struct ANASTASIS_Challenge *challenge;
 };
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index a9fa287..8e947cb 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -418,6 +418,7 @@ ANASTASIS_get_challenge (struct ANASTASIS_Challenge 
*challenge,
   ci->truth_public_key = &challenge->truth_public_key;
   ci->method = challenge->escrow_method;
   ci->url = challenge->url;
+  ci->nonce = &challenge->nonce;
   ci->instructions = challenge->instructions;
   ci->solved = &challenge->solved;
   ci->challenge = challenge;

-- 
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]