diff options
| author | Christian Grothoff <christian@grothoff.org> | 2015-04-12 22:52:54 +0200 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2015-04-12 22:52:54 +0200 | 
| commit | 15bec8f464dc6afce88e82bdce1b76ce5f372891 (patch) | |
| tree | 6ff2b4e9770bc79157b06a25379dcb5ebe95da7a /src/mint | |
| parent | 68774b20da5783ba795c4536989963bb2d5e8141 (diff) | |
make wireformat configurable (#3624)
Diffstat (limited to 'src/mint')
| -rw-r--r-- | src/mint/taler-mint-httpd.c | 42 | 
1 files changed, 19 insertions, 23 deletions
diff --git a/src/mint/taler-mint-httpd.c b/src/mint/taler-mint-httpd.c index 0cc9945e..43c2fa55 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. @@ -73,11 +73,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.   */  static uint16_t serve_port; @@ -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); @@ -276,6 +270,16 @@ mint_serve_process_config (const char *mint_directory)    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",                                               "master_public_key",                                               &TMH_master_public_key_str))    { @@ -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;  }  | 
