summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.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/circuitbuild.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/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 897f90fe4c..873eba1668 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1256,8 +1256,10 @@ circuit_finish_handshake(origin_circuit_t *circ,
crypt_path_t *hop;
int rv;
- if ((rv = pathbias_count_build_attempt(circ)) < 0)
+ if ((rv = pathbias_count_build_attempt(circ)) < 0) {
+ log_warn(LD_CIRC, "pathbias_count_build_attempt failed: %d", rv);
return rv;
+ }
if (circ->cpath->state == CPATH_STATE_AWAITING_KEYS) {
hop = circ->cpath;
@@ -1271,12 +1273,15 @@ circuit_finish_handshake(origin_circuit_t *circ,
tor_assert(hop->state == CPATH_STATE_AWAITING_KEYS);
{
+ const char *msg = NULL;
if (onion_skin_client_handshake(hop->handshake_state.tag,
&hop->handshake_state,
reply->reply, reply->handshake_len,
(uint8_t*)keys, sizeof(keys),
- (uint8_t*)hop->rend_circ_nonce) < 0) {
- log_warn(LD_CIRC,"onion_skin_client_handshake failed.");
+ (uint8_t*)hop->rend_circ_nonce,
+ &msg) < 0) {
+ if (msg)
+ log_warn(LD_CIRC,"onion_skin_client_handshake failed: %s", msg);
return -END_CIRC_REASON_TORPROTOCOL;
}
}
@@ -1284,6 +1289,7 @@ circuit_finish_handshake(origin_circuit_t *circ,
onion_handshake_state_release(&hop->handshake_state);
if (circuit_init_cpath_crypto(hop, keys, 0)<0) {
+ log_warn(LD_BUG, "Couldn't initialize cpath crypto");
return -END_CIRC_REASON_TORPROTOCOL;
}