gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 01/01: worked on fixing uuid issue... still something


From: gnunet
Subject: [taler-anastasis] 01/01: worked on fixing uuid issue... still something wrong rebase .gitignore vgcore
Date: Mon, 20 Apr 2020 11:31:42 +0200

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

grothoff pushed a commit to branch master
in repository anastasis.

commit 6da74ebc4f9c1bea2bf27726735b850f5adbba95
Author: Dennis Neufeld <address@hidden>
AuthorDate: Mon Apr 20 07:27:56 2020 +0000

    worked on fixing uuid issue... still something wrong
    rebase
    .gitignore vgcore
---
 .gitignore                                |   2 +
 src/include/anastasis_service.h           |   2 +-
 src/lib/anastasis.c                       |   2 +-
 src/lib/anastasis_api_keyshare_lookup.c   |  19 ++-
 src/lib/anastasis_api_truth_store.c       |   4 +-
 src/lib/testing_api_cmd_keyshare_lookup.c | 184 +++++++++++++++++-------------
 src/lib/testing_api_cmd_truth_store.c     |  38 ++++--
 src/util/vgcore.380224                    | Bin 16338944 -> 0 bytes
 src/util/vgcore.381169                    | Bin 41508864 -> 0 bytes
 9 files changed, 160 insertions(+), 91 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0e70349..08fb675 100644
--- a/.gitignore
+++ b/.gitignore
@@ -85,3 +85,5 @@ src/util/test_anastasis_crypto
 src/util/test_anastasis_crypto.trs
 src/lib/test_anastasisrest_api
 src/lib/vgcore.*
+src/util/vgcore.*
+src/statis/vgcore.*
\ No newline at end of file
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index b10e145..d20ffb9 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -523,7 +523,7 @@ typedef void
 struct ANASTASIS_TruthStoreOperation *
 ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
                        const char *backend_url,
