fixes to crypto.c changes

This commit is contained in:
Gian Demarmels 2022-02-05 20:22:55 +01:00
parent 41d132757b
commit e8740316a7
No known key found for this signature in database
GPG Key ID: 030CEDDCCC92D778
3 changed files with 27 additions and 13 deletions

View File

@ -180,7 +180,8 @@ check_commitment (struct RevealContext *rctx,
for (unsigned int j = 0; j<rctx->num_fresh_coins; j++)
{
struct TALER_RefreshCoinData *rcd = &rce->new_coins[j];
struct TALER_PlanchetSecretsP ps;
struct TALER_CoinSpendPrivateKeyP coin_priv;
union TALER_DenominationBlindingKeyP bks;
struct TALER_ExchangeWithdrawValues alg_values;
struct TALER_PlanchetDetail pd;
struct TALER_CoinPubHash c_hash;
@ -188,13 +189,15 @@ check_commitment (struct RevealContext *rctx,
rcd->dk = &rctx->dks[j]->denom_pub;
TALER_planchet_setup_refresh (&ts,
j,
&ps);
&coin_priv,
&bks);
// TODO: implement cipher handling
alg_values.cipher = TALER_DENOMINATION_RSA;
GNUNET_assert (GNUNET_OK ==
TALER_planchet_prepare (rcd->dk,
&alg_values,
&ps,
&bks,
&coin_priv,
&c_hash,
&pd));
rcd->coin_ev =

View File

@ -94,7 +94,7 @@ csr_ok (struct TALER_EXCHANGE_CsRHandle *csrh,
struct TALER_ExchangeWithdrawValues alg_values[GNUNET_NZL (alen)];
struct TALER_EXCHANGE_CsRResponse csrr = {
.hr = hr,
.details.success.alg_values_len = alen,
.details.success.arg_values_len = alen,
.details.success.alg_values = alg_values
};
@ -105,11 +105,11 @@ csr_ok (struct TALER_EXCHANGE_CsRHandle *csrh,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed (
"r_pub_0",
&alg_values[i].r_pub.r_pub[0],
&alg_values[i].details.cs_values.r_pub.r_pub[0],
sizeof (struct GNUNET_CRYPTO_CsRPublic)),
GNUNET_JSON_spec_fixed (
"r_pub_1",
&alg_values[i].r_pub.r_pub[1],
&alg_values[i].details.cs_values.r_pub.r_pub[1],
sizeof (struct GNUNET_CRYPTO_CsRPublic)),
GNUNET_JSON_spec_end ()
};

View File

@ -64,10 +64,20 @@ struct TALER_EXCHANGE_WithdrawHandle
const struct TALER_ReservePrivateKeyP *reserve_priv;
/**
* Secrets of the planchet.
* Seed of the planchet.
*/
struct TALER_PlanchetSecretsP ps;
/**
* blinding secret
*/
union DenominationBlindingKeyP bks;
/**
*
*/
struct TALER_CoinSpendPrivateKeyP priv;
/**
* Details of the planchet.
*/
@ -125,8 +135,8 @@ handle_reserve_withdraw_finished (
if (GNUNET_OK !=
TALER_planchet_to_coin (&wh->pk.key,
blind_sig,
&wh->ps,
&wh->c_hash,
&wh->
& wh->c_hash,
&wh->alg_values,
&fc))
{
@ -246,15 +256,16 @@ TALER_EXCHANGE_withdraw (
switch (pk->key.cipher)
{
case TALER_DENOMINATION_RSA:
struct TALER_CoinSpendPrivateKeyP priv;
alg_values.cipher = TALER_DENOMINATION_RSA;
wh->alg_values.cipher = TALER_DENOMINATION_RSA;
TALER_planchet_setup_coin_priv (ps, &wh->alg_values, &priv);
TALER_planchet_setup_coin_priv (ps, &wh->alg_values, &wh->priv);
TALER_planchet_blinding_secret_create (ps, &wh->alg_values, &wh->bks);
if (GNUNET_OK !=
TALER_planchet_prepare (&pk->key,
&wh->alg_values,
ps,
&bks,
&priv,
&wh->c_hash,
&wh->pd))
{