diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/exchange_api_common.c | 22 | ||||
-rw-r--r-- | src/lib/exchange_api_deposit.c | 3 | ||||
-rw-r--r-- | src/lib/exchange_api_handle.c | 9 | ||||
-rw-r--r-- | src/lib/exchange_api_link.c | 9 | ||||
-rw-r--r-- | src/lib/exchange_api_purse_create_with_deposit.c | 5 | ||||
-rw-r--r-- | src/lib/exchange_api_refund.c | 12 |
6 files changed, 37 insertions, 23 deletions
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c index df1c43e4f..04f2a4df8 100644 --- a/src/lib/exchange_api_common.c +++ b/src/lib/exchange_api_common.c @@ -447,7 +447,8 @@ TALER_EXCHANGE_verify_coin_history ( struct TALER_MerchantPublicKeyP merchant_pub; struct GNUNET_TIME_Timestamp refund_deadline = {0}; struct TALER_CoinSpendSignatureP sig; - struct TALER_AgeCommitmentHash hac = {0}; + struct TALER_AgeCommitmentHash hac; + bool no_hac; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_fixed_auto ("coin_sig", &sig), @@ -459,12 +460,14 @@ TALER_EXCHANGE_verify_coin_history ( h_denom_pub), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("h_age_commitment", - &hac)), + &hac), + &no_hac), GNUNET_JSON_spec_timestamp ("timestamp", &wallet_timestamp), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_timestamp ("refund_deadline", - &refund_deadline)), + &refund_deadline), + NULL), TALER_JSON_spec_amount_any ("deposit_fee", &fee), GNUNET_JSON_spec_fixed_auto ("merchant_pub", @@ -486,7 +489,7 @@ TALER_EXCHANGE_verify_coin_history ( &fee, &h_wire, &h_contract_terms, - TALER_AgeCommitmentHash_isNullOrZero (&hac) ? NULL : &hac, + no_hac ? NULL : &hac, NULL /* h_extensions! */, h_denom_pub, wallet_timestamp, @@ -519,7 +522,8 @@ TALER_EXCHANGE_verify_coin_history ( { struct TALER_CoinSpendSignatureP sig; struct TALER_RefreshCommitmentP rc; - struct TALER_AgeCommitmentHash h_age_commitment = {0}; + struct TALER_AgeCommitmentHash h_age_commitment; + bool no_hac; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_fixed_auto ("coin_sig", &sig), @@ -529,7 +533,8 @@ TALER_EXCHANGE_verify_coin_history ( h_denom_pub), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("h_age_commitment", - &h_age_commitment)), + &h_age_commitment), + &no_hac), TALER_JSON_spec_amount_any ("melt_fee", &fee), GNUNET_JSON_spec_end () @@ -566,8 +571,9 @@ TALER_EXCHANGE_verify_coin_history ( &fee, &rc, h_denom_pub, - TALER_AgeCommitmentHash_isNullOrZero (&h_age_commitment) ? - NULL : &h_age_commitment, + no_hac + ? NULL + : &h_age_commitment, coin_pub, &sig)) { diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c index 947a42561..67f595bfb 100644 --- a/src/lib/exchange_api_deposit.c +++ b/src/lib/exchange_api_deposit.c @@ -333,7 +333,8 @@ handle_deposit_finished (void *cls, &dh->exchange_pub), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("transaction_base_url", - &dr.details.success.transaction_base_url)), + &dr.details.success.transaction_base_url), + NULL), GNUNET_JSON_spec_timestamp ("exchange_timestamp", &dh->exchange_timestamp), GNUNET_JSON_spec_end () diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c index feab4ac44..6528c56d1 100644 --- a/src/lib/exchange_api_handle.c +++ b/src/lib/exchange_api_handle.c @@ -750,7 +750,8 @@ decode_keys_json (const json_t *resp_obj, ¤cy), GNUNET_JSON_spec_mark_optional ( TALER_JSON_spec_amount_any ("wallet_balance_limit_without_kyc", - &key_data->wallet_balance_limit_without_kyc)), + &key_data->wallet_balance_limit_without_kyc), + NULL), GNUNET_JSON_spec_end () }; @@ -895,11 +896,13 @@ decode_keys_json (const json_t *resp_obj, struct GNUNET_JSON_Specification ext_spec[] = { GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_json ("extensions", - &extensions)), + &extensions), + NULL), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ( "extensions_sig", - &extensions_sig)), + &extensions_sig), + NULL), GNUNET_JSON_spec_end () }; diff --git a/src/lib/exchange_api_link.c b/src/lib/exchange_api_link.c index 5840cac63..ddc763c33 100644 --- a/src/lib/exchange_api_link.c +++ b/src/lib/exchange_api_link.c @@ -97,6 +97,7 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh, union TALER_DenominationBlindingKeyP bks; struct TALER_ExchangeWithdrawValues alg_values; struct TALER_CsNonce nonce; + bool no_nonce; uint32_t coin_idx; struct GNUNET_JSON_Specification spec[] = { TALER_JSON_spec_denom_pub ("denom_pub", @@ -111,7 +112,8 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh, &coin_idx), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("cs_nonce", - &nonce)), + &nonce), + &no_nonce), GNUNET_JSON_spec_end () }; struct TALER_TransferSecretP secret; @@ -119,9 +121,6 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh, struct TALER_CoinPubHashP c_hash; /* parse reply */ - memset (&nonce, - 0, - sizeof (nonce)); if (GNUNET_OK != GNUNET_JSON_parse (json, spec, @@ -180,7 +179,7 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh, } if (TALER_DENOMINATION_CS == alg_values.cipher) { - if (GNUNET_is_zero (&nonce)) + if (no_nonce) { GNUNET_break_op (0); GNUNET_JSON_parse_free (spec); diff --git a/src/lib/exchange_api_purse_create_with_deposit.c b/src/lib/exchange_api_purse_create_with_deposit.c index d8f86de0d..f5871fa34 100644 --- a/src/lib/exchange_api_purse_create_with_deposit.c +++ b/src/lib/exchange_api_purse_create_with_deposit.c @@ -259,7 +259,7 @@ TALER_EXCHANGE_purse_create_with_deposit ( struct TALER_ContractDiffiePublicP contract_pub; char arg_str[sizeof (pch->purse_pub) * 2 + 32]; char *url; - uint32_t min_age; + uint32_t min_age = 0; pch = GNUNET_new (struct TALER_EXCHANGE_PurseCreateDepositHandle); pch->exchange = exchange; @@ -272,7 +272,8 @@ TALER_EXCHANGE_purse_create_with_deposit ( &pch->purse_value_after_fees), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_uint32 ("minimum_age", - &min_age)), + &min_age), + NULL), GNUNET_JSON_spec_end () }; diff --git a/src/lib/exchange_api_refund.c b/src/lib/exchange_api_refund.c index 6369a5bd6..004661b00 100644 --- a/src/lib/exchange_api_refund.c +++ b/src/lib/exchange_api_refund.c @@ -231,7 +231,8 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh, struct TALER_Amount deposit_fee; struct TALER_MerchantWireHashP h_wire; struct TALER_PrivateContractHashP h_contract_terms; - struct TALER_AgeCommitmentHash h_age_commitment = {{{0}}}; + struct TALER_AgeCommitmentHash h_age_commitment; + bool no_hac; // struct TALER_ExtensionContractHashP h_extensions; // FIXME! struct TALER_DenominationHashP h_denom_pub; struct GNUNET_TIME_Timestamp wallet_timestamp; @@ -249,7 +250,8 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh, &h_denom_pub), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("h_age_commitment", - &h_age_commitment)), + &h_age_commitment), + &no_hac), GNUNET_JSON_spec_timestamp ("timestamp", &wallet_timestamp), GNUNET_JSON_spec_timestamp ("refund_deadline", @@ -275,8 +277,10 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh, &deposit_fee, &h_wire, &h_contract_terms, - &h_age_commitment, - NULL /* h_extensions! */, + no_hac + ? NULL + : &h_age_commitment, + NULL /* FIXME-OEC: h_extensions! */, &h_denom_pub, wallet_timestamp, &merchant_pub, |