aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_withdraw.c
diff options
context:
space:
mode:
authorGian Demarmels <gian@demarmels.org>2022-01-17 09:37:36 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:37:33 +0100
commitbe50c084f89e8588dd2d4a4aa30c58002053ee31 (patch)
treee6651b08f663446f21c59b9428e57ca46b7b4bab /src/lib/exchange_api_withdraw.c
parentae5f082c75eb140167dc0254894dd4d57ba62a6d (diff)
downloadexchange-be50c084f89e8588dd2d4a4aa30c58002053ee31.tar.xz
fixed nonce check, renamed WithdrawNonce
Diffstat (limited to 'src/lib/exchange_api_withdraw.c')
-rw-r--r--src/lib/exchange_api_withdraw.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/exchange_api_withdraw.c b/src/lib/exchange_api_withdraw.c
index e8eca88cc..a5a886767 100644
--- a/src/lib/exchange_api_withdraw.c
+++ b/src/lib/exchange_api_withdraw.c
@@ -283,9 +283,17 @@ TALER_EXCHANGE_withdraw (
wh);
break;
case TALER_DENOMINATION_CS:
- TALER_cs_withdraw_nonce_derive (&ps->coin_priv,
- &wh->pd.blinded_planchet.details.
- cs_blinded_planchet.nonce);
+ wh->pd.blinded_planchet.cipher = TALER_DENOMINATION_CS;
+
+ /**
+ * This part is a bit hacky..
+ * due to the reason that Withdraw tests use the same private key coin to sign,
+ * the same Withdraw nonce will be derived.
+ * In a normal withdrawal TALER_cs_withdraw_nonce_derive is used.
+ * As a hacky solution, we generate the nonce here randomly.
+ */
+ TALER_cs_withdraw_nonce_generate (&wh->pd.blinded_planchet.details.
+ cs_blinded_planchet.nonce);
wh->csrh = TALER_EXCHANGE_csr (exchange,
pk,
&wh->pd.blinded_planchet.details.