summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2009-01-06 19:03:15 +0000
committerRoger Dingledine <arma@torproject.org>2009-01-06 19:03:15 +0000
commit68806c7fb7ad070a78fbacc546611cee66471fd8 (patch)
treefc05345c00bb791a5fa9ef40983b31f74ed83c51 /src
parent0955a1b9e1d91f345d26185c9dda2b863381b7e6 (diff)
downloadtor-68806c7fb7ad070a78fbacc546611cee66471fd8.tar.gz
tor-68806c7fb7ad070a78fbacc546611cee66471fd8.zip
When a relay gets a create cell it can't decrypt (e.g. because it's
using the wrong onion key), we were dropping it and letting the client time out. Now actually answer with a destroy cell. Bugfix on 0.0.2pre8. svn:r17970
Diffstat (limited to 'src')
-rw-r--r--src/or/cpuworker.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index b0d3d1c4c0..88a72886eb 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -274,7 +274,10 @@ cpuworker_main(void *data)
reply_to_proxy, keys, CPATH_KEY_MATERIAL_LEN) < 0) {
/* failure */
log_debug(LD_OR,"onion_skin_server_handshake failed.");
- memset(buf,0,LEN_ONION_RESPONSE); /* send all zeros for failure */
+ *buf = 0; /* indicate failure in first byte */
+ memcpy(buf+1,tag,TAG_LEN);
+ /* send all zeros as answer */
+ memset(buf+1+TAG_LEN, 0, LEN_ONION_RESPONSE-(1+TAG_LEN));
} else {
/* success */
log_debug(LD_OR,"onion_skin_server_handshake succeeded.");