gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated: handle TALER_EXCHAN


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: handle TALER_EXCHANGEDB_TT_PAYBACK in response generation of exchange
Date: Mon, 03 Apr 2017 13:51:55 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 94e9ba8  handle  TALER_EXCHANGEDB_TT_PAYBACK in response generation of 
exchange
94e9ba8 is described below

commit 94e9ba87101e09138d9cf083d630bf37935b3ea3
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Apr 3 13:55:02 2017 +0200

    handle  TALER_EXCHANGEDB_TT_PAYBACK in response generation of exchange
---
 src/exchange/taler-exchange-httpd_responses.c | 31 ++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/exchange/taler-exchange-httpd_responses.c 
b/src/exchange/taler-exchange-httpd_responses.c
index 96587c4..01dcb6c 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2014, 2015, 2016 Inria & GNUnet e.V.
+  Copyright (C) 2014, 2015, 2016, 2017 Inria & GNUnet e.V.
 
   TALER is free software; you can redistribute it and/or modify it under the
   terms of the GNU Affero General Public License as published by the Free 
Software
@@ -551,6 +551,35 @@ compile_transaction_history (const struct 
TALER_EXCHANGEDB_TransactionList *tl)
         details = GNUNET_JSON_from_data_auto (&rr);
       }
       break;
+    case TALER_EXCHANGEDB_TT_PAYBACK:
+      {
+        const struct TALER_EXCHANGEDB_Payback *payback = pos->details.payback;
+        struct TALER_PaybackRequestPS pr;
+
+        type = "PAYBACK";
+        value = payback->value;
+        pr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_PAYBACK);
+        pr.purpose.size = htonl (sizeof (pr));
+        pr.coin_pub = payback->coin_pub;
+        GNUNET_CRYPTO_rsa_public_key_hash (payback->denom_pub.rsa_public_key,
+                                           &pr.h_denom_pub);
+        pr.coin_blind = payback->coin_blind;
+
+       /* internal sanity check before we hand out a bogus sig... */
+        sig = &payback->coin_sig.eddsa_signature;
+        if (GNUNET_OK !=
+            GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_PAYBACK,
+                                        &pr.purpose,
+                                        sig,
+                                        &payback->coin_pub.eddsa_pub))
+       {
+         GNUNET_break (0);
+         json_decref (history);
+         return NULL;
+       }
+        details = GNUNET_JSON_from_data_auto (&pr);
+      }
+      break;
     default:
       GNUNET_assert (0);
     }

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



reply via email to

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