gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: comments


From: gnunet
Subject: [taler-anastasis] branch master updated: comments
Date: Thu, 19 Dec 2019 09:52:11 +0100

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

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 0992b47  comments
0992b47 is described below

commit 0992b476e50efd1d676fa9737cedbcad0f929726
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Dec 19 09:52:09 2019 +0100

    comments
---
 src/backend/anastasis-httpd.c                   |  6 +++++-
 src/backend/anastasis-httpd_policy.c.uncrustify |  0
 src/backend/anastasis-httpd_policy_upload.c     |  9 ++++++---
 src/include/anastasis.h                         | 27 +++++++++++++++++++++++++
 src/include/anastasis_crypto_lib.h              |  7 ++++++-
 src/include/anastasis_service.h                 |  2 --
 src/include/anastasis_testing_lib.h             |  1 +
 src/lib/anastasis_api_policy_lookup.c           |  2 ++
 src/lib/anastasis_api_policy_store.c            |  3 ++-
 src/lib/test_anastasis_api.c                    |  2 ++
 src/lib/testing_api_cmd_policy_store.c          |  2 ++
 src/lib/testing_api_helpers.c                   |  1 -
 src/stasis/plugin_anastasis_postgres.c          |  2 +-
 13 files changed, 54 insertions(+), 10 deletions(-)

diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c
index c1200af..d1d8f33 100644
--- a/src/backend/anastasis-httpd.c
+++ b/src/backend/anastasis-httpd.c
@@ -118,6 +118,7 @@ run_daemon (void *cls)
   mhd_task = prepare_daemon ();
 }
 
+
 /**
  * Kick MHD to run now, to be called after MHD_resume_connection().
  * Basically, we need to explicitly resume MHD's event loop whenever
@@ -139,6 +140,7 @@ AH_trigger_daemon ()
   }
 }
 
+
 /**
  * Kick GNUnet Curl scheduler to begin curl interactions.
  */
@@ -148,6 +150,7 @@ AH_trigger_curl ()
   GNUNET_CURL_gnunet_scheduler_reschedule (&rc);
 }
 
+
 /**
  * Return GNUNET_YES if given a valid correlation ID and
  * GNUNET_NO otherwise.
@@ -160,7 +163,7 @@ is_valid_correlation_id (const char *correlation_id)
   if (strlen (correlation_id) >= 64)
     return GNUNET_NO;
   for (int i = 0; i < strlen (correlation_id); i++)
-    if (! (isalnum (correlation_id[i]) ||(correlation_id[i] == '-')))
+    if (! (isalnum (correlation_id[i]) || (correlation_id[i] == '-')))
       return GNUNET_NO;
   return GNUNET_YES;
 }
@@ -404,6 +407,7 @@ handle_mhd_completion_callback (void *cls,
   *con_cls = NULL;
 }
 
+
 /**
  * Function that queries MHD's select sets and
  * starts the task waiting for them.
diff --git a/src/backend/anastasis-httpd_policy.c.uncrustify 
b/src/backend/anastasis-httpd_policy.c.uncrustify
deleted file mode 100644
index e69de29..0000000
diff --git a/src/backend/anastasis-httpd_policy_upload.c 
b/src/backend/anastasis-httpd_policy_upload.c
index 0e14436..4fb23d3 100644
--- a/src/backend/anastasis-httpd_policy_upload.c
+++ b/src/backend/anastasis-httpd_policy_upload.c
@@ -222,6 +222,7 @@ make_payment_request (const char *order_id)
   return resp;
 }
 
+
 /**
  * FIXME: Is this reasonable?
  */
