code cleanup (comments, scoping, naming, indentation)

This commit is contained in:
Christian Grothoff 2020-03-07 00:28:07 +01:00
parent 82d7b63ff5
commit ffcadbff8c
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
23 changed files with 1515 additions and 1688 deletions

@ -1 +1 @@
Subproject commit ca53235ccfa0458ebf11c204888ca370e20ec3f5 Subproject commit 934a6a18301e81c4fd1b3a8cda2dc13dca4741cc

View File

@ -190,8 +190,8 @@ main (int argc,
struct TALER_AuditorSignatureP *sigs; struct TALER_AuditorSignatureP *sigs;
struct TALER_AuditorPublicKeyP apub; struct TALER_AuditorPublicKeyP apub;
struct GNUNET_DISK_FileHandle *fh; struct GNUNET_DISK_FileHandle *fh;
struct TALER_DenominationKeyValidityPS *dks; struct TALER_DenominationKeyValidityPS *dki;
unsigned int dks_len; unsigned int dki_len;
struct TALER_ExchangeKeyValidityPS kv; struct TALER_ExchangeKeyValidityPS kv;
off_t in_size; off_t in_size;
@ -287,8 +287,8 @@ main (int argc,
GNUNET_free (eddsa_priv); GNUNET_free (eddsa_priv);
return 1; return 1;
} }
dks_len = in_size / sizeof (struct TALER_DenominationKeyValidityPS); dki_len = in_size / sizeof (struct TALER_DenominationKeyValidityPS);
if (0 == dks_len) if (0 == dki_len)
{ {
fprintf (stderr, fprintf (stderr,
"Failed to produce auditor signature, denomination list is empty.\n"); "Failed to produce auditor signature, denomination list is empty.\n");
@ -312,13 +312,13 @@ main (int argc,
strlen (auditor_url) + 1, strlen (auditor_url) + 1,
&kv.auditor_url_hash); &kv.auditor_url_hash);
kv.master = master_public_key; kv.master = master_public_key;
dks = GNUNET_new_array (dks_len, dki = GNUNET_new_array (dki_len,
struct TALER_DenominationKeyValidityPS); struct TALER_DenominationKeyValidityPS);
sigs = GNUNET_new_array (dks_len, sigs = GNUNET_new_array (dki_len,
struct TALER_AuditorSignatureP); struct TALER_AuditorSignatureP);
if (in_size != if (in_size !=
GNUNET_DISK_file_read (fh, GNUNET_DISK_file_read (fh,
dks, dki,
in_size)) in_size))
{ {
fprintf (stderr, fprintf (stderr,
@ -328,14 +328,14 @@ main (int argc,
TALER_AUDITORDB_plugin_unload (adb); TALER_AUDITORDB_plugin_unload (adb);
GNUNET_DISK_file_close (fh); GNUNET_DISK_file_close (fh);
GNUNET_free (sigs); GNUNET_free (sigs);
GNUNET_free (dks); GNUNET_free (dki);
GNUNET_free (eddsa_priv); GNUNET_free (eddsa_priv);
return 1; return 1;
} }
GNUNET_DISK_file_close (fh); GNUNET_DISK_file_close (fh);
for (unsigned int i = 0; i<dks_len; i++) for (unsigned int i = 0; i<dki_len; i++)
{ {
struct TALER_DenominationKeyValidityPS *dk = &dks[i]; struct TALER_DenominationKeyValidityPS *dk = &dki[i];
if (verbose) if (verbose)
print_dk (dk); print_dk (dk);
@ -362,7 +362,7 @@ main (int argc,
fprintf (stderr, fprintf (stderr,
"Output file not given\n"); "Output file not given\n");
TALER_AUDITORDB_plugin_unload (adb); TALER_AUDITORDB_plugin_unload (adb);
GNUNET_free (dks); GNUNET_free (dki);
GNUNET_free (sigs); GNUNET_free (sigs);
GNUNET_free (eddsa_priv); GNUNET_free (eddsa_priv);
return 1; return 1;
@ -375,7 +375,7 @@ main (int argc,
fprintf (stderr, fprintf (stderr,
"Failed to create tables in auditor's database\n"); "Failed to create tables in auditor's database\n");
TALER_AUDITORDB_plugin_unload (adb); TALER_AUDITORDB_plugin_unload (adb);
GNUNET_free (dks); GNUNET_free (dki);
GNUNET_free (sigs); GNUNET_free (sigs);
GNUNET_free (eddsa_priv); GNUNET_free (eddsa_priv);
return 3; return 3;
@ -396,14 +396,14 @@ main (int argc,
fprintf (stderr, fprintf (stderr,
"Failed to initialize database session\n"); "Failed to initialize database session\n");
TALER_AUDITORDB_plugin_unload (adb); TALER_AUDITORDB_plugin_unload (adb);
GNUNET_free (dks); GNUNET_free (dki);
GNUNET_free (sigs); GNUNET_free (sigs);
GNUNET_free (eddsa_priv); GNUNET_free (eddsa_priv);
return 3; return 3;
} }
for (unsigned int i = 0; i<dks_len; i++) for (unsigned int i = 0; i<dki_len; i++)
{ {
const struct TALER_DenominationKeyValidityPS *dk = &dks[i]; const struct TALER_DenominationKeyValidityPS *dk = &dki[i];
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Adding denomination key %s to auditor database\n", "Adding denomination key %s to auditor database\n",
@ -416,7 +416,7 @@ main (int argc,
fprintf (stderr, fprintf (stderr,
"Failed to store key in auditor DB (did you add the exchange using taler-auditor-exchange first?)\n"); "Failed to store key in auditor DB (did you add the exchange using taler-auditor-exchange first?)\n");
TALER_AUDITORDB_plugin_unload (adb); TALER_AUDITORDB_plugin_unload (adb);
GNUNET_free (dks); GNUNET_free (dki);
GNUNET_free (sigs); GNUNET_free (sigs);
GNUNET_free (eddsa_priv); GNUNET_free (eddsa_priv);
return 3; return 3;
@ -432,19 +432,19 @@ main (int argc,
auditor_url, auditor_url,
sigs, sigs,
&master_public_key, &master_public_key,
dks_len, dki_len,
dks)) dki))
{ {
fprintf (stderr, fprintf (stderr,
"Failed to write to file `%s': %s\n", "Failed to write to file `%s': %s\n",
output_file, output_file,
strerror (errno)); strerror (errno));
GNUNET_free (sigs); GNUNET_free (sigs);
GNUNET_free (dks); GNUNET_free (dki);
return 1; return 1;
} }
GNUNET_free (sigs); GNUNET_free (sigs);
GNUNET_free (dks); GNUNET_free (dki);
GNUNET_free (eddsa_priv); GNUNET_free (eddsa_priv);
return 0; return 0;
} }

View File

@ -1080,10 +1080,10 @@ postgres_list_exchanges (void *cls,
* @return query result status * @return query result status
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_exchange_signkey (void *cls, postgres_insert_exchange_signkey (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_AUDITORDB_ExchangeSigningKey *sk)
TALER_AUDITORDB_ExchangeSigningKey *sk)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (&sk->master_public_key), GNUNET_PQ_query_param_auto_from_type (&sk->master_public_key),
@ -1111,10 +1111,10 @@ postgres_insert_exchange_signkey (void *cls,
* @return query result status * @return query result status
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_deposit_confirmation (void *cls, postgres_insert_deposit_confirmation (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_AUDITORDB_DepositConfirmation *dc)
TALER_AUDITORDB_DepositConfirmation *dc)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (&dc->master_public_key), GNUNET_PQ_query_param_auto_from_type (&dc->master_public_key),
@ -1250,13 +1250,12 @@ deposit_confirmation_cb (void *cls,
* @return query result status * @return query result status
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_deposit_confirmations (void *cls, postgres_get_deposit_confirmations (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_public_key,
TALER_MasterPublicKeyP *master_public_key,
uint64_t start_id, uint64_t start_id,
TALER_AUDITORDB_DepositConfirmationCallback TALER_AUDITORDB_DepositConfirmationCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -1296,10 +1295,10 @@ postgres_get_deposit_confirmations (void *cls,
* @return operation status result * @return operation status result
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_denomination_info (void *cls, postgres_insert_denomination_info (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_DenominationKeyValidityPS *issue)
TALER_DenominationKeyValidityPS *issue)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (&issue->denom_hash), GNUNET_PQ_query_param_auto_from_type (&issue->denom_hash),
@ -1438,12 +1437,11 @@ denomination_info_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_denomination_info (void *cls, postgres_select_denomination_info (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, TALER_AUDITORDB_DenominationInfoDataCallback cb,
TALER_AUDITORDB_DenominationInfoDataCallback
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -1483,14 +1481,11 @@ postgres_select_denomination_info (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_auditor_progress_reserve (void *cls, postgres_insert_auditor_progress_reserve (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointReserve *ppr)
const struct
TALER_AUDITORDB_ProgressPointReserve *
ppr)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -1519,14 +1514,11 @@ postgres_insert_auditor_progress_reserve (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_auditor_progress_reserve (void *cls, postgres_update_auditor_progress_reserve (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointReserve *ppr)
const struct
TALER_AUDITORDB_ProgressPointReserve *
ppr)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&ppr->last_reserve_in_serial_id), GNUNET_PQ_query_param_uint64 (&ppr->last_reserve_in_serial_id),
@ -1554,12 +1546,11 @@ postgres_update_auditor_progress_reserve (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_auditor_progress_reserve (void *cls, postgres_get_auditor_progress_reserve (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, struct TALER_AUDITORDB_ProgressPointReserve *ppr)
struct
TALER_AUDITORDB_ProgressPointReserve *ppr)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -1596,14 +1587,11 @@ postgres_get_auditor_progress_reserve (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_auditor_progress_aggregation (void *cls, postgres_insert_auditor_progress_aggregation (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointAggregation *ppa)
const struct
TALER_AUDITORDB_ProgressPointAggregation
*ppa)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -1629,14 +1617,11 @@ postgres_insert_auditor_progress_aggregation (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_auditor_progress_aggregation (void *cls, postgres_update_auditor_progress_aggregation (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointAggregation *ppa)
const struct
TALER_AUDITORDB_ProgressPointAggregation
*ppa)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&ppa->last_wire_out_serial_id), GNUNET_PQ_query_param_uint64 (&ppa->last_wire_out_serial_id),
@ -1661,14 +1646,11 @@ postgres_update_auditor_progress_aggregation (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_auditor_progress_aggregation (void *cls, postgres_get_auditor_progress_aggregation (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, struct TALER_AUDITORDB_ProgressPointAggregation *ppa)
struct
TALER_AUDITORDB_ProgressPointAggregation
*ppa)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -1699,16 +1681,11 @@ postgres_get_auditor_progress_aggregation (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_auditor_progress_deposit_confirmation (void *cls, postgres_insert_auditor_progress_deposit_confirmation (
struct void *cls,
TALER_AUDITORDB_Session * struct TALER_AUDITORDB_Session *session,
session, const struct TALER_MasterPublicKeyP *master_pub,
const struct const struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc)
TALER_MasterPublicKeyP *
master_pub,
const struct
TALER_AUDITORDB_ProgressPointDepositConfirmation
*ppdc)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -1734,16 +1711,11 @@ postgres_insert_auditor_progress_deposit_confirmation (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_auditor_progress_deposit_confirmation (void *cls, postgres_update_auditor_progress_deposit_confirmation (
struct void *cls,
TALER_AUDITORDB_Session * struct TALER_AUDITORDB_Session *session,
session, const struct TALER_MasterPublicKeyP *master_pub,
const struct const struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc)
TALER_MasterPublicKeyP *
master_pub,
const struct
TALER_AUDITORDB_ProgressPointDepositConfirmation
*ppdc)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&ppdc->last_deposit_confirmation_serial_id), GNUNET_PQ_query_param_uint64 (&ppdc->last_deposit_confirmation_serial_id),
@ -1768,16 +1740,11 @@ postgres_update_auditor_progress_deposit_confirmation (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_auditor_progress_deposit_confirmation (void *cls, postgres_get_auditor_progress_deposit_confirmation (
struct void *cls,
TALER_AUDITORDB_Session * struct TALER_AUDITORDB_Session *session,
session, const struct TALER_MasterPublicKeyP *master_pub,
const struct struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc)
TALER_MasterPublicKeyP *
master_pub,
struct
TALER_AUDITORDB_ProgressPointDepositConfirmation
*ppdc)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -1808,12 +1775,11 @@ postgres_get_auditor_progress_deposit_confirmation (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_auditor_progress_coin (void *cls, postgres_insert_auditor_progress_coin (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointCoin *ppc)
const struct
TALER_AUDITORDB_ProgressPointCoin *ppc)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -1844,12 +1810,11 @@ postgres_insert_auditor_progress_coin (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_auditor_progress_coin (void *cls, postgres_update_auditor_progress_coin (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointCoin *ppc)
const struct
TALER_AUDITORDB_ProgressPointCoin *ppc)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&ppc->last_withdraw_serial_id), GNUNET_PQ_query_param_uint64 (&ppc->last_withdraw_serial_id),
@ -1879,12 +1844,11 @@ postgres_update_auditor_progress_coin (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_auditor_progress_coin (void *cls, postgres_get_auditor_progress_coin (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, struct TALER_AUDITORDB_ProgressPointCoin *ppc)
struct TALER_AUDITORDB_ProgressPointCoin *
ppc)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -1928,16 +1892,12 @@ postgres_get_auditor_progress_coin (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_wire_auditor_account_progress (void *cls, postgres_insert_wire_auditor_account_progress (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *
master_pub,
const char *account_name, const char *account_name,
const struct const struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
TALER_AUDITORDB_WireAccountProgressPoint
*pp,
uint64_t in_wire_off, uint64_t in_wire_off,
uint64_t out_wire_off) uint64_t out_wire_off)
{ {
@ -1972,16 +1932,12 @@ postgres_insert_wire_auditor_account_progress (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_wire_auditor_account_progress (void *cls, postgres_update_wire_auditor_account_progress (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *
master_pub,
const char *account_name, const char *account_name,
const struct const struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
TALER_AUDITORDB_WireAccountProgressPoint
*pp,
uint64_t in_wire_off, uint64_t in_wire_off,
uint64_t out_wire_off) uint64_t out_wire_off)
{ {
@ -2015,15 +1971,12 @@ postgres_update_wire_auditor_account_progress (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_wire_auditor_account_progress (void *cls, postgres_get_wire_auditor_account_progress (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const char *account_name, const char *account_name,
struct struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
TALER_AUDITORDB_WireAccountProgressPoint
*pp,
uint64_t *in_wire_off, uint64_t *in_wire_off,
uint64_t *out_wire_off) uint64_t *out_wire_off)
{ {
@ -2063,12 +2016,11 @@ postgres_get_wire_auditor_account_progress (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_wire_auditor_progress (void *cls, postgres_insert_wire_auditor_progress (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_WireProgressPoint *pp)
const struct
TALER_AUDITORDB_WireProgressPoint *pp)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -2095,12 +2047,11 @@ postgres_insert_wire_auditor_progress (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_wire_auditor_progress (void *cls, postgres_update_wire_auditor_progress (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_WireProgressPoint *pp)
const struct
TALER_AUDITORDB_WireProgressPoint *pp)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
TALER_PQ_query_param_absolute_time (&pp->last_timestamp), TALER_PQ_query_param_absolute_time (&pp->last_timestamp),
@ -2126,10 +2077,10 @@ postgres_update_wire_auditor_progress (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_wire_auditor_progress (void *cls, postgres_get_wire_auditor_progress (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
struct TALER_AUDITORDB_WireProgressPoint *pp) struct TALER_AUDITORDB_WireProgressPoint *pp)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
@ -2331,13 +2282,12 @@ postgres_get_reserve_info (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_reserve_summary (void *cls, postgres_insert_reserve_summary (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *reserve_balance, const struct TALER_Amount *reserve_balance,
const struct const struct TALER_Amount *withdraw_fee_balance)
TALER_Amount *withdraw_fee_balance)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -2370,13 +2320,12 @@ postgres_insert_reserve_summary (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_reserve_summary (void *cls, postgres_update_reserve_summary (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *reserve_balance, const struct TALER_Amount *reserve_balance,
const struct const struct TALER_Amount *withdraw_fee_balance)
TALER_Amount *withdraw_fee_balance)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
TALER_PQ_query_param_amount (reserve_balance), TALER_PQ_query_param_amount (reserve_balance),
@ -2441,10 +2390,10 @@ postgres_get_reserve_summary (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_wire_fee_summary (void *cls, postgres_insert_wire_fee_summary (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *wire_fee_balance) const struct TALER_Amount *wire_fee_balance)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
@ -2471,10 +2420,10 @@ postgres_insert_wire_fee_summary (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_wire_fee_summary (void *cls, postgres_update_wire_fee_summary (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *wire_fee_balance) const struct TALER_Amount *wire_fee_balance)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
@ -2539,10 +2488,10 @@ postgres_get_wire_fee_summary (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_denomination_balance (void *cls, postgres_insert_denomination_balance (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct GNUNET_HashCode *denom_pub_hash,
GNUNET_HashCode *denom_pub_hash,
const struct TALER_Amount *denom_balance, const struct TALER_Amount *denom_balance,
const struct TALER_Amount *denom_loss, const struct TALER_Amount *denom_loss,
const struct TALER_Amount *denom_risk, const struct TALER_Amount *denom_risk,
@ -2581,10 +2530,10 @@ postgres_insert_denomination_balance (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_denomination_balance (void *cls, postgres_update_denomination_balance (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct GNUNET_HashCode *denom_pub_hash,
GNUNET_HashCode *denom_pub_hash,
const struct TALER_Amount *denom_balance, const struct TALER_Amount *denom_balance,
const struct TALER_Amount *denom_loss, const struct TALER_Amount *denom_loss,
const struct TALER_Amount *denom_risk, const struct TALER_Amount *denom_risk,
@ -2670,10 +2619,10 @@ postgres_get_denomination_balance (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_balance_summary (void *cls, postgres_insert_balance_summary (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *denom_balance, const struct TALER_Amount *denom_balance,
const struct TALER_Amount *deposit_fee_balance, const struct TALER_Amount *deposit_fee_balance,
const struct TALER_Amount *melt_fee_balance, const struct TALER_Amount *melt_fee_balance,
@ -2729,10 +2678,10 @@ postgres_insert_balance_summary (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_balance_summary (void *cls, postgres_update_balance_summary (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *denom_balance, const struct TALER_Amount *denom_balance,
const struct TALER_Amount *deposit_fee_balance, const struct TALER_Amount *deposit_fee_balance,
const struct TALER_Amount *melt_fee_balance, const struct TALER_Amount *melt_fee_balance,
@ -2826,16 +2775,13 @@ postgres_get_balance_summary (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_historic_denom_revenue (void *cls, postgres_insert_historic_denom_revenue (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct GNUNET_HashCode *denom_pub_hash,
const struct struct GNUNET_TIME_Absolute revenue_timestamp,
GNUNET_HashCode *denom_pub_hash, const struct TALER_Amount *revenue_balance,
struct GNUNET_TIME_Absolute
revenue_timestamp,
const struct
TALER_Amount *revenue_balance,
const struct TALER_Amount *loss_balance) const struct TALER_Amount *loss_balance)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
@ -2947,12 +2893,11 @@ historic_denom_revenue_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_historic_denom_revenue (void *cls, postgres_select_historic_denom_revenue (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, TALER_AUDITORDB_HistoricDenominationRevenueDataCallback cb,
TALER_AUDITORDB_HistoricDenominationRevenueDataCallback
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -2990,16 +2935,13 @@ postgres_select_historic_denom_revenue (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_historic_reserve_revenue (void *cls, postgres_insert_historic_reserve_revenue (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, struct GNUNET_TIME_Absolute start_time,
struct GNUNET_TIME_Absolute
start_time,
struct GNUNET_TIME_Absolute end_time, struct GNUNET_TIME_Absolute end_time,
const struct const struct TALER_Amount *reserve_profits)
TALER_Amount *reserve_profits)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (master_pub),
@ -3103,13 +3045,11 @@ historic_reserve_revenue_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_historic_reserve_revenue (void *cls, postgres_select_historic_reserve_revenue (
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, TALER_AUDITORDB_HistoricReserveRevenueDataCallback cb,
TALER_AUDITORDB_HistoricReserveRevenueDataCallback
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -3146,10 +3086,10 @@ postgres_select_historic_reserve_revenue (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_predicted_result (void *cls, postgres_insert_predicted_result (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *balance) const struct TALER_Amount *balance)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
@ -3176,10 +3116,10 @@ postgres_insert_predicted_result (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_update_predicted_result (void *cls, postgres_update_predicted_result (
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const struct TALER_Amount *balance) const struct TALER_Amount *balance)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {

View File

@ -172,10 +172,10 @@ handle_admin_add_incoming_finished (void *cls,
* In this case, the callback is not called. * In this case, the callback is not called.
*/ */
struct TALER_BANK_AdminAddIncomingHandle * struct TALER_BANK_AdminAddIncomingHandle *
TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx, TALER_BANK_admin_add_incoming (
struct GNUNET_CURL_Context *ctx,
const struct TALER_BANK_AuthenticationData *auth, const struct TALER_BANK_AuthenticationData *auth,
const struct const struct TALER_ReservePublicKeyP *reserve_pub,
TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const char *debit_account, const char *debit_account,
TALER_BANK_AdminAddIncomingCallback res_cb, TALER_BANK_AdminAddIncomingCallback res_cb,
@ -257,8 +257,8 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx,
* @param aai the admin add incoming request handle * @param aai the admin add incoming request handle
*/ */
void void
TALER_BANK_admin_add_incoming_cancel (struct TALER_BANK_admin_add_incoming_cancel (
TALER_BANK_AdminAddIncomingHandle *aai) struct TALER_BANK_AdminAddIncomingHandle *aai)
{ {
if (NULL != aai->job) if (NULL != aai->job)
{ {

View File

@ -78,11 +78,11 @@ GNUNET_NETWORK_STRUCT_END
* @param[out] buf_size set to number of bytes in @a buf, 0 on error * @param[out] buf_size set to number of bytes in @a buf, 0 on error
*/ */
void void
TALER_BANK_prepare_transfer (const char *destination_account_payto_uri, TALER_BANK_prepare_transfer (
const char *destination_account_payto_uri,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const char *exchange_base_url, const char *exchange_base_url,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *wtid,
void **buf, void **buf,
size_t *buf_size) size_t *buf_size)
{ {
@ -259,9 +259,9 @@ handle_transfer_finished (void *cls,
* @return NULL on error * @return NULL on error
*/ */
struct TALER_BANK_TransferHandle * struct TALER_BANK_TransferHandle *
TALER_BANK_transfer (struct GNUNET_CURL_Context *ctx, TALER_BANK_transfer (
const struct struct GNUNET_CURL_Context *ctx,
TALER_BANK_AuthenticationData *auth, const struct TALER_BANK_AuthenticationData *auth,
const void *buf, const void *buf,
size_t buf_size, size_t buf_size,
TALER_BANK_TransferCallback cc, TALER_BANK_TransferCallback cc,
@ -376,8 +376,7 @@ TALER_BANK_transfer (struct GNUNET_CURL_Context *ctx,
* @param th the wire transfer request handle * @param th the wire transfer request handle
*/ */
void void
TALER_BANK_transfer_cancel (struct TALER_BANK_transfer_cancel (struct TALER_BANK_TransferHandle *th)
TALER_BANK_TransferHandle *th)
{ {
if (NULL != th->job) if (NULL != th->job)
{ {

View File

@ -348,12 +348,12 @@ TALER_FAKEBANK_check_credit (struct TALER_FAKEBANK_Handle *h,
* #GNUNET_SYSERR if the request_uid was reused for a different transfer * #GNUNET_SYSERR if the request_uid was reused for a different transfer
*/ */
int int
TALER_FAKEBANK_make_transfer (struct TALER_FAKEBANK_Handle *h, TALER_FAKEBANK_make_transfer (
struct TALER_FAKEBANK_Handle *h,
const char *debit_account, const char *debit_account,
const char *credit_account, const char *credit_account,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct const struct TALER_WireTransferIdentifierRawP *subject,
TALER_WireTransferIdentifierRawP *subject,
const char *exchange_base_url, const char *exchange_base_url,
const struct GNUNET_HashCode *request_uid, const struct GNUNET_HashCode *request_uid,
uint64_t *ret_row_id) uint64_t *ret_row_id)
@ -433,12 +433,12 @@ TALER_FAKEBANK_make_transfer (struct TALER_FAKEBANK_Handle *h,
* @return serial_id of the transfer * @return serial_id of the transfer
*/ */
uint64_t uint64_t
TALER_FAKEBANK_make_admin_transfer (struct TALER_FAKEBANK_Handle *h, TALER_FAKEBANK_make_admin_transfer (
struct TALER_FAKEBANK_Handle *h,
const char *debit_account, const char *debit_account,
const char *credit_account, const char *credit_account,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct const struct TALER_ReservePublicKeyP *reserve_pub)
TALER_ReservePublicKeyP *reserve_pub)
{ {
struct Transaction *t; struct Transaction *t;

View File

@ -45,12 +45,12 @@ struct FindAccountContext
/** /**
* Check if @a section begins with "exchange-wire-", and if * Check if @a section begins with "exchange-account-", and if so if the
* so if the "ENABLE" option is set to "YES". If both are * "PAYTO_URI" is given. If not, a warning is printed, otherwise we also check
* true, call the callback from the context with the * if "ENABLE_CREDIT" or "ENABLE_DEBIT" options are set to "YES" and then call
* rest of the section name. * the callback in @a cls with all of the information gathered.
* *
* @param cls our `struct FindEnabledWireContext` * @param cls our `struct FindAccountContext`
* @param section name of a section in the configuration * @param section name of a section in the configuration
*/ */
static void static void

View File

@ -97,24 +97,34 @@ auditor_iter (void *cls,
const struct TALER_AuditorSignatureP *sigs; const struct TALER_AuditorSignatureP *sigs;
const struct TALER_DenominationKeyValidityPS *dki; const struct TALER_DenominationKeyValidityPS *dki;
const char *auditor_url; const char *auditor_url;
unsigned int dki_len; uint32_t dki_len;
size_t url_len; size_t url_len;
int iret; int iret;
if (GNUNET_OK != GNUNET_DISK_file_size (filename, if (GNUNET_OK !=
GNUNET_DISK_file_size (filename,
&size, &size,
GNUNET_YES, GNUNET_YES,
GNUNET_YES)) GNUNET_YES))
{ {
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Skipping inaccessable auditor information file `%s'\n", "Skipping inaccessable auditor information file `%s'\n",
filename); filename);
return GNUNET_OK; return GNUNET_OK;
} }
if (size < sizeof (struct AuditorFileHeaderP)) if (size < sizeof (struct AuditorFileHeaderP))
{ {
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Unrecognized size for file `%s', skipping\n", "File size (%llu bytes) too small for file `%s' to contain auditor data. Skipping it.\n",
(unsigned long long) size,
filename);
return GNUNET_OK;
}
if (size >= GNUNET_MAX_MALLOC_CHECKED)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"File size (%llu bytes) too large for file `%s' to contain auditor data. Skipping it.\n",
(unsigned long long) size,
filename); filename);
return GNUNET_OK; return GNUNET_OK;
} }
@ -140,35 +150,33 @@ auditor_iter (void *cls,
GNUNET_free (af); GNUNET_free (af);
return GNUNET_OK; return GNUNET_OK;
} }
if ( (size - sizeof (struct AuditorFileHeaderP)) / dki_len < size -= sizeof (struct AuditorFileHeaderP);
if ( (size / dki_len) <=
(sizeof (struct TALER_DenominationKeyValidityPS) (sizeof (struct TALER_DenominationKeyValidityPS)
+ sizeof (struct TALER_AuditorSignatureP)) ) + sizeof (struct TALER_AuditorSignatureP)) )
{ {
GNUNET_break_op (0); GNUNET_break_op (0);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Malformed key file %s\n", "Malformed auditor data file %s (file too short for %u keys)\n",
filename); filename,
(unsigned int) dki_len);
GNUNET_free (af); GNUNET_free (af);
return GNUNET_OK; return GNUNET_OK;
} }
url_len = size url_len = size - dki_len * (sizeof (struct TALER_DenominationKeyValidityPS)
- sizeof (struct AuditorFileHeaderP)
- dki_len * (sizeof (struct TALER_DenominationKeyValidityPS)
+ sizeof (struct TALER_AuditorSignatureP)); + sizeof (struct TALER_AuditorSignatureP));
sigs = (const struct TALER_AuditorSignatureP *) &af[1]; sigs = (const struct TALER_AuditorSignatureP *) &af[1];
dki = (const struct TALER_DenominationKeyValidityPS *) &sigs[dki_len]; dki = (const struct TALER_DenominationKeyValidityPS *) &sigs[dki_len];
auditor_url = (const char *) &dki[dki_len]; auditor_url = (const char *) &dki[dki_len];
if ( (0 == url_len) || if ('\0' != auditor_url[url_len - 1])
('\0' != auditor_url[url_len - 1]) )
{ {
GNUNET_break_op (0); GNUNET_break_op (0);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Malformed key file %s\n", "Malformed auditor data file %s (no 0-terminator)\n",
filename); filename);
GNUNET_free (af); GNUNET_free (af);
return GNUNET_OK; return GNUNET_OK;
} }
/* Ignoring return value to not interrupt the iteration */
if (GNUNET_OK != if (GNUNET_OK !=
(iret = aic->it (aic->it_cls, (iret = aic->it (aic->it_cls,
&af->apub, &af->apub,
@ -242,64 +250,93 @@ TALER_EXCHANGEDB_auditor_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure. * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/ */
int int
TALER_EXCHANGEDB_auditor_write (const char *filename, TALER_EXCHANGEDB_auditor_write (
const char *filename,
const struct TALER_AuditorPublicKeyP *apub, const struct TALER_AuditorPublicKeyP *apub,
const char *auditor_url, const char *auditor_url,
const struct TALER_AuditorSignatureP *asigs, const struct TALER_AuditorSignatureP *asigs,
const struct TALER_MasterPublicKeyP *mpub, const struct TALER_MasterPublicKeyP *mpub,
unsigned int dki_len, uint32_t dki_len,
const struct const struct TALER_DenominationKeyValidityPS *dki)
TALER_DenominationKeyValidityPS *dki)
{ {
struct AuditorFileHeaderP af;
struct GNUNET_DISK_FileHandle *fh; struct GNUNET_DISK_FileHandle *fh;
ssize_t wrote; ssize_t wrote;
size_t wsize; size_t wsize;
int ret;
int eno; int eno;
af.apub = *apub; if (GNUNET_OK !=
af.mpub = *mpub; GNUNET_DISK_directory_create_for_file (filename))
af.dki_len = htonl ((uint32_t) dki_len); {
ret = GNUNET_SYSERR; eno = errno;
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"mkdir (for file)",
filename);
errno = eno;
return GNUNET_SYSERR;
}
if (NULL == (fh = GNUNET_DISK_file_open if (NULL == (fh = GNUNET_DISK_file_open
(filename, (filename,
GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE
| GNUNET_DISK_OPEN_TRUNCATE, | GNUNET_DISK_OPEN_TRUNCATE,
GNUNET_DISK_PERM_USER_READ GNUNET_DISK_PERM_USER_READ
| GNUNET_DISK_PERM_USER_WRITE))) | GNUNET_DISK_PERM_USER_WRITE)))
goto cleanup; {
eno = errno;
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"open",
filename);
errno = eno;
return GNUNET_SYSERR;
}
{
struct AuditorFileHeaderP af = {
.apub = *apub,
.mpub = *mpub,
.dki_len = htonl (dki_len)
};
wsize = sizeof (struct AuditorFileHeaderP); wsize = sizeof (struct AuditorFileHeaderP);
if (GNUNET_SYSERR == (wrote = GNUNET_DISK_file_write (fh, if ( (GNUNET_SYSERR == (wrote = GNUNET_DISK_file_write (fh,
&af, &af,
wsize))) wsize))) ||
goto cleanup; (wrote != (ssize_t) wsize) )
if (wrote != (ssize_t) wsize)
goto cleanup; goto cleanup;
}
wsize = dki_len * sizeof (struct TALER_AuditorSignatureP); wsize = dki_len * sizeof (struct TALER_AuditorSignatureP);
if (((ssize_t) wsize) == if (((ssize_t) wsize) !=
GNUNET_DISK_file_write (fh, GNUNET_DISK_file_write (fh,
asigs, asigs,
wsize)) wsize))
ret = GNUNET_OK; goto cleanup;
wsize = dki_len * sizeof (struct TALER_DenominationKeyValidityPS); wsize = dki_len * sizeof (struct TALER_DenominationKeyValidityPS);
if (((ssize_t) wsize) == if (((ssize_t) wsize) !=
GNUNET_DISK_file_write (fh, GNUNET_DISK_file_write (fh,
dki, dki,
wsize)) wsize))
ret = GNUNET_OK; goto cleanup;
wsize = strlen (auditor_url) + 1; wsize = strlen (auditor_url) + 1;
if (((ssize_t) wsize) == if (((ssize_t) wsize) !=
GNUNET_DISK_file_write (fh, GNUNET_DISK_file_write (fh,
auditor_url, auditor_url,
wsize)) wsize))
ret = GNUNET_OK; goto cleanup;
GNUNET_assert (GNUNET_OK ==
GNUNET_DISK_file_close (fh));
return GNUNET_OK;
cleanup: cleanup:
eno = errno; eno = errno;
if (NULL != fh) GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
(void) GNUNET_DISK_file_close (fh); "write",
filename);
GNUNET_break (GNUNET_OK ==
GNUNET_DISK_file_close (fh));
/* try to remove the file, as it must be malformed */
if (0 != unlink (filename))
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"unlink",
filename);
errno = eno; errno = eno;
return ret; return GNUNET_SYSERR;
} }

View File

@ -58,39 +58,42 @@ GNUNET_NETWORK_STRUCT_END
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure. * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/ */
int int
TALER_EXCHANGEDB_denomination_key_revoke (const char *revocation_dir, TALER_EXCHANGEDB_denomination_key_revoke (
const struct const char *revocation_dir,
GNUNET_HashCode *denom_hash, const struct GNUNET_HashCode *denom_hash,
const struct const struct TALER_MasterPrivateKeyP *mpriv)
TALER_MasterPrivateKeyP *mpriv)
{ {
struct TALER_MasterDenominationKeyRevocationPS rm;
char *fn; char *fn;
int ret; int ret;
struct RevocationFileP rd; struct RevocationFileP rd;
{
struct TALER_MasterDenominationKeyRevocationPS rm = {
.purpose.purpose = htonl (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED),
.purpose.size = htonl (sizeof (rm)),
.h_denom_pub = *denom_hash
};
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&mpriv->eddsa_priv,
&rm.purpose,
&rd.msig.eddsa_signature));
}
GNUNET_asprintf (&fn, GNUNET_asprintf (&fn,
"%s" DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR
"%s.rev", "%s.rev",
revocation_dir, revocation_dir,
GNUNET_h2s_full (denom_hash)); GNUNET_h2s_full (denom_hash));
rm.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED);
rm.purpose.size = htonl (sizeof (rm));
rm.h_denom_pub = *denom_hash;
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&mpriv->eddsa_priv,
&rm.purpose,
&rd.msig.eddsa_signature));
rd.denom_hash = *denom_hash; rd.denom_hash = *denom_hash;
if (sizeof (rd) != ret = (sizeof (rd) !=
GNUNET_DISK_fn_write (fn, GNUNET_DISK_fn_write (fn,
&rd, &rd,
sizeof (rd), sizeof (rd),
GNUNET_DISK_PERM_USER_READ GNUNET_DISK_PERM_USER_READ
| GNUNET_DISK_PERM_USER_WRITE)) | GNUNET_DISK_PERM_USER_WRITE))
ret = GNUNET_SYSERR; ? GNUNET_SYSERR
else : GNUNET_OK;
ret = GNUNET_OK;
GNUNET_free (fn); GNUNET_free (fn);
return ret; return ret;
} }
@ -105,10 +108,9 @@ TALER_EXCHANGEDB_denomination_key_revoke (const char *revocation_dir,
* #GNUNET_SYSERR upon failure * #GNUNET_SYSERR upon failure
*/ */
int int
TALER_EXCHANGEDB_denomination_key_read (const char *filename, TALER_EXCHANGEDB_denomination_key_read (
struct const char *filename,
TALER_EXCHANGEDB_DenominationKey struct TALER_EXCHANGEDB_DenominationKey *dki)
*dki)
{ {
uint64_t size; uint64_t size;
size_t offset; size_t offset;
@ -129,9 +131,20 @@ TALER_EXCHANGEDB_denomination_key_read (const char *filename,
offset = sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP); offset = sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP);
if (size <= offset) if (size <= offset)
{ {
GNUNET_break (0); GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"File size (%llu bytes) too small for file `%s' to contain denomination key data. Skipping it.\n",
(unsigned long long) size,
filename);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
if (size >= GNUNET_MAX_MALLOC_CHECKED)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"File size (%llu bytes) too large for file `%s' to contain denomination key data. Skipping it.\n",
(unsigned long long) size,
filename);
return GNUNET_OK;
}
data = GNUNET_malloc (size); data = GNUNET_malloc (size);
if (((ssize_t) size) != if (((ssize_t) size) !=
GNUNET_DISK_fn_read (filename, GNUNET_DISK_fn_read (filename,
@ -160,16 +173,19 @@ TALER_EXCHANGEDB_denomination_key_read (const char *filename,
offset); offset);
GNUNET_free (data); GNUNET_free (data);
if (0 == GNUNET_TIME_absolute_get_remaining if (0 == GNUNET_TIME_absolute_get_remaining
(GNUNET_TIME_absolute_ntoh ( (GNUNET_TIME_absolute_ntoh
dki->issue.properties.expire_withdraw)).rel_value_us) (dki->issue.properties.expire_withdraw)).rel_value_us)
{ {
/* key expired for withdrawal, remove private key to
minimize chance of compromise */
if (0 != unlink (filename)) if (0 != unlink (filename))
{ {
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"unlink", "unlink",
filename); filename);
return GNUNET_OK; /* yes, we had an error, but the file content /* yes, we had an error, but the file content
was fine and is being returned */ was fine and is being returned */
return GNUNET_OK;
} }
} }
return GNUNET_OK; return GNUNET_OK;
@ -184,26 +200,25 @@ TALER_EXCHANGEDB_denomination_key_read (const char *filename,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure. * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/ */
int int
TALER_EXCHANGEDB_denomination_key_write (const char *filename, TALER_EXCHANGEDB_denomination_key_write (
const struct const char *filename,
TALER_EXCHANGEDB_DenominationKey const struct TALER_EXCHANGEDB_DenominationKey *dki)
*dki)
{ {
char *priv_enc;
size_t priv_enc_size;
struct GNUNET_DISK_FileHandle *fh; struct GNUNET_DISK_FileHandle *fh;
ssize_t wrote; ssize_t wrote;
size_t wsize; size_t wsize;
int ret; int eno;
fh = NULL;
priv_enc_size
= GNUNET_CRYPTO_rsa_private_key_encode (dki->denom_priv.rsa_private_key,
&priv_enc);
ret = GNUNET_SYSERR;
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_DISK_directory_create_for_file (filename)) GNUNET_DISK_directory_create_for_file (filename))
{
eno = errno;
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"mkdir (for file)",
filename);
errno = eno;
return GNUNET_SYSERR; return GNUNET_SYSERR;
}
if (NULL == (fh = GNUNET_DISK_file_open if (NULL == (fh = GNUNET_DISK_file_open
(filename, (filename,
GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE
@ -211,27 +226,53 @@ TALER_EXCHANGEDB_denomination_key_write (const char *filename,
| GNUNET_DISK_OPEN_FAILIFEXISTS, | GNUNET_DISK_OPEN_FAILIFEXISTS,
GNUNET_DISK_PERM_USER_READ GNUNET_DISK_PERM_USER_READ
| GNUNET_DISK_PERM_USER_WRITE))) | GNUNET_DISK_PERM_USER_WRITE)))
goto cleanup; {
eno = errno;
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"open",
filename);
errno = eno;
return GNUNET_SYSERR;
}
wsize = sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP); wsize = sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP);
if (GNUNET_SYSERR == (wrote = GNUNET_DISK_file_write (fh, if ( (GNUNET_SYSERR == (wrote = GNUNET_DISK_file_write (fh,
&dki->issue, &dki->issue,
wsize))) wsize))) ||
(wrote != (ssize_t) wsize) )
goto cleanup; goto cleanup;
if (wrote != (ssize_t) wsize) {
goto cleanup; char *priv_enc;
if (GNUNET_SYSERR == size_t priv_enc_size;
(wrote = GNUNET_DISK_file_write (fh,
priv_enc_size
= GNUNET_CRYPTO_rsa_private_key_encode (dki->denom_priv.rsa_private_key,
&priv_enc);
wrote = GNUNET_DISK_file_write (fh,
priv_enc, priv_enc,
priv_enc_size))) priv_enc_size);
GNUNET_free (priv_enc);
if ( (GNUNET_SYSERR == wrote) ||
(wrote != (ssize_t) priv_enc_size) )
goto cleanup; goto cleanup;
if (wrote != (ssize_t) priv_enc_size) }
goto cleanup; GNUNET_assert (GNUNET_OK ==
ret = GNUNET_OK; GNUNET_DISK_file_close (fh));
return GNUNET_OK;
cleanup: cleanup:
GNUNET_free_non_null (priv_enc); eno = errno;
if (NULL != fh) GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
(void) GNUNET_DISK_file_close (fh); "write",
return ret; filename);
GNUNET_break (GNUNET_OK ==
GNUNET_DISK_file_close (fh));
/* try to remove the file, as it must be malformed */
if (0 != unlink (filename))
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"unlink",
filename);
errno = eno;
return GNUNET_SYSERR;
} }
@ -337,21 +378,22 @@ denomkeys_iterate_topdir_iter (void *cls,
* as maybe none of the files were well-formed) * as maybe none of the files were well-formed)
*/ */
int int
TALER_EXCHANGEDB_denomination_keys_iterate (const char *exchange_base_dir, TALER_EXCHANGEDB_denomination_keys_iterate (
TALER_EXCHANGEDB_DenominationKeyIterator const char *exchange_base_dir,
it, TALER_EXCHANGEDB_DenominationKeyIterator it,
void *it_cls) void *it_cls)
{ {
struct DenomkeysIterateContext dic = {
.it = it,
.it_cls = it_cls
};
char *dir; char *dir;
struct DenomkeysIterateContext dic;
int ret; int ret;
GNUNET_asprintf (&dir, GNUNET_asprintf (&dir,
"%s" DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR
TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS, TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS,
exchange_base_dir); exchange_base_dir);
dic.it = it;
dic.it_cls = it_cls;
ret = GNUNET_DISK_directory_scan (dir, ret = GNUNET_DISK_directory_scan (dir,
&denomkeys_iterate_topdir_iter, &denomkeys_iterate_topdir_iter,
&dic); &dic);
@ -401,23 +443,36 @@ revocations_iterate_cb (void *cls,
{ {
struct RevocationsIterateContext *ric = cls; struct RevocationsIterateContext *ric = cls;
struct RevocationFileP rf; struct RevocationFileP rf;
struct TALER_MasterDenominationKeyRevocationPS rm; ssize_t rd;
/* Check if revocation is valid... */ /* Check if revocation is valid... */
if (sizeof (rf) != rd = GNUNET_DISK_fn_read (filename,
GNUNET_DISK_fn_read (filename,
&rf, &rf,
sizeof (rf))) sizeof (rf));
if (GNUNET_SYSERR == rd)
{ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
_ ( "read",
"Invalid revocation file `%s' found and ignored (bad size)\n"),
filename); filename);
return GNUNET_OK; return GNUNET_OK;
} }
rm.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED); if (sizeof (rf) != (size_t) rd)
rm.purpose.size = htonl (sizeof (rm)); {
rm.h_denom_pub = rf.denom_hash; GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Invalid revocation file `%s' found and ignored (bad size: %llu)\n",
filename,
(unsigned long long) rd);
return GNUNET_OK;
}
{
struct TALER_MasterDenominationKeyRevocationPS rm = {
.purpose.purpose = htonl (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED),
.purpose.size = htonl (sizeof (rm)),
.h_denom_pub = rf.denom_hash
};
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify ( GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED, TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED,
@ -431,12 +486,14 @@ revocations_iterate_cb (void *cls,
filename); filename);
return GNUNET_OK; return GNUNET_OK;
} }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Denomination key `%s' was revoked!\n", "Denomination key `%s' was revoked!\n",
GNUNET_h2s (&rm.h_denom_pub)); GNUNET_h2s (&rm.h_denom_pub));
return ric->it (ric->it_cls, return ric->it (ric->it_cls,
&rm.h_denom_pub, &rm.h_denom_pub,
&rf.msig); &rf.msig);
}
} }
@ -467,8 +524,11 @@ TALER_EXCHANGEDB_revocations_iterate (const char *revocation_dir,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_DISK_directory_create (revocation_dir)) GNUNET_DISK_directory_create (revocation_dir))
return 0; /* directory doesn't exist and we couldn't even create it, {
/* directory doesn't exist and we couldn't even create it,
clearly means there are no revocations there */ clearly means there are no revocations there */
return 0;
}
return GNUNET_DISK_directory_scan (revocation_dir, return GNUNET_DISK_directory_scan (revocation_dir,
&revocations_iterate_cb, &revocations_iterate_cb,
&ric); &ric);

View File

@ -48,7 +48,7 @@ TALER_EXCHANGEDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg)
"db"); "db");
return NULL; return NULL;
} }
(void) GNUNET_asprintf (&lib_name, GNUNET_asprintf (&lib_name,
"libtaler_plugin_exchangedb_%s", "libtaler_plugin_exchangedb_%s",
plugin_name); plugin_name);
GNUNET_free (plugin_name); GNUNET_free (plugin_name);

View File

@ -1,6 +1,6 @@
/* /*
This file is part of TALER This file is part of TALER
Copyright (C) 2014, 2015, 2016 Taler Systems SA Copyright (C) 2014, 2015, 2016, 2020 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
@ -112,15 +112,16 @@ TALER_EXCHANGEDB_signing_keys_iterate (const char *exchange_base_dir,
TALER_EXCHANGEDB_SigningKeyIterator it, TALER_EXCHANGEDB_SigningKeyIterator it,
void *it_cls) void *it_cls)
{ {
struct SignkeysIterateContext skc = {
.it = it,
.it_cls = it_cls
};
char *signkey_dir; char *signkey_dir;
struct SignkeysIterateContext skc;
int ret; int ret;
GNUNET_asprintf (&signkey_dir, GNUNET_asprintf (&signkey_dir,
"%s" DIR_SEPARATOR_STR TALER_EXCHANGEDB_DIR_SIGNING_KEYS, "%s" DIR_SEPARATOR_STR TALER_EXCHANGEDB_DIR_SIGNING_KEYS,
exchange_base_dir); exchange_base_dir);
skc.it = it;
skc.it_cls = it_cls;
ret = GNUNET_DISK_directory_scan (signkey_dir, ret = GNUNET_DISK_directory_scan (signkey_dir,
&signkeys_iterate_dir_iter, &signkeys_iterate_dir_iter,
&skc); &skc);
@ -129,30 +130,6 @@ TALER_EXCHANGEDB_signing_keys_iterate (const char *exchange_base_dir,
} }
/**
* Obtain the name of the directory we use to store signing
* keys created at time @a start.
*
* @param exchange_directory base director where we store key material
* @param start time at which we create the signing key
* @return name of the directory we should use, basically "$EXCHANGEDIR/$TIME/";
* (valid until next call to this function)
*/
static char *
get_signkey_file (const char *exchange_directory,
struct GNUNET_TIME_Absolute start)
{
char *fn;
GNUNET_asprintf (&fn,
"%s" DIR_SEPARATOR_STR TALER_EXCHANGEDB_DIR_SIGNING_KEYS
DIR_SEPARATOR_STR "%llu",
exchange_directory,
(unsigned long long) start.abs_value_us);
return fn;
}
/** /**
* Exports a signing key to the given file. * Exports a signing key to the given file.
* *
@ -171,18 +148,31 @@ TALER_EXCHANGEDB_signing_key_write (const char *exchange_base_dir,
char *skf; char *skf;
ssize_t nwrite; ssize_t nwrite;
skf = get_signkey_file (exchange_base_dir, GNUNET_asprintf (&skf,
start); "%s" DIR_SEPARATOR_STR TALER_EXCHANGEDB_DIR_SIGNING_KEYS
DIR_SEPARATOR_STR "%llu",
exchange_base_dir,
(unsigned long long) start.abs_value_us);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_DISK_directory_create_for_file (skf)) GNUNET_DISK_directory_create_for_file (skf))
{
int eno;
eno = errno;
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"mkdir (for file)",
skf);
errno = eno;
return GNUNET_SYSERR; return GNUNET_SYSERR;
}
nwrite = GNUNET_DISK_fn_write (skf, nwrite = GNUNET_DISK_fn_write (skf,
ski, ski,
sizeof (struct sizeof (struct
TALER_EXCHANGEDB_PrivateSigningKeyInformationP), TALER_EXCHANGEDB_PrivateSigningKeyInformationP),
GNUNET_DISK_PERM_USER_WRITE GNUNET_DISK_PERM_USER_WRITE
| GNUNET_DISK_PERM_USER_READ); | GNUNET_DISK_PERM_USER_READ);
if (sizeof (struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP) != nwrite) if (sizeof (struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP) !=
(size_t) nwrite)
{ {
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
"write", "write",

View File

@ -33,11 +33,9 @@
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors * @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
*/ */
int int
TALER_EXCHANGEDB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_calculate_transaction_list_totals (
TALER_EXCHANGEDB_TransactionList struct TALER_EXCHANGEDB_TransactionList *tl,
*tl, const struct TALER_Amount *off,
const struct
TALER_Amount *off,
struct TALER_Amount *ret) struct TALER_Amount *ret)
{ {
struct TALER_Amount spent = *off; struct TALER_Amount spent = *off;

View File

@ -1570,13 +1570,11 @@ postgres_preflight (void *cls,
* @return status of the query * @return status of the query
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_denomination_info (void *cls, postgres_insert_denomination_info (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_DenominationPublicKey *denom_pub,
TALER_DenominationPublicKey *denom_pub, const struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue)
const struct
TALER_EXCHANGEDB_DenominationKeyInformationP
*issue)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (&issue->properties.denom_hash), GNUNET_PQ_query_param_auto_from_type (&issue->properties.denom_hash),
@ -1626,12 +1624,11 @@ postgres_insert_denomination_info (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_denomination_info (void *cls, postgres_get_denomination_info (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *denom_pub_hash, const struct GNUNET_HashCode *denom_pub_hash,
struct struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue)
TALER_EXCHANGEDB_DenominationKeyInformationP *
issue)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
enum GNUNET_DB_QueryStatus qs; enum GNUNET_DB_QueryStatus qs;
@ -2015,9 +2012,9 @@ postgres_reserves_in_insert (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_latest_reserve_in_reference (void *cls, postgres_get_latest_reserve_in_reference (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
const char *exchange_account_name, const char *exchange_account_name,
uint64_t *wire_reference) uint64_t *wire_reference)
{ {
@ -2052,11 +2049,11 @@ postgres_get_latest_reserve_in_reference (void *cls,
* @return statement execution status * @return statement execution status
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_withdraw_info (void *cls, postgres_get_withdraw_info (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_blind, const struct GNUNET_HashCode *h_blind,
struct TALER_EXCHANGEDB_CollectableBlindcoin * struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable)
collectable)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam no_params[] = { struct GNUNET_PQ_QueryParam no_params[] = {
@ -2106,11 +2103,10 @@ postgres_get_withdraw_info (void *cls,
* @return query execution status * @return query execution status
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_withdraw_info (void *cls, postgres_insert_withdraw_info (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable)
TALER_EXCHANGEDB_CollectableBlindcoin *
collectable)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
struct TALER_EXCHANGEDB_Reserve reserve; struct TALER_EXCHANGEDB_Reserve reserve;
@ -2949,11 +2945,11 @@ match_deposit_cb (void *cls,
* number of rows processed, 0 if none exist * number of rows processed, 0 if none exist
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_iterate_matching_deposits (void *cls, postgres_iterate_matching_deposits (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_wire, const struct GNUNET_HashCode *h_wire,
const struct const struct TALER_MerchantPublicKeyP *merchant_pub,
TALER_MerchantPublicKeyP *merchant_pub,
TALER_EXCHANGEDB_DepositIterator deposit_cb, TALER_EXCHANGEDB_DepositIterator deposit_cb,
void *deposit_cb_cls, void *deposit_cb_cls,
uint32_t limit) uint32_t limit)
@ -3040,10 +3036,10 @@ postgres_get_known_coin (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_coin_denomination (void *cls, postgres_get_coin_denomination (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_CoinSpendPublicKeyP *coin_pub,
struct GNUNET_HashCode *denom_hash) struct GNUNET_HashCode *denom_hash)
{ {
struct PostgresClosure *pc = cls; struct PostgresClosure *pc = cls;
@ -3347,15 +3343,13 @@ get_refunds_cb (void *cls,
* @return query result status * @return query result status
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_refunds_by_coin (void *cls, postgres_select_refunds_by_coin (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct
TALER_MerchantPublicKeyP *merchant_pub,
const struct GNUNET_HashCode *h_contract, const struct GNUNET_HashCode *h_contract,
TALER_EXCHANGEDB_RefundCoinCallback TALER_EXCHANGEDB_RefundCoinCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -3481,10 +3475,10 @@ postgres_get_melt_index (void *cls,
* @return query status for the transaction * @return query status for the transaction
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_melt (void *cls, postgres_insert_melt (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_EXCHANGEDB_Refresh *refresh_session)
TALER_EXCHANGEDB_Refresh *refresh_session)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (&refresh_session->rc), GNUNET_PQ_query_param_auto_from_type (&refresh_session->rc),
@ -3518,12 +3512,12 @@ postgres_insert_melt (void *cls,
* @return query status for the transaction * @return query status for the transaction
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_refresh_reveal (void *cls, postgres_insert_refresh_reveal (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct TALER_RefreshCommitmentP *rc, const struct TALER_RefreshCommitmentP *rc,
uint32_t num_rrcs, uint32_t num_rrcs,
const struct const struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs,
TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs,
unsigned int num_tprivs, unsigned int num_tprivs,
const struct TALER_TransferPrivateKeyP *tprivs, const struct TALER_TransferPrivateKeyP *tprivs,
const struct TALER_TransferPublicKeyP *tp) const struct TALER_TransferPublicKeyP *tp)
@ -4415,10 +4409,10 @@ struct Work
* @return database transaction status * @return database transaction status
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_coin_transactions (void *cls, postgres_get_coin_transactions (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_CoinSpendPublicKeyP *coin_pub,
int include_recoup, int include_recoup,
struct TALER_EXCHANGEDB_TransactionList **tlp) struct TALER_EXCHANGEDB_TransactionList **tlp)
{ {
@ -4609,10 +4603,10 @@ handle_wt_result (void *cls,
* @return query status of the transaction * @return query status of the transaction
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_lookup_wire_transfer (void *cls, postgres_lookup_wire_transfer (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *wtid,
TALER_EXCHANGEDB_AggregationDataCallback cb, TALER_EXCHANGEDB_AggregationDataCallback cb,
void *cb_cls) void *cb_cls)
{ {
@ -4656,17 +4650,14 @@ postgres_lookup_wire_transfer (void *cls,
* @return transaction status code * @return transaction status code
- */ - */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_lookup_transfer_by_deposit (void *cls, postgres_lookup_transfer_by_deposit (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct GNUNET_HashCode *h_contract_terms,
GNUNET_HashCode *h_contract_terms,
const struct GNUNET_HashCode *h_wire, const struct GNUNET_HashCode *h_wire,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct TALER_EXCHANGEDB_WireTransferByCoinCallback cb,
TALER_MerchantPublicKeyP *merchant_pub,
TALER_EXCHANGEDB_WireTransferByCoinCallback
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -4761,10 +4752,10 @@ postgres_lookup_transfer_by_deposit (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_aggregation_tracking (void *cls, postgres_insert_aggregation_tracking (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *wtid,
unsigned long long deposit_serial_id) unsigned long long deposit_serial_id)
{ {
uint64_t rid = deposit_serial_id; uint64_t rid = deposit_serial_id;
@ -5055,14 +5046,13 @@ postgres_get_expired_reserves (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_reserve_closed (void *cls, postgres_insert_reserve_closed (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_ReservePublicKeyP *reserve_pub,
TALER_ReservePublicKeyP *reserve_pub,
struct GNUNET_TIME_Absolute execution_date, struct GNUNET_TIME_Absolute execution_date,
const char *receiver_account, const char *receiver_account,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *wtid,
const struct TALER_Amount *amount_with_fee, const struct TALER_Amount *amount_with_fee,
const struct TALER_Amount *closing_fee) const struct TALER_Amount *closing_fee)
{ {
@ -5280,11 +5270,11 @@ postgres_start_deferred_wire_out (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_store_wire_transfer_out (void *cls, postgres_store_wire_transfer_out (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
struct GNUNET_TIME_Absolute date, struct GNUNET_TIME_Absolute date,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *wtid,
const json_t *wire_account, const json_t *wire_account,
const char *exchange_account_section, const char *exchange_account_section,
const struct TALER_Amount *amount) const struct TALER_Amount *amount)
@ -5521,9 +5511,9 @@ deposit_serial_helper_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_deposits_above_serial_id (void *cls, postgres_select_deposits_above_serial_id (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_DepositCallback cb, TALER_EXCHANGEDB_DepositCallback cb,
void *cb_cls) void *cb_cls)
@ -5660,12 +5650,11 @@ refreshs_serial_helper_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_refreshes_above_serial_id (void *cls, postgres_select_refreshes_above_serial_id (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_RefreshesCallback TALER_EXCHANGEDB_RefreshesCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -5799,9 +5788,9 @@ refunds_serial_helper_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_refunds_above_serial_id (void *cls, postgres_select_refunds_above_serial_id (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_RefundCallback cb, TALER_EXCHANGEDB_RefundCallback cb,
void *cb_cls) void *cb_cls)
@ -5934,12 +5923,11 @@ reserves_in_serial_helper_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_reserves_in_above_serial_id (void *cls, postgres_select_reserves_in_above_serial_id (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_ReserveInCallback TALER_EXCHANGEDB_ReserveInCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -5979,14 +5967,12 @@ postgres_select_reserves_in_above_serial_id (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_reserves_in_above_serial_id_by_account (void *cls, postgres_select_reserves_in_above_serial_id_by_account (
struct void *cls,
TALER_EXCHANGEDB_Session struct TALER_EXCHANGEDB_Session *session,
*session,
const char *account_name, const char *account_name,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_ReserveInCallback TALER_EXCHANGEDB_ReserveInCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -6122,12 +6108,11 @@ reserves_out_serial_helper_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_withdrawals_above_serial_id (void *cls, postgres_select_withdrawals_above_serial_id (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_WithdrawCallback TALER_EXCHANGEDB_WithdrawCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -6254,12 +6239,11 @@ wire_out_serial_helper_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_wire_out_above_serial_id (void *cls, postgres_select_wire_out_above_serial_id (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_WireTransferOutCallback TALER_EXCHANGEDB_WireTransferOutCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -6299,14 +6283,12 @@ postgres_select_wire_out_above_serial_id (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_wire_out_above_serial_id_by_account (void *cls, postgres_select_wire_out_above_serial_id_by_account (
struct void *cls,
TALER_EXCHANGEDB_Session * struct TALER_EXCHANGEDB_Session *session,
session,
const char *account_name, const char *account_name,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_WireTransferOutCallback TALER_EXCHANGEDB_WireTransferOutCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -6453,9 +6435,9 @@ recoup_serial_helper_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_recoup_above_serial_id (void *cls, postgres_select_recoup_above_serial_id (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_RecoupCallback cb, TALER_EXCHANGEDB_RecoupCallback cb,
void *cb_cls) void *cb_cls)
@ -6603,12 +6585,11 @@ recoup_refresh_serial_helper_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_recoup_refresh_above_serial_id (void *cls, postgres_select_recoup_refresh_above_serial_id (
struct TALER_EXCHANGEDB_Session void *cls,
*session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_RecoupRefreshCallback TALER_EXCHANGEDB_RecoupRefreshCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -6743,12 +6724,11 @@ reserve_closed_serial_helper_cb (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_select_reserve_closed_above_serial_id (void *cls, postgres_select_reserve_closed_above_serial_id (
struct TALER_EXCHANGEDB_Session void *cls,
*session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_ReserveClosedCallback TALER_EXCHANGEDB_ReserveClosedCallback cb,
cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -6793,15 +6773,13 @@ postgres_select_reserve_closed_above_serial_id (void *cls,
* @return transaction result status * @return transaction result status
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_recoup_request (void *cls, postgres_insert_recoup_request (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_ReservePublicKeyP *reserve_pub,
TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_CoinPublicInfo *coin, const struct TALER_CoinPublicInfo *coin,
const struct const struct TALER_CoinSpendSignatureP *coin_sig,
TALER_CoinSpendSignatureP *coin_sig, const struct TALER_DenominationBlindingKeyP *coin_blind,
const struct
TALER_DenominationBlindingKeyP *coin_blind,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct GNUNET_HashCode *h_blind_ev, const struct GNUNET_HashCode *h_blind_ev,
struct GNUNET_TIME_Absolute timestamp) struct GNUNET_TIME_Absolute timestamp)
@ -6888,19 +6866,14 @@ postgres_insert_recoup_request (void *cls,
* @return transaction result status * @return transaction result status
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_recoup_refresh_request (void *cls, postgres_insert_recoup_refresh_request (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_CoinPublicInfo *coin,
TALER_CoinPublicInfo *coin, const struct TALER_CoinSpendSignatureP *coin_sig,
const struct const struct TALER_DenominationBlindingKeyP *coin_blind,
TALER_CoinSpendSignatureP *coin_sig,
const struct
TALER_DenominationBlindingKeyP *
coin_blind,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct const struct GNUNET_HashCode *h_blind_ev,
GNUNET_HashCode *h_blind_ev,
struct GNUNET_TIME_Absolute timestamp) struct GNUNET_TIME_Absolute timestamp)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
@ -7007,13 +6980,11 @@ postgres_get_old_coin_by_h_blind (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_insert_denomination_revocation (void *cls, postgres_insert_denomination_revocation (
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct GNUNET_HashCode *denom_pub_hash,
GNUNET_HashCode *denom_pub_hash, const struct TALER_MasterSignatureP *master_sig)
const struct
TALER_MasterSignatureP *master_sig)
{ {
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (denom_pub_hash), GNUNET_PQ_query_param_auto_from_type (denom_pub_hash),
@ -7040,10 +7011,10 @@ postgres_insert_denomination_revocation (void *cls,
* @return transaction status code * @return transaction status code
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_DB_QueryStatus
postgres_get_denomination_revocation (void *cls, postgres_get_denomination_revocation (
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct GNUNET_HashCode *denom_pub_hash,
GNUNET_HashCode *denom_pub_hash,
struct TALER_MasterSignatureP *master_sig, struct TALER_MasterSignatureP *master_sig,
uint64_t *rowid) uint64_t *rowid)
{ {

View File

@ -38,9 +38,9 @@
* @param exchange_url base URL of the exchange's API * @param exchange_url base URL of the exchange's API
*/ */
typedef void typedef void
(*TALER_AUDITORDB_ExchangeCallback)(void *cls, (*TALER_AUDITORDB_ExchangeCallback)(
const struct void *cls,
TALER_MasterPublicKeyP *master_pub, const struct TALER_MasterPublicKeyP *master_pub,
const char *exchange_url); const char *exchange_url);
@ -56,10 +56,9 @@ typedef void
* #GNUNET_SYSERR or other values on error. * #GNUNET_SYSERR or other values on error.
*/ */
typedef int typedef int
(*TALER_AUDITORDB_DenominationInfoDataCallback)(void *cls, (*TALER_AUDITORDB_DenominationInfoDataCallback)(
const struct void *cls,
TALER_DenominationKeyValidityPS const struct TALER_DenominationKeyValidityPS *issue);
*issue);
/** /**
@ -78,19 +77,12 @@ typedef int
* #GNUNET_SYSERR or other values on error. * #GNUNET_SYSERR or other values on error.
*/ */
typedef int typedef int
(*TALER_AUDITORDB_HistoricDenominationRevenueDataCallback)(void *cls, (*TALER_AUDITORDB_HistoricDenominationRevenueDataCallback)(
const struct void *cls,
GNUNET_HashCode * const struct GNUNET_HashCode *denom_pub_hash,
denom_pub_hash, struct GNUNET_TIME_Absolute revenue_timestamp,
struct const struct TALER_Amount *revenue_balance,
GNUNET_TIME_Absolute const struct TALER_Amount *loss_balance);
revenue_timestamp,
const struct
TALER_Amount *
revenue_balance,
const struct
TALER_Amount *
loss_balance);
/** /**
@ -107,16 +99,11 @@ typedef int
* #GNUNET_SYSERR or other values on error. * #GNUNET_SYSERR or other values on error.
*/ */
typedef int typedef int
(*TALER_AUDITORDB_HistoricReserveRevenueDataCallback)(void *cls, (*TALER_AUDITORDB_HistoricReserveRevenueDataCallback)(
struct void *cls,
GNUNET_TIME_Absolute struct GNUNET_TIME_Absolute start_time,
start_time, struct GNUNET_TIME_Absolute end_time,
struct const struct TALER_Amount *reserve_profits);
GNUNET_TIME_Absolute
end_time,
const struct
TALER_Amount *
reserve_profits);
/** /**
@ -379,11 +366,10 @@ struct TALER_AUDITORDB_DepositConfirmation
* @param dc the deposit confirmation itself * @param dc the deposit confirmation itself
*/ */
typedef void typedef void
(*TALER_AUDITORDB_DepositConfirmationCallback)(void *cls, (*TALER_AUDITORDB_DepositConfirmationCallback)(
void *cls,
uint64_t serial_id, uint64_t serial_id,
const struct const struct TALER_AUDITORDB_DepositConfirmation *dc);
TALER_AUDITORDB_DepositConfirmation
*dc);
/** /**
@ -553,10 +539,10 @@ struct TALER_AUDITORDB_Plugin
* @return query result status * @return query result status
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_exchange_signkey)(void *cls, (*insert_exchange_signkey)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_AUDITORDB_ExchangeSigningKey *sk);
TALER_AUDITORDB_ExchangeSigningKey *sk);
/** /**
@ -568,10 +554,10 @@ struct TALER_AUDITORDB_Plugin
* @return query result status * @return query result status
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_deposit_confirmation)(void *cls, (*insert_deposit_confirmation)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_AUDITORDB_DepositConfirmation *dc);
TALER_AUDITORDB_DepositConfirmation *dc);
/** /**
@ -587,10 +573,10 @@ struct TALER_AUDITORDB_Plugin
* @return query result status * @return query result status
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*get_deposit_confirmations)(void *cls, (*get_deposit_confirmations)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_public_key,
TALER_MasterPublicKeyP *master_public_key,
uint64_t start_id, uint64_t start_id,
TALER_AUDITORDB_DepositConfirmationCallback cb, TALER_AUDITORDB_DepositConfirmationCallback cb,
void *cb_cls); void *cb_cls);
@ -607,10 +593,10 @@ struct TALER_AUDITORDB_Plugin
* @return status of database operation * @return status of database operation
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_denomination_info)(void *cls, (*insert_denomination_info)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_DenominationKeyValidityPS *issue);
TALER_DenominationKeyValidityPS *issue);
/** /**
@ -642,12 +628,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_auditor_progress_coin)(void *cls, (*insert_auditor_progress_coin)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointCoin *ppc);
const struct
TALER_AUDITORDB_ProgressPointCoin *ppc);
/** /**
@ -661,12 +646,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*update_auditor_progress_coin)(void *cls, (*update_auditor_progress_coin)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointCoin *ppc);
const struct
TALER_AUDITORDB_ProgressPointCoin *ppc);
/** /**
@ -695,12 +679,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_auditor_progress_reserve)(void *cls, (*insert_auditor_progress_reserve)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointReserve *ppr);
const struct
TALER_AUDITORDB_ProgressPointReserve *ppr);
/** /**
@ -714,12 +697,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*update_auditor_progress_reserve)(void *cls, (*update_auditor_progress_reserve)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointReserve *ppr);
const struct
TALER_AUDITORDB_ProgressPointReserve *ppr);
/** /**
@ -732,12 +714,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*get_auditor_progress_reserve)(void *cls, (*get_auditor_progress_reserve)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, struct TALER_AUDITORDB_ProgressPointReserve *ppr);
struct TALER_AUDITORDB_ProgressPointReserve *
ppr);
/** /**
* Insert information about the auditor's progress with an exchange's * Insert information about the auditor's progress with an exchange's
@ -750,15 +731,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_auditor_progress_deposit_confirmation)(void *cls, (*insert_auditor_progress_deposit_confirmation)(
struct TALER_AUDITORDB_Session void *cls,
*session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP * const struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc);
master_pub,
const struct
TALER_AUDITORDB_ProgressPointDepositConfirmation
*ppdc);
/** /**
@ -772,15 +749,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*update_auditor_progress_deposit_confirmation)(void *cls, (*update_auditor_progress_deposit_confirmation)(
struct TALER_AUDITORDB_Session void *cls,
*session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP * const struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc);
master_pub,
const struct
TALER_AUDITORDB_ProgressPointDepositConfirmation
*ppdc);
/** /**
@ -793,15 +766,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*get_auditor_progress_deposit_confirmation)(void *cls, (*get_auditor_progress_deposit_confirmation)(
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP * struct TALER_AUDITORDB_ProgressPointDepositConfirmation *ppdc);
master_pub,
struct
TALER_AUDITORDB_ProgressPointDepositConfirmation
*ppdc);
/** /**
@ -815,13 +784,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_auditor_progress_aggregation)(void *cls, (*insert_auditor_progress_aggregation)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointAggregation *ppa);
const struct
TALER_AUDITORDB_ProgressPointAggregation
*ppa);
/** /**
@ -835,13 +802,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*update_auditor_progress_aggregation)(void *cls, (*update_auditor_progress_aggregation)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_ProgressPointAggregation *ppa);
const struct
TALER_AUDITORDB_ProgressPointAggregation
*ppa);
/** /**
@ -854,13 +819,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*get_auditor_progress_aggregation)(void *cls, (*get_auditor_progress_aggregation)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, struct TALER_AUDITORDB_ProgressPointAggregation *ppa);
struct
TALER_AUDITORDB_ProgressPointAggregation *
ppa);
/** /**
@ -877,15 +840,12 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_wire_auditor_account_progress)(void *cls, (*insert_wire_auditor_account_progress)(
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const char *account_name, const char *account_name,
const struct const struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
TALER_AUDITORDB_WireAccountProgressPoint
*pp,
uint64_t in_wire_off, uint64_t in_wire_off,
uint64_t out_wire_off); uint64_t out_wire_off);
@ -904,15 +864,12 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*update_wire_auditor_account_progress)(void *cls, (*update_wire_auditor_account_progress)(
struct TALER_AUDITORDB_Session * void *cls,
session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const char *account_name, const char *account_name,
const struct const struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
TALER_AUDITORDB_WireAccountProgressPoint
*pp,
uint64_t in_wire_off, uint64_t in_wire_off,
uint64_t out_wire_off); uint64_t out_wire_off);
@ -930,14 +887,12 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*get_wire_auditor_account_progress)(void *cls, (*get_wire_auditor_account_progress)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const char *account_name, const char *account_name,
struct struct TALER_AUDITORDB_WireAccountProgressPoint *pp,
TALER_AUDITORDB_WireAccountProgressPoint
*pp,
uint64_t *in_wire_off, uint64_t *in_wire_off,
uint64_t *out_wire_off); uint64_t *out_wire_off);
@ -954,12 +909,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_wire_auditor_progress)(void *cls, (*insert_wire_auditor_progress)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_WireProgressPoint *pp);
const struct
TALER_AUDITORDB_WireProgressPoint *pp);
/** /**
@ -974,12 +928,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*update_wire_auditor_progress)(void *cls, (*update_wire_auditor_progress)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, const struct TALER_AUDITORDB_WireProgressPoint *pp);
const struct
TALER_AUDITORDB_WireProgressPoint *pp);
/** /**
@ -1394,16 +1347,14 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_historic_denom_revenue)(void *cls, (*insert_historic_denom_revenue)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
const struct GNUNET_HashCode *denom_pub_hash, const struct GNUNET_HashCode *denom_pub_hash,
struct GNUNET_TIME_Absolute struct GNUNET_TIME_Absolute revenue_timestamp,
revenue_timestamp,
const struct TALER_Amount *revenue_balance, const struct TALER_Amount *revenue_balance,
const struct const struct TALER_Amount *recoup_loss_balance);
TALER_Amount *recoup_loss_balance);
/** /**
@ -1418,12 +1369,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*select_historic_denom_revenue)(void *cls, (*select_historic_denom_revenue)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, TALER_AUDITORDB_HistoricDenominationRevenueDataCallback cb,
TALER_AUDITORDB_HistoricDenominationRevenueDataCallback
cb,
void *cb_cls); void *cb_cls);
@ -1439,14 +1389,13 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_historic_reserve_revenue)(void *cls, (*insert_historic_reserve_revenue)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub,
struct GNUNET_TIME_Absolute start_time, struct GNUNET_TIME_Absolute start_time,
struct GNUNET_TIME_Absolute end_time, struct GNUNET_TIME_Absolute end_time,
const struct const struct TALER_Amount *reserve_profits);
TALER_Amount *reserve_profits);
/** /**
@ -1460,12 +1409,11 @@ struct TALER_AUDITORDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*select_historic_reserve_revenue)(void *cls, (*select_historic_reserve_revenue)(
void *cls,
struct TALER_AUDITORDB_Session *session, struct TALER_AUDITORDB_Session *session,
const struct const struct TALER_MasterPublicKeyP *master_pub,
TALER_MasterPublicKeyP *master_pub, TALER_AUDITORDB_HistoricReserveRevenueDataCallback cb,
TALER_AUDITORDB_HistoricReserveRevenueDataCallback
cb,
void *cb_cls); void *cb_cls);

View File

@ -138,10 +138,10 @@ typedef void
* In this case, the callback is not called. * In this case, the callback is not called.
*/ */
struct TALER_BANK_AdminAddIncomingHandle * struct TALER_BANK_AdminAddIncomingHandle *
TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx, TALER_BANK_admin_add_incoming (
struct GNUNET_CURL_Context *ctx,
const struct TALER_BANK_AuthenticationData *auth, const struct TALER_BANK_AuthenticationData *auth,
const struct const struct TALER_ReservePublicKeyP *reserve_pub,
TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const char *debit_account, const char *debit_account,
TALER_BANK_AdminAddIncomingCallback res_cb, TALER_BANK_AdminAddIncomingCallback res_cb,
@ -155,8 +155,8 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx,
* @param aai the admin add incoming request handle * @param aai the admin add incoming request handle
*/ */
void void
TALER_BANK_admin_add_incoming_cancel (struct TALER_BANK_admin_add_incoming_cancel (
TALER_BANK_AdminAddIncomingHandle *aai); struct TALER_BANK_AdminAddIncomingHandle *aai);
/* ********************* /transfer *********************** */ /* ********************* /transfer *********************** */
@ -174,11 +174,11 @@ TALER_BANK_admin_add_incoming_cancel (struct
* @param[out] buf_size set to number of bytes in @a buf, 0 on error * @param[out] buf_size set to number of bytes in @a buf, 0 on error
*/ */
void void
TALER_BANK_prepare_transfer (const char *destination_account_payto_uri, TALER_BANK_prepare_transfer (
const char *destination_account_payto_uri,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const char *exchange_base_url, const char *exchange_base_url,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *wtid,
void **buf, void **buf,
size_t *buf_size); size_t *buf_size);
@ -305,12 +305,12 @@ struct TALER_BANK_CreditDetails
* @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
*/ */
typedef int typedef int
(*TALER_BANK_CreditHistoryCallback) (void *cls, (*TALER_BANK_CreditHistoryCallback) (
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
uint64_t serial_id, uint64_t serial_id,
const struct const struct TALER_BANK_CreditDetails *details,
TALER_BANK_CreditDetails *details,
const json_t *json); const json_t *json);
@ -415,12 +415,12 @@ struct TALER_BANK_DebitDetails
* @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
*/ */
typedef int typedef int
(*TALER_BANK_DebitHistoryCallback) (void *cls, (*TALER_BANK_DebitHistoryCallback) (
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
uint64_t serial_id, uint64_t serial_id,
const struct const struct TALER_BANK_DebitDetails *details,
TALER_BANK_DebitDetails *details,
const json_t *json); const json_t *json);

View File

@ -633,10 +633,9 @@ TALER_planchet_to_coin (const struct TALER_DenominationPublicKey *dk,
* @param[out] ts computed transfer secret * @param[out] ts computed transfer secret
*/ */
void void
TALER_link_derive_transfer_secret (const struct TALER_link_derive_transfer_secret (
TALER_CoinSpendPrivateKeyP *coin_priv, const struct TALER_CoinSpendPrivateKeyP *coin_priv,
const struct const struct TALER_TransferPrivateKeyP *trans_priv,
TALER_TransferPrivateKeyP *trans_priv,
struct TALER_TransferSecretP *ts); struct TALER_TransferSecretP *ts);
@ -649,10 +648,9 @@ TALER_link_derive_transfer_secret (const struct
* @param[out] transfer_secret set to the shared secret * @param[out] transfer_secret set to the shared secret
*/ */
void void
TALER_link_reveal_transfer_secret (const struct TALER_link_reveal_transfer_secret (
TALER_TransferPrivateKeyP *trans_priv, const struct TALER_TransferPrivateKeyP *trans_priv,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_TransferSecretP *transfer_secret); struct TALER_TransferSecretP *transfer_secret);
@ -665,12 +663,10 @@ TALER_link_reveal_transfer_secret (const struct
* @param[out] transfer_secret set to the shared secret * @param[out] transfer_secret set to the shared secret
*/ */
void void
TALER_link_recover_transfer_secret (const struct TALER_link_recover_transfer_secret (
TALER_TransferPublicKeyP *trans_pub, const struct TALER_TransferPublicKeyP *trans_pub,
const struct const struct TALER_CoinSpendPrivateKeyP *coin_priv,
TALER_CoinSpendPrivateKeyP *coin_priv, struct TALER_TransferSecretP *transfer_secret);
struct TALER_TransferSecretP *
transfer_secret);
/** /**
@ -758,11 +754,10 @@ TALER_exchange_wire_signature_hash (const char *payto_uri,
* @return #GNUNET_OK if signature is valid * @return #GNUNET_OK if signature is valid
*/ */
int int
TALER_exchange_wire_signature_check (const char *payto_uri, TALER_exchange_wire_signature_check (
const struct const char *payto_uri,
TALER_MasterPublicKeyP *master_pub, const struct TALER_MasterPublicKeyP *master_pub,
const struct const struct TALER_MasterSignatureP *master_sig);
TALER_MasterSignatureP *master_sig);
/** /**
@ -773,9 +768,9 @@ TALER_exchange_wire_signature_check (const char *payto_uri,
* @param[out] master_sig where to write the signature * @param[out] master_sig where to write the signature
*/ */
void void
TALER_exchange_wire_signature_make (const char *payto_uri, TALER_exchange_wire_signature_make (
const struct const char *payto_uri,
TALER_MasterPrivateKeyP *master_priv, const struct TALER_MasterPrivateKeyP *master_priv,
struct TALER_MasterSignatureP *master_sig); struct TALER_MasterSignatureP *master_sig);
@ -804,12 +799,11 @@ TALER_merchant_wire_signature_hash (const char *payto_uri,
* @return #GNUNET_OK if signature is valid * @return #GNUNET_OK if signature is valid
*/ */
int int
TALER_merchant_wire_signature_check (const char *payto_uri, TALER_merchant_wire_signature_check (
const char *payto_uri,
const char *salt, const char *salt,
const struct const struct TALER_MerchantPublicKeyP *merch_pub,
TALER_MerchantPublicKeyP *merch_pub, const struct TALER_MerchantSignatureP *merch_sig);
const struct
TALER_MerchantSignatureP *merch_sig);
/** /**
@ -821,10 +815,10 @@ TALER_merchant_wire_signature_check (const char *payto_uri,
* @param[out] merch_sig where to write the signature * @param[out] merch_sig where to write the signature
*/ */
void void
TALER_merchant_wire_signature_make (const char *payto_uri, TALER_merchant_wire_signature_make (
const char *payto_uri,
const char *salt, const char *salt,
const struct const struct TALER_MerchantPrivateKeyP *merch_priv,
TALER_MerchantPrivateKeyP *merch_priv,
struct TALER_MerchantSignatureP *merch_sig); struct TALER_MerchantSignatureP *merch_sig);

View File

@ -355,11 +355,10 @@ enum TALER_EXCHANGE_VersionCompatibility
* @param compat protocol compatibility information * @param compat protocol compatibility information
*/ */
typedef void typedef void
(*TALER_EXCHANGE_CertificationCallback) (void *cls, (*TALER_EXCHANGE_CertificationCallback) (
void *cls,
const struct TALER_EXCHANGE_Keys *keys, const struct TALER_EXCHANGE_Keys *keys,
enum enum TALER_EXCHANGE_VersionCompatibility compat);
TALER_EXCHANGE_VersionCompatibility
compat);
/** /**
@ -547,8 +546,8 @@ TALER_EXCHANGE_destroy_denomination_key (struct
* @return details about the given denomination key * @return details about the given denomination key
*/ */
const struct TALER_EXCHANGE_DenomPublicKey * const struct TALER_EXCHANGE_DenomPublicKey *
TALER_EXCHANGE_get_denomination_key_by_hash (const struct TALER_EXCHANGE_get_denomination_key_by_hash (
TALER_EXCHANGE_Keys *keys, const struct TALER_EXCHANGE_Keys *keys,
const struct GNUNET_HashCode *hc); const struct GNUNET_HashCode *hc);
@ -561,11 +560,9 @@ TALER_EXCHANGE_get_denomination_key_by_hash (const struct
* @return NULL on error (@a exchange_pub not known) * @return NULL on error (@a exchange_pub not known)
*/ */
const struct TALER_EXCHANGE_SigningPublicKey * const struct TALER_EXCHANGE_SigningPublicKey *
TALER_EXCHANGE_get_signing_key_info (const struct TALER_EXCHANGE_get_signing_key_info (
TALER_EXCHANGE_Keys *keys, const struct TALER_EXCHANGE_Keys *keys,
const struct const struct TALER_ExchangePublicKeyP *exchange_pub);
TALER_ExchangePublicKeyP *
exchange_pub);
/* ********************* /wire *********************** */ /* ********************* /wire *********************** */
@ -648,12 +645,12 @@ struct TALER_EXCHANGE_WireAccount
* @param accounts list of wire accounts of the exchange, NULL on error * @param accounts list of wire accounts of the exchange, NULL on error
*/ */
typedef void typedef void
(*TALER_EXCHANGE_WireCallback) (void *cls, (*TALER_EXCHANGE_WireCallback) (
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
unsigned int accounts_len, unsigned int accounts_len,
const struct const struct TALER_EXCHANGE_WireAccount *accounts);
TALER_EXCHANGE_WireAccount *accounts);
/** /**
@ -719,13 +716,12 @@ struct TALER_EXCHANGE_DepositHandle;
* be forwarded to the customer) * be forwarded to the customer)
*/ */
typedef void typedef void
(*TALER_EXCHANGE_DepositResultCallback) (void *cls, (*TALER_EXCHANGE_DepositResultCallback) (
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
const struct const struct TALER_ExchangeSignatureP *exchange_sig,
TALER_ExchangeSignatureP *exchange_sig, const struct TALER_ExchangePublicKeyP *sign_key,
const struct
TALER_ExchangePublicKeyP *sign_key,
const json_t *obj); const json_t *obj);
@ -820,11 +816,11 @@ struct TALER_EXCHANGE_RefundHandle;
* be forwarded to the customer) * be forwarded to the customer)
*/ */
typedef void typedef void
(*TALER_EXCHANGE_RefundCallback) (void *cls, (*TALER_EXCHANGE_RefundCallback) (
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
const struct const struct TALER_ExchangePublicKeyP *sign_key,
TALER_ExchangePublicKeyP *sign_key,
const json_t *obj); const json_t *obj);
@ -1103,16 +1099,15 @@ struct TALER_EXCHANGE_ReserveHistory
* @param history detailed transaction history, NULL on error * @param history detailed transaction history, NULL on error
*/ */
typedef void typedef void
(*TALER_EXCHANGE_ReservesGetCallback) (void *cls, (*TALER_EXCHANGE_ReservesGetCallback) (
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
const json_t *json, const json_t *json,
const struct const struct
TALER_Amount *balance, TALER_Amount *balance,
unsigned int history_length, unsigned int history_length,
const struct const struct TALER_EXCHANGE_ReserveHistory *history);
TALER_EXCHANGE_ReserveHistory *
history);
/** /**
@ -1132,9 +1127,9 @@ typedef void
* signatures fail to verify). In this case, the callback is not called. * signatures fail to verify). In this case, the callback is not called.
*/ */
struct TALER_EXCHANGE_ReservesGetHandle * struct TALER_EXCHANGE_ReservesGetHandle *
TALER_EXCHANGE_reserves_get (struct TALER_EXCHANGE_Handle *exchange, TALER_EXCHANGE_reserves_get (
const struct struct TALER_EXCHANGE_Handle *exchange,
TALER_ReservePublicKeyP *reserve_pub, const struct TALER_ReservePublicKeyP *reserve_pub,
TALER_EXCHANGE_ReservesGetCallback cb, TALER_EXCHANGE_ReservesGetCallback cb,
void *cb_cls); void *cb_cls);
@ -1146,8 +1141,8 @@ TALER_EXCHANGE_reserves_get (struct TALER_EXCHANGE_Handle *exchange,
* @param rgh the reserve request handle * @param rgh the reserve request handle
*/ */
void void
TALER_EXCHANGE_reserves_get_cancel (struct TALER_EXCHANGE_reserves_get_cancel (
TALER_EXCHANGE_ReservesGetHandle *rgh); struct TALER_EXCHANGE_ReservesGetHandle *rgh);
/* ********************* POST /reserves/$RESERVE_PUB/withdraw *********************** */ /* ********************* POST /reserves/$RESERVE_PUB/withdraw *********************** */
@ -1171,11 +1166,11 @@ struct TALER_EXCHANGE_WithdrawHandle;
* @param full_response full response from the exchange (for logging, in case of errors) * @param full_response full response from the exchange (for logging, in case of errors)
*/ */
typedef void typedef void
(*TALER_EXCHANGE_WithdrawCallback) (void *cls, (*TALER_EXCHANGE_WithdrawCallback) (
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
const struct const struct TALER_DenominationSignature *sig,
TALER_DenominationSignature *sig,
const json_t *full_response); const json_t *full_response);
@ -1201,13 +1196,12 @@ typedef void
* In this case, the callback is not called. * In this case, the callback is not called.
*/ */
struct TALER_EXCHANGE_WithdrawHandle * struct TALER_EXCHANGE_WithdrawHandle *
TALER_EXCHANGE_withdraw (struct TALER_EXCHANGE_Handle *exchange, TALER_EXCHANGE_withdraw (
struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_EXCHANGE_DenomPublicKey *pk, const struct TALER_EXCHANGE_DenomPublicKey *pk,
const struct const struct TALER_ReservePrivateKeyP *reserve_priv,
TALER_ReservePrivateKeyP *reserve_priv,
const struct TALER_PlanchetSecretsP *ps, const struct TALER_PlanchetSecretsP *ps,
TALER_EXCHANGE_WithdrawCallback TALER_EXCHANGE_WithdrawCallback res_cb,
res_cb,
void *res_cb_cls); void *res_cb_cls);
@ -1234,16 +1228,13 @@ TALER_EXCHANGE_withdraw (struct TALER_EXCHANGE_Handle *exchange,
* In this case, the callback is not called. * In this case, the callback is not called.
*/ */
struct TALER_EXCHANGE_WithdrawHandle * struct TALER_EXCHANGE_WithdrawHandle *
TALER_EXCHANGE_withdraw2 (struct TALER_EXCHANGE_Handle *exchange, TALER_EXCHANGE_withdraw2 (
const struct struct TALER_EXCHANGE_Handle *exchange,
TALER_EXCHANGE_DenomPublicKey *pk, const struct TALER_EXCHANGE_DenomPublicKey *pk,
const struct const struct TALER_ReserveSignatureP *reserve_sig,
TALER_ReserveSignatureP *reserve_sig, const struct TALER_ReservePublicKeyP *reserve_pub,
const struct
TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_PlanchetSecretsP *ps, const struct TALER_PlanchetSecretsP *ps,
TALER_EXCHANGE_WithdrawCallback TALER_EXCHANGE_WithdrawCallback res_cb,
res_cb,
void *res_cb_cls); void *res_cb_cls);
@ -1299,16 +1290,13 @@ TALER_EXCHANGE_withdraw_cancel (struct TALER_EXCHANGE_WithdrawHandle *wh);
* Non-null results should be freed using GNUNET_free(). * Non-null results should be freed using GNUNET_free().
*/ */
char * char *
TALER_EXCHANGE_refresh_prepare (const struct TALER_EXCHANGE_refresh_prepare (
TALER_CoinSpendPrivateKeyP *melt_priv, const struct TALER_CoinSpendPrivateKeyP *melt_priv,
const struct TALER_Amount *melt_amount, const struct TALER_Amount *melt_amount,
const struct const struct TALER_DenominationSignature *melt_sig,
TALER_DenominationSignature *melt_sig, const struct TALER_EXCHANGE_DenomPublicKey *melt_pk,
const struct
TALER_EXCHANGE_DenomPublicKey *melt_pk,
unsigned int fresh_pks_len, unsigned int fresh_pks_len,
const struct const struct TALER_EXCHANGE_DenomPublicKey *fresh_pks,
TALER_EXCHANGE_DenomPublicKey *fresh_pks,
size_t *res_size); size_t *res_size);
@ -1403,14 +1391,13 @@ TALER_EXCHANGE_melt_cancel (struct TALER_EXCHANGE_MeltHandle *mh);
* @param full_response full response from the exchange (for logging, in case of errors) * @param full_response full response from the exchange (for logging, in case of errors)
*/ */
typedef void typedef void
(*TALER_EXCHANGE_RefreshesRevealCallback)(void *cls, (*TALER_EXCHANGE_RefreshesRevealCallback)(
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
unsigned int num_coins, unsigned int num_coins,
const struct const struct TALER_PlanchetSecretsP *coin_privs,
TALER_PlanchetSecretsP *coin_privs, const struct TALER_DenominationSignature *sigs,
const struct
TALER_DenominationSignature *sigs,
const json_t *full_response); const json_t *full_response);
@ -1443,12 +1430,12 @@ struct TALER_EXCHANGE_RefreshesRevealHandle;
* In this case, neither callback will be called. * In this case, neither callback will be called.
*/ */
struct TALER_EXCHANGE_RefreshesRevealHandle * struct TALER_EXCHANGE_RefreshesRevealHandle *
TALER_EXCHANGE_refreshes_reveal (struct TALER_EXCHANGE_Handle *exchange, TALER_EXCHANGE_refreshes_reveal (
struct TALER_EXCHANGE_Handle *exchange,
size_t refresh_data_length, size_t refresh_data_length,
const char *refresh_data, const char *refresh_data,
uint32_t noreveal_index, uint32_t noreveal_index,
TALER_EXCHANGE_RefreshesRevealCallback TALER_EXCHANGE_RefreshesRevealCallback reveal_cb,
reveal_cb,
void *reveal_cb_cls); void *reveal_cb_cls);
@ -1459,9 +1446,8 @@ TALER_EXCHANGE_refreshes_reveal (struct TALER_EXCHANGE_Handle *exchange,
* @param rrh the refresh reval handle * @param rrh the refresh reval handle
*/ */
void void
TALER_EXCHANGE_refreshes_reveal_cancel (struct TALER_EXCHANGE_refreshes_reveal_cancel (
TALER_EXCHANGE_RefreshesRevealHandle * struct TALER_EXCHANGE_RefreshesRevealHandle *rrh);
rrh);
/* ********************* /coins/$COIN_PUB/link ***************************** */ /* ********************* /coins/$COIN_PUB/link ***************************** */
@ -1490,16 +1476,14 @@ struct TALER_EXCHANGE_LinkHandle;
* @param full_response full response from the exchange (for logging, in case of errors) * @param full_response full response from the exchange (for logging, in case of errors)
*/ */
typedef void typedef void
(*TALER_EXCHANGE_LinkCallback) (void *cls, (*TALER_EXCHANGE_LinkCallback) (
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
unsigned int num_coins, unsigned int num_coins,
const struct const struct TALER_CoinSpendPrivateKeyP *coin_privs,
TALER_CoinSpendPrivateKeyP *coin_privs, const struct TALER_DenominationSignature *sigs,
const struct const struct TALER_DenominationPublicKey *pubs,
TALER_DenominationSignature *sigs,
const struct
TALER_DenominationPublicKey *pubs,
const json_t *full_response); const json_t *full_response);
@ -1560,20 +1544,18 @@ struct TALER_EXCHANGE_TransfersGetHandle;
* @param details array with details about the combined transactions * @param details array with details about the combined transactions
*/ */
typedef void typedef void
(*TALER_EXCHANGE_TransfersGetCallback)(void *cls, (*TALER_EXCHANGE_TransfersGetCallback)(
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
const struct const struct TALER_ExchangePublicKeyP *sign_key,
TALER_ExchangePublicKeyP *sign_key,
const json_t *json, const json_t *json,
const struct GNUNET_HashCode *h_wire, const struct GNUNET_HashCode *h_wire,
struct GNUNET_TIME_Absolute struct GNUNET_TIME_Absolute execution_time,
execution_time,
const struct TALER_Amount *total_amount, const struct TALER_Amount *total_amount,
const struct TALER_Amount *wire_fee, const struct TALER_Amount *wire_fee,
unsigned int details_length, unsigned int details_length,
const struct const struct TALER_TrackTransferDetails *details);
TALER_TrackTransferDetails *details);
/** /**
@ -1587,9 +1569,9 @@ typedef void
* @return handle to cancel operation * @return handle to cancel operation
*/ */
struct TALER_EXCHANGE_TransfersGetHandle * struct TALER_EXCHANGE_TransfersGetHandle *
TALER_EXCHANGE_transfers_get (struct TALER_EXCHANGE_Handle *exchange, TALER_EXCHANGE_transfers_get (
const struct struct TALER_EXCHANGE_Handle *exchange,
TALER_WireTransferIdentifierRawP *wtid, const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_EXCHANGE_TransfersGetCallback cb, TALER_EXCHANGE_TransfersGetCallback cb,
void *cb_cls); void *cb_cls);
@ -1601,8 +1583,8 @@ TALER_EXCHANGE_transfers_get (struct TALER_EXCHANGE_Handle *exchange,
* @param wdh the wire deposits request handle * @param wdh the wire deposits request handle
*/ */
void void
TALER_EXCHANGE_transfers_get_cancel (struct TALER_EXCHANGE_transfers_get_cancel (
TALER_EXCHANGE_TransfersGetHandle *wdh); struct TALER_EXCHANGE_TransfersGetHandle *wdh);
/* ********************* GET /deposits/ *********************** */ /* ********************* GET /deposits/ *********************** */
@ -1629,19 +1611,16 @@ struct TALER_EXCHANGE_DepositGetHandle;
* @param coin_contribution contribution to the total amount by this coin (can be NULL) * @param coin_contribution contribution to the total amount by this coin (can be NULL)
*/ */
typedef void typedef void
(*TALER_EXCHANGE_DepositGetCallback)(void *cls, (*TALER_EXCHANGE_DepositGetCallback)(
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
const struct const struct TALER_ExchangePublicKeyP *sign_key,
TALER_ExchangePublicKeyP *sign_key,
const json_t *json, const json_t *json,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *
wtid,
struct GNUNET_TIME_Absolute struct GNUNET_TIME_Absolute
execution_time, execution_time,
const struct const struct TALER_Amount *coin_contribution);
TALER_Amount *coin_contribution);
/** /**
@ -1659,14 +1638,12 @@ typedef void
* @return handle to abort request * @return handle to abort request
*/ */
struct TALER_EXCHANGE_DepositGetHandle * struct TALER_EXCHANGE_DepositGetHandle *
TALER_EXCHANGE_deposits_get (struct TALER_EXCHANGE_Handle *exchange, TALER_EXCHANGE_deposits_get (
const struct struct TALER_EXCHANGE_Handle *exchange,
TALER_MerchantPrivateKeyP *merchant_priv, const struct TALER_MerchantPrivateKeyP *merchant_priv,
const struct GNUNET_HashCode *h_wire, const struct GNUNET_HashCode *h_wire,
const struct const struct GNUNET_HashCode *h_contract_terms,
GNUNET_HashCode *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);
@ -1678,9 +1655,8 @@ TALER_EXCHANGE_deposits_get (struct TALER_EXCHANGE_Handle *exchange,
* @param dwh the wire deposits request handle * @param dwh the wire deposits request handle
*/ */
void void
TALER_EXCHANGE_deposits_get_cancel (struct TALER_EXCHANGE_deposits_get_cancel (
TALER_EXCHANGE_DepositGetHandle * struct TALER_EXCHANGE_DepositGetHandle *dwh);
dwh);
/** /**
@ -1695,11 +1671,10 @@ TALER_EXCHANGE_deposits_get_cancel (struct
* @return #GNUNET_OK if @a history is valid, #GNUNET_SYSERR if not * @return #GNUNET_OK if @a history is valid, #GNUNET_SYSERR if not
*/ */
int int
TALER_EXCHANGE_verify_coin_history (const struct TALER_EXCHANGE_verify_coin_history (
TALER_EXCHANGE_DenomPublicKey *dk, const struct TALER_EXCHANGE_DenomPublicKey *dk,
const char *currency, const char *currency,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_CoinSpendPublicKeyP *coin_pub,
json_t *history, json_t *history,
struct TALER_Amount *total); struct TALER_Amount *total);
@ -1721,15 +1696,14 @@ TALER_EXCHANGE_verify_coin_history (const struct
* #GNUNET_SYSERR if there was a protocol violation in @a history * #GNUNET_SYSERR if there was a protocol violation in @a history
*/ */
int int
TALER_EXCHANGE_parse_reserve_history (struct TALER_EXCHANGE_Handle *exchange, TALER_EXCHANGE_parse_reserve_history (
struct TALER_EXCHANGE_Handle *exchange,
const json_t *history, const json_t *history,
const struct const struct TALER_ReservePublicKeyP *reserve_pub,
TALER_ReservePublicKeyP *reserve_pub,
const char *currency, const char *currency,
struct TALER_Amount *balance, struct TALER_Amount *balance,
unsigned int history_length, unsigned int history_length,
struct TALER_EXCHANGE_ReserveHistory * struct TALER_EXCHANGE_ReserveHistory *rhistory);
rhistory);
/** /**
@ -1739,8 +1713,8 @@ TALER_EXCHANGE_parse_reserve_history (struct TALER_EXCHANGE_Handle *exchange,
* @param len number of entries in @a rhistory * @param len number of entries in @a rhistory
*/ */
void void
TALER_EXCHANGE_free_reserve_history (struct TALER_EXCHANGE_free_reserve_history (
TALER_EXCHANGE_ReserveHistory *rhistory, struct TALER_EXCHANGE_ReserveHistory *rhistory,
unsigned int len); unsigned int len);
@ -1773,15 +1747,14 @@ struct TALER_EXCHANGE_RecoupHandle;
* @param full_response full response from the exchange (for logging, in case of errors) * @param full_response full response from the exchange (for logging, in case of errors)
*/ */
typedef void typedef void
(*TALER_EXCHANGE_RecoupResultCallback) (void *cls, (*TALER_EXCHANGE_RecoupResultCallback) (
void *cls,
unsigned int http_status, unsigned int http_status,
enum TALER_ErrorCode ec, enum TALER_ErrorCode ec,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
struct GNUNET_TIME_Absolute timestamp, struct GNUNET_TIME_Absolute timestamp,
const struct const struct TALER_ReservePublicKeyP *reserve_pub,
TALER_ReservePublicKeyP *reserve_pub, const struct TALER_CoinSpendPublicKeyP *old_coin_pub,
const struct
TALER_CoinSpendPublicKeyP *old_coin_pub,
const json_t *full_response); const json_t *full_response);

View File

@ -50,11 +50,10 @@
* #GNUNET_SYSERR to abort iteration with error! * #GNUNET_SYSERR to abort iteration with error!
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_SigningKeyIterator)(void *cls, (*TALER_EXCHANGEDB_SigningKeyIterator)(
void *cls,
const char *filename, const char *filename,
const struct const struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *ski);
TALER_EXCHANGEDB_PrivateSigningKeyInformationP
*ski);
/** /**
@ -84,11 +83,10 @@ TALER_EXCHANGEDB_signing_keys_iterate (const char *exchange_base_dir,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure. * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/ */
int int
TALER_EXCHANGEDB_signing_key_write (const char *exchange_base_dir, TALER_EXCHANGEDB_signing_key_write (
const char *exchange_base_dir,
struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute start,
const struct const struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *ski);
TALER_EXCHANGEDB_PrivateSigningKeyInformationP
*ski);
/** /**
@ -102,11 +100,10 @@ TALER_EXCHANGEDB_signing_key_write (const char *exchange_base_dir,
* #GNUNET_SYSERR to abort iteration with error! * #GNUNET_SYSERR to abort iteration with error!
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_DenominationKeyIterator)(void *cls, (*TALER_EXCHANGEDB_DenominationKeyIterator)(
void *cls,
const char *alias, const char *alias,
const struct const struct TALER_EXCHANGEDB_DenominationKey *dki);
TALER_EXCHANGEDB_DenominationKey
*dki);
/** /**
@ -120,11 +117,10 @@ typedef int
* #GNUNET_SYSERR to abort iteration with error! * #GNUNET_SYSERR to abort iteration with error!
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_RevocationIterator)(void *cls, (*TALER_EXCHANGEDB_RevocationIterator)(
void *cls,
const struct GNUNET_HashCode *denom_hash, const struct GNUNET_HashCode *denom_hash,
const struct const struct TALER_MasterSignatureP *revocation_master_sig);
TALER_MasterSignatureP *
revocation_master_sig);
/** /**
@ -141,9 +137,9 @@ typedef int
* as maybe none of the files were well-formed) * as maybe none of the files were well-formed)
*/ */
int int
TALER_EXCHANGEDB_denomination_keys_iterate (const char *exchange_base_dir, TALER_EXCHANGEDB_denomination_keys_iterate (
TALER_EXCHANGEDB_DenominationKeyIterator const char *exchange_base_dir,
it, TALER_EXCHANGEDB_DenominationKeyIterator it,
void *it_cls); void *it_cls);
@ -160,9 +156,9 @@ TALER_EXCHANGEDB_denomination_keys_iterate (const char *exchange_base_dir,
* as maybe none of the files were well-formed) * as maybe none of the files were well-formed)
*/ */
int int
TALER_EXCHANGEDB_revocations_iterate (const char *revocation_dir, TALER_EXCHANGEDB_revocations_iterate (
const struct const char *revocation_dir,
TALER_MasterPublicKeyP *master_pub, const struct TALER_MasterPublicKeyP *master_pub,
TALER_EXCHANGEDB_RevocationIterator it, TALER_EXCHANGEDB_RevocationIterator it,
void *it_cls); void *it_cls);
@ -177,11 +173,10 @@ TALER_EXCHANGEDB_revocations_iterate (const char *revocation_dir,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure. * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/ */
int int
TALER_EXCHANGEDB_denomination_key_revoke (const char *revocation_dir, TALER_EXCHANGEDB_denomination_key_revoke (
const struct const char *revocation_dir,
GNUNET_HashCode *denom_hash, const struct GNUNET_HashCode *denom_hash,
const struct const struct TALER_MasterPrivateKeyP *mpriv);
TALER_MasterPrivateKeyP *mpriv);
/** /**
@ -192,10 +187,9 @@ TALER_EXCHANGEDB_denomination_key_revoke (const char *revocation_dir,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure. * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/ */
int int
TALER_EXCHANGEDB_denomination_key_write (const char *filename, TALER_EXCHANGEDB_denomination_key_write (
const struct const char *filename,
TALER_EXCHANGEDB_DenominationKey const struct TALER_EXCHANGEDB_DenominationKey *dki);
*dki);
/** /**
@ -206,10 +200,9 @@ TALER_EXCHANGEDB_denomination_key_write (const char *filename,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
*/ */
int int
TALER_EXCHANGEDB_denomination_key_read (const char *filename, TALER_EXCHANGEDB_denomination_key_read (
struct const char *filename,
TALER_EXCHANGEDB_DenominationKey struct TALER_EXCHANGEDB_DenominationKey *dki);
*dki);
/** /**
@ -227,14 +220,14 @@ TALER_EXCHANGEDB_denomination_key_read (const char *filename,
* #GNUNET_SYSERR to abort iteration with error! * #GNUNET_SYSERR to abort iteration with error!
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_AuditorIterator)(void *cls, (*TALER_EXCHANGEDB_AuditorIterator)(
void *cls,
const struct TALER_AuditorPublicKeyP *apub, const struct TALER_AuditorPublicKeyP *apub,
const char *auditor_url, const char *auditor_url,
const struct TALER_MasterPublicKeyP *mpub, const struct TALER_MasterPublicKeyP *mpub,
unsigned int dki_len, unsigned int dki_len,
const struct TALER_AuditorSignatureP *asigs, const struct TALER_AuditorSignatureP *asigs,
const struct const struct TALER_DenominationKeyValidityPS *dki);
TALER_DenominationKeyValidityPS *dki);
/** /**
@ -268,14 +261,14 @@ TALER_EXCHANGEDB_auditor_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
* @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure. * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure.
*/ */
int int
TALER_EXCHANGEDB_auditor_write (const char *filename, TALER_EXCHANGEDB_auditor_write (
const char *filename,
const struct TALER_AuditorPublicKeyP *apub, const struct TALER_AuditorPublicKeyP *apub,
const char *auditor_url, const char *auditor_url,
const struct TALER_AuditorSignatureP *asigs, const struct TALER_AuditorSignatureP *asigs,
const struct TALER_MasterPublicKeyP *mpub, const struct TALER_MasterPublicKeyP *mpub,
unsigned int dki_len, uint32_t dki_len,
const struct const struct TALER_DenominationKeyValidityPS *dki);
TALER_DenominationKeyValidityPS *dki);
/** /**
@ -433,9 +426,9 @@ struct TALER_EXCHANGEDB_AccountInfo
* @param ai account information * @param ai account information
*/ */
typedef void typedef void
(*TALER_EXCHANGEDB_AccountCallback)(void *cls, (*TALER_EXCHANGEDB_AccountCallback)(
const struct void *cls,
TALER_EXCHANGEDB_AccountInfo *ai); const struct TALER_EXCHANGEDB_AccountInfo *ai);
/** /**
* Parse the configuration to find account information. * Parse the configuration to find account information.
@ -461,11 +454,9 @@ TALER_EXCHANGEDB_find_accounts (const struct GNUNET_CONFIGURATION_Handle *cfg,
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors * @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
*/ */
int int
TALER_EXCHANGEDB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_calculate_transaction_list_totals (
TALER_EXCHANGEDB_TransactionList struct TALER_EXCHANGEDB_TransactionList *tl,
*tl, const struct TALER_Amount *off,
const struct
TALER_Amount *off,
struct TALER_Amount *ret); struct TALER_Amount *ret);

View File

@ -987,16 +987,14 @@ struct TALER_EXCHANGEDB_Session;
* @return transaction status code, #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT to continue to iterate * @return transaction status code, #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT to continue to iterate
*/ */
typedef enum GNUNET_DB_QueryStatus typedef enum GNUNET_DB_QueryStatus
(*TALER_EXCHANGEDB_DepositIterator)(void *cls, (*TALER_EXCHANGEDB_DepositIterator)(
void *cls,
uint64_t rowid, uint64_t rowid,
const struct const struct TALER_MerchantPublicKeyP *merchant_pub,
TALER_MerchantPublicKeyP *merchant_pub, 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 const struct GNUNET_HashCode *h_contract_terms,
GNUNET_HashCode *h_contract_terms,
struct GNUNET_TIME_Absolute wire_deadline, struct GNUNET_TIME_Absolute wire_deadline,
const json_t *receiver_wire_account); const json_t *receiver_wire_account);
@ -1041,20 +1039,16 @@ typedef void
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_DepositCallback)(void *cls, (*TALER_EXCHANGEDB_DepositCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
struct GNUNET_TIME_Absolute timestamp, struct GNUNET_TIME_Absolute timestamp,
const struct const struct TALER_MerchantPublicKeyP *merchant_pub,
TALER_MerchantPublicKeyP *merchant_pub, const struct TALER_DenominationPublicKey *denom_pub,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_DenominationPublicKey *denom_pub, const struct TALER_CoinSpendSignatureP *coin_sig,
const struct
TALER_CoinSpendPublicKeyP *coin_pub,
const struct
TALER_CoinSpendSignatureP *coin_sig,
const struct TALER_Amount *amount_with_fee, const struct TALER_Amount *amount_with_fee,
const struct const struct GNUNET_HashCode *h_contract_terms,
GNUNET_HashCode *h_contract_terms,
struct GNUNET_TIME_Absolute refund_deadline, struct GNUNET_TIME_Absolute refund_deadline,
struct GNUNET_TIME_Absolute wire_deadline, struct GNUNET_TIME_Absolute wire_deadline,
const json_t *receiver_wire_account, const json_t *receiver_wire_account,
@ -1076,20 +1070,15 @@ typedef int
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_RefreshesCallback)(void *cls, (*TALER_EXCHANGEDB_RefreshesCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
const struct const struct TALER_DenominationPublicKey *denom_pub,
TALER_DenominationPublicKey * const struct TALER_CoinSpendPublicKeyP *coin_pub,
denom_pub, const struct TALER_CoinSpendSignatureP *coin_sig,
const struct const struct TALER_Amount *amount_with_fee,
TALER_CoinSpendPublicKeyP *coin_pub,
const struct
TALER_CoinSpendSignatureP *coin_sig,
const struct
TALER_Amount *amount_with_fee,
uint32_t noreveal_index, uint32_t noreveal_index,
const struct const struct TALER_RefreshCommitmentP *rc);
TALER_RefreshCommitmentP *rc);
/** /**
@ -1101,9 +1090,9 @@ typedef int
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_RefundCoinCallback)(void *cls, (*TALER_EXCHANGEDB_RefundCoinCallback)(
const struct void *cls,
TALER_Amount *amount_with_fee); const struct TALER_Amount *amount_with_fee);
/** /**
@ -1152,13 +1141,12 @@ struct TALER_EXCHANGEDB_RefreshRevealedCoin
* @param tp transfer public key information * @param tp transfer public key information
*/ */
typedef void typedef void
(*TALER_EXCHANGEDB_RefreshCallback)(void *cls, (*TALER_EXCHANGEDB_RefreshCallback)(
void *cls,
uint32_t num_freshcoins, uint32_t num_freshcoins,
const struct const struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs,
TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs,
unsigned int num_tprivs, unsigned int num_tprivs,
const struct const struct TALER_TransferPrivateKeyP *tprivs,
TALER_TransferPrivateKeyP *tprivs,
const struct TALER_TransferPublicKeyP *tp); const struct TALER_TransferPublicKeyP *tp);
@ -1178,18 +1166,14 @@ typedef void
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_RefundCallback)(void *cls, (*TALER_EXCHANGEDB_RefundCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
const struct const struct TALER_DenominationPublicKey *denom_pub,
TALER_DenominationPublicKey *denom_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct const struct TALER_MerchantPublicKeyP *merchant_pub,
TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_MerchantSignatureP *merchant_sig,
const struct const struct GNUNET_HashCode *h_contract_terms,
TALER_MerchantPublicKeyP *merchant_pub,
const struct
TALER_MerchantSignatureP *merchant_sig,
const struct
GNUNET_HashCode *h_contract_terms,
uint64_t rtransaction_id, uint64_t rtransaction_id,
const struct TALER_Amount *amount_with_fee); const struct TALER_Amount *amount_with_fee);
@ -1207,15 +1191,14 @@ typedef int
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_ReserveInCallback)(void *cls, (*TALER_EXCHANGEDB_ReserveInCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
const struct const struct TALER_ReservePublicKeyP *reserve_pub,
TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *credit, const struct TALER_Amount *credit,
const char *sender_account_details, const char *sender_account_details,
uint64_t wire_reference, uint64_t wire_reference,
struct GNUNET_TIME_Absolute struct GNUNET_TIME_Absolute execution_date);
execution_date);
/** /**
@ -1232,18 +1215,15 @@ typedef int
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_WithdrawCallback)(void *cls, (*TALER_EXCHANGEDB_WithdrawCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
const struct GNUNET_HashCode *h_blind_ev, const struct GNUNET_HashCode *h_blind_ev,
const struct const struct TALER_DenominationPublicKey *denom_pub,
TALER_DenominationPublicKey *denom_pub, const struct TALER_ReservePublicKeyP *reserve_pub,
const struct const struct TALER_ReserveSignatureP *reserve_sig,
TALER_ReservePublicKeyP *reserve_pub,
const struct
TALER_ReserveSignatureP *reserve_sig,
struct GNUNET_TIME_Absolute execution_date, struct GNUNET_TIME_Absolute execution_date,
const struct const struct TALER_Amount *amount_with_fee);
TALER_Amount *amount_with_fee);
/** /**
@ -1255,9 +1235,9 @@ typedef int
* @param ldl link data for @a transfer_pub * @param ldl link data for @a transfer_pub
*/ */
typedef void typedef void
(*TALER_EXCHANGEDB_LinkCallback)(void *cls, (*TALER_EXCHANGEDB_LinkCallback)(
const struct void *cls,
TALER_TransferPublicKeyP *transfer_pub, const struct TALER_TransferPublicKeyP *transfer_pub,
const struct TALER_EXCHANGEDB_LinkList *ldl); const struct TALER_EXCHANGEDB_LinkList *ldl);
@ -1276,17 +1256,12 @@ typedef void
* when we expect it to be done (if @a wtid was NULL) * when we expect it to be done (if @a wtid was NULL)
*/ */
typedef void typedef void
(*TALER_EXCHANGEDB_WireTransferByCoinCallback)(void *cls, (*TALER_EXCHANGEDB_WireTransferByCoinCallback)(
const struct void *cls,
TALER_WireTransferIdentifierRawP const struct TALER_WireTransferIdentifierRawP *wtid,
* const struct TALER_Amount *coin_contribution,
wtid, const struct TALER_Amount *coin_fee,
const struct struct GNUNET_TIME_Absolute execution_time);
TALER_Amount *coin_contribution,
const struct
TALER_Amount *coin_fee,
struct GNUNET_TIME_Absolute
execution_time);
/** /**
@ -1306,27 +1281,18 @@ typedef void
* @param coin_fee applicable fee for this coin * @param coin_fee applicable fee for this coin
*/ */
typedef void typedef void
(*TALER_EXCHANGEDB_AggregationDataCallback)(void *cls, (*TALER_EXCHANGEDB_AggregationDataCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
const struct const struct TALER_MerchantPublicKeyP *merchant_pub,
TALER_MerchantPublicKeyP * const struct GNUNET_HashCode *h_wire,
merchant_pub,
const struct
GNUNET_HashCode *h_wire,
const json_t *account_details, const json_t *account_details,
struct GNUNET_TIME_Absolute struct GNUNET_TIME_Absolute exec_time,
exec_time, const struct GNUNET_HashCode *h_contract_terms,
const struct const struct TALER_DenominationPublicKey *denom_pub,
GNUNET_HashCode *h_contract_terms, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct const struct TALER_Amount *coin_value,
TALER_DenominationPublicKey * const struct TALER_Amount *coin_fee);
denom_pub,
const struct
TALER_CoinSpendPublicKeyP *coin_pub,
const struct
TALER_Amount *coin_value,
const struct
TALER_Amount *coin_fee);
/** /**
@ -1342,12 +1308,11 @@ typedef void
* @return #GNUNET_OK to continue, #GNUNET_SYSERR to stop iteration * @return #GNUNET_OK to continue, #GNUNET_SYSERR to stop iteration
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_WireTransferOutCallback)(void *cls, (*TALER_EXCHANGEDB_WireTransferOutCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
struct GNUNET_TIME_Absolute date, struct GNUNET_TIME_Absolute date,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *
wtid,
const json_t *wire, const json_t *wire,
const struct TALER_Amount *amount); const struct TALER_Amount *amount);
@ -1386,19 +1351,16 @@ typedef int
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_RecoupCallback)(void *cls, (*TALER_EXCHANGEDB_RecoupCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
struct GNUNET_TIME_Absolute timestamp, struct GNUNET_TIME_Absolute timestamp,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct const struct TALER_ReservePublicKeyP *reserve_pub,
TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_CoinPublicInfo *coin, const struct TALER_CoinPublicInfo *coin,
const struct const struct TALER_DenominationPublicKey *denom_pub,
TALER_DenominationPublicKey *denom_pub, const struct TALER_CoinSpendSignatureP *coin_sig,
const struct const struct TALER_DenominationBlindingKeyP *coin_blind);
TALER_CoinSpendSignatureP *coin_sig,
const struct
TALER_DenominationBlindingKeyP *coin_blind);
/** /**
@ -1416,24 +1378,16 @@ typedef int
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_RecoupRefreshCallback)(void *cls, (*TALER_EXCHANGEDB_RecoupRefreshCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
struct GNUNET_TIME_Absolute struct GNUNET_TIME_Absolute timestamp,
timestamp,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct const struct TALER_CoinSpendPublicKeyP *old_coin_pub,
TALER_CoinSpendPublicKeyP * const struct TALER_CoinPublicInfo *coin,
old_coin_pub, const struct TALER_DenominationPublicKey *denom_pub,
const struct const struct TALER_CoinSpendSignatureP *coin_sig,
TALER_CoinPublicInfo *coin, const struct TALER_DenominationBlindingKeyP *coin_blind);
const struct
TALER_DenominationPublicKey *
denom_pub,
const struct
TALER_CoinSpendSignatureP *coin_sig,
const struct
TALER_DenominationBlindingKeyP *
coin_blind);
/** /**
@ -1451,19 +1405,15 @@ typedef int
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
typedef int typedef int
(*TALER_EXCHANGEDB_ReserveClosedCallback)(void *cls, (*TALER_EXCHANGEDB_ReserveClosedCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
struct GNUNET_TIME_Absolute struct GNUNET_TIME_Absolute execution_date,
execution_date, const struct TALER_Amount *amount_with_fee,
const struct const struct TALER_Amount *closing_fee,
TALER_Amount *amount_with_fee, const struct TALER_ReservePublicKeyP *reserve_pub,
const struct
TALER_Amount *closing_fee,
const struct
TALER_ReservePublicKeyP *reserve_pub,
const char *receiver_account, const char *receiver_account,
const struct const struct TALER_WireTransferIdentifierRawP *wtid);
TALER_WireTransferIdentifierRawP *wtid);
/** /**
@ -1477,13 +1427,12 @@ typedef int
* @return transaction status code to pass on * @return transaction status code to pass on
*/ */
typedef enum GNUNET_DB_QueryStatus typedef enum GNUNET_DB_QueryStatus
(*TALER_EXCHANGEDB_ReserveExpiredCallback)(void *cls, (*TALER_EXCHANGEDB_ReserveExpiredCallback)(
const struct void *cls,
TALER_ReservePublicKeyP *reserve_pub, const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *left, const struct TALER_Amount *left,
const char *account_details, const char *account_details,
struct GNUNET_TIME_Absolute struct GNUNET_TIME_Absolute expiration_date);
expiration_date);
/** /**
@ -1499,20 +1448,14 @@ typedef enum GNUNET_DB_QueryStatus
* @param amount total amount to be paid back * @param amount total amount to be paid back
*/ */
typedef void typedef void
(*TALER_EXCHANGEDB_RecoupJustificationCallback)(void *cls, (*TALER_EXCHANGEDB_RecoupJustificationCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
const struct const struct TALER_CoinPublicInfo *coin,
TALER_CoinPublicInfo *coin, const struct TALER_CoinSpendSignatureP *coin_sig,
const struct const struct TALER_DenominationBlindingKeyP *coin_blind,
TALER_CoinSpendSignatureP * const struct GNUNET_HashCode *h_blinded_ev,
coin_sig, const struct TALER_Amount *amount);
const struct
TALER_DenominationBlindingKeyP
*coin_blind,
const struct
GNUNET_HashCode *h_blinded_ev,
const struct
TALER_Amount *amount);
/** /**
@ -1529,10 +1472,10 @@ typedef void
* @param done did the exchange claim that it made a transfer? * @param done did the exchange claim that it made a transfer?
*/ */
typedef void typedef void
(*TALER_EXCHANGEDB_WireMissingCallback)(void *cls, (*TALER_EXCHANGEDB_WireMissingCallback)(
void *cls,
uint64_t rowid, uint64_t rowid,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const json_t *wire, const json_t *wire,
struct GNUNET_TIME_Absolute deadline, struct GNUNET_TIME_Absolute deadline,
@ -1548,12 +1491,11 @@ typedef void
* @param issue detailed information about the denomination (value, expiration times, fees) * @param issue detailed information about the denomination (value, expiration times, fees)
*/ */
typedef void typedef void
(*TALER_EXCHANGEDB_DenominationCallback)(void *cls, (*TALER_EXCHANGEDB_DenominationCallback)(
void *cls,
const struct const struct
TALER_DenominationPublicKey *denom_pub, TALER_DenominationPublicKey *denom_pub,
const struct const struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue);
TALER_EXCHANGEDB_DenominationKeyInformationP
*issue);
/** /**
@ -1668,13 +1610,11 @@ struct TALER_EXCHANGEDB_Plugin
* @return status of the query * @return status of the query
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_denomination_info)(void *cls, (*insert_denomination_info)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_DenominationPublicKey *denom_pub,
TALER_DenominationPublicKey *denom_pub, const struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue);
const struct
TALER_EXCHANGEDB_DenominationKeyInformationP *
issue);
/** /**
@ -1687,11 +1627,11 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*get_denomination_info)(void *cls, (*get_denomination_info)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *denom_pub_hash, const struct GNUNET_HashCode *denom_pub_hash,
struct TALER_EXCHANGEDB_DenominationKeyInformationP * struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue);
issue);
/** /**
@ -2058,11 +1998,11 @@ struct TALER_EXCHANGEDB_Plugin
* transaction status code on error * transaction status code on error
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*iterate_matching_deposits)(void *cls, (*iterate_matching_deposits)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_wire, const struct GNUNET_HashCode *h_wire,
const struct const struct TALER_MerchantPublicKeyP *merchant_pub,
TALER_MerchantPublicKeyP *merchant_pub,
TALER_EXCHANGEDB_DepositIterator deposit_cb, TALER_EXCHANGEDB_DepositIterator deposit_cb,
void *deposit_cb_cls, void *deposit_cb_cls,
uint32_t limit); uint32_t limit);
@ -2135,12 +2075,12 @@ struct TALER_EXCHANGEDB_Plugin
* @return query status for the transaction * @return query status for the transaction
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_refresh_reveal)(void *cls, (*insert_refresh_reveal)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct TALER_RefreshCommitmentP *rc, const struct TALER_RefreshCommitmentP *rc,
uint32_t num_rrcs, uint32_t num_rrcs,
const struct const struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs,
TALER_EXCHANGEDB_RefreshRevealedCoin *rrcs,
unsigned int num_tprivs, unsigned int num_tprivs,
const struct TALER_TransferPrivateKeyP *tprivs, const struct TALER_TransferPrivateKeyP *tprivs,
const struct TALER_TransferPublicKeyP *tp); const struct TALER_TransferPublicKeyP *tp);
@ -2251,14 +2191,13 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*lookup_transfer_by_deposit)(void *cls, (*lookup_transfer_by_deposit)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct GNUNET_HashCode *h_contract_terms, const struct GNUNET_HashCode *h_contract_terms,
const struct GNUNET_HashCode *h_wire, const struct GNUNET_HashCode *h_wire,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct
TALER_MerchantPublicKeyP *merchant_pub,
TALER_EXCHANGEDB_WireTransferByCoinCallback cb, TALER_EXCHANGEDB_WireTransferByCoinCallback cb,
void *cb_cls); void *cb_cls);
@ -2273,10 +2212,10 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_aggregation_tracking)(void *cls, (*insert_aggregation_tracking)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *wtid,
unsigned long long deposit_serial_id); unsigned long long deposit_serial_id);
@ -2451,11 +2390,11 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*store_wire_transfer_out)(void *cls, (*store_wire_transfer_out)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
struct GNUNET_TIME_Absolute date, struct GNUNET_TIME_Absolute date,
const struct const struct TALER_WireTransferIdentifierRawP *wtid,
TALER_WireTransferIdentifierRawP *wtid,
const json_t *wire_account, const json_t *wire_account,
const char *exchange_account_section, const char *exchange_account_section,
const struct TALER_Amount *amount); const struct TALER_Amount *amount);
@ -2561,14 +2500,12 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*select_reserves_in_above_serial_id_by_account)(void *cls, (*select_reserves_in_above_serial_id_by_account)(
struct void *cls,
TALER_EXCHANGEDB_Session * struct TALER_EXCHANGEDB_Session *session,
session,
const char *account_name, const char *account_name,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_ReserveInCallback TALER_EXCHANGEDB_ReserveInCallback cb,
cb,
void *cb_cls); void *cb_cls);
@ -2585,9 +2522,9 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*select_withdrawals_above_serial_id)(void *cls, (*select_withdrawals_above_serial_id)(
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_WithdrawCallback cb, TALER_EXCHANGEDB_WithdrawCallback cb,
void *cb_cls); void *cb_cls);
@ -2624,13 +2561,12 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*select_wire_out_above_serial_id_by_account)(void *cls, (*select_wire_out_above_serial_id_by_account)(
struct TALER_EXCHANGEDB_Session void *cls,
*session, struct TALER_EXCHANGEDB_Session *session,
const char *account_name, const char *account_name,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_WireTransferOutCallback TALER_EXCHANGEDB_WireTransferOutCallback cb,
cb,
void *cb_cls); void *cb_cls);
@ -2665,12 +2601,11 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*select_recoup_refresh_above_serial_id)(void *cls, (*select_recoup_refresh_above_serial_id)(
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_RecoupRefreshCallback TALER_EXCHANGEDB_RecoupRefreshCallback cb,
cb,
void *cb_cls); void *cb_cls);
@ -2686,12 +2621,11 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*select_reserve_closed_above_serial_id)(void *cls, (*select_reserve_closed_above_serial_id)(
struct TALER_EXCHANGEDB_Session * void *cls,
session, struct TALER_EXCHANGEDB_Session *session,
uint64_t serial_id, uint64_t serial_id,
TALER_EXCHANGEDB_ReserveClosedCallback TALER_EXCHANGEDB_ReserveClosedCallback cb,
cb,
void *cb_cls); void *cb_cls);
@ -2712,13 +2646,13 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction result status * @return transaction result status
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_recoup_request)(void *cls, (*insert_recoup_request)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct TALER_ReservePublicKeyP *reserve_pub, const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_CoinPublicInfo *coin, const struct TALER_CoinPublicInfo *coin,
const struct TALER_CoinSpendSignatureP *coin_sig, const struct TALER_CoinSpendSignatureP *coin_sig,
const struct const struct TALER_DenominationBlindingKeyP *coin_blind,
TALER_DenominationBlindingKeyP *coin_blind,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct GNUNET_HashCode *h_blind_ev, const struct GNUNET_HashCode *h_blind_ev,
struct GNUNET_TIME_Absolute timestamp); struct GNUNET_TIME_Absolute timestamp);
@ -2740,13 +2674,12 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction result status * @return transaction result status
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_recoup_refresh_request)(void *cls, (*insert_recoup_refresh_request)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct TALER_CoinPublicInfo *coin, const struct TALER_CoinPublicInfo *coin,
const struct const struct TALER_CoinSpendSignatureP *coin_sig,
TALER_CoinSpendSignatureP *coin_sig, const struct TALER_DenominationBlindingKeyP *coin_blind,
const struct
TALER_DenominationBlindingKeyP *coin_blind,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct GNUNET_HashCode *h_blind_ev, const struct GNUNET_HashCode *h_blind_ev,
struct GNUNET_TIME_Absolute timestamp); struct GNUNET_TIME_Absolute timestamp);
@ -2797,12 +2730,11 @@ struct TALER_EXCHANGEDB_Plugin
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
(*insert_denomination_revocation)(void *cls, (*insert_denomination_revocation)(
void *cls,
struct TALER_EXCHANGEDB_Session *session, struct TALER_EXCHANGEDB_Session *session,
const struct const struct GNUNET_HashCode *denom_pub_hash,
GNUNET_HashCode *denom_pub_hash, const struct TALER_MasterSignatureP *master_sig);
const struct
TALER_MasterSignatureP *master_sig);
/** /**

View File

@ -76,16 +76,16 @@ TALER_FAKEBANK_check_empty (struct TALER_FAKEBANK_Handle *h);
* @param exchange_base_url exchange URL * @param exchange_base_url exchange URL
* @param request_uid unique number to make the request unique, or NULL to create one * @param request_uid unique number to make the request unique, or NULL to create one
* @param[out] ret_row_id pointer to store the row ID of this transaction * @param[out] ret_row_id pointer to store the row ID of this transaction
* @return GNUNET_YES if the transfer was successful, * @return #GNUNET_YES if the transfer was successful,
* GNUNET_SYSERR if the request_uid was reused for a different transfer * #GNUNET_SYSERR if the request_uid was reused for a different transfer
*/ */
int int
TALER_FAKEBANK_make_transfer (struct TALER_FAKEBANK_Handle *h, TALER_FAKEBANK_make_transfer (
struct TALER_FAKEBANK_Handle *h,
const char *debit_account, const char *debit_account,
const char *credit_account, const char *credit_account,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct const struct TALER_WireTransferIdentifierRawP *subject,
TALER_WireTransferIdentifierRawP *subject,
const char *exchange_base_url, const char *exchange_base_url,
const struct GNUNET_HashCode *request_uid, const struct GNUNET_HashCode *request_uid,
uint64_t *ret_row_id); uint64_t *ret_row_id);
@ -102,12 +102,12 @@ TALER_FAKEBANK_make_transfer (struct TALER_FAKEBANK_Handle *h,
* @return serial_id of the transfer * @return serial_id of the transfer
*/ */
uint64_t uint64_t
TALER_FAKEBANK_make_admin_transfer (struct TALER_FAKEBANK_Handle *h, TALER_FAKEBANK_make_admin_transfer (
struct TALER_FAKEBANK_Handle *h,
const char *debit_account, const char *debit_account,
const char *credit_account, const char *credit_account,
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
const struct const struct TALER_ReservePublicKeyP *reserve_pub);
TALER_ReservePublicKeyP *reserve_pub);
/** /**

View File

@ -170,9 +170,9 @@ TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s,
* @return #GNUNET_OK if signature is valid * @return #GNUNET_OK if signature is valid
*/ */
int int
TALER_JSON_exchange_wire_signature_check (const json_t *wire_s, TALER_JSON_exchange_wire_signature_check (
const struct const json_t *wire_s,
TALER_MasterPublicKeyP *master_pub); const struct TALER_MasterPublicKeyP *master_pub);
/** /**
@ -183,9 +183,9 @@ TALER_JSON_exchange_wire_signature_check (const json_t *wire_s,
* @return NULL if @a payto_uri is malformed * @return NULL if @a payto_uri is malformed
*/ */
json_t * json_t *
TALER_JSON_exchange_wire_signature_make (const char *payto_uri, TALER_JSON_exchange_wire_signature_make (
const struct const char *payto_uri,
TALER_MasterPrivateKeyP *master_priv); const struct TALER_MasterPrivateKeyP *master_priv);
/** /**

View File

@ -121,10 +121,9 @@ TALER_test_coin_valid (const struct TALER_CoinPublicInfo *coin_public_info,
* @param[out] ts computed transfer secret * @param[out] ts computed transfer secret
*/ */
void void
TALER_link_derive_transfer_secret (const struct TALER_link_derive_transfer_secret (
TALER_CoinSpendPrivateKeyP *coin_priv, const struct TALER_CoinSpendPrivateKeyP *coin_priv,
const struct const struct TALER_TransferPrivateKeyP *trans_priv,
TALER_TransferPrivateKeyP *trans_priv,
struct TALER_TransferSecretP *ts) struct TALER_TransferSecretP *ts)
{ {
struct TALER_CoinSpendPublicKeyP coin_pub; struct TALER_CoinSpendPublicKeyP coin_pub;
@ -148,10 +147,9 @@ TALER_link_derive_transfer_secret (const struct
* @param[out] transfer_secret set to the shared secret * @param[out] transfer_secret set to the shared secret
*/ */
void void
TALER_link_reveal_transfer_secret (const struct TALER_link_reveal_transfer_secret (
TALER_TransferPrivateKeyP *trans_priv, const struct TALER_TransferPrivateKeyP *trans_priv,
const struct const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_TransferSecretP *transfer_secret) struct TALER_TransferSecretP *transfer_secret)
{ {
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
@ -170,12 +168,10 @@ TALER_link_reveal_transfer_secret (const struct
* @param[out] transfer_secret set to the shared secret * @param[out] transfer_secret set to the shared secret
*/ */
void void
TALER_link_recover_transfer_secret (const struct TALER_link_recover_transfer_secret (
TALER_TransferPublicKeyP *trans_pub, const struct TALER_TransferPublicKeyP *trans_pub,
const struct const struct TALER_CoinSpendPrivateKeyP *coin_priv,
TALER_CoinSpendPrivateKeyP *coin_priv, struct TALER_TransferSecretP *transfer_secret)
struct TALER_TransferSecretP *
transfer_secret)
{ {
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_ecdh (&coin_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_ecdh (&coin_priv->eddsa_priv,

View File

@ -54,11 +54,10 @@ TALER_exchange_wire_signature_hash (const char *payto_uri,
* @return #GNUNET_OK if signature is valid * @return #GNUNET_OK if signature is valid
*/ */
int int
TALER_exchange_wire_signature_check (const char *payto_uri, TALER_exchange_wire_signature_check (
const struct const char *payto_uri,
TALER_MasterPublicKeyP *master_pub, const struct TALER_MasterPublicKeyP *master_pub,
const struct const struct TALER_MasterSignatureP *master_sig)
TALER_MasterSignatureP *master_sig)
{ {
struct TALER_MasterWireDetailsPS wd; struct TALER_MasterWireDetailsPS wd;
@ -81,9 +80,9 @@ TALER_exchange_wire_signature_check (const char *payto_uri,
* @param[out] master_sig where to write the signature * @param[out] master_sig where to write the signature
*/ */
void void
TALER_exchange_wire_signature_make (const char *payto_uri, TALER_exchange_wire_signature_make (
const struct const char *payto_uri,
TALER_MasterPrivateKeyP *master_priv, const struct TALER_MasterPrivateKeyP *master_priv,
struct TALER_MasterSignatureP *master_sig) struct TALER_MasterSignatureP *master_sig)
{ {
struct TALER_MasterWireDetailsPS wd; struct TALER_MasterWireDetailsPS wd;
@ -144,12 +143,11 @@ TALER_merchant_wire_signature_hash (const char *payto_uri,
* @return #GNUNET_OK if signature is valid * @return #GNUNET_OK if signature is valid
*/ */
int int
TALER_merchant_wire_signature_check (const char *payto_uri, TALER_merchant_wire_signature_check (
const char *payto_uri,
const char *salt, const char *salt,
const struct const struct TALER_MerchantPublicKeyP *merch_pub,
TALER_MerchantPublicKeyP *merch_pub, const struct TALER_MerchantSignatureP *merch_sig)
const struct
TALER_MerchantSignatureP *merch_sig)
{ {
struct TALER_MasterWireDetailsPS wd; struct TALER_MasterWireDetailsPS wd;
@ -174,10 +172,10 @@ TALER_merchant_wire_signature_check (const char *payto_uri,
* @param[out] merch_sig where to write the signature * @param[out] merch_sig where to write the signature
*/ */
void void
TALER_merchant_wire_signature_make (const char *payto_uri, TALER_merchant_wire_signature_make (
const char *payto_uri,
const char *salt, const char *salt,
const struct const struct TALER_MerchantPrivateKeyP *merch_priv,
TALER_MerchantPrivateKeyP *merch_priv,
struct TALER_MerchantSignatureP *merch_sig) struct TALER_MerchantSignatureP *merch_sig)
{ {
struct TALER_MasterWireDetailsPS wd; struct TALER_MasterWireDetailsPS wd;