[tor-commits] [tor/master] Tweak changes file for 25024 to mention "check-typos"

2018-04-22 Thread nickm
commit fa21ac1de615e8a2f6f1b9fca3c3db96a9529197
Author: Nick Mathewson 
Date:   Sun Apr 22 20:52:55 2018 -0400

Tweak changes file for 25024 to mention "check-typos"
---
 changes/ticket25024 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/changes/ticket25024 b/changes/ticket25024
index 0ff22d092..0e5069cf8 100644
--- a/changes/ticket25024
+++ b/changes/ticket25024
@@ -1,3 +1,4 @@
   o Minor features (code quality):
-- Add spell checking using misspell in Makefile.
+- Add optional spell-checking for the Tor codebase, using the "misspell"
+  program.  To use this feature, run "make check-typos".
   Closes ticket 25024.



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


[tor-commits] [tor/master] Add spell check to makefile to check for typos ticket#25024

2018-04-22 Thread nickm
commit 48092540d09d87d6385b227fe255921285371838
Author: Deepesh Pathak 
Date:   Tue Jan 30 03:33:01 2018 +0530

Add spell check to makefile to check for typos ticket#25024

- Use misspell to check for typos in codebase
- Add `make check-typos` to run the checks
- Add `check-typos` to `make check`
---
 Makefile.am | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 04ca88a23..b892c69f7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -97,7 +97,7 @@ doxygen:
 test: all
$(top_builddir)/src/test/test
 
-check-local: check-spaces check-changes
+check-local: check-spaces check-changes check-typos
 
 need-chutney-path:
@if test ! -d "$$CHUTNEY_PATH"; then \
@@ -217,6 +217,26 @@ check-logs:
$(top_srcdir)/scripts/maint/checkLogs.pl \
$(top_srcdir)/src/*/*.[ch] | sort -n
 
+.PHONY: check-typos
+check-typos:
+   @if test -x "`which misspell 2>&1;true`"; then \
+   echo "Checking for Typos ..."; \
+   (`which misspell` \
+   $(top_srcdir)/src/**/*.[ch] \
+   $(top_srcdir)/doc \
+   $(top_srcdir)/contrib \
+   $(top_srcdir)/scripts \
+   $(top_srcdir)/README \
+   $(top_srcdir)/ChangeLog \
+   $(top_srcdir)/INSTALL \
+   $(top_srcdir)/ReleaseNotes \
+   $(top_srcdir)/LICENSE); \
+   else \
+   echo "Tor can use misspell to check for typos."; \
+   echo "It seems that you don't have misspell installed."; \
+   echo "You can install the latest version of misspell here: 
https://github.com/client9/misspell#install;; \
+   fi
+
 .PHONY: check-changes
 check-changes:
 if USEPYTHON



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


[tor-commits] [tor/master] add changes file and update check-typos in makefile

2018-04-22 Thread nickm
commit 72bfcb37f13a22780a0a771f17d3b5953703c815
Author: Deepesh Pathak 
Date:   Sun Apr 15 01:05:49 2018 +0530

add changes file and update check-typos in makefile
---
 ChangeLog   | 2 +-
 Makefile.am | 6 +++---
 changes/ticket25024 | 3 +++
 src/common/crypto_rsa.h | 2 +-
 src/or/protover.c   | 2 +-
 5 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 98da35a07..e0468e4e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -875,7 +875,7 @@ Changes in version 0.3.3.2-alpha - 2018-02-10
   would call the Rust implementation of
   protover_get_supported_protocols(). This was due to the C version
   returning a static string, whereas the Rust version newly allocated
-  a CString to pass accross the FFI boundary. Consequently, the C
+  a CString to pass across the FFI boundary. Consequently, the C
   code was not expecting to need to free() what it was given. Fixes
   bug 25127; bugfix on 0.3.2.1-alpha.
 
diff --git a/Makefile.am b/Makefile.am
index b892c69f7..cccad6c5e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -97,7 +97,7 @@ doxygen:
 test: all
$(top_builddir)/src/test/test
 
-check-local: check-spaces check-changes check-typos
+check-local: check-spaces check-changes
 
 need-chutney-path:
@if test ! -d "$$CHUTNEY_PATH"; then \
@@ -221,8 +221,8 @@ check-logs:
 check-typos:
@if test -x "`which misspell 2>&1;true`"; then \
echo "Checking for Typos ..."; \
-   (`which misspell` \
-   $(top_srcdir)/src/**/*.[ch] \
+   (misspell \
+   $(top_srcdir)/src/[^e]*/*.[ch] \
$(top_srcdir)/doc \
$(top_srcdir)/contrib \
$(top_srcdir)/scripts \
diff --git a/changes/ticket25024 b/changes/ticket25024
new file mode 100644
index 0..0ff22d092
--- /dev/null
+++ b/changes/ticket25024
@@ -0,0 +1,3 @@
+  o Minor features (code quality):
+- Add spell checking using misspell in Makefile.
+  Closes ticket 25024.
diff --git a/src/common/crypto_rsa.h b/src/common/crypto_rsa.h
index 2f5442a5d..e95208931 100644
--- a/src/common/crypto_rsa.h
+++ b/src/common/crypto_rsa.h
@@ -35,7 +35,7 @@
 /** A public key, or a public/private key-pair. */
 typedef struct crypto_pk_t crypto_pk_t;
 
-/* RSA enviroment setup */
+/* RSA environment setup */
 MOCK_DECL(crypto_pk_t *,crypto_pk_new,(void));
 void crypto_pk_free_(crypto_pk_t *env);
 #define crypto_pk_free(pk) FREE_AND_NULL(crypto_pk_t, crypto_pk_free_, (pk))
diff --git a/src/or/protover.c b/src/or/protover.c
index 6532f09c2..18382ba7c 100644
--- a/src/or/protover.c
+++ b/src/or/protover.c
@@ -715,7 +715,7 @@ protover_all_supported(const char *s, char **missing_out)
 versions->high = i;
   }
   /* If the last one to be unsupported is one less than the current
-   * one, we're in a continous range, so set the high field. */
+   * one, we're in a continuous range, so set the high field. */
   if ((versions->high && versions->high == i - 1) ||
   /* Similarly, if the last high wasn't set and we're currently
* one higher than the low, add current index as the highest



___
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 'ticket25024_squashed'

2018-04-22 Thread nickm
commit 915791bc483ca3c8adb63d211afd52b3f98007a9
Merge: 1ba9b7e01 fa21ac1de
Author: Nick Mathewson 
Date:   Sun Apr 22 20:53:04 2018 -0400

Merge branch 'ticket25024_squashed'

 ChangeLog   |  2 +-
 Makefile.am | 20 
 changes/ticket25024 |  4 
 src/common/crypto_rsa.h |  2 +-
 src/or/protover.c   |  2 +-
 5 files changed, 27 insertions(+), 3 deletions(-)

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


[tor-commits] [tor/master] Merge remote-tracking branch 'mikeperry/bug25400_squashed'

2018-04-22 Thread nickm
commit 1ba9b7e0137afc1a4bd6da7dd986ed98999cfbe5
Merge: 0e8ae82a8 f921fd771
Author: Nick Mathewson 
Date:   Sun Apr 22 20:39:35 2018 -0400

Merge remote-tracking branch 'mikeperry/bug25400_squashed'

 changes/bug25400 |  5 +
 src/common/util.c| 13 +
 src/common/util.h|  2 ++
 src/or/command.c | 11 +++
 src/or/connection.c  | 22 +-
 src/or/control.c |  8 
 src/or/relay.c   |  6 ++
 src/test/test_util.c | 18 ++
 8 files changed, 56 insertions(+), 29 deletions(-)

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


[tor-commits] [tor/master] Use u32 add helper for CIRC_BW accounting.

2018-04-22 Thread nickm
commit f921fd771ae51a82d971be064edca86b11f6004b
Author: Mike Perry 
Date:   Mon Apr 2 07:16:19 2018 +

Use u32 add helper for CIRC_BW accounting.

There are quite a few other places this could be used, but keeping it simple
for now.
---
 src/or/command.c | 7 ++-
 src/or/relay.c   | 7 ++-
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/or/command.c b/src/or/command.c
index 18cbbca25..4fa05a18b 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -504,11 +504,8 @@ command_process_relay_cell(cell_t *cell, channel_t *chan)
 origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
 
 /* Count the payload bytes only. We don't care about cell headers */
-if (PREDICT_LIKELY(UINT32_MAX - ocirc->n_read_circ_bw >
-CELL_PAYLOAD_SIZE))
-  ocirc->n_read_circ_bw += (int)CELL_PAYLOAD_SIZE;
-else
-  ocirc->n_read_circ_bw = UINT32_MAX;
+ocirc->n_read_circ_bw = tor_add_u32_nowrap(ocirc->n_read_circ_bw,
+   CELL_PAYLOAD_SIZE);
   }
 
   if (!CIRCUIT_IS_ORIGIN(circ) &&
diff --git a/src/or/relay.c b/src/or/relay.c
index d43720478..472e73b75 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -374,11 +374,8 @@ circuit_package_relay_cell(cell_t *cell, circuit_t *circ,
 
 /* Update circ written totals for control port */
 origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
-if (PREDICT_LIKELY(UINT32_MAX - ocirc->n_written_circ_bw
-  > CELL_PAYLOAD_SIZE))
-  ocirc->n_written_circ_bw += (int)CELL_PAYLOAD_SIZE;
-else
-  ocirc->n_written_circ_bw = UINT32_MAX;
+ocirc->n_written_circ_bw = tor_add_u32_nowrap(ocirc->n_written_circ_bw,
+  CELL_PAYLOAD_SIZE);
 
   } else { /* incoming cell */
 if (CIRCUIT_IS_ORIGIN(circ)) {



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


[tor-commits] [tor/master] Helper function to add u32 without overflow.

2018-04-22 Thread nickm
commit 0e06a9c3e76620881db95718f60441ce7de0f3c9
Author: Mike Perry 
Date:   Mon Apr 2 07:12:15 2018 +

Helper function to add u32 without overflow.
---
 src/common/util.c| 13 +
 src/common/util.h|  2 ++
 src/test/test_util.c | 18 ++
 3 files changed, 33 insertions(+)

diff --git a/src/common/util.c b/src/common/util.c
index 041e7aee3..b14b6f397 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -572,6 +572,19 @@ add_laplace_noise(int64_t signal_, double random_, double 
delta_f,
 return signal_ + noise;
 }
 
+/* Helper: safely add two uint32_t's, capping at UINT32_MAX rather
+ * than overflow */
+uint32_t
+tor_add_u32_nowrap(uint32_t a, uint32_t b)
+{
+  /* a+b > UINT32_MAX check, without overflow */
+  if (PREDICT_UNLIKELY(a > UINT32_MAX - b)) {
+return UINT32_MAX;
+  } else {
+return a+b;
+  }
+}
+
 /* Helper: return greatest common divisor of a,b */
 static uint64_t
 gcd64(uint64_t a, uint64_t b)
diff --git a/src/common/util.h b/src/common/util.h
index ae27e5f01..c0d20e1b2 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -176,6 +176,8 @@ int n_bits_set_u8(uint8_t v);
 int64_t clamp_double_to_int64(double number);
 void simplify_fraction64(uint64_t *numer, uint64_t *denom);
 
+uint32_t tor_add_u32_nowrap(uint32_t a, uint32_t b);
+
 /* Compute the CEIL of a divided by b, for nonnegative a
  * and positive b.  Works on integer types only. Not defined if a+(b-1)
  * can overflow. */
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 24b43c899..350273bf4 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -6050,6 +6050,23 @@ test_util_monotonic_time_add_msec(void *arg)
 }
 
 static void
+test_util_nowrap_math(void *arg)
+{
+  (void)arg;
+
+  tt_u64_op(0, OP_EQ, tor_add_u32_nowrap(0, 0));
+  tt_u64_op(1, OP_EQ, tor_add_u32_nowrap(0, 1));
+  tt_u64_op(1, OP_EQ, tor_add_u32_nowrap(1, 0));
+  tt_u64_op(4, OP_EQ, tor_add_u32_nowrap(2, 2));
+  tt_u64_op(UINT32_MAX, OP_EQ, tor_add_u32_nowrap(UINT32_MAX-1, 2));
+  tt_u64_op(UINT32_MAX, OP_EQ, tor_add_u32_nowrap(2, UINT32_MAX-1));
+  tt_u64_op(UINT32_MAX, OP_EQ, tor_add_u32_nowrap(UINT32_MAX, UINT32_MAX));
+
+ done:
+  ;
+}
+
+static void
 test_util_htonll(void *arg)
 {
   (void)arg;
@@ -6243,6 +6260,7 @@ struct testcase_t util_tests[] = {
   UTIL_TEST(listdir, 0),
   UTIL_TEST(parent_dir, 0),
   UTIL_TEST(ftruncate, 0),
+  UTIL_TEST(nowrap_math, 0),
   UTIL_TEST(num_cpus, 0),
   UTIL_TEST_WIN_ONLY(load_win_lib, 0),
   UTIL_TEST_NO_WIN(exit_status, 0),



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


[tor-commits] [tor/master] Bug 25400: Make CIRC_BW event properly total everything on a circ.

2018-04-22 Thread nickm
commit dfa6808f57e5856edd4e25a957f3f06707264199
Author: Mike Perry 
Date:   Mon Feb 12 09:11:14 2018 +

Bug 25400: Make CIRC_BW event properly total everything on a circ.
---
 changes/bug25400|  5 +
 src/or/command.c| 14 ++
 src/or/connection.c | 22 +-
 src/or/control.c|  8 
 src/or/relay.c  |  9 +
 5 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/changes/bug25400 b/changes/bug25400
new file mode 100644
index 0..cee7ea83b
--- /dev/null
+++ b/changes/bug25400
@@ -0,0 +1,5 @@
+  o Minor bugfix (controler):
+- Make CIRC_BW event reflect the total of all data sent on a circuit,
+  including padding and dropped cells. Also fix a mis-counting bug
+  when STREAM_BW events were enabled. Fixes bug 25400; bugfix on
+  0.2.5.2-alpha.
diff --git a/src/or/command.c b/src/or/command.c
index 4f99462f3..18cbbca25 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -495,6 +495,20 @@ command_process_relay_cell(cell_t *cell, channel_t *chan)
 /* if we're a relay and treating connections with recent local
  * traffic better, then this is one of them. */
 channel_timestamp_client(chan);
+
+/* Count all circuit bytes here for control port accuracy. We want
+ * to count even invalid/dropped relay cells, hence counting
+ * before the recognized check and the connection_edge_process_relay
+ * cell checks.
+ */
+origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
+
+/* Count the payload bytes only. We don't care about cell headers */
+if (PREDICT_LIKELY(UINT32_MAX - ocirc->n_read_circ_bw >
+CELL_PAYLOAD_SIZE))
+  ocirc->n_read_circ_bw += (int)CELL_PAYLOAD_SIZE;
+else
+  ocirc->n_read_circ_bw = UINT32_MAX;
   }
 
   if (!CIRCUIT_IS_ORIGIN(circ) &&
diff --git a/src/or/connection.c b/src/or/connection.c
index 957398985..e8ecf0db9 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -3479,25 +3479,15 @@ connection_buf_read_from_socket(connection_t *conn, 
ssize_t *max_to_read,
  /* change *max_to_read */
 *max_to_read = at_most - n_read;
 
-/* Update edge_conn->n_read and ocirc->n_read_circ_bw */
+/* Update edge_conn->n_read */
 if (conn->type == CONN_TYPE_AP) {
   edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
-  circuit_t *circ = circuit_get_by_edge_conn(edge_conn);
-  origin_circuit_t *ocirc;
 
   /* Check for overflow: */
   if (PREDICT_LIKELY(UINT32_MAX - edge_conn->n_read > n_read))
 edge_conn->n_read += (int)n_read;
   else
 edge_conn->n_read = UINT32_MAX;
-
-  if (circ && CIRCUIT_IS_ORIGIN(circ)) {
-ocirc = TO_ORIGIN_CIRCUIT(circ);
-if (PREDICT_LIKELY(UINT32_MAX - ocirc->n_read_circ_bw > n_read))
-  ocirc->n_read_circ_bw += (int)n_read;
-else
-  ocirc->n_read_circ_bw = UINT32_MAX;
-  }
 }
 
 /* If CONN_BW events are enabled, update conn->n_read_conn_bw for
@@ -3815,22 +3805,12 @@ connection_handle_write_impl(connection_t *conn, int 
force)
 
   if (n_written && conn->type == CONN_TYPE_AP) {
 edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
-circuit_t *circ = circuit_get_by_edge_conn(edge_conn);
-origin_circuit_t *ocirc;
 
 /* Check for overflow: */
 if (PREDICT_LIKELY(UINT32_MAX - edge_conn->n_written > n_written))
   edge_conn->n_written += (int)n_written;
 else
   edge_conn->n_written = UINT32_MAX;
-
-if (circ && CIRCUIT_IS_ORIGIN(circ)) {
-  ocirc = TO_ORIGIN_CIRCUIT(circ);
-  if (PREDICT_LIKELY(UINT32_MAX - ocirc->n_written_circ_bw > n_written))
-ocirc->n_written_circ_bw += (int)n_written;
-  else
-ocirc->n_written_circ_bw = UINT32_MAX;
-}
   }
 
   /* If CONN_BW events are enabled, update conn->n_written_conn_bw for
diff --git a/src/or/control.c b/src/or/control.c
index 0539ddaca..016fd46a4 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -5800,8 +5800,6 @@ control_event_or_conn_status(or_connection_t *conn, 
or_conn_status_event_t tp,
 int
 control_event_stream_bandwidth(edge_connection_t *edge_conn)
 {
-  circuit_t *circ;
-  origin_circuit_t *ocirc;
   struct timeval now;
   char tbuf[ISO_TIME_USEC_LEN+1];
   if (EVENT_IS_INTERESTING(EVENT_STREAM_BANDWIDTH_USED)) {
@@ -5817,12 +5815,6 @@ control_event_stream_bandwidth(edge_connection_t 
*edge_conn)
(unsigned long)edge_conn->n_written,
tbuf);
 
-circ = circuit_get_by_edge_conn(edge_conn);
-if (circ && CIRCUIT_IS_ORIGIN(circ)) {
-  ocirc = TO_ORIGIN_CIRCUIT(circ);
-  ocirc->n_read_circ_bw += edge_conn->n_read;
-  ocirc->n_written_circ_bw += edge_conn->n_written;
-}
 edge_conn->n_written = edge_conn->n_read = 0;
   }
 
diff --git a/src/or/relay.c b/src/or/relay.c
index 72a902d8b..d43720478 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -371,6 +371,15 @@ 

[tor-commits] [torspec/master] Merge remote-tracking branch 'public/bug24378_spec'

2018-04-22 Thread nickm
commit fb33ac263fc0b008dd1f568dd4b5d6e89e636f23
Merge: f59414d 708d046
Author: Nick Mathewson 
Date:   Sun Apr 22 20:02:09 2018 -0400

Merge remote-tracking branch 'public/bug24378_spec'

 dir-spec.txt | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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


[tor-commits] [torspec/master] Change the oldest-allowed consensus method to 25.

2018-04-22 Thread nickm
commit 708d0462d44a0adf02b5104e6a94609352866311
Author: Nick Mathewson 
Date:   Mon Apr 16 14:36:24 2018 -0400

Change the oldest-allowed consensus method to 25.
---
 dir-spec.txt | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dir-spec.txt b/dir-spec.txt
index 1adfe69..5f2a713 100644
--- a/dir-spec.txt
+++ b/dir-spec.txt
@@ -2793,6 +2793,9 @@
 * If consensus-method 24 or later is in use, then routers that
   do not have the Valid flag are not listed at all.
 
+[ As of 0.3.4.1-alpha, authorities no longer advertise or negotiate
+  any consensus methods lower than 25. ]
+
 * If consensus-method 25 or later is in use, then we vote
   on recommended-protocols and required-protocols lines in the
   consensus.  We also include protocols lines in routerstatus
@@ -2899,11 +2902,11 @@
method that it supports (which will probably not result in a sufficiently
signed consensus).
 
-   All authorities MUST support method 13; authorities SHOULD support
+   All authorities MUST support method 25; authorities SHOULD support
more recent methods as well.  Authorities SHOULD NOT support or
-   advertise support for any method before 13.  Clients MAY assume that
+   advertise support for any method before 25.  Clients MAY assume that
they will never see a current valid signed consensus for any method
-   before method 13.
+   before method 25.
 
(The consensuses generated by new methods must be parsable by
implementations that only understand the old methods, and must not cause



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


[tor-commits] [tor/master] Remove MIN_METHOD_{FOR_P6_LINES, FOR_NTOR_KEY, TO_CLIP_UNMEASURED_BW}

2018-04-22 Thread nickm
commit 93380db8333609b8613a1e987894c6f1fd8be6aa
Author: Nick Mathewson 
Date:   Mon Apr 9 14:51:36 2018 -0400

Remove MIN_METHOD_{FOR_P6_LINES,FOR_NTOR_KEY,TO_CLIP_UNMEASURED_BW}

Also remove a unit test for pre-MIN_METHOD_FOR_NTOR_KEY consensuses.
---
 src/or/dirvote.c  | 14 +-
 src/or/dirvote.h  | 11 ---
 src/test/test_microdesc.c | 11 ---
 3 files changed, 5 insertions(+), 31 deletions(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 1985d9067..334ebfb7f 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1601,7 +1601,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
 smartlist_free(dir_sources);
   }
 
-  if (consensus_method >= MIN_METHOD_TO_CLIP_UNMEASURED_BW) {
+  {
 char *max_unmeasured_param = NULL;
 /*  Extract this code into a common function.  Or don't!  see #19011 */
 if (params) {
@@ -1989,8 +1989,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
 rs_out.has_bandwidth = 1;
 rs_out.bw_is_unmeasured = 1;
 rs_out.bandwidth_kb = median_uint32(bandwidths_kb, num_bandwidths);
-if (consensus_method >= MIN_METHOD_TO_CLIP_UNMEASURED_BW &&
-n_authorities_measuring_bandwidth > 2) {
+if (n_authorities_measuring_bandwidth > 2) {
   /* Cap non-measured bandwidths. */
   if (rs_out.bandwidth_kb > max_unmeasured_bw_kb) {
 rs_out.bandwidth_kb = max_unmeasured_bw_kb;
@@ -2130,8 +2129,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
   /* Now the weight line. */
   if (rs_out.has_bandwidth) {
 char *guardfraction_str = NULL;
-int unmeasured = rs_out.bw_is_unmeasured &&
-  consensus_method >= MIN_METHOD_TO_CLIP_UNMEASURED_BW;
+int unmeasured = rs_out.bw_is_unmeasured;
 
 /* If we have guardfraction info, include it in the 'w' line. */
 if (rs_out.has_guardfraction) {
@@ -3833,8 +3831,7 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, 
int consensus_method)
 
   smartlist_add_asprintf(chunks, "onion-key\n%s", key);
 
-  if (consensus_method >= MIN_METHOD_FOR_NTOR_KEY &&
-  ri->onion_curve25519_pkey) {
+  if (ri->onion_curve25519_pkey) {
 char kbuf[128];
 base64_encode(kbuf, sizeof(kbuf),
   (const char*)ri->onion_curve25519_pkey->public_key,
@@ -3855,8 +3852,7 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, 
int consensus_method)
   if (summary && strcmp(summary, "reject 1-65535"))
 smartlist_add_asprintf(chunks, "p %s\n", summary);
 
-  if (consensus_method >= MIN_METHOD_FOR_P6_LINES &&
-  ri->ipv6_exit_policy) {
+  if (ri->ipv6_exit_policy) {
 /* +++ This doesn't match proposal 208, which says these should
  * be taken unchanged from the routerinfo.  That's bogosity, IMO:
  * the proposal should have said to do this instead.*/
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index 9c7916a9b..311bc61e1 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -61,17 +61,6 @@
 /** The highest consensus method that we currently support. */
 #define MAX_SUPPORTED_CONSENSUS_METHOD 28
 
-/** Lowest consensus method where microdescs may include a "p6" line. */
-#define MIN_METHOD_FOR_P6_LINES 15
-
-/** Lowest consensus method where microdescs may include an onion-key-ntor
- * line */
-#define MIN_METHOD_FOR_NTOR_KEY 16
-
-/** Lowest consensus method that ensures that authorities output an
- * Unmeasured=1 flag for unmeasured bandwidths */
-#define MIN_METHOD_TO_CLIP_UNMEASURED_BW 17
-
 /** Lowest consensus method where authorities may include an "id" line in
  * microdescriptors. */
 #define MIN_METHOD_FOR_ID_HASH_IN_MD 18
diff --git a/src/test/test_microdesc.c b/src/test/test_microdesc.c
index 59b28f758..c0eced1bb 100644
--- a/src/test/test_microdesc.c
+++ b/src/test/test_microdesc.c
@@ -385,15 +385,6 @@ static const char test_ri2[] =
   "cf34GXHv61XReJF3AlzNHFpbrPOYmowmhrTULKyMqow=\n"
   "-END SIGNATURE-\n";
 
-static const char test_md_8[] =
-  "onion-key\n"
-  "-BEGIN RSA PUBLIC KEY-\n"
-  "MIGJAoGBANBJz8Vldl12aFeSMPLiA4nOetLDN0oxU8bB1SDhO7Uu2zdWYVYAF5J0\n"
-  "st7WvrVy/jA9v/fsezNAPskBanecHRSkdMTpkcgRPMHE7CTGEwIy1Yp1X4bPgDlC\n"
-  "VCnbs5Pcts5HnWEYNK7qHDAUn+IlmjOO+pTUY8uyq+GQVz6H9wFlAgMBAAE=\n"
-  "-END RSA PUBLIC KEY-\n"
-  "p reject 25,119,135-139,445,563,1214,4661-4666,6346-6429,6699,6881-6999\n";
-
 static const char test_md_16[] =
   "onion-key\n"
   "-BEGIN RSA PUBLIC KEY-\n"
@@ -444,8 +435,6 @@ test_md_generate(void *arg)
 
   ri = router_parse_entry_from_string(test_ri, NULL, 0, 0, NULL, NULL);
   tt_assert(ri);
-  md = dirvote_create_microdescriptor(ri, 8);
-  tt_str_op(md->body, OP_EQ, test_md_8);
 
   /*  test family lines. */
   /*  test method 14 for A lines. */



___
tor-commits mailing list
tor-commits@lists.torproject.org

[tor-commits] [tor/master] Add a changes file for removing old consensus methods

2018-04-22 Thread nickm
commit ade3c7400761229a54c9a1280833672e35452176
Author: Nick Mathewson 
Date:   Mon Apr 9 15:13:37 2018 -0400

Add a changes file for removing old consensus methods

(Ticket 24378; proposal 290.)
---
 changes/24378 | 8 
 1 file changed, 8 insertions(+)

diff --git a/changes/24378 b/changes/24378
new file mode 100644
index 0..663d27e96
--- /dev/null
+++ b/changes/24378
@@ -0,0 +1,8 @@
+  o Removed features:
+
+- Directory authorities will no longer support voting according to any
+  consensus method before consensus method 25. This keeps authorities
+  compatible with all authorities running 0.2.9.8 and later, and does
+  not break any clients or relays. Implements ticket 24378 and
+  proposal 290.
+



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


[tor-commits] [tor/master] Remove MIN_METHOD_FOR_ID_HASH_IN_MD and a test for running without it.

2018-04-22 Thread nickm
commit caf766991dfd82dd1599ce90adc8afb9e749f468
Author: Nick Mathewson 
Date:   Mon Apr 9 14:54:46 2018 -0400

Remove MIN_METHOD_FOR_ID_HASH_IN_MD and a test for running without it.
---
 src/or/dirvote.c  |  2 +-
 src/or/dirvote.h  |  4 
 src/test/test_microdesc.c | 19 ---
 3 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 334ebfb7f..1a21def46 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -3862,7 +3862,7 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, 
int consensus_method)
 tor_free(p6);
   }
 
-  if (consensus_method >= MIN_METHOD_FOR_ID_HASH_IN_MD) {
+  {
 char idbuf[ED25519_BASE64_LEN+1];
 const char *keytype;
 if (consensus_method >= MIN_METHOD_FOR_ED25519_ID_IN_MD &&
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index 311bc61e1..334dc0732 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -61,10 +61,6 @@
 /** The highest consensus method that we currently support. */
 #define MAX_SUPPORTED_CONSENSUS_METHOD 28
 
-/** Lowest consensus method where authorities may include an "id" line in
- * microdescriptors. */
-#define MIN_METHOD_FOR_ID_HASH_IN_MD 18
-
 /** Lowest consensus method where we include "package" lines*/
 #define MIN_METHOD_FOR_PACKAGE_LINES 19
 
diff --git a/src/test/test_microdesc.c b/src/test/test_microdesc.c
index c0eced1bb..fc565ebf3 100644
--- a/src/test/test_microdesc.c
+++ b/src/test/test_microdesc.c
@@ -385,16 +385,6 @@ static const char test_ri2[] =
   "cf34GXHv61XReJF3AlzNHFpbrPOYmowmhrTULKyMqow=\n"
   "-END SIGNATURE-\n";
 
-static const char test_md_16[] =
-  "onion-key\n"
-  "-BEGIN RSA PUBLIC KEY-\n"
-  "MIGJAoGBANBJz8Vldl12aFeSMPLiA4nOetLDN0oxU8bB1SDhO7Uu2zdWYVYAF5J0\n"
-  "st7WvrVy/jA9v/fsezNAPskBanecHRSkdMTpkcgRPMHE7CTGEwIy1Yp1X4bPgDlC\n"
-  "VCnbs5Pcts5HnWEYNK7qHDAUn+IlmjOO+pTUY8uyq+GQVz6H9wFlAgMBAAE=\n"
-  "-END RSA PUBLIC KEY-\n"
-  "ntor-onion-key Gg73xH7+kTfT6bi1uNVx9gwQdQas9pROIfmc4NpAdC4=\n"
-  "p reject 25,119,135-139,445,563,1214,4661-4666,6346-6429,6699,6881-6999\n";
-
 static const char test_md_18[] =
   "onion-key\n"
   "-BEGIN RSA PUBLIC KEY-\n"
@@ -436,15 +426,6 @@ test_md_generate(void *arg)
   ri = router_parse_entry_from_string(test_ri, NULL, 0, 0, NULL, NULL);
   tt_assert(ri);
 
-  /*  test family lines. */
-  /*  test method 14 for A lines. */
-  /*  test method 15 for P6 lines. */
-
-  microdesc_free(md);
-  md = NULL;
-  md = dirvote_create_microdescriptor(ri, 16);
-  tt_str_op(md->body, OP_EQ, test_md_16);
-
   microdesc_free(md);
   md = NULL;
   md = dirvote_create_microdescriptor(ri, 18);



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


[tor-commits] [tor/master] Require MIN_METHOD_FOR_RECOMMENDED_PROTOCOLS

2018-04-22 Thread nickm
commit 2609a8be81c744f1c3568c83cce035836ec50758
Author: Nick Mathewson 
Date:   Mon Apr 9 15:10:27 2018 -0400

Require MIN_METHOD_FOR_RECOMMENDED_PROTOCOLS

(Remove support for running without this method.)
---
 src/or/dirvote.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 25ca961fa..f3b8a19f0 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1504,7 +1504,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
 tor_free(flaglist);
   }
 
-  if (consensus_method >= MIN_METHOD_FOR_RECOMMENDED_PROTOCOLS) {
+  {
 int num_dirauth = get_n_authorities(V3_DIRINFO);
 int idx;
 for (idx = 0; idx < 4; ++idx) {



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


[tor-commits] [tor/master] Remove MIN_METHOD_FOR_ED25519_ID_VOTING

2018-04-22 Thread nickm
commit 73c9c16faab299b483716c1b8e76c433282d3d50
Author: Nick Mathewson 
Date:   Mon Apr 9 15:02:57 2018 -0400

Remove MIN_METHOD_FOR_ED25519_ID_VOTING

This also lets us remove the old rsa-based routerstatus collator.
---
 src/or/dircollate.c | 38 +++---
 src/or/dirvote.c|  7 ++-
 src/or/dirvote.h|  4 
 3 files changed, 5 insertions(+), 44 deletions(-)

diff --git a/src/or/dircollate.c b/src/or/dircollate.c
index ce4534ff6..dec6f7515 100644
--- a/src/or/dircollate.c
+++ b/src/or/dircollate.c
@@ -25,7 +25,6 @@
 #include "dircollate.h"
 #include "dirvote.h"
 
-static void dircollator_collate_by_rsa(dircollator_t *dc);
 static void dircollator_collate_by_ed25519(dircollator_t *dc);
 
 /** Hashtable entry mapping a pair of digests (actually an ed25519 key and an
@@ -208,49 +207,18 @@ dircollator_add_vote(dircollator_t *dc, networkstatus_t 
*v)
 void
 dircollator_collate(dircollator_t *dc, int consensus_method)
 {
+  (void) consensus_method;
+
   tor_assert(!dc->is_collated);
   dc->all_rsa_sha1_lst = smartlist_new();
 
-  if (consensus_method < MIN_METHOD_FOR_ED25519_ID_VOTING)
-dircollator_collate_by_rsa(dc);
-  else
-dircollator_collate_by_ed25519(dc);
+  dircollator_collate_by_ed25519(dc);
 
   smartlist_sort_digests(dc->all_rsa_sha1_lst);
   dc->is_collated = 1;
 }
 
 /**
- * Collation function for RSA-only consensuses: collate the votes for each
- * entry in dc by their RSA keys.
- *
- * The rule is:
- *If an RSA identity key is listed by more than half of the authorities,
- *include that identity, and treat all descriptors with that RSA identity
- *as describing the same router.
- */
-static void
-dircollator_collate_by_rsa(dircollator_t *dc)
-{
-  const int total_authorities = dc->n_authorities;
-
-  DIGESTMAP_FOREACH(dc->by_rsa_sha1, k, vote_routerstatus_t **, vrs_lst) {
-int n = 0, i;
-for (i = 0; i < dc->n_votes; ++i) {
-  if (vrs_lst[i] != NULL)
-++n;
-}
-
-if (n <= total_authorities / 2)
-  continue;
-
-smartlist_add(dc->all_rsa_sha1_lst, (char *)k);
-  } DIGESTMAP_FOREACH_END;
-
-  dc->by_collated_rsa_sha1 = dc->by_rsa_sha1;
-}
-
-/**
  * Collation function for ed25519 consensuses: collate the votes for each
  * entry in dc by ed25519 key and by RSA key.
  *
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 80db32eb5..6b553083b 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1455,8 +1455,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
 smartlist_free(combined_server_versions);
 smartlist_free(combined_client_versions);
 
-if (consensus_method >= MIN_METHOD_FOR_ED25519_ID_VOTING)
-  smartlist_add_strdup(flags, "NoEdConsensus");
+smartlist_add_strdup(flags, "NoEdConsensus");
 
 smartlist_sort_strings(flags);
 smartlist_uniq_strings(flags);
@@ -1852,7 +1851,6 @@ networkstatus_compute_consensus(smartlist_t *votes,
 continue;
 
   if (ed_consensus > 0) {
-tor_assert(consensus_method >= MIN_METHOD_FOR_ED25519_ID_VOTING);
 if (ed_consensus <= total_authorities / 2) {
   log_warn(LD_BUG, "Not enough entries had ed_consensus set; how "
"can we have a consensus of %d?", ed_consensus);
@@ -1910,8 +1908,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
 } else if (!strcmp(fl, "Unnamed")) {
   if (is_unnamed)
 smartlist_add(chosen_flags, (char*)fl);
-} else if (!strcmp(fl, "NoEdConsensus") &&
-   consensus_method >= MIN_METHOD_FOR_ED25519_ID_VOTING) {
+} else if (!strcmp(fl, "NoEdConsensus")) {
   if (ed_consensus <= total_authorities/2)
 smartlist_add(chosen_flags, (char*)fl);
 } else {
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index 14fa8e0ad..defcdf575 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -61,10 +61,6 @@
 /** The highest consensus method that we currently support. */
 #define MAX_SUPPORTED_CONSENSUS_METHOD 28
 
-/** Lowest consensus method where authorities vote on ed25519 ids and ensure
- * ed25519 id consistency. */
-#define MIN_METHOD_FOR_ED25519_ID_VOTING 22
-
 /** Lowest consensus method where authorities may include a shared random
  * value(s). */
 #define MIN_METHOD_FOR_SHARED_RANDOM 23



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


[tor-commits] [tor/master] Remove MIN_METHOD_FOR and MIN_METHOD_FOR_A_LINES

2018-04-22 Thread nickm
commit 08373467b10a3e3c4765835d1820f86741b9f307
Author: Nick Mathewson 
Date:   Mon Apr 9 14:44:03 2018 -0400

Remove MIN_METHOD_FOR and MIN_METHOD_FOR_A_LINES

Also, in networkstatus.c, remove client code for recognizing pre-
MIN_METHOD_FOR_A_LINES consensuses, and corresponding unit tests in
test_dir.c.
---
 src/or/dirvote.c   | 15 ++-
 src/or/dirvote.h   |  7 ---
 src/or/networkstatus.c |  2 +-
 src/test/test_dir.c| 18 +-
 4 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 265715505..1985d9067 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -549,12 +549,12 @@ compute_routerstatus_consensus(smartlist_t *votes, int 
consensus_method,
 
   tor_assert(most);
 
-  /* If we're producing "a" lines, vote on potential alternative (sets
-   * of) OR port(s) in the winning routerstatuses.
+  /* Vote on potential alternative (sets of) OR port(s) in the winning
+   * routerstatuses.
*
* XXX prop186 There's at most one alternative OR port (_the_ IPv6
* port) for now. */
-  if (consensus_method >= MIN_METHOD_FOR_A_LINES && best_alt_orport_out) {
+  if (best_alt_orport_out) {
 smartlist_t *alt_orports = smartlist_new();
 const tor_addr_port_t *most_alt_orport = NULL;
 
@@ -1890,10 +1890,8 @@ networkstatus_compute_consensus(smartlist_t *votes,
   rs_out.published_on = rs->status.published_on;
   rs_out.dir_port = rs->status.dir_port;
   rs_out.or_port = rs->status.or_port;
-  if (consensus_method >= MIN_METHOD_FOR_A_LINES) {
-tor_addr_copy(_out.ipv6_addr, _orport.addr);
-rs_out.ipv6_orport = alt_orport.port;
-  }
+  tor_addr_copy(_out.ipv6_addr, _orport.addr);
+  rs_out.ipv6_orport = alt_orport.port;
   rs_out.has_bandwidth = 0;
   rs_out.has_exitsummary = 0;
 
@@ -3846,8 +3844,7 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, 
int consensus_method)
 
   /* We originally put a lines in the micrdescriptors, but then we worked out
* that we needed them in the microdesc consensus. See #20916. */
-  if (consensus_method >= MIN_METHOD_FOR_A_LINES &&
-  consensus_method < MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC &&
+  if (consensus_method < MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC &&
   !tor_addr_is_null(>ipv6_addr) && ri->ipv6_orport)
 smartlist_add_asprintf(chunks, "a %s\n",
fmt_addrport(>ipv6_addr, ri->ipv6_orport));
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index 91da4edee..9c7916a9b 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -61,13 +61,6 @@
 /** The highest consensus method that we currently support. */
 #define MAX_SUPPORTED_CONSENSUS_METHOD 28
 
-/** Lowest consensus method where microdesc consensuses omit any entry
- * with no microdesc. */
-#define MIN_METHOD_FOR_MANDATORY_MICRODESC 13
-
-/** Lowest consensus method that contains "a" lines. */
-#define MIN_METHOD_FOR_A_LINES 14
-
 /** Lowest consensus method where microdescs may include a "p6" line. */
 #define MIN_METHOD_FOR_P6_LINES 15
 
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 235b95b70..d7088a167 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1528,7 +1528,7 @@ networkstatus_consensus_has_ipv6(const or_options_t* 
options)
 return
cons->consensus_method >= MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS;
   } else {
-return cons->consensus_method >= MIN_METHOD_FOR_A_LINES;
+return 1;
   }
 }
 
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 6cafa7cb3..e5355069a 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -5771,22 +5771,10 @@ test_dir_networkstatus_consensus_has_ipv6(void *arg)
   /* Test the bounds for A lines in the NS consensus */
   mock_options->UseMicrodescriptors = 0;
 
-  mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES;
+  mock_networkstatus->consensus_method = MIN_SUPPORTED_CONSENSUS_METHOD;
   has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
   tt_assert(has_ipv6);
 
-  mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES + 1;
-  has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
-  tt_assert(has_ipv6);
-
-  mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES + 20;
-  has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
-  tt_assert(has_ipv6);
-
-  mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES - 1;
-  has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
-  tt_assert(!has_ipv6);
-
   /* Test the bounds for A lines in the microdesc consensus */
   mock_options->UseMicrodescriptors = 1;
 
@@ -5795,6 +5783,10 @@ test_dir_networkstatus_consensus_has_ipv6(void *arg)
   has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
   tt_assert(has_ipv6);
 
+  mock_networkstatus->consensus_method = MAX_SUPPORTED_CONSENSUS_METHOD + 20;
+  has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
+  

[tor-commits] [tor/master] Remove MIN_METHOD_FOR_{PACKAGE_LINES, GUARDFRACTION, ED25519_ID_IN_MD}

2018-04-22 Thread nickm
commit 4d6f21bb6b43fb79bb4a659ced8aa898a42389a8
Author: Nick Mathewson 
Date:   Mon Apr 9 14:59:34 2018 -0400

Remove MIN_METHOD_FOR_{PACKAGE_LINES,GUARDFRACTION,ED25519_ID_IN_MD}

Also remove a rest for pre-19 microdesc versions.
---
 src/or/dirvote.c  | 19 +++
 src/or/dirvote.h  | 12 
 src/test/test_microdesc.c | 15 ---
 3 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 1a21def46..80db32eb5 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -664,13 +664,6 @@ compute_consensus_method(smartlist_t *votes)
 static int
 consensus_method_is_supported(int method)
 {
-  if (method == MIN_METHOD_FOR_ED25519_ID_IN_MD) {
-/* This method was broken due to buggy code accidentally left in
- * dircollate.c; do not actually use it.
- */
-return 0;
-  }
-
   return (method >= MIN_SUPPORTED_CONSENSUS_METHOD) &&
 (method <= MAX_SUPPORTED_CONSENSUS_METHOD);
 }
@@ -1455,11 +1448,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
   n_versioning_servers);
 client_versions = compute_consensus_versions_list(combined_client_versions,
   n_versioning_clients);
-if (consensus_method >= MIN_METHOD_FOR_PACKAGE_LINES) {
-  packages = compute_consensus_package_lines(votes);
-} else {
-  packages = tor_strdup("");
-}
+packages = compute_consensus_package_lines(votes);
 
 SMARTLIST_FOREACH(combined_server_versions, char *, cp, tor_free(cp));
 SMARTLIST_FOREACH(combined_client_versions, char *, cp, tor_free(cp));
@@ -1971,8 +1960,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
 
   /* If it's a guard and we have enough guardfraction votes,
  calculate its consensus guardfraction value. */
-  if (is_guard && num_guardfraction_inputs > 2 &&
-  consensus_method >= MIN_METHOD_FOR_GUARDFRACTION) {
+  if (is_guard && num_guardfraction_inputs > 2) {
 rs_out.has_guardfraction = 1;
 rs_out.guardfraction_percentage = median_uint32(measured_guardfraction,
  num_guardfraction_inputs);
@@ -3865,8 +3853,7 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, 
int consensus_method)
   {
 char idbuf[ED25519_BASE64_LEN+1];
 const char *keytype;
-if (consensus_method >= MIN_METHOD_FOR_ED25519_ID_IN_MD &&
-ri->cache_info.signing_key_cert &&
+if (ri->cache_info.signing_key_cert &&
 ri->cache_info.signing_key_cert->signing_key_included) {
   keytype = "ed25519";
   ed25519_public_to_base64(idbuf,
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index 334dc0732..14fa8e0ad 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -61,18 +61,6 @@
 /** The highest consensus method that we currently support. */
 #define MAX_SUPPORTED_CONSENSUS_METHOD 28
 
-/** Lowest consensus method where we include "package" lines*/
-#define MIN_METHOD_FOR_PACKAGE_LINES 19
-
-/** Lowest consensus method where authorities may include
- * GuardFraction information in microdescriptors. */
-#define MIN_METHOD_FOR_GUARDFRACTION 20
-
-/** Lowest consensus method where authorities may include an "id" line for
- * ed25519 identities in microdescriptors. (Broken; see
- * consensus_method_is_supported() for more info.) */
-#define MIN_METHOD_FOR_ED25519_ID_IN_MD 21
-
 /** Lowest consensus method where authorities vote on ed25519 ids and ensure
  * ed25519 id consistency. */
 #define MIN_METHOD_FOR_ED25519_ID_VOTING 22
diff --git a/src/test/test_microdesc.c b/src/test/test_microdesc.c
index fc565ebf3..3d02fc1a5 100644
--- a/src/test/test_microdesc.c
+++ b/src/test/test_microdesc.c
@@ -396,16 +396,6 @@ static const char test_md_18[] =
   "p reject 25,119,135-139,445,563,1214,4661-4666,6346-6429,6699,6881-6999\n"
   "id rsa1024 Cd47okjCHD83YGzThGBDptXs9Z4\n";
 
-static const char test_md2_18[] =
-  "onion-key\n"
-  "-BEGIN RSA PUBLIC KEY-\n"
-  "MIGJAoGBAL2R8EfubUcahxha4u02P4VAR0llQIMwFAmrHPjzcK7apcQgDOf2ovOA\n"
-  "+YQnJFxlpBmCoCZC6ssCi+9G0mqo650lFuTMP5I90BdtjotfzESfTykHLiChyvhd\n"
-  "l0dlqclb2SU/GKem/fLRXH16aNi72CdSUu/1slKs/70ILi34QixRAgMBAAE=\n"
-  "-END RSA PUBLIC KEY-\n"
-  "ntor-onion-key hbxdRnfVUJJY7+KcT4E3Rs7/zuClbN3hJrjSBiEGMgI=\n"
-  "id rsa1024 t+J/EEITw28T5+mCkYKEXklZl6A\n";
-
 static const char test_md2_21[] =
   "onion-key\n"
   "-BEGIN RSA PUBLIC KEY-\n"
@@ -441,11 +431,6 @@ test_md_generate(void *arg)
 
   microdesc_free(md);
   md = NULL;
-  md = dirvote_create_microdescriptor(ri, 18);
-  tt_str_op(md->body, OP_EQ, test_md2_18);
-
-  microdesc_free(md);
-  md = NULL;
   md = dirvote_create_microdescriptor(ri, 21);
   tt_str_op(md->body, OP_EQ, test_md2_21);
   tt_assert(ed25519_pubkey_eq(md->ed25519_identity_pkey,



___
tor-commits mailing list

[tor-commits] [tor/master] Merge branch 'remove_old_consensus_methods_2018_squashed'

2018-04-22 Thread nickm
commit 0e8ae82a8757fb8bb2850f1a3d59ad1dfb468556
Merge: 6773102c9 ade3c7400
Author: Nick Mathewson 
Date:   Sun Apr 22 20:01:09 2018 -0400

Merge branch 'remove_old_consensus_methods_2018_squashed'

 changes/24378 |  8 ++
 src/or/dircollate.c   | 38 ++---
 src/or/dirvote.c  | 72 ++-
 src/or/dirvote.h  | 48 +--
 src/or/networkstatus.c|  2 +-
 src/or/routerparse.c  |  3 +-
 src/test/test_dir.c   | 48 ++-
 src/test/test_microdesc.c | 45 -
 8 files changed, 50 insertions(+), 214 deletions(-)

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


[tor-commits] [tor/master] Remove MIN_METHOD_FOR_{SHARED_RANDOM, EXCLUDING_INVALID_NODES}

2018-04-22 Thread nickm
commit 5f90d28c01960921ad1cd680ba7e1275a44345c0
Author: Nick Mathewson 
Date:   Mon Apr 9 15:07:51 2018 -0400

Remove MIN_METHOD_FOR_{SHARED_RANDOM,EXCLUDING_INVALID_NODES}

Also remove client detection for pre-EXCLUDING_INVALID_NODES
consensuses, and a test for that detection.
---
 src/or/dirvote.c |  5 ++---
 src/or/dirvote.h |  8 
 src/or/routerparse.c |  3 +--
 src/test/test_dir.c  | 16 ++--
 4 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 6b553083b..25ca961fa 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1524,7 +1524,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
 smartlist_add_strdup(chunks, "\n");
   }
 
-  if (consensus_method >= MIN_METHOD_FOR_SHARED_RANDOM) {
+  {
 int num_dirauth = get_n_authorities(V3_DIRINFO);
 /* Default value of this is 2/3 of the total number of authorities. For
  * instance, if we have 9 dirauth, the default value is 6. The following
@@ -1935,8 +1935,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
 
   /* Starting with consensus method 24, we don't list servers
* that are not valid in a consensus.  See Proposal 272 */
-  if (!is_valid &&
-  consensus_method >= MIN_METHOD_FOR_EXCLUDING_INVALID_NODES)
+  if (!is_valid)
 continue;
 
   /* Pick the version. */
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index defcdf575..8a317deb4 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -61,14 +61,6 @@
 /** The highest consensus method that we currently support. */
 #define MAX_SUPPORTED_CONSENSUS_METHOD 28
 
-/** Lowest consensus method where authorities may include a shared random
- * value(s). */
-#define MIN_METHOD_FOR_SHARED_RANDOM 23
-
-/** Lowest consensus method where authorities drop all nodes that don't get
- * the Valid flag. */
-#define MIN_METHOD_FOR_EXCLUDING_INVALID_NODES 24
-
 /** Lowest consensus method where authorities vote on required/recommended
  * protocols. */
 #define MIN_METHOD_FOR_RECOMMENDED_PROTOCOLS 25
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 79499f2e6..1834cfad2 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -2743,8 +2743,7 @@ routerstatus_parse_entry_from_string(memarea_t *area,
 /* These are implied true by having been included in a consensus made
  * with a given method */
 rs->is_flagged_running = 1; /* Starting with consensus method 4. */
-if (consensus_method >= MIN_METHOD_FOR_EXCLUDING_INVALID_NODES)
-  rs->is_valid = 1;
+rs->is_valid = 1; /* Starting with consensus method 24. */
   }
   {
 const char *protocols = NULL, *version = NULL;
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index e5355069a..df5ae2d59 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -5617,9 +5617,8 @@ test_dir_assumed_flags(void *arg)
   memarea_t *area = memarea_new();
   routerstatus_t *rs = NULL;
 
-  /* First, we should always assume that the Running flag is set, even
-   * when it isn't listed, since the consensus method is always
-   * higher than 4. */
+  /* We can assume that consensus method is higher than 24, so Running and
+   * Valid are always implicitly set */
   const char *str1 =
 "r example hereiswhereyouridentitygoes 2015-08-30 12:00:00 "
"192.168.0.1 9001 0\n"
@@ -5628,17 +5627,6 @@ test_dir_assumed_flags(void *arg)
 
   const char *cp = str1;
   rs = routerstatus_parse_entry_from_string(area, , tokens, NULL, NULL,
-23, FLAV_MICRODESC);
-  tt_assert(rs);
-  tt_assert(rs->is_flagged_running);
-  tt_assert(! rs->is_valid);
-  tt_assert(! rs->is_exit);
-  tt_assert(rs->is_fast);
-  routerstatus_free(rs);
-
-  /* With method 24 or later, we can assume "valid" is set. */
-  cp = str1;
-  rs = routerstatus_parse_entry_from_string(area, , tokens, NULL, NULL,
 24, FLAV_MICRODESC);
   tt_assert(rs);
   tt_assert(rs->is_flagged_running);



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


[tor-commits] [tor/master] Disable consensus methods before 25.

2018-04-22 Thread nickm
commit 69347f48e00ae31222ce10d66c507293954e4fcc
Author: Nick Mathewson 
Date:   Mon Apr 9 14:31:51 2018 -0400

Disable consensus methods before 25.

Consensus method 25 is the oldest one supported by any stable
version of 0.2.9, which is our current most-recent LTS.  Thus, by
proposal 290, they should be removed.

This commit does not actually remove the code to implement these
methods: it only makes it so authorities will no longer support
them.  I'll remove the backend code for them in later commits.
---
 src/or/dirvote.c|  8 +---
 src/or/dirvote.h|  2 +-
 src/test/test_dir.c | 14 --
 3 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index c3cd0d3cd..265715505 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -3951,13 +3951,7 @@ static const struct consensus_method_range_t {
   int low;
   int high;
 } microdesc_consensus_methods[] = {
-  {MIN_SUPPORTED_CONSENSUS_METHOD, MIN_METHOD_FOR_A_LINES - 1},
-  {MIN_METHOD_FOR_A_LINES, MIN_METHOD_FOR_P6_LINES - 1},
-  {MIN_METHOD_FOR_P6_LINES, MIN_METHOD_FOR_NTOR_KEY - 1},
-  {MIN_METHOD_FOR_NTOR_KEY, MIN_METHOD_FOR_ID_HASH_IN_MD - 1},
-  {MIN_METHOD_FOR_ID_HASH_IN_MD, MIN_METHOD_FOR_ED25519_ID_IN_MD - 1},
-  {MIN_METHOD_FOR_ED25519_ID_IN_MD,
-MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC - 1},
+  {MIN_SUPPORTED_CONSENSUS_METHOD, MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC - 1},
   {MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC, MAX_SUPPORTED_CONSENSUS_METHOD},
   {-1, -1}
 };
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index deeb27bfe..91da4edee 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -56,7 +56,7 @@
 #define ROUTERSTATUS_FORMAT_NO_CONSENSUS_METHOD 0
 
 /** The lowest consensus method that we currently support. */
-#define MIN_SUPPORTED_CONSENSUS_METHOD 13
+#define MIN_SUPPORTED_CONSENSUS_METHOD 25
 
 /** The highest consensus method that we currently support. */
 #define MAX_SUPPORTED_CONSENSUS_METHOD 28
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 5fac045b2..6cafa7cb3 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -2917,8 +2917,9 @@ gen_routerstatus_for_umbw(int idx, time_t now)
   rs->addr = 0x99008801;
   rs->or_port = 443;
   rs->dir_port = 8000;
-  /* all flags but running cleared */
+  /* all flags but running and valid cleared */
   rs->is_flagged_running = 1;
+  rs->is_valid = 1;
   /*
* This one has measured bandwidth below the clip cutoff, and
* so shouldn't be clipped; we'll have to test that it isn't
@@ -2991,8 +2992,9 @@ gen_routerstatus_for_umbw(int idx, time_t now)
   rs->addr = 0xC203;
   rs->or_port = 500;
   rs->dir_port = 1999;
-  /* all flags but running cleared */
+  /* all flags but running and valid cleared */
   rs->is_flagged_running = 1;
+  rs->is_valid = 1;
   /*
* This one has unmeasured bandwidth below the clip cutoff, and
* so shouldn't be clipped; we'll have to test that it isn't
@@ -3014,7 +3016,7 @@ gen_routerstatus_for_umbw(int idx, time_t now)
   if (vrs) {
 vrs->microdesc = tor_malloc_zero(sizeof(vote_microdesc_hash_t));
 tor_asprintf(>microdesc->microdesc_hash_line,
- "m 9,10,11,12,13,14,15,16,17 "
+ "m 25,26,27,28 "
  "sha256=xyzajkldsdsajdadlsdjaslsdksdjlsdjsdaskdaaa%d\n",
  idx);
   }
@@ -3040,7 +3042,7 @@ vote_tweaks_for_umbw(networkstatus_t *v, int voter, 
time_t now)
   smartlist_clear(v->supported_methods);
   /* Method 17 is MIN_METHOD_TO_CLIP_UNMEASURED_BW_KB */
   smartlist_split_string(v->supported_methods,
- "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17",
+ "25 26 27 28",
  NULL, 0, -1);
   /* If we're using a non-default clip bandwidth, add it to net_params */
   if (alternate_clip_bw > 0) {
@@ -3202,9 +3204,9 @@ test_routerstatus_for_umbw(routerstatus_t *rs, time_t now)
 tt_assert(!rs->is_fast);
 tt_assert(!rs->is_possible_guard);
 tt_assert(!rs->is_stable);
-/* (If it wasn't running it wouldn't be here) */
+/* (If it wasn't running and valid it wouldn't be here) */
 tt_assert(rs->is_flagged_running);
-tt_assert(!rs->is_valid);
+tt_assert(rs->is_valid);
 tt_assert(!rs->is_named);
 /* This one should have measured bandwidth below the clip cutoff */
 tt_assert(rs->has_bandwidth);



___
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 'bug25691_033_again_squashed'

2018-04-22 Thread nickm
commit 6773102c92e7bd9d949251da75bcc0762e754ab2
Merge: d8ac7d557 0941c8bfe
Author: Nick Mathewson 
Date:   Sun Apr 22 19:44:27 2018 -0400

Merge branch 'bug25691_033_again_squashed'

 changes/bug25691_again|  6 +
 src/or/circuitbuild.c | 67 ---
 src/or/circuituse.c   |  4 +--
 src/or/control.c  |  9 ---
 src/or/entrynodes.c   |  7 ++---
 src/or/hs_common.c| 15 ---
 src/or/nodelist.c | 39 ---
 src/or/nodelist.h |  4 ++-
 src/or/rendservice.c  |  2 +-
 src/or/routerlist.c   |  6 ++---
 src/test/test_hs.c|  1 +
 src/test/test_hs_common.c |  3 ++-
 12 files changed, 108 insertions(+), 55 deletions(-)

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


[tor-commits] [tor/master] Use node_has_preferred_descriptor() in another case

2018-04-22 Thread nickm
commit 388d217c40fea4dfd9c2782ae6036126258fc292
Author: Nick Mathewson 
Date:   Mon Apr 16 11:40:14 2018 -0400

Use node_has_preferred_descriptor() in another case

In router_add_running_nodes_to_smartlist(), we had an inline
implementation of the logic from node_has_descriptor(), which should
be changed to node_has_preferred_descriptor().
---
 src/or/routerlist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index bc3abb236..2ab5017b7 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2335,7 +2335,7 @@ router_add_running_nodes_to_smartlist(smartlist_t *sl, 
int need_uptime,
   SMARTLIST_FOREACH_BEGIN(nodelist_get_list(), const node_t *, node) {
 if (!node->is_running || !node->is_valid)
   continue;
-if (need_desc && !(node->ri || (node->rs && node->md)))
+if (need_desc && !node_has_preferred_descriptor(node, direct_conn))
   continue;
 if (node->ri && node->ri->purpose != ROUTER_PURPOSE_GENERAL)
   continue;



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


[tor-commits] [tor/master] Add a changes file for 25691/25692

2018-04-22 Thread nickm
commit 0f3d73a2d0ef22d51183768308887d0271ef20f0
Author: Nick Mathewson 
Date:   Mon Apr 16 11:47:59 2018 -0400

Add a changes file for 25691/25692
---
 changes/bug25691_again | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/changes/bug25691_again b/changes/bug25691_again
new file mode 100644
index 0..3d0d91bfd
--- /dev/null
+++ b/changes/bug25691_again
@@ -0,0 +1,6 @@
+  o Minor bugfixes (path selection):
+- Only select relays when they have the descriptors we prefer to
+  use for them. This change fixes a bug where we could select
+  a relay because it had _some_ descriptor, but reject it later with
+  a nonfatal assertion error because it didn't have the exact one we
+  wanted. Fixes bugs 25691 and 25692; bugfix on 0.3.3.4-alpha.



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


[tor-commits] [tor/master] control EXTENDCIRCUIT: check node_has_preferred_descriptor().

2018-04-22 Thread nickm
commit 0941c8bfe6f34024153ae3ed67e4b1a05f9a6bfe
Author: Nick Mathewson 
Date:   Sun Apr 22 12:27:21 2018 -0400

control EXTENDCIRCUIT: check node_has_preferred_descriptor().

Suggested by teor during code review for 25691.
---
 src/or/control.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/or/control.c b/src/or/control.c
index f87a0ca48..028339f49 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -3492,17 +3492,19 @@ handle_control_extendcircuit(control_connection_t 
*conn, uint32_t len,
   smartlist_free(args);
 
   nodes = smartlist_new();
+  int first_node = zero_circ;
   SMARTLIST_FOREACH_BEGIN(router_nicknames, const char *, n) {
 const node_t *node = node_get_by_nickname(n, 0);
 if (!node) {
   connection_printf_to_buf(conn, "552 No such router \"%s\"\r\n", n);
   goto done;
 }
-if (!node_has_any_descriptor(node)) {
+if (!node_has_preferred_descriptor(node, first_node)) {
   connection_printf_to_buf(conn, "552 No descriptor for \"%s\"\r\n", n);
   goto done;
 }
 smartlist_add(nodes, (void*)node);
+first_node = 0;
   } SMARTLIST_FOREACH_END(n);
   if (!smartlist_len(nodes)) {
 connection_write_str_to_buf("512 No router names provided\r\n", conn);
@@ -3515,14 +3517,15 @@ handle_control_extendcircuit(control_connection_t 
*conn, uint32_t len,
   }
 
   /* now circ refers to something that is ready to be extended */
-  int first_node = zero_circ;
+  first_node = zero_circ;
   SMARTLIST_FOREACH(nodes, const node_t *, node,
   {
 extend_info_t *info = extend_info_from_node(node, first_node);
 if (!info) {
   tor_assert_nonfatal(first_node);
   log_warn(LD_CONTROL,
-   "controller tried to connect to a node that doesn't have any "
+   "controller tried to connect to a node that lacks a suitable "
+   "descriptor, or which doesn't have any "
"addresses that are allowed by the firewall configuration; "
"circuit marked for closing.");
   circuit_mark_for_close(TO_CIRCUIT(circ), -END_CIRC_REASON_CONNECTFAILED);



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


[tor-commits] [tor/master] Check for "the right descriptor", not just "any descriptor".

2018-04-22 Thread nickm
commit 948dd2c79ea9ca1fd06c13f275515a1745c46986
Author: Nick Mathewson 
Date:   Mon Apr 16 10:38:55 2018 -0400

Check for "the right descriptor", not just "any descriptor".

This patch adds a new node_has_preferred_descriptor() function, and
replaces most users of node_has_descriptor() with it.  That's an
important change, since as of d1874b433953f64 (our fix for #25213),
we are willing to say that a node has _some_ descriptor, but not the
_right_ descriptor for a particular use case.

Part of a fix for 25691 and 25692.
---
 src/or/circuitbuild.c | 28 
 src/or/circuituse.c   |  4 ++--
 src/or/entrynodes.c   |  7 ---
 src/or/hs_common.c| 15 +++
 src/or/nodelist.c | 30 +-
 src/or/nodelist.h |  2 ++
 src/or/rendservice.c  |  2 +-
 7 files changed, 61 insertions(+), 27 deletions(-)

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 5f1f8122f..019b9c51f 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -417,7 +417,7 @@ onion_populate_cpath(origin_circuit_t *circ)
 circ->cpath->extend_info->identity_digest);
 /* If we don't know the node and its descriptor, we must be bootstrapping.
  */
-if (!node || !node_has_descriptor(node)) {
+if (!node || !node_has_preferred_descriptor(node, 1)) {
   return 0;
 }
   }
@@ -1869,7 +1869,7 @@ choose_good_exit_server_general(int need_uptime, int 
need_capacity)
*/
   continue;
 }
-if (!node_has_descriptor(node)) {
+if (!node_has_preferred_descriptor(node, 0)) {
   n_supported[i] = -1;
   continue;
 }
@@ -2443,6 +2443,10 @@ circuit_extend_to_new_exit(origin_circuit_t *circ, 
extend_info_t *exit_ei)
 
 /** Return the number of routers in routers that are currently up
  * and available for building circuits through.
+ *
+ * (Note that this function may overcount or undercount, if we have
+ * descriptors that are not the type we would prefer to use for some
+ * particular router. See bug #25885.)
  */
 MOCK_IMPL(STATIC int,
 count_acceptable_nodes, (smartlist_t *nodes))
@@ -2847,9 +2851,10 @@ extend_info_new(const char *nickname,
  * of the node (i.e. its IPv4 address) unless
  * for_direct_connect is true, in which case the preferred
  * address is used instead. May return NULL if there is not enough
- * info about node to extend to it--for example, if there is no
- * routerinfo_t or microdesc_t, or if for_direct_connect is true and none of
- * the node's addresses are allowed by tor's firewall and IP version config.
+ * info about node to extend to it--for example, if the preferred
+ * routerinfo_t or microdesc_t is missing, or if for_direct_connect is
+ * true and none of the node's addresses is allowed by tor's firewall
+ * and IP version config.
  **/
 extend_info_t *
 extend_info_from_node(const node_t *node, int for_direct_connect)
@@ -2857,17 +2862,8 @@ extend_info_from_node(const node_t *node, int 
for_direct_connect)
   tor_addr_port_t ap;
   int valid_addr = 0;
 
-  const int is_bridge = node_is_a_configured_bridge(node);
-  const int we_use_mds = we_use_microdescriptors_for_circuits(get_options());
-
-  if ((is_bridge && for_direct_connect) || !we_use_mds) {
-/* We need an ri in this case. */
-if (!node->ri)
-  return NULL;
-  } else {
-/* Otherwise we need an md. */
-if (node->rs == NULL || node->md == NULL)
-  return NULL;
+  if (!node_has_preferred_descriptor(node, for_direct_connect)) {
+return NULL;
   }
 
   /* Choose a preferred address first, but fall back to an allowed address.
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 3125fff65..5d8af4c6c 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -2384,7 +2384,7 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn,
 const node_t *r;
 int opt = conn->chosen_exit_optional;
 r = node_get_by_nickname(conn->chosen_exit_name, 0);
-if (r && node_has_descriptor(r)) {
+if (r && node_has_preferred_descriptor(r, conn->want_onehop ? 1 : 0)) {
   /* We might want to connect to an IPv6 bridge for loading
  descriptors so we use the preferred address rather than
  the primary. */
@@ -2394,7 +2394,7 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn,
  "Discarding this circuit.", conn->chosen_exit_name);
 return -1;
   }
-} else  { /* ! (r && node_has_descriptor(r)) */
+} else  { /* ! (r && node_has_preferred_descriptor(...)) */
   log_debug(LD_DIR, "considering %d, %s",
 want_onehop, conn->chosen_exit_name);
   if (want_onehop && conn->chosen_exit_name[0] == '$') {
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 2b6ff38c9..54638810f 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -185,14 +185,14 @@ 

[tor-commits] [tor/master] Use router_crn_flags in more places, to pass direct-connect flag

2018-04-22 Thread nickm
commit 7915efd1b83e45c53eb06cfb384eed024df440c0
Author: Nick Mathewson 
Date:   Mon Apr 16 11:41:45 2018 -0400

Use router_crn_flags in more places, to pass direct-connect flag

In order to fix 25691 and 25692, we need to pass the "direct_conn"
flag to more places -- particularly when choosing single-hop
tunnels.  The right way to do this involves having a couple more
functions accept router_crn_flags_t, rather than a big list of
boolean arguments.

This commit also makes sure that choose_good_exit_server_general()
honors the direct_conn flag, to fix 25691 and 25692.
---
 src/or/circuitbuild.c | 39 ++-
 1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 019b9c51f..96cc8369d 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1827,7 +1827,7 @@ ap_stream_wants_exit_attention(connection_t *conn)
  * Return NULL if we can't find any suitable routers.
  */
 static const node_t *
-choose_good_exit_server_general(int need_uptime, int need_capacity)
+choose_good_exit_server_general(router_crn_flags_t flags)
 {
   int *n_supported;
   int n_pending_connections = 0;
@@ -1837,6 +1837,9 @@ choose_good_exit_server_general(int need_uptime, int 
need_capacity)
   const or_options_t *options = get_options();
   const smartlist_t *the_nodes;
   const node_t *selected_node=NULL;
+  const int need_uptime = (flags & CRN_NEED_UPTIME) != 0;
+  const int need_capacity = (flags & CRN_NEED_CAPACITY) != 0;
+  const int direct_conn = (flags & CRN_DIRECT_CONN) != 0;
 
   connections = get_connection_array();
 
@@ -1869,7 +1872,7 @@ choose_good_exit_server_general(int need_uptime, int 
need_capacity)
*/
   continue;
 }
-if (!node_has_preferred_descriptor(node, 0)) {
+if (!node_has_preferred_descriptor(node, direct_conn)) {
   n_supported[i] = -1;
   continue;
 }
@@ -1982,7 +1985,8 @@ choose_good_exit_server_general(int need_uptime, int 
need_capacity)
  need_capacity?", fast":"",
  need_uptime?", stable":"");
 tor_free(n_supported);
-return choose_good_exit_server_general(0, 0);
+flags &= ~(CRN_NEED_UPTIME|CRN_NEED_CAPACITY);
+return choose_good_exit_server_general(flags);
   }
   log_notice(LD_CIRC, "All routers are down or won't exit%s -- "
  "choosing a doomed exit at random.",
@@ -2229,17 +2233,11 @@ pick_restricted_middle_node(router_crn_flags_t flags,
  * toward the preferences in 'options'.
  */
 static const node_t *
-choose_good_exit_server(origin_circuit_t *circ, int need_uptime,
-int need_capacity, int is_internal, int need_hs_v3)
+choose_good_exit_server(origin_circuit_t *circ,
+router_crn_flags_t flags, int is_internal)
 {
   const or_options_t *options = get_options();
-  router_crn_flags_t flags = CRN_NEED_DESC;
-  if (need_uptime)
-flags |= CRN_NEED_UPTIME;
-  if (need_capacity)
-flags |= CRN_NEED_CAPACITY;
-  if (need_hs_v3)
-flags |= CRN_RENDEZVOUS_V3;
+  flags |= CRN_NEED_DESC;
 
   switch (TO_CIRCUIT(circ)->purpose) {
 case CIRCUIT_PURPOSE_C_HSDIR_GET:
@@ -2253,7 +2251,7 @@ choose_good_exit_server(origin_circuit_t *circ, int 
need_uptime,
   if (is_internal) /* pick it like a middle hop */
 return router_choose_random_node(NULL, options->ExcludeNodes, flags);
   else
-return choose_good_exit_server_general(need_uptime,need_capacity);
+return choose_good_exit_server_general(flags);
 case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
   {
 /* Pick a new RP */
@@ -2378,15 +2376,22 @@ onion_pick_cpath_exit(origin_circuit_t *circ, 
extend_info_t *exit_ei,
  extend_info_describe(exit_ei));
 exit_ei = extend_info_dup(exit_ei);
   } else { /* we have to decide one */
+router_crn_flags_t flags = CRN_NEED_DESC;
+if (state->need_uptime)
+  flags |= CRN_NEED_UPTIME;
+if (state->need_capacity)
+  flags |= CRN_NEED_CAPACITY;
+if (is_hs_v3_rp_circuit)
+  flags |= CRN_RENDEZVOUS_V3;
+if (state->onehop_tunnel)
+  flags |= CRN_DIRECT_CONN;
 const node_t *node =
-  choose_good_exit_server(circ, state->need_uptime,
-  state->need_capacity, state->is_internal,
-  is_hs_v3_rp_circuit);
+  choose_good_exit_server(circ, flags, state->is_internal);
 if (!node) {
   log_warn(LD_CIRC,"Failed to choose an exit server");
   return -1;
 }
-exit_ei = extend_info_from_node(node, 0);
+exit_ei = extend_info_from_node(node, state->onehop_tunnel);
 if (BUG(exit_ei == NULL))
   return -1;
   }



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


[tor-commits] [tor/master] Rename node_has_descriptor() to node_has_any_descriptor()

2018-04-22 Thread nickm
commit 47163780c3682d881ad6e8044320a57fce439ea1
Author: Nick Mathewson 
Date:   Mon Apr 16 11:51:02 2018 -0400

Rename node_has_descriptor() to node_has_any_descriptor()

Changing the name of this function should help keep us from misusing
it when node_has_preferred_descriptor() would be more appropriate.
---
 src/or/circuitbuild.c | 2 +-
 src/or/control.c  | 2 +-
 src/or/nodelist.c | 9 ++---
 src/or/nodelist.h | 2 +-
 src/or/routerlist.c   | 4 ++--
 src/test/test_hs_common.c | 3 ++-
 6 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 96cc8369d..06aff0620 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2468,7 +2468,7 @@ count_acceptable_nodes, (smartlist_t *nodes))
 if (! node->is_valid)
 //  log_debug(LD_CIRC,"Nope, the directory says %d is not valid.",i);
   continue;
-if (! node_has_descriptor(node))
+if (! node_has_any_descriptor(node))
   continue;
 /* The node has a descriptor, so we can just check the ntor key directly */
 if (!node_has_curve25519_onion_key(node))
diff --git a/src/or/control.c b/src/or/control.c
index fa62e9dbd..f87a0ca48 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -3498,7 +3498,7 @@ handle_control_extendcircuit(control_connection_t *conn, 
uint32_t len,
   connection_printf_to_buf(conn, "552 No such router \"%s\"\r\n", n);
   goto done;
 }
-if (!node_has_descriptor(node)) {
+if (!node_has_any_descriptor(node)) {
   connection_printf_to_buf(conn, "552 No descriptor for \"%s\"\r\n", n);
   goto done;
 }
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 2962d3cb4..212606d2f 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -1131,10 +1131,13 @@ node_is_dir(const node_t *node)
   }
 }
 
-/** Return true iff node has either kind of usable descriptor -- that
- * is, a routerdescriptor or a microdescriptor. */
+/** Return true iff node has either kind of descriptor -- that
+ * is, a routerdescriptor or a microdescriptor.
+ *
+ * You should probably use node_has_preferred_descriptor() instead.
+ **/
 int
-node_has_descriptor(const node_t *node)
+node_has_any_descriptor(const node_t *node)
 {
   return (node->ri ||
   (node->rs && node->md));
diff --git a/src/or/nodelist.h b/src/or/nodelist.h
index 5e7254f60..00f12ca1e 100644
--- a/src/or/nodelist.h
+++ b/src/or/nodelist.h
@@ -46,7 +46,7 @@ void node_get_verbose_nickname(const node_t *node,
 void node_get_verbose_nickname_by_id(const char *id_digest,
 char *verbose_name_out);
 int node_is_dir(const node_t *node);
-int node_has_descriptor(const node_t *node);
+int node_has_any_descriptor(const node_t *node);
 int node_has_preferred_descriptor(const node_t *node,
   int for_direct_connect);
 int node_get_purpose(const node_t *node);
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 2ab5017b7..1bfbd9f67 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2758,7 +2758,7 @@ frac_nodes_with_descriptors(const smartlist_t *sl,
   total <= 0.0) {
 int n_with_descs = 0;
 SMARTLIST_FOREACH(sl, const node_t *, node, {
-  if (node_has_descriptor(node))
+  if (node_has_any_descriptor(node))
 n_with_descs++;
 });
 return ((double)n_with_descs) / (double)smartlist_len(sl);
@@ -2766,7 +2766,7 @@ frac_nodes_with_descriptors(const smartlist_t *sl,
 
   present = 0.0;
   SMARTLIST_FOREACH_BEGIN(sl, const node_t *, node) {
-if (node_has_descriptor(node))
+if (node_has_any_descriptor(node))
   present += bandwidths[node_sl_idx];
   } SMARTLIST_FOREACH_END(node);
 
diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c
index 8c273c963..17ba11ca7 100644
--- a/src/test/test_hs_common.c
+++ b/src/test/test_hs_common.c
@@ -305,7 +305,8 @@ helper_add_hsdir_to_networkstatus(networkstatus_t *ns,
   node_t *node = node_get_mutable_by_id(ri->cache_info.identity_digest);
   tt_assert(node);
   node->rs = rs;
-  /* We need this to exist for node_has_descriptor() to return true. */
+  /* We need this to exist for node_has_preferred_descriptor() to return
+   * true. */
   node->md = tor_malloc_zero(sizeof(microdesc_t));
   /* Do this now the nodelist_set_routerinfo() function needs a "rs" to set
* the indexes which it doesn't have when it is called. */



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


[tor-commits] [tor/master] Repair the legacy_hs/pick_tor2web_rendezvous_node unit test

2018-04-22 Thread nickm
commit f1c1328f8518ad46f09d36ef3545a7ac266658eb
Author: Nick Mathewson 
Date:   Mon Apr 16 11:52:57 2018 -0400

Repair the legacy_hs/pick_tor2web_rendezvous_node unit test

It tried to pick nodes for which only routerinfo_t items are set,
but without setting UseMicroDescriptors to 0.  This won't work any
more, now that we're strict about using the right descriptor types
due to 25691/25692/25213.
---
 src/test/test_hs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_hs.c b/src/test/test_hs.c
index 9189bb65b..64448de51 100644
--- a/src/test/test_hs.c
+++ b/src/test/test_hs.c
@@ -361,6 +361,7 @@ test_pick_tor2web_rendezvous_node(void *arg)
 
   /* Parse Tor2webRendezvousPoints as a routerset. */
   options->Tor2webRendezvousPoints = routerset_new();
+  options->UseMicrodescriptors = 0;
   retval = routerset_parse(options->Tor2webRendezvousPoints,
tor2web_rendezvous_str,
"test_tor2web_rp");



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


[tor-commits] [doctor/master] Errors are getting incorrectly suppressed

2018-04-22 Thread atagar
commit 023cbeeff9798b8600f5191ed3084e57624fee10
Author: Damian Johnson 
Date:   Sun Apr 22 12:02:31 2018 -0700

Errors are getting incorrectly suppressed

Interesting! Roger reported an issue where he isn't getting notified about
moria1's bwauth scanner being down. In taking a look at the logs I'm indeed
seeing something funky...

  04/21/2018 21:05:46 [DEBUG] NOTICE: The following directory authorities 
are not reporting bandwidth scanner results: gabelmoo
  04/21/2018 21:05:47 [INFO] Suppressing 
The_following_directory_authorities_are_not_reporting_bandwidth_scanner_results:_gabelmoo,
 time remaining is 1
  3 hours
  04/21/2018 21:05:47 [INFO] All 1 issues were suppressed. Not sending a 
notification.
  04/21/2018 21:05:47 [DEBUG] Checks finished, runtime was 46.84 seconds
  04/21/2018 22:05:45 [DEBUG] ERROR: The following directory authorities 
are not reporting bandwidth scanner results: gabelmoo, moria1
  04/21/2018 22:05:46 [INFO] All 1 issues were suppressed. Not sending a 
notification.
  04/21/2018 22:05:46 [DEBUG] Checks finished, runtime was 45.56 seconds

I suspect what's happening is this...

  * When only gabelmoo is down this is a NOTICE runlevel notification, which
works.

  * When moria1 is down as well it's an ERROR runlevel notice which should
generate an email every hour, but isn't. I think this is due to a bug 
where
ERROR notices in specific are getting incorrectly suppressed.

Lets give this a try...
---
 consensus_health_checker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/consensus_health_checker.py b/consensus_health_checker.py
index beb8c70..9710b5e 100755
--- a/consensus_health_checker.py
+++ b/consensus_health_checker.py
@@ -193,7 +193,7 @@ def is_rate_limited(issue):
   hours = issue.get_suppression_duration()
 
   if hours == 0:
-return True
+return False
 
   current_time = int(time.time())
   last_seen = stem.util.conf.get_config('last_notified').get(key, 0)

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


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

2018-04-22 Thread translation
commit d40762aa0040e64da9004cbeac33bec3c5265887
Author: Translation commit bot 
Date:   Sun Apr 22 07:20:28 2018 +

Update translations for support-miscellaneous
---
 es.json | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/es.json b/es.json
index 6bec37c61..482202264 100644
--- a/es.json
+++ b/es.json
@@ -8,7 +8,7 @@
 "misc-2": {
"id": "#misc-2",
"control": "misc-2",
-   "title": "¿Por qué no evitáis que indeseables haga maldades cuando 
usan Tor?",
+   "title": "¿Por qué no evitan que gente indeseable haga maldades 
cuando usa Tor?",
"description": "Tor está diseñado para defender los 
derechos humanos y la privacidad evitando que cualquiera censure cosas, incluso 
nosotros. Odiamos que haya personas que usen Tor para hacer cosas terribles, 
pero no podemos hacer nada para librarnos de ellos sin socavar también los 
activistas pro derechos humanos, periodistas, supervivientes de abusos, y otras 
personas que usan Tor para cosas buenas. Si queremos evitar que ciertas 
personas usen Tor, básicamente estaríamos añadiendo una puerta trasera al 
software, lo que dejaría vulnerables a nuestros usuarios a ataques de 
regímenes opresivos y otros adversarios."
 },
  "misc-3": {
@@ -50,8 +50,8 @@
 "misc-9": {
"id": "#misc-9",
"control": "misc-9",
-   "title": "Estoy teniendo un problema actualizando o usando Vidalia.",
-   "description": "Vidalia ya no es mantenido ni está 
soportado. Una gran porción de las características que ofrecía Vidalia ahora 
están integradas en el propio Navegador Tor."
+   "title": "Tengo un problema actualizando o usando Vidalia.",
+   "description": "Vidalia ya no se mantiene ni está 
soportado. Una gran parte de las características que ofrecía Vidalia ahora 
están integradas en el propio Navegador Tor."
 },
 "misc-10": {
"id": "#misc-10",
@@ -75,12 +75,12 @@
"id": "#misc-13",
"control": "misc-13",
"title": "¿Puedo usar una VPN con Tor?",
-   "description": "En términos generales, no 
recomendamos usar una VPN con Tor a menos que seas un usuario avanzado que sabe 
cómo configurar ambos de forma que no comprometa su privacidad. Puedes 
encontrar más información detallada sobre Tor + VPN en https://trac.torproject.org/projects/tor/wiki/doc/TorPlusVPN\;>​nuestro
 wiki."
+   "description": "En términos generales, no 
recomendamos usar una VPN con Tor a menos que seas un usuario avanzado que sabe 
cómo configurar ambos de forma que no comprometa tu privacidad. Puedes 
encontrar más información detallada sobre Tor + VPN en https://trac.torproject.org/projects/tor/wiki/doc/TorPlusVPN\;>​nuestro
 wiki."
 },
 "misc-14": {
"id": "#misc-14",
"control": "misc-14",
-   "title": "¿Cómo puedo ofrecerme voluntario para Tor Project?",
+   "title": "¿Cómo puedo hacer voluntariado con Tor Project?",
"description": "Por favor, ¡mira nuestra https://www.torproject.org/getinvolved/volunteer.html.en\;>​página de 
voluntariado para ver cómo involucrarte!"
 },
 "misc-15": {

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


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

2018-04-22 Thread translation
commit ffe5fc4906a1846a367311340ff62139b854628f
Author: Translation commit bot 
Date:   Sun Apr 22 07:20:32 2018 +

Update translations for support-miscellaneous_completed
---
 es.json | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/es.json b/es.json
index 6bec37c61..482202264 100644
--- a/es.json
+++ b/es.json
@@ -8,7 +8,7 @@
 "misc-2": {
"id": "#misc-2",
"control": "misc-2",
-   "title": "¿Por qué no evitáis que indeseables haga maldades cuando 
usan Tor?",
+   "title": "¿Por qué no evitan que gente indeseable haga maldades 
cuando usa Tor?",
"description": "Tor está diseñado para defender los 
derechos humanos y la privacidad evitando que cualquiera censure cosas, incluso 
nosotros. Odiamos que haya personas que usen Tor para hacer cosas terribles, 
pero no podemos hacer nada para librarnos de ellos sin socavar también los 
activistas pro derechos humanos, periodistas, supervivientes de abusos, y otras 
personas que usan Tor para cosas buenas. Si queremos evitar que ciertas 
personas usen Tor, básicamente estaríamos añadiendo una puerta trasera al 
software, lo que dejaría vulnerables a nuestros usuarios a ataques de 
regímenes opresivos y otros adversarios."
 },
  "misc-3": {
@@ -50,8 +50,8 @@
 "misc-9": {
"id": "#misc-9",
"control": "misc-9",
-   "title": "Estoy teniendo un problema actualizando o usando Vidalia.",
-   "description": "Vidalia ya no es mantenido ni está 
soportado. Una gran porción de las características que ofrecía Vidalia ahora 
están integradas en el propio Navegador Tor."
+   "title": "Tengo un problema actualizando o usando Vidalia.",
+   "description": "Vidalia ya no se mantiene ni está 
soportado. Una gran parte de las características que ofrecía Vidalia ahora 
están integradas en el propio Navegador Tor."
 },
 "misc-10": {
"id": "#misc-10",
@@ -75,12 +75,12 @@
"id": "#misc-13",
"control": "misc-13",
"title": "¿Puedo usar una VPN con Tor?",
-   "description": "En términos generales, no 
recomendamos usar una VPN con Tor a menos que seas un usuario avanzado que sabe 
cómo configurar ambos de forma que no comprometa su privacidad. Puedes 
encontrar más información detallada sobre Tor + VPN en https://trac.torproject.org/projects/tor/wiki/doc/TorPlusVPN\;>​nuestro
 wiki."
+   "description": "En términos generales, no 
recomendamos usar una VPN con Tor a menos que seas un usuario avanzado que sabe 
cómo configurar ambos de forma que no comprometa tu privacidad. Puedes 
encontrar más información detallada sobre Tor + VPN en https://trac.torproject.org/projects/tor/wiki/doc/TorPlusVPN\;>​nuestro
 wiki."
 },
 "misc-14": {
"id": "#misc-14",
"control": "misc-14",
-   "title": "¿Cómo puedo ofrecerme voluntario para Tor Project?",
+   "title": "¿Cómo puedo hacer voluntariado con Tor Project?",
"description": "Por favor, ¡mira nuestra https://www.torproject.org/getinvolved/volunteer.html.en\;>​página de 
voluntariado para ver cómo involucrarte!"
 },
 "misc-15": {

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


[tor-commits] [translation/tails-greeter-2] Update translations for tails-greeter-2

2018-04-22 Thread translation
commit 217cb0285ac85c4ae2688b3d585545f0603a9e03
Author: Translation commit bot 
Date:   Sun Apr 22 07:19:32 2018 +

Update translations for tails-greeter-2
---
 te/te.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/te/te.po b/te/te.po
index df6721593..56860e37e 100644
--- a/te/te.po
+++ b/te/te.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-01-22 14:15+0100\n"
+"POT-Creation-Date: 2018-03-01 20:26+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: Tor Project , 
2016\n"
 "Language-Team: Telugu (https://www.transifex.com/otf/teams/1519/te/)\n"

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


[tor-commits] [translation/tor-messenger-privdtd] Update translations for tor-messenger-privdtd

2018-04-22 Thread translation
commit 0c69ac20e42551792839abb95ba031d84b1a9d25
Author: Translation commit bot 
Date:   Sun Apr 22 07:19:09 2018 +

Update translations for tor-messenger-privdtd
---
 te/priv.dtd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/te/priv.dtd b/te/priv.dtd
index 70079796c..4060bca4d 100644
--- a/te/priv.dtd
+++ b/te/priv.dtd
@@ -1,2 +1,2 @@
 
-
\ No newline at end of file
+
\ No newline at end of file

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


[tor-commits] [translation/tails-perl5lib] Update translations for tails-perl5lib

2018-04-22 Thread translation
commit d4f5893e2a417c3aa36706f47b5cf930cc9bbbfd
Author: Translation commit bot 
Date:   Sun Apr 22 07:17:36 2018 +

Update translations for tails-perl5lib
---
 te.po | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/te.po b/te.po
index f4be7eb51..9fb9bcaf8 100644
--- a/te.po
+++ b/te.po
@@ -8,8 +8,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
 "POT-Creation-Date: 2018-03-15 12:15+\n"
-"PO-Revision-Date: 2018-03-31 13:21+\n"
-"Last-Translator: carolyn \n"
+"PO-Revision-Date: 2018-04-22 07:12+\n"
+"Last-Translator: sonusandeep \n"
 "Language-Team: Telugu 
(http://www.transifex.com/otf/torproject/language/te/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -19,7 +19,7 @@ msgstr ""
 
 #: ../lib/Tails/RunningSystem.pm:159
 msgid "Error"
-msgstr ""
+msgstr "లోపం"
 
 #: ../lib/Tails/RunningSystem.pm:161
 msgid ""

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


[tor-commits] [translation/tor-launcher-properties] Update translations for tor-launcher-properties

2018-04-22 Thread translation
commit 2d3b04620accadc69a215ce9ff6f5e47ccdef483
Author: Translation commit bot 
Date:   Sun Apr 22 07:16:20 2018 +

Update translations for tor-launcher-properties
---
 te/torlauncher.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/te/torlauncher.properties b/te/torlauncher.properties
index a4d097a76..209ac60ae 100644
--- a/te/torlauncher.properties
+++ b/te/torlauncher.properties
@@ -45,7 +45,7 @@ torlauncher.connect=Connect
 torlauncher.restart_tor=Restart Tor
 torlauncher.quit=Quit
 torlauncher.quit_win=Exit
-torlauncher.done=Done
+torlauncher.done=పూర్తి
 
 torlauncher.forAssistance=For assistance, contact %S
 torlauncher.forAssistance2=For assistance, visit %S

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


[tor-commits] [translation/tails-misc] Update translations for tails-misc

2018-04-22 Thread translation
commit 457f9624779921e9d2b1f34523803c09f46547ba
Author: Translation commit bot 
Date:   Sun Apr 22 07:16:44 2018 +

Update translations for tails-misc
---
 te.po | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/te.po b/te.po
index 62a2525cc..52e800ffe 100644
--- a/te.po
+++ b/te.po
@@ -8,8 +8,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-03-12 19:03+0100\n"
-"PO-Revision-Date: 2018-03-13 02:48+\n"
-"Last-Translator: carolyn \n"
+"PO-Revision-Date: 2018-04-22 07:12+\n"
+"Last-Translator: sonusandeep \n"
 "Language-Team: Telugu 
(http://www.transifex.com/otf/torproject/language/te/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -240,7 +240,7 @@ msgstr ""
 #: config/chroot_local-includes/usr/local/bin/tails-upgrade-frontend-wrapper:73
 #: config/chroot_local-includes/usr/local/sbin/unsafe-browser:28
 msgid "Error"
-msgstr ""
+msgstr "లోపం"
 
 #: config/chroot_local-includes/usr/local/lib/tails-virt-notify-user:71
 msgid "Warning: virtual machine detected!"

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


[tor-commits] [translation/torbirdy] Update translations for torbirdy

2018-04-22 Thread translation
commit 012e4f57d765962d82a3e7014b76d94b39be99e9
Author: Translation commit bot 
Date:   Sun Apr 22 07:16:03 2018 +

Update translations for torbirdy
---
 te/torbirdy.dtd | 2 --
 1 file changed, 2 deletions(-)

diff --git a/te/torbirdy.dtd b/te/torbirdy.dtd
index d7ed48f16..bdccae1dd 100644
--- a/te/torbirdy.dtd
+++ b/te/torbirdy.dtd
@@ -40,8 +40,6 @@
 
 
 
-
-
 
 
 

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


[tor-commits] [translation/tails-persistence-setup] Update translations for tails-persistence-setup

2018-04-22 Thread translation
commit 51ba8ab27bcbcee0491b394367d6b10a6b5f1357
Author: Translation commit bot 
Date:   Sun Apr 22 07:15:53 2018 +

Update translations for tails-persistence-setup
---
 te/te.po | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/te/te.po b/te/te.po
index b30847734..2cdbc6edd 100644
--- a/te/te.po
+++ b/te/te.po
@@ -8,8 +8,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
 "POT-Creation-Date: 2017-05-15 13:51+0200\n"
-"PO-Revision-Date: 2017-05-17 03:09+\n"
-"Last-Translator: carolyn \n"
+"PO-Revision-Date: 2018-04-22 07:12+\n"
+"Last-Translator: sonusandeep \n"
 "Language-Team: Telugu 
(http://www.transifex.com/otf/torproject/language/te/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -128,7 +128,7 @@ msgstr ""
 
 #: ../lib/Tails/Persistence/Setup.pm:312 ../lib/Tails/Persistence/Setup.pm:459
 msgid "Error"
-msgstr ""
+msgstr "లోపం"
 
 #: ../lib/Tails/Persistence/Setup.pm:344
 #, perl-format

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


[tor-commits] [translation/https_everywhere] Update translations for https_everywhere

2018-04-22 Thread translation
commit 4227d21909f3dbf859c4fba3efc2f0801ef5507e
Author: Translation commit bot 
Date:   Sun Apr 22 07:15:30 2018 +

Update translations for https_everywhere
---
 te/ssl-observatory.dtd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/te/ssl-observatory.dtd b/te/ssl-observatory.dtd
index 69f1cfd69..eb09d7046 100644
--- a/te/ssl-observatory.dtd
+++ b/te/ssl-observatory.dtd
@@ -50,7 +50,7 @@ intrusive corporate network:">
 
 
-
+
 
 ___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits