aboutsummaryrefslogtreecommitdiff
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.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/mint/taler-mint-httpd.c b/src/mint/taler-mint-httpd.c
index cde603168..fb5ce4405 100644
--- a/src/mint/taler-mint-httpd.c
+++ b/src/mint/taler-mint-httpd.c
@@ -56,6 +56,11 @@ struct GNUNET_CONFIGURATION_Handle *cfg;
56struct GNUNET_CRYPTO_EddsaPublicKey master_pub; 56struct GNUNET_CRYPTO_EddsaPublicKey master_pub;
57 57
58/** 58/**
59 * Private key of the mint we use to sign messages.
60 */
61struct GNUNET_CRYPTO_EddsaPrivateKey mint_priv;
62
63/**
59 * The HTTP Daemon. 64 * The HTTP Daemon.
60 */ 65 */
61static struct MHD_Daemon *mydaemon; 66static struct MHD_Daemon *mydaemon;
@@ -223,7 +228,7 @@ handle_mhd_request (void *cls,
223 * server into the corresponding global variables. 228 * server into the corresponding global variables.
224 * 229 *
225 * @param param mint_directory the mint's directory 230 * @param param mint_directory the mint's directory
226 * @return GNUNET_OK on success 231 * @return #GNUNET_OK on success
227 */ 232 */
228static int 233static int
229mint_serve_process_config (const char *mint_directory) 234mint_serve_process_config (const char *mint_directory)
@@ -231,6 +236,7 @@ mint_serve_process_config (const char *mint_directory)
231 unsigned long long port; 236 unsigned long long port;
232 unsigned long long kappa; 237 unsigned long long kappa;
233 char *master_pub_str; 238 char *master_pub_str;
239 char *mint_priv_str;
234 char *db_cfg; 240 char *db_cfg;
235 241
236 cfg = TALER_config_load (mint_directory); 242 cfg = TALER_config_load (mint_directory);
@@ -256,8 +262,30 @@ mint_serve_process_config (const char *mint_directory)
256 { 262 {
257 fprintf (stderr, 263 fprintf (stderr,
258 "Invalid master public key given in mint configuration."); 264 "Invalid master public key given in mint configuration.");
265 GNUNET_free (master_pub_str);
266 return GNUNET_NO;
267 }
268 GNUNET_free (master_pub_str);
269 if (GNUNET_OK !=
270 GNUNET_CONFIGURATION_get_value_string (cfg,
271 "mint", "mint_priv",
272 &mint_priv_str))
273 {
274 fprintf (stderr,
275 "No master public key given in mint configuration.");
276 return GNUNET_NO;
277 }
278 if (GNUNET_OK !=
279 GNUNET_CRYPTO_eddsa_private_key_from_string (mint_priv_str,
280 strlen (mint_priv_str),
281 &mint_priv))
282 {
283 fprintf (stderr,
284 "Invalid mint private key given in mint configuration.");
285 GNUNET_free (mint_priv_str);
259 return GNUNET_NO; 286 return GNUNET_NO;
260 } 287 }
288 GNUNET_free (mint_priv_str);
261 289
262 if (GNUNET_OK != 290 if (GNUNET_OK !=
263 GNUNET_CONFIGURATION_get_value_string (cfg, 291 GNUNET_CONFIGURATION_get_value_string (cfg,