commit d03e1da232ada2e0d3a3de3dbf6885caec74e4e0 Merge: 3b96bf6 41ba4f5 Author: Nick Mathewson nickm@torproject.org Date: Mon Feb 2 16:31:32 2015 -0500
Merge remote-tracking branch 'public/bug9635_warnings_025'
Conflicts: src/test/test.c
changes/bug9635 | 3 +++ src/or/circuitbuild.c | 11 ++++++++--- src/or/command.c | 1 - src/or/onion.c | 24 +++++++++++++++--------- src/or/onion.h | 3 ++- src/or/onion_fast.c | 10 ++++++---- src/or/onion_fast.h | 3 ++- src/or/onion_ntor.c | 19 ++++++++++++++++--- src/or/onion_ntor.h | 3 ++- src/or/onion_tap.c | 10 ++++++---- src/or/onion_tap.h | 3 ++- src/or/relay.c | 5 +++-- src/test/bench.c | 6 ++++-- src/test/test.c | 10 +++++----- src/test/test_ntor_cl.c | 2 +- 15 files changed, 75 insertions(+), 38 deletions(-)
diff --cc src/or/onion.c index 43fb63c,b5e801d..4864792 --- a/src/or/onion.c +++ b/src/or/onion.c @@@ -562,9 -582,11 +567,10 @@@ onion_skin_client_handshake(int type
memcpy(rend_authenticator_out, reply+DIGEST_LEN, DIGEST_LEN); return 0; -#ifdef CURVE25519_ENABLED case ONION_HANDSHAKE_TYPE_NTOR: if (reply_len < NTOR_REPLY_LEN) { - log_warn(LD_CIRC, "ntor reply was not of the correct length."); + if (msg_out) + *msg_out = "ntor reply was not of the correct length."; return -1; } { diff --cc src/test/test.c index ff4f517,e6f79a6..85a7ad6 --- a/src/test/test.c +++ b/src/test/test.c @@@ -106,11 -264,12 +106,11 @@@ test_onion_handshake(void *arg
/* client handshake 2 */ memset(c_keys, 0, 40); - tt_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)); ++ tt_assert(! onion_skin_TAP_client_handshake(c_dh, s_buf, c_keys, 40, NULL));
- test_memeq(c_keys, s_keys, 40); + tt_mem_op(c_keys,OP_EQ, s_keys, 40); memset(s_buf, 0, 40); - test_memneq(c_keys, s_buf, 40); + tt_mem_op(c_keys,OP_NE, s_buf, 40); } done: crypto_dh_free(c_dh); @@@ -178,19 -337,19 +178,19 @@@ test_bad_onion_handshake(void *arg
/* Client: Case 1: The server sent back junk. */ s_buf[64] ^= 33; - tt_int_op(-1, ==, + tt_int_op(-1, OP_EQ, - 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, ==, + tt_int_op(0, OP_EQ, - 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); + tt_mem_op(s_keys,OP_EQ, c_keys, 40);
/* Client: Case 2: The server sent back a degenerate DH. */ memset(s_buf, 0, sizeof(s_buf)); - tt_int_op(-1, ==, + tt_int_op(-1, OP_EQ, - 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); @@@ -238,12 -398,12 +238,12 @@@ 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, NULL)); + tt_int_op(0, OP_EQ, onion_skin_ntor_client_handshake(c_state, s_buf, - c_keys, 400)); ++ c_keys, 400, NULL));
- test_memeq(c_keys, s_keys, 400); + tt_mem_op(c_keys,OP_EQ, s_keys, 400); memset(s_buf, 0, 40); - test_memneq(c_keys, s_buf, 40); + tt_mem_op(c_keys,OP_NE, s_buf, 40);
done: ntor_handshake_state_free(c_state);
tor-commits@lists.torproject.org