aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_link_handshake.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-11 12:38:11 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-08 16:48:00 -0500
commitcd741cc595d705daef3aa9158bc7822fff935846 (patch)
treec1b26d448c3d24644a4d4366af31c6c0b5b5c2b6 /src/test/test_link_handshake.c
parent424ae9e18bc902e6c96a0e49b609f40868174af8 (diff)
downloadtor-cd741cc595d705daef3aa9158bc7822fff935846.tar.gz
tor-cd741cc595d705daef3aa9158bc7822fff935846.zip
Canonicity update for ed25519.
If a node can prove its Ed25519 identity, don't consider connections to it canonical unless they match both identities. Includes link handshake changes needed to avoid crashing with bug warnings, since the tests now reach more parts of the code. Closes ticket 20355
Diffstat (limited to 'src/test/test_link_handshake.c')
-rw-r--r--src/test/test_link_handshake.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test_link_handshake.c b/src/test/test_link_handshake.c
index 9931702a34..421f3aaedf 100644
--- a/src/test/test_link_handshake.c
+++ b/src/test/test_link_handshake.c
@@ -117,6 +117,9 @@ test_link_handshake_certs_ok(void *arg)
crypto_pk_t *key1 = NULL, *key2 = NULL;
const int with_ed = !strcmp((const char *)arg, "Ed25519");
+ tor_addr_from_ipv4h(&c1->base_.addr, 0x7f000001);
+ tor_addr_from_ipv4h(&c2->base_.addr, 0x7f000001);
+
scheduler_init();
MOCK(tor_tls_cert_matches_key, mock_tls_cert_matches_key);
@@ -354,6 +357,7 @@ recv_certs_setup(const struct testcase_t *test)
d->chan = tor_malloc_zero(sizeof(*d->chan));
d->c->chan = d->chan;
d->c->base_.address = tor_strdup("HaveAnAddress");
+ tor_addr_from_ipv4h(&d->c->base_.addr, 0x801f0127);
d->c->base_.state = OR_CONN_STATE_OR_HANDSHAKING_V3;
d->chan->conn = d->c;
tt_int_op(connection_init_or_handshake_state(d->c, 1), ==, 0);