diff options
Diffstat (limited to 'src/lib/exchange_api_refresh_common.c')
-rw-r--r-- | src/lib/exchange_api_refresh_common.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/lib/exchange_api_refresh_common.c b/src/lib/exchange_api_refresh_common.c index 0a6665b55..57011a6b4 100644 --- a/src/lib/exchange_api_refresh_common.c +++ b/src/lib/exchange_api_refresh_common.c @@ -68,7 +68,7 @@ TALER_EXCHANGE_get_melt_data_ ( { struct TALER_Amount total; struct TALER_CoinSpendPublicKeyP coin_pub; - struct TALER_CsNonce nonces[rd->fresh_pks_len]; + union GNUNET_CRYPTO_BlindSessionNonce nonces[rd->fresh_pks_len]; bool uses_cs = false; GNUNET_CRYPTO_eddsa_key_get_public (&rd->melt_priv.eddsa_priv, @@ -99,19 +99,27 @@ TALER_EXCHANGE_get_melt_data_ ( { struct FreshCoinData *fcd = &md->fcds[j]; - if (alg_values[j].cipher != rd->fresh_pks[j].key.cipher) + switch (fcd->fresh_pk.bsign_pub_key->cipher) { + case GNUNET_CRYPTO_BSA_INVALID: GNUNET_break (0); TALER_EXCHANGE_free_melt_data_ (md); return GNUNET_SYSERR; - } - if (TALER_DENOMINATION_CS == alg_values[j].cipher) - { + case GNUNET_CRYPTO_BSA_RSA: + break; + case GNUNET_CRYPTO_BSA_CS: + if (alg_values[j].blinding_inputs->cipher != + fcd->fresh_pk.bsign_pub_key->cipher) + { + GNUNET_break (0); + TALER_EXCHANGE_free_melt_data_ (md); + return GNUNET_SYSERR; + } uses_cs = true; - TALER_cs_refresh_nonce_derive ( - rms, - j, - &nonces[j]); + TALER_cs_refresh_nonce_derive (rms, + j, + &nonces[j].cs_nonce); + break; } TALER_denom_pub_deep_copy (&fcd->fresh_pk, &rd->fresh_pks[j].key); @@ -170,7 +178,7 @@ TALER_EXCHANGE_get_melt_data_ ( struct TALER_CoinSpendPrivateKeyP *coin_priv = &fcd->coin_priv; struct TALER_PlanchetMasterSecretP *ps = &fcd->ps[i]; struct TALER_RefreshCoinData *rcd = &md->rcd[i][j]; - union TALER_DenominationBlindingKeyP *bks = &fcd->bks[i]; + union GNUNET_CRYPTO_BlindingSecretP *bks = &fcd->bks[i]; struct TALER_PlanchetDetail pd; struct TALER_CoinPubHashP c_hash; struct TALER_AgeCommitmentHash ach; @@ -205,13 +213,11 @@ TALER_EXCHANGE_get_melt_data_ ( pah = &ach; } - if (TALER_DENOMINATION_CS == alg_values[j].cipher) - pd.blinded_planchet.details.cs_blinded_planchet.nonce = nonces[j]; - if (GNUNET_OK != TALER_planchet_prepare (&fcd->fresh_pk, &alg_values[j], bks, + &nonces[j], coin_priv, pah, &c_hash, |