From 15bec8f464dc6afce88e82bdce1b76ce5f372891 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 12 Apr 2015 22:52:54 +0200 Subject: make wireformat configurable (#3624) --- src/mint/taler-mint-httpd.c | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/mint/taler-mint-httpd.c b/src/mint/taler-mint-httpd.c index 0cc9945ed..43c2fa557 100644 --- a/src/mint/taler-mint-httpd.c +++ b/src/mint/taler-mint-httpd.c @@ -60,7 +60,7 @@ struct GNUNET_CRYPTO_EddsaPublicKey TMH_master_public_key; /** * In which format does this MINT expect wiring instructions? */ -char *TMH_expected_wire_format = "sepa"; +char *TMH_expected_wire_format; /** * Our DB plugin. @@ -72,11 +72,6 @@ struct TALER_MINTDB_Plugin *TMH_plugin; */ static struct MHD_Daemon *mydaemon; -/** - * The kappa value for refreshing. - */ -static unsigned int refresh_security_parameter; - /** * Port to run the daemon on. */ @@ -245,7 +240,6 @@ static int mint_serve_process_config (const char *mint_directory) { unsigned long long port; - unsigned long long kappa; char *TMH_master_public_key_str; cfg = TALER_config_load (mint_directory); @@ -273,6 +267,16 @@ mint_serve_process_config (const char *mint_directory) (unsigned int) TALER_CURRENCY_LEN); return GNUNET_NO; } + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_string (cfg, + "mint", + "wireformat", + &TMH_expected_wire_format)) + { + fprintf (stderr, + "No wireformat given in mint configuration."); + return GNUNET_NO; + } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "mint", @@ -305,32 +309,24 @@ mint_serve_process_config (const char *mint_directory) if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, - "mint", "port", + "mint", + "port", &port)) { fprintf (stderr, - "invalid configuration: mint.port\n"); + "Missing or invalid configuration for the port of the mint\n"); return GNUNET_NO; } - if ((port == 0) || (port > UINT16_MAX)) - { - fprintf (stderr, - "invalid configuration (value out of range): mint.port\n"); - return GNUNET_NO; - } - serve_port = port; - - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_number (cfg, - "mint", "refresh_security_parameter", - &kappa)) + if ( (0 == port) || + (port > UINT16_MAX) ) { fprintf (stderr, - "invalid configuration: mint.refresh_security_parameter\n"); + "Invalid configuration (value out of range): %llu is not a valid port\n", + port); return GNUNET_NO; } - refresh_security_parameter = kappa; + serve_port = (uint16_t) port; return GNUNET_OK; } -- cgit v1.2.3