[tor-commits] [tor/master] Reinstate a couple of teardown_capture_of_logs that I missed

2016-09-08 Thread nickm
commit 63e34e9e49e8514e2edfdc8e964bfc5752ca6326
Author: Nick Mathewson 
Date:   Thu Sep 8 19:49:21 2016 -0400

Reinstate a couple of teardown_capture_of_logs that I missed

Patch from rubiate. See #1
---
 src/test/test_tortls.c | 5 +
 src/test/test_util.c   | 4 +---
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index 790c331..8502e8a 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -2278,7 +2278,6 @@ test_tortls_finish_handshake(void *ignored)
 
   X509 *c1 = read_cert_from(validCertString);
   SESS_CERT_local *sess = NULL;
-  int log_level = 0;
 
   ctx = SSL_CTX_new(method);
 
@@ -2298,7 +2297,6 @@ test_tortls_finish_handshake(void *ignored)
   expect_single_log_msg_containing("For some reason, wasV2Handshake didn't "
"get set.");
   teardown_capture_of_logs();
-  log_level = 0;
 
   tls->wasV2Handshake = 1;
   ret = tor_tls_finish_handshake(tls);
@@ -2337,8 +2335,7 @@ test_tortls_finish_handshake(void *ignored)
   tor_free(tls);
   SSL_CTX_free(ctx);
   tor_free(method);
-  if (log_level)
-teardown_capture_of_logs();
+  teardown_capture_of_logs();
 }
 #endif
 
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 5949eb9..224ec7b 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -262,7 +262,6 @@ test_util_time(void *arg)
   time_t t_res;
   int i;
   struct timeval tv;
-  int old_log_level = 0;
 
   /* Test tv_udiff and tv_mdiff */
 
@@ -1112,8 +,7 @@ test_util_time(void *arg)
 #undef CHECK_TIMEGM_ARG_OUT_OF_RANGE
 
  done:
-  if (old_log_level)
-teardown_capture_of_logs();
+  teardown_capture_of_logs();
 }
 
 static void

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


[tor-commits] [torbutton/master] Bug 19733: GETINFO response parser doesn't handle AF_UNIX entries.

2016-09-08 Thread gk
commit 5ea022aadf6416a1f046eac47a3ec28ea2a5dd7d
Author: Kathy Brade 
Date:   Thu Sep 8 10:50:49 2016 -0400

Bug 19733: GETINFO response parser doesn't handle AF_UNIX entries.

When performing the local Tor check (which compares the configured
Firefox SOCKS proxy to the one reported by GETINFO net/listeners/socks),
correctly handle UNIX domain sockets as well as IPv6 addresses.
---
 src/chrome/content/torbutton.js | 78 ++---
 1 file changed, 58 insertions(+), 20 deletions(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index e0fc931..acb4b4b 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -1534,48 +1534,86 @@ function torbutton_local_tor_check()
   {
 if (!didLogError) {
   didLogError = true;
-  torbutton_log(5, "unexpected tor response: " + resp);
+  torbutton_log(5, "Local Tor check: unexpected GETINFO response: " + 
resp);
 }
   }
 
+  function removeBrackets(aStr)
+  {
+// Remove enclosing square brackets if present.
+if (aStr.startsWith('[') && aStr.endsWith(']'))
+  return aStr.substr(1, aStr.length - 2);
+
+return aStr;
+  }
+
   // Sample response: net/listeners/socks="127.0.0.1:9149" "127.0.0.1:9150"
   // First, check for command argument prefix.
-  resp = resp.toLowerCase();
   if (0 != resp.indexOf(kCmdArg + '=')) {
 logUnexpectedResponse();
 return false;
   }
 
   // Retrieve configured proxy settings and check each listener against them.
+  // When a Unix domain socket is configured, a file URL should be present in
+  // network.proxy.socks.
+  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1211567
   let socksAddr = m_tb_prefs.getCharPref("network.proxy.socks");
   let socksPort = m_tb_prefs.getIntPref("network.proxy.socks_port");
+  let socketPath;
+  if (socksAddr && socksAddr.startsWith("file:")) {
+// Convert the file URL to a file path.
+try {
+  let ioService = Cc["@mozilla.org/network/io-service;1"]
+.getService(Ci.nsIIOService);
+  let fph = ioService.getProtocolHandler("file")
+ .QueryInterface(Ci.nsIFileProtocolHandler);
+  socketPath = fph.getFileFromURLSpec(socksAddr).path;
+} catch (e) {
+  torbutton_log(5, "Local Tor check: Unix domain socket error: " + e);
+  return false;
+}
+  } else {
+socksAddr = removeBrackets(socksAddr);
+  }
+
   let addrArray = resp.substr(kCmdArg.length + 1).split(' ');
   let foundSocksListener = false;
-  for (let i = 0; !foundSocksListener && (i < addrArray.length); ++i)
-  {
-var addr = addrArray[i];
+  for (let i = 0; !foundSocksListener && (i < addrArray.length); ++i) {
+let addr = addrArray[i];
 
 // Remove double quotes if present.
 let len = addr.length;
 if ((len > 2) && ('"' == addr.charAt(0)) && ('"' == addr.charAt(len - 1)))
   addr = addr.substring(1, len - 1);
 
-// Check against the configured proxy.
-let tokens = addr.split(':');
-if (tokens.length < 2)
-  logUnexpectedResponse();
-else
-{
-  let torSocksAddr = tokens[0];
-  let torSocksPort = parseInt(tokens[1], 10);
-  if ((torSocksAddr.length < 1) || isNaN(torSocksPort))
+if (addr.startsWith("unix:")) {
+  if (!socketPath)
+continue;
+
+  // Check against the configured UNIX domain socket proxy.
+  let path = addr.substring(5);
+  torbutton_log(2, "Tor socks listener (socket): " + path);
+  foundSocksListener = (socketPath === path);
+} else if (!socketPath) {
+  // Check against the configured TCP proxy. We expect addr:port where addr
+  // may be an IPv6 address; that is, it may contain colon characters.
+  // Also, we remove enclosing square brackets before comparing addresses
+  // because tor requires them but Firefox does not.
+  let idx = addr.lastIndexOf(':');
+  if (idx < 0) {
 logUnexpectedResponse();
-  else
-  {
-torbutton_log(2, "Tor socks listener: " + torSocksAddr + ':'
- + torSocksPort);
-foundSocksListener = ((socksAddr == torSocksAddr) &&
-  (socksPort == torSocksPort));
+  } else {
+let torSocksAddr = removeBrackets(addr.substring(0, idx));
+let torSocksPort = parseInt(addr.substring(idx + 1), 10);
+if ((torSocksAddr.length < 1) || isNaN(torSocksPort)) {
+  logUnexpectedResponse();
+} else {
+  torbutton_log(2, "Tor socks listener: " + torSocksAddr + ':'
+   + torSocksPort);
+  foundSocksListener = ((socksAddr === torSocksAddr) &&
+(socksPort === torSocksPort));
+}
   }
 }
   }

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

[tor-commits] [tor/master] Placate "make check-spaces"

2016-09-08 Thread nickm
commit 55713f0d790378e2788c9bec1d26134838af739a
Author: Nick Mathewson 
Date:   Thu Sep 8 15:43:56 2016 -0400

Placate "make check-spaces"
---
 src/test/log_test_helpers.c | 1 +
 src/test/test_address.c | 2 --
 src/test/test_config.c  | 3 ++-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c
index 3dc926d..c788a33 100644
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@ -238,3 +238,4 @@ mock_dump_saved_logs(void)
escaped(m->generated_msg));
   } SMARTLIST_FOREACH_END(m);
 }
+
diff --git a/src/test/test_address.c b/src/test/test_address.c
index 0be4c54..9b4c52f 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -801,7 +801,6 @@ test_address_get_if_addrs6_list_internal(void *arg)
   if (smartlist_len(mock_saved_logs()) == 1) {
 expect_log_msg_containing_either("connect() failed",
  "unable to create socket");
-
   }
   teardown_capture_of_logs();
 
@@ -840,7 +839,6 @@ test_address_get_if_addrs6_list_no_internal(void *arg)
   if (smartlist_len(mock_saved_logs()) == 1) {
 expect_log_msg_containing_either("connect() failed",
  "unable to create socket");
-
   }
   teardown_capture_of_logs();
 
diff --git a/src/test/test_config.c b/src/test/test_config.c
index c1222e5..ee1686c 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -4238,7 +4238,8 @@ test_config_parse_port_config__ports__ports_given(void 
*data)
   config_free_lines(config_port_valid); config_port_valid = NULL;
   SMARTLIST_FOREACH(slout,port_cfg_t *,pf,port_cfg_free(pf));
   smartlist_clear(slout);
-  config_port_valid = mock_config_line("SOCKSPort", "42 IPv6Traffic 
PreferIPv6");
+  config_port_valid = mock_config_line("SOCKSPort",
+   "42 IPv6Traffic PreferIPv6");
   ret = parse_port_config(slout, config_port_valid, NULL, "SOCKS",
   CONN_TYPE_AP_LISTENER, "127.0.0.42", 0,
   CL_PORT_TAKES_HOSTNAMES);

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


[tor-commits] [tor/master] Fix remaining test warnings. (in test_relay.c)

2016-09-08 Thread nickm
commit d860b99dbf9f86aa27d7e7fcf161d2b16d838c68
Author: Nick Mathewson 
Date:   Thu Sep 8 15:25:56 2016 -0400

Fix remaining test warnings. (in test_relay.c)
---
 src/test/test_relay.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/test/test_relay.c b/src/test/test_relay.c
index a7fcad5..29016e4 100644
--- a/src/test/test_relay.c
+++ b/src/test/test_relay.c
@@ -74,6 +74,10 @@ test_relay_append_cell_to_circuit_queue(void *arg)
   /* Make a fake orcirc */
   orcirc = new_fake_orcirc(nchan, pchan);
   tt_assert(orcirc);
+  circuitmux_attach_circuit(nchan->cmux, TO_CIRCUIT(orcirc),
+CELL_DIRECTION_OUT);
+  circuitmux_attach_circuit(pchan->cmux, TO_CIRCUIT(orcirc),
+CELL_DIRECTION_IN);
 
   /* Make a cell */
   cell = tor_malloc_zero(sizeof(cell_t));
@@ -111,6 +115,10 @@ test_relay_append_cell_to_circuit_queue(void *arg)
   tor_free(cell);
   cell_queue_clear(>base_.n_chan_cells);
   cell_queue_clear(>p_chan_cells);
+  if (orcirc) {
+circuitmux_detach_circuit(nchan->cmux, TO_CIRCUIT(orcirc));
+circuitmux_detach_circuit(pchan->cmux, TO_CIRCUIT(orcirc));
+  }
   tor_free(orcirc);
   free_fake_channel(nchan);
   free_fake_channel(pchan);

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


[tor-commits] [tor/master] capture and detect expected BUG messages in shared-random tests

2016-09-08 Thread nickm
commit e9fdec2b1d5cc4055516d08a53663002b3722529
Author: Nick Mathewson 
Date:   Thu Sep 8 15:13:53 2016 -0400

capture and detect expected BUG messages in shared-random tests
---
 src/or/shared_random.c|  2 +-
 src/test/test_shared_random.c | 15 +++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/or/shared_random.c b/src/or/shared_random.c
index e672a41..5f6b03f 100644
--- a/src/or/shared_random.c
+++ b/src/or/shared_random.c
@@ -201,7 +201,7 @@ verify_commit_and_reveal(const sr_commit_t *commit)
 if (fast_memneq(received_hashed_reveal, commit->hashed_reveal,
 sizeof(received_hashed_reveal))) {
   log_warn(LD_BUG, "SR: Received reveal value from authority %s "
-   "does't match the commit value.",
+   "doesn't match the commit value.",
sr_commit_get_rsa_fpr(commit));
   goto invalid;
 }
diff --git a/src/test/test_shared_random.c b/src/test/test_shared_random.c
index 8210ba2..19f2e2d 100644
--- a/src/test/test_shared_random.c
+++ b/src/test/test_shared_random.c
@@ -14,6 +14,7 @@
 #include "router.h"
 #include "routerparse.h"
 #include "networkstatus.h"
+#include "log_test_helpers.h"
 
 static authority_cert_t *mock_cert;
 
@@ -326,14 +327,20 @@ test_sr_commit(void *arg)
 
 /* Timestamp MUST match. */
 test_commit.commit_ts = test_commit.reveal_ts - 42;
+setup_full_capture_of_logs(LOG_WARN);
 tt_int_op(-1, ==, verify_commit_and_reveal(_commit));
+expect_log_msg_containing("doesn't match reveal timestamp");
+teardown_capture_of_logs();
 memcpy(_commit, our_commit, sizeof(test_commit));
 tt_int_op(0, ==, verify_commit_and_reveal(_commit));
 
 /* Hashed reveal must match the H(encoded_reveal). */
 memset(test_commit.hashed_reveal, 'X',
sizeof(test_commit.hashed_reveal));
+setup_full_capture_of_logs(LOG_WARN);
 tt_int_op(-1, ==, verify_commit_and_reveal(_commit));
+expect_single_log_msg_containing("doesn't match the commit value");
+teardown_capture_of_logs();
 memcpy(_commit, our_commit, sizeof(test_commit));
 tt_int_op(0, ==, verify_commit_and_reveal(_commit));
   }
@@ -357,6 +364,7 @@ test_sr_commit(void *arg)
   }
 
  done:
