Compare commits
14 Commits
fb5bc18c58
...
46188ae07e
Author | SHA1 | Date | |
---|---|---|---|
46188ae07e | |||
|
96cbda85e3 | ||
|
4355a08769 | ||
|
4a86d411de | ||
|
27f22ef1d2 | ||
98b51edf49 | |||
|
8cc1edfe0a | ||
|
82fd1a1164 | ||
|
9e7d3f9065 | ||
|
0ad3de938e | ||
|
809300158c | ||
|
9718bc4920 | ||
|
8f2c2766a4 | ||
|
f8fd492e9e |
@ -74,25 +74,25 @@ handle_admin_add_incoming_finished (void *cls,
|
|||||||
const void *response)
|
const void *response)
|
||||||
{
|
{
|
||||||
struct TALER_BANK_AdminAddIncomingHandle *aai = cls;
|
struct TALER_BANK_AdminAddIncomingHandle *aai = cls;
|
||||||
uint64_t row_id = UINT64_MAX;
|
|
||||||
struct GNUNET_TIME_Timestamp timestamp;
|
|
||||||
enum TALER_ErrorCode ec;
|
|
||||||
const json_t *j = response;
|
const json_t *j = response;
|
||||||
|
struct TALER_BANK_AdminAddIncomingResponse ir = {
|
||||||
|
.http_status = response_code,
|
||||||
|
.response = response
|
||||||
|
};
|
||||||
|
|
||||||
aai->job = NULL;
|
aai->job = NULL;
|
||||||
timestamp = GNUNET_TIME_UNIT_FOREVER_TS;
|
|
||||||
switch (response_code)
|
switch (response_code)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
ir.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_OK:
|
case MHD_HTTP_OK:
|
||||||
{
|
{
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_uint64 ("row_id",
|
GNUNET_JSON_spec_uint64 ("row_id",
|
||||||
&row_id),
|
&ir.details.ok.serial_id),
|
||||||
GNUNET_JSON_spec_timestamp ("timestamp",
|
GNUNET_JSON_spec_timestamp ("timestamp",
|
||||||
×tamp),
|
&ir.details.ok.timestamp),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -102,42 +102,41 @@ handle_admin_add_incoming_finished (void *cls,
|
|||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
response_code = 0;
|
ir.http_status = 0;
|
||||||
ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
ir.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ec = TALER_EC_NONE;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_BAD_REQUEST:
|
case MHD_HTTP_BAD_REQUEST:
|
||||||
/* This should never happen, either us or the bank is buggy
|
/* This should never happen, either us or the bank is buggy
|
||||||
(or API version conflict); just pass JSON reply to the application */
|
(or API version conflict); just pass JSON reply to the application */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
ec = TALER_JSON_get_error_code (j);
|
ir.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_FORBIDDEN:
|
case MHD_HTTP_FORBIDDEN:
|
||||||
/* Access denied */
|
/* Access denied */
|
||||||
ec = TALER_JSON_get_error_code (j);
|
ir.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_UNAUTHORIZED:
|
case MHD_HTTP_UNAUTHORIZED:
|
||||||
/* Nothing really to verify, bank says the password is invalid; we should
|
/* Nothing really to verify, bank says the password is invalid; we should
|
||||||
pass the JSON reply to the application */
|
pass the JSON reply to the application */
|
||||||
ec = TALER_JSON_get_error_code (j);
|
ir.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_NOT_FOUND:
|
case MHD_HTTP_NOT_FOUND:
|
||||||
/* Nothing really to verify, maybe account really does not exist.
|
/* Nothing really to verify, maybe account really does not exist.
|
||||||
We should pass the JSON reply to the application */
|
We should pass the JSON reply to the application */
|
||||||
ec = TALER_JSON_get_error_code (j);
|
ir.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_CONFLICT:
|
case MHD_HTTP_CONFLICT:
|
||||||
/* Nothing to verify, we used the same wire subject
|
/* Nothing to verify, we used the same wire subject
|
||||||
twice? */
|
twice? */
|
||||||
ec = TALER_JSON_get_error_code (j);
|
ir.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_INTERNAL_SERVER_ERROR:
|
case MHD_HTTP_INTERNAL_SERVER_ERROR:
|
||||||
/* Server had an internal issue; we should retry, but this API
|
/* Server had an internal issue; we should retry, but this API
|
||||||
leaves this to the application */
|
leaves this to the application */
|
||||||
ec = TALER_JSON_get_error_code (j);
|
ir.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unexpected response code */
|
/* unexpected response code */
|
||||||
@ -145,15 +144,11 @@ handle_admin_add_incoming_finished (void *cls,
|
|||||||
"Unexpected response code %u\n",
|
"Unexpected response code %u\n",
|
||||||
(unsigned int) response_code);
|
(unsigned int) response_code);
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
ec = TALER_JSON_get_error_code (j);
|
ir.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
aai->cb (aai->cb_cls,
|
aai->cb (aai->cb_cls,
|
||||||
response_code,
|
&ir);
|
||||||
ec,
|
|
||||||
row_id,
|
|
||||||
timestamp,
|
|
||||||
j);
|
|
||||||
TALER_BANK_admin_add_incoming_cancel (aai);
|
TALER_BANK_admin_add_incoming_cancel (aai);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of TALER
|
This file is part of TALER
|
||||||
Copyright (C) 2015--2020 Taler Systems SA
|
Copyright (C) 2015--2023 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
|
||||||
@ -158,23 +158,24 @@ handle_transfer_finished (void *cls,
|
|||||||
{
|
{
|
||||||
struct TALER_BANK_TransferHandle *th = cls;
|
struct TALER_BANK_TransferHandle *th = cls;
|
||||||
const json_t *j = response;
|
const json_t *j = response;
|
||||||
uint64_t row_id = UINT64_MAX;
|
struct TALER_BANK_TransferResponse tr = {
|
||||||
struct GNUNET_TIME_Timestamp timestamp = GNUNET_TIME_UNIT_FOREVER_TS;
|
.http_status = response_code,
|
||||||
enum TALER_ErrorCode ec;
|
.response = j
|
||||||
|
};
|
||||||
|
|
||||||
th->job = NULL;
|
th->job = NULL;
|
||||||
switch (response_code)
|
switch (response_code)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
tr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_OK:
|
case MHD_HTTP_OK:
|
||||||
{
|
{
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_uint64 ("row_id",
|
GNUNET_JSON_spec_uint64 ("row_id",
|
||||||
&row_id),
|
&tr.details.ok.row_id),
|
||||||
GNUNET_JSON_spec_timestamp ("timestamp",
|
GNUNET_JSON_spec_timestamp ("timestamp",
|
||||||
×tamp),
|
&tr.details.ok.timestamp),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -184,39 +185,38 @@ handle_transfer_finished (void *cls,
|
|||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
response_code = 0;
|
tr.http_status = 0;
|
||||||
ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
tr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ec = TALER_EC_NONE;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_BAD_REQUEST:
|
case MHD_HTTP_BAD_REQUEST:
|
||||||
/* This should never happen, either us or the bank is buggy
|
/* This should never happen, either us or the bank is buggy
|
||||||
(or API version conflict); just pass JSON reply to the application */
|
(or API version conflict); just pass JSON reply to the application */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
ec = TALER_JSON_get_error_code (j);
|
tr.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_UNAUTHORIZED:
|
case MHD_HTTP_UNAUTHORIZED:
|
||||||
/* Nothing really to verify, bank says our credentials are
|
/* Nothing really to verify, bank says our credentials are
|
||||||
invalid. We should pass the JSON reply to the application. */
|
invalid. We should pass the JSON reply to the application. */
|
||||||
ec = TALER_JSON_get_error_code (j);
|
tr.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_NOT_FOUND:
|
case MHD_HTTP_NOT_FOUND:
|
||||||
/* Nothing really to verify, endpoint wrong -- could be user unknown */
|
/* Nothing really to verify, endpoint wrong -- could be user unknown */
|
||||||
ec = TALER_JSON_get_error_code (j);
|
tr.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_CONFLICT:
|
case MHD_HTTP_CONFLICT:
|
||||||
/* Nothing really to verify. Server says we used the same transfer request
|
/* Nothing really to verify. Server says we used the same transfer request
|
||||||
UID before, but with different details. Should not happen if the user
|
UID before, but with different details. Should not happen if the user
|
||||||
properly used #TALER_BANK_prepare_transfer() and our PRNG is not
|
properly used #TALER_BANK_prepare_transfer() and our PRNG is not
|
||||||
broken... */
|
broken... */
|
||||||
ec = TALER_JSON_get_error_code (j);
|
tr.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_INTERNAL_SERVER_ERROR:
|
case MHD_HTTP_INTERNAL_SERVER_ERROR:
|
||||||
/* Server had an internal issue; we should retry, but this API
|
/* Server had an internal issue; we should retry, but this API
|
||||||
leaves this to the application */
|
leaves this to the application */
|
||||||
ec = TALER_JSON_get_error_code (j);
|
tr.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unexpected response code */
|
/* unexpected response code */
|
||||||
@ -224,14 +224,11 @@ handle_transfer_finished (void *cls,
|
|||||||
"Unexpected response code %u\n",
|
"Unexpected response code %u\n",
|
||||||
(unsigned int) response_code);
|
(unsigned int) response_code);
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
ec = TALER_JSON_get_error_code (j);
|
tr.ec = TALER_JSON_get_error_code (j);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
th->cb (th->cb_cls,
|
th->cb (th->cb_cls,
|
||||||
response_code,
|
&tr);
|
||||||
ec,
|
|
||||||
row_id,
|
|
||||||
timestamp);
|
|
||||||
TALER_BANK_transfer_cancel (th);
|
TALER_BANK_transfer_cancel (th);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,34 +357,28 @@ execute_debit_history (void)
|
|||||||
* execution.
|
* execution.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param response_code HTTP status code
|
* @param tr response details
|
||||||
* @param ec taler error code
|
|
||||||
* @param row_id unique ID of the wire transfer in the bank's records
|
|
||||||
* @param timestamp when did the transaction go into effect
|
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
confirmation_cb (void *cls,
|
confirmation_cb (void *cls,
|
||||||
unsigned int response_code,
|
const struct TALER_BANK_TransferResponse *tr)
|
||||||
enum TALER_ErrorCode ec,
|
|
||||||
uint64_t row_id,
|
|
||||||
struct GNUNET_TIME_Timestamp timestamp)
|
|
||||||
{
|
{
|
||||||
(void) cls;
|
(void) cls;
|
||||||
eh = NULL;
|
eh = NULL;
|
||||||
if (MHD_HTTP_OK != response_code)
|
if (MHD_HTTP_OK != tr->http_status)
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"The wire transfer didn't execute correctly (%u/%d).\n",
|
"The wire transfer didn't execute correctly (%u/%d).\n",
|
||||||
response_code,
|
tr->http_status,
|
||||||
ec);
|
tr->ec);
|
||||||
GNUNET_SCHEDULER_shutdown ();
|
GNUNET_SCHEDULER_shutdown ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (stdout,
|
fprintf (stdout,
|
||||||
"Wire transfer #%llu executed successfully at %s.\n",
|
"Wire transfer #%llu executed successfully at %s.\n",
|
||||||
(unsigned long long) row_id,
|
(unsigned long long) tr->details.ok.row_id,
|
||||||
GNUNET_TIME_timestamp2s (timestamp));
|
GNUNET_TIME_timestamp2s (tr->details.ok.timestamp));
|
||||||
global_ret = 0;
|
global_ret = 0;
|
||||||
GNUNET_SCHEDULER_shutdown ();
|
GNUNET_SCHEDULER_shutdown ();
|
||||||
}
|
}
|
||||||
@ -464,39 +458,29 @@ execute_wire_transfer (void)
|
|||||||
* Function called with the result of the operation.
|
* Function called with the result of the operation.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
|
* @param air response details
|
||||||
* 0 if the bank's reply is bogus (fails to follow the protocol)
|
|
||||||
* @param ec detailed error code
|
|
||||||
* @param serial_id unique ID of the wire transfer in the bank's records; UINT64_MAX on error
|
|
||||||
* @param timestamp timestamp when the transaction got settled at the bank.
|
|
||||||
* @param json detailed response from the HTTPD, or NULL if reply was not in JSON
|
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
res_cb (void *cls,
|
res_cb (void *cls,
|
||||||
unsigned int http_status,
|
const struct TALER_BANK_AdminAddIncomingResponse *air)
|
||||||
enum TALER_ErrorCode ec,
|
|
||||||
uint64_t serial_id,
|
|
||||||
struct GNUNET_TIME_Timestamp timestamp,
|
|
||||||
const json_t *json)
|
|
||||||
{
|
{
|
||||||
(void) cls;
|
(void) cls;
|
||||||
(void) timestamp;
|
|
||||||
op = NULL;
|
op = NULL;
|
||||||
switch (ec)
|
switch (air->http_status)
|
||||||
{
|
{
|
||||||
case TALER_EC_NONE:
|
case MHD_HTTP_OK:
|
||||||
global_ret = 0;
|
global_ret = 0;
|
||||||
fprintf (stdout,
|
fprintf (stdout,
|
||||||
"%llu\n",
|
"%llu\n",
|
||||||
(unsigned long long) serial_id);
|
(unsigned long long) air->details.ok.serial_id);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"Operation failed with status code %u/%u\n",
|
"Operation failed with status code %u/%u\n",
|
||||||
(unsigned int) ec,
|
(unsigned int) air->ec,
|
||||||
http_status);
|
air->http_status);
|
||||||
if (NULL != json)
|
if (NULL != air->response)
|
||||||
json_dumpf (json,
|
json_dumpf (air->response,
|
||||||
stderr,
|
stderr,
|
||||||
JSON_INDENT (2));
|
JSON_INDENT (2));
|
||||||
break;
|
break;
|
||||||
|
@ -15,6 +15,10 @@ bin_PROGRAMS = \
|
|||||||
taler-bank-benchmark \
|
taler-bank-benchmark \
|
||||||
taler-exchange-benchmark
|
taler-exchange-benchmark
|
||||||
|
|
||||||
|
bin_SCRIPTS = \
|
||||||
|
taler-benchmark-setup.sh
|
||||||
|
|
||||||
|
|
||||||
taler_aggregator_benchmark_SOURCES = \
|
taler_aggregator_benchmark_SOURCES = \
|
||||||
taler-aggregator-benchmark.c
|
taler-aggregator-benchmark.c
|
||||||
taler_aggregator_benchmark_LDADD = \
|
taler_aggregator_benchmark_LDADD = \
|
||||||
@ -64,6 +68,12 @@ taler_exchange_benchmark_LDADD = \
|
|||||||
$(XLIB)
|
$(XLIB)
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
|
benchmark-common.conf \
|
||||||
benchmark-cs.conf \
|
benchmark-cs.conf \
|
||||||
benchmark-rsa.conf \
|
benchmark-rsa.conf \
|
||||||
|
bank-benchmark-cs.conf \
|
||||||
|
bank-benchmark-rsa.conf \
|
||||||
|
coins-cs.conf \
|
||||||
|
coins-rsa.conf \
|
||||||
|
$(bin_SCRIPTS) \
|
||||||
exchange_benchmark_home/.local/share/taler/exchange/offline-keys/master.priv
|
exchange_benchmark_home/.local/share/taler/exchange/offline-keys/master.priv
|
||||||
|
@ -1,128 +1,17 @@
|
|||||||
# This file is in the public domain.
|
# This file is in the public domain.
|
||||||
#
|
@INLINE@ benchmark-common.conf
|
||||||
[paths]
|
@INLINE@ coins-cs.conf
|
||||||
# Persistent data storage for the testcase
|
|
||||||
# This value is a default for `taler_config_home'
|
|
||||||
taler_test_home = exchange_benchmark_home/
|
|
||||||
|
|
||||||
[taler]
|
|
||||||
# Currency supported by the exchange (can only be one)
|
|
||||||
currency = EUR
|
|
||||||
CURRENCY_ROUND_UNIT = EUR:0.01
|
|
||||||
|
|
||||||
[exchange]
|
|
||||||
# how long is one signkey valid?
|
|
||||||
signkey_duration = 4 weeks
|
|
||||||
signkey_legal_duration = 2 years
|
|
||||||
# how long do we provide to clients denomination and signing keys
|
|
||||||
# ahead of time?
|
|
||||||
# Keep it short so the test runs fast.
|
|
||||||
lookahead_sign = 12h
|
|
||||||
# HTTP port the exchange listens to
|
|
||||||
port = 8081
|
|
||||||
# Master public key used to sign the exchange's various keys
|
|
||||||
master_public_key = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
|
|
||||||
# How to access our database
|
|
||||||
DB = postgres
|
|
||||||
# Base URL of the exchange. Must be set to a URL where the
|
|
||||||
# exchange (or the twister) is actually listening.
|
|
||||||
base_url = "http://localhost:8081/"
|
|
||||||
|
|
||||||
WIREWATCH_IDLE_SLEEP_INTERVAL = 500 ms
|
|
||||||
|
|
||||||
[exchange-offline]
|
|
||||||
MASTER_PRIV_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/master.priv
|
|
||||||
|
|
||||||
[auditor]
|
|
||||||
BASE_URL = "http://localhost:8083/"
|
|
||||||
|
|
||||||
[exchangedb-postgres]
|
|
||||||
config = "postgres:///talercheck"
|
|
||||||
|
|
||||||
[benchmark-remote-exchange]
|
|
||||||
host = localhost
|
|
||||||
# Adjust $HOME to match remote target!
|
|
||||||
dir = $HOME/repos/taler/exchange/src/benchmark
|
|
||||||
|
|
||||||
[bank]
|
|
||||||
HTTP_PORT = 8082
|
|
||||||
SERVE = http
|
|
||||||
MAX_DEBT = EUR:100000000000.0
|
|
||||||
MAX_DEBT_BANK = EUR:1000000000000000.0
|
|
||||||
|
|
||||||
[benchmark]
|
|
||||||
USER_PAYTO_URI = payto://x-taler-bank/localhost:8082/42?receiver-name=user42
|
|
||||||
|
|
||||||
[exchange-account-2]
|
[exchange-account-2]
|
||||||
# What is the payto://-URL of the exchange (to generate wire response)
|
# What is the payto://-URL of the exchange (to generate wire response)
|
||||||
PAYTO_URI = "payto://x-taler-bank/localhost:8082/Exchange?receiver-name=Exchange"
|
PAYTO_URI = "payto://x-taler-bank/localhost:8082/Exchange?receiver-name=Exchange"
|
||||||
enable_debit = YES
|
ENABLE_DEBIT = YES
|
||||||
enable_credit = YES
|
ENABLE_CREDIT = YES
|
||||||
|
|
||||||
[exchange-accountcredentials-2]
|
[exchange-accountcredentials-2]
|
||||||
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
||||||
WIRE_GATEWAY_URL = http://localhost:8082/Exchange/
|
WIRE_GATEWAY_URL = http://localhost:8082/Exchange/
|
||||||
# Authentication information for basic authentication
|
# Authentication information for basic authentication
|
||||||
WIRE_GATEWAY_AUTH_METHOD = "basic"
|
WIRE_GATEWAY_AUTH_METHOD = "basic"
|
||||||
username = Exchange
|
USERNAME = Exchange
|
||||||
password = x
|
PASSWORD = x
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Sections starting with "coin_" specify which denominations
|
|
||||||
# the exchange should support (and their respective fee structure)
|
|
||||||
[coin_eur_ct_1]
|
|
||||||
value = EUR:0.01
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.00
|
|
||||||
fee_deposit = EUR:0.00
|
|
||||||
fee_refresh = EUR:0.01
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
|
||||||
[coin_eur_ct_10]
|
|
||||||
value = EUR:0.10
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
|
||||||
[coin_eur_1]
|
|
||||||
value = EUR:1
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
|
||||||
[coin_eur_5]
|
|
||||||
value = EUR:5
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
|
||||||
[coin_eur_10]
|
|
||||||
value = EUR:10
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
@ -1,133 +1,17 @@
|
|||||||
# This file is in the public domain.
|
# This file is in the public domain.
|
||||||
#
|
@INLINE@ benchmark-common.conf
|
||||||
[paths]
|
@INLINE@ coins-cs.conf
|
||||||
# Persistent data storage for the testcase
|
|
||||||
# This value is a default for `taler_config_home'
|
|
||||||
taler_test_home = exchange_benchmark_home/
|
|
||||||
|
|
||||||
[taler]
|
|
||||||
# Currency supported by the exchange (can only be one)
|
|
||||||
currency = EUR
|
|
||||||
CURRENCY_ROUND_UNIT = EUR:0.01
|
|
||||||
|
|
||||||
[exchange]
|
|
||||||
# how long is one signkey valid?
|
|
||||||
signkey_duration = 4 weeks
|
|
||||||
signkey_legal_duration = 2 years
|
|
||||||
# how long do we provide to clients denomination and signing keys
|
|
||||||
# ahead of time?
|
|
||||||
# Keep it short so the test runs fast.
|
|
||||||
lookahead_sign = 12h
|
|
||||||
# HTTP port the exchange listens to
|
|
||||||
port = 8081
|
|
||||||
# Master public key used to sign the exchange's various keys
|
|
||||||
master_public_key = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
|
|
||||||
# How to access our database
|
|
||||||
DB = postgres
|
|
||||||
# Base URL of the exchange. Must be set to a URL where the
|
|
||||||
# exchange (or the twister) is actually listening.
|
|
||||||
base_url = "http://localhost:8081/"
|
|
||||||
|
|
||||||
WIREWATCH_IDLE_SLEEP_INTERVAL = 1500 ms
|
|
||||||
|
|
||||||
[exchange-offline]
|
|
||||||
MASTER_PRIV_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/master.priv
|
|
||||||
|
|
||||||
[auditor]
|
|
||||||
BASE_URL = "http://localhost:8083/"
|
|
||||||
|
|
||||||
[exchangedb-postgres]
|
|
||||||
config = "postgres://exchange:taler@192.168.42.42/exchange"
|
|
||||||
|
|
||||||
[benchmark-remote-exchange]
|
|
||||||
host = localhost
|
|
||||||
# Adjust $HOME to match remote target!
|
|
||||||
dir = $HOME/repos/taler/exchange/src/benchmark
|
|
||||||
|
|
||||||
[bank]
|
|
||||||
HTTP_PORT = 8082
|
|
||||||
SERVE = http
|
|
||||||
MAX_DEBT = EUR:100000000000.0
|
|
||||||
MAX_DEBT_BANK = EUR:1000000000000000.0
|
|
||||||
|
|
||||||
[benchmark]
|
|
||||||
USER_PAYTO_URI = payto://x-taler-bank/localhost:8082/42
|
|
||||||
|
|
||||||
[exchange-account-2]
|
[exchange-account-2]
|
||||||
# What is the payto://-URL of the exchange (to generate wire response)
|
# What is the payto://-URL of the exchange (to generate wire response)
|
||||||
PAYTO_URI = "payto://x-taler-bank/localhost:8082/Exchange"
|
PAYTO_URI = "payto://x-taler-bank/localhost:8082/Exchange?receiver-name=Exchange"
|
||||||
enable_debit = YES
|
ENABLE_DEBIT = YES
|
||||||
enable_credit = YES
|
ENABLE_CREDIT = YES
|
||||||
|
|
||||||
[exchange-accountcredentials-2]
|
[exchange-accountcredentials-2]
|
||||||
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
||||||
WIRE_GATEWAY_URL = http://localhost:8082/Exchange/
|
WIRE_GATEWAY_URL = http://localhost:8082/Exchange/
|
||||||
# Authentication information for basic authentication
|
# Authentication information for basic authentication
|
||||||
WIRE_GATEWAY_AUTH_METHOD = "basic"
|
WIRE_GATEWAY_AUTH_METHOD = "basic"
|
||||||
username = Exchange
|
USERNAME = Exchange
|
||||||
password = x
|
PASSWORD = x
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Sections starting with "coin_" specify which denominations
|
|
||||||
# the exchange should support (and their respective fee structure)
|
|
||||||
[coin_eur_ct_1]
|
|
||||||
value = EUR:0.01
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.00
|
|
||||||
fee_deposit = EUR:0.00
|
|
||||||
fee_refresh = EUR:0.01
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
|
||||||
[coin_eur_ct_10]
|
|
||||||
value = EUR:0.10
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
|
||||||
[coin_eur_1]
|
|
||||||
value = EUR:1
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
|
||||||
[coin_eur_5]
|
|
||||||
value = EUR:5
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
|
||||||
[coin_eur_10]
|
|
||||||
value = EUR:10
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
77
src/benchmark/benchmark-common.conf
Normal file
77
src/benchmark/benchmark-common.conf
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
# This file is in the public domain.
|
||||||
|
[paths]
|
||||||
|
TALER_TEST_HOME=exchange_benchmark_home/
|
||||||
|
|
||||||
|
[taler]
|
||||||
|
CURRENCY=EUR
|
||||||
|
CURRENCY_ROUND_UNIT=EUR:0.01
|
||||||
|
|
||||||
|
[exchange]
|
||||||
|
AML_THRESHOLD=EUR:99999999
|
||||||
|
SIGNKEY_LEGAL_DURATION=2 years
|
||||||
|
PORT=8081
|
||||||
|
MASTER_PUBLIC_KEY=98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
|
||||||
|
DB=postgres
|
||||||
|
BASE_URL="http://localhost:8081/"
|
||||||
|
AGGREGATOR_SHARD_SIZE=67108864
|
||||||
|
WIREWATCH_IDLE_SLEEP_INTERVAL=5 ms
|
||||||
|
|
||||||
|
[taler-exchange-secmod-rsa]
|
||||||
|
LOOKAHEAD_SIGN="1 d"
|
||||||
|
|
||||||
|
[taler-exchange-secmod-cs]
|
||||||
|
LOOKAHEAD_SIGN="1 d"
|
||||||
|
|
||||||
|
[taler-exchange-secmod-eddsa]
|
||||||
|
DURATION="2 d"
|
||||||
|
LOOKAHEAD_SIGN="1 d"
|
||||||
|
|
||||||
|
# Trust local exchange for "EUR" currency
|
||||||
|
[merchant-exchange-benchmark]
|
||||||
|
EXCHANGE_BASE_URL = http://localhost:8081/
|
||||||
|
MASTER_KEY=98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
|
||||||
|
# If currency does not match [TALER] section, the exchange
|
||||||
|
# will be ignored!
|
||||||
|
CURRENCY = EUR
|
||||||
|
|
||||||
|
|
||||||
|
[exchangedb-postgres]
|
||||||
|
CONFIG="postgres:///talercheck"
|
||||||
|
|
||||||
|
[merchantdb-postgres]
|
||||||
|
CONFIG="postgres:///talercheck"
|
||||||
|
|
||||||
|
[auditordb-postgres]
|
||||||
|
CONFIG="postgres:///talercheck"
|
||||||
|
|
||||||
|
[syncdb-postgres]
|
||||||
|
CONFIG="postgres:///talercheck"
|
||||||
|
|
||||||
|
[exchange-offline]
|
||||||
|
MASTER_PRIV_FILE=${TALER_DATA_HOME}/exchange/offline-keys/master.priv
|
||||||
|
|
||||||
|
[bank]
|
||||||
|
HTTP_PORT=8082
|
||||||
|
SERVE=http
|
||||||
|
MAX_DEBT=EUR:100000000000.0
|
||||||
|
MAX_DEBT_BANK=EUR:1000000000000000.0
|
||||||
|
DATABASE=bank-db.sqlite3
|
||||||
|
|
||||||
|
[libeufin-nexus]
|
||||||
|
#DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix."
|
||||||
|
DB_CONNECTION="jdbc:sqlite:libeufin-nexus.sqlite3"
|
||||||
|
|
||||||
|
[libeufin-sandbox]
|
||||||
|
#DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix."
|
||||||
|
DB_CONNECTION="jdbc:sqlite:libeufin-sandbox.sqlite3"
|
||||||
|
|
||||||
|
[auditor]
|
||||||
|
BASE_URL="http://localhost:8083/"
|
||||||
|
|
||||||
|
[benchmark-remote-exchange]
|
||||||
|
HOST=localhost
|
||||||
|
# Adjust $HOME to match remote target!
|
||||||
|
DIR=$HOME/repos/taler/exchange/src/benchmark
|
||||||
|
|
||||||
|
[benchmark]
|
||||||
|
USER_PAYTO_URI="payto://x-taler-bank/localhost:8082/42?receiver-name=user42"
|
@ -1,60 +1,6 @@
|
|||||||
# This file is in the public domain.
|
# This file is in the public domain.
|
||||||
#
|
@INLINE@ benchmark-common.conf
|
||||||
[paths]
|
@INLINE@ coins-cs.conf
|
||||||
# Persistent data storage for the testcase
|
|
||||||
# This value is a default for `taler_config_home'
|
|
||||||
TALER_TEST_HOME = exchange_benchmark_home/
|
|
||||||
|
|
||||||
[taler]
|
|
||||||
# Currency supported by the exchange (can only be one)
|
|
||||||
CURRENCY = EUR
|
|
||||||
CURRENCY_ROUND_UNIT = EUR:0.01
|
|
||||||
|
|
||||||
[exchange]
|
|
||||||
|
|
||||||
AML_THRESHOLD = EUR:99999999
|
|
||||||
SIGNKEY_LEGAL_DURATION = 2 years
|
|
||||||
|
|
||||||
# HTTP port the exchange listens to
|
|
||||||
PORT = 8081
|
|
||||||
# Master public key used to sign the exchange's various keys
|
|
||||||
MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
|
|
||||||
# How to access our database
|
|
||||||
DB = postgres
|
|
||||||
# Base URL of the exchange. Must be set to a URL where the
|
|
||||||
# exchange (or the twister) is actually listening.
|
|
||||||
BASE_URL = "http://localhost:8081/"
|
|
||||||
|
|
||||||
AGGREGATOR_SHARD_SIZE = 67108864
|
|
||||||
#AGGREGATOR_SHARD_SIZE = 2147483648
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WIREWATCH_IDLE_SLEEP_INTERVAL = 5 ms
|
|
||||||
|
|
||||||
[exchange-offline]
|
|
||||||
MASTER_PRIV_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/master.priv
|
|
||||||
|
|
||||||
[auditor]
|
|
||||||
BASE_URL = "http://localhost:8083/"
|
|
||||||
|
|
||||||
[exchangedb-postgres]
|
|
||||||
CONFIG = "postgres:///talercheck"
|
|
||||||
|
|
||||||
[benchmark-remote-exchange]
|
|
||||||
HOST = localhost
|
|
||||||
# Adjust $HOME to match remote target!
|
|
||||||
DIR = $HOME/repos/taler/exchange/src/benchmark
|
|
||||||
|
|
||||||
[bank]
|
|
||||||
HTTP_PORT = 8082
|
|
||||||
SERVE = http
|
|
||||||
MAX_DEBT = EUR:100000000000.0
|
|
||||||
MAX_DEBT_BANK = EUR:1000000000000000.0
|
|
||||||
DATABASE = bank-db.sqlite3
|
|
||||||
|
|
||||||
[benchmark]
|
|
||||||
USER_PAYTO_URI = payto://x-taler-bank/localhost:8082/42
|
|
||||||
|
|
||||||
[exchange-account-test]
|
[exchange-account-test]
|
||||||
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
||||||
@ -68,61 +14,3 @@ WIRE_GATEWAY_URL = http://localhost:8082/Exchange/
|
|||||||
WIRE_GATEWAY_AUTH_METHOD = "basic"
|
WIRE_GATEWAY_AUTH_METHOD = "basic"
|
||||||
USERNAME = Exchange
|
USERNAME = Exchange
|
||||||
PASSWORD = x
|
PASSWORD = x
|
||||||
|
|
||||||
|
|
||||||
# Sections starting with "coin_" specify which denominations
|
|
||||||
# the exchange should support (and their respective fee structure)
|
|
||||||
[coin_eur_ct_1]
|
|
||||||
value = EUR:0.01
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.00
|
|
||||||
fee_deposit = EUR:0.00
|
|
||||||
fee_refresh = EUR:0.01
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
|
||||||
[coin_eur_ct_10]
|
|
||||||
value = EUR:0.10
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
|
||||||
[coin_eur_1]
|
|
||||||
value = EUR:1
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
|
||||||
[coin_eur_5]
|
|
||||||
value = EUR:5
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
|
||||||
[coin_eur_10]
|
|
||||||
value = EUR:10
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = CS
|
|
||||||
|
@ -1,60 +1,6 @@
|
|||||||
# This file is in the public domain.
|
# This file is in the public domain.
|
||||||
#
|
@INLINE@ benchmark-common.conf
|
||||||
[paths]
|
@INLINE@ coins-rsa.conf
|
||||||
# Persistent data storage for the testcase
|
|
||||||
# This value is a default for `taler_config_home'
|
|
||||||
TALER_TEST_HOME = exchange_benchmark_home/
|
|
||||||
|
|
||||||
[taler]
|
|
||||||
# Currency supported by the exchange (can only be one)
|
|
||||||
CURRENCY = EUR
|
|
||||||
CURRENCY_ROUND_UNIT = EUR:0.01
|
|
||||||
|
|
||||||
[exchange]
|
|
||||||
|
|
||||||
AML_THRESHOLD = EUR:99999999
|
|
||||||
SIGNKEY_LEGAL_DURATION = 2 years
|
|
||||||
|
|
||||||
# HTTP port the exchange listens to
|
|
||||||
PORT = 8081
|
|
||||||
# Master public key used to sign the exchange's various keys
|
|
||||||
MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
|
|
||||||
# How to access our database
|
|
||||||
DB = postgres
|
|
||||||
# Base URL of the exchange. Must be set to a URL where the
|
|
||||||
# exchange (or the twister) is actually listening.
|
|
||||||
BASE_URL = "http://localhost:8081/"
|
|
||||||
|
|
||||||
AGGREGATOR_SHARD_SIZE = 67108864
|
|
||||||
#AGGREGATOR_SHARD_SIZE = 2147483648
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WIREWATCH_IDLE_SLEEP_INTERVAL = 5 ms
|
|
||||||
|
|
||||||
[exchange-offline]
|
|
||||||
MASTER_PRIV_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/master.priv
|
|
||||||
|
|
||||||
[auditor]
|
|
||||||
BASE_URL = "http://localhost:8083/"
|
|
||||||
|
|
||||||
[exchangedb-postgres]
|
|
||||||
CONFIG = "postgres:///talercheck"
|
|
||||||
|
|
||||||
[benchmark-remote-exchange]
|
|
||||||
HOST = localhost
|
|
||||||
# Adjust $HOME to match remote target!
|
|
||||||
DIR = $HOME/repos/taler/exchange/src/benchmark
|
|
||||||
|
|
||||||
[bank]
|
|
||||||
HTTP_PORT = 8082
|
|
||||||
SERVE = http
|
|
||||||
MAX_DEBT = EUR:100000000000.0
|
|
||||||
MAX_DEBT_BANK = EUR:1000000000000000.0
|
|
||||||
DATABASE = bank-db.sqlite3
|
|
||||||
|
|
||||||
[benchmark]
|
|
||||||
USER_PAYTO_URI = payto://x-taler-bank/localhost:8082/42
|
|
||||||
|
|
||||||
[exchange-account-test]
|
[exchange-account-test]
|
||||||
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
||||||
@ -68,66 +14,3 @@ WIRE_GATEWAY_URL = http://localhost:8082/Exchange/
|
|||||||
WIRE_GATEWAY_AUTH_METHOD = "basic"
|
WIRE_GATEWAY_AUTH_METHOD = "basic"
|
||||||
USERNAME = Exchange
|
USERNAME = Exchange
|
||||||
PASSWORD = x
|
PASSWORD = x
|
||||||
|
|
||||||
|
|
||||||
# Sections starting with "coin_" specify which denominations
|
|
||||||
# the exchange should support (and their respective fee structure)
|
|
||||||
[coin_eur_ct_1]
|
|
||||||
value = EUR:0.01
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.00
|
|
||||||
fee_deposit = EUR:0.00
|
|
||||||
fee_refresh = EUR:0.01
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
|
||||||
[coin_eur_ct_10]
|
|
||||||
value = EUR:0.10
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
|
||||||
[coin_eur_1]
|
|
||||||
value = EUR:1
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
|
||||||
[coin_eur_5]
|
|
||||||
value = EUR:5
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
|
||||||
[coin_eur_10]
|
|
||||||
value = EUR:10
|
|
||||||
duration_withdraw = 7 days
|
|
||||||
duration_spend = 2 years
|
|
||||||
duration_legal = 3 years
|
|
||||||
fee_withdraw = EUR:0.01
|
|
||||||
fee_deposit = EUR:0.01
|
|
||||||
fee_refresh = EUR:0.03
|
|
||||||
fee_refund = EUR:0.01
|
|
||||||
CIPHER = RSA
|
|
||||||
rsa_keysize = 2048
|
|
||||||
|
58
src/benchmark/coins-cs.conf
Normal file
58
src/benchmark/coins-cs.conf
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
# This file is in the public domain.
|
||||||
|
#
|
||||||
|
# Sections starting with "coin_" specify which denominations
|
||||||
|
# the exchange should support (and their respective fee structure)
|
||||||
|
[coin_eur_ct_1]
|
||||||
|
value = EUR:0.01
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.00
|
||||||
|
fee_deposit = EUR:0.00
|
||||||
|
fee_refresh = EUR:0.01
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = CS
|
||||||
|
|
||||||
|
[coin_eur_ct_10]
|
||||||
|
value = EUR:0.10
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.01
|
||||||
|
fee_deposit = EUR:0.01
|
||||||
|
fee_refresh = EUR:0.03
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = CS
|
||||||
|
|
||||||
|
[coin_eur_1]
|
||||||
|
value = EUR:1
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.01
|
||||||
|
fee_deposit = EUR:0.01
|
||||||
|
fee_refresh = EUR:0.03
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = CS
|
||||||
|
|
||||||
|
[coin_eur_5]
|
||||||
|
value = EUR:5
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.01
|
||||||
|
fee_deposit = EUR:0.01
|
||||||
|
fee_refresh = EUR:0.03
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = CS
|
||||||
|
|
||||||
|
[coin_eur_10]
|
||||||
|
value = EUR:10
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.01
|
||||||
|
fee_deposit = EUR:0.01
|
||||||
|
fee_refresh = EUR:0.03
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = CS
|
63
src/benchmark/coins-rsa.conf
Normal file
63
src/benchmark/coins-rsa.conf
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# This file is in the public domain.
|
||||||
|
#
|
||||||
|
# Sections starting with "coin_" specify which denominations
|
||||||
|
# the exchange should support (and their respective fee structure)
|
||||||
|
[coin_eur_ct_1]
|
||||||
|
value = EUR:0.01
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.00
|
||||||
|
fee_deposit = EUR:0.00
|
||||||
|
fee_refresh = EUR:0.01
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = RSA
|
||||||
|
rsa_keysize = 2048
|
||||||
|
|
||||||
|
[coin_eur_ct_10]
|
||||||
|
value = EUR:0.10
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.01
|
||||||
|
fee_deposit = EUR:0.01
|
||||||
|
fee_refresh = EUR:0.03
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = RSA
|
||||||
|
rsa_keysize = 2048
|
||||||
|
|
||||||
|
[coin_eur_1]
|
||||||
|
value = EUR:1
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.01
|
||||||
|
fee_deposit = EUR:0.01
|
||||||
|
fee_refresh = EUR:0.03
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = RSA
|
||||||
|
rsa_keysize = 2048
|
||||||
|
|
||||||
|
[coin_eur_5]
|
||||||
|
value = EUR:5
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.01
|
||||||
|
fee_deposit = EUR:0.01
|
||||||
|
fee_refresh = EUR:0.03
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = RSA
|
||||||
|
rsa_keysize = 2048
|
||||||
|
|
||||||
|
[coin_eur_10]
|
||||||
|
value = EUR:10
|
||||||
|
duration_withdraw = 7 days
|
||||||
|
duration_spend = 2 years
|
||||||
|
duration_legal = 3 years
|
||||||
|
fee_withdraw = EUR:0.01
|
||||||
|
fee_deposit = EUR:0.01
|
||||||
|
fee_refresh = EUR:0.03
|
||||||
|
fee_refund = EUR:0.01
|
||||||
|
CIPHER = RSA
|
||||||
|
rsa_keysize = 2048
|
624
src/benchmark/taler-benchmark-setup.sh
Executable file
624
src/benchmark/taler-benchmark-setup.sh
Executable file
@ -0,0 +1,624 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# This file is part of TALER
|
||||||
|
# Copyright (C) 2023 Taler Systems SA
|
||||||
|
#
|
||||||
|
# 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 Foundation; either version 3, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# TALER is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with TALER; see the file COPYING. If not, see
|
||||||
|
# <http://www.gnu.org/licenses/>
|
||||||
|
#
|
||||||
|
# Author: Christian Grothoff
|
||||||
|
#
|
||||||
|
# This script configures and launches various GNU Taler services.
|
||||||
|
# Which ones depend on command-line options. Use "-h" to find out.
|
||||||
|
# Prints "<<READY>>" on a separate line once all requested services
|
||||||
|
# are running. Close STDIN (or input 'NEWLINE') to stop all started
|
||||||
|
# services again.
|
||||||
|
#
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# Exit, with status code "skip" (no 'real' failure)
|
||||||
|
function exit_skip() {
|
||||||
|
echo " SKIP: " "$@"
|
||||||
|
exit 77
|
||||||
|
}
|
||||||
|
|
||||||
|
# Exit, with error message (hard failure)
|
||||||
|
function exit_fail() {
|
||||||
|
echo " FAIL: " "$@"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Cleanup to run whenever we exit
|
||||||
|
function cleanup()
|
||||||
|
{
|
||||||
|
for n in $(jobs -p)
|
||||||
|
do
|
||||||
|
kill $n 2> /dev/null || true
|
||||||
|
done
|
||||||
|
wait
|
||||||
|
rm -f libeufin-nexus.pid libeufin-sandbox.pid
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install cleanup handler (except for kill -9)
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
START_AUDITOR=0
|
||||||
|
START_BACKUP=0
|
||||||
|
START_EXCHANGE=0
|
||||||
|
START_FAKEBANK=0
|
||||||
|
START_MERCHANT=0
|
||||||
|
START_NEXUS=0
|
||||||
|
START_SANDBOX=0
|
||||||
|
USE_VALGRIND=""
|
||||||
|
CONF_ORIG="~/.config/taler.conf"
|
||||||
|
LOGLEVEL="DEBUG"
|
||||||
|
DEFAULT_SLEEP="0.2"
|
||||||
|
|
||||||
|
# Parse command-line options
|
||||||
|
while getopts ':abc:efhl:mnsv' OPTION; do
|
||||||
|
case "$OPTION" in
|
||||||
|
a)
|
||||||
|
START_AUDITOR="1"
|
||||||
|
;;
|
||||||
|
b)
|
||||||
|
START_BACKUP="1"
|
||||||
|
;;
|
||||||
|
c)
|
||||||
|
CONF_ORIG="$OPTARG"
|
||||||
|
;;
|
||||||
|
e)
|
||||||
|
START_EXCHANGE="1"
|
||||||
|
;;
|
||||||
|
f)
|
||||||
|
START_FAKEBANK="1"
|
||||||
|
;;
|
||||||
|
h)
|
||||||
|
echo 'Supported options:'
|
||||||
|
echo ' -a -- start auditor'
|
||||||
|
echo ' -b -- start backup/sync'
|
||||||
|
echo ' -c $CONF -- set configuration'
|
||||||
|
echo ' -e -- start exchange'
|
||||||
|
echo ' -f -- start fakebank'
|
||||||
|
echo ' -h -- print this help'
|
||||||
|
echo ' -l $LOGLEVEL -- set log level'
|
||||||
|
echo ' -m -- start merchant'
|
||||||
|
echo ' -n -- start nexus'
|
||||||
|
echo ' -s -- start sandbox'
|
||||||
|
echo ' -v -- use valgrind'
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
l)
|
||||||
|
LOGLEVEL="$OPTARG"
|
||||||
|
;;
|
||||||
|
m)
|
||||||
|
START_MERCHANT="1"
|
||||||
|
;;
|
||||||
|
n)
|
||||||
|
START_NEXUS="1"
|
||||||
|
;;
|
||||||
|
s)
|
||||||
|
START_SANDBOX="1"
|
||||||
|
;;
|
||||||
|
v)
|
||||||
|
USE_VALGRIND="valgrind --leak-check=yes"
|
||||||
|
DEFAULT_SLEEP="2"
|
||||||
|
;;
|
||||||
|
?)
|
||||||
|
exit_fail "Unrecognized command line option"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Starting with configuration file at: $CONF_ORIG"
|
||||||
|
CONF="$CONF_ORIG.edited"
|
||||||
|
cp "${CONF_ORIG}" "${CONF}"
|
||||||
|
|
||||||
|
echo -n "Testing for jq"
|
||||||
|
jq -h > /dev/null || exit_skip " jq required"
|
||||||
|
echo " FOUND"
|
||||||
|
|
||||||
|
if [ "1" = "$START_EXCHANGE" ]
|
||||||
|
then
|
||||||
|
echo -n "Testing for Taler exchange"
|
||||||
|
taler-exchange-httpd -h > /dev/null || exit_skip " taler-exchange-httpd required"
|
||||||
|
echo " FOUND"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "1" = "$START_MERCHANT" ]
|
||||||
|
then
|
||||||
|
echo -n "Testing for Taler merchant"
|
||||||
|
taler-merchant-httpd -h > /dev/null || exit_skip " taler-merchant-httpd required"
|
||||||
|
echo " FOUND"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "1" = "$START_BACKUP" ]
|
||||||
|
then
|
||||||
|
echo -n "Testing for sync-httpd"
|
||||||
|
sync-httpd -h > /dev/null || exit_skip " sync-httpd required"
|
||||||
|
echo " FOUND"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "1" = "$START_NEXUS" ]
|
||||||
|
then
|
||||||
|
echo -n "Testing for libeufin-cli"
|
||||||
|
libeufin-cli --help >/dev/null </dev/null || exit_skip " MISSING"
|
||||||
|
echo " FOUND"
|
||||||
|
fi
|
||||||
|
|
||||||
|
EXCHANGE_URL=$(taler-config -c "$CONF" -s "EXCHANGE" -o "BASE_URL")
|
||||||
|
CURRENCY=$(taler-config -c "$CONF" -s "TALER" -o "CURRENCY")
|
||||||
|
|
||||||
|
register_sandbox_account() {
|
||||||
|
export LIBEUFIN_SANDBOX_USERNAME="$1"
|
||||||
|
export LIBEUFIN_SANDBOX_PASSWORD="$2"
|
||||||
|
# FIXME-MS: delete should be removed after we make 'register' idempotent!
|
||||||
|
libeufin-cli sandbox \
|
||||||
|
demobank \
|
||||||
|
delete \
|
||||||
|
--bank-account "$1" &> /dev/null || true
|
||||||
|
libeufin-cli sandbox \
|
||||||
|
demobank \
|
||||||
|
register --name "$3"
|
||||||
|
unset LIBEUFIN_SANDBOX_USERNAME
|
||||||
|
unset LIBEUFIN_SANDBOX_PASSWORD
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BANK_PORT=$(taler-config -c "$CONF" -s "BANK" -o "HTTP_PORT")
|
||||||
|
if [ "1" = "$START_NEXUS" ]
|
||||||
|
then
|
||||||
|
NEXUS_PORT="$BANK_PORT"
|
||||||
|
SANDBOX_PORT="1$BANK_PORT"
|
||||||
|
else
|
||||||
|
NEXUS_PORT="0"
|
||||||
|
SANDBOX_PORT="1$BANK_PORT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "1" = "$START_SANDBOX" ]
|
||||||
|
then
|
||||||
|
export LIBEUFIN_SANDBOX_DB_CONNECTION=$(taler-config -c "$CONF" -s "libeufin-sandbox" -o "DB_CONNECTION")
|
||||||
|
|
||||||
|
# Create the default demobank.
|
||||||
|
echo -n "Configuring sandbox "
|
||||||
|
libeufin-sandbox config --currency "$CURRENCY" default &> libeufin-sandbox-config.log
|
||||||
|
echo "DONE"
|
||||||
|
echo -n "Launching sandbox "
|
||||||
|
export LIBEUFIN_SANDBOX_ADMIN_PASSWORD="secret"
|
||||||
|
libeufin-sandbox serve \
|
||||||
|
--port "$SANDBOX_PORT" \
|
||||||
|
> libeufin-sandbox-stdout.log \
|
||||||
|
2> libeufin-sandbox-stderr.log &
|
||||||
|
echo $! > libeufin-sandbox.pid
|
||||||
|
echo "DONE"
|
||||||
|
export LIBEUFIN_SANDBOX_URL="http://localhost:$SANDBOX_PORT/"
|
||||||
|
OK="0"
|
||||||
|
echo -n "Waiting for Sandbox ..."
|
||||||
|
for n in $(seq 1 100); do
|
||||||
|
echo -n "."
|
||||||
|
sleep "$DEFAULT_SLEEP"
|
||||||
|
wget --timeout=1 \
|
||||||
|
--tries=3 \
|
||||||
|
--waitretry=0 \
|
||||||
|
-o /dev/null \
|
||||||
|
-O /dev/null \
|
||||||
|
"$LIBEUFIN_SANDBOX_URL" || continue
|
||||||
|
OK="1"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
if [ "1" != "$OK" ]
|
||||||
|
then
|
||||||
|
exit_skip "Failed to launch services (sandbox)"
|
||||||
|
fi
|
||||||
|
echo "OK"
|
||||||
|
echo -n "Register Sandbox users ..."
|
||||||
|
register_sandbox_account fortytwo x "Forty Two"
|
||||||
|
register_sandbox_account fortythree x "Forty Three"
|
||||||
|
register_sandbox_account exchange x "Exchange Company"
|
||||||
|
register_sandbox_account tor x "Tor Project"
|
||||||
|
register_sandbox_account gnunet x "GNUnet"
|
||||||
|
register_sandbox_account tutorial x "Tutorial"
|
||||||
|
register_sandbox_account survey x "Survey"
|
||||||
|
echo " DONE"
|
||||||
|
|
||||||
|
echo -n "Fixing up exchange's PAYTO_URI in the config ..."
|
||||||
|
export LIBEUFIN_SANDBOX_USERNAME="exchange"
|
||||||
|
export LIBEUFIN_SANDBOX_PASSWORD="x"
|
||||||
|
EXCHANGE_PAYTO=$(libeufin-cli sandbox demobank info --bank-account exchange | jq --raw-output '.paytoUri')
|
||||||
|
taler-config -c "$CONF" -s exchange-account-1 -o "PAYTO_URI" -V "$EXCHANGE_PAYTO"
|
||||||
|
echo " OK"
|
||||||
|
|
||||||
|
echo -n "Setting this exchange as the bank's default ..."
|
||||||
|
libeufin-sandbox default-exchange "$EXCHANGE_URL" "$EXCHANGE_PAYTO"
|
||||||
|
echo " OK"
|
||||||
|
|
||||||
|
# Prepare EBICS: create Ebics host and Exchange subscriber.
|
||||||
|
# Shortly becoming admin to setup Ebics.
|
||||||
|
export LIBEUFIN_SANDBOX_USERNAME="admin"
|
||||||
|
export LIBEUFIN_SANDBOX_PASSWORD="secret"
|
||||||
|
echo -n "Create EBICS host at Sandbox.."
|
||||||
|
# FIXME-MS: || true should be removed after we make 'create' idempotent!
|
||||||
|
libeufin-cli sandbox \
|
||||||
|
--sandbox-url "$LIBEUFIN_SANDBOX_URL" \
|
||||||
|
ebicshost create --host-id talerebics &> libeufin-sandbox-ebicshost-create.log || true
|
||||||
|
echo "OK"
|
||||||
|
echo -n "Create exchange EBICS subscriber at Sandbox.."
|
||||||
|
# FIXME-MS: || true should be removed after we make 'new-ebicssubscriber' idempotent!
|
||||||
|
libeufin-cli sandbox \
|
||||||
|
demobank new-ebicssubscriber --host-id talerebics \
|
||||||
|
--user-id exchangeebics --partner-id talerpartner \
|
||||||
|
--bank-account exchange &> libeufin-sandbox-ebicsscubscriber.log || true
|
||||||
|
# that's a username _and_ a bank account name
|
||||||
|
echo "OK"
|
||||||
|
unset LIBEUFIN_SANDBOX_USERNAME
|
||||||
|
unset LIBEUFIN_SANDBOX_PASSWORD
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "1" = "$START_NEXUS" ]
|
||||||
|
then
|
||||||
|
echo "Setting up Nexus ..."
|
||||||
|
|
||||||
|
# Prepare Nexus, which is the side actually talking
|
||||||
|
# to the exchange.
|
||||||
|
export LIBEUFIN_NEXUS_DB_CONNECTION=$(taler-config -c "$CONF" -s "libeufin-nexus" -o "DB_CONNECTION")
|
||||||
|
|
||||||
|
# For convenience, username and password are
|
||||||
|
# identical to those used at the Sandbox.
|
||||||
|
echo -n "Create exchange Nexus user ..."
|
||||||
|
libeufin-nexus superuser exchange --password x
|
||||||
|
echo "OK"
|
||||||
|
libeufin-nexus serve --port "$NEXUS_PORT" \
|
||||||
|
2> libeufin-nexus-stderr.log \
|
||||||
|
> libeufin-nexus-stdout.log &
|
||||||
|
echo $! > libeufin-nexus.pid
|
||||||
|
export LIBEUFIN_NEXUS_URL="http://localhost:$NEXUS_PORT"
|
||||||
|
echo -n "Waiting for Nexus ..."
|
||||||
|
OK="0"
|
||||||
|
for n in $(seq 1 100); do
|
||||||
|
echo -n "."
|
||||||
|
sleep "$DEFAULT_SLEEP"
|
||||||
|
wget --timeout=1 \
|
||||||
|
--tries=3 \
|
||||||
|
--waitretry=0 \
|
||||||
|
-o /dev/null \
|
||||||
|
-O /dev/null \
|
||||||
|
"$LIBEUFIN_NEXUS_URL" || continue
|
||||||
|
OK="1"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
if [ "1" != "$OK" ]
|
||||||
|
then
|
||||||
|
exit_skip "Failed to launch services (bank)"
|
||||||
|
fi
|
||||||
|
echo " OK"
|
||||||
|
|
||||||
|
export LIBEUFIN_NEXUS_USERNAME=exchange
|
||||||
|
export LIBEUFIN_NEXUS_PASSWORD=x
|
||||||
|
echo -n "Creating a EBICS connection at Nexus ..."
|
||||||
|
libeufin-cli connections new-ebics-connection \
|
||||||
|
--ebics-url "http://localhost:$SANDBOX_PORT/ebicsweb" \
|
||||||
|
--host-id talerebics \
|
||||||
|
--partner-id talerpartner \
|
||||||
|
--ebics-user-id exchangeebics \
|
||||||
|
talerconn
|
||||||
|
echo "OK"
|
||||||
|
|
||||||
|
echo -n "Setup EBICS keying ..."
|
||||||
|
libeufin-cli connections connect talerconn > /dev/null
|
||||||
|
echo "OK"
|
||||||
|
echo -n "Download bank account name from Sandbox ..."
|
||||||
|
libeufin-cli connections download-bank-accounts talerconn
|
||||||
|
echo "OK"
|
||||||
|
echo -n "Importing bank account info into Nexus ..."
|
||||||
|
libeufin-cli connections import-bank-account \
|
||||||
|
--offered-account-id exchange \
|
||||||
|
--nexus-bank-account-id exchange-nexus \
|
||||||
|
talerconn
|
||||||
|
echo "OK"
|
||||||
|
echo -n "Setup payments submission task..."
|
||||||
|
# Tries every second.
|
||||||
|
libeufin-cli accounts task-schedule \
|
||||||
|
--task-type submit \
|
||||||
|
--task-name exchange-payments \
|
||||||
|
--task-cronspec "* * *" \
|
||||||
|
exchange-nexus
|
||||||
|
echo "OK"
|
||||||
|
# Tries every second. Ask C52
|
||||||
|
echo -n "Setup history fetch task..."
|
||||||
|
libeufin-cli accounts task-schedule \
|
||||||
|
--task-type fetch \
|
||||||
|
--task-name exchange-history \
|
||||||
|
--task-cronspec "* * *" \
|
||||||
|
--task-param-level report \
|
||||||
|
--task-param-range-type latest \
|
||||||
|
exchange-nexus
|
||||||
|
echo "OK"
|
||||||
|
# create Taler facade.
|
||||||
|
echo -n "Create the Taler facade at Nexus..."
|
||||||
|
libeufin-cli facades \
|
||||||
|
new-taler-wire-gateway-facade \
|
||||||
|
--currency TESTKUDOS --facade-name test-facade \
|
||||||
|
talerconn exchange-nexus
|
||||||
|
echo "OK"
|
||||||
|
# Facade schema: http://localhost:$NEXUS_PORT/facades/test-facade/taler-wire-gateway/
|
||||||
|
# FIXME: set the above URL automatically in the configuration?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "1" = "$START_FAKEBANK" ]
|
||||||
|
then
|
||||||
|
echo "Setting up fakebank ..."
|
||||||
|
$USE_VALGRIND taler-fakebank-run -c "$CONF" -L "$LOGLEVEL" 2> taler-fakebank-run.log &
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ "1" = "$START_EXCHANGE" ]
|
||||||
|
then
|
||||||
|
echo -n "Starting exchange ..."
|
||||||
|
|
||||||
|
EXCHANGE_PORT=$(taler-config -c "$CONF" -s EXCHANGE -o PORT)
|
||||||
|
EXCHANGE_URL="http://localhost:${EXCHANGE_PORT}/"
|
||||||
|
MASTER_PRIV_FILE=$(taler-config -f -c "${CONF}" -s "EXCHANGE-OFFLINE" -o "MASTER_PRIV_FILE")
|
||||||
|
MASTER_PRIV_DIR=$(dirname "$MASTER_PRIV_FILE")
|
||||||
|
mkdir -p "${MASTER_PRIV_DIR}"
|
||||||
|
gnunet-ecc -g1 "$MASTER_PRIV_FILE" > /dev/null 2> /dev/null
|
||||||
|
MASTER_PUB=$(gnunet-ecc -p "${MASTER_PRIV_FILE}")
|
||||||
|
MPUB=$(taler-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY)
|
||||||
|
if [ "$MPUB" != "$MASTER_PUB" ]
|
||||||
|
then
|
||||||
|
echo -n " patching master_pub ($MASTER_PUB)..."
|
||||||
|
taler-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY -V "$MASTER_PUB"
|
||||||
|
fi
|
||||||
|
taler-exchange-dbinit -c "$CONF"
|
||||||
|
$USE_VALGRIND taler-exchange-secmod-eddsa -c "$CONF" -L "$LOGLEVEL" 2> taler-exchange-secmod-eddsa.log &
|
||||||
|
$USE_VALGRIND taler-exchange-secmod-rsa -c "$CONF" -L "$LOGLEVEL" 2> taler-exchange-secmod-rsa.log &
|
||||||
|
$USE_VALGRIND taler-exchange-secmod-cs -c "$CONF" -L "$LOGLEVEL" 2> taler-exchange-secmod-cs.log &
|
||||||
|
$USE_VALGRIND taler-exchange-httpd -c "$CONF" -L "$LOGLEVEL" 2> taler-exchange-httpd.log &
|
||||||
|
EXCHANGE_HTTPD_PID=$!
|
||||||
|
$USE_VALGRIND taler-exchange-wirewatch -c "$CONF" 2> taler-exchange-wirewatch.log &
|
||||||
|
WIREWATCH_PID=$!
|
||||||
|
$USE_VALGRIND taler-exchange-aggregator -c "$CONF" 2> taler-exchange-aggregator.log &
|
||||||
|
AGGREGATOR_PID=$!
|
||||||
|
$USE_VALGRIND taler-exchange-transfer -c "$CONF" 2> taler-exchange-transfer.log &
|
||||||
|
TRANSFER_PID=$!
|
||||||
|
echo " DONE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "1" = "$START_MERCHANT" ]
|
||||||
|
then
|
||||||
|
echo -n "Starting merchant ..."
|
||||||
|
MEPUB=$(taler-config -c "$CONF" -s merchant-exchange-benchmark -o MASTER_KEY)
|
||||||
|
MXPUB=${MASTER_PUB:-$(taler-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY)}
|
||||||
|
if [ "$MEPUB" != "$MXPUB" ]
|
||||||
|
then
|
||||||
|
echo -n " patching master_pub ($MXPUB)..."
|
||||||
|
taler-config -c "$CONF" -s merchant-exchange-benchmark -o MASTER_KEY -V "$MXPUB"
|
||||||
|
fi
|
||||||
|
MERCHANT_PORT=$(taler-config -c "$CONF" -s MERCHANT -o PORT)
|
||||||
|
MERCHANT_URL="http://localhost:${MERCHANT_PORT}/"
|
||||||
|
taler-merchant-dbinit -c "$CONF"
|
||||||
|
$USE_VALGRIND taler-merchant-httpd -c "$CONF" -L "$LOGLEVEL" 2> taler-merchant-httpd.log &
|
||||||
|
MERCHANT_HTTPD_PID=$!
|
||||||
|
$USE_VALGRIND taler-merchant-webhook -c "$CONF" -L "$LOGLEVEL" 2> taler-merchant-webhook.log &
|
||||||
|
MERCHANT_WEBHOOK_PID=$!
|
||||||
|
echo " DONE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "1" = "$START_BACKUP" ]
|
||||||
|
then
|
||||||
|
echo -n "Starting sync ..."
|
||||||
|
SYNC_PORT=$(taler-config -c "$CONF" -s SYNC -o PORT)
|
||||||
|
SYNC_URL="http://localhost:${SYNC_PORT}/"
|
||||||
|
sync-dbinit -c "$CONF"
|
||||||
|
$USE_VALGRIND sync-httpd -c "$CONF" -L "$LOGLEVEL" 2> sync-httpd.log &
|
||||||
|
echo " DONE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ "1" = "$START_AUDITOR" ]
|
||||||
|
then
|
||||||
|
echo -n "Starting auditor ..."
|
||||||
|
AUDITOR_URL="http://localhost:8083/"
|
||||||
|
AUDITOR_PRIV_FILE=$(taler-config -f -c "$CONF" -s AUDITOR -o AUDITOR_PRIV_FILE)
|
||||||
|
AUDITOR_PRIV_DIR=$(dirname "$AUDITOR_PRIV_FILE")
|
||||||
|
mkdir -p "$AUDITOR_PRIV_DIR"
|
||||||
|
gnunet-ecc -g1 "$AUDITOR_PRIV_FILE" > /dev/null 2> /dev/null
|
||||||
|
AUDITOR_PUB=$(gnunet-ecc -p "${AUDITOR_PRIV_FILE}")
|
||||||
|
MAPUB=${MASTER_PUB:-$(taler-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY)}
|
||||||
|
taler-auditor-dbinit -c "$CONF"
|
||||||
|
taler-auditor-exchange -c "$CONF" -m "$MAPUB" -u "$EXCHANGE_URL"
|
||||||
|
$USE_VALGRIND taler-auditor-httpd -L "$LOGLEVEL" -c "$CONF" 2> taler-auditor-httpd.log &
|
||||||
|
echo " DONE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "1" = "$START_NEXUS" || "1" = "$START_FAKEBANK" ]]
|
||||||
|
then
|
||||||
|
echo -n "Waiting for the bank"
|
||||||
|
# Wait for bank to be available (usually the slowest)
|
||||||
|
OK="0"
|
||||||
|
for n in $(seq 1 300)
|
||||||
|
do
|
||||||
|
echo -n "."
|
||||||
|
sleep "$DEFAULT_SLEEP"
|
||||||
|
# bank
|
||||||
|
wget --tries=1 \
|
||||||
|
--waitretry=0 \
|
||||||
|
--timeout=1 \
|
||||||
|
--user admin \
|
||||||
|
--password secret \
|
||||||
|
"http://localhost:8082/" \
|
||||||
|
-o /dev/null \
|
||||||
|
-O /dev/null >/dev/null || continue
|
||||||
|
OK="1"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
if [ "1" != "$OK" ]
|
||||||
|
then
|
||||||
|
exit_skip "Failed to launch services (bank)"
|
||||||
|
fi
|
||||||
|
echo " OK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "Waiting for Taler services ..."
|
||||||
|
# Wait for all other taler services to be available
|
||||||
|
for n in $(seq 1 20)
|
||||||
|
do
|
||||||
|
echo -n "."
|
||||||
|
sleep "$DEFAULT_SLEEP"
|
||||||
|
OK="0"
|
||||||
|
if [ "1" = "$START_EXCHANGE" ]
|
||||||
|
then
|
||||||
|
wget \
|
||||||
|
--tries=1 \
|
||||||
|
--timeout=1 \
|
||||||
|
"http://localhost:8081/config" \
|
||||||
|
-o /dev/null \
|
||||||
|
-O /dev/null >/dev/null || continue
|
||||||
|
fi
|
||||||
|
if [ "1" = "$START_MERCHANT" ]
|
||||||
|
then
|
||||||
|
wget \
|
||||||
|
--tries=1 \
|
||||||
|
--timeout=1 \
|
||||||
|
"${MERCHANT_URL}config" \
|
||||||
|
-o /dev/null \
|
||||||
|
-O /dev/null >/dev/null || continue
|
||||||
|
fi
|
||||||
|
if [ "1" = "$START_BACKUP" ]
|
||||||
|
then
|
||||||
|
wget \
|
||||||
|
--tries=1 \
|
||||||
|
--timeout=1 \
|
||||||
|
"${SYNC_URL}config" \
|
||||||
|
-o /dev/null \
|
||||||
|
-O /dev/null >/dev/null || continue
|
||||||
|
fi
|
||||||
|
if [ "1" = "$START_AUDITOR" ]
|
||||||
|
then
|
||||||
|
wget \
|
||||||
|
--tries=1 \
|
||||||
|
--timeout=1 \
|
||||||
|
"${AUDITOR_URL}config" \
|
||||||
|
-o /dev/null \
|
||||||
|
-O /dev/null >/dev/null || continue
|
||||||
|
fi
|
||||||
|
OK="1"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
if [ 1 != "$OK" ]
|
||||||
|
then
|
||||||
|
exit_skip "Failed to launch (some) Taler services"
|
||||||
|
fi
|
||||||
|
echo " OK"
|
||||||
|
|
||||||
|
if [ "1" = "$START_EXCHANGE" ]
|
||||||
|
then
|
||||||
|
echo -n "Wait for exchange /management/keys to be ready "
|
||||||
|
OK="0"
|
||||||
|
LAST_RESPONSE=$(mktemp tmp-last-response.XXXXXXXX)
|
||||||
|
for n in $(seq 1 50)
|
||||||
|
do
|
||||||
|
echo -n "."
|
||||||
|
sleep "$DEFAULT_SLEEP"
|
||||||
|
# exchange
|
||||||
|
wget \
|
||||||
|
--tries=3 \
|
||||||
|
--waitretry=0 \
|
||||||
|
--timeout=1 \
|
||||||
|
"http://localhost:8081/management/keys"\
|
||||||
|
-o /dev/null \
|
||||||
|
-O "$LAST_RESPONSE" \
|
||||||
|
>/dev/null || continue
|
||||||
|
OK="1"
|
||||||
|
break;
|
||||||
|
done
|
||||||
|
if [ "1" != "$OK" ]
|
||||||
|
then
|
||||||
|
cat "$LAST_RESPONSE"
|
||||||
|
exit_skip "Failed to setup exchange keys, check secmod logs"
|
||||||
|
fi
|
||||||
|
rm "$LAST_RESPONSE"
|
||||||
|
echo " OK"
|
||||||
|
|
||||||
|
echo -n "Setting up exchange keys ..."
|
||||||
|
taler-exchange-offline -c "$CONF" \
|
||||||
|
download \
|
||||||
|
sign \
|
||||||
|
wire-fee now iban "$CURRENCY:0.01" "$CURRENCY:0.01" \
|
||||||
|
global-fee now "$CURRENCY:0.01" "$CURRENCY:0.01" "$CURRENCY:0.01" 1h 1year 5 \
|
||||||
|
upload &> taler-exchange-offline.log
|
||||||
|
echo "OK"
|
||||||
|
for ASEC in $(taler-config -c "$CONF" -S | grep -i "exchange-account-")
|
||||||
|
do
|
||||||
|
ENABLED=$(taler-config -c "$CONF" -s "$ASEC" -o "ENABLE_CREDIT")
|
||||||
|
if [ "YES" = "$ENABLED" ]
|
||||||
|
then
|
||||||
|
echo -n "Configuring bank account $ASEC ..."
|
||||||
|
EXCHANGE_PAYTO_URI=$(taler-config -c "$CONF" -s "$ASEC" -o "PAYTO_URI")
|
||||||
|
taler-exchange-offline -c "$CONF" \
|
||||||
|
enable-account "$EXCHANGE_PAYTO_URI" \
|
||||||
|
upload &> "taler-exchange-offline-account-$ASEC.log"
|
||||||
|
echo " OK"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ "1" = "$START_AUDITOR" ]
|
||||||
|
then
|
||||||
|
echo -n "Enabling auditor ..."
|
||||||
|
taler-exchange-offline -c "$CONF" \
|
||||||
|
enable-auditor $AUDITOR_PUB $AUDITOR_URL "$CURRENCY Auditor" \
|
||||||
|
upload &> taler-exchange-offline-auditor.log
|
||||||
|
echo "OK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "Checking /keys "
|
||||||
|
OK="0"
|
||||||
|
LAST_RESPONSE=$(mktemp tmp-last-response.XXXXXXXX)
|
||||||
|
for n in $(seq 1 10)
|
||||||
|
do
|
||||||
|
echo -n "."
|
||||||
|
sleep "$DEFAULT_SLEEP"
|
||||||
|
wget \
|
||||||
|
--tries=1 \
|
||||||
|
--timeout=1 \
|
||||||
|
"http://localhost:8081/keys" \
|
||||||
|
-o /dev/null \
|
||||||
|
-O "$LAST_RESPONSE" \
|
||||||
|
>/dev/null || continue
|
||||||
|
OK="1"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
if [ "1" != "$OK" ]
|
||||||
|
then
|
||||||
|
cat "$LAST_RESPONSE"
|
||||||
|
exit_skip " Failed to setup keys"
|
||||||
|
fi
|
||||||
|
rm "$LAST_RESPONSE"
|
||||||
|
echo " OK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "1" = "$START_AUDITOR" ]
|
||||||
|
then
|
||||||
|
echo -n "Setting up auditor signatures ..."
|
||||||
|
timeout 15 taler-auditor-offline -c "$CONF" \
|
||||||
|
download \
|
||||||
|
sign \
|
||||||
|
upload &> taler-auditor-offline.log
|
||||||
|
echo " OK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Signal caller that we are ready.
|
||||||
|
echo "<<READY>>"
|
||||||
|
|
||||||
|
# Wait until caller stops us.
|
||||||
|
read
|
||||||
|
|
||||||
|
exit 0
|
@ -306,8 +306,9 @@ run (void *cls,
|
|||||||
GNUNET_asprintf (&amount_5, "%s:5", currency);
|
GNUNET_asprintf (&amount_5, "%s:5", currency);
|
||||||
GNUNET_asprintf (&amount_4, "%s:4", currency);
|
GNUNET_asprintf (&amount_4, "%s:4", currency);
|
||||||
GNUNET_asprintf (&amount_1, "%s:1", currency);
|
GNUNET_asprintf (&amount_1, "%s:1", currency);
|
||||||
GNUNET_assert (GNUNET_OK == TALER_amount_set_zero (currency,
|
GNUNET_assert (GNUNET_OK ==
|
||||||
&total_reserve_amount));
|
TALER_amount_set_zero (currency,
|
||||||
|
&total_reserve_amount));
|
||||||
total_reserve_amount.value = 5 * howmany_coins;
|
total_reserve_amount.value = 5 * howmany_coins;
|
||||||
GNUNET_asprintf (&withdraw_fee_str,
|
GNUNET_asprintf (&withdraw_fee_str,
|
||||||
"%s:0.1",
|
"%s:0.1",
|
||||||
@ -537,7 +538,8 @@ parallel_benchmark (TALER_TESTING_Main main_cb,
|
|||||||
struct GNUNET_OS_Process *exchange_slave = NULL;
|
struct GNUNET_OS_Process *exchange_slave = NULL;
|
||||||
struct GNUNET_DISK_PipeHandle *exchange_slave_pipe;
|
struct GNUNET_DISK_PipeHandle *exchange_slave_pipe;
|
||||||
|
|
||||||
if ( (MODE_CLIENT == mode) || (MODE_BOTH == mode) )
|
if ( (MODE_CLIENT == mode) ||
|
||||||
|
(MODE_BOTH == mode) )
|
||||||
{
|
{
|
||||||
if (use_fakebank)
|
if (use_fakebank)
|
||||||
{
|
{
|
||||||
@ -587,7 +589,8 @@ parallel_benchmark (TALER_TESTING_Main main_cb,
|
|||||||
"-c", config_file,
|
"-c", config_file,
|
||||||
"-C",
|
"-C",
|
||||||
NULL);
|
NULL);
|
||||||
if ( (NULL == exchanged) && (MODE_BOTH == mode) )
|
if ( (NULL == exchanged) &&
|
||||||
|
(MODE_BOTH == mode) )
|
||||||
{
|
{
|
||||||
if (-1 != fakebank)
|
if (-1 != fakebank)
|
||||||
{
|
{
|
||||||
@ -978,15 +981,19 @@ main (int argc,
|
|||||||
logfile);
|
logfile);
|
||||||
if (NULL == mode_str)
|
if (NULL == mode_str)
|
||||||
mode = MODE_BOTH;
|
mode = MODE_BOTH;
|
||||||
else if (0 == strcmp (mode_str, "exchange"))
|
else if (0 == strcmp (mode_str,
|
||||||
|
"exchange"))
|
||||||
mode = MODE_EXCHANGE;
|
mode = MODE_EXCHANGE;
|
||||||
else if (0 == strcmp (mode_str, "client"))
|
else if (0 == strcmp (mode_str,
|
||||||
|
"client"))
|
||||||
mode = MODE_CLIENT;
|
mode = MODE_CLIENT;
|
||||||
else if (0 == strcmp (mode_str, "both"))
|
else if (0 == strcmp (mode_str,
|
||||||
|
"both"))
|
||||||
mode = MODE_BOTH;
|
mode = MODE_BOTH;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TALER_LOG_ERROR ("Unknown mode given: '%s'\n", mode_str);
|
TALER_LOG_ERROR ("Unknown mode given: '%s'\n",
|
||||||
|
mode_str);
|
||||||
GNUNET_free (cfg_filename);
|
GNUNET_free (cfg_filename);
|
||||||
return BAD_CONFIG_FILE;
|
return BAD_CONFIG_FILE;
|
||||||
}
|
}
|
||||||
@ -1137,7 +1144,9 @@ main (int argc,
|
|||||||
if (GNUNET_OK == result)
|
if (GNUNET_OK == result)
|
||||||
{
|
{
|
||||||
struct rusage usage;
|
struct rusage usage;
|
||||||
GNUNET_assert (0 == getrusage (RUSAGE_CHILDREN, &usage));
|
|
||||||
|
GNUNET_assert (0 == getrusage (RUSAGE_CHILDREN,
|
||||||
|
&usage));
|
||||||
fprintf (stdout,
|
fprintf (stdout,
|
||||||
"Executed (Withdraw=%u, Deposit=%u, Refresh~=%5.2f) * Reserve=%u * Parallel=%u, operations in %s\n",
|
"Executed (Withdraw=%u, Deposit=%u, Refresh~=%5.2f) * Reserve=%u * Parallel=%u, operations in %s\n",
|
||||||
howmany_coins,
|
howmany_coins,
|
||||||
|
@ -388,14 +388,15 @@ load_offline_key (int do_create)
|
|||||||
* add operation result.
|
* add operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure with a `struct DenominationAddRequest`
|
* @param cls closure with a `struct DenominationAddRequest`
|
||||||
* @param hr HTTP response data
|
* @param adr response data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
denomination_add_cb (
|
denomination_add_cb (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
const struct TALER_EXCHANGE_AuditorAddDenominationResponse *adr)
|
||||||
{
|
{
|
||||||
struct DenominationAddRequest *dar = cls;
|
struct DenominationAddRequest *dar = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &adr->hr;
|
||||||
|
|
||||||
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
||||||
{
|
{
|
||||||
@ -949,11 +950,11 @@ do_show (char *const *args)
|
|||||||
json_t *keys;
|
json_t *keys;
|
||||||
const char *err_name;
|
const char *err_name;
|
||||||
unsigned int err_line;
|
unsigned int err_line;
|
||||||
json_t *denomkeys;
|
const json_t *denomkeys;
|
||||||
struct TALER_MasterPublicKeyP mpub;
|
struct TALER_MasterPublicKeyP mpub;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("denoms",
|
GNUNET_JSON_spec_array_const ("denoms",
|
||||||
&denomkeys),
|
&denomkeys),
|
||||||
GNUNET_JSON_spec_fixed_auto ("master_public_key",
|
GNUNET_JSON_spec_fixed_auto ("master_public_key",
|
||||||
&mpub),
|
&mpub),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
@ -997,11 +998,9 @@ do_show (char *const *args)
|
|||||||
{
|
{
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
/* do NOT consume input if next argument is '-' */
|
/* do NOT consume input if next argument is '-' */
|
||||||
if ( (NULL != args[0]) &&
|
if ( (NULL != args[0]) &&
|
||||||
@ -1138,10 +1137,10 @@ do_sign (char *const *args)
|
|||||||
const char *err_name;
|
const char *err_name;
|
||||||
unsigned int err_line;
|
unsigned int err_line;
|
||||||
struct TALER_MasterPublicKeyP mpub;
|
struct TALER_MasterPublicKeyP mpub;
|
||||||
json_t *denomkeys;
|
const json_t *denomkeys;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("denoms",
|
GNUNET_JSON_spec_array_const ("denoms",
|
||||||
&denomkeys),
|
&denomkeys),
|
||||||
GNUNET_JSON_spec_fixed_auto ("master_public_key",
|
GNUNET_JSON_spec_fixed_auto ("master_public_key",
|
||||||
&mpub),
|
&mpub),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
@ -1196,11 +1195,9 @@ do_sign (char *const *args)
|
|||||||
{
|
{
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
next (args);
|
next (args);
|
||||||
}
|
}
|
||||||
|
@ -1301,13 +1301,15 @@ upload_signkey_revocation (const char *exchange_url,
|
|||||||
* Function called with information about the post auditor add operation result.
|
* Function called with information about the post auditor add operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure with a `struct AuditorAddRequest`
|
* @param cls closure with a `struct AuditorAddRequest`
|
||||||
* @param hr HTTP response data
|
* @param mer response data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
auditor_add_cb (void *cls,
|
auditor_add_cb (
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
void *cls,
|
||||||
|
const struct TALER_EXCHANGE_ManagementAuditorEnableResponse *mer)
|
||||||
{
|
{
|
||||||
struct AuditorAddRequest *aar = cls;
|
struct AuditorAddRequest *aar = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &mer->hr;
|
||||||
|
|
||||||
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
||||||
{
|
{
|
||||||
@ -1401,13 +1403,15 @@ upload_auditor_add (const char *exchange_url,
|
|||||||
* Function called with information about the post auditor del operation result.
|
* Function called with information about the post auditor del operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure with a `struct AuditorDelRequest`
|
* @param cls closure with a `struct AuditorDelRequest`
|
||||||
* @param hr HTTP response data
|
* @param mdr response data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
auditor_del_cb (void *cls,
|
auditor_del_cb (void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
const struct
|
||||||
|
TALER_EXCHANGE_ManagementAuditorDisableResponse *mdr)
|
||||||
{
|
{
|
||||||
struct AuditorDelRequest *adr = cls;
|
struct AuditorDelRequest *adr = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &mdr->hr;
|
||||||
|
|
||||||
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
||||||
{
|
{
|
||||||
@ -1539,8 +1543,8 @@ upload_wire_add (const char *exchange_url,
|
|||||||
struct WireAddRequest *war;
|
struct WireAddRequest *war;
|
||||||
const char *err_name;
|
const char *err_name;
|
||||||
const char *conversion_url = NULL;
|
const char *conversion_url = NULL;
|
||||||
json_t *debit_restrictions;
|
const json_t *debit_restrictions;
|
||||||
json_t *credit_restrictions;
|
const json_t *credit_restrictions;
|
||||||
unsigned int err_line;
|
unsigned int err_line;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_string ("payto_uri",
|
GNUNET_JSON_spec_string ("payto_uri",
|
||||||
@ -1549,10 +1553,10 @@ upload_wire_add (const char *exchange_url,
|
|||||||
GNUNET_JSON_spec_string ("conversion_url",
|
GNUNET_JSON_spec_string ("conversion_url",
|
||||||
&conversion_url),
|
&conversion_url),
|
||||||
NULL),
|
NULL),
|
||||||
GNUNET_JSON_spec_json ("debit_restrictions",
|
GNUNET_JSON_spec_array_const ("debit_restrictions",
|
||||||
&debit_restrictions),
|
&debit_restrictions),
|
||||||
GNUNET_JSON_spec_json ("credit_restrictions",
|
GNUNET_JSON_spec_array_const ("credit_restrictions",
|
||||||
&credit_restrictions),
|
&credit_restrictions),
|
||||||
GNUNET_JSON_spec_timestamp ("validity_start",
|
GNUNET_JSON_spec_timestamp ("validity_start",
|
||||||
&start_time),
|
&start_time),
|
||||||
GNUNET_JSON_spec_fixed_auto ("master_sig_add",
|
GNUNET_JSON_spec_fixed_auto ("master_sig_add",
|
||||||
@ -1577,7 +1581,6 @@ upload_wire_add (const char *exchange_url,
|
|||||||
stderr,
|
stderr,
|
||||||
JSON_INDENT (2));
|
JSON_INDENT (2));
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1591,7 +1594,6 @@ upload_wire_add (const char *exchange_url,
|
|||||||
"payto:// URI `%s' is malformed\n",
|
"payto:// URI `%s' is malformed\n",
|
||||||
payto_uri);
|
payto_uri);
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1606,7 +1608,6 @@ upload_wire_add (const char *exchange_url,
|
|||||||
"payto URI is malformed: %s\n",
|
"payto URI is malformed: %s\n",
|
||||||
msg);
|
msg);
|
||||||
GNUNET_free (msg);
|
GNUNET_free (msg);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
global_ret = EXIT_INVALIDARGUMENT;
|
global_ret = EXIT_INVALIDARGUMENT;
|
||||||
return;
|
return;
|
||||||
@ -1629,7 +1630,6 @@ upload_wire_add (const char *exchange_url,
|
|||||||
GNUNET_CONTAINER_DLL_insert (war_head,
|
GNUNET_CONTAINER_DLL_insert (war_head,
|
||||||
war_tail,
|
war_tail,
|
||||||
war);
|
war);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1730,14 +1730,15 @@ upload_wire_del (const char *exchange_url,
|
|||||||
* Function called with information about the post wire fee operation result.
|
* Function called with information about the post wire fee operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure with a `struct WireFeeRequest`
|
* @param cls closure with a `struct WireFeeRequest`
|
||||||
* @param hr HTTP response data
|
* @param swr response data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
wire_fee_cb (
|
wire_fee_cb (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
const struct TALER_EXCHANGE_ManagementSetWireFeeResponse *swr)
|
||||||
{
|
{
|
||||||
struct WireFeeRequest *wfr = cls;
|
struct WireFeeRequest *wfr = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &swr->hr;
|
||||||
|
|
||||||
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
||||||
{
|
{
|
||||||
@ -1835,14 +1836,15 @@ upload_wire_fee (const char *exchange_url,
|
|||||||
* Function called with information about the post global fee operation result.
|
* Function called with information about the post global fee operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure with a `struct WireFeeRequest`
|
* @param cls closure with a `struct WireFeeRequest`
|
||||||
* @param hr HTTP response data
|
* @param gr response data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
global_fee_cb (
|
global_fee_cb (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
const struct TALER_EXCHANGE_ManagementSetGlobalFeeResponse *gr)
|
||||||
{
|
{
|
||||||
struct GlobalFeeRequest *gfr = cls;
|
struct GlobalFeeRequest *gfr = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &gr->hr;
|
||||||
|
|
||||||
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
||||||
{
|
{
|
||||||
@ -2102,13 +2104,13 @@ upload_keys (const char *exchange_url,
|
|||||||
struct UploadKeysRequest *ukr;
|
struct UploadKeysRequest *ukr;
|
||||||
const char *err_name;
|
const char *err_name;
|
||||||
unsigned int err_line;
|
unsigned int err_line;
|
||||||
json_t *denom_sigs;
|
const json_t *denom_sigs;
|
||||||
json_t *signkey_sigs;
|
const json_t *signkey_sigs;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("denom_sigs",
|
GNUNET_JSON_spec_array_const ("denom_sigs",
|
||||||
&denom_sigs),
|
&denom_sigs),
|
||||||
GNUNET_JSON_spec_json ("signkey_sigs",
|
GNUNET_JSON_spec_array_const ("signkey_sigs",
|
||||||
&signkey_sigs),
|
&signkey_sigs),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
@ -2224,7 +2226,6 @@ upload_keys (const char *exchange_url,
|
|||||||
}
|
}
|
||||||
GNUNET_free (pkd.sign_sigs);
|
GNUNET_free (pkd.sign_sigs);
|
||||||
GNUNET_free (pkd.denom_sigs);
|
GNUNET_free (pkd.denom_sigs);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2272,13 +2273,13 @@ upload_extensions (const char *exchange_url,
|
|||||||
size_t idx,
|
size_t idx,
|
||||||
const json_t *value)
|
const json_t *value)
|
||||||
{
|
{
|
||||||
json_t *extensions;
|
const json_t *extensions;
|
||||||
struct TALER_MasterSignatureP sig;
|
struct TALER_MasterSignatureP sig;
|
||||||
const char *err_name;
|
const char *err_name;
|
||||||
unsigned int err_line;
|
unsigned int err_line;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("extensions",
|
GNUNET_JSON_spec_object_const ("extensions",
|
||||||
&extensions),
|
&extensions),
|
||||||
GNUNET_JSON_spec_fixed_auto ("extensions_sig",
|
GNUNET_JSON_spec_fixed_auto ("extensions_sig",
|
||||||
&sig),
|
&sig),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
@ -2309,9 +2310,9 @@ upload_extensions (const char *exchange_url,
|
|||||||
struct TALER_ExtensionManifestsHashP h_manifests;
|
struct TALER_ExtensionManifestsHashP h_manifests;
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_JSON_extensions_manifests_hash (extensions, &h_manifests))
|
TALER_JSON_extensions_manifests_hash (extensions,
|
||||||
|
&h_manifests))
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"couldn't hash extensions' manifests\n");
|
"couldn't hash extensions' manifests\n");
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
@ -2328,7 +2329,6 @@ upload_extensions (const char *exchange_url,
|
|||||||
&master_pub,
|
&master_pub,
|
||||||
&sig))
|
&sig))
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"invalid signature for extensions\n");
|
"invalid signature for extensions\n");
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
@ -2343,8 +2343,9 @@ upload_extensions (const char *exchange_url,
|
|||||||
.extensions = extensions,
|
.extensions = extensions,
|
||||||
.extensions_sig = sig,
|
.extensions_sig = sig,
|
||||||
};
|
};
|
||||||
struct UploadExtensionsRequest *uer = GNUNET_new (struct
|
struct UploadExtensionsRequest *uer
|
||||||
UploadExtensionsRequest);
|
= GNUNET_new (struct UploadExtensionsRequest);
|
||||||
|
|
||||||
uer->idx = idx;
|
uer->idx = idx;
|
||||||
uer->h = TALER_EXCHANGE_management_post_extensions (
|
uer->h = TALER_EXCHANGE_management_post_extensions (
|
||||||
ctx,
|
ctx,
|
||||||
@ -2356,7 +2357,6 @@ upload_extensions (const char *exchange_url,
|
|||||||
uer_tail,
|
uer_tail,
|
||||||
uer);
|
uer);
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2364,14 +2364,15 @@ upload_extensions (const char *exchange_url,
|
|||||||
* Function called with information about the add partner operation.
|
* Function called with information about the add partner operation.
|
||||||
*
|
*
|
||||||
* @param cls closure with a `struct PartnerAddRequest`
|
* @param cls closure with a `struct PartnerAddRequest`
|
||||||
* @param hr HTTP response data
|
* @param apr response data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
add_partner_cb (
|
add_partner_cb (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
const struct TALER_EXCHANGE_ManagementAddPartnerResponse *apr)
|
||||||
{
|
{
|
||||||
struct PartnerAddRequest *par = cls;
|
struct PartnerAddRequest *par = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &apr->hr;
|
||||||
|
|
||||||
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
if (MHD_HTTP_NO_CONTENT != hr->http_status)
|
||||||
{
|
{
|
||||||
@ -4482,15 +4483,15 @@ do_show (char *const *args)
|
|||||||
json_t *keys;
|
json_t *keys;
|
||||||
const char *err_name;
|
const char *err_name;
|
||||||
unsigned int err_line;
|
unsigned int err_line;
|
||||||
json_t *denomkeys;
|
const json_t *denomkeys;
|
||||||
json_t *signkeys;
|
const json_t *signkeys;
|
||||||
struct TALER_MasterPublicKeyP mpub;
|
struct TALER_MasterPublicKeyP mpub;
|
||||||
struct TALER_SecurityModulePublicKeySetP secmset;
|
struct TALER_SecurityModulePublicKeySetP secmset;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("future_denoms",
|
GNUNET_JSON_spec_array_const ("future_denoms",
|
||||||
&denomkeys),
|
&denomkeys),
|
||||||
GNUNET_JSON_spec_json ("future_signkeys",
|
GNUNET_JSON_spec_array_const ("future_signkeys",
|
||||||
&signkeys),
|
&signkeys),
|
||||||
GNUNET_JSON_spec_fixed_auto ("master_pub",
|
GNUNET_JSON_spec_fixed_auto ("master_pub",
|
||||||
&mpub),
|
&mpub),
|
||||||
GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
|
GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
|
||||||
@ -4535,7 +4536,6 @@ do_show (char *const *args)
|
|||||||
"Fatal: exchange uses different master key!\n");
|
"Fatal: exchange uses different master key!\n");
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4544,7 +4544,6 @@ do_show (char *const *args)
|
|||||||
{
|
{
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4558,12 +4557,10 @@ do_show (char *const *args)
|
|||||||
{
|
{
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
next (args);
|
next (args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4883,15 +4880,15 @@ do_sign (char *const *args)
|
|||||||
json_t *keys;
|
json_t *keys;
|
||||||
const char *err_name;
|
const char *err_name;
|
||||||
unsigned int err_line;
|
unsigned int err_line;
|
||||||
json_t *denomkeys;
|
const json_t *denomkeys;
|
||||||
json_t *signkeys;
|
const json_t *signkeys;
|
||||||
struct TALER_MasterPublicKeyP mpub;
|
struct TALER_MasterPublicKeyP mpub;
|
||||||
struct TALER_SecurityModulePublicKeySetP secmset;
|
struct TALER_SecurityModulePublicKeySetP secmset;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("future_denoms",
|
GNUNET_JSON_spec_array_const ("future_denoms",
|
||||||
&denomkeys),
|
&denomkeys),
|
||||||
GNUNET_JSON_spec_json ("future_signkeys",
|
GNUNET_JSON_spec_array_const ("future_signkeys",
|
||||||
&signkeys),
|
&signkeys),
|
||||||
GNUNET_JSON_spec_fixed_auto ("master_pub",
|
GNUNET_JSON_spec_fixed_auto ("master_pub",
|
||||||
&mpub),
|
&mpub),
|
||||||
GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
|
GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
|
||||||
@ -4938,7 +4935,6 @@ do_sign (char *const *args)
|
|||||||
"Fatal: exchange uses different master key!\n");
|
"Fatal: exchange uses different master key!\n");
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4949,7 +4945,6 @@ do_sign (char *const *args)
|
|||||||
"Fatal: security module keys changed!\n");
|
"Fatal: security module keys changed!\n");
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4973,7 +4968,6 @@ do_sign (char *const *args)
|
|||||||
test_shutdown ();
|
test_shutdown ();
|
||||||
json_decref (signkey_sig_array);
|
json_decref (signkey_sig_array);
|
||||||
json_decref (denomkey_sig_array);
|
json_decref (denomkey_sig_array);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4985,7 +4979,6 @@ do_sign (char *const *args)
|
|||||||
GNUNET_JSON_pack_array_steal ("signkey_sigs",
|
GNUNET_JSON_pack_array_steal ("signkey_sigs",
|
||||||
signkey_sig_array)));
|
signkey_sig_array)));
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
json_decref (keys);
|
json_decref (keys);
|
||||||
next (args);
|
next (args);
|
||||||
}
|
}
|
||||||
|
@ -984,14 +984,18 @@ TEH_handler_age_withdraw_reveal (
|
|||||||
MHD_RESULT result = MHD_NO;
|
MHD_RESULT result = MHD_NO;
|
||||||
enum GNUNET_GenericReturnValue ret = GNUNET_SYSERR;
|
enum GNUNET_GenericReturnValue ret = GNUNET_SYSERR;
|
||||||
struct AgeRevealContext actx = {0};
|
struct AgeRevealContext actx = {0};
|
||||||
json_t *j_denoms_h;
|
const json_t *j_denoms_h;
|
||||||
json_t *j_coin_evs;
|
const json_t *j_coin_evs;
|
||||||
json_t *j_disclosed_coin_secrets;
|
const json_t *j_disclosed_coin_secrets;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_fixed_auto ("reserve_pub", &actx.reserve_pub),
|
GNUNET_JSON_spec_fixed_auto ("reserve_pub",
|
||||||
GNUNET_JSON_spec_json ("denoms_h", &j_denoms_h),
|
&actx.reserve_pub),
|
||||||
GNUNET_JSON_spec_json ("coin_evs", &j_coin_evs),
|
GNUNET_JSON_spec_array_const ("denoms_h",
|
||||||
GNUNET_JSON_spec_json ("disclosed_coin_secrets", &j_disclosed_coin_secrets),
|
&j_denoms_h),
|
||||||
|
GNUNET_JSON_spec_array_const ("coin_evs",
|
||||||
|
&j_coin_evs),
|
||||||
|
GNUNET_JSON_spec_array_const ("disclosed_coin_secrets",
|
||||||
|
&j_disclosed_coin_secrets),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1010,7 +1014,8 @@ TEH_handler_age_withdraw_reveal (
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
/* Extract denominations, blinded and disclosed coins */
|
/* Extract denominations, blinded and disclosed coins */
|
||||||
if (GNUNET_OK != parse_age_withdraw_reveal_json (
|
if (GNUNET_OK !=
|
||||||
|
parse_age_withdraw_reveal_json (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
j_denoms_h,
|
j_denoms_h,
|
||||||
j_coin_evs,
|
j_coin_evs,
|
||||||
@ -1020,7 +1025,8 @@ TEH_handler_age_withdraw_reveal (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
/* Find original commitment */
|
/* Find original commitment */
|
||||||
if (GNUNET_OK != find_original_commitment (
|
if (GNUNET_OK !=
|
||||||
|
find_original_commitment (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
&actx.ach,
|
&actx.ach,
|
||||||
&actx.reserve_pub,
|
&actx.reserve_pub,
|
||||||
@ -1029,7 +1035,8 @@ TEH_handler_age_withdraw_reveal (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
/* Ensure validity of denoms and the sum of amounts and fees */
|
/* Ensure validity of denoms and the sum of amounts and fees */
|
||||||
if (GNUNET_OK != are_denominations_valid (
|
if (GNUNET_OK !=
|
||||||
|
are_denominations_valid (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
actx.num_coins,
|
actx.num_coins,
|
||||||
actx.denoms_h,
|
actx.denoms_h,
|
||||||
@ -1043,7 +1050,8 @@ TEH_handler_age_withdraw_reveal (
|
|||||||
|
|
||||||
/* Verify the computed h_commitment equals the committed one and that coins
|
/* Verify the computed h_commitment equals the committed one and that coins
|
||||||
* have a maximum age group corresponding max_age (age-mask dependent) */
|
* have a maximum age group corresponding max_age (age-mask dependent) */
|
||||||
if (GNUNET_OK != verify_commitment_and_max_age (
|
if (GNUNET_OK !=
|
||||||
|
verify_commitment_and_max_age (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
&actx.commitment.h_commitment,
|
&actx.commitment.h_commitment,
|
||||||
actx.commitment.max_age,
|
actx.commitment.max_age,
|
||||||
@ -1056,7 +1064,8 @@ TEH_handler_age_withdraw_reveal (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
/* Finally, sign and persist the coins */
|
/* Finally, sign and persist the coins */
|
||||||
if (GNUNET_OK != sign_and_finalize_age_withdraw (
|
if (GNUNET_OK !=
|
||||||
|
sign_and_finalize_age_withdraw (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
&actx.commitment.h_commitment,
|
&actx.commitment.h_commitment,
|
||||||
actx.num_coins,
|
actx.num_coins,
|
||||||
@ -1068,7 +1077,6 @@ TEH_handler_age_withdraw_reveal (
|
|||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
age_reveal_context_free (&actx);
|
age_reveal_context_free (&actx);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ struct DecisionContext
|
|||||||
/**
|
/**
|
||||||
* KYC requirements imposed, NULL for none.
|
* KYC requirements imposed, NULL for none.
|
||||||
*/
|
*/
|
||||||
json_t *kyc_requirements;
|
const json_t *kyc_requirements;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -261,8 +261,8 @@ TEH_handler_post_aml_decision (
|
|||||||
GNUNET_JSON_spec_uint32 ("new_state",
|
GNUNET_JSON_spec_uint32 ("new_state",
|
||||||
&new_state32),
|
&new_state32),
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
GNUNET_JSON_spec_json ("kyc_requirements",
|
GNUNET_JSON_spec_array_const ("kyc_requirements",
|
||||||
&dc.kyc_requirements),
|
&dc.kyc_requirements),
|
||||||
NULL),
|
NULL),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
@ -306,17 +306,6 @@ TEH_handler_post_aml_decision (
|
|||||||
size_t index;
|
size_t index;
|
||||||
json_t *elem;
|
json_t *elem;
|
||||||
|
|
||||||
if (! json_is_array (dc.kyc_requirements))
|
|
||||||
{
|
|
||||||
GNUNET_break_op (0);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (
|
|
||||||
connection,
|
|
||||||
MHD_HTTP_BAD_REQUEST,
|
|
||||||
TALER_EC_GENERIC_PARAMETER_MALFORMED,
|
|
||||||
"kyc_requirements must be an array");
|
|
||||||
}
|
|
||||||
|
|
||||||
json_array_foreach (dc.kyc_requirements, index, elem)
|
json_array_foreach (dc.kyc_requirements, index, elem)
|
||||||
{
|
{
|
||||||
const char *val;
|
const char *val;
|
||||||
@ -324,7 +313,6 @@ TEH_handler_post_aml_decision (
|
|||||||
if (! json_is_string (elem))
|
if (! json_is_string (elem))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (
|
return TALER_MHD_reply_with_error (
|
||||||
connection,
|
connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
@ -336,7 +324,6 @@ TEH_handler_post_aml_decision (
|
|||||||
TALER_KYCLOGIC_check_satisfiable (val))
|
TALER_KYCLOGIC_check_satisfiable (val))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (
|
return TALER_MHD_reply_with_error (
|
||||||
connection,
|
connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
@ -357,11 +344,9 @@ TEH_handler_post_aml_decision (
|
|||||||
&make_aml_decision,
|
&make_aml_decision,
|
||||||
&dc))
|
&dc))
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return mhd_ret;
|
return mhd_ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_static (
|
return TALER_MHD_reply_static (
|
||||||
connection,
|
connection,
|
||||||
MHD_HTTP_NO_CONTENT,
|
MHD_HTTP_NO_CONTENT,
|
||||||
|
@ -545,7 +545,7 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc,
|
|||||||
{
|
{
|
||||||
struct MHD_Connection *connection = rc->connection;
|
struct MHD_Connection *connection = rc->connection;
|
||||||
struct BatchDepositContext dc;
|
struct BatchDepositContext dc;
|
||||||
json_t *coins;
|
const json_t *coins;
|
||||||
bool no_refund_deadline = true;
|
bool no_refund_deadline = true;
|
||||||
bool no_policy_json = true;
|
bool no_policy_json = true;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
@ -557,8 +557,8 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc,
|
|||||||
&dc.merchant_pub),
|
&dc.merchant_pub),
|
||||||
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
|
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
|
||||||
&dc.h_contract_terms),
|
&dc.h_contract_terms),
|
||||||
GNUNET_JSON_spec_json ("coins",
|
GNUNET_JSON_spec_array_const ("coins",
|
||||||
&coins),
|
&coins),
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
GNUNET_JSON_spec_json ("policy",
|
GNUNET_JSON_spec_json ("policy",
|
||||||
&dc.policy_json),
|
&dc.policy_json),
|
||||||
|
@ -848,10 +848,10 @@ TEH_handler_batch_withdraw (struct TEH_RequestContext *rc,
|
|||||||
.reserve_pub = reserve_pub,
|
.reserve_pub = reserve_pub,
|
||||||
.rc = rc
|
.rc = rc
|
||||||
};
|
};
|
||||||
json_t *planchets;
|
const json_t *planchets;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("planchets",
|
GNUNET_JSON_spec_array_const ("planchets",
|
||||||
&planchets),
|
&planchets),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -867,20 +867,17 @@ TEH_handler_batch_withdraw (struct TEH_RequestContext *rc,
|
|||||||
if (GNUNET_OK != res)
|
if (GNUNET_OK != res)
|
||||||
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
|
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
|
||||||
}
|
}
|
||||||
if ( (! json_is_array (planchets)) ||
|
wc.planchets_length = json_array_size (planchets);
|
||||||
(0 == json_array_size (planchets)) )
|
if (0 == wc.planchets_length)
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return TALER_MHD_reply_with_error (rc->connection,
|
return TALER_MHD_reply_with_error (rc->connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
TALER_EC_GENERIC_PARAMETER_MALFORMED,
|
TALER_EC_GENERIC_PARAMETER_MALFORMED,
|
||||||
"planchets");
|
"planchets");
|
||||||
}
|
}
|
||||||
wc.planchets_length = json_array_size (planchets);
|
|
||||||
if (wc.planchets_length > TALER_MAX_FRESH_COINS)
|
if (wc.planchets_length > TALER_MAX_FRESH_COINS)
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return TALER_MHD_reply_with_error (rc->connection,
|
return TALER_MHD_reply_with_error (rc->connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
@ -906,7 +903,6 @@ TEH_handler_batch_withdraw (struct TEH_RequestContext *rc,
|
|||||||
TALER_blinded_planchet_free (&pc->blinded_planchet);
|
TALER_blinded_planchet_free (&pc->blinded_planchet);
|
||||||
TALER_blinded_denom_sig_free (&pc->collectable.sig);
|
TALER_blinded_denom_sig_free (&pc->collectable.sig);
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,12 +39,12 @@ TEH_handler_csr_melt (struct TEH_RequestContext *rc,
|
|||||||
{
|
{
|
||||||
struct TALER_RefreshMasterSecretP rms;
|
struct TALER_RefreshMasterSecretP rms;
|
||||||
unsigned int csr_requests_num;
|
unsigned int csr_requests_num;
|
||||||
json_t *csr_requests;
|
const json_t *csr_requests;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_fixed_auto ("rms",
|
GNUNET_JSON_spec_fixed_auto ("rms",
|
||||||
&rms),
|
&rms),
|
||||||
GNUNET_JSON_spec_json ("nks",
|
GNUNET_JSON_spec_array_const ("nks",
|
||||||
&csr_requests),
|
&csr_requests),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
enum TALER_ErrorCode ec;
|
enum TALER_ErrorCode ec;
|
||||||
@ -65,7 +65,7 @@ TEH_handler_csr_melt (struct TEH_RequestContext *rc,
|
|||||||
if ( (TALER_MAX_FRESH_COINS <= csr_requests_num) ||
|
if ( (TALER_MAX_FRESH_COINS <= csr_requests_num) ||
|
||||||
(0 == csr_requests_num) )
|
(0 == csr_requests_num) )
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
GNUNET_break_op (0);
|
||||||
return TALER_MHD_reply_with_error (
|
return TALER_MHD_reply_with_error (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
@ -101,14 +101,12 @@ TEH_handler_csr_melt (struct TEH_RequestContext *rc,
|
|||||||
-1);
|
-1);
|
||||||
if (GNUNET_OK != res)
|
if (GNUNET_OK != res)
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
|
return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
|
||||||
}
|
}
|
||||||
TALER_cs_refresh_nonce_derive (&rms,
|
TALER_cs_refresh_nonce_derive (&rms,
|
||||||
coin_off,
|
coin_off,
|
||||||
&nonces[i]);
|
&nonces[i]);
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < csr_requests_num; i++)
|
for (unsigned int i = 0; i < csr_requests_num; i++)
|
||||||
{
|
{
|
||||||
|
@ -145,7 +145,7 @@ set_extensions (void *cls,
|
|||||||
|
|
||||||
static enum GNUNET_GenericReturnValue
|
static enum GNUNET_GenericReturnValue
|
||||||
verify_extensions_from_json (
|
verify_extensions_from_json (
|
||||||
json_t *extensions,
|
const json_t *extensions,
|
||||||
struct SetExtensionsContext *sec)
|
struct SetExtensionsContext *sec)
|
||||||
{
|
{
|
||||||
const char*name;
|
const char*name;
|
||||||
@ -160,7 +160,7 @@ verify_extensions_from_json (
|
|||||||
sec->extensions = GNUNET_new_array (sec->num_extensions,
|
sec->extensions = GNUNET_new_array (sec->num_extensions,
|
||||||
struct Extension);
|
struct Extension);
|
||||||
|
|
||||||
json_object_foreach (extensions, name, manifest)
|
json_object_foreach ((json_t *) extensions, name, manifest)
|
||||||
{
|
{
|
||||||
int critical = 0;
|
int critical = 0;
|
||||||
json_t *config;
|
json_t *config;
|
||||||
@ -200,11 +200,11 @@ TEH_handler_management_post_extensions (
|
|||||||
const json_t *root)
|
const json_t *root)
|
||||||
{
|
{
|
||||||
MHD_RESULT ret;
|
MHD_RESULT ret;
|
||||||
json_t *extensions;
|
const json_t *extensions;
|
||||||
struct SetExtensionsContext sec = {0};
|
struct SetExtensionsContext sec = {0};
|
||||||
struct GNUNET_JSON_Specification top_spec[] = {
|
struct GNUNET_JSON_Specification top_spec[] = {
|
||||||
GNUNET_JSON_spec_json ("extensions",
|
GNUNET_JSON_spec_object_const ("extensions",
|
||||||
&extensions),
|
&extensions),
|
||||||
GNUNET_JSON_spec_fixed_auto ("extensions_sig",
|
GNUNET_JSON_spec_fixed_auto ("extensions_sig",
|
||||||
&sec.extensions_sig),
|
&sec.extensions_sig),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
@ -223,31 +223,19 @@ TEH_handler_management_post_extensions (
|
|||||||
return MHD_YES; /* failure */
|
return MHD_YES; /* failure */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure we have an object */
|
|
||||||
if ((! json_is_object (extensions)) &&
|
|
||||||
(! json_is_null (extensions)))
|
|
||||||
{
|
|
||||||
GNUNET_JSON_parse_free (top_spec);
|
|
||||||
return TALER_MHD_reply_with_error (
|
|
||||||
connection,
|
|
||||||
MHD_HTTP_BAD_REQUEST,
|
|
||||||
TALER_EC_GENERIC_PARAMETER_MALFORMED,
|
|
||||||
"invalid object");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Verify the signature */
|
/* Verify the signature */
|
||||||
{
|
{
|
||||||
struct TALER_ExtensionManifestsHashP h_manifests;
|
struct TALER_ExtensionManifestsHashP h_manifests;
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_JSON_extensions_manifests_hash (extensions, &h_manifests) ||
|
TALER_JSON_extensions_manifests_hash (extensions,
|
||||||
|
&h_manifests) ||
|
||||||
GNUNET_OK !=
|
GNUNET_OK !=
|
||||||
TALER_exchange_offline_extension_manifests_hash_verify (
|
TALER_exchange_offline_extension_manifests_hash_verify (
|
||||||
&h_manifests,
|
&h_manifests,
|
||||||
&TEH_master_public_key,
|
&TEH_master_public_key,
|
||||||
&sec.extensions_sig))
|
&sec.extensions_sig))
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (top_spec);
|
|
||||||
return TALER_MHD_reply_with_error (
|
return TALER_MHD_reply_with_error (
|
||||||
connection,
|
connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
@ -263,7 +251,6 @@ TEH_handler_management_post_extensions (
|
|||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
verify_extensions_from_json (extensions, &sec))
|
verify_extensions_from_json (extensions, &sec))
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (top_spec);
|
|
||||||
return TALER_MHD_reply_with_error (
|
return TALER_MHD_reply_with_error (
|
||||||
connection,
|
connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
@ -306,7 +293,6 @@ CLEANUP:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
GNUNET_free (sec.extensions);
|
GNUNET_free (sec.extensions);
|
||||||
GNUNET_JSON_parse_free (top_spec);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,13 +340,13 @@ TEH_handler_management_post_keys (
|
|||||||
const json_t *root)
|
const json_t *root)
|
||||||
{
|
{
|
||||||
struct AddKeysContext akc;
|
struct AddKeysContext akc;
|
||||||
json_t *denom_sigs;
|
const json_t *denom_sigs;
|
||||||
json_t *signkey_sigs;
|
const json_t *signkey_sigs;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("denom_sigs",
|
GNUNET_JSON_spec_array_const ("denom_sigs",
|
||||||
&denom_sigs),
|
&denom_sigs),
|
||||||
GNUNET_JSON_spec_json ("signkey_sigs",
|
GNUNET_JSON_spec_array_const ("signkey_sigs",
|
||||||
&signkey_sigs),
|
&signkey_sigs),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
bool ok;
|
bool ok;
|
||||||
@ -363,24 +363,12 @@ TEH_handler_management_post_keys (
|
|||||||
if (GNUNET_NO == res)
|
if (GNUNET_NO == res)
|
||||||
return MHD_YES; /* failure */
|
return MHD_YES; /* failure */
|
||||||
}
|
}
|
||||||
if (! (json_is_array (denom_sigs) &&
|
|
||||||
json_is_array (signkey_sigs)) )
|
|
||||||
{
|
|
||||||
GNUNET_break_op (0);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (
|
|
||||||
connection,
|
|
||||||
MHD_HTTP_BAD_REQUEST,
|
|
||||||
TALER_EC_GENERIC_PARAMETER_MALFORMED,
|
|
||||||
"array expected for denom_sigs and signkey_sigs");
|
|
||||||
}
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Received /management/keys\n");
|
"Received /management/keys\n");
|
||||||
akc.ksh = TEH_keys_get_state_for_management_only (); /* may start its own transaction, thus must be done here, before we run ours! */
|
akc.ksh = TEH_keys_get_state_for_management_only (); /* may start its own transaction, thus must be done here, before we run ours! */
|
||||||
if (NULL == akc.ksh)
|
if (NULL == akc.ksh)
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (
|
return TALER_MHD_reply_with_error (
|
||||||
connection,
|
connection,
|
||||||
MHD_HTTP_INTERNAL_SERVER_ERROR,
|
MHD_HTTP_INTERNAL_SERVER_ERROR,
|
||||||
@ -423,7 +411,6 @@ TEH_handler_management_post_keys (
|
|||||||
if (! ok)
|
if (! ok)
|
||||||
{
|
{
|
||||||
GNUNET_free (akc.d_sigs);
|
GNUNET_free (akc.d_sigs);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Failure to handle /management/keys\n");
|
"Failure to handle /management/keys\n");
|
||||||
return ret;
|
return ret;
|
||||||
@ -466,7 +453,6 @@ TEH_handler_management_post_keys (
|
|||||||
"Failure to handle /management/keys\n");
|
"Failure to handle /management/keys\n");
|
||||||
GNUNET_free (akc.d_sigs);
|
GNUNET_free (akc.d_sigs);
|
||||||
GNUNET_free (akc.s_sigs);
|
GNUNET_free (akc.s_sigs);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
@ -484,7 +470,6 @@ TEH_handler_management_post_keys (
|
|||||||
&akc);
|
&akc);
|
||||||
GNUNET_free (akc.d_sigs);
|
GNUNET_free (akc.d_sigs);
|
||||||
GNUNET_free (akc.s_sigs);
|
GNUNET_free (akc.s_sigs);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
if (GNUNET_SYSERR == res)
|
if (GNUNET_SYSERR == res)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -62,12 +62,12 @@ struct AddWireContext
|
|||||||
/**
|
/**
|
||||||
* Restrictions imposed when crediting this account.
|
* Restrictions imposed when crediting this account.
|
||||||
*/
|
*/
|
||||||
json_t *credit_restrictions;
|
const json_t *credit_restrictions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restrictions imposed when debiting this account.
|
* Restrictions imposed when debiting this account.
|
||||||
*/
|
*/
|
||||||
json_t *debit_restrictions;
|
const json_t *debit_restrictions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Timestamp for checking against replay attacks.
|
* Timestamp for checking against replay attacks.
|
||||||
@ -176,10 +176,10 @@ TEH_handler_management_post_wire (
|
|||||||
GNUNET_JSON_spec_string ("conversion_url",
|
GNUNET_JSON_spec_string ("conversion_url",
|
||||||
&awc.conversion_url),
|
&awc.conversion_url),
|
||||||
NULL),
|
NULL),
|
||||||
GNUNET_JSON_spec_json ("credit_restrictions",
|
GNUNET_JSON_spec_array_const ("credit_restrictions",
|
||||||
&awc.credit_restrictions),
|
&awc.credit_restrictions),
|
||||||
GNUNET_JSON_spec_json ("debit_restrictions",
|
GNUNET_JSON_spec_array_const ("debit_restrictions",
|
||||||
&awc.debit_restrictions),
|
&awc.debit_restrictions),
|
||||||
GNUNET_JSON_spec_timestamp ("validity_start",
|
GNUNET_JSON_spec_timestamp ("validity_start",
|
||||||
&awc.validity_start),
|
&awc.validity_start),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
|
@ -430,7 +430,7 @@ TEH_handler_purses_create (
|
|||||||
.pd.purse_pub = *purse_pub,
|
.pd.purse_pub = *purse_pub,
|
||||||
.exchange_timestamp = GNUNET_TIME_timestamp_get ()
|
.exchange_timestamp = GNUNET_TIME_timestamp_get ()
|
||||||
};
|
};
|
||||||
json_t *deposits;
|
const json_t *deposits;
|
||||||
json_t *deposit;
|
json_t *deposit;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
@ -449,8 +449,8 @@ TEH_handler_purses_create (
|
|||||||
&pcc.purse_sig),
|
&pcc.purse_sig),
|
||||||
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
|
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
|
||||||
&pcc.pd.h_contract_terms),
|
&pcc.pd.h_contract_terms),
|
||||||
GNUNET_JSON_spec_json ("deposits",
|
GNUNET_JSON_spec_array_const ("deposits",
|
||||||
&deposits),
|
&deposits),
|
||||||
GNUNET_JSON_spec_timestamp ("purse_expiration",
|
GNUNET_JSON_spec_timestamp ("purse_expiration",
|
||||||
&pcc.pd.purse_expiration),
|
&pcc.pd.purse_expiration),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
@ -482,7 +482,6 @@ TEH_handler_purses_create (
|
|||||||
pcc.exchange_timestamp))
|
pcc.exchange_timestamp))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (connection,
|
return TALER_MHD_reply_with_error (connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
TALER_EC_EXCHANGE_PURSE_CREATE_EXPIRATION_BEFORE_NOW,
|
TALER_EC_EXCHANGE_PURSE_CREATE_EXPIRATION_BEFORE_NOW,
|
||||||
@ -491,7 +490,6 @@ TEH_handler_purses_create (
|
|||||||
if (GNUNET_TIME_absolute_is_never (pcc.pd.purse_expiration.abs_time))
|
if (GNUNET_TIME_absolute_is_never (pcc.pd.purse_expiration.abs_time))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (connection,
|
return TALER_MHD_reply_with_error (connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
TALER_EC_EXCHANGE_PURSE_CREATE_EXPIRATION_IS_NEVER,
|
TALER_EC_EXCHANGE_PURSE_CREATE_EXPIRATION_IS_NEVER,
|
||||||
@ -502,7 +500,6 @@ TEH_handler_purses_create (
|
|||||||
(pcc.num_coins > TALER_MAX_FRESH_COINS) )
|
(pcc.num_coins > TALER_MAX_FRESH_COINS) )
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (connection,
|
return TALER_MHD_reply_with_error (connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
TALER_EC_GENERIC_PARAMETER_MALFORMED,
|
TALER_EC_GENERIC_PARAMETER_MALFORMED,
|
||||||
@ -515,7 +512,6 @@ TEH_handler_purses_create (
|
|||||||
if (NULL == keys)
|
if (NULL == keys)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (connection,
|
return TALER_MHD_reply_with_error (connection,
|
||||||
MHD_HTTP_INTERNAL_SERVER_ERROR,
|
MHD_HTTP_INTERNAL_SERVER_ERROR,
|
||||||
TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
|
TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
|
||||||
@ -547,7 +543,6 @@ TEH_handler_purses_create (
|
|||||||
deposit);
|
deposit);
|
||||||
if (GNUNET_OK != res)
|
if (GNUNET_OK != res)
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
for (unsigned int i = 0; i<idx; i++)
|
for (unsigned int i = 0; i<idx; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
@ -559,7 +554,6 @@ TEH_handler_purses_create (
|
|||||||
&pcc.deposit_total))
|
&pcc.deposit_total))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
return TALER_MHD_reply_with_error (connection,
|
return TALER_MHD_reply_with_error (connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
@ -579,7 +573,6 @@ TEH_handler_purses_create (
|
|||||||
&pcc.purse_sig))
|
&pcc.purse_sig))
|
||||||
{
|
{
|
||||||
TALER_LOG_WARNING ("Invalid signature on /purses/$PID/create request\n");
|
TALER_LOG_WARNING ("Invalid signature on /purses/$PID/create request\n");
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
@ -597,7 +590,6 @@ TEH_handler_purses_create (
|
|||||||
&pcc.econtract.econtract_sig)) )
|
&pcc.econtract.econtract_sig)) )
|
||||||
{
|
{
|
||||||
TALER_LOG_WARNING ("Invalid signature on /purses/$PID/create request\n");
|
TALER_LOG_WARNING ("Invalid signature on /purses/$PID/create request\n");
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
@ -612,7 +604,6 @@ TEH_handler_purses_create (
|
|||||||
TEH_plugin->preflight (TEH_plugin->cls))
|
TEH_plugin->preflight (TEH_plugin->cls))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
@ -634,7 +625,6 @@ TEH_handler_purses_create (
|
|||||||
&create_transaction,
|
&create_transaction,
|
||||||
&pcc))
|
&pcc))
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
@ -653,7 +643,6 @@ TEH_handler_purses_create (
|
|||||||
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,12 +329,12 @@ TEH_handler_purses_deposit (
|
|||||||
.purse_pub = purse_pub,
|
.purse_pub = purse_pub,
|
||||||
.exchange_timestamp = GNUNET_TIME_timestamp_get ()
|
.exchange_timestamp = GNUNET_TIME_timestamp_get ()
|
||||||
};
|
};
|
||||||
json_t *deposits;
|
const json_t *deposits;
|
||||||
json_t *deposit;
|
json_t *deposit;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("deposits",
|
GNUNET_JSON_spec_array_const ("deposits",
|
||||||
&deposits),
|
&deposits),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -363,7 +363,6 @@ TEH_handler_purses_deposit (
|
|||||||
(pcc.num_coins > TALER_MAX_FRESH_COINS) )
|
(pcc.num_coins > TALER_MAX_FRESH_COINS) )
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (connection,
|
return TALER_MHD_reply_with_error (connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
TALER_EC_GENERIC_PARAMETER_MALFORMED,
|
TALER_EC_GENERIC_PARAMETER_MALFORMED,
|
||||||
@ -435,7 +434,6 @@ TEH_handler_purses_deposit (
|
|||||||
deposit);
|
deposit);
|
||||||
if (GNUNET_OK != res)
|
if (GNUNET_OK != res)
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
for (unsigned int i = 0; i<idx; i++)
|
for (unsigned int i = 0; i<idx; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
@ -447,7 +445,6 @@ TEH_handler_purses_deposit (
|
|||||||
TEH_plugin->preflight (TEH_plugin->cls))
|
TEH_plugin->preflight (TEH_plugin->cls))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
@ -469,7 +466,6 @@ TEH_handler_purses_deposit (
|
|||||||
&deposit_transaction,
|
&deposit_transaction,
|
||||||
&pcc))
|
&pcc))
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
@ -501,7 +497,6 @@ TEH_handler_purses_deposit (
|
|||||||
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
for (unsigned int i = 0; i<pcc.num_coins; i++)
|
||||||
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
TEH_common_purse_deposit_free_coin (&pcc.coins[i]);
|
||||||
GNUNET_free (pcc.coins);
|
GNUNET_free (pcc.coins);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -983,26 +983,26 @@ TEH_handler_reveal (struct TEH_RequestContext *rc,
|
|||||||
const json_t *root,
|
const json_t *root,
|
||||||
const char *const args[2])
|
const char *const args[2])
|
||||||
{
|
{
|
||||||
json_t *coin_evs;
|
const json_t *coin_evs;
|
||||||
json_t *transfer_privs;
|
const json_t *transfer_privs;
|
||||||
json_t *link_sigs;
|
const json_t *link_sigs;
|
||||||
json_t *new_denoms_h;
|
const json_t *new_denoms_h;
|
||||||
json_t *old_age_commitment;
|
const json_t *old_age_commitment;
|
||||||
struct RevealContext rctx;
|
struct RevealContext rctx;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_fixed_auto ("transfer_pub",
|
GNUNET_JSON_spec_fixed_auto ("transfer_pub",
|
||||||
&rctx.gamma_tp),
|
&rctx.gamma_tp),
|
||||||
GNUNET_JSON_spec_json ("transfer_privs",
|
GNUNET_JSON_spec_array_const ("transfer_privs",
|
||||||
&transfer_privs),
|
&transfer_privs),
|
||||||
GNUNET_JSON_spec_json ("link_sigs",
|
GNUNET_JSON_spec_array_const ("link_sigs",
|
||||||
&link_sigs),
|
&link_sigs),
|
||||||
GNUNET_JSON_spec_json ("coin_evs",
|
GNUNET_JSON_spec_array_const ("coin_evs",
|
||||||
&coin_evs),
|
&coin_evs),
|
||||||
GNUNET_JSON_spec_json ("new_denoms_h",
|
GNUNET_JSON_spec_array_const ("new_denoms_h",
|
||||||
&new_denoms_h),
|
&new_denoms_h),
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
GNUNET_JSON_spec_json ("old_age_commitment",
|
GNUNET_JSON_spec_array_const ("old_age_commitment",
|
||||||
&old_age_commitment),
|
&old_age_commitment),
|
||||||
NULL),
|
NULL),
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
GNUNET_JSON_spec_fixed_auto ("rms",
|
GNUNET_JSON_spec_fixed_auto ("rms",
|
||||||
@ -1053,7 +1053,6 @@ TEH_handler_reveal (struct TEH_RequestContext *rc,
|
|||||||
/* Note we do +1 as 1 row (cut-and-choose!) is missing! */
|
/* Note we do +1 as 1 row (cut-and-choose!) is missing! */
|
||||||
if (TALER_CNC_KAPPA != json_array_size (transfer_privs) + 1)
|
if (TALER_CNC_KAPPA != json_array_size (transfer_privs) + 1)
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return TALER_MHD_reply_with_error (rc->connection,
|
return TALER_MHD_reply_with_error (rc->connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_BAD_REQUEST,
|
||||||
@ -1061,19 +1060,13 @@ TEH_handler_reveal (struct TEH_RequestContext *rc,
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
return handle_refreshes_reveal_json (rc->connection,
|
||||||
MHD_RESULT res;
|
&rctx,
|
||||||
|
transfer_privs,
|
||||||
res = handle_refreshes_reveal_json (rc->connection,
|
link_sigs,
|
||||||
&rctx,
|
new_denoms_h,
|
||||||
transfer_privs,
|
old_age_commitment,
|
||||||
link_sigs,
|
coin_evs);
|
||||||
new_denoms_h,
|
|
||||||
old_age_commitment,
|
|
||||||
coin_evs);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ struct ReserveAttestContext
|
|||||||
/**
|
/**
|
||||||
* List of requested details.
|
* List of requested details.
|
||||||
*/
|
*/
|
||||||
json_t *details;
|
const json_t *details;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client signature approving the request.
|
* Client signature approving the request.
|
||||||
@ -287,8 +287,8 @@ TEH_handler_reserves_attest (struct TEH_RequestContext *rc,
|
|||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_timestamp ("request_timestamp",
|
GNUNET_JSON_spec_timestamp ("request_timestamp",
|
||||||
&rsc.timestamp),
|
&rsc.timestamp),
|
||||||
GNUNET_JSON_spec_json ("details",
|
GNUNET_JSON_spec_array_const ("details",
|
||||||
&rsc.details),
|
&rsc.details),
|
||||||
GNUNET_JSON_spec_fixed_auto ("reserve_sig",
|
GNUNET_JSON_spec_fixed_auto ("reserve_sig",
|
||||||
&rsc.reserve_sig),
|
&rsc.reserve_sig),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
|
@ -303,7 +303,7 @@ TEH_handler_reserves_open (struct TEH_RequestContext *rc,
|
|||||||
const json_t *root)
|
const json_t *root)
|
||||||
{
|
{
|
||||||
struct ReserveOpenContext rsc;
|
struct ReserveOpenContext rsc;
|
||||||
json_t *payments;
|
const json_t *payments;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_timestamp ("request_timestamp",
|
GNUNET_JSON_spec_timestamp ("request_timestamp",
|
||||||
&rsc.timestamp),
|
&rsc.timestamp),
|
||||||
@ -313,8 +313,8 @@ TEH_handler_reserves_open (struct TEH_RequestContext *rc,
|
|||||||
&rsc.reserve_sig),
|
&rsc.reserve_sig),
|
||||||
GNUNET_JSON_spec_uint32 ("purse_limit",
|
GNUNET_JSON_spec_uint32 ("purse_limit",
|
||||||
&rsc.purse_limit),
|
&rsc.purse_limit),
|
||||||
GNUNET_JSON_spec_json ("payments",
|
GNUNET_JSON_spec_array_const ("payments",
|
||||||
&payments),
|
&payments),
|
||||||
TALER_JSON_spec_amount ("reserve_payment",
|
TALER_JSON_spec_amount ("reserve_payment",
|
||||||
TEH_currency,
|
TEH_currency,
|
||||||
&rsc.reserve_payment),
|
&rsc.reserve_payment),
|
||||||
@ -403,7 +403,6 @@ TEH_handler_reserves_open (struct TEH_RequestContext *rc,
|
|||||||
if (NULL == keys)
|
if (NULL == keys)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
cleanup_rsc (&rsc);
|
cleanup_rsc (&rsc);
|
||||||
return TALER_MHD_reply_with_error (rc->connection,
|
return TALER_MHD_reply_with_error (rc->connection,
|
||||||
MHD_HTTP_INTERNAL_SERVER_ERROR,
|
MHD_HTTP_INTERNAL_SERVER_ERROR,
|
||||||
|
@ -406,25 +406,17 @@ batch_done (void)
|
|||||||
* except for irrecoverable errors.
|
* except for irrecoverable errors.
|
||||||
*
|
*
|
||||||
* @param cls `struct WirePrepareData` we are working on
|
* @param cls `struct WirePrepareData` we are working on
|
||||||
* @param http_status_code #MHD_HTTP_OK on success
|
* @param tr transfer response
|
||||||
* @param ec taler error code
|
|
||||||
* @param row_id unique ID of the wire transfer in the bank's records
|
|
||||||
* @param wire_timestamp when did the transfer happen
|
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
wire_confirm_cb (void *cls,
|
wire_confirm_cb (void *cls,
|
||||||
unsigned int http_status_code,
|
const struct TALER_BANK_TransferResponse *tr)
|
||||||
enum TALER_ErrorCode ec,
|
|
||||||
uint64_t row_id,
|
|
||||||
struct GNUNET_TIME_Timestamp wire_timestamp)
|
|
||||||
{
|
{
|
||||||
struct WirePrepareData *wpd = cls;
|
struct WirePrepareData *wpd = cls;
|
||||||
enum GNUNET_DB_QueryStatus qs;
|
enum GNUNET_DB_QueryStatus qs;
|
||||||
|
|
||||||
(void) row_id;
|
|
||||||
(void) wire_timestamp;
|
|
||||||
wpd->eh = NULL;
|
wpd->eh = NULL;
|
||||||
switch (http_status_code)
|
switch (tr->http_status)
|
||||||
{
|
{
|
||||||
case MHD_HTTP_OK:
|
case MHD_HTTP_OK:
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
@ -438,8 +430,8 @@ wire_confirm_cb (void *cls,
|
|||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Wire transaction %llu failed: %u/%d\n",
|
"Wire transaction %llu failed: %u/%d\n",
|
||||||
(unsigned long long) wpd->row_id,
|
(unsigned long long) wpd->row_id,
|
||||||
http_status_code,
|
tr->http_status,
|
||||||
ec);
|
tr->ec);
|
||||||
qs = db_plugin->wire_prepare_data_mark_failed (db_plugin->cls,
|
qs = db_plugin->wire_prepare_data_mark_failed (db_plugin->cls,
|
||||||
wpd->row_id);
|
wpd->row_id);
|
||||||
/* continued below */
|
/* continued below */
|
||||||
@ -456,7 +448,7 @@ wire_confirm_cb (void *cls,
|
|||||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"Wire transfer %llu failed (%u), trying again\n",
|
"Wire transfer %llu failed (%u), trying again\n",
|
||||||
(unsigned long long) wpd->row_id,
|
(unsigned long long) wpd->row_id,
|
||||||
http_status_code);
|
tr->http_status);
|
||||||
wpd->eh = TALER_BANK_transfer (ctx,
|
wpd->eh = TALER_BANK_transfer (ctx,
|
||||||
wpd->wa->auth,
|
wpd->wa->auth,
|
||||||
&wpd[1],
|
&wpd[1],
|
||||||
@ -468,8 +460,8 @@ wire_confirm_cb (void *cls,
|
|||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Wire transaction %llu failed: %u/%d\n",
|
"Wire transaction %llu failed: %u/%d\n",
|
||||||
(unsigned long long) wpd->row_id,
|
(unsigned long long) wpd->row_id,
|
||||||
http_status_code,
|
tr->http_status,
|
||||||
ec);
|
tr->ec);
|
||||||
cleanup_wpd ();
|
cleanup_wpd ();
|
||||||
db_plugin->rollback (db_plugin->cls);
|
db_plugin->rollback (db_plugin->cls);
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
@ -479,8 +471,8 @@ wire_confirm_cb (void *cls,
|
|||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Wire transfer %llu failed: %u/%d\n",
|
"Wire transfer %llu failed: %u/%d\n",
|
||||||
(unsigned long long) wpd->row_id,
|
(unsigned long long) wpd->row_id,
|
||||||
http_status_code,
|
tr->http_status,
|
||||||
ec);
|
tr->ec);
|
||||||
db_plugin->rollback (db_plugin->cls);
|
db_plugin->rollback (db_plugin->cls);
|
||||||
cleanup_wpd ();
|
cleanup_wpd ();
|
||||||
global_ret = EXIT_FAILURE;
|
global_ret = EXIT_FAILURE;
|
||||||
|
@ -65,6 +65,9 @@ exchange-0004.sql: exchange-0004.sql.in 0004-*.sql
|
|||||||
gcc -E -P -undef - < exchange-0004.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@
|
gcc -E -P -undef - < exchange-0004.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@
|
||||||
chmod ugo-w $@
|
chmod ugo-w $@
|
||||||
|
|
||||||
|
check_SCRIPTS = \
|
||||||
|
test_idempotency.sh
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
exchangedb.conf \
|
exchangedb.conf \
|
||||||
exchangedb-postgres.conf \
|
exchangedb-postgres.conf \
|
||||||
@ -72,6 +75,7 @@ EXTRA_DIST = \
|
|||||||
test-exchange-db-postgres.conf \
|
test-exchange-db-postgres.conf \
|
||||||
$(sqlinputs) \
|
$(sqlinputs) \
|
||||||
$(sql_DATA) \
|
$(sql_DATA) \
|
||||||
|
$(check_SCRIPTS) \
|
||||||
pg_template.h pg_template.c \
|
pg_template.h pg_template.c \
|
||||||
pg_template.sh
|
pg_template.sh
|
||||||
|
|
||||||
@ -311,6 +315,7 @@ noinst_PROGRAMS = \
|
|||||||
|
|
||||||
AM_TESTS_ENVIRONMENT=export TALER_PREFIX=$${TALER_PREFIX:-@libdir@};export PATH=$${TALER_PREFIX:-@prefix@}/bin:$$PATH;
|
AM_TESTS_ENVIRONMENT=export TALER_PREFIX=$${TALER_PREFIX:-@libdir@};export PATH=$${TALER_PREFIX:-@prefix@}/bin:$$PATH;
|
||||||
TESTS = \
|
TESTS = \
|
||||||
|
$(check_SCRIPTS) \
|
||||||
$(check_PROGRAMS)
|
$(check_PROGRAMS)
|
||||||
|
|
||||||
test_exchangedb_postgres_SOURCES = \
|
test_exchangedb_postgres_SOURCES = \
|
||||||
|
@ -30,8 +30,8 @@ enum GNUNET_DB_QueryStatus
|
|||||||
TEH_PG_insert_wire (void *cls,
|
TEH_PG_insert_wire (void *cls,
|
||||||
const char *payto_uri,
|
const char *payto_uri,
|
||||||
const char *conversion_url,
|
const char *conversion_url,
|
||||||
json_t *debit_restrictions,
|
const json_t *debit_restrictions,
|
||||||
json_t *credit_restrictions,
|
const json_t *credit_restrictions,
|
||||||
struct GNUNET_TIME_Timestamp start_date,
|
struct GNUNET_TIME_Timestamp start_date,
|
||||||
const struct TALER_MasterSignatureP *master_sig)
|
const struct TALER_MasterSignatureP *master_sig)
|
||||||
{
|
{
|
||||||
|
@ -42,8 +42,8 @@ enum GNUNET_DB_QueryStatus
|
|||||||
TEH_PG_insert_wire (void *cls,
|
TEH_PG_insert_wire (void *cls,
|
||||||
const char *payto_uri,
|
const char *payto_uri,
|
||||||
const char *conversion_url,
|
const char *conversion_url,
|
||||||
json_t *debit_restrictions,
|
const json_t *debit_restrictions,
|
||||||
json_t *credit_restrictions,
|
const json_t *credit_restrictions,
|
||||||
struct GNUNET_TIME_Timestamp start_date,
|
struct GNUNET_TIME_Timestamp start_date,
|
||||||
const struct TALER_MasterSignatureP *master_sig);
|
const struct TALER_MasterSignatureP *master_sig);
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ enum GNUNET_DB_QueryStatus
|
|||||||
TEH_PG_update_wire (void *cls,
|
TEH_PG_update_wire (void *cls,
|
||||||
const char *payto_uri,
|
const char *payto_uri,
|
||||||
const char *conversion_url,
|
const char *conversion_url,
|
||||||
json_t *debit_restrictions,
|
const json_t *debit_restrictions,
|
||||||
json_t *credit_restrictions,
|
const json_t *credit_restrictions,
|
||||||
struct GNUNET_TIME_Timestamp change_date,
|
struct GNUNET_TIME_Timestamp change_date,
|
||||||
bool enabled)
|
bool enabled)
|
||||||
{
|
{
|
||||||
|
@ -43,8 +43,8 @@ enum GNUNET_DB_QueryStatus
|
|||||||
TEH_PG_update_wire (void *cls,
|
TEH_PG_update_wire (void *cls,
|
||||||
const char *payto_uri,
|
const char *payto_uri,
|
||||||
const char *conversion_url,
|
const char *conversion_url,
|
||||||
json_t *debit_restrictions,
|
const json_t *debit_restrictions,
|
||||||
json_t *credit_restrictions,
|
const json_t *credit_restrictions,
|
||||||
struct GNUNET_TIME_Timestamp change_date,
|
struct GNUNET_TIME_Timestamp change_date,
|
||||||
bool enabled);
|
bool enabled);
|
||||||
|
|
||||||
|
11
src/exchangedb/test_idempotency.sh
Executable file
11
src/exchangedb/test_idempotency.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# This file is in the public domain.
|
||||||
|
set -eu
|
||||||
|
echo "Initializing DB"
|
||||||
|
taler-exchange-dbinit -r test-exchange-db-postgres.conf
|
||||||
|
echo "Re-initializing DB"
|
||||||
|
taler-exchange-dbinit test-exchange-db-postgres.conf
|
||||||
|
echo "Re-loading procedures"
|
||||||
|
psql talercheck < procedures.sql
|
||||||
|
echo "Test PASSED"
|
||||||
|
exit 0
|
@ -138,7 +138,7 @@ TALER_extensions_get_by_name (
|
|||||||
|
|
||||||
enum GNUNET_GenericReturnValue
|
enum GNUNET_GenericReturnValue
|
||||||
TALER_extensions_verify_manifests_signature (
|
TALER_extensions_verify_manifests_signature (
|
||||||
json_t *manifests,
|
const json_t *manifests,
|
||||||
struct TALER_MasterSignatureP *extensions_sig,
|
struct TALER_MasterSignatureP *extensions_sig,
|
||||||
struct TALER_MasterPublicKeyP *master_pub)
|
struct TALER_MasterPublicKeyP *master_pub)
|
||||||
{
|
{
|
||||||
@ -274,72 +274,76 @@ TALER_extensions_parse_manifest (
|
|||||||
json_t **config)
|
json_t **config)
|
||||||
{
|
{
|
||||||
enum GNUNET_GenericReturnValue ret;
|
enum GNUNET_GenericReturnValue ret;
|
||||||
json_t *cfg;
|
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_boolean ("critical",
|
GNUNET_JSON_spec_boolean ("critical",
|
||||||
critical),
|
critical),
|
||||||
GNUNET_JSON_spec_string ("version",
|
GNUNET_JSON_spec_string ("version",
|
||||||
version),
|
version),
|
||||||
GNUNET_JSON_spec_json ("config",
|
GNUNET_JSON_spec_json ("config",
|
||||||
&cfg),
|
config),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
*config = NULL;
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
(ret = GNUNET_JSON_parse (obj,
|
(ret = GNUNET_JSON_parse (obj,
|
||||||
spec,
|
spec,
|
||||||
NULL,
|
NULL,
|
||||||
NULL)))
|
NULL)))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
*config = json_copy (cfg);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
enum GNUNET_GenericReturnValue
|
enum GNUNET_GenericReturnValue
|
||||||
TALER_extensions_load_manifests (
|
TALER_extensions_load_manifests (
|
||||||
json_t *extensions)
|
const json_t *extensions)
|
||||||
{
|
{
|
||||||
const char*name;
|
const char *name;
|
||||||
json_t *manifest;
|
json_t *manifest;
|
||||||
|
|
||||||
GNUNET_assert (NULL != extensions);
|
GNUNET_assert (NULL != extensions);
|
||||||
GNUNET_assert (json_is_object (extensions));
|
GNUNET_assert (json_is_object (extensions));
|
||||||
|
|
||||||
json_object_foreach (extensions, name, manifest)
|
json_object_foreach ((json_t *) extensions, name, manifest)
|
||||||
{
|
{
|
||||||
int critical;
|
int critical;
|
||||||
const char *version;
|
const char *version;
|
||||||
json_t *config;
|
json_t *config;
|
||||||
struct TALER_Extension *extension = (struct
|
struct TALER_Extension *extension
|
||||||
TALER_Extension *)
|
= (struct TALER_Extension *)
|
||||||
TALER_extensions_get_by_name (name);
|
TALER_extensions_get_by_name (name);
|
||||||
|
|
||||||
if (NULL == extension)
|
if (NULL == extension)
|
||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"no such extension: %s\n", name);
|
"no such extension: %s\n",
|
||||||
|
name);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* load and verify criticality, version, etc. */
|
/* load and verify criticality, version, etc. */
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_extensions_parse_manifest (
|
TALER_extensions_parse_manifest (
|
||||||
manifest, &critical, &version, &config))
|
manifest,
|
||||||
|
&critical,
|
||||||
|
&version,
|
||||||
|
&config))
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
|
|
||||||
if (critical != extension->critical
|
if (critical != extension->critical
|
||||||
|| 0 != strcmp (version, extension->version) // TODO: libtool compare?
|
|| 0 != strcmp (version,
|
||||||
|
extension->version) // TODO: libtool compare?
|
||||||
|| NULL == config
|
|| NULL == config
|
||||||
|| GNUNET_OK != extension->load_config (config, NULL))
|
|| (GNUNET_OK !=
|
||||||
|
extension->load_config (config,
|
||||||
|
NULL)) )
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
|
|
||||||
/* This _should_ work now */
|
/* This _should_ work now */
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
extension->load_config (config, extension))
|
extension->load_config (config,
|
||||||
|
extension))
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
|
|
||||||
extension->enabled = true;
|
extension->enabled = true;
|
||||||
|
@ -99,27 +99,65 @@ struct TALER_BANK_AuthenticationData
|
|||||||
struct TALER_BANK_AdminAddIncomingHandle;
|
struct TALER_BANK_AdminAddIncomingHandle;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response details for a history request.
|
||||||
|
*/
|
||||||
|
struct TALER_BANK_AdminAddIncomingResponse
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP status.
|
||||||
|
*/
|
||||||
|
unsigned int http_status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Taler error code, #TALER_EC_NONE on success.
|
||||||
|
*/
|
||||||
|
enum TALER_ErrorCode ec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Full response, NULL if body was not in JSON format.
|
||||||
|
*/
|
||||||
|
const json_t *response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Details returned depending on the @e http_status.
|
||||||
|
*/
|
||||||
|
union
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Details if status was #MHD_HTTP_OK
|
||||||
|
*/
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* unique ID of the wire transfer in the bank's records
|
||||||
|
*/
|
||||||
|
uint64_t serial_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* time when the transaction was made.
|
||||||
|
*/
|
||||||
|
struct GNUNET_TIME_Timestamp timestamp;
|
||||||
|
|
||||||
|
} ok;
|
||||||
|
|
||||||
|
} details;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callbacks of this type are used to return the result of submitting
|
* Callbacks of this type are used to return the result of submitting
|
||||||
* a request to transfer funds to the exchange.
|
* a request to transfer funds to the exchange.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
|
* @param air response details
|
||||||
* 0 if the bank's reply is bogus (fails to follow the protocol)
|
|
||||||
* @param ec detailed error code
|
|
||||||
* @param serial_id unique ID of the wire transfer in the bank's records; UINT64_MAX on error
|
|
||||||
* @param timestamp time when the transaction was made.
|
|
||||||
* @param json detailed response from the HTTPD, or NULL if reply was not in JSON
|
|
||||||
*/
|
*/
|
||||||
// FIXME: bad API
|
|
||||||
typedef void
|
typedef void
|
||||||
(*TALER_BANK_AdminAddIncomingCallback) (
|
(*TALER_BANK_AdminAddIncomingCallback) (
|
||||||
void *cls,
|
void *cls,
|
||||||
unsigned int http_status,
|
const struct TALER_BANK_AdminAddIncomingResponse *air);
|
||||||
enum TALER_ErrorCode ec,
|
|
||||||
uint64_t serial_id,
|
|
||||||
struct GNUNET_TIME_Timestamp timestamp,
|
|
||||||
const json_t *json);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -191,23 +229,65 @@ TALER_BANK_prepare_transfer (
|
|||||||
struct TALER_BANK_TransferHandle;
|
struct TALER_BANK_TransferHandle;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response details for a history request.
|
||||||
|
*/
|
||||||
|
struct TALER_BANK_TransferResponse
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTTP status.
|
||||||
|
*/
|
||||||
|
unsigned int http_status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Taler error code, #TALER_EC_NONE on success.
|
||||||
|
*/
|
||||||
|
enum TALER_ErrorCode ec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Full response, NULL if body was not in JSON format.
|
||||||
|
*/
|
||||||
|
const json_t *response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Details returned depending on the @e http_status.
|
||||||
|
*/
|
||||||
|
union
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Details if status was #MHD_HTTP_OK
|
||||||
|
*/
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* unique ID of the wire transfer in the bank's records
|
||||||
|
*/
|
||||||
|
uint64_t row_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* when did the transaction go into effect
|
||||||
|
*/
|
||||||
|
struct GNUNET_TIME_Timestamp timestamp;
|
||||||
|
|
||||||
|
} ok;
|
||||||
|
} details;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with the result from the execute step.
|
* Function called with the result from the execute step.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param response_code HTTP status code
|
* @param tr response details
|
||||||
* @param ec taler error code
|
|
||||||
* @param row_id unique ID of the wire transfer in the bank's records
|
|
||||||
* @param timestamp when did the transaction go into effect
|
|
||||||
*/
|
*/
|
||||||
// FIXME: bad API
|
|
||||||
typedef void
|
typedef void
|
||||||
(*TALER_BANK_TransferCallback)(
|
(*TALER_BANK_TransferCallback)(
|
||||||
void *cls,
|
void *cls,
|
||||||
unsigned int response_code,
|
const struct TALER_BANK_TransferResponse *tr);
|
||||||
enum TALER_ErrorCode ec,
|
|
||||||
uint64_t row_id,
|
|
||||||
struct GNUNET_TIME_Timestamp timestamp);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3592,7 +3592,7 @@ enum GNUNET_GenericReturnValue
|
|||||||
TALER_EXCHANGE_verify_coin_history (
|
TALER_EXCHANGE_verify_coin_history (
|
||||||
const struct TALER_EXCHANGE_DenomPublicKey *dk,
|
const struct TALER_EXCHANGE_DenomPublicKey *dk,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
json_t *history,
|
const json_t *history,
|
||||||
struct TALER_Amount *total);
|
struct TALER_Amount *total);
|
||||||
|
|
||||||
|
|
||||||
@ -4498,7 +4498,7 @@ TALER_EXCHANGE_post_management_keys_cancel (
|
|||||||
*/
|
*/
|
||||||
struct TALER_EXCHANGE_ManagementPostExtensionsData
|
struct TALER_EXCHANGE_ManagementPostExtensionsData
|
||||||
{
|
{
|
||||||
json_t *extensions;
|
const json_t *extensions;
|
||||||
struct TALER_MasterSignatureP extensions_sig;
|
struct TALER_MasterSignatureP extensions_sig;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -4548,7 +4548,7 @@ struct TALER_EXCHANGE_ManagementPostExtensionsHandle *
|
|||||||
TALER_EXCHANGE_management_post_extensions (
|
TALER_EXCHANGE_management_post_extensions (
|
||||||
struct GNUNET_CURL_Context *ctx,
|
struct GNUNET_CURL_Context *ctx,
|
||||||
const char *url,
|
const char *url,
|
||||||
struct TALER_EXCHANGE_ManagementPostExtensionsData *ped,
|
const struct TALER_EXCHANGE_ManagementPostExtensionsData *ped,
|
||||||
TALER_EXCHANGE_ManagementPostExtensionsCallback cb,
|
TALER_EXCHANGE_ManagementPostExtensionsCallback cb,
|
||||||
void *cb_cls);
|
void *cb_cls);
|
||||||
|
|
||||||
@ -5091,7 +5091,7 @@ TALER_EXCHANGE_lookup_aml_decision (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel #TALER_EXCHANGE_add_aml_decision() operation.
|
* Cancel #TALER_EXCHANGE_lookup_aml_decision() operation.
|
||||||
*
|
*
|
||||||
* @param rh handle of the operation to cancel
|
* @param rh handle of the operation to cancel
|
||||||
*/
|
*/
|
||||||
@ -5105,18 +5105,30 @@ TALER_EXCHANGE_lookup_aml_decision_cancel (
|
|||||||
*/
|
*/
|
||||||
struct TALER_EXCHANGE_AddAmlDecision;
|
struct TALER_EXCHANGE_AddAmlDecision;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response when making an AML decision.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_AddAmlDecisionResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* HTTP response data.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_HttpResponse hr;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with information about storing an
|
* Function called with information about storing an
|
||||||
* an AML decision.
|
* an AML decision.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param hr HTTP response data
|
* @param adr response data
|
||||||
*/
|
*/
|
||||||
// FIXME: bad API
|
|
||||||
typedef void
|
typedef void
|
||||||
(*TALER_EXCHANGE_AddAmlDecisionCallback) (
|
(*TALER_EXCHANGE_AddAmlDecisionCallback) (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr);
|
const struct TALER_EXCHANGE_AddAmlDecisionResponse *adr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inform the exchange that an AML decision has been taken.
|
* Inform the exchange that an AML decision has been taken.
|
||||||
@ -5161,18 +5173,28 @@ TALER_EXCHANGE_add_aml_decision_cancel (
|
|||||||
struct TALER_EXCHANGE_AddAmlDecision *rh);
|
struct TALER_EXCHANGE_AddAmlDecision *rh);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response when adding a partner exchange.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_ManagementAddPartnerResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* HTTP response data.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_HttpResponse hr;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with information about the change to
|
* Function called with information about the change to
|
||||||
* an AML officer status.
|
* an AML officer status.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param hr HTTP response data
|
* @param apr response data
|
||||||
*/
|
*/
|
||||||
// FIXME: bad API
|
|
||||||
typedef void
|
typedef void
|
||||||
(*TALER_EXCHANGE_ManagementAddPartnerCallback) (
|
(*TALER_EXCHANGE_ManagementAddPartnerCallback) (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr);
|
const struct TALER_EXCHANGE_ManagementAddPartnerResponse *apr);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -5223,17 +5245,27 @@ TALER_EXCHANGE_management_add_partner_cancel (
|
|||||||
struct TALER_EXCHANGE_ManagementAddPartner *rh);
|
struct TALER_EXCHANGE_ManagementAddPartner *rh);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response when enabling an auditor.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_ManagementAuditorEnableResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* HTTP response data.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_HttpResponse hr;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with information about the auditor setup operation result.
|
* Function called with information about the auditor setup operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param hr HTTP response data
|
* @param aer response data
|
||||||
*/
|
*/
|
||||||
// FIXME: bad API
|
|
||||||
typedef void
|
typedef void
|
||||||
(*TALER_EXCHANGE_ManagementAuditorEnableCallback) (
|
(*TALER_EXCHANGE_ManagementAuditorEnableCallback) (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr);
|
const struct TALER_EXCHANGE_ManagementAuditorEnableResponse *aer);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -5278,18 +5310,27 @@ void
|
|||||||
TALER_EXCHANGE_management_enable_auditor_cancel (
|
TALER_EXCHANGE_management_enable_auditor_cancel (
|
||||||
struct TALER_EXCHANGE_ManagementAuditorEnableHandle *ah);
|
struct TALER_EXCHANGE_ManagementAuditorEnableHandle *ah);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response when disabling an auditor.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_ManagementAuditorDisableResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* HTTP response data.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_HttpResponse hr;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with information about the auditor disable operation result.
|
* Function called with information about the auditor disable operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param hr HTTP response data
|
* @param adr HTTP response data
|
||||||
*/
|
*/
|
||||||
// FIXME: bad API
|
|
||||||
typedef void
|
typedef void
|
||||||
(*TALER_EXCHANGE_ManagementAuditorDisableCallback) (
|
(*TALER_EXCHANGE_ManagementAuditorDisableCallback) (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr);
|
const struct TALER_EXCHANGE_ManagementAuditorDisableResponse *adr);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -5467,17 +5508,27 @@ TALER_EXCHANGE_management_disable_wire_cancel (
|
|||||||
struct TALER_EXCHANGE_ManagementWireDisableHandle *wh);
|
struct TALER_EXCHANGE_ManagementWireDisableHandle *wh);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response when setting wire fees.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_ManagementSetWireFeeResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* HTTP response data.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_HttpResponse hr;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with information about the wire enable operation result.
|
* Function called with information about the wire enable operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param hr HTTP response data
|
* @param wfr response data
|
||||||
*/
|
*/
|
||||||
// FIXME: bad API
|
|
||||||
typedef void
|
typedef void
|
||||||
(*TALER_EXCHANGE_ManagementSetWireFeeCallback) (
|
(*TALER_EXCHANGE_ManagementSetWireFeeCallback) (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr);
|
const struct TALER_EXCHANGE_ManagementSetWireFeeResponse *wfr);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -5524,17 +5575,28 @@ TALER_EXCHANGE_management_set_wire_fees_cancel (
|
|||||||
struct TALER_EXCHANGE_ManagementSetWireFeeHandle *swfh);
|
struct TALER_EXCHANGE_ManagementSetWireFeeHandle *swfh);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response when setting global fees.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_ManagementSetGlobalFeeResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* HTTP response data.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_HttpResponse hr;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with information about the global fee setting operation result.
|
* Function called with information about the global fee setting operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param hr HTTP response data
|
* @param gfr HTTP response data
|
||||||
*/
|
*/
|
||||||
// FIXME: bad API
|
|
||||||
typedef void
|
typedef void
|
||||||
(*TALER_EXCHANGE_ManagementSetGlobalFeeCallback) (
|
(*TALER_EXCHANGE_ManagementSetGlobalFeeCallback) (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr);
|
const struct TALER_EXCHANGE_ManagementSetGlobalFeeResponse *gfr);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -5585,18 +5647,29 @@ TALER_EXCHANGE_management_set_global_fees_cancel (
|
|||||||
struct TALER_EXCHANGE_ManagementSetGlobalFeeHandle *sgfh);
|
struct TALER_EXCHANGE_ManagementSetGlobalFeeHandle *sgfh);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response when adding denomination signature by auditor.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_AuditorAddDenominationResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* HTTP response data.
|
||||||
|
*/
|
||||||
|
struct TALER_EXCHANGE_HttpResponse hr;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with information about the POST
|
* Function called with information about the POST
|
||||||
* /auditor/$AUDITOR_PUB/$H_DENOM_PUB operation result.
|
* /auditor/$AUDITOR_PUB/$H_DENOM_PUB operation result.
|
||||||
*
|
*
|
||||||
* @param cls closure
|
* @param cls closure
|
||||||
* @param hr HTTP response data
|
* @param adr HTTP response data
|
||||||
*/
|
*/
|
||||||
// FIXME: bad API
|
|
||||||
typedef void
|
typedef void
|
||||||
(*TALER_EXCHANGE_AuditorAddDenominationCallback) (
|
(*TALER_EXCHANGE_AuditorAddDenominationCallback) (
|
||||||
void *cls,
|
void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr);
|
const struct TALER_EXCHANGE_AuditorAddDenominationResponse *adr);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5577,8 +5577,8 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
(*insert_wire)(void *cls,
|
(*insert_wire)(void *cls,
|
||||||
const char *payto_uri,
|
const char *payto_uri,
|
||||||
const char *conversion_url,
|
const char *conversion_url,
|
||||||
json_t *debit_restrictions,
|
const json_t *debit_restrictions,
|
||||||
json_t *credit_restrictions,
|
const json_t *credit_restrictions,
|
||||||
struct GNUNET_TIME_Timestamp start_date,
|
struct GNUNET_TIME_Timestamp start_date,
|
||||||
const struct TALER_MasterSignatureP *master_sig);
|
const struct TALER_MasterSignatureP *master_sig);
|
||||||
|
|
||||||
@ -5600,8 +5600,8 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
(*update_wire)(void *cls,
|
(*update_wire)(void *cls,
|
||||||
const char *payto_uri,
|
const char *payto_uri,
|
||||||
const char *conversion_url,
|
const char *conversion_url,
|
||||||
json_t *debit_restrictions,
|
const json_t *debit_restrictions,
|
||||||
json_t *credit_restrictions,
|
const json_t *credit_restrictions,
|
||||||
struct GNUNET_TIME_Timestamp change_date,
|
struct GNUNET_TIME_Timestamp change_date,
|
||||||
bool enabled);
|
bool enabled);
|
||||||
|
|
||||||
|
@ -259,13 +259,13 @@ TALER_extensions_parse_manifest (
|
|||||||
*/
|
*/
|
||||||
enum GNUNET_GenericReturnValue
|
enum GNUNET_GenericReturnValue
|
||||||
TALER_extensions_load_manifests (
|
TALER_extensions_load_manifests (
|
||||||
json_t *manifests);
|
const json_t *manifests);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Returns the head of the linked list of extensions.
|
* @brief Returns the head of the linked list of extensions.
|
||||||
*/
|
*/
|
||||||
const struct TALER_Extensions *
|
const struct TALER_Extensions *
|
||||||
TALER_extensions_get_head ();
|
TALER_extensions_get_head (void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Finds and returns a supported extension by a given type.
|
* @brief Finds and returns a supported extension by a given type.
|
||||||
@ -323,7 +323,7 @@ TALER_extensions_is_enabled (
|
|||||||
*/
|
*/
|
||||||
enum GNUNET_GenericReturnValue
|
enum GNUNET_GenericReturnValue
|
||||||
TALER_extensions_verify_manifests_signature (
|
TALER_extensions_verify_manifests_signature (
|
||||||
json_t *manifests,
|
const json_t *manifests,
|
||||||
struct TALER_MasterSignatureP *extensions_sig,
|
struct TALER_MasterSignatureP *extensions_sig,
|
||||||
struct TALER_MasterPublicKeyP *master_pub);
|
struct TALER_MasterPublicKeyP *master_pub);
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ struct TALER_AgeRestrictionConfig
|
|||||||
* @return age restriction configuration if present, otherwise NULL.
|
* @return age restriction configuration if present, otherwise NULL.
|
||||||
*/
|
*/
|
||||||
const struct TALER_AgeRestrictionConfig *
|
const struct TALER_AgeRestrictionConfig *
|
||||||
TALER_extensions_get_age_restriction_config ();
|
TALER_extensions_get_age_restriction_config (void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if age restriction is enabled
|
* @brief Check if age restriction is enabled
|
||||||
@ -371,7 +371,7 @@ TALER_extensions_get_age_restriction_config ();
|
|||||||
* @return true, if age restriction is loaded, configured and enabled; otherwise false.
|
* @return true, if age restriction is loaded, configured and enabled; otherwise false.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
TALER_extensions_is_age_restriction_enabled ();
|
TALER_extensions_is_age_restriction_enabled (void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return the age mask for age restriction
|
* @brief Return the age mask for age restriction
|
||||||
@ -379,6 +379,6 @@ TALER_extensions_is_age_restriction_enabled ();
|
|||||||
* @return configured age mask, if age restriction is loaded, configured and enabled; otherwise zero mask.
|
* @return configured age mask, if age restriction is loaded, configured and enabled; otherwise zero mask.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeMask
|
struct TALER_AgeMask
|
||||||
TALER_extensions_get_age_restriction_mask ();
|
TALER_extensions_get_age_restriction_mask (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1237,11 +1237,6 @@ parse_i18n_string (void *cls,
|
|||||||
const char *str;
|
const char *str;
|
||||||
|
|
||||||
str = json_string_value (val);
|
str = json_string_value (val);
|
||||||
if (NULL == str)
|
|
||||||
{
|
|
||||||
GNUNET_break_op (0);
|
|
||||||
return GNUNET_SYSERR;
|
|
||||||
}
|
|
||||||
*(const char **) spec->ptr = str;
|
*(const char **) spec->ptr = str;
|
||||||
}
|
}
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
|
@ -758,11 +758,12 @@ kycaid_webhook_cancel (struct TALER_KYCLOGIC_WebhookHandle *wh)
|
|||||||
* @param verifications JSON object with failure details
|
* @param verifications JSON object with failure details
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
log_failure (json_t *verifications)
|
log_failure (const json_t *verifications)
|
||||||
{
|
{
|
||||||
json_t *member;
|
const json_t *member;
|
||||||
const char *name;
|
const char *name;
|
||||||
json_object_foreach (verifications, name, member)
|
|
||||||
|
json_object_foreach ((json_t *) verifications, name, member)
|
||||||
{
|
{
|
||||||
bool iverified;
|
bool iverified;
|
||||||
const char *comment;
|
const char *comment;
|
||||||
@ -1176,7 +1177,7 @@ kycaid_webhook (void *cls,
|
|||||||
const char *status = NULL;
|
const char *status = NULL;
|
||||||
bool verified = false;
|
bool verified = false;
|
||||||
bool no_verified = true;
|
bool no_verified = true;
|
||||||
json_t *verifications = NULL;
|
const json_t *verifications = NULL;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_string ("request_id",
|
GNUNET_JSON_spec_string ("request_id",
|
||||||
&request_id),
|
&request_id),
|
||||||
@ -1195,8 +1196,8 @@ kycaid_webhook (void *cls,
|
|||||||
&verified),
|
&verified),
|
||||||
&no_verified),
|
&no_verified),
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
GNUNET_JSON_spec_json ("verifications",
|
GNUNET_JSON_spec_object_const ("verifications",
|
||||||
&verifications),
|
&verifications),
|
||||||
NULL),
|
NULL),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
@ -1253,7 +1254,6 @@ kycaid_webhook (void *cls,
|
|||||||
wh->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
|
wh->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
wh->task = GNUNET_SCHEDULER_add_now (&async_webhook_reply,
|
wh->task = GNUNET_SCHEDULER_add_now (&async_webhook_reply,
|
||||||
wh);
|
wh);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return wh;
|
return wh;
|
||||||
}
|
}
|
||||||
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
|
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
|
||||||
@ -1267,7 +1267,6 @@ kycaid_webhook (void *cls,
|
|||||||
wh->response_code = MHD_HTTP_NOT_FOUND;
|
wh->response_code = MHD_HTTP_NOT_FOUND;
|
||||||
wh->task = GNUNET_SCHEDULER_add_now (&async_webhook_reply,
|
wh->task = GNUNET_SCHEDULER_add_now (&async_webhook_reply,
|
||||||
wh);
|
wh);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return wh;
|
return wh;
|
||||||
}
|
}
|
||||||
wh->verification_id = GNUNET_strdup (verification_id);
|
wh->verification_id = GNUNET_strdup (verification_id);
|
||||||
@ -1286,7 +1285,6 @@ kycaid_webhook (void *cls,
|
|||||||
MHD_RESPMEM_PERSISTENT);
|
MHD_RESPMEM_PERSISTENT);
|
||||||
wh->task = GNUNET_SCHEDULER_add_now (&async_webhook_reply,
|
wh->task = GNUNET_SCHEDULER_add_now (&async_webhook_reply,
|
||||||
wh);
|
wh);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return wh;
|
return wh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1300,7 +1298,6 @@ kycaid_webhook (void *cls,
|
|||||||
wh->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
|
wh->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
wh->task = GNUNET_SCHEDULER_add_now (&async_webhook_reply,
|
wh->task = GNUNET_SCHEDULER_add_now (&async_webhook_reply,
|
||||||
wh);
|
wh);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return wh;
|
return wh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1324,7 +1321,6 @@ kycaid_webhook (void *cls,
|
|||||||
pd->slist,
|
pd->slist,
|
||||||
&handle_webhook_finished,
|
&handle_webhook_finished,
|
||||||
wh);
|
wh);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return wh;
|
return wh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -951,12 +951,12 @@ parse_proof_success_reply (struct TALER_KYCLOGIC_ProofHandle *ph,
|
|||||||
const json_t *j)
|
const json_t *j)
|
||||||
{
|
{
|
||||||
const char *state;
|
const char *state;
|
||||||
json_t *data;
|
const json_t *data;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_string ("status",
|
GNUNET_JSON_spec_string ("status",
|
||||||
&state),
|
&state),
|
||||||
GNUNET_JSON_spec_json ("data",
|
GNUNET_JSON_spec_object_const ("data",
|
||||||
&data),
|
&data),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
enum GNUNET_GenericReturnValue res;
|
enum GNUNET_GenericReturnValue res;
|
||||||
@ -988,7 +988,6 @@ parse_proof_success_reply (struct TALER_KYCLOGIC_ProofHandle *ph,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
handle_proof_error (ph,
|
handle_proof_error (ph,
|
||||||
j);
|
j);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@ -1016,7 +1015,6 @@ parse_proof_success_reply (struct TALER_KYCLOGIC_ProofHandle *ph,
|
|||||||
"Unexpected response from KYC gateway: data must contain id");
|
"Unexpected response from KYC gateway: data must contain id");
|
||||||
ph->http_status
|
ph->http_status
|
||||||
= MHD_HTTP_BAD_GATEWAY;
|
= MHD_HTTP_BAD_GATEWAY;
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ph->status = TALER_KYCLOGIC_STATUS_SUCCESS;
|
ph->status = TALER_KYCLOGIC_STATUS_SUCCESS;
|
||||||
@ -1034,7 +1032,6 @@ parse_proof_success_reply (struct TALER_KYCLOGIC_ProofHandle *ph,
|
|||||||
}
|
}
|
||||||
ph->attributes = data2attributes (ph->pd,
|
ph->attributes = data2attributes (ph->pd,
|
||||||
data);
|
data);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1113,17 +1113,17 @@ handle_proof_finished (void *cls,
|
|||||||
const char *inquiry_id;
|
const char *inquiry_id;
|
||||||
const char *account_id;
|
const char *account_id;
|
||||||
const char *type = NULL;
|
const char *type = NULL;
|
||||||
json_t *attributes;
|
const json_t *attributes;
|
||||||
json_t *relationships;
|
const json_t *relationships;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_string ("type",
|
GNUNET_JSON_spec_string ("type",
|
||||||
&type),
|
&type),
|
||||||
GNUNET_JSON_spec_string ("id",
|
GNUNET_JSON_spec_string ("id",
|
||||||
&inquiry_id),
|
&inquiry_id),
|
||||||
GNUNET_JSON_spec_json ("attributes",
|
GNUNET_JSON_spec_object_const ("attributes",
|
||||||
&attributes),
|
&attributes),
|
||||||
GNUNET_JSON_spec_json ("relationships",
|
GNUNET_JSON_spec_object_const ("relationships",
|
||||||
&relationships),
|
&relationships),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1141,7 +1141,6 @@ handle_proof_finished (void *cls,
|
|||||||
inquiry_id,
|
inquiry_id,
|
||||||
"data",
|
"data",
|
||||||
data);
|
data);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1172,8 +1171,6 @@ handle_proof_finished (void *cls,
|
|||||||
inquiry_id,
|
inquiry_id,
|
||||||
"data-attributes",
|
"data-attributes",
|
||||||
data);
|
data);
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@ -1192,8 +1189,6 @@ handle_proof_finished (void *cls,
|
|||||||
inquiry_id,
|
inquiry_id,
|
||||||
"data-attributes-reference_id",
|
"data-attributes-reference_id",
|
||||||
data);
|
data);
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1207,8 +1202,6 @@ handle_proof_finished (void *cls,
|
|||||||
inquiry_id,
|
inquiry_id,
|
||||||
"data-id",
|
"data-id",
|
||||||
data);
|
data);
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1240,8 +1233,6 @@ handle_proof_finished (void *cls,
|
|||||||
GNUNET_JSON_pack_object_incref ("data",
|
GNUNET_JSON_pack_object_incref ("data",
|
||||||
(json_t *)
|
(json_t *)
|
||||||
data))));
|
data))));
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1260,9 +1251,7 @@ handle_proof_finished (void *cls,
|
|||||||
j,
|
j,
|
||||||
&proof_post_conversion_cb,
|
&proof_post_conversion_cb,
|
||||||
ph);
|
ph);
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return; /* continued in proof_post_conversion_cb */
|
return; /* continued in proof_post_conversion_cb */
|
||||||
}
|
}
|
||||||
case MHD_HTTP_BAD_REQUEST:
|
case MHD_HTTP_BAD_REQUEST:
|
||||||
@ -1649,17 +1638,17 @@ handle_webhook_finished (void *cls,
|
|||||||
const char *inquiry_id;
|
const char *inquiry_id;
|
||||||
const char *account_id;
|
const char *account_id;
|
||||||
const char *type = NULL;
|
const char *type = NULL;
|
||||||
json_t *attributes;
|
const json_t *attributes;
|
||||||
json_t *relationships;
|
const json_t *relationships;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_string ("type",
|
GNUNET_JSON_spec_string ("type",
|
||||||
&type),
|
&type),
|
||||||
GNUNET_JSON_spec_string ("id",
|
GNUNET_JSON_spec_string ("id",
|
||||||
&inquiry_id),
|
&inquiry_id),
|
||||||
GNUNET_JSON_spec_json ("attributes",
|
GNUNET_JSON_spec_object_const ("attributes",
|
||||||
&attributes),
|
&attributes),
|
||||||
GNUNET_JSON_spec_json ("relationships",
|
GNUNET_JSON_spec_object_const ("relationships",
|
||||||
&relationships),
|
&relationships),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1709,8 +1698,6 @@ handle_webhook_finished (void *cls,
|
|||||||
webhook_reply_error (wh,
|
webhook_reply_error (wh,
|
||||||
inquiry_id,
|
inquiry_id,
|
||||||
MHD_HTTP_BAD_GATEWAY);
|
MHD_HTTP_BAD_GATEWAY);
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@ -1727,8 +1714,6 @@ handle_webhook_finished (void *cls,
|
|||||||
webhook_reply_error (wh,
|
webhook_reply_error (wh,
|
||||||
inquiry_id,
|
inquiry_id,
|
||||||
MHD_HTTP_BAD_GATEWAY);
|
MHD_HTTP_BAD_GATEWAY);
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1740,8 +1725,6 @@ handle_webhook_finished (void *cls,
|
|||||||
webhook_reply_error (wh,
|
webhook_reply_error (wh,
|
||||||
inquiry_id,
|
inquiry_id,
|
||||||
MHD_HTTP_BAD_GATEWAY);
|
MHD_HTTP_BAD_GATEWAY);
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1763,8 +1746,6 @@ handle_webhook_finished (void *cls,
|
|||||||
inquiry_id,
|
inquiry_id,
|
||||||
NULL,
|
NULL,
|
||||||
MHD_HTTP_OK);
|
MHD_HTTP_OK);
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1784,9 +1765,7 @@ handle_webhook_finished (void *cls,
|
|||||||
j,
|
j,
|
||||||
&webhook_post_conversion_cb,
|
&webhook_post_conversion_cb,
|
||||||
wh);
|
wh);
|
||||||
GNUNET_JSON_parse_free (ispec);
|
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return; /* continued in webhook_post_conversion_cb */
|
return; /* continued in webhook_post_conversion_cb */
|
||||||
}
|
}
|
||||||
case MHD_HTTP_BAD_REQUEST:
|
case MHD_HTTP_BAD_REQUEST:
|
||||||
|
0
src/kyclogic/taler-exchange-kyc-kycaid-converter.sh
Normal file → Executable file
0
src/kyclogic/taler-exchange-kyc-kycaid-converter.sh
Normal file → Executable file
@ -79,9 +79,9 @@ handle_add_aml_decision_finished (void *cls,
|
|||||||
{
|
{
|
||||||
struct TALER_EXCHANGE_AddAmlDecision *wh = cls;
|
struct TALER_EXCHANGE_AddAmlDecision *wh = cls;
|
||||||
const json_t *json = response;
|
const json_t *json = response;
|
||||||
struct TALER_EXCHANGE_HttpResponse hr = {
|
struct TALER_EXCHANGE_AddAmlDecisionResponse adr = {
|
||||||
.http_status = (unsigned int) response_code,
|
.hr.http_status = (unsigned int) response_code,
|
||||||
.reply = json
|
.hr.reply = json
|
||||||
};
|
};
|
||||||
|
|
||||||
wh->job = NULL;
|
wh->job = NULL;
|
||||||
@ -89,34 +89,34 @@ handle_add_aml_decision_finished (void *cls,
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
/* no reply */
|
/* no reply */
|
||||||
hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
adr.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
||||||
hr.hint = "server offline?";
|
adr.hr.hint = "server offline?";
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_NO_CONTENT:
|
case MHD_HTTP_NO_CONTENT:
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_FORBIDDEN:
|
case MHD_HTTP_FORBIDDEN:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_CONFLICT:
|
case MHD_HTTP_CONFLICT:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unexpected response code */
|
/* unexpected response code */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Unexpected response code %u/%d for exchange AML decision\n",
|
"Unexpected response code %u/%d for exchange AML decision\n",
|
||||||
(unsigned int) response_code,
|
(unsigned int) response_code,
|
||||||
(int) hr.ec);
|
(int) adr.hr.ec);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (NULL != wh->cb)
|
if (NULL != wh->cb)
|
||||||
{
|
{
|
||||||
wh->cb (wh->cb_cls,
|
wh->cb (wh->cb_cls,
|
||||||
&hr);
|
&adr);
|
||||||
wh->cb = NULL;
|
wh->cb = NULL;
|
||||||
}
|
}
|
||||||
TALER_EXCHANGE_add_aml_decision_cancel (wh);
|
TALER_EXCHANGE_add_aml_decision_cancel (wh);
|
||||||
|
@ -79,9 +79,9 @@ handle_auditor_add_denomination_finished (void *cls,
|
|||||||
{
|
{
|
||||||
struct TALER_EXCHANGE_AuditorAddDenominationHandle *ah = cls;
|
struct TALER_EXCHANGE_AuditorAddDenominationHandle *ah = cls;
|
||||||
const json_t *json = response;
|
const json_t *json = response;
|
||||||
struct TALER_EXCHANGE_HttpResponse hr = {
|
struct TALER_EXCHANGE_AuditorAddDenominationResponse adr = {
|
||||||
.http_status = (unsigned int) response_code,
|
.hr.http_status = (unsigned int) response_code,
|
||||||
.reply = json
|
.hr.reply = json
|
||||||
};
|
};
|
||||||
|
|
||||||
ah->job = NULL;
|
ah->job = NULL;
|
||||||
@ -90,37 +90,37 @@ handle_auditor_add_denomination_finished (void *cls,
|
|||||||
case MHD_HTTP_NO_CONTENT:
|
case MHD_HTTP_NO_CONTENT:
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_FORBIDDEN:
|
case MHD_HTTP_FORBIDDEN:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_NOT_FOUND:
|
case MHD_HTTP_NOT_FOUND:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_GONE:
|
case MHD_HTTP_GONE:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_PRECONDITION_FAILED:
|
case MHD_HTTP_PRECONDITION_FAILED:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unexpected response code */
|
/* unexpected response code */
|
||||||
if (NULL != json)
|
if (NULL != json)
|
||||||
{
|
{
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Unexpected response code %u/%d for exchange auditor-add-denomination at URL `%s'\n",
|
"Unexpected response code %u/%d for exchange auditor-add-denomination at URL `%s'\n",
|
||||||
(unsigned int) response_code,
|
(unsigned int) response_code,
|
||||||
(int) hr.ec,
|
(int) adr.hr.ec,
|
||||||
ah->url);
|
ah->url);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
adr.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
||||||
hr.hint = NULL;
|
adr.hr.hint = NULL;
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Unexpected HTTP response code %u (no JSON returned) at URL `%s'\n",
|
"Unexpected HTTP response code %u (no JSON returned) at URL `%s'\n",
|
||||||
(unsigned int) response_code,
|
(unsigned int) response_code,
|
||||||
@ -131,7 +131,7 @@ handle_auditor_add_denomination_finished (void *cls,
|
|||||||
if (NULL != ah->cb)
|
if (NULL != ah->cb)
|
||||||
{
|
{
|
||||||
ah->cb (ah->cb_cls,
|
ah->cb (ah->cb_cls,
|
||||||
&hr);
|
&adr);
|
||||||
ah->cb = NULL;
|
ah->cb = NULL;
|
||||||
}
|
}
|
||||||
TALER_EXCHANGE_add_auditor_denomination_cancel (ah);
|
TALER_EXCHANGE_add_auditor_denomination_cancel (ah);
|
||||||
|
@ -237,12 +237,12 @@ handle_deposit_finished (void *cls,
|
|||||||
case MHD_HTTP_OK:
|
case MHD_HTTP_OK:
|
||||||
{
|
{
|
||||||
const struct TALER_EXCHANGE_Keys *key_state;
|
const struct TALER_EXCHANGE_Keys *key_state;
|
||||||
json_t *sigs;
|
const json_t *sigs;
|
||||||
json_t *sig;
|
json_t *sig;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("exchange_sigs",
|
GNUNET_JSON_spec_array_const ("exchange_sigs",
|
||||||
&sigs),
|
&sigs),
|
||||||
GNUNET_JSON_spec_fixed_auto ("exchange_pub",
|
GNUNET_JSON_spec_fixed_auto ("exchange_pub",
|
||||||
&dh->exchange_pub),
|
&dh->exchange_pub),
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
@ -269,7 +269,6 @@ handle_deposit_finished (void *cls,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
dr.hr.http_status = 0;
|
dr.hr.http_status = 0;
|
||||||
dr.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
|
dr.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dh->exchange_sigs = GNUNET_new_array (dh->num_cdds,
|
dh->exchange_sigs = GNUNET_new_array (dh->num_cdds,
|
||||||
@ -282,7 +281,6 @@ handle_deposit_finished (void *cls,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
dr.hr.http_status = 0;
|
dr.hr.http_status = 0;
|
||||||
dr.hr.ec = TALER_EC_EXCHANGE_DEPOSIT_INVALID_SIGNATURE_BY_EXCHANGE;
|
dr.hr.ec = TALER_EC_EXCHANGE_DEPOSIT_INVALID_SIGNATURE_BY_EXCHANGE;
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
json_array_foreach (sigs, idx, sig)
|
json_array_foreach (sigs, idx, sig)
|
||||||
@ -303,7 +301,6 @@ handle_deposit_finished (void *cls,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
dr.hr.http_status = 0;
|
dr.hr.http_status = 0;
|
||||||
dr.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
|
dr.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dki = TALER_EXCHANGE_get_denomination_key_by_hash (key_state,
|
dki = TALER_EXCHANGE_get_denomination_key_by_hash (key_state,
|
||||||
@ -332,14 +329,12 @@ handle_deposit_finished (void *cls,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
dr.hr.http_status = 0;
|
dr.hr.http_status = 0;
|
||||||
dr.hr.ec = TALER_EC_EXCHANGE_DEPOSIT_INVALID_SIGNATURE_BY_EXCHANGE;
|
dr.hr.ec = TALER_EC_EXCHANGE_DEPOSIT_INVALID_SIGNATURE_BY_EXCHANGE;
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TEAH_get_auditors_for_dc (dh->exchange,
|
TEAH_get_auditors_for_dc (dh->exchange,
|
||||||
&auditor_cb,
|
&auditor_cb,
|
||||||
dh);
|
dh);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
}
|
}
|
||||||
dr.details.ok.exchange_sigs = dh->exchange_sigs;
|
dr.details.ok.exchange_sigs = dh->exchange_sigs;
|
||||||
dr.details.ok.exchange_pub = &dh->exchange_pub;
|
dr.details.ok.exchange_pub = &dh->exchange_pub;
|
||||||
|
@ -1465,7 +1465,7 @@ enum GNUNET_GenericReturnValue
|
|||||||
TALER_EXCHANGE_verify_coin_history (
|
TALER_EXCHANGE_verify_coin_history (
|
||||||
const struct TALER_EXCHANGE_DenomPublicKey *dk,
|
const struct TALER_EXCHANGE_DenomPublicKey *dk,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
json_t *history,
|
const json_t *history,
|
||||||
struct TALER_Amount *total)
|
struct TALER_Amount *total)
|
||||||
{
|
{
|
||||||
const char *currency = dk->value.currency;
|
const char *currency = dk->value.currency;
|
||||||
@ -1865,7 +1865,7 @@ TALER_EXCHANGE_check_coin_amount_conflict_ (
|
|||||||
struct TALER_CoinSpendPublicKeyP *coin_pub,
|
struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
struct TALER_Amount *remaining)
|
struct TALER_Amount *remaining)
|
||||||
{
|
{
|
||||||
json_t *history;
|
const json_t *history;
|
||||||
struct TALER_Amount total;
|
struct TALER_Amount total;
|
||||||
struct TALER_DenominationHashP h_denom_pub;
|
struct TALER_DenominationHashP h_denom_pub;
|
||||||
const struct TALER_EXCHANGE_DenomPublicKey *dki;
|
const struct TALER_EXCHANGE_DenomPublicKey *dki;
|
||||||
@ -1874,8 +1874,8 @@ TALER_EXCHANGE_check_coin_amount_conflict_ (
|
|||||||
coin_pub),
|
coin_pub),
|
||||||
GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
|
GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
|
||||||
&h_denom_pub),
|
&h_denom_pub),
|
||||||
GNUNET_JSON_spec_json ("history",
|
GNUNET_JSON_spec_array_const ("history",
|
||||||
&history),
|
&history),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1902,10 +1902,8 @@ TALER_EXCHANGE_check_coin_amount_conflict_ (
|
|||||||
&total))
|
&total))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
json_decref (history);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
json_decref (history);
|
|
||||||
if (0 >
|
if (0 >
|
||||||
TALER_amount_subtract (remaining,
|
TALER_amount_subtract (remaining,
|
||||||
&dki->value,
|
&dki->value,
|
||||||
@ -2298,8 +2296,8 @@ TALER_EXCHANGE_parse_accounts (const struct TALER_MasterPublicKeyP *master_pub,
|
|||||||
i++)
|
i++)
|
||||||
{
|
{
|
||||||
struct TALER_EXCHANGE_WireAccount *wa = &was[i];
|
struct TALER_EXCHANGE_WireAccount *wa = &was[i];
|
||||||
json_t *credit_restrictions;
|
const json_t *credit_restrictions;
|
||||||
json_t *debit_restrictions;
|
const json_t *debit_restrictions;
|
||||||
struct GNUNET_JSON_Specification spec_account[] = {
|
struct GNUNET_JSON_Specification spec_account[] = {
|
||||||
GNUNET_JSON_spec_string ("payto_uri",
|
GNUNET_JSON_spec_string ("payto_uri",
|
||||||
&wa->payto_uri),
|
&wa->payto_uri),
|
||||||
@ -2307,10 +2305,10 @@ TALER_EXCHANGE_parse_accounts (const struct TALER_MasterPublicKeyP *master_pub,
|
|||||||
GNUNET_JSON_spec_string ("conversion_url",
|
GNUNET_JSON_spec_string ("conversion_url",
|
||||||
&wa->conversion_url),
|
&wa->conversion_url),
|
||||||
NULL),
|
NULL),
|
||||||
GNUNET_JSON_spec_json ("credit_restrictions",
|
GNUNET_JSON_spec_array_const ("credit_restrictions",
|
||||||
&credit_restrictions),
|
&credit_restrictions),
|
||||||
GNUNET_JSON_spec_json ("debit_restrictions",
|
GNUNET_JSON_spec_array_const ("debit_restrictions",
|
||||||
&debit_restrictions),
|
&debit_restrictions),
|
||||||
GNUNET_JSON_spec_fixed_auto ("master_sig",
|
GNUNET_JSON_spec_fixed_auto ("master_sig",
|
||||||
&wa->master_sig),
|
&wa->master_sig),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
@ -2366,7 +2364,6 @@ TALER_EXCHANGE_parse_accounts (const struct TALER_MasterPublicKeyP *master_pub,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec_account);
|
|
||||||
} /* end 'for all accounts */
|
} /* end 'for all accounts */
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,7 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
|
|||||||
json_t *auditor_obj,
|
json_t *auditor_obj,
|
||||||
const struct TALER_EXCHANGE_Keys *key_data)
|
const struct TALER_EXCHANGE_Keys *key_data)
|
||||||
{
|
{
|
||||||
json_t *keys;
|
const json_t *keys;
|
||||||
json_t *key;
|
json_t *key;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
unsigned int off;
|
unsigned int off;
|
||||||
@ -411,8 +411,8 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
|
|||||||
&auditor->auditor_pub),
|
&auditor->auditor_pub),
|
||||||
GNUNET_JSON_spec_string ("auditor_url",
|
GNUNET_JSON_spec_string ("auditor_url",
|
||||||
&auditor_url),
|
&auditor_url),
|
||||||
GNUNET_JSON_spec_json ("denomination_keys",
|
GNUNET_JSON_spec_array_const ("denomination_keys",
|
||||||
&keys),
|
&keys),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -492,7 +492,6 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
|
|||||||
&auditor_sig))
|
&auditor_sig))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -501,7 +500,6 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
|
|||||||
off++;
|
off++;
|
||||||
}
|
}
|
||||||
auditor->num_denom_keys = off;
|
auditor->num_denom_keys = off;
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -734,7 +732,7 @@ decode_keys_json (const json_t *resp_obj,
|
|||||||
const char *currency;
|
const char *currency;
|
||||||
const char *asset_type;
|
const char *asset_type;
|
||||||
bool tipping_allowed = true;
|
bool tipping_allowed = true;
|
||||||
json_t *wblwk = NULL;
|
const json_t *wblwk = NULL;
|
||||||
struct GNUNET_JSON_Specification mspec[] = {
|
struct GNUNET_JSON_Specification mspec[] = {
|
||||||
GNUNET_JSON_spec_fixed_auto ("denominations_sig",
|
GNUNET_JSON_spec_fixed_auto ("denominations_sig",
|
||||||
&denominations_sig),
|
&denominations_sig),
|
||||||
@ -755,8 +753,8 @@ decode_keys_json (const json_t *resp_obj,
|
|||||||
&tipping_allowed),
|
&tipping_allowed),
|
||||||
NULL),
|
NULL),
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
GNUNET_JSON_spec_json ("wallet_balance_limit_without_kyc",
|
GNUNET_JSON_spec_array_const ("wallet_balance_limit_without_kyc",
|
||||||
&wblwk),
|
&wblwk),
|
||||||
NULL),
|
NULL),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
@ -908,14 +906,14 @@ decode_keys_json (const json_t *resp_obj,
|
|||||||
/* TODO: maybe lift all this into a FP in TALER_Extension ? */
|
/* TODO: maybe lift all this into a FP in TALER_Extension ? */
|
||||||
{
|
{
|
||||||
struct TALER_MasterSignatureP extensions_sig = {0};
|
struct TALER_MasterSignatureP extensions_sig = {0};
|
||||||
json_t *manifests = NULL;
|
const json_t *manifests = NULL;
|
||||||
bool no_extensions = false;
|
bool no_extensions = false;
|
||||||
bool no_signature = false;
|
bool no_signature = false;
|
||||||
|
|
||||||
struct GNUNET_JSON_Specification ext_spec[] = {
|
struct GNUNET_JSON_Specification ext_spec[] = {
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
GNUNET_JSON_spec_json ("extensions",
|
GNUNET_JSON_spec_object_const ("extensions",
|
||||||
&manifests),
|
&manifests),
|
||||||
&no_extensions),
|
&no_extensions),
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
GNUNET_JSON_spec_fixed_auto (
|
GNUNET_JSON_spec_fixed_auto (
|
||||||
@ -1707,15 +1705,15 @@ static void
|
|||||||
deserialize_data (struct TALER_EXCHANGE_Handle *exchange,
|
deserialize_data (struct TALER_EXCHANGE_Handle *exchange,
|
||||||
const json_t *data)
|
const json_t *data)
|
||||||
{
|
{
|
||||||
json_t *keys;
|
const json_t *keys;
|
||||||
const char *url;
|
const char *url;
|
||||||
uint32_t version;
|
uint32_t version;
|
||||||
struct GNUNET_TIME_Timestamp expire;
|
struct GNUNET_TIME_Timestamp expire;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_uint32 ("version",
|
GNUNET_JSON_spec_uint32 ("version",
|
||||||
&version),
|
&version),
|
||||||
GNUNET_JSON_spec_json ("keys",
|
GNUNET_JSON_spec_array_const ("keys",
|
||||||
&keys),
|
&keys),
|
||||||
GNUNET_JSON_spec_string ("exchange_url",
|
GNUNET_JSON_spec_string ("exchange_url",
|
||||||
&url),
|
&url),
|
||||||
GNUNET_JSON_spec_timestamp ("expire",
|
GNUNET_JSON_spec_timestamp ("expire",
|
||||||
@ -1742,14 +1740,12 @@ deserialize_data (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
}
|
}
|
||||||
if (0 != version)
|
if (0 != version)
|
||||||
{
|
{
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return; /* unsupported version */
|
return; /* unsupported version */
|
||||||
}
|
}
|
||||||
if (0 != strcmp (url,
|
if (0 != strcmp (url,
|
||||||
exchange->url))
|
exchange->url))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memset (&key_data,
|
memset (&key_data,
|
||||||
@ -1762,7 +1758,6 @@ deserialize_data (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
&kresp.details.ok.compat))
|
&kresp.details.ok.compat))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* decode successful, initialize with the result */
|
/* decode successful, initialize with the result */
|
||||||
@ -1777,7 +1772,6 @@ deserialize_data (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
/* notify application about the key information */
|
/* notify application about the key information */
|
||||||
exchange->cert_cb (exchange->cert_cb_cls,
|
exchange->cert_cb (exchange->cert_cb_cls,
|
||||||
&kresp);
|
&kresp);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ handle_kyc_check_finished (void *cls,
|
|||||||
break;
|
break;
|
||||||
case MHD_HTTP_OK:
|
case MHD_HTTP_OK:
|
||||||
{
|
{
|
||||||
json_t *kyc_details;
|
const json_t *kyc_details;
|
||||||
uint32_t status;
|
uint32_t status;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_fixed_auto ("exchange_sig",
|
GNUNET_JSON_spec_fixed_auto ("exchange_sig",
|
||||||
@ -105,8 +105,8 @@ handle_kyc_check_finished (void *cls,
|
|||||||
&ks.details.ok.exchange_pub),
|
&ks.details.ok.exchange_pub),
|
||||||
GNUNET_JSON_spec_timestamp ("now",
|
GNUNET_JSON_spec_timestamp ("now",
|
||||||
&ks.details.ok.timestamp),
|
&ks.details.ok.timestamp),
|
||||||
GNUNET_JSON_spec_json ("kyc_details",
|
GNUNET_JSON_spec_object_const ("kyc_details",
|
||||||
&kyc_details),
|
&kyc_details),
|
||||||
GNUNET_JSON_spec_uint32 ("aml_status",
|
GNUNET_JSON_spec_uint32 ("aml_status",
|
||||||
&status),
|
&status),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
|
@ -270,9 +270,10 @@ parse_link_ok (struct TALER_EXCHANGE_LinkHandle *lh,
|
|||||||
whilst 'i' and 'session' track the 2d array. *///
|
whilst 'i' and 'session' track the 2d array. *///
|
||||||
for (session = 0; session<json_array_size (json); session++)
|
for (session = 0; session<json_array_size (json); session++)
|
||||||
{
|
{
|
||||||
json_t *jsona;
|
const json_t *jsona;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("new_coins", &jsona),
|
GNUNET_JSON_spec_array_const ("new_coins",
|
||||||
|
&jsona),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -285,16 +286,8 @@ parse_link_ok (struct TALER_EXCHANGE_LinkHandle *lh,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (! json_is_array (jsona))
|
|
||||||
{
|
|
||||||
GNUNET_break_op (0);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* count all coins over all sessions */
|
/* count all coins over all sessions */
|
||||||
num_coins += json_array_size (jsona);
|
num_coins += json_array_size (jsona);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
}
|
}
|
||||||
/* Now that we know how big the 1d array is, allocate
|
/* Now that we know how big the 1d array is, allocate
|
||||||
and fill it. */
|
and fill it. */
|
||||||
@ -307,11 +300,11 @@ parse_link_ok (struct TALER_EXCHANGE_LinkHandle *lh,
|
|||||||
off_coin = 0;
|
off_coin = 0;
|
||||||
for (session = 0; session<json_array_size (json); session++)
|
for (session = 0; session<json_array_size (json); session++)
|
||||||
{
|
{
|
||||||
json_t *jsona;
|
const json_t *jsona;
|
||||||
struct TALER_TransferPublicKeyP trans_pub;
|
struct TALER_TransferPublicKeyP trans_pub;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("new_coins",
|
GNUNET_JSON_spec_array_const ("new_coins",
|
||||||
&jsona),
|
&jsona),
|
||||||
GNUNET_JSON_spec_fixed_auto ("transfer_pub",
|
GNUNET_JSON_spec_fixed_auto ("transfer_pub",
|
||||||
&trans_pub),
|
&trans_pub),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
@ -326,12 +319,6 @@ parse_link_ok (struct TALER_EXCHANGE_LinkHandle *lh,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (! json_is_array (jsona))
|
|
||||||
{
|
|
||||||
GNUNET_break_op (0);
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* decode all coins */
|
/* decode all coins */
|
||||||
for (i = 0; i<json_array_size (jsona); i++)
|
for (i = 0; i<json_array_size (jsona); i++)
|
||||||
@ -357,10 +344,8 @@ parse_link_ok (struct TALER_EXCHANGE_LinkHandle *lh,
|
|||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
ret = GNUNET_SYSERR;
|
ret = GNUNET_SYSERR;
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
} /* end of for (session) */
|
} /* end of for (session) */
|
||||||
|
|
||||||
if (off_coin == num_coins)
|
if (off_coin == num_coins)
|
||||||
|
@ -127,13 +127,12 @@ parse_kyc_attributes (const json_t *kyc_attributes,
|
|||||||
json_array_foreach (kyc_attributes, idx, obj)
|
json_array_foreach (kyc_attributes, idx, obj)
|
||||||
{
|
{
|
||||||
struct TALER_EXCHANGE_KycHistoryDetail *kyc = &kyc_attributes_ar[idx];
|
struct TALER_EXCHANGE_KycHistoryDetail *kyc = &kyc_attributes_ar[idx];
|
||||||
json_t *attributes = NULL;
|
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_timestamp ("collection_time",
|
GNUNET_JSON_spec_timestamp ("collection_time",
|
||||||
&kyc->collection_time),
|
&kyc->collection_time),
|
||||||
GNUNET_JSON_spec_mark_optional (
|
GNUNET_JSON_spec_mark_optional (
|
||||||
GNUNET_JSON_spec_json ("attributes",
|
GNUNET_JSON_spec_object_const ("attributes",
|
||||||
&attributes),
|
&kyc->attributes),
|
||||||
NULL),
|
NULL),
|
||||||
GNUNET_JSON_spec_string ("provider_section",
|
GNUNET_JSON_spec_string ("provider_section",
|
||||||
&kyc->provider_section),
|
&kyc->provider_section),
|
||||||
@ -149,8 +148,6 @@ parse_kyc_attributes (const json_t *kyc_attributes,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
kyc->attributes = attributes;
|
|
||||||
json_decref (attributes); /* this is OK, RC preserved via 'kyc_attributes' as long as needed! */
|
|
||||||
}
|
}
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
@ -171,13 +168,13 @@ parse_decision_ok (struct TALER_EXCHANGE_LookupAmlDecision *lh,
|
|||||||
.hr.reply = json,
|
.hr.reply = json,
|
||||||
.hr.http_status = MHD_HTTP_OK
|
.hr.http_status = MHD_HTTP_OK
|
||||||
};
|
};
|
||||||
json_t *aml_history;
|
const json_t *aml_history;
|
||||||
json_t *kyc_attributes;
|
const json_t *kyc_attributes;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("aml_history",
|
GNUNET_JSON_spec_array_const ("aml_history",
|
||||||
&aml_history),
|
&aml_history),
|
||||||
GNUNET_JSON_spec_json ("kyc_attributes",
|
GNUNET_JSON_spec_array_const ("kyc_attributes",
|
||||||
&kyc_attributes),
|
&kyc_attributes),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -199,6 +196,12 @@ parse_decision_ok (struct TALER_EXCHANGE_LookupAmlDecision *lh,
|
|||||||
GNUNET_NZL (lr.details.ok.kyc_attributes_length)];
|
GNUNET_NZL (lr.details.ok.kyc_attributes_length)];
|
||||||
enum GNUNET_GenericReturnValue ret = GNUNET_SYSERR;
|
enum GNUNET_GenericReturnValue ret = GNUNET_SYSERR;
|
||||||
|
|
||||||
|
memset (aml_history_ar,
|
||||||
|
0,
|
||||||
|
sizeof (aml_history_ar));
|
||||||
|
memset (kyc_attributes_ar,
|
||||||
|
0,
|
||||||
|
sizeof (kyc_attributes_ar));
|
||||||
lr.details.ok.aml_history = aml_history_ar;
|
lr.details.ok.aml_history = aml_history_ar;
|
||||||
lr.details.ok.kyc_attributes = kyc_attributes_ar;
|
lr.details.ok.kyc_attributes = kyc_attributes_ar;
|
||||||
ret = parse_aml_history (aml_history,
|
ret = parse_aml_history (aml_history,
|
||||||
|
@ -123,10 +123,10 @@ parse_decisions_ok (struct TALER_EXCHANGE_LookupAmlDecisions *lh,
|
|||||||
.hr.reply = json,
|
.hr.reply = json,
|
||||||
.hr.http_status = MHD_HTTP_OK
|
.hr.http_status = MHD_HTTP_OK
|
||||||
};
|
};
|
||||||
json_t *records;
|
const json_t *records;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("records",
|
GNUNET_JSON_spec_array_const ("records",
|
||||||
&records),
|
&records),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -79,9 +79,9 @@ handle_add_partner_finished (void *cls,
|
|||||||
{
|
{
|
||||||
struct TALER_EXCHANGE_ManagementAddPartner *wh = cls;
|
struct TALER_EXCHANGE_ManagementAddPartner *wh = cls;
|
||||||
const json_t *json = response;
|
const json_t *json = response;
|
||||||
struct TALER_EXCHANGE_HttpResponse hr = {
|
struct TALER_EXCHANGE_ManagementAddPartnerResponse apr = {
|
||||||
.http_status = (unsigned int) response_code,
|
.hr.http_status = (unsigned int) response_code,
|
||||||
.reply = json
|
.hr.reply = json
|
||||||
};
|
};
|
||||||
|
|
||||||
wh->job = NULL;
|
wh->job = NULL;
|
||||||
@ -89,34 +89,34 @@ handle_add_partner_finished (void *cls,
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
/* no reply */
|
/* no reply */
|
||||||
hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
apr.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
|
||||||
hr.hint = "server offline?";
|
apr.hr.hint = "server offline?";
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_NO_CONTENT:
|
case MHD_HTTP_NO_CONTENT:
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_FORBIDDEN:
|
case MHD_HTTP_FORBIDDEN:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
apr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
apr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_CONFLICT:
|
case MHD_HTTP_CONFLICT:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
apr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
apr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unexpected response code */
|
/* unexpected response code */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
apr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
apr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Unexpected response code %u/%d for adding exchange partner\n",
|
"Unexpected response code %u/%d for adding exchange partner\n",
|
||||||
(unsigned int) response_code,
|
(unsigned int) response_code,
|
||||||
(int) hr.ec);
|
(int) apr.hr.ec);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (NULL != wh->cb)
|
if (NULL != wh->cb)
|
||||||
{
|
{
|
||||||
wh->cb (wh->cb_cls,
|
wh->cb (wh->cb_cls,
|
||||||
&hr);
|
&apr);
|
||||||
wh->cb = NULL;
|
wh->cb = NULL;
|
||||||
}
|
}
|
||||||
TALER_EXCHANGE_management_add_partner_cancel (wh);
|
TALER_EXCHANGE_management_add_partner_cancel (wh);
|
||||||
|
@ -81,9 +81,9 @@ handle_auditor_disable_finished (void *cls,
|
|||||||
{
|
{
|
||||||
struct TALER_EXCHANGE_ManagementAuditorDisableHandle *ah = cls;
|
struct TALER_EXCHANGE_ManagementAuditorDisableHandle *ah = cls;
|
||||||
const json_t *json = response;
|
const json_t *json = response;
|
||||||
struct TALER_EXCHANGE_HttpResponse hr = {
|
struct TALER_EXCHANGE_ManagementAuditorDisableResponse adr = {
|
||||||
.http_status = (unsigned int) response_code,
|
.hr.http_status = (unsigned int) response_code,
|
||||||
.reply = json
|
.hr.reply = json
|
||||||
};
|
};
|
||||||
|
|
||||||
ah->job = NULL;
|
ah->job = NULL;
|
||||||
@ -92,32 +92,32 @@ handle_auditor_disable_finished (void *cls,
|
|||||||
case MHD_HTTP_NO_CONTENT:
|
case MHD_HTTP_NO_CONTENT:
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_FORBIDDEN:
|
case MHD_HTTP_FORBIDDEN:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_NOT_FOUND:
|
case MHD_HTTP_NOT_FOUND:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_CONFLICT:
|
case MHD_HTTP_CONFLICT:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unexpected response code */
|
/* unexpected response code */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
adr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
adr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Unexpected response code %u/%d for exchange management auditor disable\n",
|
"Unexpected response code %u/%d for exchange management auditor disable\n",
|
||||||
(unsigned int) response_code,
|
(unsigned int) response_code,
|
||||||
(int) hr.ec);
|
(int) adr.hr.ec);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (NULL != ah->cb)
|
if (NULL != ah->cb)
|
||||||
{
|
{
|
||||||
ah->cb (ah->cb_cls,
|
ah->cb (ah->cb_cls,
|
||||||
&hr);
|
&adr);
|
||||||
ah->cb = NULL;
|
ah->cb = NULL;
|
||||||
}
|
}
|
||||||
TALER_EXCHANGE_management_disable_auditor_cancel (ah);
|
TALER_EXCHANGE_management_disable_auditor_cancel (ah);
|
||||||
|
@ -82,9 +82,9 @@ handle_auditor_enable_finished (void *cls,
|
|||||||
{
|
{
|
||||||
struct TALER_EXCHANGE_ManagementAuditorEnableHandle *ah = cls;
|
struct TALER_EXCHANGE_ManagementAuditorEnableHandle *ah = cls;
|
||||||
const json_t *json = response;
|
const json_t *json = response;
|
||||||
struct TALER_EXCHANGE_HttpResponse hr = {
|
struct TALER_EXCHANGE_ManagementAuditorEnableResponse aer = {
|
||||||
.http_status = (unsigned int) response_code,
|
.hr.http_status = (unsigned int) response_code,
|
||||||
.reply = json
|
.hr.reply = json
|
||||||
};
|
};
|
||||||
|
|
||||||
ah->job = NULL;
|
ah->job = NULL;
|
||||||
@ -93,28 +93,28 @@ handle_auditor_enable_finished (void *cls,
|
|||||||
case MHD_HTTP_NO_CONTENT:
|
case MHD_HTTP_NO_CONTENT:
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_FORBIDDEN:
|
case MHD_HTTP_FORBIDDEN:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
aer.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
aer.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_CONFLICT:
|
case MHD_HTTP_CONFLICT:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
aer.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
aer.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unexpected response code */
|
/* unexpected response code */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
aer.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
aer.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Unexpected response code %u/%d for exchange management auditor enable\n",
|
"Unexpected response code %u/%d for exchange management auditor enable\n",
|
||||||
(unsigned int) response_code,
|
(unsigned int) response_code,
|
||||||
(int) hr.ec);
|
(int) aer.hr.ec);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (NULL != ah->cb)
|
if (NULL != ah->cb)
|
||||||
{
|
{
|
||||||
ah->cb (ah->cb_cls,
|
ah->cb (ah->cb_cls,
|
||||||
&hr);
|
&aer);
|
||||||
ah->cb = NULL;
|
ah->cb = NULL;
|
||||||
}
|
}
|
||||||
TALER_EXCHANGE_management_enable_auditor_cancel (ah);
|
TALER_EXCHANGE_management_enable_auditor_cancel (ah);
|
||||||
|
@ -85,14 +85,14 @@ handle_ok (struct TALER_EXCHANGE_ManagementGetKeysHandle *gh,
|
|||||||
};
|
};
|
||||||
struct TALER_EXCHANGE_FutureKeys *fk
|
struct TALER_EXCHANGE_FutureKeys *fk
|
||||||
= &gkr.details.ok.keys;
|
= &gkr.details.ok.keys;
|
||||||
json_t *sk;
|
const json_t *sk;
|
||||||
json_t *dk;
|
const json_t *dk;
|
||||||
bool ok;
|
bool ok;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("future_denoms",
|
GNUNET_JSON_spec_array_const ("future_denoms",
|
||||||
&dk),
|
&dk),
|
||||||
GNUNET_JSON_spec_json ("future_signkeys",
|
GNUNET_JSON_spec_array_const ("future_signkeys",
|
||||||
&sk),
|
&sk),
|
||||||
GNUNET_JSON_spec_fixed_auto ("master_pub",
|
GNUNET_JSON_spec_fixed_auto ("master_pub",
|
||||||
&fk->master_pub),
|
&fk->master_pub),
|
||||||
GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
|
GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
|
||||||
@ -127,7 +127,7 @@ handle_ok (struct TALER_EXCHANGE_ManagementGetKeysHandle *gh,
|
|||||||
i);
|
i);
|
||||||
struct TALER_EXCHANGE_FutureSigningPublicKey *sign_key
|
struct TALER_EXCHANGE_FutureSigningPublicKey *sign_key
|
||||||
= &fk->sign_keys[i];
|
= &fk->sign_keys[i];
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification ispec[] = {
|
||||||
GNUNET_JSON_spec_fixed_auto ("key",
|
GNUNET_JSON_spec_fixed_auto ("key",
|
||||||
&sign_key->key),
|
&sign_key->key),
|
||||||
GNUNET_JSON_spec_fixed_auto ("signkey_secmod_sig",
|
GNUNET_JSON_spec_fixed_auto ("signkey_secmod_sig",
|
||||||
@ -143,7 +143,7 @@ handle_ok (struct TALER_EXCHANGE_ManagementGetKeysHandle *gh,
|
|||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_JSON_parse (j,
|
GNUNET_JSON_parse (j,
|
||||||
spec,
|
ispec,
|
||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
@ -276,7 +276,6 @@ handle_ok (struct TALER_EXCHANGE_ManagementGetKeysHandle *gh,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
if (! ok)
|
if (! ok)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -289,7 +288,6 @@ handle_ok (struct TALER_EXCHANGE_ManagementGetKeysHandle *gh,
|
|||||||
TALER_denom_pub_free (&fk->denom_keys[i].key);
|
TALER_denom_pub_free (&fk->denom_keys[i].key);
|
||||||
GNUNET_free (fk->sign_keys);
|
GNUNET_free (fk->sign_keys);
|
||||||
GNUNET_free (fk->denom_keys);
|
GNUNET_free (fk->denom_keys);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return (ok) ? GNUNET_OK : GNUNET_SYSERR;
|
return (ok) ? GNUNET_OK : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ struct TALER_EXCHANGE_ManagementPostExtensionsHandle *
|
|||||||
TALER_EXCHANGE_management_post_extensions (
|
TALER_EXCHANGE_management_post_extensions (
|
||||||
struct GNUNET_CURL_Context *ctx,
|
struct GNUNET_CURL_Context *ctx,
|
||||||
const char *url,
|
const char *url,
|
||||||
struct TALER_EXCHANGE_ManagementPostExtensionsData *ped,
|
const struct TALER_EXCHANGE_ManagementPostExtensionsData *ped,
|
||||||
TALER_EXCHANGE_ManagementPostExtensionsCallback cb,
|
TALER_EXCHANGE_ManagementPostExtensionsCallback cb,
|
||||||
void *cb_cls)
|
void *cb_cls)
|
||||||
{
|
{
|
||||||
@ -151,7 +151,7 @@ TALER_EXCHANGE_management_post_extensions (
|
|||||||
|
|
||||||
body = GNUNET_JSON_PACK (
|
body = GNUNET_JSON_PACK (
|
||||||
GNUNET_JSON_pack_object_steal ("extensions",
|
GNUNET_JSON_pack_object_steal ("extensions",
|
||||||
ped->extensions),
|
(json_t *) ped->extensions),
|
||||||
GNUNET_JSON_pack_data_auto ("extensions_sig",
|
GNUNET_JSON_pack_data_auto ("extensions_sig",
|
||||||
&ped->extensions_sig));
|
&ped->extensions_sig));
|
||||||
|
|
||||||
|
@ -79,9 +79,9 @@ handle_set_global_fee_finished (void *cls,
|
|||||||
{
|
{
|
||||||
struct TALER_EXCHANGE_ManagementSetGlobalFeeHandle *sgfh = cls;
|
struct TALER_EXCHANGE_ManagementSetGlobalFeeHandle *sgfh = cls;
|
||||||
const json_t *json = response;
|
const json_t *json = response;
|
||||||
struct TALER_EXCHANGE_HttpResponse hr = {
|
struct TALER_EXCHANGE_ManagementSetGlobalFeeResponse sfr = {
|
||||||
.http_status = (unsigned int) response_code,
|
.hr.http_status = (unsigned int) response_code,
|
||||||
.reply = json
|
.hr.reply = json
|
||||||
};
|
};
|
||||||
|
|
||||||
sgfh->job = NULL;
|
sgfh->job = NULL;
|
||||||
@ -90,32 +90,32 @@ handle_set_global_fee_finished (void *cls,
|
|||||||
case MHD_HTTP_NO_CONTENT:
|
case MHD_HTTP_NO_CONTENT:
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_FORBIDDEN:
|
case MHD_HTTP_FORBIDDEN:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
sfr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
sfr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_CONFLICT:
|
case MHD_HTTP_CONFLICT:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
sfr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
sfr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_PRECONDITION_FAILED:
|
case MHD_HTTP_PRECONDITION_FAILED:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
sfr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
sfr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unexpected response code */
|
/* unexpected response code */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
sfr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
sfr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Unexpected response code %u/%d for exchange management set global fee\n",
|
"Unexpected response code %u/%d for exchange management set global fee\n",
|
||||||
(unsigned int) response_code,
|
(unsigned int) response_code,
|
||||||
(int) hr.ec);
|
(int) sfr.hr.ec);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (NULL != sgfh->cb)
|
if (NULL != sgfh->cb)
|
||||||
{
|
{
|
||||||
sgfh->cb (sgfh->cb_cls,
|
sgfh->cb (sgfh->cb_cls,
|
||||||
&hr);
|
&sfr);
|
||||||
sgfh->cb = NULL;
|
sgfh->cb = NULL;
|
||||||
}
|
}
|
||||||
TALER_EXCHANGE_management_set_global_fees_cancel (sgfh);
|
TALER_EXCHANGE_management_set_global_fees_cancel (sgfh);
|
||||||
|
@ -79,9 +79,9 @@ handle_set_wire_fee_finished (void *cls,
|
|||||||
{
|
{
|
||||||
struct TALER_EXCHANGE_ManagementSetWireFeeHandle *swfh = cls;
|
struct TALER_EXCHANGE_ManagementSetWireFeeHandle *swfh = cls;
|
||||||
const json_t *json = response;
|
const json_t *json = response;
|
||||||
struct TALER_EXCHANGE_HttpResponse hr = {
|
struct TALER_EXCHANGE_ManagementSetWireFeeResponse swr = {
|
||||||
.http_status = (unsigned int) response_code,
|
.hr.http_status = (unsigned int) response_code,
|
||||||
.reply = json
|
.hr.reply = json
|
||||||
};
|
};
|
||||||
|
|
||||||
swfh->job = NULL;
|
swfh->job = NULL;
|
||||||
@ -90,32 +90,32 @@ handle_set_wire_fee_finished (void *cls,
|
|||||||
case MHD_HTTP_NO_CONTENT:
|
case MHD_HTTP_NO_CONTENT:
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_FORBIDDEN:
|
case MHD_HTTP_FORBIDDEN:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
swr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
swr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_CONFLICT:
|
case MHD_HTTP_CONFLICT:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
swr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
swr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
case MHD_HTTP_PRECONDITION_FAILED:
|
case MHD_HTTP_PRECONDITION_FAILED:
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
swr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
swr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unexpected response code */
|
/* unexpected response code */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
hr.ec = TALER_JSON_get_error_code (json);
|
swr.hr.ec = TALER_JSON_get_error_code (json);
|
||||||
hr.hint = TALER_JSON_get_error_hint (json);
|
swr.hr.hint = TALER_JSON_get_error_hint (json);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Unexpected response code %u/%d for exchange management set wire fee\n",
|
"Unexpected response code %u/%d for exchange management set wire fee\n",
|
||||||
(unsigned int) response_code,
|
(unsigned int) response_code,
|
||||||
(int) hr.ec);
|
(int) swr.hr.ec);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (NULL != swfh->cb)
|
if (NULL != swfh->cb)
|
||||||
{
|
{
|
||||||
swfh->cb (swfh->cb_cls,
|
swfh->cb (swfh->cb_cls,
|
||||||
&hr);
|
&swr);
|
||||||
swfh->cb = NULL;
|
swfh->cb = NULL;
|
||||||
}
|
}
|
||||||
TALER_EXCHANGE_management_set_wire_fees_cancel (swfh);
|
TALER_EXCHANGE_management_set_wire_fees_cancel (swfh);
|
||||||
|
@ -107,10 +107,10 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshesRevealHandle *rrh,
|
|||||||
const json_t *json,
|
const json_t *json,
|
||||||
struct TALER_EXCHANGE_RevealedCoinInfo *rcis)
|
struct TALER_EXCHANGE_RevealedCoinInfo *rcis)
|
||||||
{
|
{
|
||||||
json_t *jsona;
|
const json_t *jsona;
|
||||||
struct GNUNET_JSON_Specification outer_spec[] = {
|
struct GNUNET_JSON_Specification outer_spec[] = {
|
||||||
GNUNET_JSON_spec_json ("ev_sigs",
|
GNUNET_JSON_spec_array_const ("ev_sigs",
|
||||||
&jsona),
|
&jsona),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -122,18 +122,10 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshesRevealHandle *rrh,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (! json_is_array (jsona))
|
|
||||||
{
|
|
||||||
/* We expected an array of coins */
|
|
||||||
GNUNET_break_op (0);
|
|
||||||
GNUNET_JSON_parse_free (outer_spec);
|
|
||||||
return GNUNET_SYSERR;
|
|
||||||
}
|
|
||||||
if (rrh->md.num_fresh_coins != json_array_size (jsona))
|
if (rrh->md.num_fresh_coins != json_array_size (jsona))
|
||||||
{
|
{
|
||||||
/* Number of coins generated does not match our expectation */
|
/* Number of coins generated does not match our expectation */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (outer_spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
for (unsigned int i = 0; i<rrh->md.num_fresh_coins; i++)
|
for (unsigned int i = 0; i<rrh->md.num_fresh_coins; i++)
|
||||||
@ -180,7 +172,6 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshesRevealHandle *rrh,
|
|||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (outer_spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,13 +200,11 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshesRevealHandle *rrh,
|
|||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
GNUNET_JSON_parse_free (spec);
|
||||||
GNUNET_JSON_parse_free (outer_spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
GNUNET_JSON_parse_free (spec);
|
||||||
rci->sig = coin.sig;
|
rci->sig = coin.sig;
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (outer_spec);
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,11 +172,11 @@ static enum GNUNET_GenericReturnValue
|
|||||||
verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
||||||
const json_t *json)
|
const json_t *json)
|
||||||
{
|
{
|
||||||
json_t *history;
|
const json_t *history;
|
||||||
struct TALER_DenominationHashP h_denom_pub;
|
struct TALER_DenominationHashP h_denom_pub;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("history",
|
GNUNET_JSON_spec_array_const ("history",
|
||||||
&history),
|
&history),
|
||||||
GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
|
GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
|
||||||
&h_denom_pub),
|
&h_denom_pub),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
@ -199,7 +199,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
if (0 == len)
|
if (0 == len)
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
have_deposit = false;
|
have_deposit = false;
|
||||||
@ -225,7 +224,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (0 == strcasecmp (type,
|
if (0 == strcasecmp (type,
|
||||||
@ -274,7 +272,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -292,7 +289,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&sig))
|
&sig))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if ( (0 != GNUNET_memcmp (&rh->h_contract_terms,
|
if ( (0 != GNUNET_memcmp (&rh->h_contract_terms,
|
||||||
@ -302,7 +298,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
{
|
{
|
||||||
/* deposit information is about a different merchant/contract */
|
/* deposit information is about a different merchant/contract */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (have_deposit)
|
if (have_deposit)
|
||||||
@ -313,7 +308,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&dtotal))
|
&dtotal))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_break (0 <=
|
GNUNET_break (0 <=
|
||||||
@ -356,7 +350,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (0 >
|
if (0 >
|
||||||
@ -365,7 +358,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&amount))
|
&amount))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -377,7 +369,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&sig))
|
&sig))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if ( (0 != GNUNET_memcmp (&rh->h_contract_terms,
|
if ( (0 != GNUNET_memcmp (&rh->h_contract_terms,
|
||||||
@ -387,7 +378,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
{
|
{
|
||||||
/* refund is about a different merchant/contract */
|
/* refund is about a different merchant/contract */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (rtransaction_id == rh->rtransaction_id)
|
if (rtransaction_id == rh->rtransaction_id)
|
||||||
@ -395,7 +385,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
/* Eh, this shows either a dependency failure or idempotency,
|
/* Eh, this shows either a dependency failure or idempotency,
|
||||||
but must not happen in a conflict reply. Fail! */
|
but must not happen in a conflict reply. Fail! */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,7 +395,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&rtotal))
|
&rtotal))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_break (0 <=
|
GNUNET_break (0 <=
|
||||||
@ -427,7 +415,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
"Unexpected type `%s' in response for exchange refund\n",
|
"Unexpected type `%s' in response for exchange refund\n",
|
||||||
type);
|
type);
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,7 +427,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&rh->refund_amount))
|
&rh->refund_amount))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -452,7 +438,6 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
if (! have_deposit)
|
if (! have_deposit)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (-1 != TALER_amount_cmp (&dtotal,
|
if (-1 != TALER_amount_cmp (&dtotal,
|
||||||
@ -460,11 +445,9 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
{
|
{
|
||||||
/* rtotal <= dtotal is fine, no conflict! */
|
/* rtotal <= dtotal is fine, no conflict! */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
/* dtotal < rtotal: that's a conflict! */
|
/* dtotal < rtotal: that's a conflict! */
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,11 +465,11 @@ static enum GNUNET_GenericReturnValue
|
|||||||
verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
||||||
const json_t *json)
|
const json_t *json)
|
||||||
{
|
{
|
||||||
json_t *h;
|
const json_t *h;
|
||||||
json_t *e;
|
json_t *e;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("history",
|
GNUNET_JSON_spec_array_const ("history",
|
||||||
&h),
|
&h),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -498,11 +481,9 @@ verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if ( (! json_is_array (h)) ||
|
if (1 != json_array_size (h))
|
||||||
(1 != json_array_size (h) ) )
|
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
e = json_array_get (h, 0);
|
e = json_array_get (h, 0);
|
||||||
@ -538,7 +519,6 @@ verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -550,7 +530,6 @@ verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&sig))
|
&sig))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if ( (rtransaction_id != rh->rtransaction_id) ||
|
if ( (rtransaction_id != rh->rtransaction_id) ||
|
||||||
@ -562,11 +541,9 @@ verify_failed_dependency_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
&amount)) )
|
&amount)) )
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ handle_reserves_attest_ok (struct TALER_EXCHANGE_ReservesAttestHandle *rsh,
|
|||||||
.hr.reply = j,
|
.hr.reply = j,
|
||||||
.hr.http_status = MHD_HTTP_OK
|
.hr.http_status = MHD_HTTP_OK
|
||||||
};
|
};
|
||||||
json_t *attributes;
|
const json_t *attributes;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_timestamp ("exchange_timestamp",
|
GNUNET_JSON_spec_timestamp ("exchange_timestamp",
|
||||||
&rs.details.ok.exchange_time),
|
&rs.details.ok.exchange_time),
|
||||||
@ -103,8 +103,8 @@ handle_reserves_attest_ok (struct TALER_EXCHANGE_ReservesAttestHandle *rsh,
|
|||||||
&rs.details.ok.exchange_sig),
|
&rs.details.ok.exchange_sig),
|
||||||
GNUNET_JSON_spec_fixed_auto ("exchange_pub",
|
GNUNET_JSON_spec_fixed_auto ("exchange_pub",
|
||||||
&rs.details.ok.exchange_pub),
|
&rs.details.ok.exchange_pub),
|
||||||
GNUNET_JSON_spec_json ("attributes",
|
GNUNET_JSON_spec_object_const ("attributes",
|
||||||
&attributes),
|
&attributes),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -88,10 +88,10 @@ handle_reserves_get_attestable_ok (
|
|||||||
.hr.reply = j,
|
.hr.reply = j,
|
||||||
.hr.http_status = MHD_HTTP_OK
|
.hr.http_status = MHD_HTTP_OK
|
||||||
};
|
};
|
||||||
json_t *details;
|
const json_t *details;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_json ("details",
|
GNUNET_JSON_spec_array_const ("details",
|
||||||
&details),
|
&details),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -116,7 +116,6 @@ handle_reserves_get_attestable_ok (
|
|||||||
if (NULL == attributes[i])
|
if (NULL == attributes[i])
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,7 +125,6 @@ handle_reserves_get_attestable_ok (
|
|||||||
&rs);
|
&rs);
|
||||||
rgah->cb = NULL;
|
rgah->cb = NULL;
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ static enum GNUNET_GenericReturnValue
|
|||||||
handle_reserves_history_ok (struct TALER_EXCHANGE_ReservesHistoryHandle *rsh,
|
handle_reserves_history_ok (struct TALER_EXCHANGE_ReservesHistoryHandle *rsh,
|
||||||
const json_t *j)
|
const json_t *j)
|
||||||
{
|
{
|
||||||
json_t *history;
|
const json_t *history;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
struct TALER_EXCHANGE_ReserveHistory rs = {
|
struct TALER_EXCHANGE_ReserveHistory rs = {
|
||||||
.hr.reply = j,
|
.hr.reply = j,
|
||||||
@ -110,8 +110,8 @@ handle_reserves_history_ok (struct TALER_EXCHANGE_ReservesHistoryHandle *rsh,
|
|||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
TALER_JSON_spec_amount_any ("balance",
|
TALER_JSON_spec_amount_any ("balance",
|
||||||
&rs.details.ok.balance),
|
&rs.details.ok.balance),
|
||||||
GNUNET_JSON_spec_json ("history",
|
GNUNET_JSON_spec_array_const ("history",
|
||||||
&history),
|
&history),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -143,7 +143,6 @@ handle_reserves_history_ok (struct TALER_EXCHANGE_ReservesHistoryHandle *rsh,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
TALER_EXCHANGE_free_reserve_history (rhistory,
|
TALER_EXCHANGE_free_reserve_history (rhistory,
|
||||||
len);
|
len);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (NULL != rsh->cb)
|
if (NULL != rsh->cb)
|
||||||
@ -157,7 +156,6 @@ handle_reserves_history_ok (struct TALER_EXCHANGE_ReservesHistoryHandle *rsh,
|
|||||||
TALER_EXCHANGE_free_reserve_history (rhistory,
|
TALER_EXCHANGE_free_reserve_history (rhistory,
|
||||||
len);
|
len);
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ static enum GNUNET_GenericReturnValue
|
|||||||
handle_reserves_status_ok (struct TALER_EXCHANGE_ReservesStatusHandle *rsh,
|
handle_reserves_status_ok (struct TALER_EXCHANGE_ReservesStatusHandle *rsh,
|
||||||
const json_t *j)
|
const json_t *j)
|
||||||
{
|
{
|
||||||
json_t *history;
|
const json_t *history;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
struct TALER_EXCHANGE_ReserveStatus rs = {
|
struct TALER_EXCHANGE_ReserveStatus rs = {
|
||||||
.hr.reply = j,
|
.hr.reply = j,
|
||||||
@ -98,8 +98,8 @@ handle_reserves_status_ok (struct TALER_EXCHANGE_ReservesStatusHandle *rsh,
|
|||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
TALER_JSON_spec_amount_any ("balance",
|
TALER_JSON_spec_amount_any ("balance",
|
||||||
&rs.details.ok.balance),
|
&rs.details.ok.balance),
|
||||||
GNUNET_JSON_spec_json ("history",
|
GNUNET_JSON_spec_array_const ("history",
|
||||||
&history),
|
&history),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -145,7 +145,6 @@ handle_reserves_status_ok (struct TALER_EXCHANGE_ReservesStatusHandle *rsh,
|
|||||||
TALER_EXCHANGE_free_reserve_history (rhistory,
|
TALER_EXCHANGE_free_reserve_history (rhistory,
|
||||||
len);
|
len);
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ check_transfers_get_response_ok (
|
|||||||
struct TALER_EXCHANGE_TransfersGetHandle *wdh,
|
struct TALER_EXCHANGE_TransfersGetHandle *wdh,
|
||||||
const json_t *json)
|
const json_t *json)
|
||||||
{
|
{
|
||||||
json_t *details_j;
|
const json_t *details_j;
|
||||||
struct TALER_Amount total_expected;
|
struct TALER_Amount total_expected;
|
||||||
struct TALER_MerchantPublicKeyP merchant_pub;
|
struct TALER_MerchantPublicKeyP merchant_pub;
|
||||||
struct TALER_EXCHANGE_TransfersGetResponse tgr = {
|
struct TALER_EXCHANGE_TransfersGetResponse tgr = {
|
||||||
@ -104,8 +104,8 @@ check_transfers_get_response_ok (
|
|||||||
&td->h_payto),
|
&td->h_payto),
|
||||||
GNUNET_JSON_spec_timestamp ("execution_time",
|
GNUNET_JSON_spec_timestamp ("execution_time",
|
||||||
&td->execution_time),
|
&td->execution_time),
|
||||||
GNUNET_JSON_spec_json ("deposits",
|
GNUNET_JSON_spec_array_const ("deposits",
|
||||||
&details_j),
|
&details_j),
|
||||||
GNUNET_JSON_spec_fixed_auto ("exchange_sig",
|
GNUNET_JSON_spec_fixed_auto ("exchange_sig",
|
||||||
&td->exchange_sig),
|
&td->exchange_sig),
|
||||||
GNUNET_JSON_spec_fixed_auto ("exchange_pub",
|
GNUNET_JSON_spec_fixed_auto ("exchange_pub",
|
||||||
@ -126,7 +126,6 @@ check_transfers_get_response_ok (
|
|||||||
&total_expected))
|
&total_expected))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -135,7 +134,6 @@ check_transfers_get_response_ok (
|
|||||||
&td->exchange_pub))
|
&td->exchange_pub))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
td->details_length = json_array_size (details_j);
|
td->details_length = json_array_size (details_j);
|
||||||
@ -181,7 +179,6 @@ check_transfers_get_response_ok (
|
|||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_CRYPTO_hash_context_abort (hash_context);
|
GNUNET_CRYPTO_hash_context_abort (hash_context);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_free (details);
|
GNUNET_free (details);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
@ -211,7 +208,6 @@ check_transfers_get_response_ok (
|
|||||||
&td->exchange_sig))
|
&td->exchange_sig))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_free (details);
|
GNUNET_free (details);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
@ -223,7 +219,6 @@ check_transfers_get_response_ok (
|
|||||||
&td->wire_fee))
|
&td->wire_fee))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_free (details);
|
GNUNET_free (details);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
@ -232,7 +227,6 @@ check_transfers_get_response_ok (
|
|||||||
&td->total_amount))
|
&td->total_amount))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
GNUNET_free (details);
|
GNUNET_free (details);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
@ -240,7 +234,6 @@ check_transfers_get_response_ok (
|
|||||||
&tgr);
|
&tgr);
|
||||||
GNUNET_free (details);
|
GNUNET_free (details);
|
||||||
}
|
}
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,13 +62,15 @@ struct AuditorAddState
|
|||||||
* if the response code is acceptable.
|
* if the response code is acceptable.
|
||||||
*
|
*
|
||||||
* @param cls closure.
|
* @param cls closure.
|
||||||
* @param hr HTTP response details
|
* @param aer response details
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
auditor_add_cb (void *cls,
|
auditor_add_cb (
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
void *cls,
|
||||||
|
const struct TALER_EXCHANGE_ManagementAuditorEnableResponse *aer)
|
||||||
{
|
{
|
||||||
struct AuditorAddState *ds = cls;
|
struct AuditorAddState *ds = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &aer->hr;
|
||||||
|
|
||||||
ds->dh = NULL;
|
ds->dh = NULL;
|
||||||
if (ds->expected_response_code != hr->http_status)
|
if (ds->expected_response_code != hr->http_status)
|
||||||
|
@ -67,13 +67,15 @@ struct AuditorAddDenomSigState
|
|||||||
* if the response code is acceptable.
|
* if the response code is acceptable.
|
||||||
*
|
*
|
||||||
* @param cls closure.
|
* @param cls closure.
|
||||||
* @param hr HTTP response details
|
* @param adr response details
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
denom_sig_add_cb (void *cls,
|
denom_sig_add_cb (
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
void *cls,
|
||||||
|
const struct TALER_EXCHANGE_AuditorAddDenominationResponse *adr)
|
||||||
{
|
{
|
||||||
struct AuditorAddDenomSigState *ds = cls;
|
struct AuditorAddDenomSigState *ds = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &adr->hr;
|
||||||
|
|
||||||
ds->dh = NULL;
|
ds->dh = NULL;
|
||||||
if (ds->expected_response_code != hr->http_status)
|
if (ds->expected_response_code != hr->http_status)
|
||||||
|
@ -62,13 +62,16 @@ struct AuditorDelState
|
|||||||
* if the response code is acceptable.
|
* if the response code is acceptable.
|
||||||
*
|
*
|
||||||
* @param cls closure.
|
* @param cls closure.
|
||||||
* @param hr HTTP response details
|
* @param adr response details
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
auditor_del_cb (void *cls,
|
auditor_del_cb (
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
void *cls,
|
||||||
|
const struct TALER_EXCHANGE_ManagementAuditorDisableResponse *adr)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct AuditorDelState *ds = cls;
|
struct AuditorDelState *ds = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &adr->hr;
|
||||||
|
|
||||||
ds->dh = NULL;
|
ds->dh = NULL;
|
||||||
if (ds->expected_response_code != hr->http_status)
|
if (ds->expected_response_code != hr->http_status)
|
||||||
|
@ -194,28 +194,15 @@ do_retry (void *cls)
|
|||||||
* acceptable.
|
* acceptable.
|
||||||
*
|
*
|
||||||
* @param cls closure with the interpreter state
|
* @param cls closure with the interpreter state
|
||||||
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for
|
* @param air response details
|
||||||
* successful status request; 0 if the exchange's reply is
|
|
||||||
* bogus (fails to follow the protocol)
|
|
||||||
* @param ec taler-specific error code, #TALER_EC_NONE on success
|
|
||||||
* @param serial_id unique ID of the wire transfer
|
|
||||||
* @param timestamp time stamp of the transaction made.
|
|
||||||
* @param json raw response
|
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
confirmation_cb (void *cls,
|
confirmation_cb (void *cls,
|
||||||
unsigned int http_status,
|
const struct TALER_BANK_AdminAddIncomingResponse *air)
|
||||||
enum TALER_ErrorCode ec,
|
|
||||||
uint64_t serial_id,
|
|
||||||
struct GNUNET_TIME_Timestamp timestamp,
|
|
||||||
const json_t *json)
|
|
||||||
{
|
{
|
||||||
struct AdminAddIncomingState *fts = cls;
|
struct AdminAddIncomingState *fts = cls;
|
||||||
struct TALER_TESTING_Interpreter *is = fts->is;
|
struct TALER_TESTING_Interpreter *is = fts->is;
|
||||||
|
|
||||||
(void) json;
|
|
||||||
fts->reserve_history.details.in_details.timestamp = timestamp;
|
|
||||||
fts->reserve_history.details.in_details.wire_reference = serial_id;
|
|
||||||
fts->aih = NULL;
|
fts->aih = NULL;
|
||||||
/**
|
/**
|
||||||
* Test case not caring about the HTTP status code.
|
* Test case not caring about the HTTP status code.
|
||||||
@ -237,17 +224,23 @@ confirmation_cb (void *cls,
|
|||||||
TALER_TESTING_interpreter_next (is);
|
TALER_TESTING_interpreter_next (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (http_status != fts->expected_http_status)
|
if (air->http_status != fts->expected_http_status)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (http_status)
|
switch (air->http_status)
|
||||||
{
|
{
|
||||||
case MHD_HTTP_OK:
|
case MHD_HTTP_OK:
|
||||||
fts->serial_id = serial_id;
|
fts->reserve_history.details.in_details.timestamp
|
||||||
fts->timestamp = timestamp;
|
= air->details.ok.timestamp;
|
||||||
|
fts->reserve_history.details.in_details.wire_reference
|
||||||
|
= air->details.ok.serial_id;
|
||||||
|
fts->serial_id
|
||||||
|
= air->details.ok.serial_id;
|
||||||
|
fts->timestamp
|
||||||
|
= air->details.ok.timestamp;
|
||||||
TALER_TESTING_interpreter_next (is);
|
TALER_TESTING_interpreter_next (is);
|
||||||
return;
|
return;
|
||||||
case MHD_HTTP_UNAUTHORIZED:
|
case MHD_HTTP_UNAUTHORIZED:
|
||||||
@ -271,17 +264,17 @@ confirmation_cb (void *cls,
|
|||||||
if (0 != fts->do_retry)
|
if (0 != fts->do_retry)
|
||||||
{
|
{
|
||||||
fts->do_retry--;
|
fts->do_retry--;
|
||||||
if ( (0 == http_status) ||
|
if ( (0 == air->http_status) ||
|
||||||
(TALER_EC_GENERIC_DB_SOFT_FAILURE == ec) ||
|
(TALER_EC_GENERIC_DB_SOFT_FAILURE == air->ec) ||
|
||||||
(MHD_HTTP_INTERNAL_SERVER_ERROR == http_status) )
|
(MHD_HTTP_INTERNAL_SERVER_ERROR == air->http_status) )
|
||||||
{
|
{
|
||||||
GNUNET_log (
|
GNUNET_log (
|
||||||
GNUNET_ERROR_TYPE_INFO,
|
GNUNET_ERROR_TYPE_INFO,
|
||||||
"Retrying fakebank transfer failed with %u/%d\n",
|
"Retrying fakebank transfer failed with %u/%d\n",
|
||||||
http_status,
|
air->http_status,
|
||||||
(int) ec);
|
(int) air->ec);
|
||||||
/* on DB conflicts, do not use backoff */
|
/* on DB conflicts, do not use backoff */
|
||||||
if (TALER_EC_GENERIC_DB_SOFT_FAILURE == ec)
|
if (TALER_EC_GENERIC_DB_SOFT_FAILURE == air->ec)
|
||||||
fts->backoff = GNUNET_TIME_UNIT_ZERO;
|
fts->backoff = GNUNET_TIME_UNIT_ZERO;
|
||||||
else
|
else
|
||||||
fts->backoff = GNUNET_TIME_randomized_backoff (fts->backoff,
|
fts->backoff = GNUNET_TIME_randomized_backoff (fts->backoff,
|
||||||
@ -299,8 +292,8 @@ confirmation_cb (void *cls,
|
|||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Fakebank returned HTTP status %u/%d\n",
|
"Fakebank returned HTTP status %u/%d\n",
|
||||||
http_status,
|
air->http_status,
|
||||||
(int) ec);
|
(int) air->ec);
|
||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,39 +163,31 @@ do_retry (void *cls)
|
|||||||
* acceptable.
|
* acceptable.
|
||||||
*
|
*
|
||||||
* @param cls closure with the interpreter state
|
* @param cls closure with the interpreter state
|
||||||
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for
|
* @param tr response details
|
||||||
* successful status request; 0 if the exchange's reply is
|
|
||||||
* bogus (fails to follow the protocol)
|
|
||||||
* @param ec taler-specific error code, #TALER_EC_NONE on success
|
|
||||||
* @param serial_id unique ID of the wire transfer
|
|
||||||
* @param timestamp time stamp of the transaction made.
|
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
confirmation_cb (void *cls,
|
confirmation_cb (void *cls,
|
||||||
unsigned int http_status,
|
const struct TALER_BANK_TransferResponse *tr)
|
||||||
enum TALER_ErrorCode ec,
|
|
||||||
uint64_t serial_id,
|
|
||||||
struct GNUNET_TIME_Timestamp timestamp)
|
|
||||||
{
|
{
|
||||||
struct TransferState *fts = cls;
|
struct TransferState *fts = cls;
|
||||||
struct TALER_TESTING_Interpreter *is = fts->is;
|
struct TALER_TESTING_Interpreter *is = fts->is;
|
||||||
|
|
||||||
fts->weh = NULL;
|
fts->weh = NULL;
|
||||||
if (MHD_HTTP_OK != http_status)
|
if (MHD_HTTP_OK != tr->http_status)
|
||||||
{
|
{
|
||||||
if (0 != fts->do_retry)
|
if (0 != fts->do_retry)
|
||||||
{
|
{
|
||||||
fts->do_retry--;
|
fts->do_retry--;
|
||||||
if ( (0 == http_status) ||
|
if ( (0 == tr->http_status) ||
|
||||||
(TALER_EC_GENERIC_DB_SOFT_FAILURE == ec) ||
|
(TALER_EC_GENERIC_DB_SOFT_FAILURE == tr->ec) ||
|
||||||
(MHD_HTTP_INTERNAL_SERVER_ERROR == http_status) )
|
(MHD_HTTP_INTERNAL_SERVER_ERROR == tr->http_status) )
|
||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Retrying transfer failed with %u/%d\n",
|
"Retrying transfer failed with %u/%d\n",
|
||||||
http_status,
|
tr->http_status,
|
||||||
(int) ec);
|
(int) tr->ec);
|
||||||
/* on DB conflicts, do not use backoff */
|
/* on DB conflicts, do not use backoff */
|
||||||
if (TALER_EC_GENERIC_DB_SOFT_FAILURE == ec)
|
if (TALER_EC_GENERIC_DB_SOFT_FAILURE == tr->ec)
|
||||||
fts->backoff = GNUNET_TIME_UNIT_ZERO;
|
fts->backoff = GNUNET_TIME_UNIT_ZERO;
|
||||||
else
|
else
|
||||||
fts->backoff = EXCHANGE_LIB_BACKOFF (fts->backoff);
|
fts->backoff = EXCHANGE_LIB_BACKOFF (fts->backoff);
|
||||||
@ -210,14 +202,14 @@ confirmation_cb (void *cls,
|
|||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Bank returned HTTP status %u/%d\n",
|
"Bank returned HTTP status %u/%d\n",
|
||||||
http_status,
|
tr->http_status,
|
||||||
(int) ec);
|
(int) tr->ec);
|
||||||
TALER_TESTING_interpreter_fail (is);
|
TALER_TESTING_interpreter_fail (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fts->serial_id = serial_id;
|
fts->serial_id = tr->details.ok.row_id;
|
||||||
fts->timestamp = timestamp;
|
fts->timestamp = tr->details.ok.timestamp;
|
||||||
TALER_TESTING_interpreter_next (is);
|
TALER_TESTING_interpreter_next (is);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,13 +77,14 @@ struct WireFeeState
|
|||||||
* if the response code is acceptable.
|
* if the response code is acceptable.
|
||||||
*
|
*
|
||||||
* @param cls closure.
|
* @param cls closure.
|
||||||
* @param hr HTTP response details
|
* @param sfr response details
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
wire_add_cb (void *cls,
|
wire_add_cb (void *cls,
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
const struct TALER_EXCHANGE_ManagementSetWireFeeResponse *sfr)
|
||||||
{
|
{
|
||||||
struct WireFeeState *ds = cls;
|
struct WireFeeState *ds = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &sfr->hr;
|
||||||
|
|
||||||
ds->dh = NULL;
|
ds->dh = NULL;
|
||||||
if (ds->expected_response_code != hr->http_status)
|
if (ds->expected_response_code != hr->http_status)
|
||||||
|
@ -90,17 +90,19 @@ struct AmlDecisionState
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback to analyze the /management/XXX response, just used to check
|
* Callback to analyze the /aml-decision/$OFFICER_PUB response, just used to check
|
||||||
* if the response code is acceptable.
|
* if the response code is acceptable.
|
||||||
*
|
*
|
||||||
* @param cls closure.
|
* @param cls closure.
|
||||||
* @param hr HTTP response details
|
* @param adr response details
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
take_aml_decision_cb (void *cls,
|
take_aml_decision_cb (
|
||||||
const struct TALER_EXCHANGE_HttpResponse *hr)
|
void *cls,
|
||||||
|
const struct TALER_EXCHANGE_AddAmlDecisionResponse *adr)
|
||||||
{
|
{
|
||||||
struct AmlDecisionState *ds = cls;
|
struct AmlDecisionState *ds = cls;
|
||||||
|
const struct TALER_EXCHANGE_HttpResponse *hr = &adr->hr;
|
||||||
|
|
||||||
ds->dh = NULL;
|
ds->dh = NULL;
|
||||||
if (ds->expected_response != hr->http_status)
|
if (ds->expected_response != hr->http_status)
|
||||||
|
@ -17,13 +17,13 @@ TALER_HOME = ${TALER_TEST_HOME:-${HOME:-${USERPROFILE}}}
|
|||||||
# for how these should be used.
|
# for how these should be used.
|
||||||
|
|
||||||
# Persistent data storage
|
# Persistent data storage
|
||||||
TALER_DATA_HOME = ${XDG_DATA_HOME:-$TALER_HOME/.local/share}/taler/
|
TALER_DATA_HOME = ${TALER_TEST_HOME:-${XDG_DATA_HOME:-${TALER_HOME}/.local/share/}/.local/share/}taler/
|
||||||
|
|
||||||
# Configuration files
|
# Configuration files
|
||||||
TALER_CONFIG_HOME = ${XDG_CONFIG_HOME:-$TALER_HOME/.config}/taler/
|
TALER_CONFIG_HOME = ${TALER_TEST_HOME:-${XDG_CONFIG_HOME:-${TALER_HOME}/.config/}/.config/}taler/
|
||||||
|
|
||||||
# Cached data, no big deal if lost
|
# Cached data, no big deal if lost
|
||||||
TALER_CACHE_HOME = ${XDG_CACHE_HOME:-$TALER_HOME/.cache}/taler/
|
TALER_CACHE_HOME = ${TALER_TEST_HOME:-${XDG_CACHE_HOME:-${TALER_HOME}/.cache/}/.cache/}taler/
|
||||||
|
|
||||||
# Runtime data (always lost on system boot)
|
# Runtime data (always lost on system boot)
|
||||||
TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/taler-system-runtime/
|
TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/taler-system-runtime/
|
||||||
|
Loading…
Reference in New Issue
Block a user