make code build against revised GNUnet blind signing API

This commit is contained in:
Christian Grothoff 2016-06-09 14:52:00 +02:00
parent 3b9248e9c6
commit c179734ccf
4 changed files with 50 additions and 20 deletions

View File

@ -851,10 +851,18 @@ TALER_EXCHANGE_refresh_prepare (const struct TALER_CoinSpendPrivateKeyP *melt_pr
GNUNET_CRYPTO_hash (&coin_pub.eddsa_pub,
sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
&coin_hash);
coin_ev_size = GNUNET_CRYPTO_rsa_blind (&coin_hash,
&fc->blinding_key.bks,
md.fresh_pks[j].rsa_public_key,
&coin_ev);
if (GNUNET_YES !=
GNUNET_CRYPTO_rsa_blind (&coin_hash,
&fc->blinding_key.bks,
md.fresh_pks[j].rsa_public_key,
&coin_ev,
&coin_ev_size))
{
GNUNET_break_op (0);
GNUNET_CRYPTO_hash_context_abort (hash_context);
free_melt_data (&md);
return NULL;
}
GNUNET_CRYPTO_hash_context_read (hash_context,
coin_ev,
coin_ev_size);
@ -1378,10 +1386,24 @@ TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
GNUNET_CRYPTO_hash (&coin_pub.eddsa_pub,
sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
&coin_hash);
coin_ev_size = GNUNET_CRYPTO_rsa_blind (&coin_hash,
&fc->blinding_key.bks,
md->fresh_pks[i].rsa_public_key,
&coin_ev);
if (GNUNET_YES !=
GNUNET_CRYPTO_rsa_blind (&coin_hash,
&fc->blinding_key.bks,
md->fresh_pks[i].rsa_public_key,
&coin_ev,
&coin_ev_size))
{
/* This should have been noticed during the preparation stage. */
GNUNET_break (0);
json_decref (new_denoms);
json_decref (tmp);
json_decref (coin_evs);
json_decref (melt_coin);
json_decref (transfer_pubs);
json_decref (secret_encs);
json_decref (link_encs);
return NULL;
}
json_array_append (tmp,
GNUNET_JSON_from_data (coin_ev,
coin_ev_size));

View File

@ -784,7 +784,7 @@ handle_reserve_withdraw_finished (void *cls,
* caller must have committed this value to disk before the call (with @a pk)
* @param res_cb the callback to call when the final result for this request is available
* @param res_cb_cls closure for the above callback
* @return #GNUNET_OK on success, #GNUNET_SYSERR
* @return handle for the operation on success, NULL on error, i.e.
* if the inputs are invalid (i.e. denomination key not with this exchange).
* In this case, the callback is not called.
*/
@ -819,10 +819,17 @@ TALER_EXCHANGE_reserve_withdraw (struct TALER_EXCHANGE_Handle *exchange,
GNUNET_CRYPTO_hash (&coin_pub.eddsa_pub,
sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
&wsh->c_hash);
coin_ev_size = GNUNET_CRYPTO_rsa_blind (&wsh->c_hash,
&blinding_key->bks,
pk->key.rsa_public_key,
&coin_ev);
if (GNUNET_YES !=
GNUNET_CRYPTO_rsa_blind (&wsh->c_hash,
&blinding_key->bks,
pk->key.rsa_public_key,
&coin_ev,
&coin_ev_size))
{
GNUNET_break_op (0);
GNUNET_free (wsh);
return NULL;
}
GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv,
&wsh->reserve_pub.eddsa_pub);
req.purpose.size = htonl (sizeof (struct TALER_WithdrawRequestPS));

View File

@ -74,7 +74,7 @@ test_taler_exchange_aggregator_postgres_SOURCES = \
test_taler_exchange_aggregator_postgres_LDADD = \
$(LIBGCRYPT_LIBS) \
$(top_builddir)/src/exchangedb/libtalerexchangedb.la \
$(top_builddir)/src/bank-lib/libfakebank.la \
$(top_builddir)/src/bank-lib/libtalerfakebank.la \
$(top_builddir)/src/json/libtalerjson.la \
$(top_builddir)/src/util/libtalerutil.la \
-lmicrohttpd \

View File

@ -1262,14 +1262,15 @@ check_commitment (struct MHD_Connection *connection,
GNUNET_CRYPTO_hash (&coin_pub,
sizeof (struct TALER_CoinSpendPublicKeyP),
&h_msg);
if (0 == (buf_len =
GNUNET_CRYPTO_rsa_blind (&h_msg,
&link_data.blinding_key.bks,
denom_pubs[j].rsa_public_key,
&buf)))
if (GNUNET_YES !=
GNUNET_CRYPTO_rsa_blind (&h_msg,
&link_data.blinding_key.bks,
denom_pubs[j].rsa_public_key,
&buf,
&buf_len))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"blind failed\n");
"Blind failed (bad denomination key!?)\n");
GNUNET_free (commit_coins);
return (MHD_YES == TMH_RESPONSE_reply_internal_error (connection,
"Blinding error"))