+  teardown_capture_of_logs();
   SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
   smartlist_free(args);
   sr_commit_free(our_commit);
@@ -1164,8 +1172,14 @@ test_keep_commit(void *arg)
 memcpy(place_holder.hashed_reveal, commit->hashed_reveal,
sizeof(place_holder.hashed_reveal));
 memset(commit->hashed_reveal, 0, sizeof(commit->hashed_reveal));
+setup_full_capture_of_logs(LOG_WARN);
 tt_int_op(should_keep_commit(commit, commit->rsa_identity,
  SR_PHASE_REVEAL), ==, 0);
+expect_log_msg_containing("doesn't match the commit value.");
+expect_log_msg_containing("has an invalid reveal value.");
+assert_log_predicate(mock_saved_log_n_entries() == 2,
+ "expected 2 log entries");
+teardown_capture_of_logs();
 memcpy(commit->hashed_reveal, place_holder.hashed_reveal,
sizeof(commit->hashed_reveal));
   }
@@ -1178,6 +1192,7 @@ test_keep_commit(void *arg)
SR_PHASE_REVEAL), ==, 0);
 
  done:
+  teardown_capture_of_logs();
   sr_commit_free(commit);
   sr_commit_free(dup_commit);
   crypto_pk_free(k);



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


[tor-commits] [tor/master] Resolve more BUG warnings in the unit tests

2016-09-08 Thread nickm
commit b0a9e54705d16d08ae7aff272492832dbb35646d
Author: Nick Mathewson 
Date:   Thu Sep 8 14:39:20 2016 -0400

Resolve more BUG warnings in the unit tests
---
 src/test/log_test_helpers.c   |  6 ++
 src/test/log_test_helpers.h   | 17 +
 src/test/test_dir.c   | 20 ++--
 src/test/test_guardfraction.c | 10 +-
 src/test/test_rendcache.c | 19 +--
 src/test/test_shared_random.c |  4 ++--
 src/test/test_tortls.c| 20 
 src/test/test_util_process.c  |  5 +++--
 8 files changed, 84 insertions(+), 17 deletions(-)

diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c
index 5eba566..7f7f1d1 100644
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@ -105,6 +105,12 @@ mock_saved_logs(void)
   return saved_logs;
 }
 
+int
+mock_saved_log_n_entries(void)
+{
+  return saved_logs ? smartlist_len(saved_logs) : 0;
+}
+
 /**
  * Return true iff there is a message recorded by log capture
  * that is exactly equal to msg
diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h
index bf2f9a6..fd99084 100644
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@ -26,6 +26,7 @@ int mock_saved_log_has_message(const char *msg);
 int mock_saved_log_has_message_containing(const char *msg);
 int mock_saved_log_has_severity(int severity);
 int mock_saved_log_has_entry(void);
+int mock_saved_log_n_entries(void);
 void mock_dump_saved_logs(void);
 
 #define assert_log_predicate(predicate, failure_msg)   \
@@ -50,11 +51,19 @@ void mock_dump_saved_logs(void);
mock_saved_log_has_message_containing(str2), \
 "expected log to contain " # str1 " or " # str2);
 
+#define expect_single_log_msg(str) \
+  do {  \
+\
+assert_log_predicate(mock_saved_log_has_message_containing(str) &&  \
+ mock_saved_log_n_entries() == 1,   \
+  "expected log to contain exactly 1 message: " # str); \
+  } while (0);
+
 #define expect_single_log_msg_containing(str) \
-  do {\
-assert_log_predicate(mock_saved_log_has_message_containing(str), \
-  "expected log to contain " # str);  \
-tt_int_op(smartlist_len(mock_saved_logs()), OP_EQ, 1);\
+  do {  \
+assert_log_predicate(mock_saved_log_has_message_containing(str)&&   \
+ mock_saved_log_n_entries() == 1 ,  \
+"expected log to contain 1 message, containing" # str); \
   } while (0);
 
 #define expect_no_log_msg(str) \
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 65b04af..0afc0b7 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -36,6 +36,7 @@
 #include "test_dir_common.h"
 #include "torcert.h"
 #include "relay.h"
+#include "log_test_helpers.h"
 
 #define NS_MODULE dir
 
@@ -3268,6 +3269,8 @@ static void
 test_dir_fetch_type(void *arg)
 {
   (void)arg;
+  int log_level = 0;
+
   tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_EXTRAINFO, ROUTER_PURPOSE_BRIDGE,
NULL), OP_EQ, EXTRAINFO_DIRINFO | BRIDGE_DIRINFO);
   tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_EXTRAINFO, ROUTER_PURPOSE_GENERAL,
@@ -3293,9 +3296,15 @@ test_dir_fetch_type(void *arg)
   tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_MICRODESC, ROUTER_PURPOSE_GENERAL,
NULL), OP_EQ, MICRODESC_DIRINFO);
 
+  /* This will give a warning, because this function isn't supposed to be
+   * used for HS descriptors. */
+  log_level = setup_full_capture_of_logs(LOG_WARN);
   tt_int_op(dir_fetch_type(DIR_PURPOSE_FETCH_RENDDESC_V2,
ROUTER_PURPOSE_GENERAL, NULL), OP_EQ, NO_DIRINFO);
- done: ;
+  expect_single_log_msg_containing("Unexpected purpose");
+ done:
+  if (log_level)
+teardown_capture_of_logs(log_level);
 }
 
 static void
@@ -3963,6 +3972,7 @@ static void
 test_dir_conn_purpose_to_string(void *data)
 {
   (void)data;
+  int log_level = 0;
 
 #define EXPECT_CONN_PURPOSE(purpose, expected) \
   tt_str_op(dir_conn_purpose_to_string(purpose), OP_EQ, expected);
@@ -3984,9 +3994,15 @@ test_dir_conn_purpose_to_string(void *data)
   EXPECT_CONN_PURPOSE(DIR_PURPOSE_UPLOAD_RENDDESC_V2,
   "hidden-service v2 descriptor upload");
   EXPECT_CONN_PURPOSE(DIR_PURPOSE_FETCH_MICRODESC, "microdescriptor fetch");
+
+  /* This will give a warning, because there is no purpose 1024. */
+  log_level = setup_full_capture_of_logs(LOG_WARN);
   EXPECT_CONN_PURPOSE(1024, "(unknown)");
+  expect_single_log_msg_containing("Called with unknown purpose 1024");
 
-  done: ;
+ done:
+  if (log_level)
+teardown_capture_of_logs(log_level);
 }
 
 

[tor-commits] [tor/master] Fix bug warnings in test_circuitlist.

2016-09-08 Thread nickm
commit d0fe86f39ebcc9b2e17ee3b7fb638e34c2133418
Author: Nick Mathewson 
Date:   Thu Sep 8 14:04:55 2016 -0400