@@ -229,8 +230,8 @@ unsigned int
 amount_to_post_counter (const struct TALER_Amount *amount)
 {
   /* FIXME: reasonable conversion from Taler Amount to post counter */
-  if ((0 == strcmp (amount->currency, "CHF"))|| (0 == strcmp (amount->currency,
-                                                              "EUR")))
+  if ((0 == strcmp (amount->currency, "CHF")) || (0 == strcmp 
(amount->currency,
+                                                               "EUR")))
   {
     // FIXME: check if long long value is in int range
     return (int) amount->value * 10;
@@ -238,6 +239,7 @@ amount_to_post_counter (const struct TALER_Amount *amount)
   return 0;
 }
 
+
 /**
  * Callbacks of this type are used to serve the result of submitting a
  * /contract request to a merchant.
@@ -412,6 +414,7 @@ await_payment (struct PolicyUploadContext *puc,
   AH_trigger_curl ();
 }
 
+
 /**
  * Helper function used to ask our backend to begin
  * processing a payment for the user's account.
@@ -527,7 +530,7 @@ handle_database_error (struct PolicyUploadContext *puc,
 
       puc->order_id = order_id;
 
-      if ((NULL == order_id)|| GNUNET_is_zero (order_id))
+      if ((NULL == order_id) || GNUNET_is_zero (order_id))
       {
         GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                     "Payment required, starting payment process\n");
diff --git a/src/include/anastasis.h b/src/include/anastasis.h
index dbf4951..0396e91 100644
--- a/src/include/anastasis.h
+++ b/src/include/anastasis.h
@@ -52,4 +52,31 @@ ANASTASIS_escrow_provider_recovery_document_upload (const 
char *base_url,
                                                     
ANASTASIS_RecoverUploadResult
                                                     cb,
                                                     void *cb_cls);
+
 // ... cancel
+
+
+struct ANASTASIS_Handle;
+
+// In the C code:
+// {
+//   json_t *policy_document;
+//   unsigned int escrow_methods_length;
+//   struct ANASTASIS_CRYPTO_EscrowMethod *escrow_methods;
+// };
+
+
+int
+ANASTASIS_add_escrow_method (struct ANASTASIS_Handle *h,
+                             const char *provider_url,
+                             const char *method,
+                             const void *challenge,
+                             size_t challange_size,
+                             const void *truth,
+                             size_t truth_size,
+                             struct ANASTASIS_CRYPTO_EscrowUuid *uuid);
+
+
+int
+ANASTASIS_remove_escrow_method (struct ANASTASIS_Handle *h,
+                                const struct ANASTASIS_CRYPTO_EscrowUuid 
*uuid);
diff --git a/src/include/anastasis_crypto_lib.h 
b/src/include/anastasis_crypto_lib.h
index 50058e2..43b40a3 100644
--- a/src/include/anastasis_crypto_lib.h
+++ b/src/include/anastasis_crypto_lib.h
@@ -59,6 +59,7 @@ void
 ANASTASIS_CRYPTO_uid_hash (const json_t *id_data,
                            struct ANASTASIS_CRYPTO_UserIdentifier
                            *id);
+
 /**
  * Generates the eddsa Public Key
  * @param uid Hashed Userinput, used as entropy source for the key Generation
@@ -68,6 +69,7 @@ struct ANASTASIS_AccountPrivP *
 ANASTASIS_CRYPTO_privKey (const struct
                           ANASTASIS_CRYPTO_UserIdentifier
                           *uid);
+
 /**
  * Generates the eddsa public Key from the private Key
  * @param privP generated eddsa private key
@@ -77,6 +79,7 @@ struct ANASTASIS_AccountPubP *
 ANASTASIS_CRYPTO_pubKey (const struct
                          ANASTASIS_AccountPrivP
                          *privP);
+
 /**
  * Encrypts the Recoverydocument
  * @param p Reference to the Recoverydocument which should be encrypted
@@ -93,6 +96,7 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (const struct
                                             ANASTASIS_CRYPTO_UserIdentifier 
*id,
                                             void **res,
                                             size_t *res_size);
+
 /**
  * Encrypts the Recoverydocument
  * @param id Hashed User input, used for the generation of the encryption key
@@ -114,7 +118,6 @@ ANASTASIS_CRYPTO_escrow_master_key_create (const struct
                                            unsigned int keyshare_length);
 
 
-
 struct ANASTASIS_CRYPTO_Policy *
 ANSTASIS_CRYPTO_policy_create (const struct
                                ANASTASIS_CRYPTO_salt *
@@ -156,9 +159,11 @@ ANASTASIS_CRYPTO_recovery_document_create (struct
 void
 ANASTASIS_CRYPTO_recovery_document_destroy (struct
                                             ANASTASIS_CRYPTO_RecoveryDocument 
*p);
+
 void
 ANASTASIS_CRYPTO_escrow_method_destroy (struct
                                         ANASTASIS_CRYPTO_EscrowMethod *p);
+
 void
 ANASTASIS_CRYPTO_policy_destroy (struct
                                  ANASTASIS_CRYPTO_Policy *p);
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 9796903..e99a851 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -109,7 +109,6 @@ struct ANASTASIS_Salt
 GNUNET_NETWORK_STRUCT_END
 
 
-
 /**
  * High-level ways how an upload may conclude.
  */
@@ -239,7 +238,6 @@ struct ANASTASIS_UploadDetails
 };
 
 
-
 typedef void
 (ANASTASIS_SaltCallback)(void *cls,
                          const struct ANASTASIS_Salt *salt);
