diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-10-16 13:26:42 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-10-16 13:26:42 -0400 |
commit | fb91d647acdf0560fc7479d72eeea52e4e6ff41d (patch) | |
tree | 500121c7c6c5b1b2cf3ee27d85f4cec6651853c6 /src/test | |
parent | ab4b29625db720817f9af502199ebf1ee3ac5af7 (diff) | |
download | tor-fb91d647acdf0560fc7479d72eeea52e4e6ff41d.tar.gz tor-fb91d647acdf0560fc7479d72eeea52e4e6ff41d.zip |
Downgrade 'invalid result from curve25519 handshake: 4' warning
Also, refactor the way we handle failed handshakes so that this
warning doesn't propagate itself to "onion_skin_client_handshake
failed" and "circuit_finish_handshake failed" and
"connection_edge_process_relay_cell (at origin) failed."
Resolves warning from 9635.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/bench.c | 6 | ||||
-rw-r--r-- | src/test/test.c | 11 | ||||
-rw-r--r-- | src/test/test_ntor_cl.c | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/src/test/bench.c b/src/test/bench.c index f6c33626f2..fd374b5baf 100644 --- a/src/test/bench.c +++ b/src/test/bench.c @@ -162,7 +162,8 @@ bench_onion_TAP(void) char key_out[CPATH_KEY_MATERIAL_LEN]; int s; dh = crypto_dh_dup(dh_out); - s = onion_skin_TAP_client_handshake(dh, or, key_out, sizeof(key_out)); + s = onion_skin_TAP_client_handshake(dh, or, key_out, sizeof(key_out), + NULL); crypto_dh_free(dh); tor_assert(s == 0); } @@ -222,7 +223,8 @@ bench_onion_ntor(void) for (i = 0; i < iters; ++i) { uint8_t key_out[CPATH_KEY_MATERIAL_LEN]; int s; - s = onion_skin_ntor_client_handshake(state, or, key_out, sizeof(key_out)); + s = onion_skin_ntor_client_handshake(state, or, key_out, sizeof(key_out), + NULL); tor_assert(s == 0); } end = perftime(); diff --git a/src/test/test.c b/src/test/test.c index 8bce9c91f4..e6f79a6bc6 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -264,7 +264,8 @@ test_onion_handshake(void) /* client handshake 2 */ memset(c_keys, 0, 40); - test_assert(! onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40)); + test_assert(! onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40, + NULL)); test_memeq(c_keys, s_keys, 40); memset(s_buf, 0, 40); @@ -337,18 +338,18 @@ test_bad_onion_handshake(void *arg) /* Client: Case 1: The server sent back junk. */ s_buf[64] ^= 33; tt_int_op(-1, ==, - onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40)); + onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40, NULL)); s_buf[64] ^= 33; /* Let the client finish; make sure it can. */ tt_int_op(0, ==, - onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40)); + onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40, NULL)); test_memeq(s_keys, c_keys, 40); /* Client: Case 2: The server sent back a degenerate DH. */ memset(s_buf, 0, sizeof(s_buf)); tt_int_op(-1, ==, - onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40)); + onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40, NULL)); done: crypto_dh_free(c_dh); @@ -398,7 +399,7 @@ test_ntor_handshake(void *arg) /* client handshake 2 */ memset(c_keys, 0, 40); tt_int_op(0, ==, onion_skin_ntor_client_handshake(c_state, s_buf, - c_keys, 400)); + c_keys, 400, NULL)); test_memeq(c_keys, s_keys, 400); memset(s_buf, 0, 40); diff --git a/src/test/test_ntor_cl.c b/src/test/test_ntor_cl.c index f2b7a72ad5..6103e807e5 100644 --- a/src/test/test_ntor_cl.c +++ b/src/test/test_ntor_cl.c @@ -130,7 +130,7 @@ client2(int argc, char **argv) keys = tor_malloc(keybytes); hexkeys = tor_malloc(keybytes*2+1); - if (onion_skin_ntor_client_handshake(&state, msg, keys, keybytes)<0) { + if (onion_skin_ntor_client_handshake(&state, msg, keys, keybytes, NULL)<0) { fprintf(stderr, "handshake failed"); result = 2; goto done; |