-                       const uuid_t truth_uuid,
+                       const uuid_t *truth_uuid,
                        json_t *truth_data,
                        int payment_requested,
                        const char *paid_order_id,
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index 5d126fb..1f74d5d 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -625,7 +625,7 @@ ANASTASIS_truth_upload (const json_t *id_data,
 
   tu->tso = ANASTASIS_truth_store (tu->ctx,
                                    t->url,
-                                   t->uuid,
+                                   &t->uuid,
                                    truth,
                                    tu->payment_requested,
                                    tu->paid_order_id,
diff --git a/src/lib/anastasis_api_keyshare_lookup.c 
b/src/lib/anastasis_api_keyshare_lookup.c
index 86ad620..a70596a 100644
--- a/src/lib/anastasis_api_keyshare_lookup.c
+++ b/src/lib/anastasis_api_keyshare_lookup.c
@@ -259,8 +259,19 @@ ANASTASIS_keyshare_lookup (struct GNUNET_CURL_Context *ctx,
   kslo->cb = cb;
   kslo->cb_cls = cb_cls;
   kslo->truth_key = truth_key;
+    << << << < HEAD
+
+    GNUNET_assert (NULL != truth_uuid);
   uuid_str = GNUNET_STRINGS_data_to_string_alloc (truth_uuid,
                                                   sizeof (*truth_uuid));
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "UUID in keyshare lookup:  %s\n",
+              uuid_str);
+  GNUNET_assert (NULL != hashed_answer);
+  ====== =
+    uuid_str = GNUNET_STRINGS_data_to_string_alloc (truth_uuid,
+                                                    sizeof (*truth_uuid));
+  >> >> >> > f6a488c ... modified salt request
   hashed_answer_str = GNUNET_STRINGS_data_to_string_alloc (hashed_answer,
                                                            sizeof (struct
                                                                    
GNUNET_HashCode));
@@ -275,7 +286,13 @@ ANASTASIS_keyshare_lookup (struct GNUNET_CURL_Context *ctx,
   GNUNET_free (path);
   GNUNET_free (uuid_str);
   GNUNET_free (hashed_answer_str);
-  eh = curl_easy_init ();
+    << << << < HEAD
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Url get request (keyshare lookup): %s\n",
+                kslo->url);
+  ====== =
+    >> >> >> > f6a488c ... modified salt request
+    eh = curl_easy_init ();
   GNUNET_assert (CURLE_OK ==
                  curl_easy_setopt (eh,
                                    CURLOPT_HEADERFUNCTION,
diff --git a/src/lib/anastasis_api_truth_store.c 
b/src/lib/anastasis_api_truth_store.c
index a54e7c8..7552364 100644
--- a/src/lib/anastasis_api_truth_store.c
+++ b/src/lib/anastasis_api_truth_store.c
@@ -259,7 +259,7 @@ handle_header (char *buffer,
 struct ANASTASIS_TruthStoreOperation *
 ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
                        const char *backend_url,
-                       const uuid_t truth_uuid,
+                       const uuid_t *truth_uuid,
                        json_t *truth_data,
                        int payment_requested,
                        const char *paid_order_id,
@@ -284,7 +284,7 @@ ANASTASIS_truth_store (struct GNUNET_CURL_Context *ctx,
       char uuid_str[37];
       char *path;
 
-      uuid_unparse (truth_uuid, uuid_str);
+      uuid_unparse (*truth_uuid, uuid_str);
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "UUID:  %s\n",
                   uuid_str);
diff --git a/src/lib/testing_api_cmd_keyshare_lookup.c 
b/src/lib/testing_api_cmd_keyshare_lookup.c
index e39e280..ec2f491 100644
--- a/src/lib/testing_api_cmd_keyshare_lookup.c
+++ b/src/lib/testing_api_cmd_keyshare_lookup.c
@@ -131,30 +131,56 @@ keyshare_lookup_run (void *cls,
       TALER_TESTING_interpreter_fail (ksls->is);
       return;
     }
-    if (GNUNET_OK !=
-        ANASTASIS_TESTING_get_trait_uuid (upload_cmd,
-                                          0,
-                                          &ksls->truth_uuid))
+      << << << < HEAD
+        {
+        const uuid_t *uuid;
+
+        if (GNUNET_OK !=
+            ANASTASIS_TESTING_get_trait_uuid (upload_cmd,
+                                              0,
+                                              &uuid))
+        {
+          GNUNET_break (0);
+          TALER_TESTING_interpreter_fail (ksls->is);
+          return;
+        }
+        ksls->truth_uuid = uuid;
+        if (NULL == ksls->truth_uuid)
+        {
+          GNUNET_break (0);
+          TALER_TESTING_interpreter_fail (ksls->is);
+          return;
+        }
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                    "Uuid from trait: %s\n",
+                    TALER_B2S (ksls->truth_uuid));
+
+        ====== =
+          if (GNUNET_OK !=
+              ANASTASIS_TESTING_get_trait_uuid (upload_cmd,
+                                                0,
+                                                &ksls->truth_uuid))
+        {
+          GNUNET_break (0);
+          TALER_TESTING_interpreter_fail (ksls->is);
+          return;
+          >> >> >> > f6a488c ... modified salt request
+        }
+      }
+      ksls->kslo = ANASTASIS_keyshare_lookup (is->ctx,
+                                              ksls->anastasis_url,
+                                              ksls->truth_uuid,
+                                              ksls->truth_key,
+                                              &ksls->hashed_answer,
+                                              &keyshare_lookup_cb,
+                                              ksls);
+    if (NULL == ksls->kslo)
     {
       GNUNET_break (0);
       TALER_TESTING_interpreter_fail (ksls->is);
       return;
     }
   }
-  ksls->kslo = ANASTASIS_keyshare_lookup (is->ctx,
-                                          ksls->anastasis_url,
-                                          ksls->truth_uuid,
-                                          ksls->truth_key,
-                                          &ksls->hashed_answer,
-                                          &keyshare_lookup_cb,
-                                          ksls);
-  if (NULL == ksls->kslo)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (ksls->is);
-    return;
-  }
-}
 
 
 /**
@@ -164,22 +190,22 @@ keyshare_lookup_run (void *cls,
  * @param cls closure.
  * @param cmd command being freed.
  */
-static void
-keyshare_lookup_cleanup (void *cls,
-                         const struct TALER_TESTING_Command *cmd)
-{
-  struct KeyShareLookupState *ksls = cls;
-
-  if (NULL != ksls->kslo)
+  static void
+  keyshare_lookup_cleanup (void *cls,
+                           const struct TALER_TESTING_Command *cmd)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Command '%s' did not complete (keyshare lookup)\n",
-                cmd->label);
-    ANASTASIS_keyshare_lookup_cancel (ksls->kslo);
-    ksls->kslo = NULL;
+    struct KeyShareLookupState *ksls = cls;
+
+    if (NULL != ksls->kslo)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                  "Command '%s' did not complete (keyshare lookup)\n",
+                  cmd->label);
+      ANASTASIS_keyshare_lookup_cancel (ksls->kslo);
+      ksls->kslo = NULL;
+    }
+    GNUNET_free (ksls);
   }
