gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: worked on anastasis.c and testi


From: gnunet
Subject: [taler-anastasis] branch master updated: worked on anastasis.c and testing
Date: Tue, 28 Apr 2020 21:52:08 +0200

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

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

The following commit(s) were added to refs/heads/master by this push:
     new dfff2c2  worked on anastasis.c and testing
dfff2c2 is described below

commit dfff2c245256a49109dc9066830aa33db85434e6
Author: Dennis Neufeld <address@hidden>
AuthorDate: Tue Apr 28 19:51:52 2020 +0000

    worked on anastasis.c and testing
---
 src/include/anastasis_testing_lib.h |  2 +-
 src/lib/anastasis.c                 | 41 ++++++++++++++++++++++++++++++++-----
 src/lib/test_anastasis.c            |  9 +++-----
 src/lib/testing_cmd_truth_upload.c  |  7 ++++++-
 4 files changed, 46 insertions(+), 13 deletions(-)

diff --git a/src/include/anastasis_testing_lib.h 
b/src/include/anastasis_testing_lib.h
index f523058..f7406a5 100644
--- a/src/include/anastasis_testing_lib.h
+++ b/src/include/anastasis_testing_lib.h
@@ -513,7 +513,7 @@ ANASTASIS_TESTING_make_id_data_example (const char 
*id_data);
 struct TALER_TESTING_Command
 ANASTASIS_TESTING_cmd_truth_upload (const char *label,
                                     const char *anastasis_url,
-                                    const json_t *id_data,
+                                    json_t *id_data,
                                     const char *method,
                                     const char *instructions,
                                     const char *mime_type,
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index 57c9257..58dc653 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -680,20 +680,47 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
                            provider_url,
                            &salt_cb,
                            ss);
-
+  if (NULL == &ss->so->salt)
+  {
+    GNUNET_break (0);
+    return;
+  }
+  if (NULL == id_data)
+  {
+    GNUNET_break (0);
+    return;
+  }
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "At %s:%d server salt is %s-%llu b\n", __FILE__, __LINE__,
+              TALER_B2S (&ss->so->salt),
+              (unsigned long long) sizeof (ss->so->salt));
   ANASTASIS_CRYPTO_keyshare_create (&t->key_share);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "At %s:%d keyshare is %s-%llu b\n", __FILE__, __LINE__,
+              TALER_B2S (&t->key_share),
+              (unsigned long long) sizeof (t->key_share));
   ANASTASIS_CRYPTO_user_identifier_derive (id_data,
                                            &ss->so->salt,
                                            &tu->id);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "At %s:%d user identifier is %s-%llu b\n", __FILE__, __LINE__,
+              TALER_B2S (&tu->id),
+              (unsigned long long) sizeof (tu->id));
   ANASTASIS_CRYPTO_keyshare_encrypt (&t->key_share,
                                      &tu->id,
                                      &encrypted_key_share);
-  salt_cleanup (ss);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "At %s:%d encrypted key share is %s-%llu b\n", __FILE__, 
__LINE__,
+              TALER_B2S (encrypted_key_share),
+              (unsigned long long) sizeof (*encrypted_key_share));
 
   GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG,
                               &t->truth_key,
                               sizeof (struct ANASTASIS_CRYPTO_TruthKeyP));
-
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "At %s:%d truth key is %s-%llu b\n", __FILE__, __LINE__,
+              TALER_B2S (&t->truth_key),
+              (unsigned long long) sizeof (t->truth_key));
   ANASTASIS_CRYPTO_truth_encrypt (&t->truth_key,
                                   truth_data,
                                   truth_data_size,
@@ -710,7 +737,11 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
                      "encrypted_truth", GNUNET_JSON_from_data (
                        encrypted_truth, encrypted_truth_size),
                      "truth_mime", mime_type);
-
+  if (NULL == truth)
+  {
+    GNUNET_break (0);
+    return;
+  }
   tu->tso = ANASTASIS_truth_store (tu->ctx,
                                    t->url,
                                    &t->uuid,
@@ -719,7 +750,7 @@ ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
                                    tu->paid_order_id,
                                    &truth_store_callback,
                                    tu);
-
+  salt_cleanup (ss);
   // SETUP TRUTH CALLBACK
   tu->tc = tc;
   tu->tc_cls = tc_cls;
diff --git a/src/lib/test_anastasis.c b/src/lib/test_anastasis.c
index 0c4be60..8dfe491 100644
--- a/src/lib/test_anastasis.c
+++ b/src/lib/test_anastasis.c
@@ -188,8 +188,7 @@ run (void *cls,
     ANASTASIS_TESTING_cmd_truth_upload ("truth-create-1",
                                         anastasis_url,
                                         ANASTASIS_TESTING_make_id_data_example 
(
-                                          "MaxMuster123456789"
-                                          ),
+                                          "MaxMuster123456789"),
                                         "Secure-Question",
                                         "You have to answer the secure 
question.",
                                         "string",
@@ -202,8 +201,7 @@ run (void *cls,
     ANASTASIS_TESTING_cmd_truth_upload ("truth-create-2",
                                         anastasis_url,
                                         ANASTASIS_TESTING_make_id_data_example 
(
-                                          "MaxMuster123456789"
-                                          ),
+                                          "MaxMuster123456789"),
                                         "Secure-Question",
                                         "You have to answer the secure 
question.",
                                         "string",
@@ -216,8 +214,7 @@ run (void *cls,
     ANASTASIS_TESTING_cmd_truth_upload ("truth-create-3",
                                         anastasis_url,
                                         ANASTASIS_TESTING_make_id_data_example 
(
-                                          "MaxMuster123456789"
-                                          ),
+                                          "MaxMuster123456789"),
                                         "Secure-Question",
                                         "You have to answer the secure 
question.",
                                         "string",
diff --git a/src/lib/testing_cmd_truth_upload.c 
b/src/lib/testing_cmd_truth_upload.c
index 3f60aad..bdcd206 100644
--- a/src/lib/testing_cmd_truth_upload.c
+++ b/src/lib/testing_cmd_truth_upload.c
@@ -293,6 +293,11 @@ ANASTASIS_TESTING_make_id_data_example (const char 
*id_data)
 {
   json_t *id;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "At %s:%d id data string is %s-%llu b\n", __FILE__, __LINE__,
+              id_data,
+              (unsigned long long) strlen (id_data));
+
   id = json_pack ("{s:s}",
                   "id_data", id_data);
   GNUNET_assert (NULL != id);
@@ -320,7 +325,7 @@ ANASTASIS_TESTING_make_id_data_example (const char *id_data)
 struct TALER_TESTING_Command
 ANASTASIS_TESTING_cmd_truth_upload (const char *label,
                                     const char *anastasis_url,
-                                    const json_t *id_data,
+                                    json_t *id_data,
                                     const char *method,
                                     const char *instructions,
                                     const char *mime_type,

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



reply via email to

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