-fix recoup testing cmds
This commit is contained in:
parent
62d8368b1b
commit
5ff3189075
@ -178,6 +178,7 @@ run (void *cls,
|
|||||||
"sent response\n");
|
"sent response\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#if FIXME_FLORIAN
|
||||||
if (0 == strcmp ("setup_refresh_planchet", op))
|
if (0 == strcmp ("setup_refresh_planchet", op))
|
||||||
{
|
{
|
||||||
struct TALER_TransferSecretP transfer_secret;
|
struct TALER_TransferSecretP transfer_secret;
|
||||||
@ -222,6 +223,7 @@ run (void *cls,
|
|||||||
"sent response\n");
|
"sent response\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"unsupported operation '%s'\n",
|
"unsupported operation '%s'\n",
|
||||||
op);
|
op);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of TALER
|
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
|
TALER is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as
|
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) \
|
#define TALER_TESTING_INDEXED_TRAITS(op) \
|
||||||
op (denom_pub, const struct TALER_EXCHANGE_DenomPublicKey) \
|
op (denom_pub, const struct TALER_EXCHANGE_DenomPublicKey) \
|
||||||
op (denom_sig, const struct TALER_DenominationSignature) \
|
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_priv, const struct TALER_CoinSpendPrivateKeyP) \
|
||||||
op (coin_pub, const struct TALER_CoinSpendPublicKeyP) \
|
op (coin_pub, const struct TALER_CoinSpendPublicKeyP) \
|
||||||
op (absolute_time, const struct GNUNET_TIME_Absolute) \
|
op (absolute_time, const struct GNUNET_TIME_Absolute) \
|
||||||
|
@ -203,13 +203,15 @@ insert_deposit_run (void *cls,
|
|||||||
struct TALER_BlindedDenominationSignature bds;
|
struct TALER_BlindedDenominationSignature bds;
|
||||||
struct TALER_PlanchetSecretsP ps;
|
struct TALER_PlanchetSecretsP ps;
|
||||||
struct TALER_ExchangeWithdrawValues alg_values;
|
struct TALER_ExchangeWithdrawValues alg_values;
|
||||||
|
union TALER_DenominationBlindingKeyP bks;
|
||||||
|
|
||||||
alg_values.cipher = TALER_DENOMINATION_RSA;
|
alg_values.cipher = TALER_DENOMINATION_RSA;
|
||||||
TALER_planchet_blinding_secret_create (&ps,
|
TALER_planchet_blinding_secret_create (&ps,
|
||||||
&alg_values);
|
&alg_values,
|
||||||
|
&bks);
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_denom_blind (&dpk,
|
TALER_denom_blind (&dpk,
|
||||||
&ps.blinding_key,
|
&bks,
|
||||||
NULL, /* FIXME-Oec */
|
NULL, /* FIXME-Oec */
|
||||||
&deposit.coin.coin_pub,
|
&deposit.coin.coin_pub,
|
||||||
&alg_values,
|
&alg_values,
|
||||||
@ -223,7 +225,7 @@ insert_deposit_run (void *cls,
|
|||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_denom_sig_unblind (&deposit.coin.denom_sig,
|
TALER_denom_sig_unblind (&deposit.coin.denom_sig,
|
||||||
&bds,
|
&bds,
|
||||||
&ps.blinding_key,
|
&bks,
|
||||||
&dpk));
|
&dpk));
|
||||||
TALER_blinded_denom_sig_free (&bds);
|
TALER_blinded_denom_sig_free (&bds);
|
||||||
}
|
}
|
||||||
|
@ -237,12 +237,12 @@ recoup_run (void *cls,
|
|||||||
struct RecoupState *ps = cls;
|
struct RecoupState *ps = cls;
|
||||||
const struct TALER_TESTING_Command *coin_cmd;
|
const struct TALER_TESTING_Command *coin_cmd;
|
||||||
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
|
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
|
||||||
const union TALER_DenominationBlindingKeyP *blinding_key;
|
|
||||||
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
|
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
|
||||||
const struct TALER_DenominationSignature *coin_sig;
|
const struct TALER_DenominationSignature *coin_sig;
|
||||||
struct TALER_PlanchetSecretsP planchet;
|
const struct TALER_PlanchetSecretsP *planchet;
|
||||||
char *cref;
|
char *cref;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
|
const struct TALER_ExchangeWithdrawValues *ewv;
|
||||||
|
|
||||||
ps->is = is;
|
ps->is = is;
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -264,7 +264,6 @@ recoup_run (void *cls,
|
|||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_TESTING_get_trait_coin_priv (coin_cmd,
|
TALER_TESTING_get_trait_coin_priv (coin_cmd,
|
||||||
idx,
|
idx,
|
||||||
@ -274,18 +273,24 @@ recoup_run (void *cls,
|
|||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_TESTING_get_trait_blinding_key (coin_cmd,
|
TALER_TESTING_get_trait_exchange_wd_value (coin_cmd,
|
||||||
idx,
|
idx,
|
||||||
&blinding_key))
|
&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);
|
GNUNET_break (0);
|
||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
planchet.coin_priv = *coin_priv;
|
|
||||||
planchet.blinding_key = *blinding_key;
|
|
||||||
GNUNET_CRYPTO_eddsa_key_get_public (
|
GNUNET_CRYPTO_eddsa_key_get_public (
|
||||||
&coin_priv->eddsa_priv,
|
&coin_priv->eddsa_priv,
|
||||||
&ps->reserve_history.details.recoup_details.coin_pub.eddsa_pub);
|
&ps->reserve_history.details.recoup_details.coin_pub.eddsa_pub);
|
||||||
@ -299,7 +304,6 @@ recoup_run (void *cls,
|
|||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_TESTING_get_trait_denom_sig (coin_cmd,
|
TALER_TESTING_get_trait_denom_sig (coin_cmd,
|
||||||
idx,
|
idx,
|
||||||
@ -309,15 +313,14 @@ recoup_run (void *cls,
|
|||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Trying to recoup denomination '%s'\n",
|
"Trying to recoup denomination '%s'\n",
|
||||||
TALER_B2S (&denom_pub->h_key));
|
TALER_B2S (&denom_pub->h_key));
|
||||||
|
|
||||||
ps->ph = TALER_EXCHANGE_recoup (is->exchange,
|
ps->ph = TALER_EXCHANGE_recoup (is->exchange,
|
||||||
denom_pub,
|
denom_pub,
|
||||||
coin_sig,
|
coin_sig,
|
||||||
&planchet,
|
ewv,
|
||||||
|
planchet,
|
||||||
&recoup_cb,
|
&recoup_cb,
|
||||||
ps);
|
ps);
|
||||||
GNUNET_assert (NULL != ps->ph);
|
GNUNET_assert (NULL != ps->ph);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of TALER
|
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
|
TALER is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as
|
it under the terms of the GNU General Public License as
|
||||||
@ -231,10 +231,10 @@ recoup_refresh_run (void *cls,
|
|||||||
struct RecoupRefreshState *ps = cls;
|
struct RecoupRefreshState *ps = cls;
|
||||||
const struct TALER_TESTING_Command *coin_cmd;
|
const struct TALER_TESTING_Command *coin_cmd;
|
||||||
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
|
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
|
||||||
const union TALER_DenominationBlindingKeyP *blinding_key;
|
|
||||||
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
|
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
|
||||||
const struct TALER_DenominationSignature *coin_sig;
|
const struct TALER_DenominationSignature *coin_sig;
|
||||||
struct TALER_PlanchetSecretsP planchet;
|
const struct TALER_PlanchetSecretsP *planchet;
|
||||||
|
const struct TALER_ExchangeWithdrawValues *ewv;
|
||||||
char *cref;
|
char *cref;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
|
|
||||||
@ -258,7 +258,6 @@ recoup_refresh_run (void *cls,
|
|||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_TESTING_get_trait_coin_priv (coin_cmd,
|
TALER_TESTING_get_trait_coin_priv (coin_cmd,
|
||||||
idx,
|
idx,
|
||||||
@ -268,18 +267,24 @@ recoup_refresh_run (void *cls,
|
|||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_TESTING_get_trait_blinding_key (coin_cmd,
|
TALER_TESTING_get_trait_exchange_wd_value (coin_cmd,
|
||||||
idx,
|
idx,
|
||||||
&blinding_key))
|
&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);
|
GNUNET_break (0);
|
||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
planchet.coin_priv = *coin_priv;
|
|
||||||
planchet.blinding_key = *blinding_key;
|
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_TESTING_get_trait_denom_pub (coin_cmd,
|
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,
|
ps->ph = TALER_EXCHANGE_recoup_refresh (is->exchange,
|
||||||
denom_pub,
|
denom_pub,
|
||||||
coin_sig,
|
coin_sig,
|
||||||
&planchet,
|
ewv,
|
||||||
recoup_refresh_cb,
|
planchet,
|
||||||
|
&recoup_refresh_cb,
|
||||||
ps);
|
ps);
|
||||||
GNUNET_assert (NULL != ps->ph);
|
GNUNET_assert (NULL != ps->ph);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user