aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion_tap.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-10-16 13:26:42 -0400
committerNick Mathewson <nickm@torproject.org>2014-10-16 13:26:42 -0400
commitfb91d647acdf0560fc7479d72eeea52e4e6ff41d (patch)
tree500121c7c6c5b1b2cf3ee27d85f4cec6651853c6 /src/or/onion_tap.c
parentab4b29625db720817f9af502199ebf1ee3ac5af7 (diff)
downloadtor-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/or/onion_tap.c')
-rw-r--r--src/or/onion_tap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/onion_tap.c b/src/or/onion_tap.c
index 65f8275f75..668c48cfcd 100644
--- a/src/or/onion_tap.c
+++ b/src/or/onion_tap.c
@@ -183,7 +183,8 @@ int
onion_skin_TAP_client_handshake(crypto_dh_t *handshake_state,
const char *handshake_reply, /* TAP_ONIONSKIN_REPLY_LEN bytes */
char *key_out,
- size_t key_out_len)
+ size_t key_out_len,
+ const char **msg_out)
{
ssize_t len;
char *key_material=NULL;
@@ -196,14 +197,15 @@ onion_skin_TAP_client_handshake(crypto_dh_t *handshake_state,
handshake_reply, DH_KEY_LEN, key_material,
key_material_len);
if (len < 0) {
- log_warn(LD_PROTOCOL,"DH computation failed.");
+ if (msg_out)
+ *msg_out = "DH computation failed.";
goto err;
}
if (tor_memneq(key_material, handshake_reply+DH_KEY_LEN, DIGEST_LEN)) {
/* H(K) does *not* match. Something fishy. */
- log_warn(LD_PROTOCOL,"Digest DOES NOT MATCH on onion handshake. "
- "Bug or attack.");
+ if (msg_out)
+ *msg_out = "Digest DOES NOT MATCH on onion handshake. Bug or attack.";
goto err;
}