summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_recoup.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-09 22:02:29 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-09 22:02:29 +0100
commit025922950dcf39700625e04be9f6037af67dddf5 (patch)
tree89b14956f470210e716b46dde8615221e51d1d72 /src/exchange/taler-exchange-httpd_recoup.c
parente6598cfa1a81f6b040718933496436987d21194b (diff)
downloadexchange-025922950dcf39700625e04be9f6037af67dddf5.tar.gz
exchange-025922950dcf39700625e04be9f6037af67dddf5.tar.bz2
exchange-025922950dcf39700625e04be9f6037af67dddf5.zip
pass exchange values to /recoup
Diffstat (limited to 'src/exchange/taler-exchange-httpd_recoup.c')
-rw-r--r--src/exchange/taler-exchange-httpd_recoup.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_recoup.c b/src/exchange/taler-exchange-httpd_recoup.c
index 416eaf69d..d4ff52376 100644
--- a/src/exchange/taler-exchange-httpd_recoup.c
+++ b/src/exchange/taler-exchange-httpd_recoup.c
@@ -165,6 +165,8 @@ recoup_transaction (void *cls,
*
* @param connection the MHD connection to handle
* @param coin information about the coin
+ * @param exchange_vals values contributed by the exchange
+ * during withdrawal
* @param coin_bks blinding data of the coin (to be checked)
* @param coin_sig signature of the coin
* @return MHD result code
@@ -173,6 +175,7 @@ static MHD_RESULT
verify_and_execute_recoup (
struct MHD_Connection *connection,
const struct TALER_CoinPublicInfo *coin,
+ const struct TALER_ExchangeWithdrawValues *exchange_vals,
const union TALER_DenominationBlindingKeyP *coin_bks,
const struct TALER_CoinSpendSignatureP *coin_sig)
{
@@ -242,6 +245,9 @@ verify_and_execute_recoup (
NULL);
}
+ /* re-compute client-side blinding so we can
+ (a bit later) check that this coin was indeed
+ signed by us. */
{
struct TALER_CoinPubHash c_hash;
struct TALER_BlindedPlanchet blinded_planchet;
@@ -251,7 +257,7 @@ verify_and_execute_recoup (
coin_bks,
NULL, /* FIXME-Oec: TALER_AgeHash * */
&coin->coin_pub,
- NULL, /* FIXME: handle CS */
+ exchange_vals,
&c_hash,
&blinded_planchet))
{
@@ -262,9 +268,10 @@ verify_and_execute_recoup (
TALER_EC_EXCHANGE_RECOUP_BLINDING_FAILED,
NULL);
}
- if (GNUNET_OK != TALER_coin_ev_hash (&blinded_planchet,
- &coin->denom_pub_hash,
- &pc.h_blind))
+ if (GNUNET_OK !=
+ TALER_coin_ev_hash (&blinded_planchet,
+ &coin->denom_pub_hash,
+ &pc.h_blind))
{
GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
@@ -365,11 +372,14 @@ TEH_handler_recoup (struct MHD_Connection *connection,
struct TALER_CoinPublicInfo coin;
union TALER_DenominationBlindingKeyP coin_bks;
struct TALER_CoinSpendSignatureP coin_sig;
+ struct TALER_ExchangeWithdrawValues exchange_vals;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("denom_pub_hash",
&coin.denom_pub_hash),
TALER_JSON_spec_denom_sig ("denom_sig",
&coin.denom_sig),
+ TALER_JSON_spec_exchange_withdraw_values ("ewv",
+ &exchange_vals),
GNUNET_JSON_spec_fixed_auto ("coin_blind_key_secret",
&coin_bks),
GNUNET_JSON_spec_fixed_auto ("coin_sig",
@@ -393,6 +403,7 @@ TEH_handler_recoup (struct MHD_Connection *connection,
res = verify_and_execute_recoup (connection,
&coin,
+ &exchange_vals,
&coin_bks,
&coin_sig);
GNUNET_JSON_parse_free (spec);