gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 04/04: worked on testing truth upload (anastasis.c)


From: gnunet
Subject: [taler-anastasis] 04/04: worked on testing truth upload (anastasis.c)
Date: Tue, 28 Apr 2020 19:14:51 +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 c2df06c6d71f4ef68148eead5276fb7ac6fa4dc4
Author: Dennis Neufeld <address@hidden>
AuthorDate: Tue Apr 28 17:14:41 2020 +0000

    worked on testing truth upload (anastasis.c)
---
 src/include/anastasis.h              |  8 +++++---
 src/lib/anastasis.c                  | 17 +++++++++++++----
 src/lib/anastasis_api_policy_store.c |  2 +-
 src/lib/testing_cmd_truth_upload.c   |  3 ++-
 4 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/include/anastasis.h b/src/include/anastasis.h
index 8898b35..5d3bc0d 100644
--- a/src/include/anastasis.h
+++ b/src/include/anastasis.h
@@ -267,19 +267,21 @@ typedef void
 /**
 * Uploads a truth object onto a escrow provider
 *
+* @param ctx the CURL context used to connect to the backend
 * @param id_data user provided authentication for generation of the truth 
encryption
 * @param method defines the method of the challenge (secure question, sms, 
email)
 * @param instructions depending on method! usually only for security 
question/answer!
 * @param mime_type format of the challenge
-* @param data contains the keyshare for this truth
-* @param data_size size of the data
+* @param truth_data contains the truth for this challenge i.e. phone number, 
email address
+* @param truth_data_size size of the data
 * @param tpc opens a truth payment callback to pay the upload
 * @param tpc_cls closure for the payment callback
 * @param tc opens the truth callback which contains the status of the upload
 * @param tc_cls closure for the callback
 */
 struct ANASTASIS_TruthUpload *
-ANASTASIS_truth_upload (const json_t *id_data,
+ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
+                        const json_t *id_data,
                         const char *provider_url,
                         const char *method,
                         const char *instructions,
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index f083bfb..57c9257 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -626,6 +626,7 @@ truth_store_callback (void *cls,
 /**
 * Uploads a truth object onto a escrow provider
 *
+* @param ctx the CURL context used to connect to the backend
 * @param id_data user provided authentication for generation of the truth 
encryption
 * @param method defines the method of the challenge (secure question, sms, 
email)
 * @param instructions depending on method! usually only for security 
question/answer!
@@ -638,7 +639,8 @@ truth_store_callback (void *cls,
 * @param tc_cls closure for the callback
 */
 struct ANASTASIS_TruthUpload *
-ANASTASIS_truth_upload (const json_t *id_data,
+ANASTASIS_truth_upload (struct GNUNET_CURL_Context *ctx,
+                        const json_t *id_data,
                         const char *provider_url,
                         const char *method,
                         const char *instructions,
@@ -652,19 +654,26 @@ ANASTASIS_truth_upload (const json_t *id_data,
 {
   // FIXME Challenge
   struct ANASTASIS_TruthUpload *tu;
-  tu = GNUNET_new (struct ANASTASIS_TruthUpload);
   struct ANASTASIS_Truth *t;
-  t = GNUNET_new (struct ANASTASIS_Truth);
+  struct SaltState *ss;
   struct ANASTASIS_CRYPTO_EncryptedKeyShareP *encrypted_key_share;
   void *encrypted_truth;
   size_t encrypted_truth_size;
   json_t *truth;
+
+  tu = GNUNET_new (struct ANASTASIS_TruthUpload);
+  t = GNUNET_new (struct ANASTASIS_Truth);
+  ss = GNUNET_new (struct ANASTASIS_CRYPTO_SaltP);
+  tu->tc_cls = tc_cls;
+  tu->tpc_cls = tpc_cls;
+  tu->tpc = tpc;
+  tu->tc = tc;
+  tu->ctx = ctx;
   t->url = provider_url;
   t->method = method;
   t->instructions = instructions;
   t->mime_type = mime_type;
   uuid_generate (t->uuid);
-  struct SaltState *ss = tpc_cls;
 
   ss->http_status = MHD_HTTP_OK;
   ss->so = ANASTASIS_salt (tu->ctx,
diff --git a/src/lib/anastasis_api_policy_store.c 
b/src/lib/anastasis_api_policy_store.c
index e4036b3..cb8e324 100644
--- a/src/lib/anastasis_api_policy_store.c
+++ b/src/lib/anastasis_api_policy_store.c
@@ -292,7 +292,7 @@ ANASTASIS_policy_store (struct GNUNET_CURL_Context *ctx,
     .purpose.size = htonl (sizeof (usp))
   };
 
-  /*
+  /* FIXME: Maybe can be deleted
   if (NULL != prev_recovery_data_hash)
     usp.old_recovery_data_hash = *prev_recovery_data_hash;
   */
diff --git a/src/lib/testing_cmd_truth_upload.c 
b/src/lib/testing_cmd_truth_upload.c
index b749bf0..3f60aad 100644
--- a/src/lib/testing_cmd_truth_upload.c
+++ b/src/lib/testing_cmd_truth_upload.c
@@ -201,7 +201,8 @@ truth_upload_run (void *cls,
     tus->truth_number = 0;
   }
 
-  tus->tuo = ANASTASIS_truth_upload (tus->id_data,
+  tus->tuo = ANASTASIS_truth_upload (is->ctx,
+                                     tus->id_data,
                                      tus->anastasis_url,
                                      tus->method,
                                      tus->instructions,

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



reply via email to

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