Fix bug warnings in test_circuitlist.
---
 src/test/test_circuitlist.c | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c
index 1e640b5..688515c 100644
--- a/src/test/test_circuitlist.c
+++ b/src/test/test_circuitlist.c
@@ -9,6 +9,7 @@
 #include "circuitbuild.h"
 #include "circuitlist.h"
 #include "test.h"
+#include "log_test_helpers.h"
 
 static channel_t *
 new_fake_channel(void)
@@ -270,6 +271,13 @@ test_rend_token_maps(void *arg)
 }
 
 static void
+mock_channel_dump_statistics(channel_t *chan, int severity)
+{
+  (void)chan;
+  (void)severity;
+}
+
+static void
 test_pick_circid(void *arg)
 {
   bitarray_t *ba = NULL;
@@ -277,13 +285,25 @@ test_pick_circid(void *arg)
   circid_t circid;
   int i;
   (void) arg;
+  int prev_level = 0;
+
+  MOCK(channel_dump_statistics, mock_channel_dump_statistics);
 
   chan1 = tor_malloc_zero(sizeof(channel_t));
   chan2 = tor_malloc_zero(sizeof(channel_t));
   chan2->wide_circ_ids = 1;
 
+  chan1->cmux = circuitmux_alloc();
+  chan2->cmux = circuitmux_alloc();
+
+  /* CIRC_ID_TYPE_NEITHER is supposed to create a warning. */
   chan1->circ_id_type = CIRC_ID_TYPE_NEITHER;
+  prev_level = setup_full_capture_of_logs(LOG_WARN);
   tt_int_op(0, OP_EQ, get_unique_circ_id_by_chan(chan1));
+  expect_single_log_msg_containing("Trying to pick a circuit ID for a "
+   "connection from a client with no identity.");
+  teardown_capture_of_logs(prev_level);
+  prev_level = 0;
 
   /* Basic tests, with no collisions */
   chan1->circ_id_type = CIRC_ID_TYPE_LOWER;
@@ -337,10 +357,17 @@ test_pick_circid(void *arg)
   }
 
  done:
+  if (chan1)
+circuitmux_free(chan1->cmux);
+  if (chan2)
+circuitmux_free(chan2->cmux);
   tor_free(chan1);
   tor_free(chan2);
   bitarray_free(ba);
   circuit_free_all();
+  if (prev_level)
+teardown_capture_of_logs(prev_level);
+  UNMOCK(channel_dump_statistics);
 }
 
 struct testcase_t circuitlist_tests[] = {



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


[tor-commits] [tor/master] Fix typo error in bug warning in relay.c

2016-09-08 Thread nickm
commit 3fcd5d71ad3b8b05b60ef5b3a7a62c3d53625d55
Author: Nick Mathewson 
Date:   Thu Sep 8 15:15:57 2016 -0400

Fix typo error in bug warning in relay.c
---
 src/or/relay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index 38096ad..5fedba2 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2454,7 +2454,7 @@ update_circuit_on_cmux_(circuit_t *circ, cell_direction_t 
direction,
 
   /* Cmux sanity check */
   if (! circuitmux_is_circuit_attached(cmux, circ)) {
-log_warn(LD_BUG, "called on non-attachd circuit from %s:%d",
+log_warn(LD_BUG, "called on non-attached circuit from %s:%d",
  file, lineno);
 return;
   }



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


[tor-commits] [stem/master] Python3 testing failure for ephemeral services

2016-09-08 Thread atagar
commit be9cc749dfae1c3785fe07b08f9e0bff36b86116
Author: Damian Johnson 
Date:   Thu Sep 8 11:44:30 2016 -0700

Python3 testing failure for ephemeral services

Fixing the following test failure caught by toralf...

  https://trac.torproject.org/projects/tor/ticket/20112
---
 test/integ/control/controller.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index 440c9d5..149dc03 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -685,7 +685,7 @@ class TestController(unittest.TestCase):
   response = controller.create_ephemeral_hidden_service(4567, basic_auth = 
{'alice': 'nKwfvVPmTNr2k2pG0pzV4g', 'bob': None})
   self.assertEqual([response.service_id], 
controller.list_ephemeral_hidden_services())
   self.assertTrue(response.private_key is not None)
-  self.assertEqual(['bob'], response.client_auth.keys())  # newly created 
credentials were only created for bob
+  self.assertEqual(['bob'], list(response.client_auth.keys()))  # newly 
created credentials were only created for bob
 
   # drop the service
 

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


[tor-commits] [doctor/master] Resume check for unexpected authority flags

2016-09-08 Thread atagar
commit a75aabbd232885b9032aca5818d96ba52a127728
Author: Damian Johnson 
Date:   Thu Sep 8 10:34:22 2016 -0700

Resume check for unexpected authority flags

Reverting commit 10193a8 now that Tonga has been fully replaced by Bifroest.
---
 consensus_health_checker.py | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/consensus_health_checker.py b/consensus_health_checker.py
index 7d7a354..a2859e9 100755
--- a/consensus_health_checker.py
+++ b/consensus_health_checker.py
@@ -603,10 +603,8 @@ def has_authority_flag(latest_consensus, consensuses, 
votes):
   if missing_authorities:
 issues.append(Issue(Runlevel.WARNING, 'MISSING_AUTHORITIES', authorities = 
', '.join(missing_authorities), to = missing_authorities))
 
-  # TODO: Re-enable when Tonga is gone.
-
-  #if extra_authorities:
-  #  issues.append(Issue(Runlevel.NOTICE, 'EXTRA_AUTHORITIES', authorities = 
', '.join(extra_authorities), to = extra_authorities))
+  if extra_authorities:
+issues.append(Issue(Runlevel.NOTICE, 'EXTRA_AUTHORITIES', authorities = ', 
'.join(extra_authorities), to = extra_authorities))
 
   return issues
 

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


[tor-commits] [stem/master] Add Bifroest as a directory authority

2016-09-08 Thread atagar
commit 75b780acbb544310b92f0ce949f1db4bc42aec3a
Author: Damian Johnson 
Date:   Thu Sep 8 10:33:06 2016 -0700

Add Bifroest as a directory authority

Bifroest has now been up and running for a while as the replacement for 
Tonga.
Past due that I added it to our list and started DocTor checks.
---
 stem/descriptor/remote.py | 9 +
 1 file changed, 9 insertions(+)

diff --git a/stem/descriptor/remote.py b/stem/descriptor/remote.py
index f0c98f4..b47ee2b 100644
--- a/stem/descriptor/remote.py
+++ b/stem/descriptor/remote.py
@@ -852,6 +852,15 @@ DIRECTORY_AUTHORITIES = {
 fingerprint = '74A910646BCEEFBCD2E874FC1DC997430F968145',
 v3ident = '23D15D965BC35114467363C165C4F724B64B4F66',
   ),
+  'Bifroest': DirectoryAuthority(
+nickname = 'Bifroest',
+address = '37.218.247.217',
+or_port = 443,
+dir_port = 80,
+is_bandwidth_authority = False,
+fingerprint = '1D8F3A91C37C5D1C4C19B1AD1D0CFBE8BF72D8E1',
+v3ident = None,  # does not vote in the consensus
+  ),
 }
 
 

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


[tor-commits] [tor/master] Treat all nonfatal assertion failures as unit test failures.

2016-09-08 Thread nickm
commit 3269307dafafa8c7c2c3e0be5d5c3cb5e7df3153
Author: Nick Mathewson 
Date:   Thu Sep 8 13:27:30 2016 -0400

Treat all nonfatal assertion failures as unit test failures.

Part of 1.
---
 changes/bug1_prep |  2 ++
 src/common/util_bug.c | 16 
 src/common/util_bug.h |  1 +
 src/test/testing_common.c |  7 +++
 4 files changed, 26 insertions(+)

diff --git a/changes/bug1_prep b/changes/bug1_prep
index e8bb4a5..769c870 100644
--- a/changes/bug1_prep
+++ b/changes/bug1_prep
@@ -12,6 +12,8 @@
 - Our link-handshake unit tests now check, that when invalid
   handshakes fail, they fail with the error messages we
   expected.
+- The unit tests now treat any failure of a "tor_assert_nonfatal()"
+  assertion as a test failure.
 
   o Minor bugfixes (unit tests):
 - The tor_tls_server_info_callback unit test no longer crashes when
diff --git a/src/common/util_bug.c b/src/common/util_bug.c
index f1cd336..08aba47 100644
--- a/src/common/util_bug.c
+++ b/src/common/util_bug.c
@@ -14,6 +14,7 @@
 #include "container.h"
 
 #ifdef TOR_UNIT_TESTS
+static void (*failed_assertion_cb)(void) = NULL;
 static int n_bugs_to_capture = 0;
 static smartlist_t *bug_messages = NULL;
 #define capturing_bugs() (bug_messages != NULL && n_bugs_to_capture)
@@ -45,6 +46,15 @@ add_captured_bug(const char *s)
   --n_bugs_to_capture;
   smartlist_add(bug_messages, tor_strdup(s));
 }
+/** Set a callback to be invoked when we get any tor_bug_occurred_
+ * invocation. We use this in the unit tests so that a nonfatal
+ * assertion failure can also count as a test failure.
+ */
+void
+tor_set_failed_assertion_callback(void (*fn)(void))
+{
+  failed_assertion_cb = fn;
+}
 #else
 #define capturing_bugs() (0)
 #define add_captured_bug(s) do { } while (0)
@@ -95,5 +105,11 @@ tor_bug_occurred_(const char *fname, unsigned int line,
  expr, func, fname, line);
   }
   log_backtrace(LOG_WARN, LD_BUG, buf);
+
+#ifdef TOR_UNIT_TESTS
+  if (failed_assertion_cb) {
+failed_assertion_cb();
+  }
+#endif
 }
 
