-fix recoup testing cmds

This commit is contained in:
Christian Grothoff 2022-02-06 20:04:36 +01:00
parent 62d8368b1b
commit 5ff3189075
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
5 changed files with 44 additions and 29 deletions

View File

@ -178,6 +178,7 @@ run (void *cls,
"sent response\n");
continue;
}
#if FIXME_FLORIAN
if (0 == strcmp ("setup_refresh_planchet", op))
{
struct TALER_TransferSecretP transfer_secret;
@ -222,6 +223,7 @@ run (void *cls,
"sent response\n");
continue;
}
#endif
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"unsupported operation '%s'\n",
op);

View File

@ -1,6 +1,6 @@
/*
This file is part of TALER
(C) 2018 Taler Systems SA
(C) 2018-2022 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@ -2482,6 +2482,8 @@ TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits,
#define TALER_TESTING_INDEXED_TRAITS(op) \
op (denom_pub, const struct TALER_EXCHANGE_DenomPublicKey) \
op (denom_sig, const struct TALER_DenominationSignature) \
op (planchet_secret, const struct TALER_PlanchetSecretsP) \
op (exchange_wd_value, const struct TALER_ExchangeWithdrawValues) \
op (coin_priv, const struct TALER_CoinSpendPrivateKeyP) \
op (coin_pub, const struct TALER_CoinSpendPublicKeyP) \
op (absolute_time, const struct GNUNET_TIME_Absolute) \

View File

@ -203,13 +203,15 @@ insert_deposit_run (void *cls,
struct TALER_BlindedDenominationSignature bds;
struct TALER_PlanchetSecretsP ps;
struct TALER_ExchangeWithdrawValues alg_values;
union TALER_DenominationBlindingKeyP bks;
alg_values.cipher = TALER_DENOMINATION_RSA;
TALER_planchet_blinding_secret_create (&ps,
&alg_values);
&alg_values,
&bks);
GNUNET_assert (GNUNET_OK ==
TALER_denom_blind (&dpk,
&ps.blinding_key,
&bks,
NULL, /* FIXME-Oec */
&deposit.coin.coin_pub,
&alg_values,
@ -223,7 +225,7 @@ insert_deposit_run (void *cls,
GNUNET_assert (GNUNET_OK ==
TALER_denom_sig_unblind (&deposit.coin.denom_sig,
&bds,
&ps.blinding_key,
&bks,
&dpk));
TALER_blinded_denom_sig_free (&bds);
}

View File

@ -237,12 +237,12 @@ recoup_run (void *cls,
struct RecoupState *ps = cls;
const struct TALER_TESTING_Command *coin_cmd;
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
const union TALER_DenominationBlindingKeyP *blinding_key;
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
const struct TALER_DenominationSignature *coin_sig;
struct TALER_PlanchetSecretsP planchet;
const struct TALER_PlanchetSecretsP *planchet;
char *cref;
unsigned int idx;
const struct TALER_ExchangeWithdrawValues *ewv;
ps->is = is;
if (GNUNET_OK !=
@ -264,7 +264,6 @@ recoup_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
if (GNUNET_OK !=
TALER_TESTING_get_trait_coin_priv (coin_cmd,
idx,
@ -274,18 +273,24 @@ recoup_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
if (GNUNET_OK !=
TALER_TESTING_get_trait_blinding_key (coin_cmd,
idx,
&blinding_key))
TALER_TESTING_get_trait_exchange_wd_value (coin_cmd,
idx,
&ewv))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
return;
}
if (GNUNET_OK !=
TALER_TESTING_get_trait_planchet_secret (coin_cmd,
idx,
&planchet))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
return;
}
planchet.coin_priv = *coin_priv;
planchet.blinding_key = *blinding_key;
GNUNET_CRYPTO_eddsa_key_get_public (
&coin_priv->eddsa_priv,
&ps->reserve_history.details.recoup_details.coin_pub.eddsa_pub);
@ -299,7 +304,6 @@ recoup_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
if (GNUNET_OK !=
TALER_TESTING_get_trait_denom_sig (coin_cmd,
idx,
@ -309,15 +313,14 @@ recoup_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Trying to recoup denomination '%s'\n",
TALER_B2S (&denom_pub->h_key));
ps->ph = TALER_EXCHANGE_recoup (is->exchange,
denom_pub,
coin_sig,
&planchet,
ewv,
planchet,
&recoup_cb,
ps);
GNUNET_assert (NULL != ps->ph);

View File

@ -1,6 +1,6 @@
/*
This file is part of TALER
Copyright (C) 2014-2018 Taler Systems SA
Copyright (C) 2014-2022 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@ -231,10 +231,10 @@ recoup_refresh_run (void *cls,
struct RecoupRefreshState *ps = cls;
const struct TALER_TESTING_Command *coin_cmd;
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
const union TALER_DenominationBlindingKeyP *blinding_key;
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
const struct TALER_DenominationSignature *coin_sig;
struct TALER_PlanchetSecretsP planchet;
const struct TALER_PlanchetSecretsP *planchet;
const struct TALER_ExchangeWithdrawValues *ewv;
char *cref;
unsigned int idx;
@ -258,7 +258,6 @@ recoup_refresh_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
if (GNUNET_OK !=
TALER_TESTING_get_trait_coin_priv (coin_cmd,
idx,
@ -268,18 +267,24 @@ recoup_refresh_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
if (GNUNET_OK !=
TALER_TESTING_get_trait_blinding_key (coin_cmd,
idx,
&blinding_key))
TALER_TESTING_get_trait_exchange_wd_value (coin_cmd,
idx,
&ewv))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
return;
}
if (GNUNET_OK !=
TALER_TESTING_get_trait_planchet_secret (coin_cmd,
idx,
&planchet))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
return;
}
planchet.coin_priv = *coin_priv;
planchet.blinding_key = *blinding_key;
if (GNUNET_OK !=
TALER_TESTING_get_trait_denom_pub (coin_cmd,
@ -308,8 +313,9 @@ recoup_refresh_run (void *cls,
ps->ph = TALER_EXCHANGE_recoup_refresh (is->exchange,
denom_pub,
coin_sig,
&planchet,
recoup_refresh_cb,
ewv,
planchet,
&recoup_refresh_cb,
ps);
GNUNET_assert (NULL != ps->ph);
}