[tor-commits] [torspec/master] control-spec: Document logs that are not included in the Log event

2019-08-05 Thread nickm
commit e5ec0281872c38ba450801d4524f70cb3ab8291c
Author: teor 
Date:   Fri Aug 2 12:59:36 2019 +1000

control-spec: Document logs that are not included in the Log event

Spec for 30901.
---
 control-spec.txt | 8 
 1 file changed, 8 insertions(+)

diff --git a/control-spec.txt b/control-spec.txt
index ac6578a..97bee17 100644
--- a/control-spec.txt
+++ b/control-spec.txt
@@ -2267,6 +2267,14 @@
 
  Severity = "DEBUG" / "INFO" / "NOTICE" / "WARN"/ "ERR"
 
+  Some low-level logs may be sent from signal handlers, so their destination
+  logs must be signal-safe. These low-level logs include backtraces,
+  logging function errors, and errors in code called by logging functions.
+  Signal-safe logs are never sent as control port log events.
+
+  Control port message trace debug logs are never sent as control port log
+  events, to avoid modifying control output when debugging.
+
 4.1.6. New descriptors available
 
   This event is generated when new router descriptors (not microdescs or

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/support-portal_completed] Update translations for support-portal_completed

2019-08-05 Thread translation
commit aefb707150efde0a39d1abe927f4bd6e54502e7f
Author: Translation commit bot 
Date:   Mon Aug 5 15:21:15 2019 +

Update translations for support-portal_completed
---
 contents+de.po | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/contents+de.po b/contents+de.po
index 5f8fa1d1a..79e17df8e 100644
--- a/contents+de.po
+++ b/contents+de.po
@@ -3,9 +3,9 @@
 # try once, 2019
 # Oliver Baumann , 2019
 # erinm, 2019
-# Emma Peel, 2019
 # Marcel Haring , 2019
 # Curtis Baltimore , 2019
+# Emma Peel, 2019
 # 
 msgid ""
 msgstr ""
@@ -13,7 +13,7 @@ msgstr ""
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2019-07-31 14:11+CET\n"
 "PO-Revision-Date: 2018-10-02 22:41+\n"
-"Last-Translator: Curtis Baltimore , 2019\n"
+"Last-Translator: Emma Peel, 2019\n"
 "Language-Team: German (https://www.transifex.com/otf/teams/1519/de/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -6308,8 +6308,8 @@ msgid ""
 "Tor is funded by a number of different sponsors including US federal "
 "agencies, private foundations, and individual donors."
 msgstr ""
-"Tor wird von einer Reihe von Sponsor*innen inklusive US-Behörden, privaten "
-"Stiftungen und Privatpersonen unterstützt."
+"Tor wird von einer Reihe von Sponsorinnen inklusive US-Behörden, "
+"privaten Stiftungen und Privatpersonen unterstützt."
 
 #: https//support.torproject.org/misc/misc-3/
 #: (content/misc/misc-3/contents+en.lrquestion.description)
@@ -6322,7 +6322,7 @@ msgid ""
 msgstr ""
 "Siehe die https://www.torproject.org/about/sponsors.html.en\;>Liste unserer "
-"Sponsor*innen und eine Serie von  und eine Serie von https://blog.torproject.org/category/tags/form-990\;>Blogeinträgen"
 " mit finanziellen Berichten."
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/support-portal] Update translations for support-portal

2019-08-05 Thread translation
commit 3050aa6e518e5e69df445da2dd731e564c45a4ab
Author: Translation commit bot 
Date:   Mon Aug 5 15:21:07 2019 +

Update translations for support-portal
---
 contents+de.po | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/contents+de.po b/contents+de.po
index 5f8fa1d1a..79e17df8e 100644
--- a/contents+de.po
+++ b/contents+de.po
@@ -3,9 +3,9 @@
 # try once, 2019
 # Oliver Baumann , 2019
 # erinm, 2019
-# Emma Peel, 2019
 # Marcel Haring , 2019
 # Curtis Baltimore , 2019
+# Emma Peel, 2019
 # 
 msgid ""
 msgstr ""
@@ -13,7 +13,7 @@ msgstr ""
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2019-07-31 14:11+CET\n"
 "PO-Revision-Date: 2018-10-02 22:41+\n"
