-fix more FTBFS
This commit is contained in:
parent
f7d08e8c2b
commit
f0951d34dd
@ -603,7 +603,7 @@ struct TALER_TrackTransferDetails
|
||||
/**
|
||||
* Hash of the proposal data.
|
||||
*/
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
struct TALER_PrivateContractHash h_contract_terms;
|
||||
|
||||
/**
|
||||
* Which coin was deposited?
|
||||
@ -728,6 +728,31 @@ TALER_test_coin_valid (const struct TALER_CoinPublicInfo *coin_public_info,
|
||||
const struct TALER_DenominationPublicKey *denom_pub);
|
||||
|
||||
|
||||
/**
|
||||
* Compute the hash of a blinded coin.
|
||||
*
|
||||
* @param coin_ev blinded coin
|
||||
* @param coin_ev_size number of bytes in @a coin_ev
|
||||
* @param[out] bch where to write the hash
|
||||
*/
|
||||
void
|
||||
TALER_coin_ev_hash (const void *coin_ev,
|
||||
size_t coin_ev_size,
|
||||
struct TALER_BlindedCoinHash *bch);
|
||||
|
||||
|
||||
/**
|
||||
* Compute the hash of a coin.
|
||||
* FIXME-Oec: add age restriction hash here!
|
||||
*
|
||||
* @param coin_pub public key of the coin
|
||||
* @param[out] coin_h where to write the hash
|
||||
*/
|
||||
void
|
||||
TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
struct TALER_CoinPubHash *coin_h);
|
||||
|
||||
|
||||
GNUNET_NETWORK_STRUCT_BEGIN
|
||||
|
||||
/**
|
||||
|
@ -226,7 +226,7 @@ verify_melt_signature_spend_conflict (struct TALER_EXCHANGE_MeltHandle *mh,
|
||||
};
|
||||
const struct MeltedCoin *mc;
|
||||
enum TALER_ErrorCode ec;
|
||||
struct GNUNET_HashCode h_denom_pub;
|
||||
struct TALER_DenominationHash h_denom_pub;
|
||||
|
||||
/* parse JSON reply */
|
||||
if (GNUNET_OK !=
|
||||
@ -486,8 +486,8 @@ TALER_EXCHANGE_melt (struct TALER_EXCHANGE_Handle *exchange,
|
||||
&md->melted_coin.fee_melt);
|
||||
GNUNET_CRYPTO_eddsa_key_get_public (&md->melted_coin.coin_priv.eddsa_priv,
|
||||
&melt.coin_pub.eddsa_pub);
|
||||
GNUNET_CRYPTO_rsa_public_key_hash (md->melted_coin.pub_key.rsa_public_key,
|
||||
&melt.h_denom_pub);
|
||||
TALER_denom_pub_hash (&md->melted_coin.pub_key,
|
||||
&melt.h_denom_pub);
|
||||
GNUNET_CRYPTO_eddsa_sign (&md->melted_coin.coin_priv.eddsa_priv,
|
||||
&melt,
|
||||
&confirm_sig.eddsa_signature);
|
||||
@ -529,8 +529,10 @@ TALER_EXCHANGE_melt (struct TALER_EXCHANGE_Handle *exchange,
|
||||
mh->exchange = exchange;
|
||||
mh->coin_pub = melt.coin_pub;
|
||||
mh->dki = *dki;
|
||||
mh->dki.key.rsa_public_key = NULL; /* lifetime not warranted, so better
|
||||
not copy the pointer */
|
||||
memset (&mh->dki.key,
|
||||
0,
|
||||
sizeof (mh->dki.key)); /* lifetime not warranted, so better
|
||||
not copy the pointers */
|
||||
mh->melt_cb = melt_cb;
|
||||
mh->melt_cb_cls = melt_cb_cls;
|
||||
mh->md = md;
|
||||
|
@ -187,7 +187,7 @@ handle_recoup_finished (void *cls,
|
||||
/* Insufficient funds, proof attached */
|
||||
json_t *history;
|
||||
struct TALER_Amount total;
|
||||
struct GNUNET_HashCode h_denom_pub;
|
||||
struct TALER_DenominationHash h_denom_pub;
|
||||
const struct TALER_EXCHANGE_DenomPublicKey *dki;
|
||||
enum TALER_ErrorCode ec;
|
||||
|
||||
@ -313,7 +313,7 @@ TALER_EXCHANGE_recoup (struct TALER_EXCHANGE_Handle *exchange,
|
||||
struct GNUNET_CURL_Context *ctx;
|
||||
struct TALER_RecoupRequestPS pr;
|
||||
struct TALER_CoinSpendSignatureP coin_sig;
|
||||
struct GNUNET_HashCode h_denom_pub;
|
||||
struct TALER_DenominationHash h_denom_pub;
|
||||
json_t *recoup_obj;
|
||||
CURL *eh;
|
||||
char arg_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2 + 32];
|
||||
@ -324,8 +324,8 @@ TALER_EXCHANGE_recoup (struct TALER_EXCHANGE_Handle *exchange,
|
||||
pr.purpose.size = htonl (sizeof (struct TALER_RecoupRequestPS));
|
||||
GNUNET_CRYPTO_eddsa_key_get_public (&ps->coin_priv.eddsa_priv,
|
||||
&pr.coin_pub.eddsa_pub);
|
||||
GNUNET_CRYPTO_rsa_public_key_hash (pk->key.rsa_public_key,
|
||||
&h_denom_pub);
|
||||
TALER_denom_pub_hash (&pk->key,
|
||||
&h_denom_pub);
|
||||
pr.h_denom_pub = pk->h_key;
|
||||
pr.coin_blind = ps->blinding_key;
|
||||
GNUNET_CRYPTO_eddsa_sign (&ps->coin_priv.eddsa_priv,
|
||||
@ -362,7 +362,9 @@ TALER_EXCHANGE_recoup (struct TALER_EXCHANGE_Handle *exchange,
|
||||
ph->coin_pub = pr.coin_pub;
|
||||
ph->exchange = exchange;
|
||||
ph->pk = *pk;
|
||||
ph->pk.key.rsa_public_key = NULL; /* zero out, as lifetime cannot be warranted */
|
||||
memset (&ph->pk.key,
|
||||
0,
|
||||
sizeof (ph->pk.key)); /* zero out, as lifetime cannot be warranted */
|
||||
ph->cb = recoup_cb;
|
||||
ph->cb_cls = recoup_cb_cls;
|
||||
ph->url = TEAH_path_to_url (exchange,
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of TALER
|
||||
Copyright (C) 2015-2020 Taler Systems SA
|
||||
Copyright (C) 2015-2021 Taler Systems SA
|
||||
|
||||
TALER is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
@ -32,10 +32,8 @@
|
||||
static void
|
||||
free_melted_coin (struct MeltedCoin *mc)
|
||||
{
|
||||
if (NULL != mc->pub_key.rsa_public_key)
|
||||
GNUNET_CRYPTO_rsa_public_key_free (mc->pub_key.rsa_public_key);
|
||||
if (NULL != mc->sig.rsa_signature)
|
||||
GNUNET_CRYPTO_rsa_signature_free (mc->sig.rsa_signature);
|
||||
TALER_denom_pub_free (&mc->pub_key);
|
||||
TALER_denom_sig_free (&mc->sig);
|
||||
}
|
||||
|
||||
|
||||
|
@ -98,14 +98,15 @@ struct TALER_EXCHANGE_RefreshesRevealHandle
|
||||
* @param[out] sigs array of length `num_fresh_coins`, initialized to contain RSA signatures
|
||||
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
|
||||
*/
|
||||
static int
|
||||
static enum GNUNET_GenericReturnValue
|
||||
refresh_reveal_ok (struct TALER_EXCHANGE_RefreshesRevealHandle *rrh,
|
||||
const json_t *json,
|
||||
struct TALER_DenominationSignature *sigs)
|
||||
{
|
||||
json_t *jsona;
|
||||
struct GNUNET_JSON_Specification outer_spec[] = {
|
||||
GNUNET_JSON_spec_json ("ev_sigs", &jsona),
|
||||
GNUNET_JSON_spec_json ("ev_sigs",
|
||||
&jsona),
|
||||
GNUNET_JSON_spec_end ()
|
||||
};
|
||||
|
||||
@ -138,9 +139,10 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshesRevealHandle *rrh,
|
||||
json_t *jsonai;
|
||||
struct GNUNET_CRYPTO_RsaSignature *blind_sig;
|
||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||
struct GNUNET_HashCode coin_hash;
|
||||
struct TALER_CoinPubHash coin_hash;
|
||||
struct GNUNET_JSON_Specification spec[] = {
|
||||
GNUNET_JSON_spec_rsa_signature ("ev_sig", &blind_sig),
|
||||
GNUNET_JSON_spec_rsa_signature ("ev_sig",
|
||||
&blind_sig),
|
||||
GNUNET_JSON_spec_end ()
|
||||
};
|
||||
struct TALER_FreshCoin coin;
|
||||
@ -164,9 +166,8 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshesRevealHandle *rrh,
|
||||
hence recomputing it here... */
|
||||
GNUNET_CRYPTO_eddsa_key_get_public (&fc->coin_priv.eddsa_priv,
|
||||
&coin_pub.eddsa_pub);
|
||||
GNUNET_CRYPTO_hash (&coin_pub.eddsa_pub,
|
||||
sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
|
||||
&coin_hash);
|
||||
TALER_coin_pub_hash (&coin_pub,
|
||||
&coin_hash);
|
||||
if (GNUNET_OK !=
|
||||
TALER_planchet_to_coin (pk,
|
||||
blind_sig,
|
||||
@ -218,7 +219,9 @@ handle_refresh_reveal_finished (void *cls,
|
||||
struct TALER_DenominationSignature sigs[rrh->md->num_fresh_coins];
|
||||
int ret;
|
||||
|
||||
memset (sigs, 0, sizeof (sigs));
|
||||
memset (sigs,
|
||||
0,
|
||||
sizeof (sigs));
|
||||
ret = refresh_reveal_ok (rrh,
|
||||
j,
|
||||
sigs);
|
||||
@ -237,8 +240,7 @@ handle_refresh_reveal_finished (void *cls,
|
||||
rrh->reveal_cb = NULL;
|
||||
}
|
||||
for (unsigned int i = 0; i<rrh->md->num_fresh_coins; i++)
|
||||
if (NULL != sigs[i].rsa_signature)
|
||||
GNUNET_CRYPTO_rsa_signature_free (sigs[i].rsa_signature);
|
||||
TALER_denom_sig_free (&sigs[i]);
|
||||
TALER_EXCHANGE_refreshes_reveal_cancel (rrh);
|
||||
return;
|
||||
}
|
||||
@ -342,12 +344,12 @@ TALER_EXCHANGE_refreshes_reveal (
|
||||
GNUNET_assert (NULL != (link_sigs = json_array ()));
|
||||
for (unsigned int i = 0; i<md->num_fresh_coins; i++)
|
||||
{
|
||||
struct GNUNET_HashCode denom_hash;
|
||||
struct TALER_DenominationHash denom_hash;
|
||||
struct TALER_PlanchetDetail pd;
|
||||
struct GNUNET_HashCode c_hash;
|
||||
struct TALER_CoinPubHash c_hash;
|
||||
|
||||
GNUNET_CRYPTO_rsa_public_key_hash (md->fresh_pks[i].rsa_public_key,
|
||||
&denom_hash);
|
||||
TALER_denom_pub_hash (&md->fresh_pks[i],
|
||||
&denom_hash);
|
||||
GNUNET_assert (0 ==
|
||||
json_array_append_new (new_denoms_h,
|
||||
GNUNET_JSON_from_data_auto (
|
||||
|
@ -638,7 +638,7 @@ handle_refund_finished (void *cls,
|
||||
struct TALER_EXCHANGE_RefundHandle *
|
||||
TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle *exchange,
|
||||
const struct TALER_Amount *amount,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct TALER_PrivateContractHash *h_contract_terms,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
uint64_t rtransaction_id,
|
||||
const struct TALER_MerchantPrivateKeyP *merchant_priv,
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of TALER
|
||||
Copyright (C) 2014-2020 Taler Systems SA
|
||||
Copyright (C) 2014-2021 Taler Systems SA
|
||||
|
||||
TALER is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
|
@ -71,7 +71,7 @@ struct TALER_EXCHANGE_WithdrawHandle
|
||||
/**
|
||||
* Hash of the public key of the coin we are signing.
|
||||
*/
|
||||
struct GNUNET_HashCode c_hash;
|
||||
struct TALER_CoinPubHash c_hash;
|
||||
|
||||
};
|
||||
|
||||
@ -142,7 +142,7 @@ handle_reserve_withdraw_finished (
|
||||
wh->cb (wh->cb_cls,
|
||||
&wr);
|
||||
if (MHD_HTTP_OK == hr->http_status)
|
||||
GNUNET_CRYPTO_rsa_signature_free (wr.details.success.sig.rsa_signature);
|
||||
TALER_denom_sig_free (&wr.details.success.sig);
|
||||
TALER_EXCHANGE_withdraw_cancel (wh);
|
||||
}
|
||||
|
||||
@ -193,8 +193,8 @@ TALER_EXCHANGE_withdraw (
|
||||
GNUNET_free (wh);
|
||||
return NULL;
|
||||
}
|
||||
wh->pk.key.rsa_public_key
|
||||
= GNUNET_CRYPTO_rsa_public_key_dup (pk->key.rsa_public_key);
|
||||
TALER_denom_pub_deep_copy (&wh->pk.key,
|
||||
&pk->key);
|
||||
wh->wh2 = TALER_EXCHANGE_withdraw2 (exchange,
|
||||
&pd,
|
||||
reserve_priv,
|
||||
@ -205,12 +205,6 @@ TALER_EXCHANGE_withdraw (
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cancel a withdraw status request. This function cannot be used
|
||||
* on a request handle if a response is already served for it.
|
||||
*
|
||||
* @param wh the withdraw sign request handle
|
||||
*/
|
||||
void
|
||||
TALER_EXCHANGE_withdraw_cancel (struct TALER_EXCHANGE_WithdrawHandle *wh)
|
||||
{
|
||||
@ -219,6 +213,6 @@ TALER_EXCHANGE_withdraw_cancel (struct TALER_EXCHANGE_WithdrawHandle *wh)
|
||||
TALER_EXCHANGE_withdraw2_cancel (wh->wh2);
|
||||
wh->wh2 = NULL;
|
||||
}
|
||||
GNUNET_CRYPTO_rsa_public_key_free (wh->pk.key.rsa_public_key);
|
||||
TALER_denom_pub_free (&wh->pk.key);
|
||||
GNUNET_free (wh);
|
||||
}
|
||||
|
@ -437,7 +437,7 @@ TALER_EXCHANGE_withdraw2 (
|
||||
|
||||
TALER_amount_hton (&req.amount_with_fee,
|
||||
&wh->requested_amount);
|
||||
GNUNET_CRYPTO_hash (pd->coin_ev,
|
||||
TALER_coin_ev_hash (pd->coin_ev,
|
||||
pd->coin_ev_size,
|
||||
&req.h_coin_envelope);
|
||||
GNUNET_CRYPTO_eddsa_sign (&reserve_priv->eddsa_priv,
|
||||
|
@ -339,4 +339,25 @@ TALER_rsa_unblind (const struct GNUNET_CRYPTO_RsaSignature *sig,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TALER_coin_ev_hash (const void *coin_ev,
|
||||
size_t coin_ev_size,
|
||||
struct TALER_BlindedCoinHash *bch)
|
||||
{
|
||||
GNUNET_CRYPTO_hash (coin_ev,
|
||||
coin_ev_size,
|
||||
&bch->hash);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
struct TALER_CoinPubHash *coin_h)
|
||||
{
|
||||
GNUNET_CRYPTO_hash (&coin_pub->eddsa_pub,
|
||||
sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
|
||||
&coin_h->hash);
|
||||
}
|
||||
|
||||
|
||||
/* end of crypto.c */
|
||||
|
@ -19,7 +19,7 @@
|
||||
* @author Christian Grothoff <christian@grothoff.org>
|
||||
*/
|
||||
#include "platform.h"
|
||||
#include "taler_crypto_lib.h"
|
||||
#include "taler_util.h"
|
||||
#include "taler_signatures.h"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user