diff --git a/src/common/util_bug.h b/src/common/util_bug.h
index 049ca1a..8b69a47 100644
--- a/src/common/util_bug.h
+++ b/src/common/util_bug.h
@@ -153,6 +153,7 @@ void tor_bug_occurred_(const char *fname, unsigned int line,
 void tor_capture_bugs_(int n);
 void tor_end_capture_bugs_(void);
 const struct smartlist_t *tor_get_captured_bug_log_(void);
+void tor_set_failed_assertion_callback(void (*fn)(void));
 #endif
 
 #endif
diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index 6460713..29f36a3 100644
--- a/src/test/testing_common.c
+++ b/src/test/testing_common.c
@@ -217,6 +217,12 @@ const struct testcase_setup_t passthrough_setup = {
   passthrough_test_setup, passthrough_test_cleanup
 };
 
+static void
+an_assertion_failed(void)
+{
+  tinytest_set_test_failed_();
+}
+
 /** Main entry point for unit test code: parse the command line, and run
  * some unit tests. */
 int
@@ -299,6 +305,7 @@ main(int c, const char **v)
 tor_free(errmsg);
 return 1;
   }
+  tor_set_failed_assertion_callback(an_assertion_failed);
 
   atexit(remove_directory);
 

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


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

2016-09-08 Thread translation
commit cae6cba473cbe451c5007d3e503924e00937334b
Author: Translation commit bot 
Date:   Thu Sep 8 15:47:51 2016 +

Update translations for tor-messenger-otrproperties
---
 fi/otr.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fi/otr.properties b/fi/otr.properties
index 9adef98..35d1c42 100644
--- a/fi/otr.properties
+++ b/fi/otr.properties
@@ -22,7 +22,7 @@ error.not_priv=You sent encrypted data to %S, who wasn't 
expecting it.
 error.unreadable=You transmitted an unreadable encrypted message.
 error.malformed=You transmitted a malformed data message.
 resent=[uudelleenlähetetty]
-tlv.disconnected=%S has ended their private conversation with you; you should 
do the same.
+tlv.disconnected=%S on lopettanut yksityisen keskustelun kanssasi; sinun 
pitäisi tehdä sama.
 query.msg=%S has requested an Off-the Record private conversation. However, 
you do not have a plugin to support that. See http://otr.cypherpunks.ca/ for 
more information.
 trust.unused=Käyttämätön
 trust.not_private=Ei yksityinen

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


[tor-commits] [tor/master] Tolerate another failure mode of get_if_addres6_list in tests

2016-09-08 Thread nickm
commit 6a1454aa462c7a1ef8d84fe703d4f28e727ca1c0
Author: Nick Mathewson 
Date:   Thu Sep 8 11:47:16 2016 -0400

Tolerate another failure mode of get_if_addres6_list in tests
---
 src/test/log_test_helpers.h |  5 +
 src/test/test_address.c | 13 -
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h
index 5685ddb..bf2f9a6 100644
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@ -45,6 +45,11 @@ void mock_dump_saved_logs(void);
   assert_log_predicate(mock_saved_log_has_message_containing(str), \
 "expected log to contain " # str);
 
+#define expect_log_msg_containing_either(str1, str2)\
+  assert_log_predicate(mock_saved_log_has_message_containing(str1) ||   \
+   mock_saved_log_has_message_containing(str2), \
+"expected log to contain " # str1 " or " # str2);
+
 #define expect_single_log_msg_containing(str) \
   do {\
 assert_log_predicate(mock_saved_log_has_message_containing(str), \
diff --git a/src/test/test_address.c b/src/test/test_address.c
index e984bea..932dc38 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -794,7 +794,16 @@ test_address_get_if_addrs6_list_internal(void *arg)
 
   (void)arg;
 
+  /* We might drop a log_err */
+  int prev_level = setup_full_capture_of_logs(LOG_ERR);
   results = get_interface_address6_list(LOG_ERR, AF_INET6, 1);
+  tt_int_op(smartlist_len(mock_saved_logs()), OP_LE, 1);
+  if (smartlist_len(mock_saved_logs()) == 1) {
+expect_log_msg_containing_either("connect() failed",
+ "unable to create socket");
+
+  }
+  teardown_capture_of_logs(prev_level);
 
   tt_assert(results != NULL);
   /* Work even on systems without IPv6 interfaces */
@@ -828,7 +837,9 @@ test_address_get_if_addrs6_list_no_internal(void *arg)
   results = get_interface_address6_list(LOG_ERR, AF_INET6, 0);
   tt_int_op(smartlist_len(mock_saved_logs()), OP_LE, 1);
   if (smartlist_len(mock_saved_logs()) == 1) {
-expect_log_msg_containing("connect() failed");
+expect_log_msg_containing_either("connect() failed",
+ "unable to create socket");
+
   }
   teardown_capture_of_logs(prev_level);
 

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


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

2016-09-08 Thread translation
commit f958c3dc917a15b59976a7f35774476f4d6fb68e
Author: Translation commit bot 
Date:   Thu Sep 8 15:18:17 2016 +

Update translations for tor-messenger-prefsdtd_completed
---
 fi/prefs.dtd | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/fi/prefs.dtd b/fi/prefs.dtd
index 7461790..380f25e 100644
--- a/fi/prefs.dtd
+++ b/fi/prefs.dtd
@@ -1,13 +1,22 @@
 
+
+
 
 
 
 
-
-
-
+
+
+
 
-
-
+
+
 
-
\ 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/tor-messenger-prefsdtd] Update translations for tor-messenger-prefsdtd

2016-09-08 Thread translation
commit 0885f70e616d9356185aa8ba212a21a9612ac939
Author: Translation commit bot 
Date:   Thu Sep 8 15:18:04 2016 +

Update translations for tor-messenger-prefsdtd
---
 fi/prefs.dtd | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fi/prefs.dtd b/fi/prefs.dtd
index 6986d12..380f25e 100644
--- a/fi/prefs.dtd
+++ b/fi/prefs.dtd
@@ -9,14 +9,14 @@
 
 
 
-
-
+
+
 
 
-
-
-
-
-
-
-
\ 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] [tor/master] more consistent use of expect_log_msg_containing

2016-09-08 Thread nickm
commit f9cb9d899061770c6d3b3966c08d5e8d844f395a
Author: Nick Mathewson 
Date:   Thu Sep 8 11:16:09 2016 -0400

more consistent use of expect_log_msg_containing
---
 src/test/test_link_handshake.c | 9 +++--
 src/test/test_util.c   | 2 +-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/test/test_link_handshake.c b/src/test/test_link_handshake.c
index e1fd14b..1d60a49 100644
--- a/src/test/test_link_handshake.c
+++ b/src/test/test_link_handshake.c
@@ -344,8 +344,7 @@ test_link_handshake_recv_certs_ok_server(void *arg)
 tt_int_op(0, ==, mock_send_authenticate_called);\
 tt_int_op(0, ==, mock_send_netinfo_called); \
 if (require_failure_message) {  \
-  tt_assert(mock_saved_log_has_message_containing(  \
- require_failure_message)); \
+  expect_log_msg_containing(require_failure_message);   \
 }   \
   done: \
 teardown_capture_of_logs(prev_level);   \
@@ -622,8 +621,7 @@ test_link_handshake_recv_authchallenge_ok_unrecognized(void 
*arg)
 tt_int_op(0, ==, mock_send_authenticate_called);\
 tt_int_op(0, ==, mock_send_netinfo_called); \
 if (require_failure_message) {  \
-  tt_assert(mock_saved_log_has_message_containing(  \
- require_failure_message)); \
+  expect_log_msg_containing(require_failure_message);   \
 }   \
   done: \
 teardown_capture_of_logs(prev_level);   \
@@ -862,8 +860,7 @@ test_link_handshake_auth_cell(void *arg)
 tt_int_op(mock_close_called, ==, 1);\
 tt_int_op(d->c2->handshake_state->authenticated, ==, 0);\
 if (require_failure_message) {  \
-  tt_assert(mock_saved_log_has_message_containing(  \
- require_failure_message)); \
+  expect_log_msg_containing(require_failure_message);   \
 }   \
   done: \
 teardown_capture_of_logs(prev_level);   \
diff --git a/src/test/test_util.c b/src/test/test_util.c
index ca00622..e2e8c54 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -651,7 +651,7 @@ test_util_time(void *arg)
 old_log_level = setup_full_capture_of_logs(LOG_WARN);   \
   } while (0)
 #define CHECK_TIMEGM_WARNING(msg) do { \
-tt_assert(mock_saved_log_has_message_containing(msg));  \
+expect_log_msg_containing(msg); \
 tt_int_op(1, OP_EQ, smartlist_len(mock_saved_logs()));  \
 teardown_capture_of_logs(old_log_level);\
   } while (0)

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


[tor-commits] [tor/master] Fix a bug in connection/download_status.. tests

2016-09-08 Thread nickm
commit d626ffe29ce63950db3593e1a3a61e38b844ae31
Author: Nick Mathewson 
Date:   Thu Sep 8 10:48:22 2016 -0400

Fix a bug in connection/download_status.. tests
---
 src/test/test_connection.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index bf95b0b..92f1f68 100644
--- a/src/test/test_connection.c
+++ b/src/test/test_connection.c
@@ -340,10 +340,7 @@ test_conn_get_rsrc_teardown(const struct testcase_t *tc, 
void *arg)
 static void *
 test_conn_download_status_setup(const struct testcase_t *tc)
 {
-  (void)tc;
-
-  /* Don't return NULL, that causes the test to fail */
-  return (void*)"ok";
+  return (void*)tc;
 }
 
 static int
@@ -655,7 +652,8 @@ test_conn_download_status(void *arg)
   dir_connection_t *conn4 = NULL;
   connection_t *ap_conn = NULL;
 
-  consensus_flavor_t usable_flavor = (consensus_flavor_t)arg;
+  const struct testcase_t *tc = arg;
+  consensus_flavor_t usable_flavor = (consensus_flavor_t)tc->setup_data;
 
   /* The "other flavor" trick only works if there are two flavors */
   tor_assert(N_CONSENSUS_FLAVORS == 2);



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


[tor-commits] [tor/master] Suppress a really impressive pile of warnings in conection/.. tests

2016-09-08 Thread nickm
commit f64f293c48e2293e18d9e183938b21add0643745
Author: Nick Mathewson 
Date:   Thu Sep 8 10:56:51 2016 -0400

Suppress a really impressive pile of warnings in conection/.. tests
---
 src/test/test_connection.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index 92f1f68..bf2cf18 100644
--- a/src/test/test_connection.c
+++ b/src/test/test_connection.c
@@ -192,6 +192,15 @@ test_conn_get_basic_teardown(const struct testcase_t *tc, 
void *arg)
 
 if (!conn->linked_conn->marked_for_close) {
   connection_close_immediate(conn->linked_conn);
+  if (CONN_IS_EDGE(conn->linked_conn)) {
+/* Suppress warnings about all the stuff we didn't do */
+TO_EDGE_CONN(conn->linked_conn)->edge_has_sent_end = 1;
+TO_EDGE_CONN(conn->linked_conn)->end_reason =
+  END_STREAM_REASON_INTERNAL;
+if (conn->linked_conn->type == CONN_TYPE_AP) {
+  TO_ENTRY_CONN(conn->linked_conn)->socks_request->has_finished = 1;
+}
+  }
   connection_mark_for_close(conn->linked_conn);
 }
 
@@ -212,6 +221,14 @@ test_conn_get_basic_teardown(const struct testcase_t *tc, 
void *arg)
 
   if (!conn->marked_for_close) {
 connection_close_immediate(conn);
+if (CONN_IS_EDGE(conn)) {
+  /* Suppress warnings about all the stuff we didn't do */
+  TO_EDGE_CONN(conn)->edge_has_sent_end = 1;
+  TO_EDGE_CONN(conn)->end_reason = END_STREAM_REASON_INTERNAL;
+  if (conn->type == CONN_TYPE_AP) {
+TO_ENTRY_CONN(conn)->socks_request->has_finished = 1;
+  }
+}
 connection_mark_for_close(conn);
   }
 

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


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

2016-09-08 Thread translation
commit 4c0964bd8c2d3e268abe73d0a111f7ab60f65837
Author: Translation commit bot 
Date:   Thu Sep 8 14:48:04 2016 +

Update translations for tor-messenger-prefsdtd
---
 fi/prefs.dtd | 6 +++---
 sv/prefs.dtd | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fi/prefs.dtd b/fi/prefs.dtd
index 4a606a8..6986d12 100644
--- a/fi/prefs.dtd
+++ b/fi/prefs.dtd
@@ -5,9 +5,9 @@
 
 
 
-
-
-
+
+
+
 
 
 
diff --git a/sv/prefs.dtd b/sv/prefs.dtd
index b1fd9c5..c4c1f5b 100644
--- a/sv/prefs.dtd
+++ b/sv/prefs.dtd
@@ -18,5 +18,5 @@
 
 
 
-
-
\ 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-openpgp-applet_completed] Update translations for tails-openpgp-applet_completed

2016-09-08 Thread translation
commit 1e8aa56323e2fd23a92bd91d29bf8e4d2b7cca9a
Author: Translation commit bot 
Date:   Thu Sep 8 14:48:25 2016 +

Update translations for tails-openpgp-applet_completed
---
 fi/openpgp-applet.pot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fi/openpgp-applet.pot b/fi/openpgp-applet.pot
index ef99e09..4596ae8 100644
--- a/fi/openpgp-applet.pot
+++ b/fi/openpgp-applet.pot
@@ -10,7 +10,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: ta...@boum.org\n"
 "POT-Creation-Date: 2015-08-10 15:55+0200\n"
-"PO-Revision-Date: 2016-08-29 17:25+\n"
+"PO-Revision-Date: 2016-09-08 14:41+\n"
 "Last-Translator: Thomas \n"
 "Language-Team: Finnish 
(http://www.transifex.com/otf/torproject/language/fi/)\n"
 "MIME-Version: 1.0\n"

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


[tor-commits] [translation/tails-openpgp-applet] Update translations for tails-openpgp-applet

2016-09-08 Thread translation
commit 8d866690f9873a14793570aa294c5d5b0dd3ed1e
Author: Translation commit bot 
Date:   Thu Sep 8 14:48:21 2016 +

Update translations for tails-openpgp-applet
---
 fi/openpgp-applet.pot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fi/openpgp-applet.pot b/fi/openpgp-applet.pot
index ef99e09..4596ae8 100644
--- a/fi/openpgp-applet.pot
+++ b/fi/openpgp-applet.pot
@@ -10,7 +10,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: ta...@boum.org\n"
 "POT-Creation-Date: 2015-08-10 15:55+0200\n"
-"PO-Revision-Date: 2016-08-29 17:25+\n"
+"PO-Revision-Date: 2016-09-08 14:41+\n"
 "Last-Translator: Thomas \n"
 "Language-Team: Finnish 
(http://www.transifex.com/otf/torproject/language/fi/)\n"
 "MIME-Version: 1.0\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-prefsdtd_completed] Update translations for tor-messenger-prefsdtd_completed

2016-09-08 Thread translation
commit 65ff39fd86307c340b2cef27f626ac2ab766c95f
Author: Translation commit bot 
Date:   Thu Sep 8 14:48:18 2016 +

Update translations for tor-messenger-prefsdtd_completed
---
 sv/prefs.dtd | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sv/prefs.dtd b/sv/prefs.dtd
index 0ace934..c4c1f5b 100644
--- a/sv/prefs.dtd
+++ b/sv/prefs.dtd
@@ -1,5 +1,6 @@
 
 
+
 
 
 
@@ -11,4 +12,11 @@
 
 
 
-
\ 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/tor-messenger-conversationsproperties] Update translations for tor-messenger-conversationsproperties

2016-09-08 Thread translation
commit 1898245e57c575ab6562aa284f4a26c214be4565
Author: Translation commit bot 
Date:   Thu Sep 8 14:47:28 2016 +

Update translations for tor-messenger-conversationsproperties
---
 fi/conversations.properties | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fi/conversations.properties b/fi/conversations.properties
index c0ca279..ce9059b 100644
--- a/fi/conversations.properties
+++ b/fi/conversations.properties
@@ -30,10 +30,10 @@ statusKnown=Tilinne on yhdistetty uudelleen (%1$S on %2$S).
 statusKnownWithStatusText=Tilinne on yhdistetty uudelleen (%1$S on %2$S: %3$S).
 # LOCALIZATION NOTE (statusUnknown):
 #  %S is the display name of the contact.
-statusUnknown=Your account is disconnected (the status of %S is no longer 
known).
+statusUnknown=Tilinne yhteys on katkaistu (%S-tilaa ei enää tunneta).
 
 accountDisconnected=Tilinne yhteys on katkaistu.
-accountReconnected=Tilinne yhteys on uudelleen yhdistetty.
+accountReconnected=Tilinne yhteys on yhdistetty uudelleen.
 
 # LOCALIZATION NOTE (autoReply):
 #  %S is replaced by the text of a message that was sent as an automatic reply.
@@ -45,27 +45,27 @@ noTopic=Aihe puuttuu tästä huoneesta.
 
 # LOCALIZATION NOTE (topicSet):
 #  %1$S is the conversation name, %2$S is the topic.
-topicSet=The topic for %1$S is: %2$S.
+topicSet=Aihe kohteelle %1$S on: %2$S.
 # LOCALIZATION NOTE (topicNotSet):
 #  %S is the conversation name.
-topicNotSet=There is no topic for %S.
+topicNotSet=Kohteelle %S ei ole aihetta.
 # LOCALIZATION NOTE (topicChanged):
 #  %1$S is the user who changed the topic, %2$S is the new topic.
-topicChanged=%1$S has changed the topic to: %2$S.
+topicChanged=%1$S on vaihtanut aiheeksi: %2$S.
 # LOCALIZATION NOTE (topicCleared):
 #  %1$S is the user who cleared the topic.
-topicCleared=%1$S has cleared the topic.
+topicCleared=%1$S on hävittänyt aiheen.
 
 # LOCALIZATION NOTE (nickSet):
 #   This is displayed as a system message when a participant changes his/her
 #   nickname in a conversation.
 #   %1$S is the old nick.
 #   %2$S is the new nick.
-nickSet=%1$S is now known as %2$S.
+nickSet=%1$S tunnetaan nyt nimellä %2$S.
 # LOCALIZATION NOTE (nickSet.you):
 #   This is displayed as a system message when your nickname is changed.
 #   %S is your new nick.
-nickSet.you=You are now known as %S.
+nickSet.you=Sinut tunnetaan nimellä %S.
 
 # LOCALIZATION NOTE (messenger.conversations.selections.ellipsis):
 #  ellipsis is used when copying a part of a message to show that the message 
was cut
@@ -77,4 +77,4 @@ messenger.conversations.selections.ellipsis=[…]
 #  whitespace and separators to make them fit your locale.
 messenger.conversations.selections.systemMessagesTemplate=%aika% - %viesti%
 messenger.conversations.selections.contentMessagesTemplate=%aika% - 
%lähettäjä%: %viesti%
-messenger.conversations.selections.actionMessagesTemplate=%time% * %sender% 
%message%
+messenger.conversations.selections.actionMessagesTemplate=%aika% * 
%lähettäjä% %viesti%

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


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

2016-09-08 Thread translation
commit 99eaf6fd45db1a44d1e6085613f88b9467d15c75
Author: Translation commit bot 
Date:   Thu Sep 8 14:48:33 2016 +

Update translations for tails-onioncircuits
---
 fi/onioncircuits.pot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fi/onioncircuits.pot b/fi/onioncircuits.pot
index 574f7b1..7514037 100644
--- a/fi/onioncircuits.pot
+++ b/fi/onioncircuits.pot
@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-05-31 14:42+0200\n"
-"PO-Revision-Date: 2016-06-23 17:27+\n"
+"PO-Revision-Date: 2016-09-08 14:41+\n"
 "Last-Translator: Thomas \n"
 "Language-Team: Finnish 
(http://www.transifex.com/otf/torproject/language/fi/)\n"
 "MIME-Version: 1.0\n"

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


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

2016-09-08 Thread translation
commit e39b93282e515ead0edca429de808b536d919261
Author: Translation commit bot 
Date:   Thu Sep 8 14:48:36 2016 +

Update translations for tails-onioncircuits_completed
---
 fi/onioncircuits.pot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fi/onioncircuits.pot b/fi/onioncircuits.pot
index 574f7b1..7514037 100644
--- a/fi/onioncircuits.pot
+++ b/fi/onioncircuits.pot
@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-05-31 14:42+0200\n"
-"PO-Revision-Date: 2016-06-23 17:27+\n"
+"PO-Revision-Date: 2016-09-08 14:41+\n"
 "Last-Translator: Thomas \n"
 "Language-Team: Finnish 
(http://www.transifex.com/otf/torproject/language/fi/)\n"
 "MIME-Version: 1.0\n"

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


[tor-commits] [tor/master] Remove redundant definitions of expect_{no_, }log_msg()

2016-09-08 Thread nickm
commit ae3ea9a7a1ff0733d6e80734cd984495aeac6247
Author: Nick Mathewson 
Date:   Thu Sep 8 10:32:59 2016 -0400

Remove redundant definitions of expect_{no_,}log_msg()
---
 src/test/test_options.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/src/test/test_options.c b/src/test/test_options.c
index 87f8966..2748f42 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -394,14 +394,6 @@ free_options_test_data(options_test_data_t *td)
   tor_free(td);
 }
 
-#define expect_log_msg(str) \
-  tt_assert_msg(mock_saved_log_has_message(str), \
-"expected log to contain " # str);
-
-#define expect_no_log_msg(str)  \
-  tt_assert_msg(!mock_saved_log_has_message(str), \
-"expected log to not contain " # str);
-
 static void
 test_options_validate__uname_for_server(void *ignored)
 {



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


[tor-commits] [tor/master] Revise log-testing macros to dump the actual log contents on failure

2016-09-08 Thread nickm
commit 3705ee8fe4771be7b3dce0530cddecf26cff45ce
Author: Nick Mathewson 
Date:   Thu Sep 8 10:33:01 2016 -0400

Revise log-testing macros to dump the actual log contents on failure
---
 src/test/log_test_helpers.c | 15 +++
 src/test/log_test_helpers.h | 28 +++-
 2 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c
index 1ad008a..5eba566 100644
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@ -210,3 +210,18 @@ mock_saving_logv(int severity, log_domain_mask_t domain,
   smartlist_add(saved_logs, e);
 }
 
+void
+mock_dump_saved_logs(void)
+{
+  if (saved_logs == NULL) {
+puts("  Captured logs: NULL");
+return;
+  }
+
+  puts("  Captured logs:");
+  SMARTLIST_FOREACH_BEGIN(saved_logs, const mock_saved_log_entry_t *, m) {
+printf("% 5d. %s: %s\n", m_sl_idx + 1,
+   log_level_to_string(m->severity),
+   escaped(m->generated_msg));
+  } SMARTLIST_FOREACH_END(m);
+}
diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h
index f33ee67..5685ddb 100644
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@ -26,40 +26,50 @@ int mock_saved_log_has_message(const char *msg);
 int mock_saved_log_has_message_containing(const char *msg);
 int mock_saved_log_has_severity(int severity);
 int mock_saved_log_has_entry(void);
+void mock_dump_saved_logs(void);
 
-#define expect_log_msg(str) \
-  tt_assert_msg(mock_saved_log_has_message(str), \
+#define assert_log_predicate(predicate, failure_msg)   \
+  do { \
+if (!(predicate)) {\
+  tt_fail_msg((failure_msg));  \
+  mock_dump_saved_logs();  \
+  TT_EXIT_TEST_FUNCTION;   \
+}  \
+  } while (0)
+
+#define expect_log_msg(str) \
+  assert_log_predicate(mock_saved_log_has_message(str), \
 "expected log to contain " # str);
 
 #define expect_log_msg_containing(str) \
-  tt_assert_msg(mock_saved_log_has_message_containing(str), \
+  assert_log_predicate(mock_saved_log_has_message_containing(str), \
 "expected log to contain " # str);
 
 #define expect_single_log_msg_containing(str) \
   do {\
-tt_assert_msg(mock_saved_log_has_message_containing(str), \
+assert_log_predicate(mock_saved_log_has_message_containing(str), \
   "expected log to contain " # str);  \
 tt_int_op(smartlist_len(mock_saved_logs()), OP_EQ, 1);\
   } while (0);
 
 #define expect_no_log_msg(str) \
-  tt_assert_msg(!mock_saved_log_has_message(str), \
+  assert_log_predicate(!mock_saved_log_has_message(str), \
 "expected log to not contain " # str);
 
 #define expect_log_severity(severity) \
-  tt_assert_msg(mock_saved_log_has_severity(severity), \
+  assert_log_predicate(mock_saved_log_has_severity(severity), \
 "expected log to contain severity " # severity);
 
 #define expect_no_log_severity(severity) \
-  tt_assert_msg(!mock_saved_log_has_severity(severity), \
+  assert_log_predicate(!mock_saved_log_has_severity(severity), \
 "expected log to not contain severity " # severity);
 
 #define expect_log_entry() \
-  tt_assert_msg(mock_saved_log_has_entry(), \
+  assert_log_predicate(mock_saved_log_has_entry(), \
 "expected log to contain entries");
 
 #define expect_no_log_entry() \
-  tt_assert_msg(!mock_saved_log_has_entry(), \
+  assert_log_predicate(!mock_saved_log_has_entry(), \
 "expected log to not contain entries");
 
 #endif

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


[tor-commits] [tor/master] Fix libevent linking on openbsd.

2016-09-08 Thread nickm
commit fe9cfeba6ec96c11d009f4d57bf03f0019e34c9d
Author: Nick Mathewson 
Date:   Thu Sep 8 10:08:29 2016 -0400

Fix libevent linking on openbsd.

Closes ticket 19902; bugfix on 0.2.9.1-alpha; patch from rubiate
---
 changes/bug19902 | 5 +
 configure.ac | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/changes/bug19902 b/changes/bug19902
new file mode 100644
index 000..297570e
--- /dev/null
+++ b/changes/bug19902
@@ -0,0 +1,5 @@
+  o Major bugfixes (compilation, OpenBSD):
+
+- Fix a Libevent-detection bug in our autoconf script that would
+  prevent Tor from linking successfully on OpenBSD. Patch from
+  rubiate. Fixes bug 19902; bugfix on 0.2.9.1-alpha.
diff --git a/configure.ac b/configure.ac
index ed57757..fc27017 100644
--- a/configure.ac
+++ b/configure.ac
@@ -501,6 +501,8 @@ AC_CHECK_FUNCS([evutil_secure_rng_set_urandom_device_file \
 evutil_secure_rng_add_bytes \
 ])
 
+AC_CHECK_HEADERS(event2/event.h event2/dns.h event2/bufferevent_ssl.h)
+
 LIBS="$STATIC_LIBEVENT_FLAGS $TOR_LIB_WS32 $save_LIBS"
 
 if test "$enable_static_libevent" = "yes"; then
@@ -521,7 +523,7 @@ else
  TOR_LIBEVENT_LIBS="$ac_cv_search_evdns_base_new $TOR_LIBEVENT_LIBS"
fi
  else
-   TOR_LIBEVENT_LIBS="-levent"
+   AC_MSG_ERROR("libevent2 is required but the headers could not be found")
  fi
 fi
 

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


[tor-commits] [tor/master] Disable -Wthread-safety.

2016-09-08 Thread nickm
commit f3cda3272a2504f8ffd66e1a5625c268ce660f4c
Author: Nick Mathewson 
Date:   Thu Sep 8 09:37:40 2016 -0400

Disable -Wthread-safety.

See changes file; closes ticket 20110.
---
 changes/bug20110 |  6 ++
 configure.ac | 13 -
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/changes/bug20110 b/changes/bug20110
new file mode 100644
index 000..bb56a13
--- /dev/null
+++ b/changes/bug20110
@@ -0,0 +1,6 @@
+  o Minor bugfixes (compilation):
+
+- Stop trying to build with Clang 4.0's -Wthread-safety
+  warnings. They apparently require a set of annotations that we
+  aren't currently using, and they create false positives in our
+  pthreads wrappers. Fixes bug 20110; bugfix on 0.2.9.1-alpha.
diff --git a/configure.ac b/configure.ac
index a90c15c..ed57757 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1800,11 +1800,6 @@ if test "x$enable_gcc_warnings_advisory" != "xno"; then
  -Wsync-nand
  -Wtautological-constant-out-of-range-compare
  -Wtentative-definition-incomplete-type
- -Wthread-safety
- -Wthread-safety-analysis
- -Wthread-safety-attributes
- -Wthread-safety-beta
- -Wthread-safety-precise
  -Wtrampolines
  -Wtype-safety
  -Wtypedef-redefinition
@@ -1838,6 +1833,14 @@ if test "x$enable_gcc_warnings_advisory" != "xno"; then
  -Wzero-length-array
   ], [ TOR_CHECK_CFLAGS([warning_flag]) ])
 
+dnlThese seem to require annotations that we don't currently use,
+dnland they give false positives in our pthreads wrappers. (Clang 4)
+dnl -Wthread-safety
+dnl -Wthread-safety-analysis
+dnl -Wthread-safety-attributes
+dnl -Wthread-safety-beta
+dnl -Wthread-safety-precise
+
   CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith"
   CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings"
   CFLAGS="$CFLAGS -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2"

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


[tor-commits] [tor/master] Unit test fix: windows should be able to handle DNSPort just fine.

2016-09-08 Thread nickm
commit 8acb951fc823e985218ef86dce1939f106febf7e
Author: Nick Mathewson 
Date:   Thu Sep 8 09:23:20 2016 -0400

Unit test fix: windows should be able to handle DNSPort just fine.
---
 src/test/test_config.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/src/test/test_config.c b/src/test/test_config.c
index 80a1727..c1222e5 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -4011,9 +4011,6 @@ test_config_parse_port_config__ports__ports_given(void 
*data)
   ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
   CONN_TYPE_AP_DNS_LISTENER, NULL, 0,
   CL_PORT_TAKES_HOSTNAMES);
-#ifdef _WIN32
-  tt_int_op(ret, OP_EQ, -1);
-#else
   tt_int_op(ret, OP_EQ, 0);
   tt_int_op(smartlist_len(slout), OP_EQ, 1);
   port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
@@ -4021,7 +4018,6 @@ test_config_parse_port_config__ports__ports_given(void 
*data)
   tt_int_op(port_cfg->entry_cfg.ipv4_traffic, OP_EQ, 0);
   tt_int_op(port_cfg->entry_cfg.ipv6_traffic, OP_EQ, 0);
   tt_int_op(port_cfg->entry_cfg.onion_traffic, OP_EQ, 0);
-#endif
 
   // Test failure if we have DNS but no ipv4 and no ipv6
   config_free_lines(config_port_invalid); config_port_invalid = NULL;

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


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

2016-09-08 Thread translation
commit 42d262f068c7c4898b3be615c46aaa92b7118fa1
Author: Translation commit bot 
Date:   Thu Sep 8 13:17:42 2016 +

Update translations for tor-messenger-fingerdtd_completed
---
 fi/finger.dtd | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/fi/finger.dtd b/fi/finger.dtd
index 1b0a7c4..fbd3ba7 100644
--- a/fi/finger.dtd
+++ b/fi/finger.dtd
@@ -1,10 +1,15 @@
-
+
 
 
 
 
 
-
+
 
 
-
\ 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/tor-messenger-fingerdtd] Update translations for tor-messenger-fingerdtd

2016-09-08 Thread translation
commit 70fcc22ab1087992718a10f82e1c052c23e44950
Author: Translation commit bot 
Date:   Thu Sep 8 13:17:39 2016 +

Update translations for tor-messenger-fingerdtd
---
 fi/finger.dtd | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fi/finger.dtd b/fi/finger.dtd
index 9b60a30..fbd3ba7 100644
--- a/fi/finger.dtd
+++ b/fi/finger.dtd
@@ -1,15 +1,15 @@
-
+
 
 
 
 
 
-
+
 
 
-
-
+
+
 
-
+
 
-
\ 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] [torspec/master] Specify "p" lines in a consensus as required

2016-09-08 Thread nickm
commit dca09fda52993babfc00d3e76e681913450d5f82
Author: Sebastian Hahn 
Date:   Tue Sep 6 21:06:35 2016 +0200

Specify "p" lines in a consensus as required

This is motivated to remove an ambiguity about what a missing "p" line
means when comparing historical consensus data.
---
 dir-spec.txt | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dir-spec.txt b/dir-spec.txt
index db1378f..d5e8376 100644
--- a/dir-spec.txt
+++ b/dir-spec.txt
@@ -1369,16 +1369,17 @@
 
  "p" SP ("accept" / "reject") SP PortList NL
 
-[At most once]
+[Exactly once.]
 
-The exit-policy summary as specified in sections 3.4.1 and 3.8.2.  A
-missing "p" line is equivalent to "p reject 1-65535".
+The exit-policy summary as specified in sections 3.4.1 and 3.8.2.
 
 [With microdescriptors, clients don't learn exact exit policies:
 clients can only guess whether a relay accepts their request, try the
 BEGIN request, and might get end-reason-exit-policy if they guessed
 wrong, in which case they'll have to try elsewhere.]
 
+[In consensus methods before 5, this line was omitted.]
+
  "p6" SP ("accept" / "reject") SP PortList NL
 
 [At most once]



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


[tor-commits] [torspec/master] Merge branch 'ticket20089_squashed'

2016-09-08 Thread nickm
commit dda7a944a1eb5fb958c9e9e24770cb74b19e0213
Merge: 04ee910 dca09fd
Author: Nick Mathewson 
Date:   Thu Sep 8 09:15:23 2016 -0400

Merge branch 'ticket20089_squashed'

 dir-spec.txt | 7 ---
 1 file changed, 4 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] Clarify that 'signature\n' is also signed along with all onion descriptor fields

2016-09-08 Thread nickm
commit 04ee91071c5766fb76f83169e0e05e33dd2e94b1
Author: Ivan Markin 
Date:   Wed Sep 7 18:27:25 2016 +

Clarify that 'signature\n' is also signed along with all onion descriptor 
fields
---
 rend-spec.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rend-spec.txt b/rend-spec.txt
index cf32f2b..28e039a 100644
--- a/rend-spec.txt
+++ b/rend-spec.txt
@@ -396,8 +396,8 @@
[At end, exactly once]
[No extra arguments]
 
-   A signature of all fields above with the private key of the hidden
-   service.
+   A signature of all fields above including '"signature" NL' with
+   the private key of the hidden service.
 
 1.3.1. Other descriptor formats we don't use.
 

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


[tor-commits] [tor/master] Patch from rubiate: disable openbsd memory protections in test-memwipe

2016-09-08 Thread nickm
commit 08d1ac4f2ae81a79d19cbb830c3c88cb2998cb6e
Author: Nick Mathewson 
Date:   Thu Sep 8 09:00:24 2016 -0400

Patch from rubiate: disable openbsd memory protections in test-memwipe

Test-memwipe is *supposed* to invoke undefined behavior, alas.

Closes 20066.
---
 changes/ticket20066 | 5 +
 src/test/test-memwipe.c | 6 ++
 2 files changed, 11 insertions(+)

diff --git a/changes/ticket20066 b/changes/ticket20066
new file mode 100644
index 000..970793d
--- /dev/null
+++ b/changes/ticket20066
@@ -0,0 +1,5 @@
+  o Minor features (testing):
+- Disable memory protections on OpenBSD when testing memwipe().
+  The test deliberately invokes undefined behaviour which the
+  protections interfere with. Patch from "rubiate". Closes ticket
+  20066.
diff --git a/src/test/test-memwipe.c b/src/test/test-memwipe.c
index 2d40283..8187c45 100644
--- a/src/test/test-memwipe.c
+++ b/src/test/test-memwipe.c
@@ -35,6 +35,12 @@ const char *s = NULL;
 sum += (unsigned char)buf[i];   \
   }
 
+#ifdef __OpenBSD__
+/* Disable some of OpenBSD's malloc protections for this test. This helps
+ * us do bad things, such as access freed buffers, without crashing. */
+const char *malloc_options="sufjj";
+#endif
+
 static unsigned
 fill_a_buffer_memset(void)
 {

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


[tor-commits] [webwml/master] Tor Mirror update for 9/8/2016 at 0350 AM

2016-09-08 Thread sebastian
commit 9626ba4dcbb35d015f16fb01a0e157aabe433ccb
Author: John L. Ricketts, PhD 
Date:   Thu Sep 8 03:51:07 2016 -0500

Tor Mirror update for 9/8/2016 at 0350 AM
---
 include/mirrors-table.wmi | 202 +++-
 include/tor-mirrors.csv   | 209 --
 2 files changed, 191 insertions(+), 220 deletions(-)

diff --git a/include/mirrors-table.wmi b/include/mirrors-table.wmi
index a341692..af221ed 100644
--- a/include/mirrors-table.wmi
+++ b/include/mirrors-table.wmi
@@ -137,23 +137,6 @@
  
 
 
- AT
-
- Tor Supporter
-
- Up to date
-
- - 
-http://torproject.ph3x.at/dist/;>http
-http://torproject.ph3x.at/;>http
- - 
- - 
- - 
- - 
-
- 
-
-
  MX
 
  Tor Supporter
@@ -222,17 +205,17 @@
  
 
 
- IS
+ DE
 
- TheOnionRouter
+ crazyhaze.de
 
  Up to date
 
  - 
-http://www.theonionrouter.com/dist/;>http
-http://www.theonionrouter.com/;>http
- - 
- - 
+http://tor.crazyhaze.de/dist/;>http
+http://tor.crazyhaze.de/;>http
+https://tor.crazyhaze.de/dist/;>https
+https://tor.crazyhaze.de/;>https
  - 
  - 
 
@@ -477,53 +460,36 @@
  
 
 
- DE
+ US
 
- Tor Supporter
+ Setec Administrator
 
  Up to date
 
  - 
-http://torproject.hactar.bz/dist/;>http
-http://torproject.hactar.bz;>http
- - 
+http://tor.nuclear-weapons.net/dist;>http
+http://tor.nuclear-weapons.net;>http
+https://tor.nuclear-weapons.net/dist;>https
+https://tor.nuclear-weapons.net;>https
  - 
  - 
- - 
-
- 
-
-
- FR
-
- Babylon Network
-
- Up to date
-
-ftp://mirror0.babylon.network/torproject/;>ftp
-http://mirror0.babylon.network/torproject/dist/;>http
-http://mirror0.babylon.network/torproject/;>http
-https://mirror0.babylon.network/torproject/dist/;>https
-https://mirror0.babylon.network/torproject/;>https
-rsync
-rsync
 
  
 
 
- FR
+ DE
 
- Babylon Network
+ Tor Supporter
 
  Up to date
 
-ftp://mirror1.babylon.network/torproject/;>ftp
-http://mirror1.babylon.network/torproject/dist/;>http
-http://mirror1.babylon.network/torproject/;>http
-https://mirror1.babylon.network/torproject/dist/;>https
-https://mirror1.babylon.network/torproject/;>https
-rsync
-rsync
+ - 
+http://torproject.hactar.bz/dist/;>http
+http://torproject.hactar.bz;>http
+ - 
+ - 
+ - 
+ - 
 
  
 
@@ -698,23 +664,6 @@
  
 
 
- CH
-
- urown.net
-
- Up to date
-
- - 
-http://torproject.urown.net/dist/;>http
-http://torproject.urown.net/;>http
-https://torproject.urown.net/dist/;>https
-https://torproject.urown.net/;>https
- - 
- - 
-
- 
-
-
  DE
 
  sela Internet
@@ -817,17 +766,17 @@
  
 
 
- DE
+ US
 
- tormirror
+ The Calyx Institute
 
  Up to date
 
-http://tormirror.snydernet.net/dist/;>ftp
-https://tormirror.snydernet.net/dist/;>http
-https://tormirror.snydernet.net/;>http
- - 
  - 
+http://tor.calyxinstitute.org/dist/;>http
+http://tor.calyxinstitute.org;>http
+https://tor.calyxinstitute.org/dist/;>https
+https://tor.calyxinstitute.org;>https
  - 
  - 
 
@@ -836,83 +785,100 @@
 
  FR
 
- Tor Supporter
+ Michael Armbruster
 
  Up to date
 
  - 
-http://tor.hermes.bendellar.com/dist;>http
-http://tor.hermes.bendellar.com;>http
-https://tor.hermes.bendellar.com/dist;>https
-https://tor.hermes.bendellar.com;>https
- - 
- - 
+http://tor.armbrust.me/dist/;>http
+http://tor.armbrust.me/;>http
+https://tor.armbrust.me/dist;>https
+https://tor.armbrust.me/;>https
+rsync
+rsync
 
  
 
 
- US
+ DE
 
- The Calyx Institute
+ HdO Tor Supporter
 
  Up to date
 
  - 
-http://tor.calyxinstitute.org/dist/;>http
-http://tor.calyxinstitute.org;>http
-https://tor.calyxinstitute.org/dist/;>https
-https://tor.calyxinstitute.org;>https
+http://tor.hdoev.de/dist/;>http
+http://tor.hdoev.de/;>http
+ - 
+ - 
  - 
  - 
 
  
 
 
- FR
+ US
 
- Michael Armbruster
+ Quintex Alliance Consulting
 
  Up to date
 
- - 
-http://tor.armbrust.me/dist/;>http
-http://tor.armbrust.me/;>http
-https://tor.armbrust.me/dist;>https
-https://tor.armbrust.me/;>https
-rsync
-rsync
+ftp://mirror.quintex.com/torproject.org;>ftp
+http://torproject.quintex.com/dist;>http
+http://torproject.quintex.com/;>http
+https://torproject.quintex.com/dist;>https
+https://torproject.quintex.com;>https
+rsync
+rsync
 
  
 
 

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

2016-09-08 Thread translation
commit f1f64fae194455167a620131516bafe1bc6add13
Author: Translation commit bot 
Date:   Thu Sep 8 10:47:59 2016 +

Update translations for tails-perl5lib_completed
---
 fi.po | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fi.po b/fi.po
index 9ec6a9c..64bf370 100644
--- a/fi.po
+++ b/fi.po
@@ -6,13 +6,14 @@
 # Jaakko Helleranta , 2016
 # Jorma Karvonen , 2015
 # Propa G, 2016
+# Finland355 , 2016
 msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
-"POT-Creation-Date: 2016-01-25 16:59+0100\n"
-"PO-Revision-Date: 2016-03-21 16:27+\n"
-"Last-Translator: Jaakko Helleranta \n"
+"POT-Creation-Date: 2016-06-05 19:40+0200\n"
+"PO-Revision-Date: 2016-09-08 10:44+\n"
+"Last-Translator: Finland355 \n"
 "Language-Team: Finnish 
(http://www.transifex.com/otf/torproject/language/fi/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -34,4 +35,4 @@ msgstr "Laitetta, jolta Tailsia käytetään, ei tunnistettu. 
Käytitkö käynni
 msgid ""
 "The drive Tails is running from cannot be found. Maybe you used the `toram' "
 "option?"
-msgstr "Asemaa josta Tails ajetaan, ei löydy. Ehkä käytit 
’toram’-vaihtoehtoa?"
+msgstr "Asemaa josta Tails suoritetaan, ei löydy. Ehkä käytit 
’toram’-vaihtoehtoa?"

___
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

2016-09-08 Thread translation
commit 2e68d8e446f3f170cb7ffe6033dea47134a14498
Author: Translation commit bot 
Date:   Thu Sep 8 10:47:56 2016 +

Update translations for tails-perl5lib
---
 fi.po | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fi.po b/fi.po
index 9ec6a9c..64bf370 100644
--- a/fi.po
+++ b/fi.po
@@ -6,13 +6,14 @@
 # Jaakko Helleranta , 2016
 # Jorma Karvonen , 2015
 # Propa G, 2016
+# Finland355 , 2016
 msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
-"POT-Creation-Date: 2016-01-25 16:59+0100\n"
-"PO-Revision-Date: 2016-03-21 16:27+\n"
-"Last-Translator: Jaakko Helleranta \n"
+"POT-Creation-Date: 2016-06-05 19:40+0200\n"
+"PO-Revision-Date: 2016-09-08 10:44+\n"
+"Last-Translator: Finland355 \n"
 "Language-Team: Finnish 
(http://www.transifex.com/otf/torproject/language/fi/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -34,4 +35,4 @@ msgstr "Laitetta, jolta Tailsia käytetään, ei tunnistettu. 
Käytitkö käynni
 msgid ""
 "The drive Tails is running from cannot be found. Maybe you used the `toram' "
 "option?"
-msgstr "Asemaa josta Tails ajetaan, ei löydy. Ehkä käytit 
’toram’-vaihtoehtoa?"
+msgstr "Asemaa josta Tails suoritetaan, ei löydy. Ehkä käytit 
’toram’-vaihtoehtoa?"

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


[tor-commits] [tor-browser-bundle/master] Bug 19856: Make OS X builds reproducible again

2016-09-08 Thread gk
commit 73a698d2e1875763c153282a0eb19c259bd3788b
Author: Georg Koppen 
Date:   Mon Aug 15 12:10:19 2016 +

Bug 19856: Make OS X builds reproducible again

We recently found a machine that includes actual timestamps into
OpenSSL libraries we need for tor. The reason for this is unknown as
other KVM and LXC machines are generating matching builds.

Resorting to libfaketime again solves this issue.
---
 gitian/descriptors/mac/gitian-utils.yml | 34 ++---
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/gitian/descriptors/mac/gitian-utils.yml 
b/gitian/descriptors/mac/gitian-utils.yml
index 33db2e8..f54d5cb 100644
--- a/gitian/descriptors/mac/gitian-utils.yml
+++ b/gitian/descriptors/mac/gitian-utils.yml
@@ -7,6 +7,7 @@ architectures:
 - "i386"
 - "amd64"
 packages:
+- "faketime"
 - "automake"
 - "libtool"
 - "zip"
@@ -14,6 +15,8 @@ reference_datetime: "2000-01-01 00:00:00"
 remotes:
 - "url": "https://github.com/libevent/libevent.git;
   "dir": "libevent"
+- "url": "https://github.com/wolfcw/libfaketime;
+  "dir": "faketime"
 - "url": "https://github.com/llvm-mirror/llvm;
   "dir": "llvm"
 - "url": "https://github.com/llvm-mirror/clang;
@@ -24,14 +27,13 @@ files:
 - "apple-uni-sdk-10.6_20110407-0.flosoft1_i386.deb"
 - 
"multiarch-darwin11-cctools127.2-gcc42-5666.3-llvmgcc42-2336.1-Linux-120724.tar.xz"
 - "openssl.tar.gz"
-- "openssl-Make-build-reproducible.patch"
 - "gmp.tar.bz2"
 - "versions"
 - "dzip.sh"
+- "libfaketime.patch"
 script: |
   INSTDIR="$HOME/install"
   source versions
-  export REFERENCE_DATETIME
   export TZ=UTC
   export LC_ALL=C
   umask 0022
@@ -54,13 +56,21 @@ script: |
 make $MAKEOPTS
 make install
 cd $INSTDIR
-# Since we stopped using libfaketime, the clang archive is no longer
-# reproducible. The reason is that it includes some .a archives and
-# other files which include timestamps.
-# Those files are however not part of the files we ship.
 ~/build/dzip.sh clang-$CLANG_VER-linux64-wheezy-utils.zip clang
 cp *utils.zip $OUTDIR/
   else
+# Building libfaketime.
+cd faketime
+export GIT_COMMITTER_NAME="nobody"
+export GIT_COMMITTER_EMAIL="nobody@localhost"
+export GIT_COMMITTER_DATE="$REFERENCE_DATETIME"
+git am ~/build/libfaketime.patch
+make
+DESTDIR="$INSTDIR/faketime" make install
+export FAKETIME_SKIP_CMDS="make"
+export FAKETIME=$REFERENCE_DATETIME
+cd ..
+
 # dpkg requires sbin directories in the PATH
 export PATH="/usr/sbin:/sbin:$PATH"
 sudo dpkg -i *.deb
@@ -81,14 +91,15 @@ script: |
 ./autogen.sh
 find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
 ./configure --disable-static --host=i686-apple-darwin11 
--prefix=$INSTDIR/libevent
+export 
LD_PRELOAD="$INSTDIR/faketime/usr/local/lib/faketime/libfaketime.so.1"
 make $MAKEOPTS
 make install
 cd ..
 
 # Building OpenSSL
+# We still need libfaketime here it seems, see #19856 for details.
 tar xzf openssl.tar.gz
 cd openssl-*
-patch -p1 < ../openssl-Make-build-reproducible.patch
 find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
 # TODO: Add enable-ec_nistp_64_gcc_128 for 64bit OS X.
 ./Configure --cross-compile-prefix=i686-apple-darwin11- $CFLAGS 
darwin64-x86_64-cc --prefix=$INSTDIR/openssl enable-ec_nistp_64_gcc_128
@@ -101,19 +112,20 @@ script: |
 # Building GMP
 tar xjf gmp.tar.bz2
 cd gmp-*
+# |configure| can't cope with nano seconds faked. And even if we would 
revert
+# that feature it would hang sometimes for unknown but to libfaketime 
related
+# reasons.
+export LD_PRELOAD=""
 find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
 # Even if we are not shipping libgmpxx anymore we still need --enable-xcc
 # during compile time.
 ./configure --host=x86_64-apple-darwin11 --prefix=$INSTDIR/gmp 
--disable-static --enable-shared --enable-cxx
+export 
LD_PRELOAD="$INSTDIR/faketime/usr/local/lib/faketime/libfaketime.so.1"
 make
 make install
 cd ..
 
 # Grabbing the results
-# Since we stopped using libfaketime, the openssl archive is no
-# longer reproducible. The main reason is that it includes some .a
-# archives which include timestamps.
-# Those files are however not part of the files we ship.
 cd $INSTDIR
 ~/build/dzip.sh openssl-$OPENSSL_VER-mac64-utils.zip openssl
 ~/build/dzip.sh libevent-${LIBEVENT_TAG#release-}-mac64-utils.zip libevent

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