gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 89/130: -misc fixes


From: gnunet
Subject: [taler-exchange] 89/130: -misc fixes
Date: Wed, 17 Nov 2021 12:25:37 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

commit 81f9b2c93eabc283af6410744d81b343c2332d60
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Nov 6 19:57:34 2021 +0100

    -misc fixes
---
 src/auditor/taler-auditor-httpd_deposit-confirmation.c     | 2 ++
 src/auditordb/auditor-0001.sql                             | 1 +
 src/auditordb/plugin_auditordb_postgres.c                  | 5 ++++-
 src/exchangedb/drop0001.sql                                | 1 +
 src/include/taler_auditor_service.h                        | 2 ++
 src/include/taler_auditordb_plugin.h                       | 5 +++++
 src/lib/auditor_api_deposit_confirmation.c                 | 8 +++++++-
 src/lib/exchange_api_deposit.c                             | 1 +
 src/testing/testing_api_cmd_auditor_deposit_confirmation.c | 2 ++
 9 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation.c 
b/src/auditor/taler-auditor-httpd_deposit-confirmation.c
index 20500a88..8f16f36f 100644
--- a/src/auditor/taler-auditor-httpd_deposit-confirmation.c
+++ b/src/auditor/taler-auditor-httpd_deposit-confirmation.c
@@ -249,6 +249,8 @@ TAH_DEPOSIT_CONFIRMATION_handler (struct TAH_RequestHandler 
*rh,
   struct GNUNET_JSON_Specification spec[] = {
     GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
                                  &dc.h_contract_terms),
+    GNUNET_JSON_spec_fixed_auto ("h_extensions",
+                                 &dc.h_extensions),
     GNUNET_JSON_spec_fixed_auto ("h_wire",
                                  &dc.h_wire),
     TALER_JSON_spec_absolute_time ("exchange_timestamp",
diff --git a/src/auditordb/auditor-0001.sql b/src/auditordb/auditor-0001.sql
index e7ac7538..c5633802 100644
--- a/src/auditordb/auditor-0001.sql
+++ b/src/auditordb/auditor-0001.sql
@@ -228,6 +228,7 @@ CREATE TABLE IF NOT EXISTS deposit_confirmations
   (master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES 
auditor_exchanges(master_pub) ON DELETE CASCADE
   ,serial_id BIGSERIAL UNIQUE
   ,h_contract_terms BYTEA CHECK (LENGTH(h_contract_terms)=64)
+  ,h_extensions BYTEA CHECK (LENGTH(h_contract_terms)=64)
   ,h_wire BYTEA CHECK (LENGTH(h_wire)=64)
   ,exchange_timestamp INT8 NOT NULL
   ,refund_deadline INT8 NOT NULL
diff --git a/src/auditordb/plugin_auditordb_postgres.c 
b/src/auditordb/plugin_auditordb_postgres.c
index d4cfa427..1a2e86c2 100644
--- a/src/auditordb/plugin_auditordb_postgres.c
+++ b/src/auditordb/plugin_auditordb_postgres.c
@@ -1030,10 +1030,11 @@ postgres_insert_deposit_confirmation (
   struct GNUNET_PQ_QueryParam params[] = {
     GNUNET_PQ_query_param_auto_from_type (&dc->master_public_key),
     GNUNET_PQ_query_param_auto_from_type (&dc->h_contract_terms),
+    GNUNET_PQ_query_param_auto_from_type (&dc->h_extensions),
     GNUNET_PQ_query_param_auto_from_type (&dc->h_wire),
     TALER_PQ_query_param_absolute_time (&dc->exchange_timestamp),
-    TALER_PQ_query_param_absolute_time (&dc->refund_deadline),
     TALER_PQ_query_param_absolute_time (&dc->wire_deadline),
+    TALER_PQ_query_param_absolute_time (&dc->refund_deadline),
     TALER_PQ_query_param_amount (&dc->amount_without_fee),
     GNUNET_PQ_query_param_auto_from_type (&dc->coin_pub),
     GNUNET_PQ_query_param_auto_from_type (&dc->merchant),
@@ -1110,6 +1111,8 @@ deposit_confirmation_cb (void *cls,
                                     &serial_id),
       GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
                                             &dc.h_contract_terms),
+      GNUNET_PQ_result_spec_auto_from_type ("h_extensions",
+                                            &dc.h_contract_terms),
       GNUNET_PQ_result_spec_auto_from_type ("h_wire",
                                             &dc.h_wire),
       GNUNET_PQ_result_spec_absolute_time ("exchange_timestamp",
diff --git a/src/exchangedb/drop0001.sql b/src/exchangedb/drop0001.sql
index 9c77d30c..52079e52 100644
--- a/src/exchangedb/drop0001.sql
+++ b/src/exchangedb/drop0001.sql
@@ -41,6 +41,7 @@ DROP TABLE IF EXISTS wire_out CASCADE;
 DROP TABLE IF EXISTS wire_targets CASCADE;
 DROP TABLE IF EXISTS wire_fee CASCADE;
 DROP TABLE IF EXISTS deposits CASCADE;
+DROP TABLE IF EXISTS extension_details CASCADE;
 DROP TABLE IF EXISTS refunds CASCADE;
 DROP TABLE IF EXISTS refresh_commitments CASCADE;
 DROP TABLE IF EXISTS refresh_revealed_coins CASCADE;
diff --git a/src/include/taler_auditor_service.h 
b/src/include/taler_auditor_service.h
index 4da72c1c..bc990a14 100644
--- a/src/include/taler_auditor_service.h
+++ b/src/include/taler_auditor_service.h
@@ -233,6 +233,7 @@ typedef void
  *
  * @param auditor the auditor handle; the auditor must be ready to operate
  * @param h_wire hash of merchant wire details
+ * @param h_extensions hash over the extensions, if any
  * @param h_contract_terms hash of the contact of the merchant with the 
customer (further details are never disclosed to the auditor)
  * @param exchange_timestamp timestamp when the contract was finalized, must 
not be too far in the future
  * @param wire_deadline date until which the exchange should wire the funds
@@ -256,6 +257,7 @@ struct TALER_AUDITOR_DepositConfirmationHandle *
 TALER_AUDITOR_deposit_confirmation (
   struct TALER_AUDITOR_Handle *auditor,
   const struct TALER_MerchantWireHash *h_wire,
+  const struct TALER_ExtensionContractHash *h_extensions,
   const struct TALER_PrivateContractHash *h_contract_terms,
   struct GNUNET_TIME_Absolute timestamp,
   struct GNUNET_TIME_Absolute wire_deadline,
diff --git a/src/include/taler_auditordb_plugin.h 
b/src/include/taler_auditordb_plugin.h
index 8dd454b9..7756db2b 100644
--- a/src/include/taler_auditordb_plugin.h
+++ b/src/include/taler_auditordb_plugin.h
@@ -276,6 +276,11 @@ struct TALER_AUDITORDB_DepositConfirmation
    */
   struct TALER_PrivateContractHash h_contract_terms;
 
+  /**
+   * Hash over the extensions for the deposit.
+   */
+  struct TALER_ExtensionContractHash h_extensions;
+
   /**
    * Hash over the wiring information of the merchant.
    */
diff --git a/src/lib/auditor_api_deposit_confirmation.c 
b/src/lib/auditor_api_deposit_confirmation.c
index 41f9d5e4..5b207a18 100644
--- a/src/lib/auditor_api_deposit_confirmation.c
+++ b/src/lib/auditor_api_deposit_confirmation.c
@@ -153,6 +153,7 @@ handle_deposit_confirmation_finished (void *cls,
  * Verify signature information about the deposit-confirmation.
  *
  * @param h_wire hash of merchant wire details
+ * @param h_extensions hash over the extensions, if any
  * @param h_contract_terms hash of the contact of the merchant with the 
customer (further details are never disclosed to the auditor)
  * @param exchange_timestamp timestamp when the deposit was received by the 
wallet
  * @param refund_deadline date until which the merchant can issue a refund to 
the customer via the auditor (can be zero if refunds are not allowed); must not 
be after the @a wire_deadline
@@ -170,6 +171,7 @@ handle_deposit_confirmation_finished (void *cls,
  */
 static enum GNUNET_GenericReturnValue
 verify_signatures (const struct TALER_MerchantWireHash *h_wire,
+                   const struct TALER_ExtensionContractHash *h_extensions,
                    const struct TALER_PrivateContractHash *h_contract_terms,
                    struct GNUNET_TIME_Absolute exchange_timestamp,
                    struct GNUNET_TIME_Absolute wire_deadline,
@@ -188,7 +190,7 @@ verify_signatures (const struct TALER_MerchantWireHash 
*h_wire,
   if (GNUNET_OK !=
       TALER_exchange_deposit_confirm_verify (h_contract_terms,
                                              h_wire,
-                                             NULL /* h_extensions! */,
+                                             h_extensions,
                                              exchange_timestamp,
                                              wire_deadline,
                                              refund_deadline,
@@ -235,6 +237,7 @@ struct TALER_AUDITOR_DepositConfirmationHandle *
 TALER_AUDITOR_deposit_confirmation (
   struct TALER_AUDITOR_Handle *auditor,
   const struct TALER_MerchantWireHash *h_wire,
+  const struct TALER_ExtensionContractHash *h_extensions,
   const struct TALER_PrivateContractHash *h_contract_terms,
   struct GNUNET_TIME_Absolute exchange_timestamp,
   struct GNUNET_TIME_Absolute wire_deadline,
@@ -266,6 +269,7 @@ TALER_AUDITOR_deposit_confirmation (
                  TALER_AUDITOR_handle_is_ready_ (auditor));
   if (GNUNET_OK !=
       verify_signatures (h_wire,
+                         h_extensions,
                          h_contract_terms,
                          exchange_timestamp,
                          wire_deadline,
@@ -289,6 +293,8 @@ TALER_AUDITOR_deposit_confirmation (
     = GNUNET_JSON_PACK (
         GNUNET_JSON_pack_data_auto ("h_wire",
                                     h_wire),
+        GNUNET_JSON_pack_data_auto ("h_extensions",
+                                    h_extensions),
         GNUNET_JSON_pack_data_auto ("h_contract_terms",
                                     h_contract_terms),
         GNUNET_JSON_pack_time_abs ("exchange_timestamp",
diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c
index 60dcb066..e857c8ea 100644
--- a/src/lib/exchange_api_deposit.c
+++ b/src/lib/exchange_api_deposit.c
@@ -205,6 +205,7 @@ auditor_cb (void *cls,
   aie->dch = TALER_AUDITOR_deposit_confirmation (
     ah,
     &dh->h_wire,
+    &dh->h_extensions,
     &dh->h_contract_terms,
     dh->exchange_timestamp,
     dh->wire_deadline,
diff --git a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c 
b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
index 12496e0e..54b5dd6c 100644
--- a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
+++ b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c
@@ -199,6 +199,7 @@ deposit_confirmation_run (void *cls,
                           const struct TALER_TESTING_Command *cmd,
                           struct TALER_TESTING_Interpreter *is)
 {
+  static struct TALER_ExtensionContractHash no_h_extensions;
   struct DepositConfirmationState *dcs = cls;
   const struct TALER_TESTING_Command *deposit_cmd;
   struct TALER_MerchantWireHash h_wire;
@@ -317,6 +318,7 @@ deposit_confirmation_run (void *cls,
   }
   dcs->dc = TALER_AUDITOR_deposit_confirmation (dcs->auditor,
                                                 &h_wire,
+                                                &no_h_extensions,
                                                 &h_contract_terms,
                                                 *exchange_timestamp,
                                                 *wire_deadline,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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