summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2014-10-27 14:37:50 +0100
committerSebastian Hahn <sebastian@torproject.org>2014-10-27 14:41:19 +0100
commit909aa51b3f4411b30bccbbf1dd9f876d150167fd (patch)
treee8fe448757c2aaaa0de5687ba9b7db9accdc7a2a /src/test
parentac4dd248e187b0327617c84ee2820a03b0a87a16 (diff)
downloadtor-909aa51b3f4411b30bccbbf1dd9f876d150167fd.tar.gz
tor-909aa51b3f4411b30bccbbf1dd9f876d150167fd.zip
Remove configure option to disable curve25519
By now, support in the network is widespread and it's time to require more modern crypto on all Tor instances, whether they're clients or servers. By doing this early in 0.2.6, we can be sure that at some point all clients will have reasonable support.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench.c7
-rw-r--r--src/test/include.am6
-rw-r--r--src/test/test.c6
-rw-r--r--src/test/test_cell_formats.c8
-rw-r--r--src/test/test_crypto.c6
-rw-r--r--src/test/test_dir.c4
-rw-r--r--src/test/test_ntor_cl.c4
7 files changed, 1 insertions, 40 deletions
diff --git a/src/test/bench.c b/src/test/bench.c
index 825299835b..3a9432b137 100644
--- a/src/test/bench.c
+++ b/src/test/bench.c
@@ -26,10 +26,8 @@ const char tor_git_revision[] = "";
#endif
#include "config.h"
-#ifdef CURVE25519_ENABLED
#include "crypto_curve25519.h"
#include "onion_ntor.h"
-#endif
#include "crypto_ed25519.h"
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
@@ -179,7 +177,6 @@ bench_onion_TAP(void)
crypto_pk_free(key2);
}
-#ifdef CURVE25519_ENABLED
static void
bench_onion_ntor(void)
{
@@ -293,7 +290,6 @@ bench_ed25519(void)
printf("Blind a public key: %.2f usec\n",
MICROCOUNT(start, end, iters));
}
-#endif
static void
bench_cell_aes(void)
@@ -573,10 +569,9 @@ static struct benchmark_t benchmarks[] = {
ENT(siphash),
ENT(aes),
ENT(onion_TAP),
-#ifdef CURVE25519_ENABLED
ENT(onion_ntor),
ENT(ed25519),
-#endif
+
ENT(cell_aes),
ENT(cell_ops),
ENT(dh),
diff --git a/src/test/include.am b/src/test/include.am
index 8d05b3b700..d0f3224dc5 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -80,7 +80,6 @@ noinst_HEADERS+= \
src/test/failing_routerdescs.inc \
src/test/ed25519_vectors.inc
-if CURVE25519_ENABLED
noinst_PROGRAMS+= src/test/test-ntor-cl
src_test_test_ntor_cl_SOURCES = src/test/test_ntor_cl.c
src_test_test_ntor_cl_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
@@ -91,9 +90,6 @@ src_test_test_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \
src_test_test_ntor_cl_AM_CPPFLAGS = \
-I"$(top_srcdir)/src/or"
NTOR_TEST_DEPS=src/test/test-ntor-cl
-else
-NTOR_TEST_DEPS=
-endif
if COVERAGE_ENABLED
CMDLINE_TEST_TOR = ./src/or/tor-cov
@@ -113,10 +109,8 @@ src_test_test_bt_cl_CPPFLAGS= $(src_test_AM_CPPFLAGS)
check-local: $(NTOR_TEST_DEPS) $(CMDLINE_TEST_TOR)
if USEPYTHON
$(PYTHON) $(top_srcdir)/src/test/test_cmdline_args.py $(CMDLINE_TEST_TOR) "${top_srcdir}"
-if CURVE25519_ENABLED
$(PYTHON) $(top_srcdir)/src/test/ntor_ref.py test-tor
$(PYTHON) $(top_srcdir)/src/test/ntor_ref.py self-test
-endif
./src/test/test-bt-cl assert | $(PYTHON) $(top_srcdir)/src/test/bt_test.py
./src/test/test-bt-cl crash | $(PYTHON) $(top_srcdir)/src/test/bt_test.py
endif
diff --git a/src/test/test.c b/src/test/test.c
index 16ad6f3ae6..9878d13f0e 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -64,10 +64,8 @@ double fabs(double x);
#include "rephist.h"
#include "routerparse.h"
#include "statefile.h"
-#ifdef CURVE25519_ENABLED
#include "crypto_curve25519.h"
#include "onion_ntor.h"
-#endif
#ifdef USE_DMALLOC
#include <dmalloc.h>
@@ -365,7 +363,6 @@ test_bad_onion_handshake(void *arg)
crypto_pk_free(pk2);
}
-#ifdef CURVE25519_ENABLED
static void
test_ntor_handshake(void *arg)
{
@@ -417,7 +414,6 @@ test_ntor_handshake(void *arg)
ntor_handshake_state_free(c_state);
dimap_free(s_keymap, NULL);
}
-#endif
/** Run unit tests for the onion queues. */
static void
@@ -1267,9 +1263,7 @@ static struct testcase_t test_array[] = {
ENT(onion_handshake),
{ "bad_onion_handshake", test_bad_onion_handshake, 0, NULL, NULL },
ENT(onion_queues),
-#ifdef CURVE25519_ENABLED
{ "ntor_handshake", test_ntor_handshake, 0, NULL, NULL },
-#endif
ENT(circuit_timeout),
ENT(rend_fns),
ENT(geoip),
diff --git a/src/test/test_cell_formats.c b/src/test/test_cell_formats.c
index 995e519163..211eebce91 100644
--- a/src/test/test_cell_formats.c
+++ b/src/test/test_cell_formats.c
@@ -445,7 +445,6 @@ test_cfmt_create_cells(void *arg)
cell.command = CELL_CREATE2;
memcpy(cell.payload, "\x00\x02\x00\x54", 4); /* ntor, 84 bytes long */
memcpy(cell.payload+4, b, NTOR_ONIONSKIN_LEN);
-#ifdef CURVE25519_ENABLED
tt_int_op(0, ==, create_cell_parse(&cc, &cell));
tt_int_op(CELL_CREATE2, ==, cc.cell_type);
tt_int_op(ONION_HANDSHAKE_TYPE_NTOR, ==, cc.handshake_type);
@@ -454,9 +453,6 @@ test_cfmt_create_cells(void *arg)
tt_int_op(0, ==, create_cell_format(&cell2, &cc));
tt_int_op(cell.command, ==, cell2.command);
tt_mem_op(cell.payload,==, cell2.payload, CELL_PAYLOAD_SIZE);
-#else
- tt_int_op(-1, ==, create_cell_parse(&cc, &cell));
-#endif
/* A valid create cell with an ntor payload, in legacy format. */
memset(&cell, 0, sizeof(cell));
@@ -465,7 +461,6 @@ test_cfmt_create_cells(void *arg)
cell.command = CELL_CREATE;
memcpy(cell.payload, "ntorNTORntorNTOR", 16);
memcpy(cell.payload+16, b, NTOR_ONIONSKIN_LEN);
-#ifdef CURVE25519_ENABLED
tt_int_op(0, ==, create_cell_parse(&cc, &cell));
tt_int_op(CELL_CREATE, ==, cc.cell_type);
tt_int_op(ONION_HANDSHAKE_TYPE_NTOR, ==, cc.handshake_type);
@@ -474,9 +469,6 @@ test_cfmt_create_cells(void *arg)
tt_int_op(0, ==, create_cell_format(&cell2, &cc));
tt_int_op(cell.command, ==, cell2.command);
tt_mem_op(cell.payload,==, cell2.payload, CELL_PAYLOAD_SIZE);
-#else
- tt_int_op(-1, ==, create_cell_parse(&cc, &cell));
-#endif
/* == Okay, now let's try to parse some impossible stuff. */
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index 795c603fd4..45370c1635 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -11,9 +11,7 @@
#include "aes.h"
#include "util.h"
#include "siphash.h"
-#ifdef CURVE25519_ENABLED
#include "crypto_curve25519.h"
-#endif
#include "crypto_ed25519.h"
#include "ed25519_vectors.inc"
#include "crypto_s2k.h"
@@ -1332,7 +1330,6 @@ test_crypto_hkdf_sha256(void *arg)
#undef EXPAND
}
-#ifdef CURVE25519_ENABLED
static void
test_crypto_curve25519_impl(void *arg)
{
@@ -1876,7 +1873,6 @@ test_crypto_ed25519_testvectors(void *arg)
done:
tor_free(mem_op_hex_tmp);
}
-#endif /* CURVE25519_ENABLED */
static void
test_crypto_siphash(void *arg)
@@ -2025,7 +2021,6 @@ struct testcase_t crypto_tests[] = {
CRYPTO_LEGACY(base32_decode),
{ "kdf_TAP", test_crypto_kdf_TAP, 0, NULL, NULL },
{ "hkdf_sha256", test_crypto_hkdf_sha256, 0, NULL, NULL },
-#ifdef CURVE25519_ENABLED
{ "curve25519_impl", test_crypto_curve25519_impl, 0, NULL, NULL },
{ "curve25519_impl_hibit", test_crypto_curve25519_impl, 0, NULL, (void*)"y"},
{ "curve25519_wrappers", test_crypto_curve25519_wrappers, 0, NULL, NULL },
@@ -2037,7 +2032,6 @@ struct testcase_t crypto_tests[] = {
{ "ed25519_convert", test_crypto_ed25519_convert, 0, NULL, NULL },
{ "ed25519_blinding", test_crypto_ed25519_blinding, 0, NULL, NULL },
{ "ed25519_testvectors", test_crypto_ed25519_testvectors, 0, NULL, NULL },
-#endif
{ "siphash", test_crypto_siphash, 0, NULL, NULL },
END_OF_TESTCASES
};
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index e03efbeff5..d17f0b7921 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -216,10 +216,8 @@ test_dir_formats(void *arg)
strlcat(buf2, "signing-key\n", sizeof(buf2));
strlcat(buf2, pk1_str, sizeof(buf2));
strlcat(buf2, "hidden-service-dir\n", sizeof(buf2));
-#ifdef CURVE25519_ENABLED
strlcat(buf2, "ntor-onion-key "
"skyinAnvardNostarsNomoonNowindormistsorsnow=\n", sizeof(buf2));
-#endif
strlcat(buf2, "accept *:80\nreject 18.0.0.0/8:24\n", sizeof(buf2));
strlcat(buf2, "router-signature\n", sizeof(buf2));
@@ -239,11 +237,9 @@ test_dir_formats(void *arg)
tt_int_op(rp2->bandwidthrate,==, r2->bandwidthrate);
tt_int_op(rp2->bandwidthburst,==, r2->bandwidthburst);
tt_int_op(rp2->bandwidthcapacity,==, r2->bandwidthcapacity);
-#ifdef CURVE25519_ENABLED
tt_mem_op(rp2->onion_curve25519_pkey->public_key,==,
r2->onion_curve25519_pkey->public_key,
CURVE25519_PUBKEY_LEN);
-#endif
tt_assert(crypto_pk_cmp_keys(rp2->onion_pkey, pk2) == 0);
tt_assert(crypto_pk_cmp_keys(rp2->identity_pkey, pk1) == 0);
diff --git a/src/test/test_ntor_cl.c b/src/test/test_ntor_cl.c
index f2b7a72ad5..873fae0a61 100644
--- a/src/test/test_ntor_cl.c
+++ b/src/test/test_ntor_cl.c
@@ -13,10 +13,6 @@
#include "crypto_curve25519.h"
#include "onion_ntor.h"
-#ifndef CURVE25519_ENABLED
-#error "This isn't going to work without curve25519."
-#endif
-
#define N_ARGS(n) STMT_BEGIN { \
if (argc < (n)) { \
fprintf(stderr, "%s needs %d arguments.\n",argv[1],n); \