mint->exchange leftovers

This commit is contained in:
Christian Grothoff 2016-09-30 23:19:18 +02:00
parent f00a49e40c
commit f1a71f180c
30 changed files with 745 additions and 745 deletions

View File

@ -52,17 +52,17 @@
/**
* Which currency is used by this exchange?
*/
char *TMH_exchange_currency_string;
char *TEH_exchange_currency_string;
/**
* Should we return "Connection: close" in each response?
*/
int TMH_exchange_connection_close;
int TEH_exchange_connection_close;
/**
* Base directory of the exchange (global)
*/
char *TMH_exchange_directory;
char *TEH_exchange_directory;
/**
* The exchange's configuration (global)
@ -73,12 +73,12 @@ struct GNUNET_CONFIGURATION_Handle *cfg;
* Master public key (according to the
* configuration in the exchange directory).
*/
struct TALER_MasterPublicKeyP TMH_master_public_key;
struct TALER_MasterPublicKeyP TEH_master_public_key;
/**
* Our DB plugin.
*/
struct TALER_EXCHANGEDB_Plugin *TMH_plugin;
struct TALER_EXCHANGEDB_Plugin *TEH_plugin;
/**
* Default timeout in seconds for HTTP requests.
@ -155,7 +155,7 @@ handle_mhd_completion_callback (void *cls,
{
if (NULL == *con_cls)
return;
TMH_PARSE_post_cleanup_callback (*con_cls);
TEH_PARSE_post_cleanup_callback (*con_cls);
*con_cls = NULL;
}
@ -183,122 +183,122 @@ handle_mhd_request (void *cls,
size_t *upload_data_size,
void **con_cls)
{
static struct TMH_RequestHandler handlers[] =
static struct TEH_RequestHandler handlers[] =
{
/* Landing page, tell humans to go away. */
{ "/", MHD_HTTP_METHOD_GET, "text/plain",
"Hello, I'm the Taler exchange. This HTTP server is not for humans.\n", 0,
&TMH_MHD_handler_static_response, MHD_HTTP_OK },
&TEH_MHD_handler_static_response, MHD_HTTP_OK },
/* /robots.txt: disallow everything */
{ "/robots.txt", MHD_HTTP_METHOD_GET, "text/plain",
"User-agent: *\nDisallow: /\n", 0,
&TMH_MHD_handler_static_response, MHD_HTTP_OK },
&TEH_MHD_handler_static_response, MHD_HTTP_OK },
/* AGPL licensing page, redirect to source. As per the AGPL-license,
every deployment is required to offer the user a download of the
source. We make this easy by including a redirect to the source
here. */
{ "/agpl", MHD_HTTP_METHOD_GET, "text/plain",
NULL, 0,
&TMH_MHD_handler_agpl_redirect, MHD_HTTP_FOUND },
&TEH_MHD_handler_agpl_redirect, MHD_HTTP_FOUND },
/* Return key material and fundamental properties for this exchange */
{ "/keys", MHD_HTTP_METHOD_GET, "application/json",
NULL, 0,
&TMH_KS_handler_keys, MHD_HTTP_OK },
&TEH_KS_handler_keys, MHD_HTTP_OK },
{ "/keys", NULL, "text/plain",
"Only GET is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
/* Requests for wiring information */
{ "/wire", MHD_HTTP_METHOD_GET, "application/json",
NULL, 0,
&TMH_WIRE_handler_wire, MHD_HTTP_OK },
&TEH_WIRE_handler_wire, MHD_HTTP_OK },
{ "/wire", NULL, "text/plain",
"Only GET is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
/* Withdrawing coins / interaction with reserves */
{ "/reserve/status", MHD_HTTP_METHOD_GET, "application/json",
NULL, 0,
&TMH_RESERVE_handler_reserve_status, MHD_HTTP_OK },
&TEH_RESERVE_handler_reserve_status, MHD_HTTP_OK },
{ "/reserve/status", NULL, "text/plain",
"Only GET is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/reserve/withdraw", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_RESERVE_handler_reserve_withdraw, MHD_HTTP_OK },
&TEH_RESERVE_handler_reserve_withdraw, MHD_HTTP_OK },
{ "/reserve/withdraw", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
/* Depositing coins */
{ "/deposit", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_DEPOSIT_handler_deposit, MHD_HTTP_OK },
&TEH_DEPOSIT_handler_deposit, MHD_HTTP_OK },
{ "/deposit", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
/* Refunding coins */
{ "/refund", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_REFUND_handler_refund, MHD_HTTP_OK },
&TEH_REFUND_handler_refund, MHD_HTTP_OK },
{ "/refund", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
/* Dealing with change */
{ "/refresh/melt", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_REFRESH_handler_refresh_melt, MHD_HTTP_OK },
&TEH_REFRESH_handler_refresh_melt, MHD_HTTP_OK },
{ "/refresh/melt", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/refresh/reveal", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_REFRESH_handler_refresh_reveal, MHD_HTTP_OK },
&TEH_REFRESH_handler_refresh_reveal, MHD_HTTP_OK },
{ "/refresh/reveal", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/refresh/reveal", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_REFRESH_handler_refresh_reveal, MHD_HTTP_OK },
&TEH_REFRESH_handler_refresh_reveal, MHD_HTTP_OK },
{ "/refresh/reveal", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/refresh/link", MHD_HTTP_METHOD_GET, "application/json",
NULL, 0,
&TMH_REFRESH_handler_refresh_link, MHD_HTTP_OK },
&TEH_REFRESH_handler_refresh_link, MHD_HTTP_OK },
{ "/refresh/link", NULL, "text/plain",
"Only GET is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/track/transfer", MHD_HTTP_METHOD_GET, "application/json",
NULL, 0,
&TMH_TRACKING_handler_track_transfer, MHD_HTTP_OK },
&TEH_TRACKING_handler_track_transfer, MHD_HTTP_OK },
{ "/track/transfer", NULL, "text/plain",
"Only GET is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/track/transaction", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_TRACKING_handler_track_transaction, MHD_HTTP_OK },
&TEH_TRACKING_handler_track_transaction, MHD_HTTP_OK },
{ "/track/transaction", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ NULL, NULL, NULL, NULL, 0, 0 }
};
static struct TMH_RequestHandler h404 =
static struct TEH_RequestHandler h404 =
{
"", NULL, "text/html",
"<html><title>404: not found</title></html>", 0,
&TMH_MHD_handler_static_response, MHD_HTTP_NOT_FOUND
&TEH_MHD_handler_static_response, MHD_HTTP_NOT_FOUND
};
struct TMH_RequestHandler *rh;
struct TEH_RequestHandler *rh;
unsigned int i;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@ -318,7 +318,7 @@ handle_mhd_request (void *cls,
upload_data,
upload_data_size);
}
return TMH_MHD_handler_static_response (&h404,
return TEH_MHD_handler_static_response (&h404,
connection,
con_cls,
upload_data,
@ -349,90 +349,90 @@ handle_mhd_admin_request (void *cls,
size_t *upload_data_size,
void **con_cls)
{
static struct TMH_RequestHandler handlers[] =
static struct TEH_RequestHandler handlers[] =
{
{ "/admin/add/incoming", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_ADMIN_handler_admin_add_incoming, MHD_HTTP_OK },
&TEH_ADMIN_handler_admin_add_incoming, MHD_HTTP_OK },
{ "/admin/add/incoming", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
#if HAVE_DEVELOPER
/* Client crypto-interoperability test functions */
{ "/test", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_TEST_handler_test, MHD_HTTP_OK },
&TEH_TEST_handler_test, MHD_HTTP_OK },
{ "/test", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/base32", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_TEST_handler_test_base32, MHD_HTTP_OK },
&TEH_TEST_handler_test_base32, MHD_HTTP_OK },
{ "/test/base32", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/encrypt", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_TEST_handler_test_encrypt, MHD_HTTP_OK },
&TEH_TEST_handler_test_encrypt, MHD_HTTP_OK },
{ "/test/encrypt", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/hkdf", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_TEST_handler_test_hkdf, MHD_HTTP_OK },
&TEH_TEST_handler_test_hkdf, MHD_HTTP_OK },
{ "/test/hkdf", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/ecdhe", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_TEST_handler_test_ecdhe, MHD_HTTP_OK },
&TEH_TEST_handler_test_ecdhe, MHD_HTTP_OK },
{ "/test/ecdhe", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/eddsa", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_TEST_handler_test_eddsa, MHD_HTTP_OK },
&TEH_TEST_handler_test_eddsa, MHD_HTTP_OK },
{ "/test/eddsa", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/rsa/get", MHD_HTTP_METHOD_GET, "application/json",
NULL, 0,
&TMH_TEST_handler_test_rsa_get, MHD_HTTP_OK },
&TEH_TEST_handler_test_rsa_get, MHD_HTTP_OK },
{ "/test/rsa/get", NULL, "text/plain",
"Only GET is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/rsa/sign", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_TEST_handler_test_rsa_sign, MHD_HTTP_OK },
&TEH_TEST_handler_test_rsa_sign, MHD_HTTP_OK },
{ "/test/rsa/sign", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/transfer", MHD_HTTP_METHOD_POST, "application/json",
NULL, 0,
&TMH_TEST_handler_test_transfer, MHD_HTTP_OK },
&TEH_TEST_handler_test_transfer, MHD_HTTP_OK },
{ "/test/transfer", NULL, "text/plain",
"Only POST is allowed", 0,
&TMH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
#endif
{ NULL, NULL, NULL, NULL, 0, 0 }
};
static struct TMH_RequestHandler h404 =
static struct TEH_RequestHandler h404 =
{
"", NULL, "text/html",
"<html><title>404: not found</title></html>", 0,
&TMH_MHD_handler_static_response, MHD_HTTP_NOT_FOUND
&TEH_MHD_handler_static_response, MHD_HTTP_NOT_FOUND
};
struct TMH_RequestHandler *rh;
struct TEH_RequestHandler *rh;
unsigned int i;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@ -452,7 +452,7 @@ handle_mhd_admin_request (void *cls,
upload_data,
upload_data_size);
}
return TMH_MHD_handler_static_response (&h404,
return TEH_MHD_handler_static_response (&h404,
connection,
con_cls,
upload_data,
@ -587,13 +587,13 @@ parse_port_config (const char *section,
static int
exchange_serve_process_config ()
{
char *TMH_master_public_key_str;
char *TEH_master_public_key_str;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg,
"exchange",
"KEYDIR",
&TMH_exchange_directory))
&TEH_exchange_directory))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"exchange",
@ -604,56 +604,56 @@ exchange_serve_process_config ()
GNUNET_CONFIGURATION_get_value_string (cfg,
"taler",
"currency",
&TMH_exchange_currency_string))
&TEH_exchange_currency_string))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"taler",
"currency");
return GNUNET_SYSERR;
}
if (strlen (TMH_exchange_currency_string) >= TALER_CURRENCY_LEN)
if (strlen (TEH_exchange_currency_string) >= TALER_CURRENCY_LEN)
{
fprintf (stderr,
"Currency `%s' longer than the allowed limit of %u characters.",
TMH_exchange_currency_string,
TEH_exchange_currency_string,
(unsigned int) TALER_CURRENCY_LEN);
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
TMH_VALIDATION_init (cfg))
TEH_VALIDATION_init (cfg))
return GNUNET_SYSERR;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
"exchange",
"master_public_key",
&TMH_master_public_key_str))
&TEH_master_public_key_str))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"exchange",
"master_public_key");
TMH_VALIDATION_done ();
TEH_VALIDATION_done ();
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_public_key_from_string (TMH_master_public_key_str,
strlen (TMH_master_public_key_str),
&TMH_master_public_key.eddsa_pub))
GNUNET_CRYPTO_eddsa_public_key_from_string (TEH_master_public_key_str,
strlen (TEH_master_public_key_str),
&TEH_master_public_key.eddsa_pub))
{
fprintf (stderr,
"Invalid master public key given in exchange configuration.");
GNUNET_free (TMH_master_public_key_str);
TMH_VALIDATION_done ();
GNUNET_free (TEH_master_public_key_str);
TEH_VALIDATION_done ();
return GNUNET_SYSERR;
}
GNUNET_free (TMH_master_public_key_str);
GNUNET_free (TEH_master_public_key_str);
if (NULL ==
(TMH_plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
(TEH_plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
{
fprintf (stderr,
"Failed to initialize DB subsystem\n");
TMH_VALIDATION_done ();
TEH_VALIDATION_done ();
return GNUNET_SYSERR;
}
if (GNUNET_YES ==
@ -663,7 +663,7 @@ exchange_serve_process_config ()
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Running in TEST mode! Database contents will not persist!\n");
TMH_plugin->create_tables (TMH_plugin->cls);
TEH_plugin->create_tables (TEH_plugin->cls);
}
if (GNUNET_OK !=
@ -672,7 +672,7 @@ exchange_serve_process_config ()
&serve_unixpath,
&unixpath_mode))
{
TMH_VALIDATION_done ();
TEH_VALIDATION_done ();
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
@ -681,7 +681,7 @@ exchange_serve_process_config ()
&serve_admin_unixpath,
&unixpath_admin_mode))
{
TMH_VALIDATION_done ();
TEH_VALIDATION_done ();
return GNUNET_SYSERR;
}
return GNUNET_OK;
@ -700,7 +700,7 @@ static char *input_filename;
/**
* Run 'nc' or 'ncat' as a fake HTTP client using #input_filename
* as the input for the request. If launching the client worked,
* run the #TMH_KS_loop() event loop as usual.
* run the #TEH_KS_loop() event loop as usual.
*
* @return #GNUNET_OK
*/
@ -754,7 +754,7 @@ run_fake_client ()
}
/* parent process */
GNUNET_break (0 == close (fd));
ret = TMH_KS_loop ();
ret = TEH_KS_loop ();
if (cld != waitpid (cld, &status, 0))
fprintf (stderr,
"Waiting for `nc' child failed: %s\n",
@ -933,7 +933,7 @@ main (int argc,
const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'C', "connection-close", NULL,
"force HTTP connections to be closed after each request", 0,
&GNUNET_GETOPT_set_one, &TMH_exchange_connection_close},
&GNUNET_GETOPT_set_one, &TEH_exchange_connection_close},
GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile),
{'D', "disable-admin", NULL,
"do not run the /admin-HTTP server", 0,
@ -1101,11 +1101,11 @@ main (int argc,
else
{
/* normal behavior */
ret = TMH_KS_loop ();
ret = TEH_KS_loop ();
}
#else
/* normal behavior */
ret = TMH_KS_loop ();
ret = TEH_KS_loop ();
#endif
switch (ret)
@ -1195,8 +1195,8 @@ main (int argc,
MHD_stop_daemon (mhd_admin);
break;
}
TALER_EXCHANGEDB_plugin_unload (TMH_plugin);
TMH_VALIDATION_done ();
TALER_EXCHANGEDB_plugin_unload (TEH_plugin);
TEH_VALIDATION_done ();
return (GNUNET_SYSERR == ret) ? 1 : 0;
}

View File

@ -31,12 +31,12 @@
/**
* Which currency is used by this exchange?
*/
extern char *TMH_exchange_currency_string;
extern char *TEH_exchange_currency_string;
/**
* Should we return "Connection: close" in each response?
*/
extern int TMH_exchange_connection_close;
extern int TEH_exchange_connection_close;
/**
* The exchange's configuration.
@ -46,29 +46,29 @@ extern struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Main directory with exchange data.
*/
extern char *TMH_exchange_directory;
extern char *TEH_exchange_directory;
/**
* Master public key (according to the
* configuration in the exchange directory).
*/
extern struct TALER_MasterPublicKeyP TMH_master_public_key;
extern struct TALER_MasterPublicKeyP TEH_master_public_key;
/**
* Private key of the exchange we use to sign messages.
*/
extern struct GNUNET_CRYPTO_EddsaPrivateKey TMH_exchange_private_signing_key;
extern struct GNUNET_CRYPTO_EddsaPrivateKey TEH_exchange_private_signing_key;
/**
* Our DB plugin.
*/
extern struct TALER_EXCHANGEDB_Plugin *TMH_plugin;
extern struct TALER_EXCHANGEDB_Plugin *TEH_plugin;
/**
* @brief Struct describing an URL and the handler for it.
*/
struct TMH_RequestHandler
struct TEH_RequestHandler
{
/**
@ -107,7 +107,7 @@ struct TMH_RequestHandler
* @param[in,out] upload_data_size number of bytes (left) in @a upload_data
* @return MHD result code
*/
int (*handler)(struct TMH_RequestHandler *rh,
int (*handler)(struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

View File

@ -41,7 +41,7 @@
* @return MHD result code
*/
int
TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
TEH_ADMIN_handler_admin_add_incoming (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -63,7 +63,7 @@ TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
};
int res;
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -72,7 +72,7 @@ TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == root) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
root,
spec);
json_decref (root);
@ -83,26 +83,26 @@ TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
}
if (GNUNET_YES !=
TMH_json_validate_wireformat (sender_account_details,
TEH_json_validate_wireformat (sender_account_details,
GNUNET_NO))
{
GNUNET_break_op (0);
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_unknown (connection,
return TEH_RESPONSE_reply_arg_unknown (connection,
"sender_account_details");
}
if (0 != strcasecmp (amount.currency,
TMH_exchange_currency_string))
TEH_exchange_currency_string))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Exchange uses currency `%s', but /admin/add/incoming tried to use currency `%s'\n",
TMH_exchange_currency_string,
TEH_exchange_currency_string,
amount.currency);
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"amount:currency");
}
res = TMH_DB_execute_admin_add_incoming (connection,
res = TEH_DB_execute_admin_add_incoming (connection,
&reserve_pub,
&amount,
at,

View File

@ -37,7 +37,7 @@
* @return MHD result code
*/
int
TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
TEH_ADMIN_handler_admin_add_incoming (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,7 @@
* @return MHD result code
*/
int
TMH_DB_execute_deposit (struct MHD_Connection *connection,
TEH_DB_execute_deposit (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_Deposit *deposit);
@ -50,7 +50,7 @@ TMH_DB_execute_deposit (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_DB_execute_refund (struct MHD_Connection *connection,
TEH_DB_execute_refund (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_Refund *refund);
@ -63,7 +63,7 @@ TMH_DB_execute_refund (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_DB_execute_reserve_status (struct MHD_Connection *connection,
TEH_DB_execute_reserve_status (struct MHD_Connection *connection,
const struct TALER_ReservePublicKeyP *reserve_pub);
@ -82,7 +82,7 @@ TMH_DB_execute_reserve_status (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_DB_execute_reserve_withdraw (struct MHD_Connection *connection,
TEH_DB_execute_reserve_withdraw (struct MHD_Connection *connection,
const struct TALER_ReservePublicKeyP *reserve,
const struct TALER_DenominationPublicKey *denomination_pub,
const char *blinded_msg,
@ -93,7 +93,7 @@ TMH_DB_execute_reserve_withdraw (struct MHD_Connection *connection,
/**
* @brief Details about a melt operation of an individual coin.
*/
struct TMH_DB_MeltDetails
struct TEH_DB_MeltDetails
{
/**
@ -142,11 +142,11 @@ struct TMH_DB_MeltDetails
* @return MHD result code
*/
int
TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
TEH_DB_execute_refresh_melt (struct MHD_Connection *connection,
const struct GNUNET_HashCode *session_hash,
unsigned int num_new_denoms,
const struct TALER_DenominationPublicKey *denom_pubs,
const struct TMH_DB_MeltDetails *coin_melt_details,
const struct TEH_DB_MeltDetails *coin_melt_details,
struct TALER_EXCHANGEDB_RefreshCommitCoin *const* commit_coin,
const struct TALER_TransferPublicKeyP *transfer_pubs);
@ -164,7 +164,7 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
TEH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
const struct GNUNET_HashCode *session_hash,
struct TALER_TransferPrivateKeyP *transfer_privs);
@ -179,7 +179,7 @@ TMH_DB_execute_refresh_reveal (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_DB_execute_refresh_link (struct MHD_Connection *connection,
TEH_DB_execute_refresh_link (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub);
@ -196,7 +196,7 @@ TMH_DB_execute_refresh_link (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_DB_execute_admin_add_incoming (struct MHD_Connection *connection,
TEH_DB_execute_admin_add_incoming (struct MHD_Connection *connection,
const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *amount,
struct GNUNET_TIME_Absolute execution_time,
@ -213,7 +213,7 @@ TMH_DB_execute_admin_add_incoming (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_DB_execute_track_transfer (struct MHD_Connection *connection,
TEH_DB_execute_track_transfer (struct MHD_Connection *connection,
const struct TALER_WireTransferIdentifierRawP *wtid);
@ -230,7 +230,7 @@ TMH_DB_execute_track_transfer (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_DB_execute_track_transaction (struct MHD_Connection *connection,
TEH_DB_execute_track_transaction (struct MHD_Connection *connection,
const struct GNUNET_HashCode *h_contract,
const struct GNUNET_HashCode *h_wire,
const struct TALER_CoinSpendPublicKeyP *coin_pub,

View File

@ -50,7 +50,7 @@ static int
verify_and_execute_deposit (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_Deposit *deposit)
{
struct TMH_KS_StateHandle *key_state;
struct TEH_KS_StateHandle *key_state;
struct TALER_DepositRequestPS dr;
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TALER_Amount fee_deposit;
@ -75,19 +75,19 @@ verify_and_execute_deposit (struct MHD_Connection *connection,
&deposit->coin.coin_pub.eddsa_pub))
{
TALER_LOG_WARNING ("Invalid signature on /deposit request\n");
return TMH_RESPONSE_reply_signature_invalid (connection,
return TEH_RESPONSE_reply_signature_invalid (connection,
"coin_sig");
}
/* check denomination exists and is valid */
key_state = TMH_KS_acquire ();
dki = TMH_KS_denomination_key_lookup (key_state,
key_state = TEH_KS_acquire ();
dki = TEH_KS_denomination_key_lookup (key_state,
&deposit->coin.denom_pub,
TMH_KS_DKU_DEPOSIT);
TEH_KS_DKU_DEPOSIT);
if (NULL == dki)
{
TMH_KS_release (key_state);
TEH_KS_release (key_state);
TALER_LOG_WARNING ("Unknown denomination key in /deposit request\n");
return TMH_RESPONSE_reply_arg_unknown (connection,
return TEH_RESPONSE_reply_arg_unknown (connection,
"denom_pub");
}
/* check coin signature */
@ -95,8 +95,8 @@ verify_and_execute_deposit (struct MHD_Connection *connection,
TALER_test_coin_valid (&deposit->coin))
{
TALER_LOG_WARNING ("Invalid coin passed for /deposit\n");
TMH_KS_release (key_state);
return TMH_RESPONSE_reply_signature_invalid (connection,
TEH_KS_release (key_state);
return TEH_RESPONSE_reply_signature_invalid (connection,
"ub_sig");
}
TALER_amount_ntoh (&fee_deposit,
@ -104,13 +104,13 @@ verify_and_execute_deposit (struct MHD_Connection *connection,
if (0 < TALER_amount_cmp (&fee_deposit,
&deposit->amount_with_fee))
{
TMH_KS_release (key_state);
return TMH_RESPONSE_reply_external_error (connection,
TEH_KS_release (key_state);
return TEH_RESPONSE_reply_external_error (connection,
"deposited amount smaller than depositing fee");
}
TMH_KS_release (key_state);
TEH_KS_release (key_state);
return TMH_DB_execute_deposit (connection,
return TEH_DB_execute_deposit (connection,
deposit);
}
@ -130,7 +130,7 @@ verify_and_execute_deposit (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
TEH_DEPOSIT_handler_deposit (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -141,7 +141,7 @@ TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
json_t *wire;
struct TALER_EXCHANGEDB_Deposit deposit;
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TMH_KS_StateHandle *ks;
struct TEH_KS_StateHandle *ks;
struct GNUNET_HashCode my_h_wire;
struct TALER_Amount amount;
struct GNUNET_JSON_Specification spec[] = {
@ -161,7 +161,7 @@ TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -171,7 +171,7 @@ TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
memset (&deposit, 0, sizeof (deposit));
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
json_decref (json);
@ -184,16 +184,16 @@ TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
{
GNUNET_break_op (0);
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"refund_deadline");
}
if (GNUNET_YES !=
TMH_json_validate_wireformat (wire,
TEH_json_validate_wireformat (wire,
GNUNET_NO))
{
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_unknown (connection,
return TEH_RESPONSE_reply_arg_unknown (connection,
"wire");
}
if (GNUNET_OK !=
@ -202,7 +202,7 @@ TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
{
TALER_LOG_WARNING ("Failed to parse JSON wire format specification for /deposit request\n");
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"wire");
}
if (0 != memcmp (&deposit.h_wire,
@ -211,23 +211,23 @@ TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
{
/* Client hashed contract differently than we did, reject */
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"H_wire");
}
ks = TMH_KS_acquire ();
dki = TMH_KS_denomination_key_lookup (ks,
ks = TEH_KS_acquire ();
dki = TEH_KS_denomination_key_lookup (ks,
&deposit.coin.denom_pub,
TMH_KS_DKU_DEPOSIT);
TEH_KS_DKU_DEPOSIT);
if (NULL == dki)
{
TMH_KS_release (ks);
TEH_KS_release (ks);
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_unknown (connection,
return TEH_RESPONSE_reply_arg_unknown (connection,
"denom_pub");
}
TALER_amount_ntoh (&deposit.deposit_fee,
&dki->issue.properties.fee_deposit);
TMH_KS_release (ks);
TEH_KS_release (ks);
deposit.receiver_wire_account = wire;
deposit.amount_with_fee = amount;
if (-1 == TALER_amount_cmp (&deposit.amount_with_fee,
@ -235,7 +235,7 @@ TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
{
/* Total amount smaller than fee, invalid */
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"f");
}
res = verify_and_execute_deposit (connection,

View File

@ -41,7 +41,7 @@
* @return MHD result code
*/
int
TMH_DEPOSIT_handler_deposit (struct TMH_RequestHandler *rh,
TEH_DEPOSIT_handler_deposit (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

View File

@ -33,12 +33,12 @@
* the exchange. There can be multiple instances of this struct, as it is
* reference counted and only destroyed once the last user is done
* with it. The current instance is acquired using
* #TMH_KS_acquire(). Using this function increases the
* #TEH_KS_acquire(). Using this function increases the
* reference count. The contents of this structure (except for the
* reference counter) should be considered READ-ONLY until it is
* ultimately destroyed (as there can be many concurrent users).
*/
struct TMH_KS_StateHandle
struct TEH_KS_StateHandle
{
/**
* JSON array with denomination keys. (Currently not really used
@ -60,7 +60,7 @@ struct TMH_KS_StateHandle
/**
* Cached JSON text that the exchange will send for a "/keys" request.
* Includes our @e TMH_master_public_key public key, the signing and
* Includes our @e TEH_master_public_key public key, the signing and
* denomination keys as well as the @e reload_time.
*/
char *keys_json;
@ -107,9 +107,9 @@ struct TMH_KS_StateHandle
/**
* Exchange key state. Never use directly, instead access via
* #TMH_KS_acquire() and #TMH_KS_release().
* #TEH_KS_acquire() and #TEH_KS_release().
*/
static struct TMH_KS_StateHandle *internal_key_state;
static struct TEH_KS_StateHandle *internal_key_state;
/**
* Mutex protecting access to #internal_key_state.
@ -219,7 +219,7 @@ reload_keys_denom_iter (void *cls,
const char *alias,
const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki)
{
struct TMH_KS_StateHandle *ctx = cls;
struct TEH_KS_StateHandle *ctx = cls;
struct GNUNET_TIME_Absolute now;
struct GNUNET_TIME_Absolute horizon;
struct GNUNET_TIME_Absolute expire_deposit;
@ -257,7 +257,7 @@ reload_keys_denom_iter (void *cls,
sizeof (struct GNUNET_HashCode));
if (0 != memcmp (&dki->issue.properties.master,
&TMH_master_public_key,
&TEH_master_public_key,
sizeof (struct TALER_MasterPublicKeyP)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@ -267,7 +267,7 @@ reload_keys_denom_iter (void *cls,
}
session = TMH_plugin->get_session (TMH_plugin->cls);
session = TEH_plugin->get_session (TEH_plugin->cls);
if (NULL == session)
return GNUNET_SYSERR;
/* Try to insert DKI into DB until we succeed; note that if the DB
@ -277,7 +277,7 @@ reload_keys_denom_iter (void *cls,
res = GNUNET_SYSERR;
while (GNUNET_OK != res)
{
res = TMH_plugin->start (TMH_plugin->cls,
res = TEH_plugin->start (TEH_plugin->cls,
session);
if (GNUNET_OK != res)
{
@ -285,7 +285,7 @@ reload_keys_denom_iter (void *cls,
GNUNET_break (0);
continue;
}
res = TMH_plugin->get_denomination_info (TMH_plugin->cls,
res = TEH_plugin->get_denomination_info (TEH_plugin->cls,
session,
&dki->denom_pub,
NULL);
@ -293,18 +293,18 @@ reload_keys_denom_iter (void *cls,
{
/* Fetch failed!? Very bad error, log and retry */
GNUNET_break (0);
TMH_plugin->rollback (TMH_plugin->cls,
TEH_plugin->rollback (TEH_plugin->cls,
session);
continue;
}
if (GNUNET_OK == res)
{
/* Record exists, we're good, just exit */
TMH_plugin->rollback (TMH_plugin->cls,
TEH_plugin->rollback (TEH_plugin->cls,
session);
break;
}
res = TMH_plugin->insert_denomination_info (TMH_plugin->cls,
res = TEH_plugin->insert_denomination_info (TEH_plugin->cls,
session,
&dki->denom_pub,
&dki->issue);
@ -312,11 +312,11 @@ reload_keys_denom_iter (void *cls,
{
/* Insert failed!? Very bad error, log and retry */
GNUNET_break (0);
TMH_plugin->rollback (TMH_plugin->cls,
TEH_plugin->rollback (TEH_plugin->cls,
session);
continue;
}
res = TMH_plugin->commit (TMH_plugin->cls,
res = TEH_plugin->commit (TEH_plugin->cls,
session);
/* If commit succeeded, we're done, otherwise we retry; this
time without logging, as theroetically commits can fail
@ -382,7 +382,7 @@ sign_key_issue_to_json (const struct TALER_ExchangeSigningKeyValidityPS *ski)
/**
* Iterator for sign keys.
*
* @param cls closure with the `struct TMH_KS_StateHandle *`
* @param cls closure with the `struct TEH_KS_StateHandle *`
* @param filename name of the file the key came from
* @param ski the sign key issue
* @return #GNUNET_OK to continue to iterate,
@ -394,7 +394,7 @@ reload_keys_sign_iter (void *cls,
const char *filename,
const struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP *ski)
{
struct TMH_KS_StateHandle *ctx = cls;
struct TEH_KS_StateHandle *ctx = cls;
struct GNUNET_TIME_Absolute now;
struct GNUNET_TIME_Absolute horizon;
@ -418,7 +418,7 @@ reload_keys_sign_iter (void *cls,
}
if (0 != memcmp (&ski->issue.master_public_key,
&TMH_master_public_key,
&TEH_master_public_key,
sizeof (struct TALER_MasterPublicKeyP)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@ -489,7 +489,7 @@ auditor_to_json (const struct TALER_AuditorPublicKeyP *apub,
* add the auditor information to our /keys response (if it is
* (still) applicable).
*
* @param cls closure with the `struct TMH_KS_StateHandle *`
* @param cls closure with the `struct TEH_KS_StateHandle *`
* @param apub the auditor's public key
* @param auditor_url URL of the auditor
* @param mpub the exchange's public key (as expected by the auditor)
@ -509,7 +509,7 @@ reload_auditor_iter (void *cls,
const struct TALER_AuditorSignatureP *asigs,
const struct TALER_DenominationKeyValidityPS *dki)
{
struct TMH_KS_StateHandle *ctx = cls;
struct TEH_KS_StateHandle *ctx = cls;
unsigned int i;
unsigned int keep;
const struct TALER_AuditorSignatureP *kept_asigs[dki_len];
@ -517,7 +517,7 @@ reload_auditor_iter (void *cls,
/* Check if the signature is at least for this exchange. */
if (0 != memcmp (&mpub->eddsa_pub,
&TMH_master_public_key,
&TEH_master_public_key,
sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@ -553,7 +553,7 @@ reload_auditor_iter (void *cls,
/**
* Iterator for freeing denomination keys.
*
* @param cls closure with the `struct TMH_KS_StateHandle`
* @param cls closure with the `struct TEH_KS_StateHandle`
* @param key key for the denomination key
* @param value coin details
* @return #GNUNET_OK to continue to iterate,
@ -581,7 +581,7 @@ free_denom_key (void *cls,
* @param key_state the key state to release
*/
static void
ks_release_ (struct TMH_KS_StateHandle *key_state)
ks_release_ (struct TEH_KS_StateHandle *key_state)
{
GNUNET_assert (0 < key_state->refcnt);
key_state->refcnt--;
@ -618,8 +618,8 @@ ks_release_ (struct TMH_KS_StateHandle *key_state)
* @param key_state the key state to release
*/
void
TMH_KS_release_ (const char *location,
struct TMH_KS_StateHandle *key_state)
TEH_KS_release_ (const char *location,
struct TEH_KS_StateHandle *key_state)
{
GNUNET_assert (0 == pthread_mutex_lock (&internal_key_state_mutex));
ks_release_ (key_state);
@ -629,17 +629,17 @@ TMH_KS_release_ (const char *location,
/**
* Acquire the key state of the exchange. Updates keys if necessary.
* For every call to #TMH_KS_acquire(), a matching call
* to #TMH_KS_release() must be made.
* For every call to #TEH_KS_acquire(), a matching call
* to #TEH_KS_release() must be made.
*
* @param location name of the function in which the lock is acquired
* @return the key state
*/
struct TMH_KS_StateHandle *
TMH_KS_acquire_ (const char *location)
struct TEH_KS_StateHandle *
TEH_KS_acquire_ (const char *location)
{
struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
struct TMH_KS_StateHandle *key_state;
struct TEH_KS_StateHandle *key_state;
json_t *keys;
struct TALER_ExchangeKeySetPS ks;
struct TALER_ExchangeSignatureP sig;
@ -653,7 +653,7 @@ TMH_KS_acquire_ (const char *location)
}
if (NULL == internal_key_state)
{
key_state = GNUNET_new (struct TMH_KS_StateHandle);
key_state = GNUNET_new (struct TEH_KS_StateHandle);
key_state->hash_context = GNUNET_CRYPTO_hash_context_start ();
key_state->min_dk_expire = GNUNET_TIME_UNIT_FOREVER_ABS;
@ -672,11 +672,11 @@ TMH_KS_acquire_ (const char *location)
GNUNET_TIME_round_abs (&key_state->reload_time);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Loading keys from `%s'\n",
TMH_exchange_directory);
TALER_EXCHANGEDB_denomination_keys_iterate (TMH_exchange_directory,
TEH_exchange_directory);
TALER_EXCHANGEDB_denomination_keys_iterate (TEH_exchange_directory,
&reload_keys_denom_iter,
key_state);
TALER_EXCHANGEDB_signing_keys_iterate (TMH_exchange_directory,
TALER_EXCHANGEDB_signing_keys_iterate (TEH_exchange_directory,
&reload_keys_sign_iter,
key_state);
TALER_EXCHANGEDB_auditor_iterate (cfg,
@ -684,7 +684,7 @@ TMH_KS_acquire_ (const char *location)
key_state);
if (0 != memcmp (&key_state->current_sign_key_issue.issue.master_public_key,
&TMH_master_public_key,
&TEH_master_public_key,
sizeof (struct TALER_MasterPublicKeyP)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@ -712,7 +712,7 @@ TMH_KS_acquire_ (const char *location)
keys = json_pack ("{s:o, s:o, s:o, s:o, s:o, s:o, s:o}",
"master_public_key",
GNUNET_JSON_from_data_auto (&TMH_master_public_key),
GNUNET_JSON_from_data_auto (&TEH_master_public_key),
"signkeys", key_state->sign_keys_array,
"denoms", key_state->denom_keys_array,
"auditors", key_state->auditors_array,
@ -747,9 +747,9 @@ TMH_KS_acquire_ (const char *location)
* or NULL if denom_pub could not be found
*/
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state,
TEH_KS_denomination_key_lookup (const struct TEH_KS_StateHandle *key_state,
const struct TALER_DenominationPublicKey *denom_pub,
enum TMH_KS_DenominationKeyUse use)
enum TEH_KS_DenominationKeyUse use)
{
struct GNUNET_HashCode hc;
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
@ -773,7 +773,7 @@ TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state,
now = GNUNET_TIME_absolute_get ();
switch (use)
{
case TMH_KS_DKU_WITHDRAW:
case TEH_KS_DKU_WITHDRAW:
if (now.abs_value_us >
GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_withdraw).abs_value_us)
{
@ -783,7 +783,7 @@ TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state,
return NULL;
}
break;
case TMH_KS_DKU_DEPOSIT:
case TEH_KS_DKU_DEPOSIT:
if (now.abs_value_us >
GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_deposit).abs_value_us)
{
@ -891,7 +891,7 @@ handle_sigchld ()
* #GNUNET_NO to restart an update version of the binary
*/
int
TMH_KS_loop (void)
TEH_KS_loop (void)
{
struct GNUNET_SIGNAL_Context *sigusr1;
struct GNUNET_SIGNAL_Context *sigterm;
@ -927,12 +927,12 @@ TMH_KS_loop (void)
"(re-)loading keys\n");
if (NULL != internal_key_state)
{
TMH_KS_release (internal_key_state);
TEH_KS_release (internal_key_state);
internal_key_state = NULL;
}
/* This will re-initialize 'internal_key_state' with
an initial refcnt of 1 */
if (NULL == TMH_KS_acquire ())
if (NULL == TEH_KS_acquire ())
{
ret = GNUNET_SYSERR;
break;
@ -978,7 +978,7 @@ read_again:
}
if (NULL != internal_key_state)
{
TMH_KS_release (internal_key_state);
TEH_KS_release (internal_key_state);
internal_key_state = NULL;
}
GNUNET_SIGNAL_handler_uninstall (sigusr1);
@ -998,20 +998,20 @@ read_again:
* @param[out] sig signature over purpose using current signing key
*/
void
TMH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
TEH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig)
{
struct TMH_KS_StateHandle *key_state;
struct TEH_KS_StateHandle *key_state;
key_state = TMH_KS_acquire ();
key_state = TEH_KS_acquire ();
*pub = key_state->current_sign_key_issue.issue.signkey_pub;
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_sign (&key_state->current_sign_key_issue.signkey_priv.eddsa_priv,
purpose,
&sig->eddsa_signature));
TMH_KS_release (key_state);
TEH_KS_release (key_state);
}
@ -1079,28 +1079,28 @@ get_date_string (struct GNUNET_TIME_Absolute at,
* @return MHD result code
*/
int
TMH_KS_handler_keys (struct TMH_RequestHandler *rh,
TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
size_t *upload_data_size)
{
struct TMH_KS_StateHandle *key_state;
struct TEH_KS_StateHandle *key_state;
struct MHD_Response *response;
int ret;
char dat[128];
key_state = TMH_KS_acquire ();
key_state = TEH_KS_acquire ();
response = MHD_create_response_from_buffer (strlen (key_state->keys_json),
key_state->keys_json,
MHD_RESPMEM_MUST_COPY);
TMH_KS_release (key_state);
TEH_KS_release (key_state);
if (NULL == response)
{
GNUNET_break (0);
return MHD_NO;
}
TMH_RESPONSE_add_global_headers (response);
TEH_RESPONSE_add_global_headers (response);
GNUNET_break (MHD_YES ==
MHD_add_response_header (response,
MHD_HTTP_HEADER_CONTENT_TYPE,

View File

@ -33,19 +33,19 @@
* Snapshot of the (coin and signing)
* keys (including private keys) of the exchange.
*/
struct TMH_KS_StateHandle;
struct TEH_KS_StateHandle;
/**
* Acquire the key state of the exchange. Updates keys if necessary.
* For every call to #TMH_KS_acquire(), a matching call
* to #TMH_KS_release() must be made.
* For every call to #TEH_KS_acquire(), a matching call
* to #TEH_KS_release() must be made.
*
* @param location name of the function in which the lock is acquired
* @return the key state
*/
struct TMH_KS_StateHandle *
TMH_KS_acquire_ (const char *location);
struct TEH_KS_StateHandle *
TEH_KS_acquire_ (const char *location);
/**
@ -55,18 +55,18 @@ TMH_KS_acquire_ (const char *location);
* @param key_state the key state to release
*/
void
TMH_KS_release_ (const char *location,
struct TMH_KS_StateHandle *key_state);
TEH_KS_release_ (const char *location,
struct TEH_KS_StateHandle *key_state);
/**
* Acquire the key state of the exchange. Updates keys if necessary.
* For every call to #TMH_KS_acquire(), a matching call
* to #TMH_KS_release() must be made.
* For every call to #TEH_KS_acquire(), a matching call
* to #TEH_KS_release() must be made.
*
* @return the key state
*/
#define TMH_KS_acquire(void) TMH_KS_acquire_(__FUNCTION__)
#define TEH_KS_acquire(void) TEH_KS_acquire_(__FUNCTION__)
/**
@ -74,7 +74,7 @@ TMH_KS_release_ (const char *location,
*
* @param key_state the key state to release
*/
#define TMH_KS_release(key_state) TMH_KS_release_ (__FUNCTION__, key_state)
#define TEH_KS_release(key_state) TEH_KS_release_ (__FUNCTION__, key_state)
/**
@ -83,18 +83,18 @@ TMH_KS_release_ (const char *location,
* periods for a key differ, the caller must specify which
* use is relevant for the current operation.
*/
enum TMH_KS_DenominationKeyUse {
enum TEH_KS_DenominationKeyUse {
/**
* The key is to be used for a /reserve/withdraw or /refresh (exchange)
* operation.
*/
TMH_KS_DKU_WITHDRAW,
TEH_KS_DKU_WITHDRAW,
/**
* The key is to be usd for a /deposit or /refresh (melt) operation.
*/
TMH_KS_DKU_DEPOSIT
TEH_KS_DKU_DEPOSIT
};
@ -110,9 +110,9 @@ enum TMH_KS_DenominationKeyUse {
* or NULL if denom_pub could not be found (or is not valid at this time for the given @a use)
*/
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state,
TEH_KS_denomination_key_lookup (const struct TEH_KS_StateHandle *key_state,
const struct TALER_DenominationPublicKey *denom_pub,
enum TMH_KS_DenominationKeyUse use);
enum TEH_KS_DenominationKeyUse use);
/**
@ -125,7 +125,7 @@ TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state,
* #GNUNET_NO to restart an update version of the binary
*/
int
TMH_KS_loop (void);
TEH_KS_loop (void);
/**
@ -137,7 +137,7 @@ TMH_KS_loop (void);
* @param[out] sig signature over purpose using current signing key
*/
void
TMH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
TEH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig);
@ -153,7 +153,7 @@ TMH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
* @return MHD result code
*/
int
TMH_KS_handler_keys (struct TMH_RequestHandler *rh,
TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

View File

@ -44,7 +44,7 @@
* @return MHD result code
*/
int
TMH_MHD_handler_static_response (struct TMH_RequestHandler *rh,
TEH_MHD_handler_static_response (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -63,7 +63,7 @@ TMH_MHD_handler_static_response (struct TMH_RequestHandler *rh,
GNUNET_break (0);
return MHD_NO;
}
TMH_RESPONSE_add_global_headers (response);
TEH_RESPONSE_add_global_headers (response);
if (NULL != rh->mime_type)
(void) MHD_add_response_header (response,
MHD_HTTP_HEADER_CONTENT_TYPE,
@ -88,7 +88,7 @@ TMH_MHD_handler_static_response (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_MHD_handler_agpl_redirect (struct TMH_RequestHandler *rh,
TEH_MHD_handler_agpl_redirect (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -107,7 +107,7 @@ TMH_MHD_handler_agpl_redirect (struct TMH_RequestHandler *rh,
GNUNET_break (0);
return MHD_NO;
}
TMH_RESPONSE_add_global_headers (response);
TEH_RESPONSE_add_global_headers (response);
if (NULL != rh->mime_type)
(void) MHD_add_response_header (response,
MHD_HTTP_HEADER_CONTENT_TYPE,
@ -135,13 +135,13 @@ TMH_MHD_handler_agpl_redirect (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_MHD_handler_send_json_pack_error (struct TMH_RequestHandler *rh,
TEH_MHD_handler_send_json_pack_error (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
size_t *upload_data_size)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
rh->response_code,
"{s:s}",
"error",

View File

@ -40,7 +40,7 @@
* @return MHD result code
*/
int
TMH_MHD_handler_static_response (struct TMH_RequestHandler *rh,
TEH_MHD_handler_static_response (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -59,7 +59,7 @@ TMH_MHD_handler_static_response (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_MHD_handler_agpl_redirect (struct TMH_RequestHandler *rh,
TEH_MHD_handler_agpl_redirect (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -80,7 +80,7 @@ TMH_MHD_handler_agpl_redirect (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_MHD_helper_send_json_pack (struct TMH_RequestHandler *rh,
TEH_MHD_helper_send_json_pack (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void *connection_cls,
int response_code,
@ -101,7 +101,7 @@ TMH_MHD_helper_send_json_pack (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_MHD_handler_send_json_pack_error (struct TMH_RequestHandler *rh,
TEH_MHD_handler_send_json_pack_error (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

View File

@ -42,7 +42,7 @@
* realizes an MHD POST processor that will (incrementally) process
* JSON data uploaded to the HTTP server. It will store the required
* state in the @a con_cls, which must be cleaned up using
* #TMH_PARSE_post_cleanup_callback().
* #TEH_PARSE_post_cleanup_callback().
*
* @param connection the MHD connection
* @param con_cls the closure (points to a `struct Buffer *`)
@ -61,7 +61,7 @@
* close HTTP session with MHD_NO)
*/
int
TMH_PARSE_post_json (struct MHD_Connection *connection,
TEH_PARSE_post_json (struct MHD_Connection *connection,
void **con_cls,
const char *upload_data,
size_t *upload_data_size,
@ -78,18 +78,18 @@ TMH_PARSE_post_json (struct MHD_Connection *connection,
{
case GNUNET_JSON_PR_OUT_OF_MEMORY:
return (MHD_NO ==
TMH_RESPONSE_reply_internal_error (connection,
TEH_RESPONSE_reply_internal_error (connection,
"out of memory"))
? GNUNET_SYSERR : GNUNET_NO;
case GNUNET_JSON_PR_CONTINUE:
return GNUNET_YES;
case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
return (MHD_NO ==
TMH_RESPONSE_reply_request_too_large (connection))
TEH_RESPONSE_reply_request_too_large (connection))
? GNUNET_SYSERR : GNUNET_NO;
case GNUNET_JSON_PR_JSON_INVALID:
return (MHD_YES ==
TMH_RESPONSE_reply_invalid_json (connection))
TEH_RESPONSE_reply_invalid_json (connection))
? GNUNET_NO : GNUNET_SYSERR;
case GNUNET_JSON_PR_SUCCESS:
GNUNET_break (NULL != *json);
@ -106,10 +106,10 @@ TMH_PARSE_post_json (struct MHD_Connection *connection,
* to clean up our state.
*
* @param con_cls value as it was left by
* #TMH_PARSE_post_json(), to be cleaned up
* #TEH_PARSE_post_json(), to be cleaned up
*/
void
TMH_PARSE_post_cleanup_callback (void *con_cls)
TEH_PARSE_post_cleanup_callback (void *con_cls)
{
GNUNET_JSON_post_parser_cleanup (con_cls);
}
@ -131,7 +131,7 @@ TMH_PARSE_post_cleanup_callback (void *con_cls)
* #GNUNET_SYSERR on internal error (error response could not be sent)
*/
int
TMH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
TEH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
const char *param_name,
void *out_data,
size_t out_size)
@ -144,7 +144,7 @@ TMH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
if (NULL == str)
{
return (MHD_NO ==
TMH_RESPONSE_reply_arg_missing (connection, param_name))
TEH_RESPONSE_reply_arg_missing (connection, param_name))
? GNUNET_SYSERR : GNUNET_NO;
}
if (GNUNET_OK !=
@ -153,7 +153,7 @@ TMH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
out_data,
out_size))
return (MHD_NO ==
TMH_RESPONSE_reply_arg_invalid (connection, param_name))
TEH_RESPONSE_reply_arg_invalid (connection, param_name))
? GNUNET_SYSERR : GNUNET_NO;
return GNUNET_OK;
}
@ -174,7 +174,7 @@ TMH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
* #GNUNET_SYSERR on internal error
*/
int
TMH_PARSE_json_data (struct MHD_Connection *connection,
TEH_PARSE_json_data (struct MHD_Connection *connection,
const json_t *root,
struct GNUNET_JSON_Specification *spec)
{
@ -191,7 +191,7 @@ TMH_PARSE_json_data (struct MHD_Connection *connection,
if (NULL == error_json_name)
error_json_name = "<no field>";
ret = (MHD_YES ==
TMH_RESPONSE_reply_json_pack (connection,
TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
"{s:s, s:s, s:I}",
"error", "parse error",
@ -220,7 +220,7 @@ TMH_PARSE_json_data (struct MHD_Connection *connection,
* #GNUNET_SYSERR on internal error
*/
int
TMH_PARSE_json_array (struct MHD_Connection *connection,
TEH_PARSE_json_array (struct MHD_Connection *connection,
const json_t *root,
struct GNUNET_JSON_Specification *spec,
...)
@ -243,7 +243,7 @@ TMH_PARSE_json_array (struct MHD_Connection *connection,
if (NULL == root)
{
ret = (MHD_YES ==
TMH_RESPONSE_reply_json_pack (connection,
TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
"{s:s, s:I}",
"error", "parse error",
@ -260,7 +260,7 @@ TMH_PARSE_json_array (struct MHD_Connection *connection,
if (NULL == error_json_name)
error_json_name = "<no field>";
ret = (MHD_YES ==
TMH_RESPONSE_reply_json_pack (connection,
TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
"{s:s, s:s, s:I}",
"error", "parse error",

View File

@ -35,7 +35,7 @@
* (incrementally) process JSON data uploaded to the HTTP
* server. It will store the required state in the
* "connection_cls", which must be cleaned up using
* #TMH_PARSE_post_cleanup_callback().
* #TEH_PARSE_post_cleanup_callback().
*
* @param connection the MHD connection
* @param con_cls the closure (points to a `struct Buffer *`)
@ -54,7 +54,7 @@
* close HTTP session with MHD_NO)
*/
int
TMH_PARSE_post_json (struct MHD_Connection *connection,
TEH_PARSE_post_json (struct MHD_Connection *connection,
void **con_cls,
const char *upload_data,
size_t *upload_data_size,
@ -66,10 +66,10 @@ TMH_PARSE_post_json (struct MHD_Connection *connection,
* to clean up our state.
*
* @param con_cls value as it was left by
* #TMH_PARSE_post_json(), to be cleaned up
* #TEH_PARSE_post_json(), to be cleaned up
*/
void
TMH_PARSE_post_cleanup_callback (void *con_cls);
TEH_PARSE_post_cleanup_callback (void *con_cls);
/**
@ -87,7 +87,7 @@ TMH_PARSE_post_cleanup_callback (void *con_cls);
* #GNUNET_SYSERR on internal error
*/
int
TMH_PARSE_json_data (struct MHD_Connection *connection,
TEH_PARSE_json_data (struct MHD_Connection *connection,
const json_t *root,
struct GNUNET_JSON_Specification *spec);
@ -108,7 +108,7 @@ TMH_PARSE_json_data (struct MHD_Connection *connection,
* #GNUNET_SYSERR on internal error
*/
int
TMH_PARSE_json_array (struct MHD_Connection *connection,
TEH_PARSE_json_array (struct MHD_Connection *connection,
const json_t *root,
struct GNUNET_JSON_Specification *spec,
...);
@ -130,7 +130,7 @@ TMH_PARSE_json_array (struct MHD_Connection *connection,
* #GNUNET_SYSERR on internal error (error response could not be sent)
*/
int
TMH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
TEH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
const char *param_name,
void *out_data,
size_t out_size);

View File

@ -52,13 +52,13 @@ static int
handle_refresh_melt_binary (struct MHD_Connection *connection,
unsigned int num_new_denoms,
const struct TALER_DenominationPublicKey *denom_pubs,
const struct TMH_DB_MeltDetails *coin_melt_details,
const struct TEH_DB_MeltDetails *coin_melt_details,
const struct GNUNET_HashCode *session_hash,
struct TALER_EXCHANGEDB_RefreshCommitCoin *const* commit_coin,
const struct TALER_TransferPublicKeyP *transfer_pubs)
{
unsigned int i;
struct TMH_KS_StateHandle *key_state;
struct TEH_KS_StateHandle *key_state;
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dk;
struct TALER_EXCHANGEDB_DenominationKeyInformationP *dki;
struct TALER_Amount cost;
@ -69,19 +69,19 @@ handle_refresh_melt_binary (struct MHD_Connection *connection,
struct TALER_Amount total_melt;
GNUNET_assert (GNUNET_OK ==
TALER_amount_get_zero (TMH_exchange_currency_string,
TALER_amount_get_zero (TEH_exchange_currency_string,
&total_cost));
key_state = TMH_KS_acquire ();
key_state = TEH_KS_acquire ();
for (i=0;i<num_new_denoms;i++)
{
dk = TMH_KS_denomination_key_lookup (key_state,
dk = TEH_KS_denomination_key_lookup (key_state,
&denom_pubs[i],
TMH_KS_DKU_WITHDRAW);
TEH_KS_DKU_WITHDRAW);
if (NULL == dk)
{
GNUNET_break_op (0);
TMH_KS_release (key_state);
return TMH_RESPONSE_reply_arg_invalid (connection,
TEH_KS_release (key_state);
return TEH_RESPONSE_reply_arg_invalid (connection,
"new_denoms");
}
dki = &dk->issue;
@ -99,19 +99,19 @@ handle_refresh_melt_binary (struct MHD_Connection *connection,
&total_cost)) )
{
GNUNET_break_op (0);
TMH_KS_release (key_state);
return TMH_RESPONSE_reply_internal_error (connection,
TEH_KS_release (key_state);
return TEH_RESPONSE_reply_internal_error (connection,
"cost calculation failure");
}
}
dk = TMH_KS_denomination_key_lookup (key_state,
dk = TEH_KS_denomination_key_lookup (key_state,
&coin_melt_details->coin_info.denom_pub,
TMH_KS_DKU_DEPOSIT);
TEH_KS_DKU_DEPOSIT);
if (NULL == dk)
{
GNUNET_break (0);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"denom_pub");
}
dki = &dk->issue;
@ -123,11 +123,11 @@ handle_refresh_melt_binary (struct MHD_Connection *connection,
&fee_melt))
{
GNUNET_break_op (0);
TMH_KS_release (key_state);
return TMH_RESPONSE_reply_external_error (connection,
TEH_KS_release (key_state);
return TEH_RESPONSE_reply_external_error (connection,
"Melt contribution below melting fee");
}
TMH_KS_release (key_state);
TEH_KS_release (key_state);
if (0 !=
TALER_amount_cmp (&total_cost,
&total_melt))
@ -135,12 +135,12 @@ handle_refresh_melt_binary (struct MHD_Connection *connection,
GNUNET_break_op (0);
/* We require total value of coins being melted and
total value of coins being generated to match! */
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
"{s:s}",
"error", "value mismatch");
}
return TMH_DB_execute_refresh_melt (connection,
return TEH_DB_execute_refresh_melt (connection,
session_hash,
num_new_denoms,
denom_pubs,
@ -163,7 +163,7 @@ handle_refresh_melt_binary (struct MHD_Connection *connection,
static int
get_coin_public_info (struct MHD_Connection *connection,
const json_t *coin_info,
struct TMH_DB_MeltDetails *r_melt_detail)
struct TEH_DB_MeltDetails *r_melt_detail)
{
int ret;
struct TALER_CoinSpendSignatureP melt_sig;
@ -179,7 +179,7 @@ get_coin_public_info (struct MHD_Connection *connection,
GNUNET_JSON_spec_end ()
};
ret = TMH_PARSE_json_data (connection,
ret = TEH_PARSE_json_data (connection,
coin_info,
spec);
if (GNUNET_OK != ret)
@ -198,7 +198,7 @@ get_coin_public_info (struct MHD_Connection *connection,
r_melt_detail->coin_info.denom_sig.rsa_signature = NULL;
r_melt_detail->coin_info.denom_pub.rsa_public_key = NULL;
return (MHD_YES ==
TMH_RESPONSE_reply_signature_invalid (connection,
TEH_RESPONSE_reply_signature_invalid (connection,
"denom_sig"))
? GNUNET_NO : GNUNET_SYSERR;
}
@ -226,22 +226,22 @@ get_coin_public_info (struct MHD_Connection *connection,
static int
verify_coin_public_info (struct MHD_Connection *connection,
const struct GNUNET_HashCode *session_hash,
struct TMH_DB_MeltDetails *melt_detail)
struct TEH_DB_MeltDetails *melt_detail)
{
struct TALER_RefreshMeltCoinAffirmationPS body;
struct TMH_KS_StateHandle *key_state;
struct TEH_KS_StateHandle *key_state;
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TALER_Amount fee_refresh;
key_state = TMH_KS_acquire ();
dki = TMH_KS_denomination_key_lookup (key_state,
key_state = TEH_KS_acquire ();
dki = TEH_KS_denomination_key_lookup (key_state,
&melt_detail->coin_info.denom_pub,
TMH_KS_DKU_DEPOSIT);
TEH_KS_DKU_DEPOSIT);
if (NULL == dki)
{
TMH_KS_release (key_state);
TEH_KS_release (key_state);
TALER_LOG_WARNING ("Unknown denomination key in /refresh/melt request\n");
return TMH_RESPONSE_reply_arg_unknown (connection,
return TEH_RESPONSE_reply_arg_unknown (connection,
"denom_pub");
}
TALER_amount_ntoh (&fee_refresh,
@ -259,14 +259,14 @@ verify_coin_public_info (struct MHD_Connection *connection,
&melt_detail->melt_amount_with_fee) > 0)
{
GNUNET_break_op (0);
TMH_KS_release (key_state);
TEH_KS_release (key_state);
return (MHD_YES ==
TMH_RESPONSE_reply_external_error (connection,
TEH_RESPONSE_reply_external_error (connection,
"melt amount smaller than melting fee"))
? GNUNET_NO : GNUNET_SYSERR;
}
TMH_KS_release (key_state);
TEH_KS_release (key_state);
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT,
&body.purpose,
@ -275,7 +275,7 @@ verify_coin_public_info (struct MHD_Connection *connection,
{
GNUNET_break_op (0);
if (MHD_YES !=
TMH_RESPONSE_reply_signature_invalid (connection,
TEH_RESPONSE_reply_signature_invalid (connection,
"confirm_sig"))
return GNUNET_SYSERR;
return GNUNET_NO;
@ -336,7 +336,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
unsigned int j;
struct TALER_DenominationPublicKey *denom_pubs;
unsigned int num_newcoins;
struct TMH_DB_MeltDetails coin_melt_details;
struct TEH_DB_MeltDetails coin_melt_details;
struct GNUNET_HashCode session_hash;
struct GNUNET_HashContext *hash_context;
struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coin[TALER_CNC_KAPPA];
@ -353,7 +353,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_json_array (connection,
res = TEH_PARSE_json_array (connection,
transfer_pubs,
trans_spec,
i, -1);
@ -382,7 +382,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_json_array (connection,
res = TEH_PARSE_json_array (connection,
new_denoms,
spec,
i, -1);
@ -441,7 +441,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_json_array (connection,
res = TEH_PARSE_json_array (connection,
coin_evs,
coin_spec,
i, j, -1);
@ -508,7 +508,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
* Handle a "/refresh/melt" request. Parses the request into the JSON
* components and then hands things of to #handle_refresh_melt_json()
* to validate the melted coins, the signature and execute the melt
* using TMH_DB_execute_refresh_melt().
* using TEH_DB_execute_refresh_melt().
*
* @param rh context of the handler
* @param connection the MHD connection to handle
@ -518,7 +518,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
TEH_REFRESH_handler_refresh_melt (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -538,7 +538,7 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -548,7 +548,7 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
if ( (GNUNET_NO == res) || (NULL == root) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
root,
spec);
json_decref (root);
@ -560,14 +560,14 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
{
GNUNET_break_op (0);
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"coin_evs");
}
if (TALER_CNC_KAPPA != json_array_size (transfer_pubs))
{
GNUNET_break_op (0);
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"transfer_pubs");
}
res = handle_refresh_melt_json (connection,
@ -583,7 +583,7 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
/**
* Handle a "/refresh/reveal" request. Parses the given JSON
* transfer private keys and if successful, passes everything to
* #TMH_DB_execute_refresh_reveal() which will verify that the
* #TEH_DB_execute_refresh_reveal() which will verify that the
* revealed information is valid then returns the signed refreshed
* coins.
*
@ -611,7 +611,7 @@ handle_refresh_reveal_json (struct MHD_Connection *connection,
if (GNUNET_OK != res)
break;
res = TMH_PARSE_json_array (connection,
res = TEH_PARSE_json_array (connection,
tp_json,
tp_spec,
i, -1);
@ -620,7 +620,7 @@ handle_refresh_reveal_json (struct MHD_Connection *connection,
if (GNUNET_OK != res)
res = (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
else
res = TMH_DB_execute_refresh_reveal (connection,
res = TEH_DB_execute_refresh_reveal (connection,
session_hash,
transfer_privs);
return res;
@ -632,7 +632,7 @@ handle_refresh_reveal_json (struct MHD_Connection *connection,
* the private transfer keys except for the cut-and-choose value
* returned from "/refresh/melt". This function parses the revealed
* keys and secrets and ultimately passes everything to
* #TMH_DB_execute_refresh_reveal() which will verify that the
* #TEH_DB_execute_refresh_reveal() which will verify that the
* revealed information is valid then returns the signed refreshed
* coins.
*
@ -644,7 +644,7 @@ handle_refresh_reveal_json (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
TEH_REFRESH_handler_refresh_reveal (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -660,7 +660,7 @@ TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -670,7 +670,7 @@ TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
if ( (GNUNET_NO == res) || (NULL == root) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
root,
spec);
json_decref (root);
@ -685,7 +685,7 @@ TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
{
GNUNET_JSON_parse_free (spec);
GNUNET_break_op (0);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"transfer_privs");
}
res = handle_refresh_reveal_json (connection,
@ -708,7 +708,7 @@ TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_REFRESH_handler_refresh_link (struct TMH_RequestHandler *rh,
TEH_REFRESH_handler_refresh_link (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -717,7 +717,7 @@ TMH_REFRESH_handler_refresh_link (struct TMH_RequestHandler *rh,
struct TALER_CoinSpendPublicKeyP coin_pub;
int res;
res = TMH_PARSE_mhd_request_arg_data (connection,
res = TEH_PARSE_mhd_request_arg_data (connection,
"coin_pub",
&coin_pub,
sizeof (struct TALER_CoinSpendPublicKeyP));
@ -725,7 +725,7 @@ TMH_REFRESH_handler_refresh_link (struct TMH_RequestHandler *rh,
return MHD_NO;
if (GNUNET_OK != res)
return MHD_YES;
return TMH_DB_execute_refresh_link (connection,
return TEH_DB_execute_refresh_link (connection,
&coin_pub);
}

View File

@ -32,7 +32,7 @@
* Handle a "/refresh/melt" request. Parses the request into the JSON
* components and then hands things of to #handle_refresh_melt_json()
* to validate the melted coins, the signature and execute the melt
* using TMH_DB_execute_refresh_melt().
* using TEH_DB_execute_refresh_melt().
*
* @param rh context of the handler
* @param connection the MHD connection to handle
@ -42,7 +42,7 @@
* @return MHD result code
*/
int
TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
TEH_REFRESH_handler_refresh_melt (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -54,7 +54,7 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
* the private transfer keys except for the cut-and-choose value
* returned from "/refresh/commit". This function parses the revealed
* keys and secrets and ultimately passes everything to
* #TMH_DB_execute_refresh_reveal() which will verify that the
* #TEH_DB_execute_refresh_reveal() which will verify that the
* revealed information is valid then returns the signed refreshed
* coins.
*
@ -66,7 +66,7 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
TEH_REFRESH_handler_refresh_reveal (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -84,7 +84,7 @@ TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_REFRESH_handler_refresh_link (struct TMH_RequestHandler *rh,
TEH_REFRESH_handler_refresh_link (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

View File

@ -68,14 +68,14 @@ verify_and_execute_refund (struct MHD_Connection *connection,
&refund->refund_fee) )
{
GNUNET_break_op (0);
return TMH_RESPONSE_reply_arg_invalid (connection,
return TEH_RESPONSE_reply_arg_invalid (connection,
"refund_fee");
}
if (-1 == TALER_amount_cmp (&refund->refund_amount,
&refund->refund_fee) )
{
GNUNET_break_op (0);
return TMH_RESPONSE_reply_signature_invalid (connection,
return TEH_RESPONSE_reply_signature_invalid (connection,
"refund_amount");
}
if (GNUNET_OK !=
@ -85,10 +85,10 @@ verify_and_execute_refund (struct MHD_Connection *connection,
&refund->merchant_pub.eddsa_pub))
{
TALER_LOG_WARNING ("Invalid signature on /refund request\n");
return TMH_RESPONSE_reply_signature_invalid (connection,
return TEH_RESPONSE_reply_signature_invalid (connection,
"merchant_sig");
}
return TMH_DB_execute_refund (connection,
return TEH_DB_execute_refund (connection,
refund);
}
@ -108,7 +108,7 @@ verify_and_execute_refund (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_REFUND_handler_refund (struct TMH_RequestHandler *rh,
TEH_REFUND_handler_refund (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -129,7 +129,7 @@ TMH_REFUND_handler_refund (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -138,7 +138,7 @@ TMH_REFUND_handler_refund (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
json_decref (json);

View File

@ -43,7 +43,7 @@
* @return MHD result code
*/
int
TMH_REFUND_handler_refund (struct TMH_RequestHandler *rh,
TEH_REFUND_handler_refund (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

View File

@ -43,7 +43,7 @@
* @return MHD result code
*/
int
TMH_RESERVE_handler_reserve_status (struct TMH_RequestHandler *rh,
TEH_RESERVE_handler_reserve_status (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -52,7 +52,7 @@ TMH_RESERVE_handler_reserve_status (struct TMH_RequestHandler *rh,
struct TALER_ReservePublicKeyP reserve_pub;
int res;
res = TMH_PARSE_mhd_request_arg_data (connection,
res = TEH_PARSE_mhd_request_arg_data (connection,
"reserve_pub",
&reserve_pub,
sizeof (struct TALER_ReservePublicKeyP));
@ -60,7 +60,7 @@ TMH_RESERVE_handler_reserve_status (struct TMH_RequestHandler *rh,
return MHD_NO; /* internal error */
if (GNUNET_NO == res)
return MHD_YES; /* parse error */
return TMH_DB_execute_reserve_status (connection,
return TEH_DB_execute_reserve_status (connection,
&reserve_pub);
}
@ -82,7 +82,7 @@ TMH_RESERVE_handler_reserve_status (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
TEH_RESERVE_handler_reserve_withdraw (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -99,7 +99,7 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
struct TALER_Amount fee_withdraw;
struct TALER_ReserveSignatureP signature;
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki;
struct TMH_KS_StateHandle *ks;
struct TEH_KS_StateHandle *ks;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_varsize ("coin_ev",
@ -114,7 +114,7 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -123,21 +123,21 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == root) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
root,
spec);
json_decref (root);
if (GNUNET_OK != res)
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
ks = TMH_KS_acquire ();
dki = TMH_KS_denomination_key_lookup (ks,
ks = TEH_KS_acquire ();
dki = TEH_KS_denomination_key_lookup (ks,
&denomination_pub,
TMH_KS_DKU_WITHDRAW);
TEH_KS_DKU_WITHDRAW);
if (NULL == dki)
{
GNUNET_JSON_parse_free (spec);
TMH_KS_release (ks);
return TMH_RESPONSE_reply_arg_unknown (connection,
TEH_KS_release (ks);
return TEH_RESPONSE_reply_arg_unknown (connection,
"denom_pub");
}
TALER_amount_ntoh (&amount,
@ -152,7 +152,7 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
&amount_with_fee);
TALER_amount_hton (&wsrd.withdraw_fee,
&fee_withdraw);
TMH_KS_release (ks);
TEH_KS_release (ks);
/* verify signature! */
wsrd.purpose.size = htonl (sizeof (struct TALER_WithdrawRequestPS));
wsrd.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW);
@ -170,10 +170,10 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
{
TALER_LOG_WARNING ("Client supplied invalid signature for /reserve/withdraw request\n");
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_signature_invalid (connection,
return TEH_RESPONSE_reply_signature_invalid (connection,
"reserve_sig");
}
res = TMH_DB_execute_reserve_withdraw (connection,
res = TEH_DB_execute_reserve_withdraw (connection,
&wsrd.reserve_pub,
&denomination_pub,
blinded_msg,

View File

@ -40,7 +40,7 @@
* @return MHD result code
*/
int
TMH_RESERVE_handler_reserve_status (struct TMH_RequestHandler *rh,
TEH_RESERVE_handler_reserve_status (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -64,7 +64,7 @@ TMH_RESERVE_handler_reserve_status (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh,
TEH_RESERVE_handler_reserve_withdraw (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

View File

@ -16,7 +16,7 @@
/**
* @file taler-exchange-httpd_responses.c
* @brief API for generating the various replies of the exchange; these
* functions are called TMH_RESPONSE_reply_ and they generate
* functions are called TEH_RESPONSE_reply_ and they generate
* and queue MHD response objects for a given connection.
* @author Florian Dold
* @author Benedikt Mueller
@ -37,9 +37,9 @@
* @param response response to modify
*/
void
TMH_RESPONSE_add_global_headers (struct MHD_Response *response)
TEH_RESPONSE_add_global_headers (struct MHD_Response *response)
{
if (TMH_exchange_connection_close)
if (TEH_exchange_connection_close)
GNUNET_break (MHD_YES ==
MHD_add_response_header (response,
MHD_HTTP_HEADER_CONNECTION,
@ -56,7 +56,7 @@ TMH_RESPONSE_add_global_headers (struct MHD_Response *response)
* @return MHD result code
*/
int
TMH_RESPONSE_reply_json (struct MHD_Connection *connection,
TEH_RESPONSE_reply_json (struct MHD_Connection *connection,
const json_t *json,
unsigned int response_code)
{
@ -75,7 +75,7 @@ TMH_RESPONSE_reply_json (struct MHD_Connection *connection,
GNUNET_break (0);
return MHD_NO;
}
TMH_RESPONSE_add_global_headers (resp);
TEH_RESPONSE_add_global_headers (resp);
(void) MHD_add_response_header (resp,
MHD_HTTP_HEADER_CONTENT_TYPE,
"application/json");
@ -98,7 +98,7 @@ TMH_RESPONSE_reply_json (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_json_pack (struct MHD_Connection *connection,
TEH_RESPONSE_reply_json_pack (struct MHD_Connection *connection,
unsigned int response_code,
const char *fmt,
...)
@ -120,7 +120,7 @@ TMH_RESPONSE_reply_json_pack (struct MHD_Connection *connection,
GNUNET_break (0);
return MHD_NO;
}
ret = TMH_RESPONSE_reply_json (connection,
ret = TEH_RESPONSE_reply_json (connection,
json,
response_code);
json_decref (json);
@ -136,10 +136,10 @@ TMH_RESPONSE_reply_json_pack (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection,
TEH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection,
const char *param_name)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
"{s:s, s:s}",
"error", "invalid parameter",
@ -157,10 +157,10 @@ TMH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_arg_unknown (struct MHD_Connection *connection,
TEH_RESPONSE_reply_arg_unknown (struct MHD_Connection *connection,
const char *param_name)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_NOT_FOUND,
"{s:s, s:s}",
"error", "unknown entity referenced",
@ -176,10 +176,10 @@ TMH_RESPONSE_reply_arg_unknown (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_signature_invalid (struct MHD_Connection *connection,
TEH_RESPONSE_reply_signature_invalid (struct MHD_Connection *connection,
const char *param_name)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_UNAUTHORIZED,
"{s:s, s:s}",
"error", "invalid signature",
@ -195,10 +195,10 @@ TMH_RESPONSE_reply_signature_invalid (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_arg_missing (struct MHD_Connection *connection,
TEH_RESPONSE_reply_arg_missing (struct MHD_Connection *connection,
const char *param_name)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
"{ s:s, s:s}",
"error", "missing parameter",
@ -214,10 +214,10 @@ TMH_RESPONSE_reply_arg_missing (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_permission_denied (struct MHD_Connection *connection,
TEH_RESPONSE_reply_permission_denied (struct MHD_Connection *connection,
const char *hint)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_FORBIDDEN,
"{s:s, s:s}",
"error", "permission denied",
@ -233,10 +233,10 @@ TMH_RESPONSE_reply_permission_denied (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_internal_error (struct MHD_Connection *connection,
TEH_RESPONSE_reply_internal_error (struct MHD_Connection *connection,
const char *hint)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
"{s:s, s:s}",
"error", "internal error",
@ -252,10 +252,10 @@ TMH_RESPONSE_reply_internal_error (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_external_error (struct MHD_Connection *connection,
TEH_RESPONSE_reply_external_error (struct MHD_Connection *connection,
const char *hint)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
"{s:s, s:s}",
"error", "client error",
@ -271,9 +271,9 @@ TMH_RESPONSE_reply_external_error (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_commit_error (struct MHD_Connection *connection)
TEH_RESPONSE_reply_commit_error (struct MHD_Connection *connection)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
"{s:s}",
"error", "commit failure");
@ -288,9 +288,9 @@ TMH_RESPONSE_reply_commit_error (struct MHD_Connection *connection)
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_internal_db_error (struct MHD_Connection *connection)
TEH_RESPONSE_reply_internal_db_error (struct MHD_Connection *connection)
{
return TMH_RESPONSE_reply_internal_error (connection,
return TEH_RESPONSE_reply_internal_error (connection,
"Failed to connect to database");
}
@ -302,7 +302,7 @@ TMH_RESPONSE_reply_internal_db_error (struct MHD_Connection *connection)
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_request_too_large (struct MHD_Connection *connection)
TEH_RESPONSE_reply_request_too_large (struct MHD_Connection *connection)
{
struct MHD_Response *resp;
int ret;
@ -312,7 +312,7 @@ TMH_RESPONSE_reply_request_too_large (struct MHD_Connection *connection)
MHD_RESPMEM_PERSISTENT);
if (NULL == resp)
return MHD_NO;
TMH_RESPONSE_add_global_headers (resp);
TEH_RESPONSE_add_global_headers (resp);
ret = MHD_queue_response (connection,
MHD_HTTP_REQUEST_ENTITY_TOO_LARGE,
resp);
@ -328,9 +328,9 @@ TMH_RESPONSE_reply_request_too_large (struct MHD_Connection *connection)
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection)
TEH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
"{s:s}",
"error",
@ -358,7 +358,7 @@ TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection)
* @return MHD result code
*/
int
TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct GNUNET_HashCode *h_wire,
const struct GNUNET_HashCode *h_contract,
@ -383,10 +383,10 @@ TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
amount_without_fee);
dc.coin_pub = *coin_pub;
dc.merchant = *merchant;
TMH_KS_sign (&dc.purpose,
TEH_KS_sign (&dc.purpose,
&pub,
&sig);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:s, s:o, s:o}",
"status", "DEPOSIT_OK",
@ -549,15 +549,15 @@ compile_transaction_history (const struct TALER_EXCHANGEDB_TransactionList *tl)
* @return MHD result code
*/
int
TMH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection,
TEH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_TransactionList *tl)
{
json_t *history;
history = compile_transaction_history (tl);
if (NULL == history)
return TMH_RESPONSE_reply_internal_db_error (connection);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_internal_db_error (connection);
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_FORBIDDEN,
"{s:s, s:o}",
"error", "insufficient funds",
@ -691,10 +691,10 @@ compile_reserve_history (const struct TALER_EXCHANGEDB_ReserveHistory *rh,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_refund_conflict (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refund_conflict (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_TransactionList *tl)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_CONFLICT,
"{s:s, s:o}",
"status", "conflicting refund",
@ -711,10 +711,10 @@ TMH_RESPONSE_reply_refund_conflict (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_refund_failure (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refund_failure (struct MHD_Connection *connection,
unsigned int response_code)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
response_code,
"{s:s}",
"error",
@ -730,7 +730,7 @@ TMH_RESPONSE_reply_refund_failure (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_refund_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refund_success (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_Refund *refund)
{
struct TALER_RefundConfirmationPS rc;
@ -748,10 +748,10 @@ TMH_RESPONSE_reply_refund_success (struct MHD_Connection *connection,
&refund->refund_amount);
TALER_amount_hton (&rc.refund_fee,
&refund->refund_fee);
TMH_KS_sign (&rc.purpose,
TEH_KS_sign (&rc.purpose,
&pub,
&sig);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:s, s:o, s:o}",
"status", "REFUND_OK",
@ -768,7 +768,7 @@ TMH_RESPONSE_reply_refund_success (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_ReserveHistory *rh)
{
json_t *json_balance;
@ -778,10 +778,10 @@ TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
json_history = compile_reserve_history (rh,
&balance);
if (NULL == json_history)
return TMH_RESPONSE_reply_internal_error (connection,
return TEH_RESPONSE_reply_internal_error (connection,
"balance calculation failure");
json_balance = TALER_JSON_from_amount (&balance);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o, s:o}",
"balance", json_balance,
@ -799,7 +799,7 @@ TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *connection,
TEH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_ReserveHistory *rh)
{
json_t *json_balance;
@ -809,10 +809,10 @@ TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *c
json_history = compile_reserve_history (rh,
&balance);
if (NULL == json_history)
return TMH_RESPONSE_reply_internal_error (connection,
return TEH_RESPONSE_reply_internal_error (connection,
"balance calculation failure");
json_balance = TALER_JSON_from_amount (&balance);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_PAYMENT_REQUIRED,
"{s:s, s:o, s:o}",
"error", "Insufficient funds",
@ -829,13 +829,13 @@ TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *c
* @return MHD result code
*/
int
TMH_RESPONSE_reply_reserve_withdraw_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_reserve_withdraw_success (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable)
{
json_t *sig_json;
sig_json = GNUNET_JSON_from_rsa_signature (collectable->sig.rsa_signature);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"ev_sig", sig_json);
@ -858,7 +858,7 @@ TMH_RESPONSE_reply_reserve_withdraw_success (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_Amount coin_value,
struct TALER_EXCHANGEDB_TransactionList *tl,
@ -869,8 +869,8 @@ TMH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *conne
history = compile_transaction_history (tl);
if (NULL == history)
return TMH_RESPONSE_reply_internal_db_error (connection);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_internal_db_error (connection);
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_FORBIDDEN,
"{s:s, s:o, s:o, s:o, s:o, s:o}",
"error",
@ -897,7 +897,7 @@ TMH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *conne
* @return a MHD status code
*/
int
TMH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
const struct GNUNET_HashCode *session_hash,
uint16_t noreveal_index)
{
@ -911,12 +911,12 @@ TMH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
body.session_hash = *session_hash;
body.noreveal_index = htons (noreveal_index);
body.reserved = htons (0);
TMH_KS_sign (&body.purpose,
TEH_KS_sign (&body.purpose,
&pub,
&sig);
sig_json = GNUNET_JSON_from_data_auto (&sig);
GNUNET_assert (NULL != sig_json);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:i, s:o, s:o}",
"noreveal_index", (int) noreveal_index,
@ -934,7 +934,7 @@ TMH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
unsigned int num_newcoins,
const struct TALER_DenominationSignature *sigs)
{
@ -959,7 +959,7 @@ TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
json_object_set_new (root,
"ev_sigs",
list);
ret = TMH_RESPONSE_reply_json (connection,
ret = TEH_RESPONSE_reply_json (connection,
root,
MHD_HTTP_OK);
json_decref (root);
@ -979,7 +979,7 @@ TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_RefreshSession *session,
const struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins,
const struct TALER_DenominationPublicKey *denom_pubs,
@ -1009,7 +1009,7 @@ TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
json_array_append_new (info_commit_k,
cc_json));
}
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_CONFLICT,
"{s:s, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:i}",
"error", "commitment violation",
@ -1034,9 +1034,9 @@ TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
unsigned int num_sessions,
const struct TMH_RESPONSE_LinkSessionInfo *sessions)
const struct TEH_RESPONSE_LinkSessionInfo *sessions)
{
json_t *root;
json_t *mlist;
@ -1075,7 +1075,7 @@ TMH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
json_array_append_new (mlist,
root));
}
res = TMH_RESPONSE_reply_json (connection,
res = TEH_RESPONSE_reply_json (connection,
mlist,
MHD_HTTP_OK);
json_decref (mlist);
@ -1092,9 +1092,9 @@ TMH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_transaction_unknown (struct MHD_Connection *connection)
TEH_RESPONSE_reply_transaction_unknown (struct MHD_Connection *connection)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_NOT_FOUND,
"{s:s}",
"error", "Deposit unknown");
@ -1110,10 +1110,10 @@ TMH_RESPONSE_reply_transaction_unknown (struct MHD_Connection *connection)
* @return MHD result code
*/
int
TMH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
TEH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
struct GNUNET_TIME_Absolute planned_exec_time)
{
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_ACCEPTED,
"{s:o}",
"execution_time", GNUNET_JSON_from_time_abs (planned_exec_time));
@ -1136,7 +1136,7 @@ TMH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
TEH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
const struct GNUNET_HashCode *h_contract,
const struct GNUNET_HashCode *h_wire,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
@ -1159,10 +1159,10 @@ TMH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
cw.execution_time = GNUNET_TIME_absolute_hton (exec_time);
TALER_amount_hton (&cw.coin_contribution,
coin_contribution);
TMH_KS_sign (&cw.purpose,
TEH_KS_sign (&cw.purpose,
&pub,
&sig);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o, s:o, s:o, s:o, s:o}",
"wtid", GNUNET_JSON_from_data_auto (wtid),
@ -1186,14 +1186,14 @@ TMH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_track_transfer_details (struct MHD_Connection *connection,
TEH_RESPONSE_reply_track_transfer_details (struct MHD_Connection *connection,
const struct TALER_Amount *total,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct GNUNET_HashCode *h_wire,
struct GNUNET_TIME_Absolute exec_time,
const struct TMH_TrackTransferDetail *wdd_head)
const struct TEH_TrackTransferDetail *wdd_head)
{
const struct TMH_TrackTransferDetail *wdd_pos;
const struct TEH_TrackTransferDetail *wdd_pos;
json_t *deposits;
struct TALER_WireDepositDetailP dd;
struct GNUNET_HashContext *hash_context;
@ -1234,10 +1234,10 @@ TMH_RESPONSE_reply_track_transfer_details (struct MHD_Connection *connection,
wdp.h_wire = *h_wire;
GNUNET_CRYPTO_hash_context_finish (hash_context,
&wdp.h_details);
TMH_KS_sign (&wdp.purpose,
TEH_KS_sign (&wdp.purpose,
&pub,
&sig);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o, s:o, s:o, s:o, s:o, s:o, s:o}",
"total", TALER_JSON_from_amount (total),

View File

@ -17,7 +17,7 @@
/**
* @file taler-exchange-httpd_responses.h
* @brief API for generating the various replies of the exchange; these
* functions are called TMH_RESPONSE_reply_ and they generate
* functions are called TEH_RESPONSE_reply_ and they generate
* and queue MHD response objects for a given connection.
* @author Florian Dold
* @author Benedikt Mueller
@ -40,7 +40,7 @@
* @param response response to modify
*/
void
TMH_RESPONSE_add_global_headers (struct MHD_Response *response);
TEH_RESPONSE_add_global_headers (struct MHD_Response *response);
/**
@ -52,7 +52,7 @@ TMH_RESPONSE_add_global_headers (struct MHD_Response *response);
* @return MHD result code
*/
int
TMH_RESPONSE_reply_json (struct MHD_Connection *connection,
TEH_RESPONSE_reply_json (struct MHD_Connection *connection,
const json_t *json,
unsigned int response_code);
@ -68,7 +68,7 @@ TMH_RESPONSE_reply_json (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_json_pack (struct MHD_Connection *connection,
TEH_RESPONSE_reply_json_pack (struct MHD_Connection *connection,
unsigned int response_code,
const char *fmt,
...);
@ -82,7 +82,7 @@ TMH_RESPONSE_reply_json_pack (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_signature_invalid (struct MHD_Connection *connection,
TEH_RESPONSE_reply_signature_invalid (struct MHD_Connection *connection,
const char *param_name);
@ -94,7 +94,7 @@ TMH_RESPONSE_reply_signature_invalid (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection,
TEH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection,
const char *param_name);
@ -108,7 +108,7 @@ TMH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_arg_unknown (struct MHD_Connection *connection,
TEH_RESPONSE_reply_arg_unknown (struct MHD_Connection *connection,
const char *param_name);
@ -120,7 +120,7 @@ TMH_RESPONSE_reply_arg_unknown (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_arg_missing (struct MHD_Connection *connection,
TEH_RESPONSE_reply_arg_missing (struct MHD_Connection *connection,
const char *param_name);
@ -132,7 +132,7 @@ TMH_RESPONSE_reply_arg_missing (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_permission_denied (struct MHD_Connection *connection,
TEH_RESPONSE_reply_permission_denied (struct MHD_Connection *connection,
const char *hint);
@ -144,7 +144,7 @@ TMH_RESPONSE_reply_permission_denied (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_internal_error (struct MHD_Connection *connection,
TEH_RESPONSE_reply_internal_error (struct MHD_Connection *connection,
const char *hint);
@ -156,7 +156,7 @@ TMH_RESPONSE_reply_internal_error (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_external_error (struct MHD_Connection *connection,
TEH_RESPONSE_reply_external_error (struct MHD_Connection *connection,
const char *hint);
@ -168,7 +168,7 @@ TMH_RESPONSE_reply_external_error (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_commit_error (struct MHD_Connection *connection);
TEH_RESPONSE_reply_commit_error (struct MHD_Connection *connection);
/**
@ -179,7 +179,7 @@ TMH_RESPONSE_reply_commit_error (struct MHD_Connection *connection);
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_internal_db_error (struct MHD_Connection *connection);
TEH_RESPONSE_reply_internal_db_error (struct MHD_Connection *connection);
/**
@ -189,7 +189,7 @@ TMH_RESPONSE_reply_internal_db_error (struct MHD_Connection *connection);
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_request_too_large (struct MHD_Connection *connection);
TEH_RESPONSE_reply_request_too_large (struct MHD_Connection *connection);
/**
@ -199,7 +199,7 @@ TMH_RESPONSE_reply_request_too_large (struct MHD_Connection *connection);
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection);
TEH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection);
/**
@ -222,7 +222,7 @@ TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection);
* @return MHD result code
*/
int
TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct GNUNET_HashCode *h_wire,
const struct GNUNET_HashCode *h_contract,
@ -243,7 +243,7 @@ TMH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection,
TEH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_TransactionList *tl);
@ -256,7 +256,7 @@ TMH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection
* @return MHD result code
*/
int
TMH_RESPONSE_reply_refund_conflict (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refund_conflict (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_TransactionList *tl);
@ -269,7 +269,7 @@ TMH_RESPONSE_reply_refund_conflict (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_refund_failure (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refund_failure (struct MHD_Connection *connection,
unsigned int response_code);
@ -281,7 +281,7 @@ TMH_RESPONSE_reply_refund_failure (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_refund_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refund_success (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_Refund *refund);
@ -294,7 +294,7 @@ TMH_RESPONSE_reply_refund_success (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_transaction_unknown (struct MHD_Connection *connection);
TEH_RESPONSE_reply_transaction_unknown (struct MHD_Connection *connection);
/**
@ -306,7 +306,7 @@ TMH_RESPONSE_reply_transaction_unknown (struct MHD_Connection *connection);
* @return MHD result code
*/
int
TMH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
TEH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
struct GNUNET_TIME_Absolute planned_exec_time);
@ -325,7 +325,7 @@ TMH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
TEH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
const struct GNUNET_HashCode *h_contract,
const struct GNUNET_HashCode *h_wire,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
@ -338,18 +338,18 @@ TMH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
/**
* Detail for /wire/deposit response.
*/
struct TMH_TrackTransferDetail
struct TEH_TrackTransferDetail
{
/**
* We keep deposit details in a DLL.
*/
struct TMH_TrackTransferDetail *next;
struct TEH_TrackTransferDetail *next;
/**
* We keep deposit details in a DLL.
*/
struct TMH_TrackTransferDetail *prev;
struct TEH_TrackTransferDetail *prev;
/**
* Hash of the contract
@ -391,12 +391,12 @@ struct TMH_TrackTransferDetail
* @return MHD result code
*/
int
TMH_RESPONSE_reply_track_transfer_details (struct MHD_Connection *connection,
TEH_RESPONSE_reply_track_transfer_details (struct MHD_Connection *connection,
const struct TALER_Amount *total,
const struct TALER_MerchantPublicKeyP *merchant_pub,
const struct GNUNET_HashCode *h_wire,
struct GNUNET_TIME_Absolute exec_time,
const struct TMH_TrackTransferDetail *wdd_head);
const struct TEH_TrackTransferDetail *wdd_head);
/**
@ -407,7 +407,7 @@ TMH_RESPONSE_reply_track_transfer_details (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_ReserveHistory *rh);
@ -421,7 +421,7 @@ TMH_RESPONSE_reply_reserve_status_success (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *connection,
TEH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_ReserveHistory *rh);
@ -433,7 +433,7 @@ TMH_RESPONSE_reply_reserve_withdraw_insufficient_funds (struct MHD_Connection *c
* @return MHD result code
*/
int
TMH_RESPONSE_reply_reserve_withdraw_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_reserve_withdraw_success (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_CollectableBlindcoin *collectable);
@ -446,7 +446,7 @@ TMH_RESPONSE_reply_reserve_withdraw_success (struct MHD_Connection *connection,
* @return a MHD status code
*/
int
TMH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
const struct GNUNET_HashCode *session_hash,
uint16_t noreveal_index);
@ -467,7 +467,7 @@ TMH_RESPONSE_reply_refresh_melt_success (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *connection,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_Amount coin_value,
struct TALER_EXCHANGEDB_TransactionList *tl,
@ -484,7 +484,7 @@ TMH_RESPONSE_reply_refresh_melt_insufficient_funds (struct MHD_Connection *conne
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
unsigned int num_newcoins,
const struct TALER_DenominationSignature *sigs);
@ -501,7 +501,7 @@ TMH_RESPONSE_reply_refresh_reveal_success (struct MHD_Connection *connection,
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
const struct TALER_EXCHANGEDB_RefreshSession *session,
const struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins,
const struct TALER_DenominationPublicKey *denom_pubs,
@ -511,7 +511,7 @@ TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
/**
* @brief Information for each session a coin was melted into.
*/
struct TMH_RESPONSE_LinkSessionInfo
struct TEH_RESPONSE_LinkSessionInfo
{
/**
* Transfer public key of the coin.
@ -536,9 +536,9 @@ struct TMH_RESPONSE_LinkSessionInfo
* @return a MHD result code
*/
int
TMH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
TEH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
unsigned int num_sessions,
const struct TMH_RESPONSE_LinkSessionInfo *sessions);
const struct TEH_RESPONSE_LinkSessionInfo *sessions);
#endif

View File

@ -52,7 +52,7 @@ static struct GNUNET_CRYPTO_RsaPrivateKey *rsa_pk;
* @return MHD result code
*/
int
TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_base32 (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -68,7 +68,7 @@ TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -77,7 +77,7 @@ TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
if (GNUNET_YES != res)
@ -87,7 +87,7 @@ TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
&hc);
GNUNET_JSON_parse_free (spec);
json_decref (json);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"output",
@ -113,7 +113,7 @@ TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_encrypt (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -133,7 +133,7 @@ TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
};
char *out;
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -142,7 +142,7 @@ TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
json_decref (json);
@ -169,7 +169,7 @@ TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
in_ptr_size);
GNUNET_free (out);
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"output",
@ -195,7 +195,7 @@ TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_hkdf (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -211,7 +211,7 @@ TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -220,7 +220,7 @@ TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
json_decref (json);
@ -233,7 +233,7 @@ TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
NULL, 0);
GNUNET_JSON_parse_free (spec);
json = GNUNET_JSON_from_data_auto (&hc);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"output",
@ -256,7 +256,7 @@ TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_ecdhe (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -273,7 +273,7 @@ TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -282,7 +282,7 @@ TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
json_decref (json);
@ -294,11 +294,11 @@ TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
&hc))
{
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_internal_error (connection,
return TEH_RESPONSE_reply_internal_error (connection,
"Failed to perform ECDH");
}
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"ecdh_hash",
@ -322,7 +322,7 @@ TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_eddsa (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -340,7 +340,7 @@ TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
};
struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -349,7 +349,7 @@ TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
json_decref (json);
@ -364,7 +364,7 @@ TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
&pub))
{
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_signature_invalid (connection,
return TEH_RESPONSE_reply_signature_invalid (connection,
"eddsa_sig");
}
GNUNET_JSON_parse_free (spec);
@ -376,13 +376,13 @@ TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
&sig))
{
GNUNET_free (pk);
return TMH_RESPONSE_reply_internal_error (connection,
return TEH_RESPONSE_reply_internal_error (connection,
"Failed to EdDSA-sign");
}
GNUNET_CRYPTO_eddsa_key_get_public (pk,
&pub);
GNUNET_free (pk);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o, s:o}",
"eddsa_pub",
@ -404,7 +404,7 @@ TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_rsa_get (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_rsa_get (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -418,17 +418,17 @@ TMH_TEST_handler_test_rsa_get (struct TMH_RequestHandler *rh,
if (NULL == rsa_pk)
{
GNUNET_break (0);
return TMH_RESPONSE_reply_internal_error (connection,
return TEH_RESPONSE_reply_internal_error (connection,
"Failed to create RSA key");
}
pub = GNUNET_CRYPTO_rsa_private_key_get_public (rsa_pk);
if (NULL == pub)
{
GNUNET_break (0);
return TMH_RESPONSE_reply_internal_error (connection,
return TEH_RESPONSE_reply_internal_error (connection,
"Failed to get public RSA key");
}
res = TMH_RESPONSE_reply_json_pack (connection,
res = TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"rsa_pub",
@ -451,7 +451,7 @@ TMH_TEST_handler_test_rsa_get (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_rsa_sign (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -467,7 +467,7 @@ TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -476,7 +476,7 @@ TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
json_decref (json);
@ -488,7 +488,7 @@ TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
{
GNUNET_break (0);
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_internal_error (connection,
return TEH_RESPONSE_reply_internal_error (connection,
"Failed to create RSA key");
}
sig = GNUNET_CRYPTO_rsa_sign_blinded (rsa_pk,
@ -498,11 +498,11 @@ TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
{
GNUNET_break (0);
GNUNET_JSON_parse_free (spec);
return TMH_RESPONSE_reply_internal_error (connection,
return TEH_RESPONSE_reply_internal_error (connection,
"Failed to RSA-sign");
}
GNUNET_JSON_parse_free (spec);
res = TMH_RESPONSE_reply_json_pack (connection,
res = TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"rsa_blind_sig",
@ -527,7 +527,7 @@ TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_transfer (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -544,7 +544,7 @@ TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
};
struct TALER_TransferSecretP secret;
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -553,7 +553,7 @@ TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
json_decref (json);
@ -562,7 +562,7 @@ TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
TALER_link_reveal_transfer_secret (&trans_priv,
&coin_pub,
&secret);
return TMH_RESPONSE_reply_json_pack (connection,
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:o}",
"secret",
@ -581,7 +581,7 @@ TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -590,7 +590,7 @@ TMH_TEST_handler_test (struct TMH_RequestHandler *rh,
json_t *json;
int res;
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,

View File

@ -42,7 +42,7 @@
* @return MHD result code
*/
int
TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_base32 (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -67,7 +67,7 @@ TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_encrypt (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -92,7 +92,7 @@ TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_hkdf (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -114,7 +114,7 @@ TMH_TEST_handler_test_hkdf (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_ecdhe (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -137,7 +137,7 @@ TMH_TEST_handler_test_ecdhe (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_eddsa (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -156,7 +156,7 @@ TMH_TEST_handler_test_eddsa (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_rsa_get (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_rsa_get (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -176,7 +176,7 @@ TMH_TEST_handler_test_rsa_get (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_rsa_sign (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -198,7 +198,7 @@ TMH_TEST_handler_test_rsa_sign (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test_transfer (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -216,7 +216,7 @@ TMH_TEST_handler_test_transfer (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TEST_handler_test (struct TMH_RequestHandler *rh,
TEH_TEST_handler_test (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

View File

@ -40,7 +40,7 @@
* @return MHD result code
*/
int
TMH_TRACKING_handler_track_transfer (struct TMH_RequestHandler *rh,
TEH_TRACKING_handler_track_transfer (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -49,7 +49,7 @@ TMH_TRACKING_handler_track_transfer (struct TMH_RequestHandler *rh,
struct TALER_WireTransferIdentifierRawP wtid;
int res;
res = TMH_PARSE_mhd_request_arg_data (connection,
res = TEH_PARSE_mhd_request_arg_data (connection,
"wtid",
&wtid,
sizeof (struct TALER_WireTransferIdentifierRawP));
@ -57,7 +57,7 @@ TMH_TRACKING_handler_track_transfer (struct TMH_RequestHandler *rh,
return MHD_NO; /* internal error */
if (GNUNET_NO == res)
return MHD_YES; /* parse error */
return TMH_DB_execute_track_transfer (connection,
return TEH_DB_execute_track_transfer (connection,
&wtid);
}
@ -87,10 +87,10 @@ check_and_handle_track_transaction_request (struct MHD_Connection *connection,
&merchant_pub->eddsa_pub))
{
GNUNET_break_op (0);
return TMH_RESPONSE_reply_signature_invalid (connection,
return TEH_RESPONSE_reply_signature_invalid (connection,
"merchant_sig");
}
return TMH_DB_execute_track_transaction (connection,
return TEH_DB_execute_track_transaction (connection,
&tps->h_contract,
&tps->h_wire,
&tps->coin_pub,
@ -110,7 +110,7 @@ check_and_handle_track_transaction_request (struct MHD_Connection *connection,
* @return MHD result code
*/
int
TMH_TRACKING_handler_track_transaction (struct TMH_RequestHandler *rh,
TEH_TRACKING_handler_track_transaction (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -131,7 +131,7 @@ TMH_TRACKING_handler_track_transaction (struct TMH_RequestHandler *rh,
GNUNET_JSON_spec_end ()
};
res = TMH_PARSE_post_json (connection,
res = TEH_PARSE_post_json (connection,
connection_cls,
upload_data,
upload_data_size,
@ -140,7 +140,7 @@ TMH_TRACKING_handler_track_transaction (struct TMH_RequestHandler *rh,
return MHD_NO;
if ( (GNUNET_NO == res) || (NULL == json) )
return MHD_YES;
res = TMH_PARSE_json_data (connection,
res = TEH_PARSE_json_data (connection,
json,
spec);
if (GNUNET_OK != res)

View File

@ -37,7 +37,7 @@
* @return MHD result code
*/
int
TMH_TRACKING_handler_track_transfer (struct TMH_RequestHandler *rh,
TEH_TRACKING_handler_track_transfer (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
@ -55,7 +55,7 @@ TMH_TRACKING_handler_track_transfer (struct TMH_RequestHandler *rh,
* @return MHD result code
*/
int
TMH_TRACKING_handler_track_transaction (struct TMH_RequestHandler *rh,
TEH_TRACKING_handler_track_transaction (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,

View File

@ -72,7 +72,7 @@ static struct Plugin *wire_tail;
* @return #GNUNET_OK on success
*/
int
TMH_VALIDATION_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
TEH_VALIDATION_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct Plugin *p;
char *wireformats;
@ -106,7 +106,7 @@ TMH_VALIDATION_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to load plugin %s\n",
token);
TMH_VALIDATION_done ();
TEH_VALIDATION_done ();
return GNUNET_SYSERR;
}
GNUNET_CONTAINER_DLL_insert (wire_head,
@ -122,7 +122,7 @@ TMH_VALIDATION_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
* Shutdown validation subsystem.
*/
void
TMH_VALIDATION_done ()
TEH_VALIDATION_done ()
{
struct Plugin *p;
@ -147,7 +147,7 @@ TMH_VALIDATION_done ()
* @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
*/
int
TMH_json_validate_wireformat (const json_t *wire,
TEH_json_validate_wireformat (const json_t *wire,
int ours)
{
const char *stype;
@ -168,7 +168,7 @@ TMH_json_validate_wireformat (const json_t *wire,
return p->plugin->wire_validate (p->plugin->cls,
wire,
(GNUNET_YES == ours)
? &TMH_master_public_key
? &TEH_master_public_key
: NULL);
return GNUNET_NO;
}
@ -183,7 +183,7 @@ TMH_json_validate_wireformat (const json_t *wire,
* @return JSON array with the supported validation methods
*/
json_t *
TMH_VALIDATION_get_wire_methods (const char *prefix)
TEH_VALIDATION_get_wire_methods (const char *prefix)
{
json_t *methods;
json_t *method;
@ -203,7 +203,7 @@ TMH_VALIDATION_get_wire_methods (const char *prefix)
cfg,
account_name);
if (GNUNET_YES !=
TMH_json_validate_wireformat (method,
TEH_json_validate_wireformat (method,
GNUNET_YES))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,

View File

@ -32,14 +32,14 @@
* @return #GNUNET_OK on success
*/
int
TMH_VALIDATION_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
TEH_VALIDATION_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
* Shutdown validation subsystem.
*/
void
TMH_VALIDATION_done (void);
TEH_VALIDATION_done (void);
/**
@ -51,7 +51,7 @@ TMH_VALIDATION_done (void);
* @return #GNUNET_YES if correctly formatted; #GNUNET_NO if not
*/
int
TMH_json_validate_wireformat (const json_t *wire,
TEH_json_validate_wireformat (const json_t *wire,
int ours);
@ -64,7 +64,7 @@ TMH_json_validate_wireformat (const json_t *wire,
* @return JSON array with the supported validation methods
*/
json_t *
TMH_VALIDATION_get_wire_methods (const char *prefix);
TEH_VALIDATION_get_wire_methods (const char *prefix);
#endif

View File

@ -43,16 +43,16 @@ static json_t *wire_methods;
* @return MHD result code
*/
int
TMH_WIRE_handler_wire (struct TMH_RequestHandler *rh,
TEH_WIRE_handler_wire (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,
size_t *upload_data_size)
{
if (NULL == wire_methods)
wire_methods = TMH_VALIDATION_get_wire_methods ("exchange-wire-incoming");
wire_methods = TEH_VALIDATION_get_wire_methods ("exchange-wire-incoming");
return TMH_RESPONSE_reply_json (connection,
return TEH_RESPONSE_reply_json (connection,
wire_methods,
MHD_HTTP_OK);
}

View File

@ -37,7 +37,7 @@
* @return MHD result code
*/
int
TMH_WIRE_handler_wire (struct TMH_RequestHandler *rh,
TEH_WIRE_handler_wire (struct TEH_RequestHandler *rh,
struct MHD_Connection *connection,
void **connection_cls,
const char *upload_data,