- GNUNET_CRYPTO_ecc_key_free (pk);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS",
- "SERVICEHOME",
- &service_home));
- /* FIXME: might be better to evaluate actual configuration option here... */
- GNUNET_snprintf (hostkey_filename, sizeof (hostkey_filename), "%s/private.ecc",
- service_home);
- GNUNET_free (service_home);
+ GNUNET_free (pk);
+ if (GNUNET_NO ==
+ GNUNET_CONFIGURATION_have_value (cfg, "PEER", "PRIVATE_KEY"))
+ {
+ GNUNET_asprintf (&emsg_,
+ _("PRIVATE_KEY option in PEER section missing in configuration\n"));
+ goto err_ret;
+ }
+ /* Remove sections for shared services */
+ for (cnt = 0; cnt < system->n_shared_services; cnt++)
+ {
+ ss = system->shared_services[cnt];
+ GNUNET_CONFIGURATION_remove_section (cfg, ss->sname);
+ }
+ if (GNUNET_OK != GNUNET_TESTING_configuration_create_ (system, cfg,
+ &ports, &nports))
+ {
+ GNUNET_asprintf (&emsg_,
+ _("Failed to create configuration for peer "
+ "(not enough free ports?)\n"));
+ goto err_ret;
+ }
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_filename (cfg, "PEER",
+ "PRIVATE_KEY",
+ &hostkey_filename));