#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
+#define HOSTKEY_FILE "test_plugin_hostkey.ecc"
+
/**
* Our public key.
*/
-static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded my_public_key;
+static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded my_public_key;
/**
* Our identity.
/**
* Our private key.
*/
-static struct GNUNET_CRYPTO_RsaPrivateKey *my_private_key;
+static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
/**
* Our configuration.
if (pretty_printers_running > 0)
{
- timeout_endbadly = GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, &end_badly, NULL);
+ timeout_endbadly = GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, &end_badly, &ok);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Have pending calls to pretty_printer ... deferring shutdown\n"));
return;
"NEIGHBOUR_LIMIT",
&tneigh)) ||
(GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (c,
- "GNUNETD", "HOSTKEY",
+ "PEER", "PRIVATE_KEY",
&keyfile)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
return;
}
+ if (GNUNET_OK != GNUNET_DISK_file_test (HOSTKEY_FILE))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Hostkey `%s' missing. Exiting.\n"),
+ HOSTKEY_FILE);
+ }
+
+ if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (keyfile))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Could not create a directory for hostkey `%s'. Exiting.\n"),
+ keyfile);
+ end_badly_now ();
+ return;
+ }
+
+ if (GNUNET_OK != GNUNET_DISK_file_copy (HOSTKEY_FILE, keyfile))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Could not copy hostkey `%s' to destination `%s'. Exiting.\n"),
+ HOSTKEY_FILE, keyfile);
+ end_badly_now ();
+ return;
+ }
+
+
max_connect_per_transport = (uint32_t) tneigh;
- my_private_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
+ my_private_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
GNUNET_free (keyfile);
if (NULL == my_private_key)
{
end_badly_now ();
return;
}
- GNUNET_CRYPTO_rsa_key_get_public (my_private_key, &my_public_key);
+ GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key);
GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key),
&my_identity.hashPubKey);
};
int ret;
+ GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-plugin-transport");
+
char *const argv_prog[] = {
"test_plugin_transport",
"-c",