-"Last-Translator: Curtis Baltimore , 2019\n"
+"Last-Translator: Emma Peel, 2019\n"
 "Language-Team: German (https://www.transifex.com/otf/teams/1519/de/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -6308,8 +6308,8 @@ msgid ""
 "Tor is funded by a number of different sponsors including US federal "
 "agencies, private foundations, and individual donors."
 msgstr ""
-"Tor wird von einer Reihe von Sponsor*innen inklusive US-Behörden, privaten "
-"Stiftungen und Privatpersonen unterstützt."
+"Tor wird von einer Reihe von Sponsorinnen inklusive US-Behörden, "
+"privaten Stiftungen und Privatpersonen unterstützt."
 
 #: https//support.torproject.org/misc/misc-3/
 #: (content/misc/misc-3/contents+en.lrquestion.description)
@@ -6322,7 +6322,7 @@ msgid ""
 msgstr ""
 "Siehe die https://www.torproject.org/about/sponsors.html.en\;>Liste unserer "
-"Sponsor*innen und eine Serie von  und eine Serie von https://blog.torproject.org/category/tags/form-990\;>Blogeinträgen"
 " mit finanziellen Berichten."
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Ignore regular cells in padding circuits.

2019-08-05 Thread nickm
commit ce477da8a7969964810fb16502073d5f34e58692
Author: George Kadianakis 
Date:   Tue Jul 23 13:17:37 2019 +0300

Ignore regular cells in padding circuits.

Padding circuits were regular cells that got closed before their padding
machine could finish. This means that they can still receive regular cells 
from
their past life, but they have no way or reason to answer them anymore. 
Hence
let's ignore them before they even get to the proper subsystems.
---
 scripts/maint/practracker/exceptions.txt |  6 +++---
 src/core/or/circuitpadding.c | 37 
 src/core/or/circuitpadding.h |  4 
 src/core/or/relay.c  | 25 ++---
 4 files changed, 50 insertions(+), 22 deletions(-)

diff --git a/scripts/maint/practracker/exceptions.txt 
b/scripts/maint/practracker/exceptions.txt
index 642ae467f..d437726fe 100644
--- a/scripts/maint/practracker/exceptions.txt
+++ b/scripts/maint/practracker/exceptions.txt
@@ -84,7 +84,7 @@ problem function-size 
/src/core/or/circuitlist.c:circuit_about_to_free() 120
 problem function-size /src/core/or/circuitlist.c:circuits_handle_oom() 117
 problem function-size /src/core/or/circuitmux.c:circuitmux_set_policy() 109
 problem function-size /src/core/or/circuitmux.c:circuitmux_attach_circuit() 113
-problem file-size /src/core/or/circuitpadding.c 3006
+problem file-size /src/core/or/circuitpadding.c 3043
 problem function-size 
/src/core/or/circuitpadding.c:circpad_machine_schedule_padding() 107
 problem function-size 
/src/core/or/circuitpadding_machines.c:circpad_machine_relay_hide_intro_circuits()
 103
 problem function-size 
/src/core/or/circuitpadding_machines.c:circpad_machine_client_hide_rend_circuits()
 112
@@ -117,12 +117,12 @@ problem function-size 
/src/core/or/connection_or.c:connection_or_compute_authent
 problem file-size /src/core/or/policies.c 3249
 problem function-size /src/core/or/policies.c:policy_summarize() 107
 problem function-size /src/core/or/protover.c:protover_all_supported() 117
-problem file-size /src/core/or/relay.c 3244
+problem file-size /src/core/or/relay.c 3263
 problem function-size /src/core/or/relay.c:circuit_receive_relay_cell() 126
 problem function-size /src/core/or/relay.c:relay_send_command_from_edge_() 109
 problem function-size 
/src/core/or/relay.c:connection_ap_process_end_not_open() 192
 problem function-size 
/src/core/or/relay.c:connection_edge_process_relay_cell_not_open() 137
-problem function-size 
/src/core/or/relay.c:connection_edge_process_relay_cell() 428
+problem function-size /src/core/or/relay.c:handle_relay_cell_command() 369
 problem function-size /src/core/or/relay.c:connection_edge_package_raw_inbuf() 
128
 problem function-size 
/src/core/or/relay.c:circuit_resume_edge_reading_helper() 146
 problem function-size /src/core/or/scheduler_kist.c:kist_scheduler_run() 171
