gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: adaptations for signing API chan


From: gnunet
Subject: [taler-merchant] branch master updated: adaptations for signing API change in GNUnet (#6164)
Date: Wed, 08 Apr 2020 18:18:35 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 8eb0270  adaptations for signing API change in GNUnet (#6164)
8eb0270 is described below

commit 8eb027085c388296e6885139638f4bba255c69f5
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Apr 8 16:36:13 2020 +0200

    adaptations for signing API change in GNUnet (#6164)
---
 src/backend/taler-merchant-httpd_pay.c        | 25 ++++++-------------------
 src/backend/taler-merchant-httpd_proposal.c   |  7 +++----
 src/backend/taler-merchant-httpd_refund.c     | 13 +++----------
 src/backend/taler-merchant-httpd_tip-pickup.c |  7 +++----
 src/lib/merchant_api_pay.c                    |  9 ++++-----
 src/lib/testing_api_cmd_pay.c                 |  4 ++--
 6 files changed, 21 insertions(+), 44 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_pay.c 
b/src/backend/taler-merchant-httpd_pay.c
index e0f9915..44466f1 100644
--- a/src/backend/taler-merchant-httpd_pay.c
+++ b/src/backend/taler-merchant-httpd_pay.c
@@ -591,10 +591,9 @@ generate_success_response (struct PayContext *pc)
       .h_contract_terms = pc->h_contract_terms
     };
 
-    GNUNET_assert (GNUNET_OK ==
-                   GNUNET_CRYPTO_eddsa_sign (&pc->mi->privkey.eddsa_priv,
-                                             &mr.purpose,
-                                             &sig));
+    GNUNET_CRYPTO_eddsa_sign (&pc->mi->privkey.eddsa_priv,
+                              &mr,
+                              &sig);
   }
 
   /* Build the response */
@@ -2031,21 +2030,9 @@ begin_transaction (struct PayContext *pc)
         TALER_amount_hton (&rr.refund_fee,
                            &pc->dc[i].refund_fee);
 
-        if (GNUNET_OK !=
-            GNUNET_CRYPTO_eddsa_sign (&pc->mi->privkey.eddsa_priv,
-                                      &rr.purpose,
-                                      &msig.eddsa_sig))
-        {
-          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                      "Failed to sign successful refund confirmation\n");
-          json_decref (refunds);
-          resume_pay_with_error (pc,
-                                 MHD_HTTP_INTERNAL_SERVER_ERROR,
-                                 TALER_EC_PAY_REFUND_SIGNATURE_FAILED,
-                                 "Refund approved, but failed to sign 
confirmation");
-          return;
-        }
-
+        GNUNET_CRYPTO_eddsa_sign (&pc->mi->privkey.eddsa_priv,
+                                  &rr,
+                                  &msig.eddsa_sig);
         /* Pack refund for i-th coin.  */
         if (0 !=
             json_array_append_new (
diff --git a/src/backend/taler-merchant-httpd_proposal.c 
b/src/backend/taler-merchant-httpd_proposal.c
index 5e53143..0fc5eef 100644
--- a/src/backend/taler-merchant-httpd_proposal.c
+++ b/src/backend/taler-merchant-httpd_proposal.c
@@ -210,10 +210,9 @@ MH_handler_proposal_lookup (struct TMH_RequestHandler *rh,
                                          "Could not hash order");
     }
 
-    GNUNET_assert (GNUNET_OK ==
-                   GNUNET_CRYPTO_eddsa_sign (&mi->privkey.eddsa_priv,
-                                             &pdps.purpose,
-                                             &merchant_sig));
+    GNUNET_CRYPTO_eddsa_sign (&mi->privkey.eddsa_priv,
+                              &pdps,
+                              &merchant_sig);
   }
   return TALER_MHD_reply_json_pack (connection,
                                     MHD_HTTP_OK,
diff --git a/src/backend/taler-merchant-httpd_refund.c 
b/src/backend/taler-merchant-httpd_refund.c
index 88e8303..79cb954 100644
--- a/src/backend/taler-merchant-httpd_refund.c
+++ b/src/backend/taler-merchant-httpd_refund.c
@@ -102,16 +102,9 @@ process_refunds_cb (void *cls,
                        refund_amount);
     TALER_amount_hton (&rr.refund_fee,
                        refund_fee);
-    if (GNUNET_OK !=
-        GNUNET_CRYPTO_eddsa_sign (&prd->merchant->privkey.eddsa_priv,
-                                  &rr.purpose,
-                                  &sig))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Could not sign refund request\n");
-      prd->ec = TALER_EC_INTERNAL_LOGIC_ERROR;
-      return;
-    }
+    GNUNET_CRYPTO_eddsa_sign (&prd->merchant->privkey.eddsa_priv,
+                              &rr,
+                              &sig);
   }
 
   element = json_pack ("{s:o, s:o, s:o, s:I, s:o}",
diff --git a/src/backend/taler-merchant-httpd_tip-pickup.c 
b/src/backend/taler-merchant-httpd_tip-pickup.c
index c95ca08..7e75bbb 100644
--- a/src/backend/taler-merchant-httpd_tip-pickup.c
+++ b/src/backend/taler-merchant-httpd_tip-pickup.c
@@ -241,10 +241,9 @@ run_pickup (struct MHD_Connection *connection,
     struct TALER_ReserveSignatureP reserve_sig;
 
     pd->wr.reserve_pub = reserve_pub;
-    GNUNET_assert (GNUNET_OK ==
-                   GNUNET_CRYPTO_eddsa_sign (&reserve_priv.eddsa_priv,
-                                             &pd->wr.purpose,
-                                             &reserve_sig.eddsa_signature));
+    GNUNET_CRYPTO_eddsa_sign (&reserve_priv.eddsa_priv,
+                              &pd->wr,
+                              &reserve_sig.eddsa_signature);
     if (0 !=
         json_array_append_new (sigs,
                                json_pack ("{s:o}",
diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c
index 0db4631..fb9dbb4 100644
--- a/src/lib/merchant_api_pay.c
+++ b/src/lib/merchant_api_pay.c
@@ -199,7 +199,7 @@ check_abort_refund (struct TALER_MERCHANT_Pay *ph,
                            &ph->coins[found].refund_fee);
         if (GNUNET_OK !=
             GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
-                                        &rr.purpose,
+                                        &rr,
                                         &sig->eddsa_sig,
                                         &merchant_pub.eddsa_pub))
         {
@@ -844,10 +844,9 @@ prepare_pay_generic (struct GNUNET_CURL_Context *ctx,
                        TALER_amount2s (&fee));
     }
 
-    GNUNET_assert (GNUNET_OK ==
-                   GNUNET_CRYPTO_eddsa_sign (&coin->coin_priv.eddsa_priv,
-                                             &dr.purpose,
-                                             &p->coin_sig.eddsa_signature));
+    GNUNET_CRYPTO_eddsa_sign (&coin->coin_priv.eddsa_priv,
+                              &dr,
+                              &p->coin_sig.eddsa_signature);
     p->denom_pub = coin->denom_pub;
     p->denom_sig = coin->denom_sig;
     p->denom_value = coin->denom_value;
diff --git a/src/lib/testing_api_cmd_pay.c b/src/lib/testing_api_cmd_pay.c
index 7cd0f6c..1855d37 100644
--- a/src/lib/testing_api_cmd_pay.c
+++ b/src/lib/testing_api_cmd_pay.c
@@ -316,7 +316,7 @@ pay_cb (void *cls,
       TALER_TESTING_FAIL (ps->is);
     if (GNUNET_OK !=
         GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_PAYMENT_OK,
-                                    &mr.purpose,
+                                    &mr,
                                     &sig,
                                     &merchant_pub->eddsa_pub))
     {
@@ -741,7 +741,7 @@ pay_again_cb (void *cls,
 
     if (GNUNET_OK !=
         GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_PAYMENT_OK,
-                                    &mr.purpose,
+                                    &mr,
                                     &sig,
                                     &merchant_pub->eddsa_pub))
     {

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



reply via email to

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