diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-10 23:39:00 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-10 23:39:00 +0100 |
commit | 532d4ad0dca62055056e5b6093e82daa3541f690 (patch) | |
tree | 65e2d5b783d0a84b33779b8d0e89225d0e765353 /src/lib/exchange_api_link.c | |
parent | d58d89dcab91823dff208d230e1b1b3a742810bd (diff) | |
download | exchange-532d4ad0dca62055056e5b6093e82daa3541f690.tar.xz |
-fixes to tests, and half-baked fixes for CS-/link (still fails)
Diffstat (limited to 'src/lib/exchange_api_link.c')
-rw-r--r-- | src/lib/exchange_api_link.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/lib/exchange_api_link.c b/src/lib/exchange_api_link.c index cfa70617e..0b2a1336b 100644 --- a/src/lib/exchange_api_link.c +++ b/src/lib/exchange_api_link.c @@ -95,18 +95,25 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh, struct TALER_DenominationPublicKey rpub; struct TALER_CoinSpendSignatureP link_sig; union TALER_DenominationBlindingKeyP bks; + struct TALER_ExchangeWithdrawValues alg_values; + uint32_t coin_idx; struct GNUNET_JSON_Specification spec[] = { TALER_JSON_spec_denom_pub ("denom_pub", &rpub), TALER_JSON_spec_blinded_denom_sig ("ev_sig", &bsig), + // FIXME: add to spec! + TALER_JSON_spec_exchange_withdraw_values ("ewv", + &alg_values), GNUNET_JSON_spec_fixed_auto ("link_sig", &link_sig), + // FIXME: add to spec! + GNUNET_JSON_spec_uint32 ("coin_idx", + &coin_idx), GNUNET_JSON_spec_end () }; struct TALER_TransferSecretP secret; struct TALER_PlanchetSecretsP ps; - struct TALER_ExchangeWithdrawValues alg_values; struct TALER_PlanchetDetail pd; struct TALER_CoinPubHash c_hash; @@ -125,9 +132,6 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh, TALER_transfer_secret_to_planchet_secret (&secret, coin_num, &ps); - - // TODO: implement cipher handling - alg_values.cipher = TALER_DENOMINATION_RSA; TALER_planchet_setup_coin_priv (&ps, &alg_values, coin_priv); @@ -165,6 +169,20 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh, GNUNET_CRYPTO_eddsa_key_get_public (&lh->coin_priv.eddsa_priv, &old_coin_pub.eddsa_pub); + // FIXME-NEXT: this is probably the wrong 'ps'! + // However, the 'right' PS is not something the + // exchange could even give us. So probably we + // really need to change the derivation structure + // during refresh to derive the nonces differently + // and make /link possible! + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Link using PS(%u)=%s\n", + (unsigned int) coin_idx, + TALER_B2S (&ps)); + TALER_cs_refresh_nonce_derive ( + &ps, + coin_idx, + &pd.blinded_planchet.details.cs_blinded_planchet.nonce); TALER_coin_ev_hash (&pd.blinded_planchet, &pd.denom_pub_hash, &coin_envelope_hash); |