summaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mint/taler-mint-httpd.c')
-rw-r--r--src/mint/taler-mint-httpd.c45
1 files changed, 8 insertions, 37 deletions
diff --git a/src/mint/taler-mint-httpd.c b/src/mint/taler-mint-httpd.c
index 26a440c95..5d6aa0589 100644
--- a/src/mint/taler-mint-httpd.c
+++ b/src/mint/taler-mint-httpd.c
@@ -39,6 +39,7 @@
#include "taler-mint-httpd_test.h"
#endif
#include "taler_mintdb_plugin.h"
+#include "taler-mint-httpd_validation.h"
/**
* Which currency is used by this mint?
@@ -67,13 +68,6 @@ struct GNUNET_CONFIGURATION_Handle *cfg;
struct GNUNET_CRYPTO_EddsaPublicKey TMH_master_public_key;
/**
- * In which format does this MINT expect wiring instructions?
- * NULL-terminated array of 0-terminated wire format types,
- * suitable for passing to #TALER_json_validate_wireformat().
- */
-const char **TMH_expected_wire_formats;
-
-/**
* Our DB plugin.
*/
struct TALER_MINTDB_Plugin *TMH_plugin;
@@ -384,9 +378,6 @@ mint_serve_process_config (const char *mint_directory)
{
unsigned long long port;
char *TMH_master_public_key_str;
- char *wireformats;
- const char *token;
- unsigned int len;
cfg = TALER_config_load (mint_directory);
if (NULL == cfg)
@@ -414,35 +405,9 @@ mint_serve_process_config (const char *mint_directory)
(unsigned int) TALER_CURRENCY_LEN);
return GNUNET_SYSERR;
}
- /* Find out list of supported wire formats */
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
- "wireformat",
- &wireformats))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "mint",
- "wireformat");
+ TMH_VALIDATION_init (cfg))
return GNUNET_SYSERR;
- }
- /* build NULL-terminated array of TMH_expected_wire_formats */
- TMH_expected_wire_formats = GNUNET_new_array (1,
- const char *);
- len = 1;
- for (token = strtok (wireformats,
- " ");
- NULL != token;
- token = strtok (NULL,
- " "))
- {
- /* Grow by 1, appending NULL-terminator */
- GNUNET_array_append (TMH_expected_wire_formats,
- len,
- NULL);
- TMH_expected_wire_formats[len - 2] = GNUNET_strdup (token);
- }
- GNUNET_free (wireformats);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
@@ -453,6 +418,7 @@ mint_serve_process_config (const char *mint_directory)
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"mint",
"master_public_key");
+ TMH_VALIDATION_done ();
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
@@ -463,6 +429,7 @@ mint_serve_process_config (const char *mint_directory)
fprintf (stderr,
"Invalid master public key given in mint configuration.");
GNUNET_free (TMH_master_public_key_str);
+ TMH_VALIDATION_done ();
return GNUNET_SYSERR;
}
GNUNET_free (TMH_master_public_key_str);
@@ -472,6 +439,7 @@ mint_serve_process_config (const char *mint_directory)
{
fprintf (stderr,
"Failed to initialize DB subsystem\n");
+ TMH_VALIDATION_done ();
return GNUNET_SYSERR;
}
if (GNUNET_YES ==
@@ -496,6 +464,7 @@ mint_serve_process_config (const char *mint_directory)
"mint",
"port",
"port number required");
+ TMH_VALIDATION_done ();
return GNUNET_SYSERR;
}
@@ -505,6 +474,7 @@ mint_serve_process_config (const char *mint_directory)
fprintf (stderr,
"Invalid configuration (value out of range): %llu is not a valid port\n",
port);
+ TMH_VALIDATION_done ();
return GNUNET_SYSERR;
}
serve_port = (uint16_t) port;
@@ -772,6 +742,7 @@ main (int argc,
session);
}
TALER_MINTDB_plugin_unload (TMH_plugin);
+ TMH_VALIDATION_done ();
return (GNUNET_SYSERR == ret) ? 1 : 0;
}