diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-28 19:48:41 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-28 19:48:41 +0100 |
commit | 2e0e30291c4e490389f85bbd4973374f0adf22f4 (patch) | |
tree | 8d5f306cb967e7e7ab137b133206c7414bbb6f35 /src/mint/taler-mint-httpd.c | |
parent | e19f1906a3363f0f49553d35d95429c92bec29d4 (diff) | |
download | exchange-2e0e30291c4e490389f85bbd4973374f0adf22f4.tar.xz |
sign /deposit reply so that merchant has proof that mint accepted it
Diffstat (limited to 'src/mint/taler-mint-httpd.c')
-rw-r--r-- | src/mint/taler-mint-httpd.c | 30 |
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; struct GNUNET_CRYPTO_EddsaPublicKey master_pub; /** + * Private key of the mint we use to sign messages. + */ +struct GNUNET_CRYPTO_EddsaPrivateKey mint_priv; + +/** * The HTTP Daemon. */ static struct MHD_Daemon *mydaemon; @@ -223,7 +228,7 @@ handle_mhd_request (void *cls, * server into the corresponding global variables. * * @param param mint_directory the mint's directory - * @return GNUNET_OK on success + * @return #GNUNET_OK on success */ static int mint_serve_process_config (const char *mint_directory) @@ -231,6 +236,7 @@ mint_serve_process_config (const char *mint_directory) unsigned long long port; unsigned long long kappa; char *master_pub_str; + char *mint_priv_str; char *db_cfg; cfg = TALER_config_load (mint_directory); @@ -256,8 +262,30 @@ mint_serve_process_config (const char *mint_directory) { fprintf (stderr, "Invalid master public key given in mint configuration."); + GNUNET_free (master_pub_str); + return GNUNET_NO; + } + GNUNET_free (master_pub_str); + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_string (cfg, + "mint", "mint_priv", + &mint_priv_str)) + { + fprintf (stderr, + "No master public key given in mint configuration."); + return GNUNET_NO; + } + if (GNUNET_OK != + GNUNET_CRYPTO_eddsa_private_key_from_string (mint_priv_str, + strlen (mint_priv_str), + &mint_priv)) + { + fprintf (stderr, + "Invalid mint private key given in mint configuration."); + GNUNET_free (mint_priv_str); return GNUNET_NO; } + GNUNET_free (mint_priv_str); if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, |