diff --git a/src/include/anastasis_testing_lib.h 
b/src/include/anastasis_testing_lib.h
index 963afaf..a617fb5 100644
--- a/src/include/anastasis_testing_lib.h
+++ b/src/include/anastasis_testing_lib.h
@@ -242,6 +242,7 @@ ANASTASIS_TESTING_cmd_policy_store (const char *label,
                                     ANASTASIS_TESTING_PolicyStoreOption pso,
                                     const void *policy_data,
                                     size_t policy_data_size);
+
 /**
  * Make the "policy lookup" command.
  *
diff --git a/src/lib/anastasis_api_policy_lookup.c 
b/src/lib/anastasis_api_policy_lookup.c
index 2f980b2..8c2fba1 100644
--- a/src/lib/anastasis_api_policy_lookup.c
+++ b/src/lib/anastasis_api_policy_lookup.c
@@ -193,6 +193,7 @@ handle_policy_lookup_finished (void *cls,
   ANASTASIS_policy_lookup_cancel (plo);
 }
 
+
 /**
  * Handle HTTP header received by curl.
  *
@@ -266,6 +267,7 @@ handle_header (char *buffer,
   return total;
 }
 
+
 /**
  * Does a GET /policy.
  *
diff --git a/src/lib/anastasis_api_policy_store.c 
b/src/lib/anastasis_api_policy_store.c
index 8aa1f41..13172f3 100644
--- a/src/lib/anastasis_api_policy_store.c
+++ b/src/lib/anastasis_api_policy_store.c
@@ -95,6 +95,7 @@ ANASTASIS_policy_store_cancel (struct
   GNUNET_free (pso);
 }
 
+
 /**
  * Callback to process POST /policy response
  *
@@ -188,6 +189,7 @@ handle_policy_store_finished (void *cls,
   ANASTASIS_policy_store_cancel (pso);
 }
 
+
 /**
  * Handle HTTP header received by curl.
  *
@@ -238,7 +240,6 @@ handle_header (char *buffer,
 }
 
 
-
 /**
  * Store policies, does a POST /policy/$AccountPub
  *
diff --git a/src/lib/test_anastasis_api.c b/src/lib/test_anastasis_api.c
index 25be00f..e9df51d 100644
--- a/src/lib/test_anastasis_api.c
+++ b/src/lib/test_anastasis_api.c
@@ -340,6 +340,7 @@ run (void *cls,
                                    fakebank_url);
 }
 
+
 int
 main (int argc,
       char *const *argv)
@@ -410,4 +411,5 @@ main (int argc,
   return 0;
 }
 
+
 /* end of test_merchant_api.c */
diff --git a/src/lib/testing_api_cmd_policy_store.c 
b/src/lib/testing_api_cmd_policy_store.c
index f044f70..64a86b1 100644
--- a/src/lib/testing_api_cmd_policy_store.c
+++ b/src/lib/testing_api_cmd_policy_store.c
@@ -248,6 +248,7 @@ policy_store_cb (void *cls,
   TALER_TESTING_interpreter_next (pss->is);
 }
 
+
 /**
  * Run a "policy store" CMD.
  *
@@ -439,6 +440,7 @@ policy_store_cleanup (void *cls,
   GNUNET_free (pss);
 }
 
+
 /**
  * Offer internal data to other commands.
  *
diff --git a/src/lib/testing_api_helpers.c b/src/lib/testing_api_helpers.c
index bc5e3f6..973aac3 100644
--- a/src/lib/testing_api_helpers.c
+++ b/src/lib/testing_api_helpers.c
@@ -188,7 +188,6 @@ TALER_TESTING_prepare_anastasis (const char 
*config_filename)
   GNUNET_OS_process_destroy (dbinit_proc);
 
 
-
   GNUNET_asprintf (&base_url,
                    "http://localhost:%llu/";,
                    port);
diff --git a/src/stasis/plugin_anastasis_postgres.c 
b/src/stasis/plugin_anastasis_postgres.c
index 182be1e..9d43764 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -255,7 +255,7 @@ postgres_lookup_expired_payment_by_account (void *cls,
   if (qs == ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT)
   {
     time_remaining = GNUNET_TIME_absolute_get_remaining (paid_until);
-    if ( GNUNET_TIME_round_rel (&time_remaining) == 0)
+    if (GNUNET_TIME_round_rel (&time_remaining) == 0)
       return ANASTASIS_DB_STATUS_PAYMENT_REQUIRED;
   }
   GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs);

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



reply via email to

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