-  GNUNET_free (ksls);
-}
 
 
 /**
@@ -189,19 +215,19 @@ keyshare_lookup_cleanup (void *cls,
  * @param size_answer size of the answer
  * @return hash of the answer
  */
-struct GNUNET_HashCode
-ANASTASIS_TESTING_make_hashed_answer (const void *answer,
-                                      size_t size_answer)
-{
-  struct GNUNET_HashCode hashed_answer;
-  GNUNET_CRYPTO_hash (answer,
-                      size_answer,
-                      &hashed_answer);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Hashed answer: %s\n",
-              TALER_B2S (&hashed_answer));
-  return hashed_answer;
-}
+  struct GNUNET_HashCode
+  ANASTASIS_TESTING_make_hashed_answer (const void *answer,
+                                        size_t size_answer)
+  {
+    struct GNUNET_HashCode hashed_answer;
+    GNUNET_CRYPTO_hash (answer,
+                        size_answer,
+                        &hashed_answer);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Hashed answer: %s\n",
+                TALER_B2S (&hashed_answer));
+    return hashed_answer;
+  }
 
 
 /**
@@ -216,42 +242,42 @@ ANASTASIS_TESTING_make_hashed_answer (const void *answer,
  * @param upload_ref reference to upload command
  * @return the command
  */
-struct TALER_TESTING_Command
-ANASTASIS_TESTING_cmd_keyshare_lookup (const char *label,
-                                       const char *anastasis_url,
-                                       unsigned int http_status,
-                                       const struct GNUNET_HashCode answer,
-                                       const struct
-                                       ANASTASIS_CRYPTO_TruthKey *key,
-                                       const char *upload_ref)
-{
-  struct KeyShareLookupState *ksls;
-
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Hashed answer in keyshare lookup cmd: %s\n",
-              TALER_B2S (&answer));
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "TruthKey in keyshare lookup cmd: %s\n",
-              TALER_B2S (key));
-
-  GNUNET_assert (NULL != upload_ref);
-  ksls = GNUNET_new (struct KeyShareLookupState);
-  ksls->http_status = http_status;
-  ksls->anastasis_url = anastasis_url;
-  ksls->upload_reference = upload_ref;
-  ksls->hashed_answer = answer;
-  ksls->truth_key = key;
+  struct TALER_TESTING_Command
+  ANASTASIS_TESTING_cmd_keyshare_lookup (const char *label,
+                                         const char *anastasis_url,
+                                         unsigned int http_status,
+                                         const struct GNUNET_HashCode answer,
+                                         const struct
+                                         ANASTASIS_CRYPTO_TruthKey *key,
+                                         const char *upload_ref)
   {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ksls,
-      .label = label,
-      .run = &keyshare_lookup_run,
-      .cleanup = &keyshare_lookup_cleanup
-    };
-
-    return cmd;
+    struct KeyShareLookupState *ksls;
+
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Hashed answer in keyshare lookup cmd: %s\n",
+                TALER_B2S (&answer));
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "TruthKey in keyshare lookup cmd: %s\n",
+                TALER_B2S (key));
+
+    GNUNET_assert (NULL != upload_ref);
+    ksls = GNUNET_new (struct KeyShareLookupState);
+    ksls->http_status = http_status;
+    ksls->anastasis_url = anastasis_url;
+    ksls->upload_reference = upload_ref;
+    ksls->hashed_answer = answer;
+    ksls->truth_key = key;
+    {
+      struct TALER_TESTING_Command cmd = {
+        .cls = ksls,
+        .label = label,
+        .run = &keyshare_lookup_run,
+        .cleanup = &keyshare_lookup_cleanup
+      };
+
+      return cmd;
+    }
   }
