exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 5bce2b2abe7522152a76744aacc79c662b67dfeb
parent f87b0374aa3c89ef11c53b8d61fc317aa728d0af
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 21 Dec 2025 20:58:38 +0100

fix #9925

Diffstat:
Msrc/testing/testing_api_cmd_batch_deposit.c | 11++++++-----
Msrc/testing/testing_api_cmd_deposit.c | 11++++++-----
Msrc/testing/testing_api_cmd_refresh.c | 12+++++++++++-
Msrc/testing/testing_api_cmd_withdraw.c | 9+++++++++
4 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/src/testing/testing_api_cmd_batch_deposit.c b/src/testing/testing_api_cmd_batch_deposit.c @@ -548,7 +548,7 @@ batch_deposit_traits (void *cls, const struct Coin *coin = &ds->coins[index]; /* Will point to coin cmd internals. */ const struct TALER_CoinSpendPrivateKeyP *coin_spent_priv; - struct TALER_CoinSpendPublicKeyP coin_spent_pub; + const struct TALER_CoinSpendPublicKeyP *coin_spent_pub; const struct TALER_AgeCommitmentProof *age_commitment_proof; if (index >= ds->num_coins) @@ -570,6 +570,10 @@ batch_deposit_traits (void *cls, coin->coin_idx, &coin_spent_priv)) || (GNUNET_OK != + TALER_TESTING_get_trait_coin_pub (coin->coin_cmd, + coin->coin_idx, + &coin_spent_pub)) || + (GNUNET_OK != TALER_TESTING_get_trait_age_commitment_proof (coin->coin_cmd, coin->coin_idx, &age_commitment_proof)) ) @@ -579,9 +583,6 @@ batch_deposit_traits (void *cls, return GNUNET_NO; } - GNUNET_CRYPTO_eddsa_key_get_public (&coin_spent_priv->eddsa_priv, - &coin_spent_pub.eddsa_pub); - { struct TALER_TESTING_Trait traits[] = { /* First two traits are only available if @@ -602,7 +603,7 @@ batch_deposit_traits (void *cls, TALER_TESTING_make_trait_coin_history (index, &coin->che), TALER_TESTING_make_trait_coin_pub (index, - &coin_spent_pub), + coin_spent_pub), TALER_TESTING_make_trait_denom_pub (index, coin->denom_pub), TALER_TESTING_make_trait_coin_priv (index, diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c @@ -638,7 +638,7 @@ deposit_traits (void *cls, const struct TALER_TESTING_Command *coin_cmd; /* Will point to coin cmd internals. */ const struct TALER_CoinSpendPrivateKeyP *coin_spent_priv; - struct TALER_CoinSpendPublicKeyP coin_spent_pub; + const struct TALER_CoinSpendPublicKeyP *coin_spent_pub; const struct TALER_AgeCommitmentProof *age_commitment_proof=NULL; const struct TALER_AgeCommitmentHashP *h_age_commitment=NULL; @@ -663,6 +663,10 @@ deposit_traits (void *cls, ds->coin_index, &coin_spent_priv)) || (GNUNET_OK != + TALER_TESTING_get_trait_coin_pub (coin_cmd, + ds->coin_index, + &coin_spent_pub)) || + (GNUNET_OK != TALER_TESTING_get_trait_age_commitment_proof (coin_cmd, ds->coin_index, &age_commitment_proof)) || @@ -676,9 +680,6 @@ deposit_traits (void *cls, return GNUNET_NO; } - GNUNET_CRYPTO_eddsa_key_get_public (&coin_spent_priv->eddsa_priv, - &coin_spent_pub.eddsa_pub); - { struct TALER_TESTING_Trait traits[] = { /* First two traits are only available if @@ -693,7 +694,7 @@ deposit_traits (void *cls, TALER_TESTING_make_trait_coin_priv (0, coin_spent_priv), TALER_TESTING_make_trait_coin_pub (0, - &coin_spent_pub), + coin_spent_pub), TALER_TESTING_make_trait_denom_pub (0, ds->denom_pub), TALER_TESTING_make_trait_coin_sig (0, diff --git a/src/testing/testing_api_cmd_refresh.c b/src/testing/testing_api_cmd_refresh.c @@ -71,7 +71,12 @@ struct TALER_TESTING_FreshCoinData */ struct TALER_CoinSpendPrivateKeyP coin_priv; - /* + /** + * Set (by the interpreter) to the coin's public key. + */ + struct TALER_CoinSpendPublicKeyP coin_pub; + + /** * Fresh age commitment for the coin with proof and its hash, NULL if not * applicable. */ @@ -495,6 +500,8 @@ reveal_cb (void *cls, return; } fc->coin_priv = coin->coin_priv; + GNUNET_CRYPTO_eddsa_key_get_public (&fc->coin_priv.eddsa_priv, + &fc->coin_pub.eddsa_pub); if (NULL != coin->age_commitment_proof) { @@ -1203,6 +1210,9 @@ melt_reveal_traits (void *cls, TALER_TESTING_make_trait_coin_priv ( index, &rrs->fresh_coins[index].coin_priv), + TALER_TESTING_make_trait_coin_pub ( + index, + &rrs->fresh_coins[index].coin_pub), TALER_TESTING_make_trait_age_commitment_proof ( index, rrs->fresh_coins[index].age_commitment_proof), diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c @@ -118,6 +118,11 @@ struct WithdrawState struct TALER_CoinSpendPrivateKeyP coin_priv; /** + * Public key of the coin. + */ + struct TALER_CoinSpendPublicKeyP coin_pub; + + /** * Blinding key used during the operation. */ union GNUNET_CRYPTO_BlindingSecretP bks; @@ -313,6 +318,8 @@ withdraw_cb (void *cls, TALER_denom_sig_copy (&ws->sig, &wr->details.ok.coin_details[0].denom_sig); ws->coin_priv = wr->details.ok.coin_details[0].coin_priv; + GNUNET_CRYPTO_eddsa_key_get_public (&ws->coin_priv.eddsa_priv, + &ws->coin_pub.eddsa_pub); ws->bks = wr->details.ok.coin_details[0].blinding_key; TALER_denom_ewv_copy (&ws->exchange_vals, &wr->details.ok.coin_details[0].blinding_values); @@ -561,6 +568,8 @@ withdraw_traits (void *cls, &ws->reserve_history), TALER_TESTING_make_trait_coin_priv (0 /* only one coin */, &ws->coin_priv), + TALER_TESTING_make_trait_coin_pub (0 /* only one coin */, + &ws->coin_pub), TALER_TESTING_make_trait_withdraw_seed (&ws->seed), TALER_TESTING_make_trait_blinding_seed (&ws->blinding_seed), TALER_TESTING_make_trait_withdraw_commitment (&ws->planchets_h),