diff --git a/src/core/or/circuitpadding.c b/src/core/or/circuitpadding.c
index 460f72c17..9ccad8744 100644
--- a/src/core/or/circuitpadding.c
+++ b/src/core/or/circuitpadding.c
@@ -1791,6 +1791,43 @@ circpad_cell_event_nonpadding_sent(circuit_t *on_circ)
   } FOR_EACH_ACTIVE_CIRCUIT_MACHINE_END;
 }
 
+/** Check if this cell or circuit are related to circuit padding and handle
+ *  them if so.  Return 0 if the cell was handled in this subsystem and does
+ *  not need any other consideration, otherwise return 1.
+ */
+int
+circpad_check_received_cell(cell_t *cell, circuit_t *circ,
+crypt_path_t *layer_hint,
+const relay_header_t *rh)
+{
+  unsigned domain = layer_hint?LD_APP:LD_EXIT;
+
+  /* First handle the padding commands, since we want to ignore any other
+   * commands if this circuit is padding-specific. */
+  switch (rh->command) {
+case RELAY_COMMAND_DROP:
+  /* Already examined in circpad_deliver_recognized_relay_cell_events */
+  return 0;
+case RELAY_COMMAND_PADDING_NEGOTIATE:
+  circpad_handle_padding_negotiate(circ, cell);
+  return 0;
+case RELAY_COMMAND_PADDING_NEGOTIATED:
+  if (circpad_handle_padding_negotiated(circ, cell, layer_hint) == 0)
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh->length);
+  return 0;
+  }
+
+  /* If this is a padding circuit we don't need to parse any other commands
+   * than the padding ones. Just drop them to the floor. */
+  if (circ->purpose == CIRCUIT_PURPOSE_C_CIRCUIT_PADDING) {
+log_info(domain, "Ignored cell (%d) that arrived in padding circuit.",
+ rh->command);
+return 0;
+  }
+
+  return 1;
+}
+
 /**
  * A "non-padding" cell has been received by this endpoint. React
  * according to any padding state machines on the circuit.
diff --git a/src/core/or/circuitpadding.h b/src/core/or/circuitpadding.h
index fc2e595c0..e9eb32c61 100644
--- a/src/core/or/circuitpadding.h
+++ b/src/core/or/circuitpadding.h
@@ -734,6 +734,10 @@ bool circpad_padding_negotiated(struct circuit_t *circ,
 
 

[tor-commits] [tor/master] Split connection_edge_process_relay_cell() in two functions.

2019-08-05 Thread nickm
commit 7a032c5e4838651b62b99938d56e94b4a6fc6197
Author: George Kadianakis 
Date:   Tue Jul 23 13:01:12 2019 +0300

Split connection_edge_process_relay_cell() in two functions.

One function does the validation, the other does the handling.
---
 src/core/or/relay.c | 225 +---
 1 file changed, 124 insertions(+), 101 deletions(-)

diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 9e691a02b..84fc58787 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -1576,83 +1576,27 @@ process_sendme_cell(const relay_header_t *rh, const 
cell_t *cell,
   return 0;
 }
 
-/** An incoming relay cell has arrived on circuit circ. If
- * conn is NULL this is a control cell, else cell is
- * destined for conn.
- *
- * If layer_hint is defined, then we're the origin of the
- * circuit, and it specifies the hop that packaged cell.
+/** A helper for connection_edge_process_relay_cell(): Actually handles the
+ *  cell that we received on the connection.
  *
- * Return -reason if you want to warn and tear down the circuit, else 0.
+ *  The arguments are the same as in the parent function
+ *  connection_edge_process_relay_cell(), plus the relay header rh as
+ *  unpacked by the parent function, and optimistic_data as set by the
+ *  parent function.
  */
