summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-10-17 09:33:54 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-10-17 09:33:54 +0000
commit76fd5e31a0efdd100c6f219d334d0efd823432ac (patch)
treecb901aca5af25d634d2ea4093674c29e6ba60500 /src/transport
parent5a750bc216e6a1871ee2554c071c32026c497ec9 (diff)
use precomputed hostkey for slow computers
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/Makefile.am1
-rw-r--r--src/transport/test_plugin_hostkeybin0 -> 914 bytes
-rw-r--r--src/transport/test_plugin_transport.c21
3 files changed, 22 insertions, 0 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index df238d338..b8d220e72 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -839,6 +839,7 @@ test_transport_api_multi_LDADD = \
EXTRA_DIST = \
+test_plugin_hostkey \
gnunet-transport-certificate-creation \
template_cfg_peer1.conf\
template_cfg_peer2.conf\
diff --git a/src/transport/test_plugin_hostkey b/src/transport/test_plugin_hostkey
new file mode 100644
index 000000000..13f1dc9b3
--- /dev/null
+++ b/src/transport/test_plugin_hostkey
Binary files differ
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index e512716bc..07a20adad 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -43,6 +43,8 @@
#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"
+
/**
* Our public key.
*/
@@ -547,6 +549,23 @@ run (void *cls, char *const *args, const char *cfgfile,
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_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);
GNUNET_free (keyfile);
@@ -674,6 +693,8 @@ main (int argc, char *const *argv)
};
int ret;
+ GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-plugin-transport");
+
char *const argv_prog[] = {
"test_plugin_transport",
"-c",