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

[or-cvs] r18667: {tor} Patch from lark: drop BEGIN cells from a rendevous circuit i (in tor/trunk: . src/or)



Author: nickm
Date: 2009-02-21 14:07:01 -0500 (Sat, 21 Feb 2009)
New Revision: 18667

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/relay.c
Log:
Patch from lark: drop BEGIN cells from a rendevous circuit if they do not originate from the end of the circuit.

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2009-02-21 17:10:04 UTC (rev 18666)
+++ tor/trunk/ChangeLog	2009-02-21 19:07:01 UTC (rev 18667)
@@ -28,6 +28,8 @@
       stream never finished making its connection, it would live
       forever in circuit_wait state. Now we close it after SocksTimeout
       seconds. Bugfix on 0.1.2.7-alpha; reported by Mike Perry.
+    - Drop begin cells to a hidden service if they come from the middle of a
+      circuit.  Patch from lark.
 
   o Minor features:
     - On Linux, use the prctl call to re-enable core dumps when the user

Modified: tor/trunk/src/or/relay.c
===================================================================
--- tor/trunk/src/or/relay.c	2009-02-21 17:10:04 UTC (rev 18666)
+++ tor/trunk/src/or/relay.c	2009-02-21 19:07:01 UTC (rev 18667)
@@ -1019,6 +1019,13 @@
                "Relay begin request unsupported at AP. Dropping.");
         return 0;
       }
+      if (circ->purpose == CIRCUIT_PURPOSE_S_REND_JOINED &&
+          layer_hint != TO_ORIGIN_CIRCUIT(circ)->cpath->prev) {
+        log_fn(LOG_PROTOCOL_WARN, LD_APP,
+               "Relay begin request to Hidden Service "
+               "from intermediary node. Dropping.");
+        return 0;
+      }
       if (conn) {
         log_fn(LOG_PROTOCOL_WARN, domain,
                "Begin cell for known stream. Dropping.");