fix lib/ FTBFS

This commit is contained in:
Christian Grothoff 2021-10-27 13:42:54 +02:00
parent b148a5a81a
commit 77142acbe8
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
16 changed files with 64 additions and 172 deletions

View File

@ -760,8 +760,8 @@ show_denomkeys (const json_t *denomkeys)
struct TALER_Amount fee_refund;
struct TALER_MasterSignatureP master_sig;
struct GNUNET_JSON_Specification spec[] = {
TALER_JSON_spec_denomination_public_key ("denom_pub",
&denom_pub),
TALER_JSON_spec_denom_pub ("denom_pub",
&denom_pub),
TALER_JSON_spec_amount ("value",
currency,
&coin_value),
@ -1060,8 +1060,8 @@ sign_denomkeys (const json_t *denomkeys)
struct TALER_Amount fee_refund;
struct TALER_MasterSignatureP master_sig;
struct GNUNET_JSON_Specification spec[] = {
TALER_JSON_spec_denomination_public_key ("denom_pub",
&denom_pub),
TALER_JSON_spec_denom_pub ("denom_pub",
&denom_pub),
TALER_JSON_spec_amount ("value",
currency,
&coin_value),

View File

@ -2604,8 +2604,8 @@ show_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("section_name",
&section_name),
TALER_JSON_spec_denomination_public_key ("denom_pub",
&denom_pub),
TALER_JSON_spec_denom_pub ("denom_pub",
&denom_pub),
TALER_JSON_spec_amount ("value",
currency,
&coin_value),
@ -3023,8 +3023,8 @@ sign_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("section_name",
&section_name),
TALER_JSON_spec_denomination_public_key ("denom_pub",
&denom_pub),
TALER_JSON_spec_denom_pub ("denom_pub",
&denom_pub),
TALER_JSON_spec_amount ("value",
currency,
&coin_value),

View File

@ -330,8 +330,8 @@ TEH_handler_deposit (struct MHD_Connection *connection,
&deposit.amount_with_fee),
GNUNET_JSON_spec_fixed_auto ("denom_pub_hash",
&deposit.coin.denom_pub_hash),
TALER_JSON_spec_denomination_signature ("ub_sig",
&deposit.coin.denom_sig),
TALER_JSON_spec_denom_sig ("ub_sig",
&deposit.coin.denom_sig),
GNUNET_JSON_spec_fixed_auto ("merchant_pub",
&deposit.merchant_pub),
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",

View File

@ -590,8 +590,8 @@ TEH_handler_melt (struct MHD_Connection *connection,
enum GNUNET_GenericReturnValue ret;
MHD_RESULT res;
struct GNUNET_JSON_Specification spec[] = {
TALER_JSON_spec_denomination_signature ("denom_sig",
&rmc.refresh_session.coin.denom_sig),
TALER_JSON_spec_denom_sig ("denom_sig",
&rmc.refresh_session.coin.denom_sig),
GNUNET_JSON_spec_fixed_auto ("denom_pub_hash",
&rmc.refresh_session.coin.denom_pub_hash),
GNUNET_JSON_spec_fixed_auto ("confirm_sig",

View File

@ -523,8 +523,8 @@ TEH_handler_recoup (struct MHD_Connection *connection,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("denom_pub_hash",
&coin.denom_pub_hash),
TALER_JSON_spec_denomination_signature ("denom_sig",
&coin.denom_sig),
TALER_JSON_spec_denom_sig ("denom_sig",
&coin.denom_sig),
GNUNET_JSON_spec_fixed_auto ("coin_blind_key_secret",
&coin_bks),
GNUNET_JSON_spec_fixed_auto ("coin_sig",

View File

@ -1590,8 +1590,6 @@ struct TALER_EXCHANGE_RefreshesRevealHandle;
* prior to calling this function.
*
* @param exchange the exchange handle; the exchange must be ready to operate
* @param refresh_data_length size of the @a refresh_data (returned
* in the `res_size` argument from #TALER_EXCHANGE_refresh_prepare())
* @param refresh_data the refresh data as returned from
#TALER_EXCHANGE_refresh_prepare())
* @param noreveal_index response from the exchange to the
@ -1605,8 +1603,7 @@ struct TALER_EXCHANGE_RefreshesRevealHandle;
struct TALER_EXCHANGE_RefreshesRevealHandle *
TALER_EXCHANGE_refreshes_reveal (
struct TALER_EXCHANGE_Handle *exchange,
size_t refresh_data_length,
const char *refresh_data,
const json_t *refresh_data,
uint32_t noreveal_index,
TALER_EXCHANGE_RefreshesRevealCallback reveal_cb,
void *reveal_cb_cls);

View File

@ -311,8 +311,8 @@ TALER_JSON_spec_relative_time (const char *name,
* @return corresponding field spec
*/
struct GNUNET_JSON_Specification
TALER_JSON_spec_denomination_public_key (const char *field,
struct TALER_DenominationPublicKey *pk);
TALER_JSON_spec_denom_pub (const char *field,
struct TALER_DenominationPublicKey *pk);
/**
@ -323,8 +323,8 @@ TALER_JSON_spec_denomination_public_key (const char *field,
* @return corresponding field spec
*/
struct GNUNET_JSON_Specification
TALER_JSON_spec_denomination_signature (const char *field,
struct TALER_DenominationSignature *sig);
TALER_JSON_spec_denom_sig (const char *field,
struct TALER_DenominationSignature *sig);
/**

View File

@ -506,8 +506,8 @@ clean_denom_pub (void *cls,
struct GNUNET_JSON_Specification
TALER_JSON_spec_denomination_public_key (const char *field,
struct TALER_DenominationPublicKey *pk)
TALER_JSON_spec_denom_pub (const char *field,
struct TALER_DenominationPublicKey *pk)
{
struct GNUNET_JSON_Specification ret = {
.parser = &parse_denom_pub,
@ -599,8 +599,8 @@ clean_denom_sig (void *cls,
struct GNUNET_JSON_Specification
TALER_JSON_spec_denomination_signature (const char *field,
struct TALER_DenominationSignature *sig)
TALER_JSON_spec_denom_sig (const char *field,
struct TALER_DenominationSignature *sig)
{
struct GNUNET_JSON_Specification ret = {
.parser = &parse_denom_sig,

View File

@ -26,22 +26,6 @@
#include "taler_signatures.h"
/**
* Parse history given in JSON format and return it in binary
* format.
*
* @param exchange connection to the exchange we can use
* @param history JSON array with the history
* @param reserve_pub public key of the reserve to inspect
* @param currency currency we expect the balance to be in
* @param[out] balance final balance
* @param history_length number of entries in @a history
* @param[out] rhistory array of length @a history_length, set to the
* parsed history entries
* @return #GNUNET_OK if history was valid and @a rhistory and @a balance
* were set,
* #GNUNET_SYSERR if there was a protocol violation in @a history
*/
enum GNUNET_GenericReturnValue
TALER_EXCHANGE_parse_reserve_history (
struct TALER_EXCHANGE_Handle *exchange,
@ -954,14 +938,6 @@ TALER_EXCHANGE_verify_coin_history (
}
/**
* Obtain meta data about an exchange (online) signing
* key.
*
* @param keys from where to obtain the meta data
* @param exchange_pub public key to lookup
* @return NULL on error (@a exchange_pub not known)
*/
const struct TALER_EXCHANGE_SigningPublicKey *
TALER_EXCHANGE_get_signing_key_info (
const struct TALER_EXCHANGE_Keys *keys,

View File

@ -345,8 +345,8 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
&denom_key->fee_refresh),
TALER_JSON_spec_amount_any ("fee_refund",
&denom_key->fee_refund),
TALER_JSON_spec_denomination_public_key ("denom_pub",
&denom_key->key),
TALER_JSON_spec_denom_pub ("denom_pub",
&denom_key->key),
GNUNET_JSON_spec_end ()
};

View File

@ -95,8 +95,8 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
struct TALER_DenominationPublicKey rpub;
struct TALER_CoinSpendSignatureP link_sig;
struct GNUNET_JSON_Specification spec[] = {
TALER_JSON_spec_denomination_public_key ("denom_pub",
&rpub),
TALER_JSON_spec_denom_pub ("denom_pub",
&rpub),
GNUNET_JSON_spec_rsa_signature ("ev_sig",
&bsig),
GNUNET_JSON_spec_fixed_auto ("link_sig",

View File

@ -179,8 +179,8 @@ handle_ok (struct TALER_EXCHANGE_ManagementGetKeysHandle *gh,
&denom_key->expire_deposit),
TALER_JSON_spec_absolute_time ("stamp_expire_legal",
&denom_key->expire_legal),
TALER_JSON_spec_denomination_public_key ("denom_pub",
&denom_key->key),
TALER_JSON_spec_denom_pub ("denom_pub",
&denom_key->key),
TALER_JSON_spec_amount_any ("fee_withdraw",
&denom_key->fee_withdraw),
TALER_JSON_spec_amount_any ("fee_deposit",

View File

@ -471,7 +471,8 @@ TALER_EXCHANGE_melt (struct TALER_EXCHANGE_Handle *exchange,
GNUNET_assert (GNUNET_YES ==
TEAH_handle_is_ready (exchange));
md = TALER_EXCHANGE_deserialize_melt_data_ (refresh_data);
md = TALER_EXCHANGE_deserialize_melt_data_ (refresh_data,
exchange->key_data.currency);
if (NULL == md)
{
GNUNET_break (0);

View File

@ -100,11 +100,13 @@ serialize_melted_coin (const struct MeltedCoin *mc)
* Deserialize information about a coin we are melting.
*
* @param[out] mc information to deserialize
* @param currency expected currency
* @param in JSON object to read data from
* @return #GNUNET_NO to report errors
*/
static enum GNUNET_GenericReturnValue
deserialize_melted_coin (struct MeltedCoin *mc,
const char *currency,
const json_t *in)
{
json_t *trans_privs;
@ -116,15 +118,18 @@ deserialize_melted_coin (struct MeltedCoin *mc,
TALER_JSON_spec_denom_pub ("denom_pub",
&mc->pub_key),
TALER_JSON_spec_amount ("melt_amount_with_fee",
currency,
&mc->melt_amount_with_fee),
TALER_JSON_spec_amount ("original_value",
currency,
&mc->original_value),
TALER_JSON_spec_amount ("melt_fee",
&mc->melt_fee),
currency,
&mc->fee_melt),
TALER_JSON_spec_absolute_time ("expire_deposit",
&mc->expire_deposit),
TALER_JSON_spec_json ("transfer_privs",
&trans_privs),
GNUNET_JSON_spec_json ("transfer_privs",
&trans_privs),
GNUNET_JSON_spec_end ()
};
@ -190,33 +195,35 @@ serialize_melt_data (const struct MeltData *md)
json_t *ps;
ps = GNUNET_JSON_PACK (
GNUNET_JSON_pack_fixed_auto ("ps",
&md->fresh_coins[i][j]));
GNUNET_JSON_pack_data_auto ("ps",
&md->fresh_coins[i][j]));
GNUNET_assert (0 ==
json_array_append (planchet_secrets,
ps));
}
GNUNET_assert (0 ==
json_array_append (
fresh_coins,
GNUNET_JSON_PACK (
TALER_JSON_pack_denom_pub ("denom_pub",
&md->fresh_pks[i]),
TALER_JSON_pack_array_steal ("planchet_secrets",
ps)))
GNUNET_JSON_pack_array_steal ("planchet_secrets",
planchet_secrets)))
);
}
return GNUNET_JSON_PACK (
TALER_JSON_pack_array_steal ("fresh_coins",
fresh_coins),
TALER_JSON_pack_object_steal ("melted_coin",
serialize_melted_coin (&mc->melted_coin)),
GNUNET_JSON_pack_fixed_auto ("rc",
&md->rc));
GNUNET_JSON_pack_array_steal ("fresh_coins",
fresh_coins),
GNUNET_JSON_pack_object_steal ("melted_coin",
serialize_melted_coin (&md->melted_coin)),
GNUNET_JSON_pack_data_auto ("rc",
&md->rc));
}
struct MeltData *
TALER_EXCHANGE_deserialize_melt_data_ (const json_t *melt_data)
TALER_EXCHANGE_deserialize_melt_data_ (const json_t *melt_data,
const char *currency)
{
struct MeltData *md = GNUNET_new (struct MeltData);
json_t *fresh_coins;
@ -250,7 +257,8 @@ TALER_EXCHANGE_deserialize_melt_data_ (const json_t *melt_data)
return NULL;
}
if (GNUNET_OK !=
deserialize_melted_coin (&md->mc,
deserialize_melted_coin (&md->melted_coin,
currency,
melted_coin))
{
GNUNET_break (0);
@ -278,8 +286,8 @@ TALER_EXCHANGE_deserialize_melt_data_ (const json_t *melt_data)
};
if (GNUNET_OK !=
GNUNET_JSON_parse (melt_data,
spec,
GNUNET_JSON_parse (ji,
ispec,
NULL, NULL))
{
GNUNET_break (0);
@ -296,8 +304,8 @@ TALER_EXCHANGE_deserialize_melt_data_ (const json_t *melt_data)
for (unsigned int j = 0; j<TALER_CNC_KAPPA; j++)
{
struct GNUNET_JSON_Specification jspec[] = {
GNUNET_JSON_spec_data_auto ("ps",
&md->fresh_coins[i][j]),
GNUNET_JSON_spec_fixed_auto ("ps",
&md->fresh_coins[i][j]),
GNUNET_JSON_spec_end ()
};
@ -451,5 +459,5 @@ TALER_EXCHANGE_refresh_prepare (
GNUNET_free (rce[i].new_coins);
}
TALER_EXCHANGE_free_melt_data_ (&md);
return buf;
return ret;
}

View File

@ -27,97 +27,6 @@
#include "taler_signatures.h"
/* structures for committing refresh data to disk before doing the
network interaction(s) */
GNUNET_NETWORK_STRUCT_BEGIN
/**
* Header of serialized information about a coin we are melting.
*/
struct MeltedCoinP
{
/**
* Private key of the coin.
*/
struct TALER_CoinSpendPrivateKeyP coin_priv;
/**
* Amount this coin contributes to the melt, including fee.
*/
struct TALER_AmountNBO melt_amount_with_fee;
/**
* The applicable fee for withdrawing a coin of this denomination
*/
struct TALER_AmountNBO fee_melt;
/**
* The original value of the coin.
*/
struct TALER_AmountNBO original_value;
/**
* Transfer private keys for each cut-and-choose dimension.
*/
struct TALER_TransferPrivateKeyP transfer_priv[TALER_CNC_KAPPA];
/**
* Timestamp indicating when coins of this denomination become invalid.
*/
struct GNUNET_TIME_AbsoluteNBO expire_deposit;
/**
* Size of the encoded public key that follows.
*/
uint16_t pbuf_size;
/**
* Size of the encoded signature that follows.
*/
uint16_t sbuf_size;
/* Followed by serializations of:
1) struct TALER_DenominationPublicKey pub_key;
2) struct TALER_DenominationSignature sig;
*/
};
/**
* Header of serialized data about a melt operation, suitable for
* persisting it on disk.
*/
struct MeltDataP
{
/**
* Hash over the melting session.
*/
struct TALER_RefreshCommitmentP rc;
/**
* Number of coins we are melting, in NBO
*/
uint16_t num_melted_coins GNUNET_PACKED;
/**
* Number of coins we are creating, in NBO
*/
uint16_t num_fresh_coins GNUNET_PACKED;
/* Followed by serializations of:
1) struct MeltedCoinP melted_coins[num_melted_coins];
2) struct TALER_EXCHANGE_DenomPublicKey fresh_pks[num_fresh_coins];
3) TALER_CNC_KAPPA times:
3a) struct TALER_PlanchetSecretsP fresh_coins[num_fresh_coins];
*/
};
GNUNET_NETWORK_STRUCT_END
/**
* Information about a coin we are melting.
*/
@ -205,10 +114,12 @@ struct MeltData
* Deserialize melt data.
*
* @param data json data to deserialize
* @param currency expected currency for the coins
* @return deserialized melt data, NULL on error
*/
struct MeltData *
TALER_EXCHANGE_deserialize_melt_data_ (const json_t *data);
TALER_EXCHANGE_deserialize_melt_data_ (const json_t *data,
const char *currency);
/**

View File

@ -292,8 +292,7 @@ handle_refresh_reveal_finished (void *cls,
struct TALER_EXCHANGE_RefreshesRevealHandle *
TALER_EXCHANGE_refreshes_reveal (
struct TALER_EXCHANGE_Handle *exchange,
size_t refresh_data_length,
const char *refresh_data,
const json_t *refresh_data,
uint32_t noreveal_index,
TALER_EXCHANGE_RefreshesRevealCallback reveal_cb,
void *reveal_cb_cls)
@ -326,7 +325,7 @@ TALER_EXCHANGE_refreshes_reveal (
return NULL;
}
md = TALER_EXCHANGE_deserialize_melt_data_ (refresh_data,
refresh_data_length);
exchange->key_data.currency);
if (NULL == md)
{
GNUNET_break (0);