-STATIC int
-connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
-   edge_connection_t *conn,
-   crypt_path_t *layer_hint)
+static int
+handle_relay_command(cell_t *cell, circuit_t *circ,
+ edge_connection_t *conn,
+ crypt_path_t *layer_hint,
+ relay_header_t *rh,
+ int optimistic_data)
 {
-  static int num_seen=0;
-  relay_header_t rh;
   unsigned domain = layer_hint?LD_APP:LD_EXIT;
   int reason;
-  int optimistic_data = 0; /* Set to 1 if we receive data on a stream
-* that's in the EXIT_CONN_STATE_RESOLVING
-* or EXIT_CONN_STATE_CONNECTING states. */
-
-  tor_assert(cell);
-  tor_assert(circ);
-
-  relay_header_unpack(, cell->payload);
-//  log_fn(LOG_DEBUG,"command %d stream %d", rh.command, rh.stream_id);
-  num_seen++;
-  log_debug(domain, "Now seen %d relay cells here (command %d, stream %d).",
-num_seen, rh.command, rh.stream_id);
 
-  if (rh.length > RELAY_PAYLOAD_SIZE) {
-log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
-   "Relay cell length field too long. Closing circuit.");
-return - END_CIRC_REASON_TORPROTOCOL;
-  }
-
-  if (rh.stream_id == 0) {
-switch (rh.command) {
-  case RELAY_COMMAND_BEGIN:
-  case RELAY_COMMAND_CONNECTED:
-  case RELAY_COMMAND_END:
-  case RELAY_COMMAND_RESOLVE:
-  case RELAY_COMMAND_RESOLVED:
-  case RELAY_COMMAND_BEGIN_DIR:
-log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Relay command %d with zero "
-   "stream_id. Dropping.", (int)rh.command);
-return 0;
-  default:
-;
-}
-  }
-
-  /* Tell circpad that we've received a recognized cell */
-  circpad_deliver_recognized_relay_cell_events(circ, rh.command, layer_hint);
-
-  /* either conn is NULL, in which case we've got a control cell, or else
-   * conn points to the recognized stream. */
-  if (conn && !connection_state_is_open(TO_CONN(conn))) {
-if (conn->base_.type == CONN_TYPE_EXIT &&
-(conn->base_.state == EXIT_CONN_STATE_CONNECTING ||
- conn->base_.state == EXIT_CONN_STATE_RESOLVING) &&
-rh.command == RELAY_COMMAND_DATA) {
-  /* Allow DATA cells to be delivered to an exit node in state
-   * EXIT_CONN_STATE_CONNECTING or EXIT_CONN_STATE_RESOLVING.
-   * This speeds up HTTP, for example. */
-  optimistic_data = 1;
-} else if (rh.stream_id == 0 && rh.command == RELAY_COMMAND_DATA) {
-  log_warn(LD_BUG, "Somehow I had a connection that matched a "
-   "data cell with stream ID 0.");
-} else {
-  return connection_edge_process_relay_cell_not_open(
-   , cell, circ, conn, layer_hint);
-}
-  }
+  tor_assert(rh);
 
-  switch (rh.command) {
+  switch (rh->command) {
 case RELAY_COMMAND_DROP:
   /* Already examined in circpad_deliver_recognized_relay_cell_events */
   return 0;
@@ -1661,7 +1605,7 @@ connection_edge_process_relay_cell(cell_t *cell, 
circuit_t *circ,
   return 0;
 case RELAY_COMMAND_PADDING_NEGOTIATED:
   if (circpad_handle_padding_negotiated(circ, cell, layer_hint) == 0)
-circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh->length);
   return 0;
   }
 
@@ -1694,7 +1638,7 @@ connection_edge_process_relay_cell(cell_t *cell, 
circuit_t *circ,
"Begin cell for known stream. Dropping.");
 return 0;
   }
