-more changes towards fixing FTBFS

This commit is contained in:
Christian Grothoff 2021-10-24 12:25:57 +02:00 committed by Christian Grothoff
parent d4e03b12ae
commit 464c1f806c
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
9 changed files with 50 additions and 54 deletions

View File

@ -363,7 +363,7 @@ deposit_cb (void *cls,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_Amount *amount_with_fee, const struct TALER_Amount *amount_with_fee,
const struct TALER_Amount *deposit_fee, const struct TALER_Amount *deposit_fee,
const struct GNUNET_HashCode *h_contract_terms, const struct TALER_PrivateContractHash *h_contract_terms,
const json_t *wire) const json_t *wire)
{ {
struct AggregationUnit *au = cls; struct AggregationUnit *au = cls;
@ -528,7 +528,7 @@ aggregate_cb (void *cls,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_Amount *amount_with_fee, const struct TALER_Amount *amount_with_fee,
const struct TALER_Amount *deposit_fee, const struct TALER_Amount *deposit_fee,
const struct GNUNET_HashCode *h_contract_terms) const struct TALER_PrivateContractHash *h_contract_terms)
{ {
struct AggregationUnit *au = cls; struct AggregationUnit *au = cls;
struct TALER_Amount old; struct TALER_Amount old;

View File

@ -217,7 +217,7 @@ expired_reserve_cb (void *cls,
struct TALER_WireTransferIdentifierRawP wtid; struct TALER_WireTransferIdentifierRawP wtid;
struct TALER_Amount amount_without_fee; struct TALER_Amount amount_without_fee;
struct TALER_Amount closing_fee; struct TALER_Amount closing_fee;
int ret; enum TALER_AmountArithmeticResult ret;
enum GNUNET_DB_QueryStatus qs; enum GNUNET_DB_QueryStatus qs;
const struct TALER_EXCHANGEDB_AccountInfo *wa; const struct TALER_EXCHANGEDB_AccountInfo *wa;
@ -273,8 +273,8 @@ expired_reserve_cb (void *cls,
ret = TALER_amount_subtract (&amount_without_fee, ret = TALER_amount_subtract (&amount_without_fee,
left, left,
&closing_fee); &closing_fee);
if ( (GNUNET_SYSERR == ret) || if ( (TALER_AAR_INVALID_NEGATIVE_RESULT == ret) ||
(GNUNET_NO == ret) ) (TALER_AAR_RESULT_ZERO == ret) )
{ {
/* Closing fee higher than or equal to remaining balance, close /* Closing fee higher than or equal to remaining balance, close
without wire transfer. */ without wire transfer. */
@ -283,6 +283,7 @@ expired_reserve_cb (void *cls,
TALER_amount_set_zero (left->currency, TALER_amount_set_zero (left->currency,
&amount_without_fee)); &amount_without_fee));
} }
GNUNET_assert (TALER_AAR_RESULT_POSITIVE == ret);
/* round down to enable transfer */ /* round down to enable transfer */
if (GNUNET_SYSERR == if (GNUNET_SYSERR ==
TALER_amount_round_down (&amount_without_fee, TALER_amount_round_down (&amount_without_fee,

View File

@ -558,7 +558,7 @@ TALER_EXCHANGE_get_keys_raw (struct TALER_EXCHANGE_Handle *exchange);
* @param pub claimed current online signing key for the exchange * @param pub claimed current online signing key for the exchange
* @return #GNUNET_OK if @a pub is (according to /keys) a current signing key * @return #GNUNET_OK if @a pub is (according to /keys) a current signing key
*/ */
int enum GNUNET_GenericReturnValue
TALER_EXCHANGE_test_signing_key (const struct TALER_EXCHANGE_Keys *keys, TALER_EXCHANGE_test_signing_key (const struct TALER_EXCHANGE_Keys *keys,
const struct TALER_ExchangePublicKeyP *pub); const struct TALER_ExchangePublicKeyP *pub);

View File

@ -122,9 +122,9 @@ handle_exchanges_finished (void *cls,
} }
{ {
struct TALER_AUDITOR_ExchangeInfo ei[ja_len]; struct TALER_AUDITOR_ExchangeInfo ei[ja_len];
int ok; bool ok;
ok = GNUNET_YES; ok = true;
for (unsigned int i = 0; i<ja_len; i++) for (unsigned int i = 0; i<ja_len; i++)
{ {
struct GNUNET_JSON_Specification spec[] = { struct GNUNET_JSON_Specification spec[] = {
@ -140,13 +140,13 @@ handle_exchanges_finished (void *cls,
NULL, NULL)) NULL, NULL))
{ {
GNUNET_break_op (0); GNUNET_break_op (0);
ok = GNUNET_NO; ok = false;
hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED; hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
hr.http_status = 0; hr.http_status = 0;
break; break;
} }
} }
if (GNUNET_YES != ok) if (! ok)
break; break;
leh->cb (leh->cb_cls, leh->cb (leh->cb_cls,
&hr, &hr,
@ -220,7 +220,8 @@ TALER_AUDITOR_list_exchanges (struct TALER_AUDITOR_Handle *auditor,
leh->auditor = auditor; leh->auditor = auditor;
leh->cb = cb; leh->cb = cb;
leh->cb_cls = cb_cls; leh->cb_cls = cb_cls;
leh->url = TALER_AUDITOR_path_to_url_ (auditor, "/exchanges"); leh->url = TALER_AUDITOR_path_to_url_ (auditor,
"/exchanges");
if (NULL == leh->url) if (NULL == leh->url)
{ {
GNUNET_free (leh); GNUNET_free (leh);
@ -253,8 +254,8 @@ TALER_AUDITOR_list_exchanges (struct TALER_AUDITOR_Handle *auditor,
* @param leh the list exchanges request handle * @param leh the list exchanges request handle
*/ */
void void
TALER_AUDITOR_list_exchanges_cancel (struct TALER_AUDITOR_list_exchanges_cancel (
TALER_AUDITOR_ListExchangesHandle *leh) struct TALER_AUDITOR_ListExchangesHandle *leh)
{ {
if (NULL != leh->job) if (NULL != leh->job)
{ {

View File

@ -420,12 +420,12 @@ handle_deposit_finished (void *cls,
static enum GNUNET_GenericReturnValue static enum GNUNET_GenericReturnValue
verify_signatures (const struct TALER_EXCHANGE_DenomPublicKey *dki, verify_signatures (const struct TALER_EXCHANGE_DenomPublicKey *dki,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct GNUNET_HashCode *h_wire, const struct TALER_MerchantWireHash *h_wire,
const struct GNUNET_HashCode *h_contract_terms, const struct TALER_PrivateContractHash *h_contract_terms,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_DenominationSignature *denom_sig, const struct TALER_DenominationSignature *denom_sig,
const struct TALER_DenominationPublicKey *denom_pub, const struct TALER_DenominationPublicKey *denom_pub,
const struct GNUNET_HashCode *denom_pub_hash, const struct TALER_DenominationHash *denom_pub_hash,
struct GNUNET_TIME_Absolute timestamp, struct GNUNET_TIME_Absolute timestamp,
const struct TALER_MerchantPublicKeyP *merchant_pub, const struct TALER_MerchantPublicKeyP *merchant_pub,
struct GNUNET_TIME_Absolute refund_deadline, struct GNUNET_TIME_Absolute refund_deadline,
@ -500,9 +500,9 @@ void
TALER_EXCHANGE_deposit_permission_sign ( TALER_EXCHANGE_deposit_permission_sign (
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct TALER_Amount *deposit_fee, const struct TALER_Amount *deposit_fee,
const struct GNUNET_HashCode *h_wire, const struct TALER_MerchantWireHash *h_wire,
const struct GNUNET_HashCode *h_contract_terms, const struct TALER_PrivateContractHash *h_contract_terms,
const struct GNUNET_HashCode *h_denom_pub, const struct TALER_DenominationHash *h_denom_pub,
const struct TALER_CoinSpendPrivateKeyP *coin_priv, const struct TALER_CoinSpendPrivateKeyP *coin_priv,
struct GNUNET_TIME_Absolute wallet_timestamp, struct GNUNET_TIME_Absolute wallet_timestamp,
const struct TALER_MerchantPublicKeyP *merchant_pub, const struct TALER_MerchantPublicKeyP *merchant_pub,
@ -510,10 +510,8 @@ TALER_EXCHANGE_deposit_permission_sign (
struct TALER_CoinSpendSignatureP *coin_sig) struct TALER_CoinSpendSignatureP *coin_sig)
{ {
struct TALER_DepositRequestPS dr = { struct TALER_DepositRequestPS dr = {
.purpose.size = htonl .purpose.size = htonl (sizeof (dr)),
(sizeof (dr)), .purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT),
.purpose.purpose = htonl
(TALER_SIGNATURE_WALLET_COIN_DEPOSIT),
.h_contract_terms = *h_contract_terms, .h_contract_terms = *h_contract_terms,
.h_wire = *h_wire, .h_wire = *h_wire,
.h_denom_pub = *h_denom_pub, .h_denom_pub = *h_denom_pub,
@ -543,7 +541,8 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
struct GNUNET_TIME_Absolute wire_deadline, struct GNUNET_TIME_Absolute wire_deadline,
json_t *wire_details, json_t *wire_details,
const struct GNUNET_HashCode *h_contract_terms, const struct
TALER_PrivateContractHash *h_contract_terms,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_DenominationSignature *denom_sig, const struct TALER_DenominationSignature *denom_sig,
const struct TALER_DenominationPublicKey *denom_pub, const struct TALER_DenominationPublicKey *denom_pub,
@ -561,8 +560,8 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
struct GNUNET_CURL_Context *ctx; struct GNUNET_CURL_Context *ctx;
json_t *deposit_obj; json_t *deposit_obj;
CURL *eh; CURL *eh;
struct GNUNET_HashCode h_wire; struct TALER_MerchantWireHash h_wire;
struct GNUNET_HashCode denom_pub_hash; struct TALER_DenominationHash denom_pub_hash;
struct TALER_Amount amount_without_fee; struct TALER_Amount amount_without_fee;
char arg_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2 + 32]; char arg_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2 + 32];
@ -678,10 +677,10 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
json_decref (deposit_obj); json_decref (deposit_obj);
return NULL; return NULL;
} }
dh->depconf.purpose.size = htonl (sizeof (struct dh->depconf.purpose.size
TALER_DepositConfirmationPS)); = htonl (sizeof (struct TALER_DepositConfirmationPS));
dh->depconf.purpose.purpose = htonl ( dh->depconf.purpose.purpose
TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT); = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT);
dh->depconf.h_contract_terms = *h_contract_terms; dh->depconf.h_contract_terms = *h_contract_terms;
dh->depconf.h_wire = h_wire; dh->depconf.h_wire = h_wire;
/* dh->depconf.exchange_timestamp; -- initialized later from exchange reply! */ /* dh->depconf.exchange_timestamp; -- initialized later from exchange reply! */

View File

@ -278,8 +278,8 @@ struct TALER_EXCHANGE_DepositGetHandle *
TALER_EXCHANGE_deposits_get ( TALER_EXCHANGE_deposits_get (
struct TALER_EXCHANGE_Handle *exchange, struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_MerchantPrivateKeyP *merchant_priv, const struct TALER_MerchantPrivateKeyP *merchant_priv,
const struct GNUNET_HashCode *h_wire, const struct TALER_MerchantWireHash *h_wire,
const struct GNUNET_HashCode *h_contract_terms, const struct TALER_PrivateContractHash *h_contract_terms,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_EXCHANGE_DepositGetCallback cb, TALER_EXCHANGE_DepositGetCallback cb,
void *cb_cls) void *cb_cls)
@ -290,9 +290,9 @@ TALER_EXCHANGE_deposits_get (
struct GNUNET_CURL_Context *ctx; struct GNUNET_CURL_Context *ctx;
CURL *eh; CURL *eh;
char arg_str[(sizeof (struct TALER_CoinSpendPublicKeyP) char arg_str[(sizeof (struct TALER_CoinSpendPublicKeyP)
+ sizeof (struct GNUNET_HashCode) + sizeof (struct TALER_MerchantWireHash)
+ sizeof (struct TALER_MerchantPublicKeyP) + sizeof (struct TALER_MerchantPublicKeyP)
+ sizeof (struct GNUNET_HashCode) + sizeof (struct TALER_PrivateContractHash)
+ sizeof (struct TALER_MerchantSignatureP)) * 2 + 48]; + sizeof (struct TALER_MerchantSignatureP)) * 2 + 48];
if (GNUNET_YES != if (GNUNET_YES !=
@ -316,37 +316,32 @@ TALER_EXCHANGE_deposits_get (
char cpub_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2]; char cpub_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2];
char mpub_str[sizeof (struct TALER_MerchantPublicKeyP) * 2]; char mpub_str[sizeof (struct TALER_MerchantPublicKeyP) * 2];
char msig_str[sizeof (struct TALER_MerchantSignatureP) * 2]; char msig_str[sizeof (struct TALER_MerchantSignatureP) * 2];
char chash_str[sizeof (struct GNUNET_HashCode) * 2]; char chash_str[sizeof (struct TALER_PrivateContractHash) * 2];
char whash_str[sizeof (struct GNUNET_HashCode) * 2]; char whash_str[sizeof (struct TALER_MerchantWireHash) * 2];
char *end; char *end;
end = GNUNET_STRINGS_data_to_string (h_wire, end = GNUNET_STRINGS_data_to_string (h_wire,
sizeof (struct sizeof (*h_wire),
GNUNET_HashCode),
whash_str, whash_str,
sizeof (whash_str)); sizeof (whash_str));
*end = '\0'; *end = '\0';
end = GNUNET_STRINGS_data_to_string (&dtp.merchant, end = GNUNET_STRINGS_data_to_string (&dtp.merchant,
sizeof (struct sizeof (dtp.merchant),
TALER_MerchantPublicKeyP),
mpub_str, mpub_str,
sizeof (mpub_str)); sizeof (mpub_str));
*end = '\0'; *end = '\0';
end = GNUNET_STRINGS_data_to_string (h_contract_terms, end = GNUNET_STRINGS_data_to_string (h_contract_terms,
sizeof (struct sizeof (*h_contract_terms),
GNUNET_HashCode),
chash_str, chash_str,
sizeof (chash_str)); sizeof (chash_str));
*end = '\0'; *end = '\0';
end = GNUNET_STRINGS_data_to_string (coin_pub, end = GNUNET_STRINGS_data_to_string (coin_pub,
sizeof (struct sizeof (*coin_pub),
TALER_CoinSpendPublicKeyP),
cpub_str, cpub_str,
sizeof (cpub_str)); sizeof (cpub_str));
*end = '\0'; *end = '\0';
end = GNUNET_STRINGS_data_to_string (&merchant_sig, end = GNUNET_STRINGS_data_to_string (&merchant_sig,
sizeof (struct sizeof (merchant_sig),
TALER_MerchantSignatureP),
msig_str, msig_str,
sizeof (msig_str)); sizeof (msig_str));
*end = '\0'; *end = '\0';

View File

@ -445,7 +445,7 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
off = 0; off = 0;
json_array_foreach (keys, i, key) { json_array_foreach (keys, i, key) {
struct TALER_AuditorSignatureP auditor_sig; struct TALER_AuditorSignatureP auditor_sig;
struct GNUNET_HashCode denom_h; struct TALER_DenominationHash denom_h;
const struct TALER_EXCHANGE_DenomPublicKey *dk; const struct TALER_EXCHANGE_DenomPublicKey *dk;
unsigned int dk_off; unsigned int dk_off;
struct GNUNET_JSON_Specification kspec[] = { struct GNUNET_JSON_Specification kspec[] = {
@ -2010,7 +2010,7 @@ TALER_EXCHANGE_disconnect (struct TALER_EXCHANGE_Handle *exchange)
* @param pub claimed current online signing key for the exchange * @param pub claimed current online signing key for the exchange
* @return #GNUNET_OK if @a pub is (according to /keys) a current signing key * @return #GNUNET_OK if @a pub is (according to /keys) a current signing key
*/ */
int enum GNUNET_GenericReturnValue
TALER_EXCHANGE_test_signing_key (const struct TALER_EXCHANGE_Keys *keys, TALER_EXCHANGE_test_signing_key (const struct TALER_EXCHANGE_Keys *keys,
const struct TALER_ExchangePublicKeyP *pub) const struct TALER_ExchangePublicKeyP *pub)
{ {
@ -2114,7 +2114,7 @@ TALER_EXCHANGE_destroy_denomination_key (
const struct TALER_EXCHANGE_DenomPublicKey * const struct TALER_EXCHANGE_DenomPublicKey *
TALER_EXCHANGE_get_denomination_key_by_hash ( TALER_EXCHANGE_get_denomination_key_by_hash (
const struct TALER_EXCHANGE_Keys *keys, const struct TALER_EXCHANGE_Keys *keys,
const struct GNUNET_HashCode *hc) const struct TALER_DenominationHash *hc)
{ {
for (unsigned int i = 0; i<keys->num_denom_keys; i++) for (unsigned int i = 0; i<keys->num_denom_keys; i++)
if (0 == GNUNET_memcmp (hc, if (0 == GNUNET_memcmp (hc,

View File

@ -141,8 +141,8 @@ verify_melt_signature_ok (struct TALER_EXCHANGE_MeltHandle *mh,
/* verify signature by exchange */ /* verify signature by exchange */
confirm.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT); confirm.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT);
confirm.purpose.size = htonl (sizeof (struct confirm.purpose.size
TALER_RefreshMeltConfirmationPS)); = htonl (sizeof (struct TALER_RefreshMeltConfirmationPS));
confirm.rc = mh->md->rc; confirm.rc = mh->md->rc;
confirm.noreveal_index = htonl (*noreveal_index); confirm.noreveal_index = htonl (*noreveal_index);
if (GNUNET_OK != if (GNUNET_OK !=
@ -167,14 +167,14 @@ verify_melt_signature_ok (struct TALER_EXCHANGE_MeltHandle *mh,
* @param json json reply with the signature(s) and transaction history * @param json json reply with the signature(s) and transaction history
* @return #GNUNET_OK if the signature(s) is valid, #GNUNET_SYSERR if not * @return #GNUNET_OK if the signature(s) is valid, #GNUNET_SYSERR if not
*/ */
static int static enum GNUNET_GenericReturnValue
verify_melt_signature_denom_conflict (struct TALER_EXCHANGE_MeltHandle *mh, verify_melt_signature_denom_conflict (struct TALER_EXCHANGE_MeltHandle *mh,
const json_t *json) const json_t *json)
{ {
json_t *history; json_t *history;
struct TALER_Amount total; struct TALER_Amount total;
struct GNUNET_HashCode h_denom_pub; struct TALER_DenominationHash h_denom_pub;
memset (&h_denom_pub, memset (&h_denom_pub,
0, 0,

View File

@ -579,7 +579,7 @@ TALER_EXCHANGE_refresh_prepare (
struct TALER_PlanchetSecretsP *fc = &md.fresh_coins[i][j]; struct TALER_PlanchetSecretsP *fc = &md.fresh_coins[i][j];
struct TALER_RefreshCoinData *rcd = &rce[i].new_coins[j]; struct TALER_RefreshCoinData *rcd = &rce[i].new_coins[j];
struct TALER_PlanchetDetail pd; struct TALER_PlanchetDetail pd;
struct GNUNET_HashCode c_hash; struct TALER_CoinPubHash c_hash;
TALER_planchet_setup_refresh (&trans_sec[i], TALER_planchet_setup_refresh (&trans_sec[i],
j, j,