[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r17970: {tor} When a relay gets a create cell it can't decrypt (e.g. becau (in tor/trunk: . src/or)



Author: arma
Date: 2009-01-06 14:03:15 -0500 (Tue, 06 Jan 2009)
New Revision: 17970

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/cpuworker.c
Log:
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.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2009-01-06 18:06:49 UTC (rev 17969)
+++ tor/trunk/ChangeLog	2009-01-06 19:03:15 UTC (rev 17970)
@@ -67,6 +67,10 @@
       unencrypted links, we also broke DirPort reachability testing for
       bridges. So bridges with a non-zero DirPort were printing spurious
       warns to their logs. Bugfix on 0.2.0.16-alpha. Fixes bug 709.
+    - 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.
 
   o Deprecated and removed features:
     - The old "tor --version --version" command, which would print out
@@ -1239,9 +1243,9 @@
       Bugfix on 0.2.0.16-alpha. Reported by lodger.
 
   o Minor bugfixes:
-    - Fix compilation with OpenSSL 0.9.8 and 0.9.8a.  All other supported
-      OpenSSL versions should have been working fine.  Diagnosis and patch
-      from lodger, Karsten Loesing, and Sebastian Hahn.  Fixes bug 616.
+    - Fix compilation with OpenSSL 0.9.8 and 0.9.8a. All other supported
+      OpenSSL versions should have been working fine. Diagnosis and patch
+      from lodger, Karsten Loesing, and Sebastian Hahn. Fixes bug 616.
       Bugfix on 0.2.0.20-rc.
 
 

Modified: tor/trunk/src/or/cpuworker.c
===================================================================
--- tor/trunk/src/or/cpuworker.c	2009-01-06 18:06:49 UTC (rev 17969)
+++ tor/trunk/src/or/cpuworker.c	2009-01-06 19:03:15 UTC (rev 17970)
@@ -274,7 +274,10 @@
           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.");