-  if (rh.command == RELAY_COMMAND_BEGIN_DIR &&
+  if (rh->command == 

[tor-commits] [tor/master] Rename handle_relay_command to handle_relay_cell_command .

2019-08-05 Thread nickm
commit 82488121882040f6831be554a21629c1428f8031
Author: George Kadianakis 
Date:   Fri Aug 2 12:35:38 2019 +0300

Rename handle_relay_command to handle_relay_cell_command .

As per David's review.
---
 src/core/or/relay.c| 4 ++--
 src/core/or/relay.h| 2 +-
 src/test/test_circuitpadding.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index ac3f2a8bb..98d5b416f 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -1585,7 +1585,7 @@ process_sendme_cell(const relay_header_t *rh, const 
cell_t *cell,
  *  parent function.
  */
 STATIC int
-handle_relay_command(cell_t *cell, circuit_t *circ,
+handle_relay_cell_command(cell_t *cell, circuit_t *circ,
  edge_connection_t *conn, crypt_path_t *layer_hint,
  relay_header_t *rh, int optimistic_data)
 {
@@ -2033,7 +2033,7 @@ connection_edge_process_relay_cell(cell_t *cell, 
circuit_t *circ,
 }
   }
 
-  return handle_relay_command(cell, circ, conn, layer_hint,
+  return handle_relay_cell_command(cell, circ, conn, layer_hint,
   , optimistic_data);
 }
 
diff --git a/src/core/or/relay.h b/src/core/or/relay.h
index d9e0d533f..99f755301 100644
--- a/src/core/or/relay.h
+++ b/src/core/or/relay.h
@@ -100,7 +100,7 @@ uint8_t packed_cell_get_command(const packed_cell_t *cell, 
int wide_circ_ids);
 
 #ifdef RELAY_PRIVATE
 STATIC int
-handle_relay_command(cell_t *cell, circuit_t *circ,
+handle_relay_cell_command(cell_t *cell, circuit_t *circ,
  edge_connection_t *conn, crypt_path_t *layer_hint,
  relay_header_t *rh, int optimistic_data);
 
diff --git a/src/test/test_circuitpadding.c b/src/test/test_circuitpadding.c
index 8575e6ced..915f08661 100644
--- a/src/test/test_circuitpadding.c
+++ b/src/test/test_circuitpadding.c
@@ -3169,7 +3169,7 @@ test_circuitpadding_ignore_non_padding_cells(void *arg)
   rh.command = RELAY_COMMAND_BEGIN;
 
   setup_full_capture_of_logs(LOG_INFO);
-  retval = handle_relay_command(NULL, client_side, NULL, NULL, , 0);
+  retval = handle_relay_cell_command(NULL, client_side, NULL, NULL, , 0);
   tt_int_op(retval, OP_EQ, 0);
   expect_log_msg_containing("Ignored cell");
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Test that regular cells get ignored in padding circuits.

2019-08-05 Thread nickm
commit 1e970d17b8e028ec6bd2fa9e0d88dc54209e0523
Author: George Kadianakis 
Date:   Tue Jul 23 13:52:36 2019 +0300

Test that regular cells get ignored in padding circuits.
---
 src/core/or/relay.c|  8 +++-
 src/core/or/relay.h|  5 +
 src/test/test_circuitpadding.c | 26 ++
 3 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 3b5aa2b66..ac3f2a8bb 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -1584,12 +1584,10 @@ process_sendme_cell(const relay_header_t *rh, const 
cell_t *cell,
  *  unpacked by the parent function, and optimistic_data as set by the
  *  parent function.
  */
-static int
+STATIC int
 handle_relay_command(cell_t *cell, circuit_t *circ,
- edge_connection_t *conn,
- crypt_path_t *layer_hint,
- relay_header_t *rh,
- int optimistic_data)
+ edge_connection_t *conn, crypt_path_t *layer_hint,
+ relay_header_t *rh, int optimistic_data)
 {
   unsigned domain = layer_hint?LD_APP:LD_EXIT;
   int reason;
diff --git a/src/core/or/relay.h b/src/core/or/relay.h
index 79036f97b..d9e0d533f 100644
--- a/src/core/or/relay.h
+++ b/src/core/or/relay.h
@@ -99,6 +99,11 @@ circid_t packed_cell_get_circid(const packed_cell_t *cell, 
int wide_circ_ids);
 uint8_t packed_cell_get_command(const packed_cell_t *cell, int wide_circ_ids);
 
 #ifdef RELAY_PRIVATE
+STATIC int
+handle_relay_command(cell_t *cell, circuit_t *circ,
+ edge_connection_t *conn, crypt_path_t *layer_hint,
+ relay_header_t *rh, int optimistic_data);
+
 STATIC int connected_cell_parse(const relay_header_t *rh, const cell_t *cell,
  tor_addr_t *addr_out, int *ttl_out);
 /** An address-and-ttl tuple as yielded by resolved_cell_parse */
diff --git a/src/test/test_circuitpadding.c b/src/test/test_circuitpadding.c
index 236f4a192..8575e6ced 100644
--- a/src/test/test_circuitpadding.c
+++ b/src/test/test_circuitpadding.c
@@ -4,9 +4,11 @@
 #define CIRCUITPADDING_MACHINES_PRIVATE
 #define NETWORKSTATUS_PRIVATE
 #define CRYPT_PATH_PRIVATE
+#define RELAY_PRIVATE
 
 #include "core/or/or.h"
 #include "test/test.h"
+#include "test/log_test_helpers.h"
 #include "lib/testsupport/testsupport.h"
 #include "core/or/connection_or.h"
 #include "core/or/channel.h"
@@ -3152,6 +3154,29 @@ test_circuitpadding_hs_machines(void *arg)
   UNMOCK(circpad_machine_schedule_padding);
 }
 
+/** Test that we effectively ignore non-padding cells in padding circuits. */
+static void
+test_circuitpadding_ignore_non_padding_cells(void *arg)
+{
+  int retval;
+  relay_header_t rh;
+
+  (void) arg;
+
+  client_side = (circuit_t *)origin_circuit_new();
+  client_side->purpose = CIRCUIT_PURPOSE_C_CIRCUIT_PADDING;
+
+  rh.command = RELAY_COMMAND_BEGIN;
+
+  setup_full_capture_of_logs(LOG_INFO);
+  retval = handle_relay_command(NULL, client_side, NULL, NULL, , 0);
+  tt_int_op(retval, OP_EQ, 0);
+  expect_log_msg_containing("Ignored cell");
+
+ done:
+  ;
+}
+
 #define TEST_CIRCUITPADDING(name, flags) \
 { #name, test_##name, (flags), NULL, NULL }
 
@@ -3175,5 +3200,6 @@ struct testcase_t circuitpadding_tests[] = {
   TEST_CIRCUITPADDING(circuitpadding_token_removal_exact, TT_FORK),
   TEST_CIRCUITPADDING(circuitpadding_manage_circuit_lifetime, TT_FORK),
   TEST_CIRCUITPADDING(circuitpadding_hs_machines, TT_FORK),
+  TEST_CIRCUITPADDING(circuitpadding_ignore_non_padding_cells, TT_FORK),
   END_OF_TESTCASES
 };



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.4.1'

2019-08-05 Thread nickm
commit 54ad92a240d8fe0997bf833272f041ee42de5ffb
Merge: e57209dc3 74c059596
Author: Nick Mathewson 
Date:   Mon Aug 5 09:59:40 2019 -0400

Merge branch 'maint-0.4.1'

 changes/bug30942|  4 
 src/core/or/relay.c | 11 +++
 2 files changed, 15 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Ignore regular cells in padding circuits.

2019-08-05 Thread nickm
commit 74c059596527af67f5df38847e86179852bc7005
Author: George Kadianakis 
Date:   Mon Aug 5 13:47:07 2019 +0300

Ignore regular cells in padding circuits.

Padding circuits were regular cells that got closed before their padding
machine could finish. This means that they can still receive regular cells 
from
their past life, but they have no way or reason to answer them anymore. 
Hence
let's ignore them before they even get to the proper subsystems.
---
 changes/bug30942|  4 
 src/core/or/relay.c | 11 +++
 2 files changed, 15 insertions(+)

diff --git a/changes/bug30942 b/changes/bug30942
new file mode 100644
index 0..bd6b2ff58
--- /dev/null
+++ b/changes/bug30942
@@ -0,0 +1,4 @@
+  o Minor bugfixes (circuit padding):
+- Ignore non-padding cells on padding circuits. This addresses various
+  warning messages from subsystems that were not expecting padding
+  circuits. Fixes bug 30942; bugfix on 0.4.1.1-alpha.
\ No newline at end of file
diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 9f90a0969..9e691a02b 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -1663,6 +1663,17 @@ connection_edge_process_relay_cell(cell_t *cell, 
circuit_t *circ,
   if (circpad_handle_padding_negotiated(circ, cell, layer_hint) == 0)
 circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
   return 0;
+  }
+
+  /* If this is a padding circuit we don't need to parse any other commands
+   * than the padding ones. Just drop them to the floor. */
+  if (circ->purpose == CIRCUIT_PURPOSE_C_CIRCUIT_PADDING) {
+log_info(domain, "Ignored cell (%d) that arrived in padding circuit.",
+ rh.command);
+return 0;
+  }
+
+  switch (rh.command) {
 case RELAY_COMMAND_BEGIN:
 case RELAY_COMMAND_BEGIN_DIR:
   if (layer_hint &&



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.1] Ignore regular cells in padding circuits.

2019-08-05 Thread nickm
commit 74c059596527af67f5df38847e86179852bc7005
Author: George Kadianakis 
Date:   Mon Aug 5 13:47:07 2019 +0300

Ignore regular cells in padding circuits.

Padding circuits were regular cells that got closed before their padding
machine could finish. This means that they can still receive regular cells 
from
their past life, but they have no way or reason to answer them anymore. 
Hence
let's ignore them before they even get to the proper subsystems.
---
 changes/bug30942|  4 
 src/core/or/relay.c | 11 +++
 2 files changed, 15 insertions(+)

diff --git a/changes/bug30942 b/changes/bug30942
new file mode 100644
index 0..bd6b2ff58
--- /dev/null
+++ b/changes/bug30942
@@ -0,0 +1,4 @@
+  o Minor bugfixes (circuit padding):
+- Ignore non-padding cells on padding circuits. This addresses various
+  warning messages from subsystems that were not expecting padding
+  circuits. Fixes bug 30942; bugfix on 0.4.1.1-alpha.
\ No newline at end of file
diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 9f90a0969..9e691a02b 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -1663,6 +1663,17 @@ connection_edge_process_relay_cell(cell_t *cell, 
circuit_t *circ,
   if (circpad_handle_padding_negotiated(circ, cell, layer_hint) == 0)
 circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
   return 0;
+  }
+
+  /* If this is a padding circuit we don't need to parse any other commands
+   * than the padding ones. Just drop them to the floor. */
+  if (circ->purpose == CIRCUIT_PURPOSE_C_CIRCUIT_PADDING) {
+log_info(domain, "Ignored cell (%d) that arrived in padding circuit.",
+ rh.command);
+return 0;
+  }
+
+  switch (rh.command) {
 case RELAY_COMMAND_BEGIN:
 case RELAY_COMMAND_BEGIN_DIR:
   if (layer_hint &&

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.1] Merge branch 'maint-0.4.1' into release-0.4.1

2019-08-05 Thread nickm
commit 53abbc784e5ff377a4f64f47b9a9404228055719
Merge: 3c8a7cb54 74c059596
Author: Nick Mathewson 
Date:   Mon Aug 5 09:59:40 2019 -0400

Merge branch 'maint-0.4.1' into release-0.4.1

 changes/bug30942|  4 
 src/core/or/relay.c | 11 +++
 2 files changed, 15 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.1] Ignore regular cells in padding circuits.

2019-08-05 Thread nickm
commit 74c059596527af67f5df38847e86179852bc7005
Author: George Kadianakis 
Date:   Mon Aug 5 13:47:07 2019 +0300

Ignore regular cells in padding circuits.

Padding circuits were regular cells that got closed before their padding
machine could finish. This means that they can still receive regular cells 
from
their past life, but they have no way or reason to answer them anymore. 
Hence
let's ignore them before they even get to the proper subsystems.
---
 changes/bug30942|  4 
 src/core/or/relay.c | 11 +++
 2 files changed, 15 insertions(+)

diff --git a/changes/bug30942 b/changes/bug30942
new file mode 100644
index 0..bd6b2ff58
--- /dev/null
+++ b/changes/bug30942
@@ -0,0 +1,4 @@
+  o Minor bugfixes (circuit padding):
+- Ignore non-padding cells on padding circuits. This addresses various
+  warning messages from subsystems that were not expecting padding
+  circuits. Fixes bug 30942; bugfix on 0.4.1.1-alpha.
\ No newline at end of file
diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 9f90a0969..9e691a02b 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -1663,6 +1663,17 @@ connection_edge_process_relay_cell(cell_t *cell, 
circuit_t *circ,
   if (circpad_handle_padding_negotiated(circ, cell, layer_hint) == 0)
 circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
   return 0;
+  }
+
+  /* If this is a padding circuit we don't need to parse any other commands
+   * than the padding ones. Just drop them to the floor. */
+  if (circ->purpose == CIRCUIT_PURPOSE_C_CIRCUIT_PADDING) {
+log_info(domain, "Ignored cell (%d) that arrived in padding circuit.",
+ rh.command);
+return 0;
+  }
+
+  switch (rh.command) {
 case RELAY_COMMAND_BEGIN:
 case RELAY_COMMAND_BEGIN_DIR:
   if (layer_hint &&



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits