aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_withdraw2.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-12 00:52:19 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-12 00:52:19 +0100
commit94a5359494bcc24916c9f7f8323ace4643bc0065 (patch)
tree2d012532facb3d805487ad5bd9c07ebde2e1deb6 /src/lib/exchange_api_withdraw2.c
parent3b1e742dde4c386b38fc77147127b4bf6119d9e5 (diff)
downloadexchange-94a5359494bcc24916c9f7f8323ace4643bc0065.tar.xz
-address misc. fixmes
Diffstat (limited to 'src/lib/exchange_api_withdraw2.c')
-rw-r--r--src/lib/exchange_api_withdraw2.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/lib/exchange_api_withdraw2.c b/src/lib/exchange_api_withdraw2.c
index d354946e1..c0643b9af 100644
--- a/src/lib/exchange_api_withdraw2.c
+++ b/src/lib/exchange_api_withdraw2.c
@@ -380,6 +380,7 @@ TALER_EXCHANGE_withdraw2 (
const struct TALER_EXCHANGE_DenomPublicKey *dk;
struct TALER_ReserveSignatureP reserve_sig;
char arg_str[sizeof (struct TALER_ReservePublicKeyP) * 2 + 32];
+ struct TALER_BlindedCoinHash bch;
keys = TALER_EXCHANGE_get_keys (exchange);
if (NULL == keys)
@@ -428,31 +429,22 @@ TALER_EXCHANGE_withdraw2 (
"/reserves/%s/withdraw",
pub_str);
}
- // FIXME: move this to libtalerutil!
+
+ if (GNUNET_OK !=
+ TALER_coin_ev_hash (&pd->blinded_planchet,
+ &pd->denom_pub_hash,
+ &bch))
{
- struct TALER_WithdrawRequestPS req = {
- .purpose.size = htonl (sizeof (req)),
- .purpose.purpose = htonl (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW),
- .reserve_pub = wh->reserve_pub,
- .h_denomination_pub = pd->denom_pub_hash
- };
-
- TALER_amount_hton (&req.amount_with_fee,
- &wh->requested_amount);
- if (GNUNET_OK !=
- TALER_coin_ev_hash (&pd->blinded_planchet,
- &pd->denom_pub_hash,
- &req.h_coin_envelope))
- {
- GNUNET_break (0);
- GNUNET_free (wh);
- return NULL;
- }
- GNUNET_CRYPTO_eddsa_sign (&reserve_priv->eddsa_priv,
- &req,
- &reserve_sig.eddsa_signature);
+ GNUNET_break (0);
+ GNUNET_free (wh);
+ return NULL;
}
+ TALER_wallet_withdraw_sign (&pd->denom_pub_hash,
+ &wh->requested_amount,
+ &bch,
+ reserve_priv,
+ &reserve_sig);
{
json_t *withdraw_obj = GNUNET_JSON_PACK (
GNUNET_JSON_pack_data_auto ("denom_pub_hash",