-}
 
 
 /* end of testing_api_cmd_keyshare_lookup.c */
\ No newline at end of file
diff --git a/src/lib/testing_api_cmd_truth_store.c 
b/src/lib/testing_api_cmd_truth_store.c
index 66cd376..bb52a4c 100644
--- a/src/lib/testing_api_cmd_truth_store.c
+++ b/src/lib/testing_api_cmd_truth_store.c
@@ -5,11 +5,19 @@
   Anastasis is free software; you can redistribute it and/or modify it under 
the
   terms of the GNU Lesser General Public License as published by the Free 
Software
   Foundation; either version 3, or (at your option) any later version.
+<<<<<<< HEAD
 
   Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
+=======
+
+  Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+>>>>>>> f6a488c... modified salt request
   You should have received a copy of the GNU General Public License along with
   Anastasis; see the file COPYING.GPL.  If not, see 
<http://www.gnu.org/licenses/>
 */
@@ -30,7 +38,6 @@
  */
 struct TruthStoreState
 {
-
   /**
    * The policy data.
    */
@@ -41,7 +48,10 @@ struct TruthStoreState
    */
   unsigned int http_status;
 
-  const uuid_t truth_uuid;
+  /**
+   * Uuid of truth
+   */
+  const uuid_t *truth_uuid;
 
   /**
    * Hash of the current upload.
@@ -252,12 +262,22 @@ truth_store_run (void *cls,
       }
     }
   }
-  // Create an uuid
-  uuid_t truth_uuid;
-  uuid_generate (truth_uuid);
+  {
+    // Create an uuid
+    uuid_t truth_uuid;
+    uuid_generate (truth_uuid);
+    tss->truth_uuid = &truth_uuid;
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Uuid created: %s\n",
+                TALER_B2S (&truth_uuid));
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Uuid stored in tss: %s\n",
+                TALER_B2S (tss->truth_uuid));
+  }
+
   tss->tso = ANASTASIS_truth_store (is->ctx,
                                     tss->anastasis_url,
-                                    truth_uuid,
+                                    tss->truth_uuid,
                                     tss->truth_data,
                                     (0 !=
                                      (ANASTASIS_TESTING_TSO_REQUEST_PAYMENT
@@ -321,7 +341,11 @@ truth_store_traits (void *cls,
     ANASTASIS_TESTING_make_trait_hash (ANASTASIS_TESTING_TRAIT_HASH_CURRENT,
                                        &tss->curr_hash),
     ANASTASIS_TESTING_make_trait_uuid (0,
-                                       &tss->truth_uuid),
+                                       << << << < HEAD
+                                       tss->truth_uuid),
+    ====== =
+      &tss->truth_uuid),
+    >> >> >> > f6a488c ... modified salt request
     TALER_TESTING_make_trait_order_id (0,
                                        tss->payment_order_id),
     TALER_TESTING_trait_end ()
diff --git a/src/util/vgcore.380224 b/src/util/vgcore.380224
deleted file mode 100644
index 233334c..0000000
Binary files a/src/util/vgcore.380224 and /dev/null differ
diff --git a/src/util/vgcore.381169 b/src/util/vgcore.381169
deleted file mode 100644
index c64f830..0000000
Binary files a/src/util/vgcore.381169 and /dev/null differ

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



reply via email to

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