-fix leaks and compiler warnings
This commit is contained in:
parent
7b5eb61370
commit
52fe9d657b
@ -1386,6 +1386,7 @@ handle_admin_add_incoming (struct TALER_FAKEBANK_Handle *h,
|
|||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Currency `%s' does not match our configuration\n",
|
"Currency `%s' does not match our configuration\n",
|
||||||
amount.currency);
|
amount.currency);
|
||||||
|
json_decref (json);
|
||||||
return TALER_MHD_reply_with_error (
|
return TALER_MHD_reply_with_error (
|
||||||
connection,
|
connection,
|
||||||
MHD_HTTP_CONFLICT,
|
MHD_HTTP_CONFLICT,
|
||||||
@ -1411,6 +1412,7 @@ handle_admin_add_incoming (struct TALER_FAKEBANK_Handle *h,
|
|||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"Reserve public key not unique\n");
|
"Reserve public key not unique\n");
|
||||||
|
json_decref (json);
|
||||||
return TALER_MHD_reply_with_error (
|
return TALER_MHD_reply_with_error (
|
||||||
connection,
|
connection,
|
||||||
MHD_HTTP_CONFLICT,
|
MHD_HTTP_CONFLICT,
|
||||||
|
@ -473,6 +473,7 @@ execute_wire_transfer (void)
|
|||||||
buf_size,
|
buf_size,
|
||||||
&confirmation_cb,
|
&confirmation_cb,
|
||||||
NULL);
|
NULL);
|
||||||
|
GNUNET_free (buf);
|
||||||
if (NULL == eh)
|
if (NULL == eh)
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
|
@ -375,6 +375,8 @@ check_refresh_reveal_cb (
|
|||||||
const struct TALER_TransferPublicKeyP *tpr)
|
const struct TALER_TransferPublicKeyP *tpr)
|
||||||
{
|
{
|
||||||
(void) cls;
|
(void) cls;
|
||||||
|
|
||||||
|
GNUNET_assert (TALER_CNC_KAPPA - 1 == num_tprivs);
|
||||||
/* compare the refresh commit coin arrays */
|
/* compare the refresh commit coin arrays */
|
||||||
for (unsigned int cnt = 0; cnt < num_freshcoins; cnt++)
|
for (unsigned int cnt = 0; cnt < num_freshcoins; cnt++)
|
||||||
{
|
{
|
||||||
@ -433,6 +435,7 @@ audit_refresh_session_cb (void *cls,
|
|||||||
(void) cls;
|
(void) cls;
|
||||||
(void) rowid;
|
(void) rowid;
|
||||||
(void) denom_pub;
|
(void) denom_pub;
|
||||||
|
(void) coin_pub;
|
||||||
(void) coin_sig;
|
(void) coin_sig;
|
||||||
(void) amount_with_fee;
|
(void) amount_with_fee;
|
||||||
(void) noreveal_index;
|
(void) noreveal_index;
|
||||||
@ -717,6 +720,16 @@ cb_wt_never (void *cls,
|
|||||||
const struct TALER_Amount *coin_value,
|
const struct TALER_Amount *coin_value,
|
||||||
const struct TALER_Amount *coin_fee)
|
const struct TALER_Amount *coin_fee)
|
||||||
{
|
{
|
||||||
|
(void) cls;
|
||||||
|
(void) serial_id;
|
||||||
|
(void) merchant_pub;
|
||||||
|
(void) account_payto_uri;
|
||||||
|
(void) exec_time;
|
||||||
|
(void) h_contract_terms;
|
||||||
|
(void) denom_pub;
|
||||||
|
(void) coin_pub;
|
||||||
|
(void) coin_value;
|
||||||
|
(void) coin_fee;
|
||||||
GNUNET_assert (0); /* this statement should be unreachable */
|
GNUNET_assert (0); /* this statement should be unreachable */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,6 +760,8 @@ cb_wt_check (void *cls,
|
|||||||
const struct TALER_Amount *coin_value,
|
const struct TALER_Amount *coin_value,
|
||||||
const struct TALER_Amount *coin_fee)
|
const struct TALER_Amount *coin_fee)
|
||||||
{
|
{
|
||||||
|
(void) row_id;
|
||||||
|
(void) denom_pub;
|
||||||
GNUNET_assert (cls == &cb_wt_never);
|
GNUNET_assert (cls == &cb_wt_never);
|
||||||
GNUNET_assert (0 == GNUNET_memcmp (merchant_pub,
|
GNUNET_assert (0 == GNUNET_memcmp (merchant_pub,
|
||||||
&merchant_pub_wt));
|
&merchant_pub_wt));
|
||||||
@ -890,6 +905,12 @@ audit_deposit_cb (void *cls,
|
|||||||
const struct TALER_DenominationPublicKey *denom_pub,
|
const struct TALER_DenominationPublicKey *denom_pub,
|
||||||
bool done)
|
bool done)
|
||||||
{
|
{
|
||||||
|
(void) cls;
|
||||||
|
(void) rowid;
|
||||||
|
(void) exchange_timestamp;
|
||||||
|
(void) deposit;
|
||||||
|
(void) denom_pub;
|
||||||
|
(void) done;
|
||||||
auditor_row_cnt++;
|
auditor_row_cnt++;
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
@ -911,7 +932,7 @@ audit_deposit_cb (void *cls,
|
|||||||
* @param amount_with_fee amount that was deposited including fee
|
* @param amount_with_fee amount that was deposited including fee
|
||||||
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
audit_refund_cb (void *cls,
|
audit_refund_cb (void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
const struct TALER_DenominationPublicKey *denom_pub,
|
const struct TALER_DenominationPublicKey *denom_pub,
|
||||||
@ -948,7 +969,7 @@ audit_refund_cb (void *cls,
|
|||||||
* @param execution_date when did we receive the funds
|
* @param execution_date when did we receive the funds
|
||||||
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
audit_reserve_in_cb (void *cls,
|
audit_reserve_in_cb (void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
const struct TALER_ReservePublicKeyP *reserve_pub,
|
const struct TALER_ReservePublicKeyP *reserve_pub,
|
||||||
@ -982,7 +1003,7 @@ audit_reserve_in_cb (void *cls,
|
|||||||
* @param amount_with_fee amount that was withdrawn
|
* @param amount_with_fee amount that was withdrawn
|
||||||
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
audit_reserve_out_cb (void *cls,
|
audit_reserve_out_cb (void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
const struct TALER_BlindedCoinHash *h_blind_ev,
|
const struct TALER_BlindedCoinHash *h_blind_ev,
|
||||||
@ -1010,7 +1031,7 @@ audit_reserve_out_cb (void *cls,
|
|||||||
*
|
*
|
||||||
* @return #GNUNET_OK on success
|
* @return #GNUNET_OK on success
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
test_gc (void)
|
test_gc (void)
|
||||||
{
|
{
|
||||||
struct DenomKeyPair *dkp;
|
struct DenomKeyPair *dkp;
|
||||||
@ -1062,7 +1083,7 @@ test_gc (void)
|
|||||||
*
|
*
|
||||||
* @return #GNUNET_OK on success
|
* @return #GNUNET_OK on success
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
test_wire_fees (void)
|
test_wire_fees (void)
|
||||||
{
|
{
|
||||||
struct GNUNET_TIME_Absolute start_date;
|
struct GNUNET_TIME_Absolute start_date;
|
||||||
@ -1171,7 +1192,7 @@ static struct TALER_Amount wire_out_amount;
|
|||||||
* @param amount amount that was wired
|
* @param amount amount that was wired
|
||||||
* @return #GNUNET_OK to continue, #GNUNET_SYSERR to stop iteration
|
* @return #GNUNET_OK to continue, #GNUNET_SYSERR to stop iteration
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
audit_wire_cb (void *cls,
|
audit_wire_cb (void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
struct GNUNET_TIME_Absolute date,
|
struct GNUNET_TIME_Absolute date,
|
||||||
@ -1179,6 +1200,9 @@ audit_wire_cb (void *cls,
|
|||||||
const char *payto_uri,
|
const char *payto_uri,
|
||||||
const struct TALER_Amount *amount)
|
const struct TALER_Amount *amount)
|
||||||
{
|
{
|
||||||
|
(void) cls;
|
||||||
|
(void) rowid;
|
||||||
|
(void) payto_uri;
|
||||||
auditor_row_cnt++;
|
auditor_row_cnt++;
|
||||||
GNUNET_assert (0 ==
|
GNUNET_assert (0 ==
|
||||||
TALER_amount_cmp (amount,
|
TALER_amount_cmp (amount,
|
||||||
@ -1196,7 +1220,7 @@ audit_wire_cb (void *cls,
|
|||||||
*
|
*
|
||||||
* @return #GNUNET_OK on success
|
* @return #GNUNET_OK on success
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
test_wire_out (const struct TALER_EXCHANGEDB_Deposit *deposit)
|
test_wire_out (const struct TALER_EXCHANGEDB_Deposit *deposit)
|
||||||
{
|
{
|
||||||
auditor_row_cnt = 0;
|
auditor_row_cnt = 0;
|
||||||
@ -1347,7 +1371,7 @@ drop:
|
|||||||
* @param coin_blind blinding factor used to blind the coin
|
* @param coin_blind blinding factor used to blind the coin
|
||||||
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
recoup_cb (void *cls,
|
recoup_cb (void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
struct GNUNET_TIME_Absolute timestamp,
|
struct GNUNET_TIME_Absolute timestamp,
|
||||||
@ -1360,6 +1384,10 @@ recoup_cb (void *cls,
|
|||||||
{
|
{
|
||||||
const union TALER_DenominationBlindingKeyP *cb = cls;
|
const union TALER_DenominationBlindingKeyP *cb = cls;
|
||||||
|
|
||||||
|
(void) timestamp;
|
||||||
|
(void) amount;
|
||||||
|
(void) reserve_pub;
|
||||||
|
(void) coin_sig;
|
||||||
FAILIF (NULL == cb);
|
FAILIF (NULL == cb);
|
||||||
FAILIF (0 != GNUNET_memcmp (cb,
|
FAILIF (0 != GNUNET_memcmp (cb,
|
||||||
coin_blind));
|
coin_blind));
|
||||||
@ -1666,6 +1694,7 @@ run (void *cls)
|
|||||||
TALER_denom_pub_verify (&dkp->pub,
|
TALER_denom_pub_verify (&dkp->pub,
|
||||||
&ds,
|
&ds,
|
||||||
&c_hash));
|
&c_hash));
|
||||||
|
TALER_denom_sig_free (&ds);
|
||||||
}
|
}
|
||||||
|
|
||||||
RND_BLK (&coin_sig);
|
RND_BLK (&coin_sig);
|
||||||
@ -2197,6 +2226,7 @@ main (int argc,
|
|||||||
char *testname;
|
char *testname;
|
||||||
struct GNUNET_CONFIGURATION_Handle *cfg;
|
struct GNUNET_CONFIGURATION_Handle *cfg;
|
||||||
|
|
||||||
|
(void) argc;
|
||||||
result = -1;
|
result = -1;
|
||||||
if (NULL == (plugin_name = strrchr (argv[0], (int) '-')))
|
if (NULL == (plugin_name = strrchr (argv[0], (int) '-')))
|
||||||
{
|
{
|
||||||
|
@ -679,7 +679,7 @@ TALER_EXCHANGE_verify_coin_history (
|
|||||||
for the exchange to lie here, so not checking is probably OK
|
for the exchange to lie here, so not checking is probably OK
|
||||||
(an auditor ought to check, though). Then again, we similarly
|
(an auditor ought to check, though). Then again, we similarly
|
||||||
had no reason to check the merchant's signature (other than a
|
had no reason to check the merchant's signature (other than a
|
||||||
well-formendess check). *///
|
well-formendess check). */
|
||||||
|
|
||||||
/* check that refund fee matches our expectations from /keys! */
|
/* check that refund fee matches our expectations from /keys! */
|
||||||
if (NULL != dk)
|
if (NULL != dk)
|
||||||
|
@ -198,11 +198,11 @@ serialize_melt_data (const struct MeltData *md)
|
|||||||
GNUNET_JSON_pack_data_auto ("ps",
|
GNUNET_JSON_pack_data_auto ("ps",
|
||||||
&md->fresh_coins[j][i]));
|
&md->fresh_coins[j][i]));
|
||||||
GNUNET_assert (0 ==
|
GNUNET_assert (0 ==
|
||||||
json_array_append (planchet_secrets,
|
json_array_append_new (planchet_secrets,
|
||||||
ps));
|
ps));
|
||||||
}
|
}
|
||||||
GNUNET_assert (0 ==
|
GNUNET_assert (0 ==
|
||||||
json_array_append (
|
json_array_append_new (
|
||||||
fresh_coins,
|
fresh_coins,
|
||||||
GNUNET_JSON_PACK (
|
GNUNET_JSON_PACK (
|
||||||
TALER_JSON_pack_denom_pub ("denom_pub",
|
TALER_JSON_pack_denom_pub ("denom_pub",
|
||||||
@ -299,6 +299,7 @@ TALER_EXCHANGE_deserialize_melt_data_ (const json_t *melt_data,
|
|||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
ok = false;
|
ok = false;
|
||||||
|
GNUNET_JSON_parse_free (ispec);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (unsigned int j = 0; j<TALER_CNC_KAPPA; j++)
|
for (unsigned int j = 0; j<TALER_CNC_KAPPA; j++)
|
||||||
@ -320,10 +321,12 @@ TALER_EXCHANGE_deserialize_melt_data_ (const json_t *melt_data,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
json_decref (planchet_secrets);
|
||||||
if (! ok)
|
if (! ok)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
if (! ok)
|
if (! ok)
|
||||||
{
|
{
|
||||||
TALER_EXCHANGE_free_melt_data_ (md);
|
TALER_EXCHANGE_free_melt_data_ (md);
|
||||||
|
@ -166,6 +166,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
if (0 == len)
|
if (0 == len)
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
have_deposit = false;
|
have_deposit = false;
|
||||||
@ -191,6 +192,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (0 == strcasecmp (type,
|
if (0 == strcasecmp (type,
|
||||||
@ -205,7 +207,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
struct TALER_MerchantPublicKeyP merchant_pub;
|
struct TALER_MerchantPublicKeyP merchant_pub;
|
||||||
struct GNUNET_TIME_Absolute refund_deadline;
|
struct GNUNET_TIME_Absolute refund_deadline;
|
||||||
struct TALER_CoinSpendSignatureP sig;
|
struct TALER_CoinSpendSignatureP sig;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification ispec[] = {
|
||||||
GNUNET_JSON_spec_fixed_auto ("coin_sig",
|
GNUNET_JSON_spec_fixed_auto ("coin_sig",
|
||||||
&sig),
|
&sig),
|
||||||
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
|
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
|
||||||
@ -227,10 +229,11 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_JSON_parse (transaction,
|
GNUNET_JSON_parse (transaction,
|
||||||
spec,
|
ispec,
|
||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -247,6 +250,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&sig))
|
&sig))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if ( (0 != GNUNET_memcmp (&rh->depconf.h_contract_terms,
|
if ( (0 != GNUNET_memcmp (&rh->depconf.h_contract_terms,
|
||||||
@ -256,6 +260,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
{
|
{
|
||||||
/* deposit information is about a different merchant/contract */
|
/* deposit information is about a different merchant/contract */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (have_deposit)
|
if (have_deposit)
|
||||||
@ -266,6 +271,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&dtotal))
|
&dtotal))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_break (0 <=
|
GNUNET_break (0 <=
|
||||||
@ -290,7 +296,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_REFUND),
|
.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_REFUND),
|
||||||
.coin_pub = rh->depconf.coin_pub
|
.coin_pub = rh->depconf.coin_pub
|
||||||
};
|
};
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification ispec[] = {
|
||||||
TALER_JSON_spec_amount_any ("refund_fee",
|
TALER_JSON_spec_amount_any ("refund_fee",
|
||||||
&refund_fee),
|
&refund_fee),
|
||||||
GNUNET_JSON_spec_fixed_auto ("merchant_sig",
|
GNUNET_JSON_spec_fixed_auto ("merchant_sig",
|
||||||
@ -306,10 +312,11 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_JSON_parse (transaction,
|
GNUNET_JSON_parse (transaction,
|
||||||
spec,
|
ispec,
|
||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (0 >
|
if (0 >
|
||||||
@ -318,6 +325,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&amount))
|
&amount))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
TALER_amount_hton (&rr.refund_amount,
|
TALER_amount_hton (&rr.refund_amount,
|
||||||
@ -330,6 +338,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&rr.merchant.eddsa_pub))
|
&rr.merchant.eddsa_pub))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if ( (0 != GNUNET_memcmp (&rh->depconf.h_contract_terms,
|
if ( (0 != GNUNET_memcmp (&rh->depconf.h_contract_terms,
|
||||||
@ -339,6 +348,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
{
|
{
|
||||||
/* refund is about a different merchant/contract */
|
/* refund is about a different merchant/contract */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (rr.rtransaction_id == rh->depconf.rtransaction_id)
|
if (rr.rtransaction_id == rh->depconf.rtransaction_id)
|
||||||
@ -346,6 +356,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
/* Eh, this shows either a dependency failure or idempotency,
|
/* Eh, this shows either a dependency failure or idempotency,
|
||||||
but must not happen in a conflict reply. Fail! */
|
but must not happen in a conflict reply. Fail! */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,6 +367,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&rtotal))
|
&rtotal))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_break (0 <=
|
GNUNET_break (0 <=
|
||||||
@ -376,6 +388,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
"Unexpected type `%s' in response for exchange refund\n",
|
"Unexpected type `%s' in response for exchange refund\n",
|
||||||
type);
|
type);
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -393,6 +406,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&amount))
|
&amount))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -405,10 +419,12 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&rtotal))
|
&rtotal))
|
||||||
{
|
{
|
||||||
/* dtotal < rtotal: good! */
|
/* dtotal < rtotal: good! */
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
/* this fails to prove a conflict */
|
/* this fails to prove a conflict */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,14 +438,15 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
* @param json json reply with the signature
|
* @param json json reply with the signature
|
||||||
* @return #GNUNET_OK if the signature is valid, #GNUNET_SYSERR if not
|
* @return #GNUNET_OK if the signature is valid, #GNUNET_SYSERR if not
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
||||||
const json_t *json)
|
const json_t *json)
|
||||||
{
|
{
|
||||||
json_t *h;
|
json_t *h;
|
||||||
json_t *e;
|
json_t *e;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("history", &h),
|
GNUNET_JSON_spec_json ("history",
|
||||||
|
&h),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -445,6 +462,7 @@ verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
(1 != json_array_size (h) ) )
|
(1 != json_array_size (h) ) )
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
e = json_array_get (h, 0);
|
e = json_array_get (h, 0);
|
||||||
@ -459,7 +477,7 @@ verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
.coin_pub = rh->depconf.coin_pub
|
.coin_pub = rh->depconf.coin_pub
|
||||||
};
|
};
|
||||||
uint64_t rtransaction_id;
|
uint64_t rtransaction_id;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification ispec[] = {
|
||||||
TALER_JSON_spec_amount_any ("amount",
|
TALER_JSON_spec_amount_any ("amount",
|
||||||
&amount),
|
&amount),
|
||||||
GNUNET_JSON_spec_string ("type",
|
GNUNET_JSON_spec_string ("type",
|
||||||
@ -479,10 +497,11 @@ verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_JSON_parse (e,
|
GNUNET_JSON_parse (e,
|
||||||
spec,
|
ispec,
|
||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
rr.rtransaction_id = GNUNET_htonll (rtransaction_id);
|
rr.rtransaction_id = GNUNET_htonll (rtransaction_id);
|
||||||
@ -495,6 +514,7 @@ verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&rh->depconf.merchant.eddsa_pub))
|
&rh->depconf.merchant.eddsa_pub))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if ( (rr.rtransaction_id != rh->depconf.rtransaction_id) ||
|
if ( (rr.rtransaction_id != rh->depconf.rtransaction_id) ||
|
||||||
@ -506,9 +526,11 @@ verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&rr.refund_amount)) )
|
&rr.refund_amount)) )
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -670,6 +670,7 @@ run (void *cls,
|
|||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
TALER_TESTING_run_with_fakebank (is,
|
TALER_TESTING_run_with_fakebank (is,
|
||||||
commands,
|
commands,
|
||||||
bc.exchange_auth.wire_gateway_url);
|
bc.exchange_auth.wire_gateway_url);
|
||||||
@ -680,6 +681,8 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *const *argv)
|
char *const *argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -91,6 +91,7 @@ version_cb (void *cls,
|
|||||||
const struct TALER_AUDITOR_VersionInformation *vi,
|
const struct TALER_AUDITOR_VersionInformation *vi,
|
||||||
enum TALER_AUDITOR_VersionCompatibility compat)
|
enum TALER_AUDITOR_VersionCompatibility compat)
|
||||||
{
|
{
|
||||||
|
(void) cls;
|
||||||
(void) hr;
|
(void) hr;
|
||||||
if ( (NULL != vi) &&
|
if ( (NULL != vi) &&
|
||||||
(TALER_AUDITOR_VC_MATCH == compat) )
|
(TALER_AUDITOR_VC_MATCH == compat) )
|
||||||
@ -134,6 +135,8 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
struct GNUNET_OS_Process *proc;
|
struct GNUNET_OS_Process *proc;
|
||||||
|
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -75,6 +75,7 @@ run (void *cls,
|
|||||||
{
|
{
|
||||||
struct TALER_WireTransferIdentifierRawP wtid;
|
struct TALER_WireTransferIdentifierRawP wtid;
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
memset (&wtid, 42, sizeof (wtid));
|
memset (&wtid, 42, sizeof (wtid));
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -165,6 +166,8 @@ main (int argc,
|
|||||||
int rv;
|
int rv;
|
||||||
const char *cfgfile;
|
const char *cfgfile;
|
||||||
|
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -86,6 +86,7 @@ run (void *cls,
|
|||||||
/* Route our commands through twister. */
|
/* Route our commands through twister. */
|
||||||
struct TALER_BANK_AuthenticationData exchange_auth_twisted;
|
struct TALER_BANK_AuthenticationData exchange_auth_twisted;
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
memset (&wtid,
|
memset (&wtid,
|
||||||
0x5a,
|
0x5a,
|
||||||
sizeof (wtid));
|
sizeof (wtid));
|
||||||
@ -165,6 +166,7 @@ main (int argc,
|
|||||||
int ret;
|
int ret;
|
||||||
const char *cfgfilename;
|
const char *cfgfilename;
|
||||||
|
|
||||||
|
(void) argc;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -902,6 +902,8 @@ run (void *cls,
|
|||||||
struct TALER_TESTING_Command reserve_open_close[(RESERVE_OPEN_CLOSE_ITERATIONS
|
struct TALER_TESTING_Command reserve_open_close[(RESERVE_OPEN_CLOSE_ITERATIONS
|
||||||
* RESERVE_OPEN_CLOSE_CHUNK)
|
* RESERVE_OPEN_CLOSE_CHUNK)
|
||||||
+ 1];
|
+ 1];
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
for (unsigned int i = 0;
|
for (unsigned int i = 0;
|
||||||
i < RESERVE_OPEN_CLOSE_ITERATIONS;
|
i < RESERVE_OPEN_CLOSE_ITERATIONS;
|
||||||
i++)
|
i++)
|
||||||
@ -980,6 +982,8 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *const *argv)
|
char *const *argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -99,6 +99,7 @@ run (void *cls,
|
|||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
TALER_TESTING_run (is,
|
TALER_TESTING_run (is,
|
||||||
commands);
|
commands);
|
||||||
}
|
}
|
||||||
@ -108,6 +109,8 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *const *argv)
|
char *const *argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -79,6 +79,7 @@ run (void *cls,
|
|||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
TALER_TESTING_run (is,
|
TALER_TESTING_run (is,
|
||||||
commands);
|
commands);
|
||||||
}
|
}
|
||||||
@ -88,6 +89,8 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *const *argv)
|
char *const *argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -239,6 +239,7 @@ run (void *cls,
|
|||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
TALER_TESTING_run_with_fakebank (is,
|
TALER_TESTING_run_with_fakebank (is,
|
||||||
revocation,
|
revocation,
|
||||||
bc.exchange_auth.wire_gateway_url);
|
bc.exchange_auth.wire_gateway_url);
|
||||||
@ -249,6 +250,8 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *const *argv)
|
char *const *argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -155,7 +155,8 @@ run (void *cls,
|
|||||||
* NOTE: not all CMDs actually need the twister,
|
* NOTE: not all CMDs actually need the twister,
|
||||||
* so it may be better to move those into the "main"
|
* so it may be better to move those into the "main"
|
||||||
* lib test suite.
|
* lib test suite.
|
||||||
*/struct TALER_TESTING_Command refund[] = {
|
*/
|
||||||
|
struct TALER_TESTING_Command refund[] = {
|
||||||
CMD_TRANSFER_TO_EXCHANGE ("create-reserve-r1",
|
CMD_TRANSFER_TO_EXCHANGE ("create-reserve-r1",
|
||||||
"EUR:5.01"),
|
"EUR:5.01"),
|
||||||
CMD_EXEC_WIREWATCH ("wirewatch-r1"),
|
CMD_EXEC_WIREWATCH ("wirewatch-r1"),
|
||||||
@ -183,7 +184,6 @@ run (void *cls,
|
|||||||
MHD_HTTP_FORBIDDEN,
|
MHD_HTTP_FORBIDDEN,
|
||||||
"EUR:5",
|
"EUR:5",
|
||||||
"deposit-refund-1"),
|
"deposit-refund-1"),
|
||||||
|
|
||||||
/* This next deposit CMD is only used to provide a
|
/* This next deposit CMD is only used to provide a
|
||||||
* good merchant signature to the next (failing) refund
|
* good merchant signature to the next (failing) refund
|
||||||
* operations. */
|
* operations. */
|
||||||
@ -210,6 +210,7 @@ run (void *cls,
|
|||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if 0
|
||||||
/**
|
/**
|
||||||
* Test that we don't get errors when the keys from the exchange
|
* Test that we don't get errors when the keys from the exchange
|
||||||
* are out of date.
|
* are out of date.
|
||||||
@ -234,6 +235,7 @@ run (void *cls,
|
|||||||
MHD_HTTP_OK),
|
MHD_HTTP_OK),
|
||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
struct TALER_TESTING_Command commands[] = {
|
struct TALER_TESTING_Command commands[] = {
|
||||||
TALER_TESTING_cmd_wire_add ("add-wire-account",
|
TALER_TESTING_cmd_wire_add ("add-wire-account",
|
||||||
@ -248,11 +250,14 @@ run (void *cls,
|
|||||||
refresh_409_conflict),
|
refresh_409_conflict),
|
||||||
TALER_TESTING_cmd_batch ("refund",
|
TALER_TESTING_cmd_batch ("refund",
|
||||||
refund),
|
refund),
|
||||||
|
#if 0
|
||||||
TALER_TESTING_cmd_batch ("expired-keys",
|
TALER_TESTING_cmd_batch ("expired-keys",
|
||||||
expired_keys),
|
expired_keys),
|
||||||
|
#endif
|
||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
TALER_TESTING_run_with_fakebank (is,
|
TALER_TESTING_run_with_fakebank (is,
|
||||||
commands,
|
commands,
|
||||||
bc.exchange_auth.wire_gateway_url);
|
bc.exchange_auth.wire_gateway_url);
|
||||||
@ -280,6 +285,8 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -145,6 +145,7 @@ run (void *cls,
|
|||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
TALER_TESTING_run_with_fakebank (is,
|
TALER_TESTING_run_with_fakebank (is,
|
||||||
commands,
|
commands,
|
||||||
bc.exchange_auth.wire_gateway_url);
|
bc.exchange_auth.wire_gateway_url);
|
||||||
@ -155,6 +156,8 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *const *argv)
|
char *const *argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -231,6 +231,7 @@ run (void *cls,
|
|||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
TALER_TESTING_run_with_fakebank (is,
|
TALER_TESTING_run_with_fakebank (is,
|
||||||
commands,
|
commands,
|
||||||
bc.exchange_auth.wire_gateway_url);
|
bc.exchange_auth.wire_gateway_url);
|
||||||
@ -241,6 +242,8 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char *const *argv)
|
char *const *argv)
|
||||||
{
|
{
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
/* These environment variables get in the way... */
|
/* These environment variables get in the way... */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -143,6 +143,7 @@ run (void *cls,
|
|||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void) cls;
|
||||||
TALER_TESTING_run_with_fakebank (is,
|
TALER_TESTING_run_with_fakebank (is,
|
||||||
all,
|
all,
|
||||||
bc.exchange_auth.wire_gateway_url);
|
bc.exchange_auth.wire_gateway_url);
|
||||||
@ -155,6 +156,7 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
const char *plugin_name;
|
const char *plugin_name;
|
||||||
|
|
||||||
|
(void) argc;
|
||||||
/* these might get in the way */
|
/* these might get in the way */
|
||||||
unsetenv ("XDG_DATA_HOME");
|
unsetenv ("XDG_DATA_HOME");
|
||||||
unsetenv ("XDG_CONFIG_HOME");
|
unsetenv ("XDG_CONFIG_HOME");
|
||||||
|
@ -490,6 +490,7 @@ refresh_reveal_cleanup (void *cls,
|
|||||||
{
|
{
|
||||||
struct RefreshRevealState *rrs = cls;
|
struct RefreshRevealState *rrs = cls;
|
||||||
|
|
||||||
|
(void) cmd;
|
||||||
if (NULL != rrs->rrh)
|
if (NULL != rrs->rrh)
|
||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
@ -741,6 +742,7 @@ refresh_link_run (void *cls,
|
|||||||
const struct TALER_TESTING_Command *melt_cmd;
|
const struct TALER_TESTING_Command *melt_cmd;
|
||||||
const struct TALER_TESTING_Command *coin_cmd;
|
const struct TALER_TESTING_Command *coin_cmd;
|
||||||
|
|
||||||
|
(void) cmd;
|
||||||
rls->is = is;
|
rls->is = is;
|
||||||
reveal_cmd = TALER_TESTING_interpreter_lookup_command (rls->is,
|
reveal_cmd = TALER_TESTING_interpreter_lookup_command (rls->is,
|
||||||
rls->reveal_reference);
|
rls->reveal_reference);
|
||||||
@ -855,6 +857,11 @@ do_melt_retry (void *cls)
|
|||||||
rms->retry_task = NULL;
|
rms->retry_task = NULL;
|
||||||
rms->is->commands[rms->is->ip].last_req_time
|
rms->is->commands[rms->is->ip].last_req_time
|
||||||
= GNUNET_TIME_absolute_get ();
|
= GNUNET_TIME_absolute_get ();
|
||||||
|
if (NULL != rms->refresh_data)
|
||||||
|
{
|
||||||
|
json_decref (rms->refresh_data);
|
||||||
|
rms->refresh_data = NULL;
|
||||||
|
}
|
||||||
melt_run (rms,
|
melt_run (rms,
|
||||||
NULL,
|
NULL,
|
||||||
rms->is);
|
rms->is);
|
||||||
@ -880,6 +887,7 @@ melt_cb (void *cls,
|
|||||||
{
|
{
|
||||||
struct RefreshMeltState *rms = cls;
|
struct RefreshMeltState *rms = cls;
|
||||||
|
|
||||||
|
(void) exchange_pub;
|
||||||
rms->rmh = NULL;
|
rms->rmh = NULL;
|
||||||
if (rms->expected_response_code != hr->http_status)
|
if (rms->expected_response_code != hr->http_status)
|
||||||
{
|
{
|
||||||
@ -966,6 +974,7 @@ melt_run (void *cls,
|
|||||||
};
|
};
|
||||||
const char **melt_fresh_amounts;
|
const char **melt_fresh_amounts;
|
||||||
|
|
||||||
|
(void) cmd;
|
||||||
if (NULL == (melt_fresh_amounts = rms->melt_fresh_amounts))
|
if (NULL == (melt_fresh_amounts = rms->melt_fresh_amounts))
|
||||||
melt_fresh_amounts = default_melt_fresh_amounts;
|
melt_fresh_amounts = default_melt_fresh_amounts;
|
||||||
rms->is = is;
|
rms->is = is;
|
||||||
@ -1029,8 +1038,9 @@ melt_run (void *cls,
|
|||||||
{
|
{
|
||||||
const struct TALER_EXCHANGE_DenomPublicKey *fresh_pk;
|
const struct TALER_EXCHANGE_DenomPublicKey *fresh_pk;
|
||||||
|
|
||||||
if (GNUNET_OK != TALER_string_to_amount
|
if (GNUNET_OK !=
|
||||||
(melt_fresh_amounts[i], &fresh_amount))
|
TALER_string_to_amount (melt_fresh_amounts[i],
|
||||||
|
&fresh_amount))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
@ -1060,7 +1070,8 @@ melt_run (void *cls,
|
|||||||
/* Make a deep copy of the RSA key */
|
/* Make a deep copy of the RSA key */
|
||||||
TALER_denom_pub_deep_copy (&rms->fresh_pks[i].key,
|
TALER_denom_pub_deep_copy (&rms->fresh_pks[i].key,
|
||||||
&fresh_pk->key);
|
&fresh_pk->key);
|
||||||
}
|
} /* end for */
|
||||||
|
GNUNET_assert (NULL == rms->refresh_data);
|
||||||
rms->refresh_data
|
rms->refresh_data
|
||||||
= TALER_EXCHANGE_refresh_prepare (rms->melt_priv,
|
= TALER_EXCHANGE_refresh_prepare (rms->melt_priv,
|
||||||
&melt_amount,
|
&melt_amount,
|
||||||
@ -1102,6 +1113,7 @@ melt_cleanup (void *cls,
|
|||||||
{
|
{
|
||||||
struct RefreshMeltState *rms = cls;
|
struct RefreshMeltState *rms = cls;
|
||||||
|
|
||||||
|
(void) cmd;
|
||||||
if (NULL != rms->rmh)
|
if (NULL != rms->rmh)
|
||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
|
@ -118,6 +118,7 @@ key_cb (void *cls,
|
|||||||
const struct TALER_SecurityModulePublicKeyP *sm_pub,
|
const struct TALER_SecurityModulePublicKeyP *sm_pub,
|
||||||
const struct TALER_SecurityModuleSignatureP *sm_sig)
|
const struct TALER_SecurityModuleSignatureP *sm_sig)
|
||||||
{
|
{
|
||||||
|
(void) cls;
|
||||||
(void) sm_pub;
|
(void) sm_pub;
|
||||||
(void) sm_sig;
|
(void) sm_sig;
|
||||||
if (0 == validity_duration.rel_value_us)
|
if (0 == validity_duration.rel_value_us)
|
||||||
|
@ -98,6 +98,22 @@ struct KeyData
|
|||||||
static struct KeyData keys[MAX_KEYS];
|
static struct KeyData keys[MAX_KEYS];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release memory occupied by #keys.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
free_keys (void)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i<MAX_KEYS; i++)
|
||||||
|
if (keys[i].valid)
|
||||||
|
{
|
||||||
|
TALER_denom_pub_free (&keys[i].denom_pub);
|
||||||
|
GNUNET_assert (num_keys > 0);
|
||||||
|
num_keys--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with information about available keys for signing. Usually
|
* Function called with information about available keys for signing. Usually
|
||||||
* only called once per key upon connect. Also called again in case a key is
|
* only called once per key upon connect. Also called again in case a key is
|
||||||
@ -127,6 +143,7 @@ key_cb (void *cls,
|
|||||||
const struct TALER_SecurityModulePublicKeyP *sm_pub,
|
const struct TALER_SecurityModulePublicKeyP *sm_pub,
|
||||||
const struct TALER_SecurityModuleSignatureP *sm_sig)
|
const struct TALER_SecurityModuleSignatureP *sm_sig)
|
||||||
{
|
{
|
||||||
|
(void) cls;
|
||||||
(void) sm_pub;
|
(void) sm_pub;
|
||||||
(void) sm_sig;
|
(void) sm_sig;
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
@ -472,9 +489,6 @@ par_signing (struct GNUNET_CONFIGURATION_Handle *cfg)
|
|||||||
for (unsigned int i = 0; i<NUM_CORES; i++)
|
for (unsigned int i = 0; i<NUM_CORES; i++)
|
||||||
{
|
{
|
||||||
pids[i] = fork ();
|
pids[i] = fork ();
|
||||||
memset (keys,
|
|
||||||
0,
|
|
||||||
sizeof (keys));
|
|
||||||
num_keys = 0;
|
num_keys = 0;
|
||||||
GNUNET_assert (-1 != pids[i]);
|
GNUNET_assert (-1 != pids[i]);
|
||||||
if (0 == pids[i])
|
if (0 == pids[i])
|
||||||
@ -488,6 +502,7 @@ par_signing (struct GNUNET_CONFIGURATION_Handle *cfg)
|
|||||||
ret = perf_signing (dh,
|
ret = perf_signing (dh,
|
||||||
"parallel");
|
"parallel");
|
||||||
TALER_CRYPTO_helper_rsa_disconnect (dh);
|
TALER_CRYPTO_helper_rsa_disconnect (dh);
|
||||||
|
free_keys ();
|
||||||
exit (ret);
|
exit (ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -571,16 +586,10 @@ run_test (void)
|
|||||||
ret = perf_signing (dh,
|
ret = perf_signing (dh,
|
||||||
"sequential");
|
"sequential");
|
||||||
TALER_CRYPTO_helper_rsa_disconnect (dh);
|
TALER_CRYPTO_helper_rsa_disconnect (dh);
|
||||||
|
free_keys ();
|
||||||
if (0 == ret)
|
if (0 == ret)
|
||||||
ret = par_signing (cfg);
|
ret = par_signing (cfg);
|
||||||
/* clean up our state */
|
/* clean up our state */
|
||||||
for (unsigned int i = 0; i<MAX_KEYS; i++)
|
|
||||||
if (keys[i].valid)
|
|
||||||
{
|
|
||||||
TALER_denom_pub_free (&keys[i].denom_pub);
|
|
||||||
GNUNET_assert (num_keys > 0);
|
|
||||||
num_keys--;
|
|
||||||
}
|
|
||||||
GNUNET_CONFIGURATION_destroy (cfg);
|
GNUNET_CONFIGURATION_destroy (cfg);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user