[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] 01/04: Modified TruthUpload
From: |
gnunet |
Subject: |
[taler-anastasis] 01/04: Modified TruthUpload |
Date: |
Tue, 28 Apr 2020 19:14:48 +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 ccdfb79195f2f5d09d6fc25af38549b0016de2a3
Author: Dennis Neufeld <address@hidden>
AuthorDate: Mon Apr 27 11:45:24 2020 +0000
Modified TruthUpload
---
src/lib/anastasis.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index 884c634..356c338 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -505,35 +505,47 @@ struct ANASTASIS_TruthUpload
* Expected HTTP Status
*/
unsigned int http_status;
+
/**
* CURL Context for the Post Request
*/
struct GNUNET_CURL_Context *ctx;
+
/**
* User identifier used for the keyshare encryption
*/
struct ANASTASIS_CRYPTO_UserIdentifierP id;
+
/**
* Callback which tells the user the payment details for the upload
*/
ANASTASIS_TruthPaymentCallback tpc;
+
/**
* Closure for the payment callback
*/
void *tpc_cls;
+
/**
* Callback which sends back the generated truth object later used to build
the policy
*/
ANASTASIS_TruthCallback tc;
+
/**
* Closure for the Callback
*/
void *tc_cls;
+
/**
* Reference to the Truthstore Operation
*/
struct ANASTASIS_TruthStoreOperation *tso;
+ /**
+ * the truth details
+ */
+ json_t *truth;
+
// FIXME not sure how to do payment
int payment_requested;
const char *paid_order_id;
@@ -651,7 +663,6 @@ ANASTASIS_truth_upload (const json_t *id_data,
struct ANASTASIS_CRYPTO_EncryptedKeyShareP *encrypted_key_share;
void *encrypted_truth;
size_t encrypted_truth_size;
- json_t *truth;
t->url = provider_url;
t->method = method;
t->instructions = instructions;
@@ -684,21 +695,21 @@ ANASTASIS_truth_upload (const json_t *id_data,
&encrypted_truth,
&encrypted_truth_size);
- truth = json_pack ("{s:o," /* encrypted KeyShare */
- " s:s," /* method */
- " s:o," /* nonce */
- " s:s}", /* truth_mime */
- "keyshare_data", GNUNET_JSON_from_data_auto (
- encrypted_key_share),
- "method", method,
- "encrypted_truth", GNUNET_JSON_from_data (
- encrypted_truth, encrypted_truth_size),
- "truth_mime", mime_type);
+ tu->truth = json_pack ("{s:o," /* encrypted KeyShare */
+ " s:s," /* method */
+ " s:o," /* nonce */
+ " s:s}", /* truth_mime */
+ "keyshare_data", GNUNET_JSON_from_data_auto (
+ encrypted_key_share),
+ "method", method,
+ "encrypted_truth", GNUNET_JSON_from_data (
+ encrypted_truth, encrypted_truth_size),
+ "truth_mime", mime_type);
tu->tso = ANASTASIS_truth_store (tu->ctx,
t->url,
&t->uuid,
- truth,
+ tu->truth,
tu->payment_requested,
tu->paid_order_id,
&truth_store_callback,
@@ -716,6 +727,7 @@ ANASTASIS_truth_upload (const json_t *id_data,
// FIXME PAYMENT CALLBACK
return tu;
}
+
/**
* Cancels a upload process
* @param tu handle for the upload
--
To stop receiving notification emails like this one, please contact
address@hidden.