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

2017-09-12 Thread translation
commit 72d2fa0484a40e58d6eca5dd006776bbce3b1f71
Author: Translation commit bot 
Date:   Wed Sep 13 06:48:02 2017 +

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

diff --git a/ru/openpgp-applet.pot b/ru/openpgp-applet.pot
index 7d325e1cb..6b1206358 100644
--- a/ru/openpgp-applet.pot
+++ b/ru/openpgp-applet.pot
@@ -11,7 +11,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: ta...@boum.org\n"
 "POT-Creation-Date: 2017-08-05 15:07-0400\n"
-"PO-Revision-Date: 2017-09-12 11:27+\n"
+"PO-Revision-Date: 2017-09-13 06:18+\n"
 "Last-Translator: Misha Dyachuk \n"
 "Language-Team: Russian 
(http://www.transifex.com/otf/torproject/language/ru/)\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

2017-09-12 Thread translation
commit a3dca95cc1d1cf8161e8c82eda00371031125b32
Author: Translation commit bot 
Date:   Wed Sep 13 06:47:55 2017 +

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

diff --git a/ru/openpgp-applet.pot b/ru/openpgp-applet.pot
index 7d325e1cb..6b1206358 100644
--- a/ru/openpgp-applet.pot
+++ b/ru/openpgp-applet.pot
@@ -11,7 +11,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: ta...@boum.org\n"
 "POT-Creation-Date: 2017-08-05 15:07-0400\n"
-"PO-Revision-Date: 2017-09-12 11:27+\n"
+"PO-Revision-Date: 2017-09-13 06:18+\n"
 "Last-Translator: Misha Dyachuk \n"
 "Language-Team: Russian 
(http://www.transifex.com/otf/torproject/language/ru/)\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] [chutney/master] Disable v3 onion services in mixed networks

2017-09-12 Thread teor
commit 99b7c5e8e8e063af8a166fea65ce77f02a483e39
Author: teor 
Date:   Wed Sep 13 14:44:42 2017 +1000

Disable v3 onion services in mixed networks

This is a workaround until 23498 is implemented.
---
 networks/mixed+hs-v23 | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/networks/mixed+hs-v23 b/networks/mixed+hs-v23
index f959032..eab43e9 100644
--- a/networks/mixed+hs-v23
+++ b/networks/mixed+hs-v23
@@ -11,14 +11,16 @@ OldClient = Node(tag="cOLD", client=1, torrc="client.tmpl", 
tor=OLD_TOR)
 HSv2 = Node(tag="h", hs=1, torrc="hs.tmpl")
 OldHSv2 = Node(tag="hOLD", hs=1, torrc="hs.tmpl", tor=OLD_TOR)
 # Old tor versions don't have HSv3 support yet
-HSv3 = Node(tag="h", hs=1, torrc="hs-v3.tmpl")
+# And chutney doesn't know how to tell old clients to avoid v3 services
+# See 23498
+#HSv3 = Node(tag="h", hs=1, torrc="hs-v3.tmpl")
 
 # We need 8 authorities/relays/exits to ensure at least 2 get the guard flag
 # in 0.2.6
 NODES = Authority.getN(2) + OldAuthority.getN(2) + \
 Relay.getN(2) + OldRelay.getN(2) + \
 Client.getN(1) + OldClient.getN(1) + \
-HSv2.getN(1) + OldHSv2.getN(1) + \
-HSv3.getN(1)
+HSv2.getN(1) + OldHSv2.getN(1)
+#HSv3.getN(1)
 
 ConfigureNodes(NODES)

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


[tor-commits] [chutney/master] Tag every client and bridge client in every networks file

2017-09-12 Thread teor
commit d1535113b2ef5c803877347612ad0376a1a034b0
Author: teor 
Date:   Wed Sep 13 13:14:48 2017 +1000

Tag every client and bridge client in every networks file

Using the following mass replace scripts:

sed -i~ 's/tag="c",/tag="c", client=1,/'
sed -i~ 's/tag="cOLD",/tag="cOLD", client=1,/'
sed -i~ 's/tag="bc",/tag="bc", client=1, bridgeclient=1,/'
sed -i~ 's/tag="bcOLD",/tag="bcOLD", client=1, bridgeclient=1,/'

Part of 4, but currently unused.
---
 networks/basic| 2 +-
 networks/basic-025| 2 +-
 networks/basic-100| 2 +-
 networks/basic-min| 2 +-
 networks/basic-min-mixed  | 4 ++--
 networks/bridges  | 4 ++--
 networks/bridges+hs   | 4 ++--
 networks/bridges+hs-v23   | 4 ++--
 networks/bridges+ipv6 | 4 ++--
 networks/bridges+ipv6+hs  | 4 ++--
 networks/bridges+ipv6+hs-v23  | 4 ++--
 networks/bridges+ipv6-min | 2 +-
 networks/bridges-min  | 2 +-
 networks/client-ipv6-only | 2 +-
 networks/hs   | 2 +-
 networks/hs-025   | 2 +-
 networks/hs-100   | 2 +-
 networks/hs-100-clients   | 2 +-
 networks/hs-client-ipv6   | 2 +-
 networks/hs-exit-min  | 2 +-
 networks/hs-intro | 2 +-
 networks/hs-ipv6  | 4 ++--
 networks/hs-min   | 2 +-
 networks/hs-min-mixed | 4 ++--
 networks/hs-v2-min| 2 +-
 networks/hs-v23-ipv6  | 4 ++--
 networks/hs-v23-min   | 2 +-
 networks/hs-v3| 2 +-
 networks/hs-v3-intro  | 2 +-
 networks/hs-v3-ipv6   | 4 ++--
 networks/hs-v3-min| 2 +-
 networks/ipv6-exit-min| 2 +-
 networks/middle   | 2 +-
 networks/middle-025   | 2 +-
 networks/middle-100   | 2 +-
 networks/mixed| 4 ++--
 networks/mixed+hs-v2  | 4 ++--
 networks/mixed+hs-v23 | 4 ++--
 networks/mixed+hs-v3  | 4 ++--
 networks/single-onion | 2 +-
 networks/single-onion-client-ipv6 | 2 +-
 networks/single-onion-indirect| 2 +-
 networks/single-onion-ipv6| 4 ++--
 networks/single-onion-v23 | 2 +-
 networks/single-onion-v23-ipv6| 4 ++--
 networks/single-onion-v3  | 2 +-
 networks/single-onion-v3-ipv6 | 4 ++--
 47 files changed, 65 insertions(+), 65 deletions(-)

diff --git a/networks/basic b/networks/basic
index f3f94de..703f5fc 100644
--- a/networks/basic
+++ b/networks/basic
@@ -1,7 +1,7 @@
 # By default, Authorities are not configured as exits
 Authority = Node(tag="a", authority=1, relay=1, torrc="authority.tmpl")
 ExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl")
-Client = Node(tag="c", torrc="client.tmpl")
+Client = Node(tag="c", client=1, torrc="client.tmpl")
 
 # We need 8 authorities/relays/exits to ensure at least 2 get the guard flag
 # in 0.2.6
diff --git a/networks/basic-025 b/networks/basic-025
index d57bcb8..266643f 100644
--- a/networks/basic-025
+++ b/networks/basic-025
@@ -1,7 +1,7 @@
 # By default, Authorities are not configured as exits
 Authority = Node(tag="a", authority=1, relay=1, torrc="authority.tmpl")
 ExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl")
-Client = Node(tag="c", torrc="client.tmpl")
+Client = Node(tag="c", client=1, torrc="client.tmpl")
 
 NODES = Authority.getN(4) + ExitRelay.getN(16) + Client.getN(5)
 
diff --git a/networks/basic-100 b/networks/basic-100
index 1b181eb..b1546e6 100644
--- a/networks/basic-100
+++ b/networks/basic-100
@@ -3,7 +3,7 @@
 # By default, Authorities are not configured as exits
 Authority = Node(tag="a", authority=1, relay=1, torrc="authority.tmpl")
 ExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl")
-Client = Node(tag="c", torrc="client.tmpl")
+Client = Node(tag="c", client=1, torrc="client.tmpl")
 
 NODES = Authority.getN(5) + ExitRelay.getN(35) + Client.getN(60)
 
diff --git a/networks/basic-min b/networks/basic-min
index 48cf1cf..e5e0187 100644
--- a/networks/basic-min
+++ b/networks/basic-min
@@ -1,7 +1,7 @@
 # By default, Authorities are not configured as exits
 Authority = Node(tag="a", authority=1, relay=1, torrc="authority.tmpl")
 ExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl")
-Client = Node(tag="c", torrc="client.tmpl")
+Client = Node(tag="c", client=1, torrc="client.tmpl")
 
 # Since only 25% of relays get the guard flag,
 # TestingDirAuthVoteGuard * may need to be used in small networks
diff --git a/networks/basic-min-mixed b/networks/basic-min-mixed
index 5ae7bd5..6f19c16 100644
--- a/networks/basic-min-mixed
+++ b/networks/basic-min-mixed
@@ -17,8 +17,8 @@ ExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl")
 OldExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl",
 tor=OLD_TOR)
 

[tor-commits] [chutney/master] Stop assuming that test module attribute errors are about run_test

2017-09-12 Thread teor
commit f1835b17ec878e1c4cdd87a015218f3fbf024ab0
Author: teor 
Date:   Wed Sep 13 14:21:58 2017 +1000

Stop assuming that test module attribute errors are about run_test

Fixes 23497, introduced when the verify test was refactored into
a test script.
---
 lib/chutney/TorNet.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 5d44128..aeab347 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -1118,8 +1118,8 @@ def runConfigFile(verb, data):
 test_module = importlib.import_module("chutney_tests.{}".format(verb))
 try:
 return test_module.run_test(network)
-except AttributeError:
-print("Test {!r} has no 'run_test(network)' function".format(verb))
+except AttributeError as e:
+print("Error running test {!r}: {}".format(verb, e))
 return False
 
 # tell the user we don't know what their verb meant



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


[tor-commits] [chutney/master] Test OLD clients, bridge clients, and hidden services in mixed networks

2017-09-12 Thread teor
commit 0df68e3a9950dc0d36387a31121497531ad12597
Author: teor 
Date:   Wed Sep 13 14:20:24 2017 +1000

Test OLD clients, bridge clients, and hidden services in mixed networks

Chutney uses tags and attributes to find clients and hidden services,
for compatibility with old custom networks.

Implements 4
---
 scripts/chutney_tests/verify.py | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/chutney_tests/verify.py b/scripts/chutney_tests/verify.py
index 98beb74..063bf8f 100644
--- a/scripts/chutney_tests/verify.py
+++ b/scripts/chutney_tests/verify.py
@@ -63,14 +63,18 @@ def _verify_traffic(network):
 bind_to = (LISTEN_ADDR, LISTEN_PORT)
 tt = chutney.Traffic.TrafficTester(bind_to, tmpdata, TIMEOUT, reps,
dot_reps)
+# _env does not implement get() due to its fallback to parent behaviour
 client_list = filter(lambda n:
- n._env['tag'] == 'c' or n._env['tag'] == 'bc',
+ n._env['tag'].startswith('c') or
+ n._env['tag'].startswith('bc') or
+ ('client' in n._env.keys() and n._env['client'] == 1),
  network._nodes)
 exit_list = filter(lambda n:
-   ('exit' in n._env.keys()) and n._env['exit'] == 1,
+   ('exit' in n._env.keys() and n._env['exit'] == 1),
network._nodes)
 hs_list = filter(lambda n:
- n._env['tag'] == 'h',
+ n._env['tag'].startswith('h') or
+ ('hs' in n._env.keys() and n._env['hs'] == 1),
  network._nodes)
 if len(client_list) == 0:
 print("  Unable to verify network: no client nodes available")



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


[tor-commits] [torspec/master] other easier fixes to prop#280

2017-09-12 Thread arma
commit eb7c64b9bacd884b5e7b8b69f3caa614f01d8d86
Author: Roger Dingledine 
Date:   Tue Sep 12 22:39:29 2017 -0400

other easier fixes to prop#280
---
 proposals/280-privcount-in-tor.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/proposals/280-privcount-in-tor.txt 
b/proposals/280-privcount-in-tor.txt
index 716b48e..9b1a8b5 100644
--- a/proposals/280-privcount-in-tor.txt
+++ b/proposals/280-privcount-in-tor.txt
@@ -220,7 +220,7 @@ Status: Draft
[Exactly once]
 
The curve25519 public key of the tally reporter who is intended
-   to receive an decrypt this document.  The key is base64-encoded
+   to receive and decrypt this document.  The key is base64-encoded
with padding stripped.
 
 "count-document-digest" SP "sha3" Digest NL
@@ -259,7 +259,7 @@ Status: Draft
   instance of that keyword's blinded counter.
 
   For example: if the count document lists the keywords "b", "x", "g",
-  and "a" (in that order), and lists instances "0", and "2", then the
+  and "a" (in that order), and lists instances "0" and "2", then the
   decrypted data will hold the blinding values in this order:
   b, instance 0
   b, instance 2
@@ -308,7 +308,7 @@ Status: Draft
 
 6. An optimized alternative
 
-   As an alternative, the sequences of blinding values is NOT transmitted
+   As an alternative, the sequences of blinding values are NOT transmitted
to the tally reporters.  Instead the client generates a single
ephemeral keypair sk_c, PK_c, and places the public key in its counts
document.  It does this each time a new round begins.

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


[tor-commits] [chutney/master] Stop including two copies of common.i in single-onion-v3.tmpl

2017-09-12 Thread teor
commit d3cec8117065908f483ca12a335acb12861c62aa
Author: teor 
Date:   Wed Sep 13 12:32:13 2017 +1000

Stop including two copies of common.i in single-onion-v3.tmpl

Fix for Tor's 22437.
---
 torrc_templates/single-onion-v3.tmpl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/torrc_templates/single-onion-v3.tmpl 
b/torrc_templates/single-onion-v3.tmpl
index a9b1a19..403e8fa 100644
--- a/torrc_templates/single-onion-v3.tmpl
+++ b/torrc_templates/single-onion-v3.tmpl
@@ -1,2 +1,2 @@
 ${include:single-onion.tmpl}
-${include:hs-v3.tmpl}
+HiddenServiceVersion 3

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


[tor-commits] [chutney/master] Hide a log message removed by Tor 23078, fixed in 0.3.0.11 and 0.3.1.6-rc

2017-09-12 Thread teor
commit a99fca82b3b2327f2f5760170b63d6dadbe3c6b7
Author: teor 
Date:   Wed Sep 13 12:31:29 2017 +1000

Hide a log message removed by Tor 23078, fixed in 0.3.0.11 and 0.3.1.6-rc
---
 tools/ignore.warnings | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/ignore.warnings b/tools/ignore.warnings
index 5429533..463ce6c 100644
--- a/tools/ignore.warnings
+++ b/tools/ignore.warnings
@@ -24,6 +24,8 @@ Couldn't set up any working nameservers. Network not up yet
 Currently, sandboxing is only implemented on Linux
 # We ignore consensus failure warnings
 Error publishing .* consensus
+# Tor 23078, fixed in 0.3.0.11 and 0.3.1.6-rc
+Established prop224 intro point on circuit
 Every hidden service on this tor instance is NON-ANONYMOUS
 # We ignore consensus failure warnings
 Failed to choose an exit server



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


[tor-commits] [torspec/master] Fix some prop280 typos reported by arma

2017-09-12 Thread arma
commit 51825e0d22fab0de2499cfd1e89c287a85683c08
Author: teor 
Date:   Wed Sep 13 11:51:44 2017 +1000

Fix some prop280 typos reported by arma
---
 proposals/280-privcount-in-tor.txt | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/proposals/280-privcount-in-tor.txt 
b/proposals/280-privcount-in-tor.txt
index f0e4bd3..716b48e 100644
--- a/proposals/280-privcount-in-tor.txt
+++ b/proposals/280-privcount-in-tor.txt
@@ -67,9 +67,9 @@ Status: Draft
 
   In order to prevent bogus data from corrupting the tally, the Tor
   relays and the Tally Reporters perform multiple "instances" of this
-  algorithm, randomly sampling in each relays. The relay sends multiple
-  Y values for each measurement, built with different sets of B_i.
-  These "instances" are numbered in order from 1 to R.
+  algorithm, randomly sampling the relays in each instance. Each relay
+  sends multiple Y values for each measurement, built with different
+  sets of B_i. These "instances" are numbered in order from 1 to R.
 
   So that the system will still produce results in the event of a single
   Tally Reporter failure, these instances are distributed across multiple
@@ -108,9 +108,9 @@ Status: Draft
   noise.)
 
   We also need to work out how to handle instances with mixed
-  Tor versions, where some Data Collectors report different
-  counters to other Data Collectors. (The blinding works if we
-  substitute zeroes for missing counters on Tally Reporters.
+  Tor versions, where some Data Collectors report a different
+  set of counters than other Data Collectors. (The blinding works
+  if we substitute zeroes for missing counters on Tally Reporters.
   But we also need to add noise in this case.)
 
   -teor

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


[tor-commits] [sandboxed-tor-browser/master] Bump the version to 0.0.14-dev.

2017-09-12 Thread yawning
commit 3d9ed652082bb401a85261dc7fbffb8552f6c830
Author: Yawning Angel 
Date:   Wed Sep 13 02:01:21 2017 +

Bump the version to 0.0.14-dev.
---
 ChangeLog| 2 ++
 data/version | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 9570ef7..ea7e000 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+Changes in version 0.0.14 - UNRELEASED:
+
 Changes in version 0.0.13 - 2017-09-13:
  * Bug 13170: Disable the rest of the Firefox experiments botnet prefs.
  * Bug 23449: Allow `epool_pwait` in the tor seccomp rules.
diff --git a/data/version b/data/version
index 43b2961..c983ac1 100644
--- a/data/version
+++ b/data/version
@@ -1 +1 @@
-0.0.13
+0.0.14-dev

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


[tor-commits] [sandboxed-tor-browser/master] Do the release ritual for sandboxed-tor-browser-0.0.13.

2017-09-12 Thread yawning
commit 43cdbb24b8b79995fb0292274c4a8daa5192b86d
Author: Yawning Angel 
Date:   Wed Sep 13 01:59:00 2017 +

Do the release ritual for sandboxed-tor-browser-0.0.13.
---
 ChangeLog| 2 +-
 data/version | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fedcb4c..9570ef7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-Changes in version 0.0.13 - UNRELEASED:
+Changes in version 0.0.13 - 2017-09-13:
  * Bug 13170: Disable the rest of the Firefox experiments botnet prefs.
  * Bug 23449: Allow `epool_pwait` in the tor seccomp rules.
  * Use lockPref for the IDN override done as part of #22984.
diff --git a/data/version b/data/version
index a4eb7ef..43b2961 100644
--- a/data/version
+++ b/data/version
@@ -1 +1 @@
-0.0.13-dev
+0.0.13

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


[tor-commits] [chutney/master] Add another network with bridges and hidden services

2017-09-12 Thread teor
commit 25c1528e879d89a6c00f99a188b181438b5cb9ac
Author: teor 
Date:   Wed Sep 13 09:30:04 2017 +1000

Add another network with bridges and hidden services

We can use this one to test tor 0.3.2 and later.

Closes 22691.
---
 networks/bridges+ipv6+hs-v23 | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/networks/bridges+ipv6+hs-v23 b/networks/bridges+ipv6+hs-v23
new file mode 100644
index 000..c99dff5
--- /dev/null
+++ b/networks/bridges+ipv6+hs-v23
@@ -0,0 +1,26 @@
+# By default, Authorities are not configured as exits
+Authority = Node(tag="a", authority=1, relay=1, torrc="authority.tmpl")
+ExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl")
+Client = Node(tag="c", torrc="client.tmpl")
+
+BridgeAuthority = Node(tag="ba", authority=1, bridgeauthority=1,
+   relay=1, torrc="bridgeauthority.tmpl")
+Bridge = Node(tag="br", bridge=1, relay=1, torrc="bridge.tmpl")
+BridgeIPv6 = Node(tag="br", bridge=1, relay=1, ipv6_addr="[::1]", 
torrc="bridge-v6.tmpl")
+BridgeClient = Node(tag="bc", torrc="bridgeclient.tmpl")
+HSv2 = Node(tag="h", hs=1, torrc="hs.tmpl")
+HSv3 = Node(tag="h", hs=1, torrc="hs-v3.tmpl")
+
+# We need 8 authorities/relays/exits to ensure at least 2 get the guard flag
+# in 0.2.6
+# We need 5 authorities/relays/exits to ensure we can build HS connections
+# We put the IPv6 bridge first to ensure that clients try IPv6 before IPv4
+# Unfortunately, this does not prevent clients falling back to IPv4
+# bridges+ipv6-min only has IPv6 bridges
+NODES = Authority.getN(3) + BridgeAuthority.getN(1) + \
+ExitRelay.getN(4) + \
+BridgeIPv6.getN(1) + Bridge.getN(1) + \
+Client.getN(1) + BridgeClient.getN(1) + \
+HSv2.getN(1) + HSv3.getN(1)
+
+ConfigureNodes(NODES)

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


[tor-commits] [chutney/master] Add a bridges+hs-v23 network

2017-09-12 Thread teor
commit fee8719ddda7a41e1e23427c80c9f6be3a86e15f
Author: teor 
Date:   Wed Sep 13 09:05:32 2017 +1000

Add a bridges+hs-v23 network

This would be a great default network for chutney, but it requires
tor 0.3.2 or later.

Part of 22437.
---
 networks/bridges+hs-v23 | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/networks/bridges+hs-v23 b/networks/bridges+hs-v23
new file mode 100644
index 000..5a5a367
--- /dev/null
+++ b/networks/bridges+hs-v23
@@ -0,0 +1,22 @@
+# By default, Authorities are not configured as exits
+Authority = Node(tag="a", authority=1, relay=1, torrc="authority.tmpl")
+ExitRelay = Node(tag="r", relay=1, exit=1, torrc="relay.tmpl")
+Client = Node(tag="c", torrc="client.tmpl")
+
+BridgeAuthority = Node(tag="ba", authority=1, bridgeauthority=1,
+   relay=1, torrc="bridgeauthority.tmpl")
+Bridge = Node(tag="br", bridge=1, relay=1, torrc="bridge.tmpl")
+BridgeClient = Node(tag="bc", torrc="bridgeclient.tmpl")
+HSv2 = Node(tag="h", hs=1, torrc="hs.tmpl")
+HSv3 = Node(tag="h", hs=1, torrc="hs-.tmpl")
+
+# We need 8 authorities/relays/exits to ensure at least 2 get the guard flag
+# in 0.2.6
+# We need 5 authorities/relays/exits to ensure we can build HS connections
+NODES = Authority.getN(3) + BridgeAuthority.getN(1) + \
+ExitRelay.getN(4) + \
+Bridge.getN(1) + \
+Client.getN(1) + BridgeClient.getN(1) + \
+HS.getN(1)
+
+ConfigureNodes(NODES)

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


[tor-commits] [chutney/master] Properly qualify class variables

2017-09-12 Thread teor
commit d86feecd02a0af114d72cdab27c88d681e0d1c83
Author: teor 
Date:   Wed Sep 13 09:03:58 2017 +1000

Properly qualify class variables

Unqualified class variables work in some pythons, but not in others.

Fix on commit c889534 in 21903.
---
 lib/chutney/TorNet.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 3ace8a7..5d44128 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -890,8 +890,8 @@ class TorEnviron(chutney.Templating.Environ):
 elif my['dns_conf'] is None:
 # if there is no DNS conf file set
 print("CHUTNEY_DNS_CONF not specified, using '%s'."
-  % (DEFAULT_DNS_RESOLV_CONF))
-dns_conf = DEFAULT_DNS_RESOLV_CONF
+  % (TorEnviron.DEFAULT_DNS_RESOLV_CONF))
+dns_conf = TorEnviron.DEFAULT_DNS_RESOLV_CONF
 else:
 dns_conf = my['dns_conf']
 dns_conf = os.path.abspath(my['dns_conf'])
@@ -901,8 +901,8 @@ class TorEnviron(chutney.Templating.Environ):
 if not os.path.exists(dns_conf):
 # Issue a warning so the user notices
 print("CHUTNEY_DNS_CONF '%s' does not exist, using '%s'."
-  % (dns_conf, OFFLINE_DNS_RESOLV_CONF))
-dns_conf = OFFLINE_DNS_RESOLV_CONF
+  % (dns_conf, TorEnviron.OFFLINE_DNS_RESOLV_CONF))
+dns_conf = TorEnviron.OFFLINE_DNS_RESOLV_CONF
 return "ServerDNSResolvConfFile %s" % (dns_conf)
 
 



___
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

2017-09-12 Thread translation
commit 87bbf06a76b71513d2f7ccd5665b0fbbaae70b7e
Author: Translation commit bot 
Date:   Tue Sep 12 21:18:00 2017 +

Update translations for tails-openpgp-applet
---
 uz/openpgp-applet.pot | 78 +--
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/uz/openpgp-applet.pot b/uz/openpgp-applet.pot
index 25dc0f1e5..31f615548 100644
--- a/uz/openpgp-applet.pot
+++ b/uz/openpgp-applet.pot
@@ -1,13 +1,13 @@
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR Tails developers
-# This file is distributed under the same license as the PACKAGE package.
+# This file is distributed under the same license as the OpenPGP_Applet 
package.
 # 
 # Translators:
 msgid ""
 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"
+"POT-Creation-Date: 2017-08-05 15:07-0400\n"
 "PO-Revision-Date: 2015-11-23 02:23+\n"
 "Last-Translator: FULL NAME \n"
 "Language-Team: Uzbek (http://www.transifex.com/otf/torproject/language/uz/)\n"
@@ -17,158 +17,158 @@ msgstr ""
 "Language: uz\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
 
-#: bin/openpgp-applet:163
+#: bin/openpgp-applet:160
 msgid "You are about to exit OpenPGP Applet. Are you sure?"
 msgstr ""
 
-#: bin/openpgp-applet:175
+#: bin/openpgp-applet:172
 msgid "OpenPGP encryption applet"
 msgstr ""
 
-#: bin/openpgp-applet:178
+#: bin/openpgp-applet:175
 msgid "Exit"
 msgstr "Chiqish"
 
-#: bin/openpgp-applet:180
+#: bin/openpgp-applet:177
 msgid "About"
 msgstr ""
 
-#: bin/openpgp-applet:235
+#: bin/openpgp-applet:232
 msgid "Encrypt Clipboard with _Passphrase"
 msgstr ""
 
-#: bin/openpgp-applet:238
+#: bin/openpgp-applet:235
 msgid "Sign/Encrypt Clipboard with Public _Keys"
 msgstr ""
 
-#: bin/openpgp-applet:243
+#: bin/openpgp-applet:240
 msgid "_Decrypt/Verify Clipboard"
 msgstr ""
 
-#: bin/openpgp-applet:247
+#: bin/openpgp-applet:244
 msgid "_Manage Keys"
 msgstr ""
 
-#: bin/openpgp-applet:251
+#: bin/openpgp-applet:248
 msgid "_Open Text Editor"
 msgstr ""
 
-#: bin/openpgp-applet:295
+#: bin/openpgp-applet:292
 msgid "The clipboard does not contain valid input data."
 msgstr ""
 
-#: bin/openpgp-applet:347 bin/openpgp-applet:349 bin/openpgp-applet:351
+#: bin/openpgp-applet:337 bin/openpgp-applet:339 bin/openpgp-applet:341
 msgid "Unknown Trust"
 msgstr ""
 
-#: bin/openpgp-applet:353
+#: bin/openpgp-applet:343
 msgid "Marginal Trust"
 msgstr ""
 
-#: bin/openpgp-applet:355
+#: bin/openpgp-applet:345
 msgid "Full Trust"
 msgstr ""
 
-#: bin/openpgp-applet:357
+#: bin/openpgp-applet:347
 msgid "Ultimate Trust"
 msgstr ""
 
-#: bin/openpgp-applet:410
+#: bin/openpgp-applet:400
 msgid "Name"
 msgstr "Nomi"
 
-#: bin/openpgp-applet:411
+#: bin/openpgp-applet:401
 msgid "Key ID"
 msgstr ""
 
-#: bin/openpgp-applet:412
+#: bin/openpgp-applet:402
 msgid "Status"
 msgstr ""
 
-#: bin/openpgp-applet:444
+#: bin/openpgp-applet:433
 msgid "Fingerprint:"
 msgstr ""
 
-#: bin/openpgp-applet:447
+#: bin/openpgp-applet:436
 msgid "User ID:"
 msgid_plural "User IDs:"
 msgstr[0] ""
 
-#: bin/openpgp-applet:476
+#: bin/openpgp-applet:465
 msgid "None (Don't sign)"
 msgstr ""
 
-#: bin/openpgp-applet:539
+#: bin/openpgp-applet:528
 msgid "Select recipients:"
 msgstr ""
 
-#: bin/openpgp-applet:547
+#: bin/openpgp-applet:536
 msgid "Hide recipients"
 msgstr ""
 
-#: bin/openpgp-applet:550
+#: bin/openpgp-applet:539
 msgid ""
 "Hide the user IDs of all recipients of an encrypted message. Otherwise "
 "anyone that sees the encrypted message can see who the recipients are."
 msgstr ""
 
-#: bin/openpgp-applet:556
+#: bin/openpgp-applet:545
 msgid "Sign message as:"
 msgstr ""
 
-#: bin/openpgp-applet:560
+#: bin/openpgp-applet:549
 msgid "Choose keys"
 msgstr ""
 
-#: bin/openpgp-applet:600
+#: bin/openpgp-applet:589
 msgid "Do you trust these keys?"
 msgstr ""
 
-#: bin/openpgp-applet:603
+#: bin/openpgp-applet:592
 msgid "The following selected key is not fully trusted:"
 msgid_plural "The following selected keys are not fully trusted:"
 msgstr[0] ""
 
-#: bin/openpgp-applet:621
+#: bin/openpgp-applet:610
 msgid "Do you trust this key enough to use it anyway?"
 msgid_plural "Do you trust these keys enough to use them anyway?"
 msgstr[0] ""
 
-#: bin/openpgp-applet:634
+#: bin/openpgp-applet:623
 msgid "No keys selected"
 msgstr ""
 
-#: bin/openpgp-applet:636
+#: bin/openpgp-applet:625
 msgid ""
 "You must select a private key to sign the message, or some public keys to "
 "encrypt the message, or both."
 msgstr ""
 
-#: bin/openpgp-applet:664
+#: bin/openpgp-applet:653
 msgid "No keys available"
 msgstr ""
 
-#: bin/openpgp-applet:666
+#: bin/openpgp-applet:655
 msgid ""
 "You need a private key to sign messages or a public key to encrypt messages."
 msgstr ""
 
-#: bin/openpgp-applet:794
+#: bin/openpgp-applet:783
 msgid "GnuPG error"
 msgstr ""
 
-#: bin/openpgp-applet:815
+#: bin/openpgp-applet:804
 msgid "Therefore the operation cannot be

[tor-commits] [translation/mat-gui] Update translations for mat-gui

2017-09-12 Thread translation
commit f803a1bdca26b0d012376ef9bb286b5485b56318
Author: Translation commit bot 
Date:   Tue Sep 12 21:16:08 2017 +

Update translations for mat-gui
---
 uz.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uz.po b/uz.po
index 5d20cafa8..55eb11392 100644
--- a/uz.po
+++ b/uz.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-02-10 23:06+0100\n"
-"PO-Revision-Date: 2017-09-12 19:53+\n"
+"PO-Revision-Date: 2017-09-12 20:48+\n"
 "Last-Translator: carolyn \n"
 "Language-Team: Uzbek (http://www.transifex.com/otf/torproject/language/uz/)\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] Merge branch 'maint-0.3.1'

2017-09-12 Thread nickm
commit 3092c8bb3e5eef94016327a83b07bab1c4ab3694
Merge: 9c27f56cd eb078a3bd
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.3.1'

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

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


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

2017-09-12 Thread nickm
commit a040b05890b4f5e74609c922f22a4bf5e9c61660
Merge: 374780733 eb078a3bd
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.3.1' into release-0.3.1

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

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


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

2017-09-12 Thread nickm
commit eb078a3bd5bc645177600aff7cbbe59d6e25c3a4
Merge: befddf6d2 dedafe95f
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.3.0' into maint-0.3.1

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)




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


[tor-commits] [tor/release-0.3.1] Merge branch 'maint-0.2.9' into maint-0.3.0

2017-09-12 Thread nickm
commit dedafe95feff363b0dac086e1f034b88dc112952
Merge: 0729ba286 3138fe2e6
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 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 branch 'maint-0.3.0' into maint-0.3.1

2017-09-12 Thread nickm
commit eb078a3bd5bc645177600aff7cbbe59d6e25c3a4
Merge: befddf6d2 dedafe95f
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.3.0' into maint-0.3.1

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)




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


[tor-commits] [tor/maint-0.3.1] Merge branch 'maint-0.2.9' into maint-0.3.0

2017-09-12 Thread nickm
commit dedafe95feff363b0dac086e1f034b88dc112952
Merge: 0729ba286 3138fe2e6
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)




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


[tor-commits] [tor/maint-0.3.1] Merge branch 'maint-0.3.0' into maint-0.3.1

2017-09-12 Thread nickm
commit eb078a3bd5bc645177600aff7cbbe59d6e25c3a4
Merge: befddf6d2 dedafe95f
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.3.0' into maint-0.3.1

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

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


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

2017-09-12 Thread nickm
commit fdcb065bf7b1002a4c5e81b345848f47562938a3
Merge: 070e82a02 dedafe95f
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.3.0' into release-0.3.0

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

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


[tor-commits] [tor/master] Avoid sscanf() warnings from openbsd in the unit tests

2017-09-12 Thread nickm
commit d9e2db1efd531b5fb0d47a9c03d19f871145a76d
Author: Nick Mathewson 
Date:   Tue Sep 12 15:57:25 2017 -0400

Avoid sscanf() warnings from openbsd in the unit tests

OpenBSD doesn't like tricks where you use a too-wide sscanf argument
for a too-narrow array, even when you know the input string
statically.  The fix here is just to use bigger buffers.

Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
---
 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/changes/bug15582 b/changes/bug15582
new file mode 100644
index 0..5ea6431cf
--- /dev/null
+++ b/changes/bug15582
@@ -0,0 +1,4 @@
+  o Minor bugfixes (compilation):
+- Avoid compiler warnings in the unit tests for running tor_sscanf()
+  with wide string outputs. Fixes bug 15582; bugfix on 0.2.6.2-alpha.
+
diff --git a/src/test/test_util.c b/src/test/test_util.c
index fcda56456..0b707caee 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2500,7 +2500,7 @@ test_util_sscanf(void *arg)
 {
   unsigned u1, u2, u3;
   unsigned long ulng;
-  char s1[20], s2[10], s3[10], ch;
+  char s1[20], s2[10], s3[10], ch, *huge = NULL;
   int r;
   long lng1,lng2;
   int int1, int2;
@@ -2512,7 +2512,13 @@ test_util_sscanf(void *arg)
   tt_int_op(-1,OP_EQ,
 tor_sscanf("wrong", "%5c", s1)); /* %c cannot have a number. */
   tt_int_op(-1,OP_EQ, tor_sscanf("hello", "%s", s1)); /* %s needs a number. */
-  tt_int_op(-1,OP_EQ, tor_sscanf("prettylongstring", "%99s", s1));
+  /* this will fail because we don't allow widths longer than  */
+  {
+huge = tor_malloc(100);
+r = tor_sscanf("prettylongstring", "%9s", huge);
+tor_free(huge);
+tt_int_op(-1,OP_EQ, r);
+  }
 #if 0
   /* GCC thinks these two are illegal. */
   test_eq(-1, tor_sscanf("prettylongstring", "%0s", s1));
@@ -2618,8 +2624,13 @@ test_util_sscanf(void *arg)
   tt_int_op(2,OP_EQ, tor_sscanf("76trombones", "%6u%9s", &u1, s1)); /* %u%s */
   tt_int_op(76,OP_EQ, u1);
   tt_str_op(s1,OP_EQ, "trombones");
-  tt_int_op(1,OP_EQ, tor_sscanf("prettylongstring", "%999s", s1));
-  tt_str_op(s1,OP_EQ, "prettylongstring");
+  {
+huge = tor_malloc(1000);
+r = tor_sscanf("prettylongstring", "%999s", huge);
+tt_int_op(1,OP_EQ, r);
+tt_str_op(huge,OP_EQ, "prettylongstring");
+tor_free(huge);
+  }
   /* %s doesn't eat spaces */
   tt_int_op(2,OP_EQ, tor_sscanf("hello world", "%9s %9s", s1, s2));
   tt_str_op(s1,OP_EQ, "hello");
@@ -2843,7 +2854,7 @@ test_util_sscanf(void *arg)
   test_feq(d4, 3.2);
 
  done:
-  ;
+  tor_free(huge);
 }
 
 #define tt_char_op(a,op,b) tt_assert_op_type(a,op,b,char,"%c")



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


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

2017-09-12 Thread nickm
commit 3138fe2e694a7036d28427ee3d76e639d15e4bc0
Merge: bac160b4e d9e2db1ef
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:42 2017 -0400

Merge branch 'bug15582_029' into maint-0.2.9

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)



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


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

2017-09-12 Thread nickm
commit b9ffcf672485794431e8a4a4176b23b621f133b0
Merge: abc22e8f1 3138fe2e6
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.2.9' into release-0.2.9

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 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 branch 'bug15582_029' into maint-0.2.9

2017-09-12 Thread nickm
commit 3138fe2e694a7036d28427ee3d76e639d15e4bc0
Merge: bac160b4e d9e2db1ef
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:42 2017 -0400

Merge branch 'bug15582_029' into maint-0.2.9

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)



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


[tor-commits] [tor/release-0.3.1] Avoid sscanf() warnings from openbsd in the unit tests

2017-09-12 Thread nickm
commit d9e2db1efd531b5fb0d47a9c03d19f871145a76d
Author: Nick Mathewson 
Date:   Tue Sep 12 15:57:25 2017 -0400

Avoid sscanf() warnings from openbsd in the unit tests

OpenBSD doesn't like tricks where you use a too-wide sscanf argument
for a too-narrow array, even when you know the input string
statically.  The fix here is just to use bigger buffers.

Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
---
 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/changes/bug15582 b/changes/bug15582
new file mode 100644
index 0..5ea6431cf
--- /dev/null
+++ b/changes/bug15582
@@ -0,0 +1,4 @@
+  o Minor bugfixes (compilation):
+- Avoid compiler warnings in the unit tests for running tor_sscanf()
+  with wide string outputs. Fixes bug 15582; bugfix on 0.2.6.2-alpha.
+
diff --git a/src/test/test_util.c b/src/test/test_util.c
index fcda56456..0b707caee 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2500,7 +2500,7 @@ test_util_sscanf(void *arg)
 {
   unsigned u1, u2, u3;
   unsigned long ulng;
-  char s1[20], s2[10], s3[10], ch;
+  char s1[20], s2[10], s3[10], ch, *huge = NULL;
   int r;
   long lng1,lng2;
   int int1, int2;
@@ -2512,7 +2512,13 @@ test_util_sscanf(void *arg)
   tt_int_op(-1,OP_EQ,
 tor_sscanf("wrong", "%5c", s1)); /* %c cannot have a number. */
   tt_int_op(-1,OP_EQ, tor_sscanf("hello", "%s", s1)); /* %s needs a number. */
-  tt_int_op(-1,OP_EQ, tor_sscanf("prettylongstring", "%99s", s1));
+  /* this will fail because we don't allow widths longer than  */
+  {
+huge = tor_malloc(100);
+r = tor_sscanf("prettylongstring", "%9s", huge);
+tor_free(huge);
+tt_int_op(-1,OP_EQ, r);
+  }
 #if 0
   /* GCC thinks these two are illegal. */
   test_eq(-1, tor_sscanf("prettylongstring", "%0s", s1));
@@ -2618,8 +2624,13 @@ test_util_sscanf(void *arg)
   tt_int_op(2,OP_EQ, tor_sscanf("76trombones", "%6u%9s", &u1, s1)); /* %u%s */
   tt_int_op(76,OP_EQ, u1);
   tt_str_op(s1,OP_EQ, "trombones");
-  tt_int_op(1,OP_EQ, tor_sscanf("prettylongstring", "%999s", s1));
-  tt_str_op(s1,OP_EQ, "prettylongstring");
+  {
+huge = tor_malloc(1000);
+r = tor_sscanf("prettylongstring", "%999s", huge);
+tt_int_op(1,OP_EQ, r);
+tt_str_op(huge,OP_EQ, "prettylongstring");
+tor_free(huge);
+  }
   /* %s doesn't eat spaces */
   tt_int_op(2,OP_EQ, tor_sscanf("hello world", "%9s %9s", s1, s2));
   tt_str_op(s1,OP_EQ, "hello");
@@ -2843,7 +2854,7 @@ test_util_sscanf(void *arg)
   test_feq(d4, 3.2);
 
  done:
-  ;
+  tor_free(huge);
 }
 
 #define tt_char_op(a,op,b) tt_assert_op_type(a,op,b,char,"%c")



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


[tor-commits] [tor/release-0.3.0] Merge branch 'bug15582_029' into maint-0.2.9

2017-09-12 Thread nickm
commit 3138fe2e694a7036d28427ee3d76e639d15e4bc0
Merge: bac160b4e d9e2db1ef
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:42 2017 -0400

Merge branch 'bug15582_029' into maint-0.2.9

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)



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


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

2017-09-12 Thread nickm
commit dedafe95feff363b0dac086e1f034b88dc112952
Merge: 0729ba286 3138fe2e6
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 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 branch 'maint-0.2.9' into maint-0.3.0

2017-09-12 Thread nickm
commit dedafe95feff363b0dac086e1f034b88dc112952
Merge: 0729ba286 3138fe2e6
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)




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


[tor-commits] [tor/release-0.3.0] Avoid sscanf() warnings from openbsd in the unit tests

2017-09-12 Thread nickm
commit d9e2db1efd531b5fb0d47a9c03d19f871145a76d
Author: Nick Mathewson 
Date:   Tue Sep 12 15:57:25 2017 -0400

Avoid sscanf() warnings from openbsd in the unit tests

OpenBSD doesn't like tricks where you use a too-wide sscanf argument
for a too-narrow array, even when you know the input string
statically.  The fix here is just to use bigger buffers.

Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
---
 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/changes/bug15582 b/changes/bug15582
new file mode 100644
index 0..5ea6431cf
--- /dev/null
+++ b/changes/bug15582
@@ -0,0 +1,4 @@
+  o Minor bugfixes (compilation):
+- Avoid compiler warnings in the unit tests for running tor_sscanf()
+  with wide string outputs. Fixes bug 15582; bugfix on 0.2.6.2-alpha.
+
diff --git a/src/test/test_util.c b/src/test/test_util.c
index fcda56456..0b707caee 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2500,7 +2500,7 @@ test_util_sscanf(void *arg)
 {
   unsigned u1, u2, u3;
   unsigned long ulng;
-  char s1[20], s2[10], s3[10], ch;
+  char s1[20], s2[10], s3[10], ch, *huge = NULL;
   int r;
   long lng1,lng2;
   int int1, int2;
@@ -2512,7 +2512,13 @@ test_util_sscanf(void *arg)
   tt_int_op(-1,OP_EQ,
 tor_sscanf("wrong", "%5c", s1)); /* %c cannot have a number. */
   tt_int_op(-1,OP_EQ, tor_sscanf("hello", "%s", s1)); /* %s needs a number. */
-  tt_int_op(-1,OP_EQ, tor_sscanf("prettylongstring", "%99s", s1));
+  /* this will fail because we don't allow widths longer than  */
+  {
+huge = tor_malloc(100);
+r = tor_sscanf("prettylongstring", "%9s", huge);
+tor_free(huge);
+tt_int_op(-1,OP_EQ, r);
+  }
 #if 0
   /* GCC thinks these two are illegal. */
   test_eq(-1, tor_sscanf("prettylongstring", "%0s", s1));
@@ -2618,8 +2624,13 @@ test_util_sscanf(void *arg)
   tt_int_op(2,OP_EQ, tor_sscanf("76trombones", "%6u%9s", &u1, s1)); /* %u%s */
   tt_int_op(76,OP_EQ, u1);
   tt_str_op(s1,OP_EQ, "trombones");
-  tt_int_op(1,OP_EQ, tor_sscanf("prettylongstring", "%999s", s1));
-  tt_str_op(s1,OP_EQ, "prettylongstring");
+  {
+huge = tor_malloc(1000);
+r = tor_sscanf("prettylongstring", "%999s", huge);
+tt_int_op(1,OP_EQ, r);
+tt_str_op(huge,OP_EQ, "prettylongstring");
+tor_free(huge);
+  }
   /* %s doesn't eat spaces */
   tt_int_op(2,OP_EQ, tor_sscanf("hello world", "%9s %9s", s1, s2));
   tt_str_op(s1,OP_EQ, "hello");
@@ -2843,7 +2854,7 @@ test_util_sscanf(void *arg)
   test_feq(d4, 3.2);
 
  done:
-  ;
+  tor_free(huge);
 }
 
 #define tt_char_op(a,op,b) tt_assert_op_type(a,op,b,char,"%c")



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


[tor-commits] [tor/release-0.3.1] Merge branch 'bug15582_029' into maint-0.2.9

2017-09-12 Thread nickm
commit 3138fe2e694a7036d28427ee3d76e639d15e4bc0
Merge: bac160b4e d9e2db1ef
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:42 2017 -0400

Merge branch 'bug15582_029' into maint-0.2.9

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)



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


[tor-commits] [tor/maint-0.3.1] Merge branch 'bug15582_029' into maint-0.2.9

2017-09-12 Thread nickm
commit 3138fe2e694a7036d28427ee3d76e639d15e4bc0
Merge: bac160b4e d9e2db1ef
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:42 2017 -0400

Merge branch 'bug15582_029' into maint-0.2.9

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)



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


[tor-commits] [tor/maint-0.3.1] Avoid sscanf() warnings from openbsd in the unit tests

2017-09-12 Thread nickm
commit d9e2db1efd531b5fb0d47a9c03d19f871145a76d
Author: Nick Mathewson 
Date:   Tue Sep 12 15:57:25 2017 -0400

Avoid sscanf() warnings from openbsd in the unit tests

OpenBSD doesn't like tricks where you use a too-wide sscanf argument
for a too-narrow array, even when you know the input string
statically.  The fix here is just to use bigger buffers.

Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
---
 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/changes/bug15582 b/changes/bug15582
new file mode 100644
index 0..5ea6431cf
--- /dev/null
+++ b/changes/bug15582
@@ -0,0 +1,4 @@
+  o Minor bugfixes (compilation):
+- Avoid compiler warnings in the unit tests for running tor_sscanf()
+  with wide string outputs. Fixes bug 15582; bugfix on 0.2.6.2-alpha.
+
diff --git a/src/test/test_util.c b/src/test/test_util.c
index fcda56456..0b707caee 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2500,7 +2500,7 @@ test_util_sscanf(void *arg)
 {
   unsigned u1, u2, u3;
   unsigned long ulng;
-  char s1[20], s2[10], s3[10], ch;
+  char s1[20], s2[10], s3[10], ch, *huge = NULL;
   int r;
   long lng1,lng2;
   int int1, int2;
@@ -2512,7 +2512,13 @@ test_util_sscanf(void *arg)
   tt_int_op(-1,OP_EQ,
 tor_sscanf("wrong", "%5c", s1)); /* %c cannot have a number. */
   tt_int_op(-1,OP_EQ, tor_sscanf("hello", "%s", s1)); /* %s needs a number. */
-  tt_int_op(-1,OP_EQ, tor_sscanf("prettylongstring", "%99s", s1));
+  /* this will fail because we don't allow widths longer than  */
+  {
+huge = tor_malloc(100);
+r = tor_sscanf("prettylongstring", "%9s", huge);
+tor_free(huge);
+tt_int_op(-1,OP_EQ, r);
+  }
 #if 0
   /* GCC thinks these two are illegal. */
   test_eq(-1, tor_sscanf("prettylongstring", "%0s", s1));
@@ -2618,8 +2624,13 @@ test_util_sscanf(void *arg)
   tt_int_op(2,OP_EQ, tor_sscanf("76trombones", "%6u%9s", &u1, s1)); /* %u%s */
   tt_int_op(76,OP_EQ, u1);
   tt_str_op(s1,OP_EQ, "trombones");
-  tt_int_op(1,OP_EQ, tor_sscanf("prettylongstring", "%999s", s1));
-  tt_str_op(s1,OP_EQ, "prettylongstring");
+  {
+huge = tor_malloc(1000);
+r = tor_sscanf("prettylongstring", "%999s", huge);
+tt_int_op(1,OP_EQ, r);
+tt_str_op(huge,OP_EQ, "prettylongstring");
+tor_free(huge);
+  }
   /* %s doesn't eat spaces */
   tt_int_op(2,OP_EQ, tor_sscanf("hello world", "%9s %9s", s1, s2));
   tt_str_op(s1,OP_EQ, "hello");
@@ -2843,7 +2854,7 @@ test_util_sscanf(void *arg)
   test_feq(d4, 3.2);
 
  done:
-  ;
+  tor_free(huge);
 }
 
 #define tt_char_op(a,op,b) tt_assert_op_type(a,op,b,char,"%c")



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


[tor-commits] [tor/maint-0.3.0] Merge branch 'maint-0.2.9' into maint-0.3.0

2017-09-12 Thread nickm
commit dedafe95feff363b0dac086e1f034b88dc112952
Merge: 0729ba286 3138fe2e6
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:47 2017 -0400

Merge branch 'maint-0.2.9' into maint-0.3.0

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

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


[tor-commits] [tor/release-0.2.9] Avoid sscanf() warnings from openbsd in the unit tests

2017-09-12 Thread nickm
commit d9e2db1efd531b5fb0d47a9c03d19f871145a76d
Author: Nick Mathewson 
Date:   Tue Sep 12 15:57:25 2017 -0400

Avoid sscanf() warnings from openbsd in the unit tests

OpenBSD doesn't like tricks where you use a too-wide sscanf argument
for a too-narrow array, even when you know the input string
statically.  The fix here is just to use bigger buffers.

Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
---
 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/changes/bug15582 b/changes/bug15582
new file mode 100644
index 0..5ea6431cf
--- /dev/null
+++ b/changes/bug15582
@@ -0,0 +1,4 @@
+  o Minor bugfixes (compilation):
+- Avoid compiler warnings in the unit tests for running tor_sscanf()
+  with wide string outputs. Fixes bug 15582; bugfix on 0.2.6.2-alpha.
+
diff --git a/src/test/test_util.c b/src/test/test_util.c
index fcda56456..0b707caee 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2500,7 +2500,7 @@ test_util_sscanf(void *arg)
 {
   unsigned u1, u2, u3;
   unsigned long ulng;
-  char s1[20], s2[10], s3[10], ch;
+  char s1[20], s2[10], s3[10], ch, *huge = NULL;
   int r;
   long lng1,lng2;
   int int1, int2;
@@ -2512,7 +2512,13 @@ test_util_sscanf(void *arg)
   tt_int_op(-1,OP_EQ,
 tor_sscanf("wrong", "%5c", s1)); /* %c cannot have a number. */
   tt_int_op(-1,OP_EQ, tor_sscanf("hello", "%s", s1)); /* %s needs a number. */
-  tt_int_op(-1,OP_EQ, tor_sscanf("prettylongstring", "%99s", s1));
+  /* this will fail because we don't allow widths longer than  */
+  {
+huge = tor_malloc(100);
+r = tor_sscanf("prettylongstring", "%9s", huge);
+tor_free(huge);
+tt_int_op(-1,OP_EQ, r);
+  }
 #if 0
   /* GCC thinks these two are illegal. */
   test_eq(-1, tor_sscanf("prettylongstring", "%0s", s1));
@@ -2618,8 +2624,13 @@ test_util_sscanf(void *arg)
   tt_int_op(2,OP_EQ, tor_sscanf("76trombones", "%6u%9s", &u1, s1)); /* %u%s */
   tt_int_op(76,OP_EQ, u1);
   tt_str_op(s1,OP_EQ, "trombones");
-  tt_int_op(1,OP_EQ, tor_sscanf("prettylongstring", "%999s", s1));
-  tt_str_op(s1,OP_EQ, "prettylongstring");
+  {
+huge = tor_malloc(1000);
+r = tor_sscanf("prettylongstring", "%999s", huge);
+tt_int_op(1,OP_EQ, r);
+tt_str_op(huge,OP_EQ, "prettylongstring");
+tor_free(huge);
+  }
   /* %s doesn't eat spaces */
   tt_int_op(2,OP_EQ, tor_sscanf("hello world", "%9s %9s", s1, s2));
   tt_str_op(s1,OP_EQ, "hello");
@@ -2843,7 +2854,7 @@ test_util_sscanf(void *arg)
   test_feq(d4, 3.2);
 
  done:
-  ;
+  tor_free(huge);
 }
 
 #define tt_char_op(a,op,b) tt_assert_op_type(a,op,b,char,"%c")



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


[tor-commits] [tor/maint-0.3.0] Avoid sscanf() warnings from openbsd in the unit tests

2017-09-12 Thread nickm
commit d9e2db1efd531b5fb0d47a9c03d19f871145a76d
Author: Nick Mathewson 
Date:   Tue Sep 12 15:57:25 2017 -0400

Avoid sscanf() warnings from openbsd in the unit tests

OpenBSD doesn't like tricks where you use a too-wide sscanf argument
for a too-narrow array, even when you know the input string
statically.  The fix here is just to use bigger buffers.

Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
---
 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/changes/bug15582 b/changes/bug15582
new file mode 100644
index 0..5ea6431cf
--- /dev/null
+++ b/changes/bug15582
@@ -0,0 +1,4 @@
+  o Minor bugfixes (compilation):
+- Avoid compiler warnings in the unit tests for running tor_sscanf()
+  with wide string outputs. Fixes bug 15582; bugfix on 0.2.6.2-alpha.
+
diff --git a/src/test/test_util.c b/src/test/test_util.c
index fcda56456..0b707caee 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2500,7 +2500,7 @@ test_util_sscanf(void *arg)
 {
   unsigned u1, u2, u3;
   unsigned long ulng;
-  char s1[20], s2[10], s3[10], ch;
+  char s1[20], s2[10], s3[10], ch, *huge = NULL;
   int r;
   long lng1,lng2;
   int int1, int2;
@@ -2512,7 +2512,13 @@ test_util_sscanf(void *arg)
   tt_int_op(-1,OP_EQ,
 tor_sscanf("wrong", "%5c", s1)); /* %c cannot have a number. */
   tt_int_op(-1,OP_EQ, tor_sscanf("hello", "%s", s1)); /* %s needs a number. */
-  tt_int_op(-1,OP_EQ, tor_sscanf("prettylongstring", "%99s", s1));
+  /* this will fail because we don't allow widths longer than  */
+  {
+huge = tor_malloc(100);
+r = tor_sscanf("prettylongstring", "%9s", huge);
+tor_free(huge);
+tt_int_op(-1,OP_EQ, r);
+  }
 #if 0
   /* GCC thinks these two are illegal. */
   test_eq(-1, tor_sscanf("prettylongstring", "%0s", s1));
@@ -2618,8 +2624,13 @@ test_util_sscanf(void *arg)
   tt_int_op(2,OP_EQ, tor_sscanf("76trombones", "%6u%9s", &u1, s1)); /* %u%s */
   tt_int_op(76,OP_EQ, u1);
   tt_str_op(s1,OP_EQ, "trombones");
-  tt_int_op(1,OP_EQ, tor_sscanf("prettylongstring", "%999s", s1));
-  tt_str_op(s1,OP_EQ, "prettylongstring");
+  {
+huge = tor_malloc(1000);
+r = tor_sscanf("prettylongstring", "%999s", huge);
+tt_int_op(1,OP_EQ, r);
+tt_str_op(huge,OP_EQ, "prettylongstring");
+tor_free(huge);
+  }
   /* %s doesn't eat spaces */
   tt_int_op(2,OP_EQ, tor_sscanf("hello world", "%9s %9s", s1, s2));
   tt_str_op(s1,OP_EQ, "hello");
@@ -2843,7 +2854,7 @@ test_util_sscanf(void *arg)
   test_feq(d4, 3.2);
 
  done:
-  ;
+  tor_free(huge);
 }
 
 #define tt_char_op(a,op,b) tt_assert_op_type(a,op,b,char,"%c")



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


[tor-commits] [tor/maint-0.3.0] Merge branch 'bug15582_029' into maint-0.2.9

2017-09-12 Thread nickm
commit 3138fe2e694a7036d28427ee3d76e639d15e4bc0
Merge: bac160b4e d9e2db1ef
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:42 2017 -0400

Merge branch 'bug15582_029' into maint-0.2.9

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)



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


[tor-commits] [tor/maint-0.2.9] Merge branch 'bug15582_029' into maint-0.2.9

2017-09-12 Thread nickm
commit 3138fe2e694a7036d28427ee3d76e639d15e4bc0
Merge: bac160b4e d9e2db1ef
Author: Nick Mathewson 
Date:   Tue Sep 12 17:09:42 2017 -0400

Merge branch 'bug15582_029' into maint-0.2.9

 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

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


[tor-commits] [tor/maint-0.2.9] Avoid sscanf() warnings from openbsd in the unit tests

2017-09-12 Thread nickm
commit d9e2db1efd531b5fb0d47a9c03d19f871145a76d
Author: Nick Mathewson 
Date:   Tue Sep 12 15:57:25 2017 -0400

Avoid sscanf() warnings from openbsd in the unit tests

OpenBSD doesn't like tricks where you use a too-wide sscanf argument
for a too-narrow array, even when you know the input string
statically.  The fix here is just to use bigger buffers.

Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
---
 changes/bug15582 |  4 
 src/test/test_util.c | 21 -
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/changes/bug15582 b/changes/bug15582
new file mode 100644
index 0..5ea6431cf
--- /dev/null
+++ b/changes/bug15582
@@ -0,0 +1,4 @@
+  o Minor bugfixes (compilation):
+- Avoid compiler warnings in the unit tests for running tor_sscanf()
+  with wide string outputs. Fixes bug 15582; bugfix on 0.2.6.2-alpha.
+
diff --git a/src/test/test_util.c b/src/test/test_util.c
index fcda56456..0b707caee 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2500,7 +2500,7 @@ test_util_sscanf(void *arg)
 {
   unsigned u1, u2, u3;
   unsigned long ulng;
-  char s1[20], s2[10], s3[10], ch;
+  char s1[20], s2[10], s3[10], ch, *huge = NULL;
   int r;
   long lng1,lng2;
   int int1, int2;
@@ -2512,7 +2512,13 @@ test_util_sscanf(void *arg)
   tt_int_op(-1,OP_EQ,
 tor_sscanf("wrong", "%5c", s1)); /* %c cannot have a number. */
   tt_int_op(-1,OP_EQ, tor_sscanf("hello", "%s", s1)); /* %s needs a number. */
-  tt_int_op(-1,OP_EQ, tor_sscanf("prettylongstring", "%99s", s1));
+  /* this will fail because we don't allow widths longer than  */
+  {
+huge = tor_malloc(100);
+r = tor_sscanf("prettylongstring", "%9s", huge);
+tor_free(huge);
+tt_int_op(-1,OP_EQ, r);
+  }
 #if 0
   /* GCC thinks these two are illegal. */
   test_eq(-1, tor_sscanf("prettylongstring", "%0s", s1));
@@ -2618,8 +2624,13 @@ test_util_sscanf(void *arg)
   tt_int_op(2,OP_EQ, tor_sscanf("76trombones", "%6u%9s", &u1, s1)); /* %u%s */
   tt_int_op(76,OP_EQ, u1);
   tt_str_op(s1,OP_EQ, "trombones");
-  tt_int_op(1,OP_EQ, tor_sscanf("prettylongstring", "%999s", s1));
-  tt_str_op(s1,OP_EQ, "prettylongstring");
+  {
+huge = tor_malloc(1000);
+r = tor_sscanf("prettylongstring", "%999s", huge);
+tt_int_op(1,OP_EQ, r);
+tt_str_op(huge,OP_EQ, "prettylongstring");
+tor_free(huge);
+  }
   /* %s doesn't eat spaces */
   tt_int_op(2,OP_EQ, tor_sscanf("hello world", "%9s %9s", s1, s2));
   tt_str_op(s1,OP_EQ, "hello");
@@ -2843,7 +2854,7 @@ test_util_sscanf(void *arg)
   test_feq(d4, 3.2);
 
  done:
-  ;
+  tor_free(huge);
 }
 
 #define tt_char_op(a,op,b) tt_assert_op_type(a,op,b,char,"%c")



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


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

2017-09-12 Thread translation
commit b0ab41cda23bde508952504991cea7a4f9e58d9d
Author: Translation commit bot 
Date:   Tue Sep 12 20:49:24 2017 +

Update translations for exoneratorproperties
---
 uz/exonerator.properties | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/uz/exonerator.properties b/uz/exonerator.properties
index 9b5922d37..0fdd28332 100644
--- a/uz/exonerator.properties
+++ b/uz/exonerator.properties
@@ -1,13 +1,13 @@
-form.explanation=Enter an IP address and date to find out whether that address 
was used as a Tor relay\:
+form.explanation=Enter an IP address and date to find out whether that address 
was used as a Tor relay:
 form.ip.label=IP address
 form.timestamp.label=Date
 form.search.label=Search
 summary.heading=Summary
 summary.serverproblem.dbnoconnect.title=Server problem
-summary.serverproblem.dbnoconnect.body.text=Unable to connect to the database. 
Please try again later. If this problem persists, please %s\!
+summary.serverproblem.dbnoconnect.body.text=Unable to connect to the database. 
Please try again later. If this problem persists, please %s!
 summary.serverproblem.dbnoconnect.body.link=let us know
 summary.serverproblem.dbempty.title=Server problem
-summary.serverproblem.dbempty.body.text=The database appears to be empty. 
Please try again later. If this problem persists, please %s\!
+summary.serverproblem.dbempty.body.text=The database appears to be empty. 
Please try again later. If this problem persists, please %s!
 summary.serverproblem.dbempty.body.link=let us know
 summary.invalidparams.notimestamp.title=No date parameter given
 summary.invalidparams.notimestamp.body=Sorry, you also need to provide a date 
parameter.
@@ -20,10 +20,10 @@ summary.invalidparams.invalidip.body=Sorry, %s is not a 
valid IP address. The ex
 summary.invalidparams.invalidtimestamp.title=Invalid date parameter
 summary.invalidparams.invalidtimestamp.body=Sorry, %s is not a valid date. The 
expected date format is %s.
 summary.serverproblem.nodata.title=Server problem
-summary.serverproblem.nodata.body.text=The database does not contain any data 
for the requested date. Please try again later. If this problem persists, 
please %s\!
+summary.serverproblem.nodata.body.text=The database does not contain any data 
for the requested date. Please try again later. If this problem persists, 
please %s!
 summary.serverproblem.nodata.body.link=let us know
 summary.negativesamenetwork.title=Result is negative
-summary.negativesamenetwork.body=We did not find IP address %s on or within a 
day of %s. But we did find other IP addresses of Tor relays in the same /%d 
network around the time\:
+summary.negativesamenetwork.body=We did not find IP address %s on or within a 
day of %s. But we did find other IP addresses of Tor relays in the same /%d 
network around the time:
 summary.positive.title=Result is positive
 summary.positive.body=We found one or more Tor relays on IP address %s on or 
within a day of %s that Tor clients were likely to know.
 summary.negative.title=Result is negative
@@ -49,6 +49,6 @@ footer.aboutexonerator.heading=About ExoneraTor
 footer.aboutexonerator.body=The ExoneraTor service maintains a database of IP 
addresses that have been part of the Tor network.  It answers the question 
whether there was a Tor relay running on a given IP address on a given 
date.  ExoneraTor may store more than one IP address per relay if relays 
use a different IP address for exiting to the Internet than for registering in 
the Tor network, and it stores whether a relay permitted transit of Tor traffic 
to the open Internet at that time.
 footer.trademark.text="Tor" and the "Onion Logo" are %s of The Tor Project, 
Inc.
 footer.trademark.link=registered trademarks
-footer.language.name=English
-footer.language.text=This page is also available in the following languages\:
+footer.language.name=Ingliz
+footer.language.text=This page is also available in the following languages:
 

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


[tor-commits] [tor/master] Fix torrc-format documentation corner cases

2017-09-12 Thread nickm
commit 9c27f56cd9537d46c8d3acebf3ef37ff43b5c03b
Author: Nick Mathewson 
Date:   Tue Sep 12 16:32:56 2017 -0400

Fix torrc-format documentation corner cases

We don't require that the final line be terminated, and we open
windows torrc files in text mode.

Closes ticket 22795.
---
 doc/torrc_format.txt | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/torrc_format.txt b/doc/torrc_format.txt
index b175b9fb1..7a4a92a66 100644
--- a/doc/torrc_format.txt
+++ b/doc/torrc_format.txt
@@ -18,9 +18,10 @@ does, not what it should do.
; specified in RFC5234.
 
; A file is interpreted as every Entry in the file, in order.
-   TorrcFile = *Line
+   TorrcFile = *Line [ UnterminatedLine ]
 
-   Line = BlankLine / Entry
+   Line = BlankLine LF / Entry LF
+   UnterminatedLine = BlankLine / Entry
 
BlankLine =  *WSP OptComment LF
BlankLine =/ *WSP LF
@@ -69,6 +70,12 @@ does, not what it should do.
; Anything besides NUL and LF
NonLF = %x01-%x09 / %x0b - %xff
 
+   ; Note that on windows, we open our configuration files in "text" mode,
+   ; which causes CRLF pairs to be interpreted as LF.  So, on windows:
+   ; LF = [ %x0d ] %x0a
+   ; but everywhere else,
+   LF = %0x0a
+
OCTDIG = '0' - '7'
 
KC = Any character except an isspace() character or '#' or NUL

___
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 items from testing_tor_network_defaults

2017-09-12 Thread nickm
commit 6ff67389631100d076482e573859d0f8f85255ac
Author: Nick Mathewson 
Date:   Tue Sep 12 16:23:37 2017 -0400

Remove redundant items from testing_tor_network_defaults

These items were listed in testing_tor_network_defaults, but had the
same defaults as with the regular settings.

Closes ticket 22532.
---
 src/or/config.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index 55c9531f4..a5bda8be0 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -624,7 +624,6 @@ static config_var_t option_vars_[] = {
 /** Override default values with these if the user sets the TestingTorNetwork
  * option. */
 static const config_var_t testing_tor_network_defaults[] = {
-  V(ServerDNSAllowBrokenConfig,  BOOL, "1"),
   V(DirAllowPrivateAddresses,BOOL, "1"),
   V(EnforceDistinctSubnets,  BOOL, "0"),
   V(AssumeReachable, BOOL, "1"),
@@ -648,7 +647,6 @@ static const config_var_t testing_tor_network_defaults[] = {
   V(TestingV3AuthInitialVotingInterval, INTERVAL, "150 seconds"),
   V(TestingV3AuthInitialVoteDelay, INTERVAL, "20 seconds"),
   V(TestingV3AuthInitialDistDelay, INTERVAL, "20 seconds"),
-  V(TestingV3AuthVotingStartOffset, INTERVAL, "0"),
   V(TestingAuthDirTimeToLearnReachability, INTERVAL, "0 minutes"),
   V(TestingEstimatedDescriptorPropagationTime, INTERVAL, "0 minutes"),
   V(MinUptimeHidServDirectoryV2, INTERVAL, "0 minutes"),

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


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

2017-09-12 Thread translation
commit 270f14699958b77b00a651b8b80f605804f4557d
Author: Translation commit bot 
Date:   Tue Sep 12 20:19:07 2017 +

Update translations for tor-messenger-uiproperties
---
 uz/ui.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uz/ui.properties b/uz/ui.properties
index de5c23213..35912979a 100644
--- a/uz/ui.properties
+++ b/uz/ui.properties
@@ -2,7 +2,7 @@ start.label=Start private conversation
 end.label=End private conversation
 refresh.label=Refresh private conversation
 auth.label=Verify your contact's identity
-auth.cancel=Cancel
+auth.cancel=Bekor qilish
 auth.cancelAccessKey=C
 auth.error=An error occurred while verifying your contact's identity.
 auth.success=Verifying your contact's identity completed successfully.

___
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

2017-09-12 Thread translation
commit 6e98d008f994f78d8754244ee3ccaf3c64ac2954
Author: Translation commit bot 
Date:   Tue Sep 12 20:19:16 2017 +

Update translations for tails-greeter-2
---
 uz/uz.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/uz/uz.po b/uz/uz.po
index 1067ab0f5..e02ec78dd 100644
--- a/uz/uz.po
+++ b/uz/uz.po
@@ -10,7 +10,7 @@ msgstr ""
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-06-10 12:27+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: Umidjon Almasov , 2016\n"
+"Last-Translator: Adham Kurbanov , 2017\n"
 "Language-Team: Uzbek (https://www.transifex.com/otf/teams/1519/uz/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -255,7 +255,7 @@ msgstr "Bekor qilish"
 
 #: ../tailsgreeter/gui.py:608
 msgid "Add"
-msgstr ""
+msgstr "Qo‘shish"
 
 #: ../tailsgreeter/gui.py:616
 msgid "Back"

___
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

2017-09-12 Thread translation
commit b14bbb5117c390c4f51e3080d600016f9c26951d
Author: Translation commit bot 
Date:   Tue Sep 12 20:16:39 2017 +

Update translations for tails-misc
---
 uz.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uz.po b/uz.po
index d9a1809d0..d9aac894c 100644
--- a/uz.po
+++ b/uz.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-06-05 11:57+0200\n"
-"PO-Revision-Date: 2017-05-26 14:47+\n"
+"PO-Revision-Date: 2017-09-12 19:57+\n"
 "Last-Translator: carolyn \n"
 "Language-Team: Uzbek (http://www.transifex.com/otf/torproject/language/uz/)\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/mat-gui] Update translations for mat-gui

2017-09-12 Thread translation
commit f680e172b5a2135ccd0fd02261c755211c82d654
Author: Translation commit bot 
Date:   Tue Sep 12 20:16:09 2017 +

Update translations for mat-gui
---
 uz.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/uz.po b/uz.po
index 6d4110887..5d20cafa8 100644
--- a/uz.po
+++ b/uz.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-02-10 23:06+0100\n"
-"PO-Revision-Date: 2016-03-21 16:34+\n"
+"PO-Revision-Date: 2017-09-12 19:53+\n"
 "Last-Translator: carolyn \n"
 "Language-Team: Uzbek (http://www.transifex.com/otf/torproject/language/uz/)\n"
 "MIME-Version: 1.0\n"
@@ -148,7 +148,7 @@ msgstr ""
 
 #: data/mat.glade:187
 msgid "Add"
-msgstr ""
+msgstr "Qo‘shish"
 
 #: data/mat.glade:256
 msgid "State"

___
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

2017-09-12 Thread translation
commit b15eee8e16952e5cf4ea6408a3aae72218538e4e
Author: Translation commit bot 
Date:   Tue Sep 12 20:15:59 2017 +

Update translations for torbirdy
---
 uz/torbirdy.dtd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uz/torbirdy.dtd b/uz/torbirdy.dtd
index c4e540f78..b2893663e 100644
--- a/uz/torbirdy.dtd
+++ b/uz/torbirdy.dtd
@@ -16,7 +16,7 @@
 
 
 
-
+
 
 
 

___
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

2017-09-12 Thread translation
commit 31e0befd8a8311f9a71c72d88c30795302e54057
Author: Translation commit bot 
Date:   Tue Sep 12 20:15:50 2017 +

Update translations for tails-persistence-setup
---
 uz/uz.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/uz/uz.po b/uz/uz.po
index 3cf62cc97..c9ddbd87c 100644
--- a/uz/uz.po
+++ b/uz/uz.po
@@ -8,7 +8,7 @@ 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"
+"PO-Revision-Date: 2017-09-12 19:57+\n"
 "Last-Translator: carolyn \n"
 "Language-Team: Uzbek (http://www.transifex.com/otf/torproject/language/uz/)\n"
 "MIME-Version: 1.0\n"
@@ -312,7 +312,7 @@ msgstr ""
 
 #: ../lib/Tails/Persistence/Step/Delete.pm:54
 msgid "Delete"
-msgstr ""
+msgstr "O‘chirish"
 
 #: ../lib/Tails/Persistence/Step/Delete.pm:111
 msgid "Deleting..."

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


[tor-commits] [policies/master] Membership policy vote

2017-09-12 Thread atagar
commit 35594fd77f83007211fcb037c4f27d9cda0a1df0
Author: Damian Johnson 
Date:   Tue Sep 12 13:11:32 2017 -0700

Membership policy vote
---
 membership.txt | 191 +
 votes/17-09-12_membership/proposal.txt | 144 +
 votes/17-09-12_membership/summary.txt  | 118 
 3 files changed, 453 insertions(+)

diff --git a/membership.txt b/membership.txt
new file mode 100644
index 000..524d8a8
--- /dev/null
+++ b/membership.txt
@@ -0,0 +1,191 @@
+=
+Membership Policy
+=
+
+These guidelines are intended to define Core Contributor roles and
+responsibilities. Anyone who uses, supports, or contributes to Tor can be a
+member of the Tor community, but being a Core Contributor is a recognition of
+demonstrated, continuous work on Tor plus interactions with other Core
+Contributors. Core Contributors get special access to Tor resources, are
+involved with the day-to-day work of building Tor, and are considered
+ambassadors of Tor in the broader community. We hope that these guidelines will
+clarify the privileges and responsibilities of being a Core Contributor so that
+we may all focus our time on working well together and contributing positively
+to Tor.
+
+This membership concept is distinct from whether people are employees or
+contractors for the non-profit organization "The Tor Project Inc": Tor the
+non-profit organization is different from Tor Core Contributors. The Tor
+Project Inc and the Core Contributors support the same goals with an
+overlapping, but not necessarily identical, set of responsibilities.
+
+This document describes rules and procedures. We as a community frown on gaming
+these rules and procedures by following them to the letter while subverting
+their intent. Please don't do that.
+
+=
+What is a "Core Contributor"?
+=
+
+We call a community member a Core Contributor when they...
+
+ * Have worked continuously on Tor for at least the last six months.
+ * Enjoy the respect and support of other Tor Core Contributors.
+ * Have gone through the process outlined in this document.
+
+The phrase "work on Tor" includes but is not limited to: advocacy, support,
+design, code, community building, project management, bug triaging,
+documentation, etc.
+
+The Tor Community is made up of all kinds of people -- researchers, relay
+operators, advocates, developers, and users. Some of those people work on Tor
+as part of their day job, while others contribute a few lines of code or a bug
+report here and there. All contributions -- big and small -- are what make Tor
+possible, and we're grateful for such a vibrant and dedicated community.
+
+=
+How can I become a Core Contributor?
+=
+
+Members of the wider Tor community may become a Core Contributor by doing the
+following...
+
+ 1. Find an Advocate who is an existing Core Contributor.
+ 2. You and your Advocate collaborate to answer the following:
+
+   * What name or alias would you like to be called?
+   * How have you been involved in Tor these last six months?
+   * What is your OpenPGP key?
+   * What email should be subscribed to our internal lists?
+
+ 3. Your Advocate initiates an internal discussion with the other Core
+Contributors. Two weeks of discussion and consensus-building will then take
+place. Any Core Contributor has the ability to "block" if they have very
+serious concerns about a potential new contributor. A "block" is not a veto
+in the traditional sense; it means that the concerns are so serious that
+they would sooner leave the project than allow for the new contributor to
+join. Since blocking is a very serious measure, we hope that the
+overwhelming majority of decisions about whether or not to invite someone
+to become a Core Contributor will be decided by consensus-building alone. 
+
+If consensus is reached after two weeks, you become a Core Contributor. If
+consensus fails, that result will be shared with you and it is suggested you
+wait at least six months before trying again, and work with your Advocate to
+understand why your membership was rejected. If your application is blocked,
+you may be prohibited from reapplying.
+
+=
+What are the benefits of being a Core Contributor?
+=
+
+Core Contributorship has the following privileges...
+
+ * One vote, whenever voting takes place. [2]
+ * Subscription to the tor-internal@ and related mailing lists.
+ * Access to

[tor-commits] [tor/master] remove a redundant changes file for 22750

2017-09-12 Thread nickm
commit d165812416246f3b34d80904d6b253bd7eb1f4fa
Author: Nick Mathewson 
Date:   Tue Sep 12 15:39:06 2017 -0400

remove a redundant changes file for 22750
---
 changes/ticket22750 | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/changes/ticket22750 b/changes/ticket22750
deleted file mode 100644
index 6bc1fb263..0
--- a/changes/ticket22750
+++ /dev/null
@@ -1,3 +0,0 @@
-  o Minor bugfixes (logging, sandbox):
-- Use the correct system call in sandbox error messages. Fixes bug
-  22750; bugfix on 0.2.5.1-alpha.

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


[tor-commits] [tor/master] hs-v3: Stall SOCKS connection when no live consensus available

2017-09-12 Thread nickm
commit 6b4eace248272f4defae0f6cc9933588b1b498b3
Author: David Goulet 
Date:   Tue Sep 12 12:24:26 2017 -0400

hs-v3: Stall SOCKS connection when no live consensus available

Fixes #23481

Signed-off-by: David Goulet 
---
 src/or/connection_edge.c  | 26 +++---
 src/or/hs_client.c| 31 +++
 src/or/hs_client.h| 16 
 src/test/test_entryconn.c |  2 +-
 4 files changed, 63 insertions(+), 12 deletions(-)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index dfa89bc2c..d1b8abda8 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -80,6 +80,7 @@
 #include "hs_client.h"
 #include "hs_circuit.h"
 #include "main.h"
+#include "networkstatus.h"
 #include "nodelist.h"
 #include "policies.h"
 #include "proto_http.h"
@@ -1561,18 +1562,37 @@ connection_ap_handle_onion(entry_connection_t *conn,
 if (addresstype == ONION_V2_HOSTNAME) {
   tor_assert(edge_conn->rend_data);
   rend_client_refetch_v2_renddesc(edge_conn->rend_data);
+  /* Whatever the result of the refetch, we don't go further. */
+  return 0;
 } else {
   tor_assert(addresstype == ONION_V3_HOSTNAME);
   tor_assert(edge_conn->hs_ident);
-  hs_client_refetch_hsdesc(&edge_conn->hs_ident->identity_pk);
+  /* Attempt to fetch the hsv3 descriptor. Check the retval to see how it
+   * went and act accordingly. */
+  int ret = hs_client_refetch_hsdesc(&edge_conn->hs_ident->identity_pk);
+  switch (ret) {
+  case HS_CLIENT_FETCH_MISSING_INFO:
+/* By going to the end, the connection is put in waiting for a circuit
+ * state which means that it will be retried and consider as a pending
+ * connection. */
+goto end;
+  case HS_CLIENT_FETCH_LAUNCHED:
+  case HS_CLIENT_FETCH_HAVE_DESC:
+return 0;
+  case HS_CLIENT_FETCH_ERROR:
+  case HS_CLIENT_FETCH_NO_HSDIRS:
+  case HS_CLIENT_FETCH_NOT_ALLOWED:
+/* Can't proceed further and better close the SOCKS request. */
+return -1;
+  }
 }
-return 0;
   }
 
   /* We have the descriptor!  So launch a connection to the HS. */
-  base_conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
   log_info(LD_REND, "Descriptor is here. Great.");
 
+ end:
+  base_conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
   /* We'll try to attach it at the next event loop, or whenever
* we call connection_ap_attach_pending() */
   connection_ap_mark_as_pending_circuit(conn);
diff --git a/src/or/hs_client.c b/src/or/hs_client.c
index 620ef3a10..be5ece068 100644
--- a/src/or/hs_client.c
+++ b/src/or/hs_client.c
@@ -152,7 +152,7 @@ directory_launch_v3_desc_fetch(const ed25519_public_key_t 
*onion_identity_pk,
   /* ...and base64 it. */
   retval = ed25519_public_to_base64(base64_blinded_pubkey, &blinded_pubkey);
   if (BUG(retval < 0)) {
-return -1;
+return HS_CLIENT_FETCH_ERROR;
   }
 
   /* Copy onion pk to a dir_ident so that we attach it to the dir conn */
@@ -180,7 +180,7 @@ directory_launch_v3_desc_fetch(const ed25519_public_key_t 
*onion_identity_pk,
   memwipe(base64_blinded_pubkey, 0, sizeof(base64_blinded_pubkey));
   memwipe(&hs_conn_dir_ident, 0, sizeof(hs_conn_dir_ident));
 
-  return 1;
+  return HS_CLIENT_FETCH_LAUNCHED;
 }
 
 /** Return the HSDir we should use to fetch the descriptor of the hidden
@@ -236,7 +236,7 @@ fetch_v3_desc(const ed25519_public_key_t *onion_identity_pk)
   hsdir_rs = pick_hsdir_v3(onion_identity_pk);
   if (!hsdir_rs) {
 log_info(LD_REND, "Couldn't pick a v3 hsdir.");
-return 0;
+return HS_CLIENT_FETCH_NO_HSDIRS;
   }
 
   return directory_launch_v3_desc_fetch(onion_identity_pk, hsdir_rs);
@@ -998,8 +998,7 @@ hs_client_any_intro_points_usable(const 
ed25519_public_key_t *service_pk,
 /** Launch a connection to a hidden service directory to fetch a hidden
  * service descriptor using identity_pk to get the necessary keys.
  *
- * On success, 1 is returned. If no hidden service is left to ask, return 0.
- * On error, -1 is returned. (retval is only used by unittests right now) */
+ * A hs_client_fetch_status_t code is returned. */
 int
 hs_client_refetch_hsdesc(const ed25519_public_key_t *identity_pk)
 {
@@ -1009,7 +1008,23 @@ hs_client_refetch_hsdesc(const ed25519_public_key_t 
*identity_pk)
   if (!get_options()->FetchHidServDescriptors) {
 log_warn(LD_REND, "We received an onion address for a hidden service "
   "descriptor but we are configured to not fetch.");
-return 0;
+return HS_CLIENT_FETCH_NOT_ALLOWED;
+  }
+
+  /* Without a live consensus we can't do any client actions. It is needed to
+   * compute the hashring for a service. */
+  if (!networkstatus_get_live_consensus(approx_time())) {
+log_info(LD_REND, "Can't fetch descriptor for service %s because we "
+  "are missing a live consensus. Stalling connection.",
+   safe_str_client(ed25519_fmt(identity_pk)));
+ 

[tor-commits] [nyx/master] Move interaction of --interface and --socket to arguments

2017-09-12 Thread atagar
commit 305f575eb060ed31e51f5e9b537cbb5f13e96bf7
Author: Damian Johnson 
Date:   Tue Sep 5 11:22:01 2017 -0700

Move interaction of --interface and --socket to arguments

When interface is set we unset the socket, and vic versa. Doing this in the
arguments module both makes sense and lets us clean up the starter a bit.
---
 nyx/arguments.py | 29 +
 nyx/panel/connection.py  |  4 ++--
 nyx/starter.py   | 15 ++-
 test/arguments.py| 25 -
 web/changelog/index.html |  1 +
 5 files changed, 42 insertions(+), 32 deletions(-)

diff --git a/nyx/arguments.py b/nyx/arguments.py
index e55b653..698328f 100644
--- a/nyx/arguments.py
+++ b/nyx/arguments.py
@@ -15,11 +15,8 @@ import nyx.log
 import stem.util.connection
 
 DEFAULT_ARGS = {
-  'control_address': '127.0.0.1',
-  'control_port': 9051,
-  'user_provided_port': False,
+  'control_port': ('127.0.0.1', 9051),
   'control_socket': '/var/run/tor/control',
-  'user_provided_socket': False,
   'config': os.path.join(os.path.expanduser('~/.nyx'), 'config'),
   'debug_path': None,
   'logged_events': 'NOTICE,WARN,ERR,NYX_NOTICE,NYX_WARNING,NYX_ERROR',
@@ -81,27 +78,27 @@ def parse(argv):
   except getopt.GetoptError as exc:
 raise ValueError('%s (for usage provide --help)' % exc)
 
+  has_port_arg, has_socket_arg = False, False
+
   for opt, arg in recognized_args:
 if opt in ('-i', '--interface'):
   if ':' in arg:
 address, port = arg.split(':', 1)
   else:
-address, port = None, arg
+address, port = args['control_port'][0], arg
 
   if address is not None:
 if not stem.util.connection.is_valid_ipv4_address(address):
   raise ValueError("'%s' isn't a valid IPv4 address" % address)
 
-args['control_address'] = address
-
   if not stem.util.connection.is_valid_port(port):
 raise ValueError("'%s' isn't a valid port number" % port)
 
-  args['control_port'] = int(port)
-  args['user_provided_port'] = True
+  args['control_port'] = (address, int(port))
+  has_port_arg = True
 elif opt in ('-s', '--socket'):
   args['control_socket'] = arg
-  args['user_provided_socket'] = True
+  has_socket_arg = True
 elif opt in ('-c', '--config'):
   args['config'] = arg
 elif opt in ('-d', '--debug'):
@@ -113,6 +110,14 @@ def parse(argv):
 elif opt in ('-h', '--help'):
   args['print_help'] = True
 
+  # If the user explicitely specified an endpoint then just try to connect to
+  # that.
+
+  if has_socket_arg and not has_port_arg:
+args['control_port'] = None
+  elif has_port_arg and not has_socket_arg:
+args['control_socket'] = None
+
   # translates our args dict into a named tuple
 
   Args = collections.namedtuple('Args', args.keys())
@@ -127,8 +132,8 @@ def get_help():
   """
 
   return HELP_OUTPUT.format(
-address = DEFAULT_ARGS['control_address'],
-port = DEFAULT_ARGS['control_port'],
+address = DEFAULT_ARGS['control_port'][0],
+port = DEFAULT_ARGS['control_port'][1],
 socket = DEFAULT_ARGS['control_socket'],
 config_path = DEFAULT_ARGS['config'],
   )
diff --git a/nyx/panel/connection.py b/nyx/panel/connection.py
index 41577b6..4683dcc 100644
--- a/nyx/panel/connection.py
+++ b/nyx/panel/connection.py
@@ -5,11 +5,11 @@
 Listing of the currently established connections tor has made.
 """
 
-import re
-import time
 import collections
 import curses
 import itertools
+import re
+import time
 
 import nyx.curses
 import nyx.panel
diff --git a/nyx/starter.py b/nyx/starter.py
index 077ca36..88cf9f5 100644
--- a/nyx/starter.py
+++ b/nyx/starter.py
@@ -65,20 +65,9 @@ def main(config):
 
   _load_user_nyxrc(args.config)
 
-  control_port = (args.control_address, args.control_port)
-  control_socket = args.control_socket
-
-  # If the user explicitely specified an endpoint then just try to connect to
-  # that.
-
-  if args.user_provided_socket and not args.user_provided_port:
-control_port = None
-  elif args.user_provided_port and not args.user_provided_socket:
-control_socket = None
-
   controller = init_controller(
-control_port = control_port,
-control_socket = control_socket,
+control_port = args.control_port,
+control_socket = args.control_socket,
 password_prompt = True,
 chroot_path = config.get('tor_chroot', ''),
   )
diff --git a/test/arguments.py b/test/arguments.py
index c146e7d..454c3ca 100644
--- a/test/arguments.py
+++ b/test/arguments.py
@@ -16,12 +16,10 @@ class TestArgumentParsing(unittest.TestCase):
 
   def test_that_we_load_arguments(self):
 args = parse(['--interface', '10.0.0.25:80'])
-self.assertEqual('10.0.0.25', args.control_address)
-self.assertEqual(80, args.control_port)
+self.assertEqual(('10.0.0.25', 80), args.control_port)
 
 args = parse(['--interface', '80'])
-self.assertEqual(DEFAULT_ARGS['control_address'], args.control_address)
- 

[tor-commits] [nyx/master] Provide url for sample nyxrc

2017-09-12 Thread atagar
commit b9bf1f9340a7b2f8189fc3874c5a312d7be20901
Author: Damian Johnson 
Date:   Sun Sep 10 03:39:18 2017 -0700

Provide url for sample nyxrc

Most folks install via things like apt-get, and as such have no clue where 
the
'nyxrc.sample' is. Our website provides it so giving 'em a link to that.
---
 nyx/starter.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nyx/starter.py b/nyx/starter.py
index 22e985e..90aa947 100644
--- a/nyx/starter.py
+++ b/nyx/starter.py
@@ -145,7 +145,7 @@ def _load_user_nyxrc(path, config):
 except IOError as exc:
   stem.util.log.warn('Failed to load configuration (using defaults): "%s"' 
% exc.strerror)
   else:
-stem.util.log.notice('No nyxrc loaded, using defaults. You can customize 
nyx by placing a configuration file at %s (see the nyxrc.sample for its 
options).' % path)
+stem.util.log.notice('No nyxrc loaded, using defaults. You can customize 
nyx by placing a configuration file at %s (see 
https://nyx.torproject.org/nyxrc.sample for its options).' % path)
 
 
 def _warn_if_root(controller):



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


[tor-commits] [nyx/master] Move chroot out of starter

2017-09-12 Thread atagar
commit ee4a3205d8d9c3001b43cf802cbba2f6c5fdb714
Author: Damian Johnson 
Date:   Fri Sep 8 03:43:27 2017 -0700

Move chroot out of starter

There's a few things to consult to determine our chroot so making this a
helper rather than part of the starter.
---
 nyx/__init__.py | 37 +
 nyx/panel/header.py |  8 
 nyx/starter.py  | 28 +---
 test/__init__.py| 34 --
 4 files changed, 66 insertions(+), 41 deletions(-)

diff --git a/nyx/__init__.py b/nyx/__init__.py
index 2239956..c5736c1 100644
--- a/nyx/__init__.py
+++ b/nyx/__init__.py
@@ -14,6 +14,7 @@ Tor curses monitoring application.
   input_prompt - prompts the user for text input
   init_controller - initializes our connection to tor
   expand_path - expands path with respect to our chroot
+  chroot - provides the chroot path we reside within
   join - joins a series of strings up to a set length
 
   Cache - application cache
@@ -44,6 +45,7 @@ Tor curses monitoring application.
 import contextlib
 import distutils.spawn
 import os
+import platform
 import sqlite3
 import sys
 import threading
@@ -99,6 +101,7 @@ CONFIG = stem.util.conf.config_dict('nyx', {
 NYX_INTERFACE = None
 TOR_CONTROLLER = None
 CACHE = None
+CHROOT = None
 BASE_DIR = os.path.sep.join(__file__.split(os.path.sep)[:-1])
 
 # technically can change but we use this query a *lot* so needs to be cached
@@ -294,8 +297,7 @@ def data_directory(filename, config):
   return os.path.join(data_dir, filename)
 
 
-@uses_settings
-def expand_path(path, config):
+def expand_path(path):
   """
   Expands relative paths and include our chroot if one was set.
 
@@ -308,14 +310,41 @@ def expand_path(path, config):
 return None
 
   try:
-chroot = config.get('tor_chroot', '')
 tor_cwd = stem.util.system.cwd(tor_controller().get_pid(None))
-return chroot + stem.util.system.expand_path(path, tor_cwd)
+return chroot() + stem.util.system.expand_path(path, tor_cwd)
   except IOError as exc:
 stem.util.log.info('Unable to expand a relative path (%s): %s' % (path, 
exc))
 return path
 
 
+@uses_settings
+def chroot(config):
+  global CHROOT
+
+  if CHROOT is None:
+# If the user provided us with a chroot then validate and normalize the
+# path.
+
+chroot = config.get('tor_chroot', '').strip().rstrip(os.path.sep)
+
+if chroot and not os.path.exists(chroot):
+  stem.util.log.notice("The chroot path set in your config (%s) doesn't 
exist." % chroot)
+  chroot = ''
+
+if not chroot and platform.system() == 'FreeBSD':
+  controller = tor_controller()
+  pid = controller.get_pid(None) if controller else 
stem.util.system.pid_by_name('tor')
+  jail_chroot = stem.util.system.bsd_jail_path(pid) if pid else None
+
+  if jail_chroot and os.path.exists(jail_chroot):
+stem.util.log.info('Adjusting paths to account for Tor running in a 
FreeBSD jail at: %s' % jail_chroot)
+chroot = jail_chroot
+
+CHROOT = chroot
+
+  return CHROOT
+
+
 def join(entries, joiner = ' ', size = None):
   """
   Joins a series of strings similar to str.join(), but only up to a given size.
diff --git a/nyx/panel/header.py b/nyx/panel/header.py
index cf11b67..b1cbfbf 100644
--- a/nyx/panel/header.py
+++ b/nyx/panel/header.py
@@ -16,13 +16,14 @@ import stem.util.proc
 import stem.util.str_tools
 import stem.util.system
 
+import nyx
 import nyx.curses
 import nyx.panel
 import nyx.popups
 import nyx.tracker
 
 from stem.util import conf, log
-from nyx import nyx_interface, tor_controller, input_prompt
+from nyx import nyx_interface, tor_controller
 
 from nyx.curses import RED, GREEN, YELLOW, CYAN, WHITE, BOLD, HIGHLIGHT
 
@@ -33,7 +34,6 @@ UPDATE_RATE = 5  # rate in seconds at which we refresh
 CONFIG = conf.config_dict('nyx', {
   'attr.flag_colors': {},
   'attr.version_status_colors': {},
-  'tor_chroot': '',
 })
 
 
@@ -129,9 +129,9 @@ class HeaderPanel(nyx.panel.DaemonPanel):
 
   try:
 try:
-  controller.reconnect(chroot_path = CONFIG['tor_chroot'])
+  controller.reconnect(chroot_path = nyx.chroot())
 except stem.connection.MissingPassword:
-  password = input_prompt('Controller Password: ')
+  password = nyx.input_prompt('Controller Password: ')
 
   if password:
 controller.authenticate(password)
diff --git a/nyx/starter.py b/nyx/starter.py
index 88cf9f5..22e985e 100644
--- a/nyx/starter.py
+++ b/nyx/starter.py
@@ -69,7 +69,7 @@ def main(config):
 control_port = args.control_port,
 control_socket = args.control_socket,
 password_prompt = True,
-chroot_path = config.get('tor_chroot', ''),
+chroot_path = nyx.chroot(),
   )
 
   if controller is None:
@@ -78,7 +78,6 @@ def main(config):
   _warn_if_root(controller)
   _warn_if_unable_to_get_pid(controller)
   _warn_about_unused_config_keys()
-  _setup_freebsd_chroot(controller)
   _use_eng

[tor-commits] [nyx/master] Move _load_user_nyxrc() helper into main

2017-09-12 Thread atagar
commit 4fe97b17de9b0999ea87c9c13978eb3f7d80a06a
Author: Damian Johnson 
Date:   Sun Sep 10 03:50:04 2017 -0700

Move _load_user_nyxrc() helper into main

This helper stands out from the rest in that it's invoked before 
established a
controller connection. Think I like it a bit better above, like the debug
handling.
---
 nyx/starter.py | 33 +++--
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/nyx/starter.py b/nyx/starter.py
index 40cfc6b..789e67c 100644
--- a/nyx/starter.py
+++ b/nyx/starter.py
@@ -63,7 +63,13 @@ def main(config):
   print('Unable to write to our debug log file (%s): %s' % 
(args.debug_path, exc.strerror))
   sys.exit(1)
 
-  _load_user_nyxrc(args.config)
+  if os.path.exists(args.config):
+try:
+  config.load(args.config)
+except IOError as exc:
+  stem.util.log.warn('Failed to load configuration (using defaults): "%s"' 
% exc.strerror)
+  else:
+stem.util.log.notice('No nyxrc loaded, using defaults. You can customize 
nyx by placing a configuration file at %s (see 
https://nyx.torproject.org/nyxrc.sample for its options).' % args.config)
 
   controller = init_controller(
 control_port = args.control_port,
@@ -134,21 +140,6 @@ def _setup_debug_logging(args):
   ))
 
 
-@uses_settings
-def _load_user_nyxrc(path, config):
-  """
-  Loads user's personal nyxrc if it's available.
-  """
-
-  if os.path.exists(path):
-try:
-  config.load(path)
-except IOError as exc:
-  stem.util.log.warn('Failed to load configuration (using defaults): "%s"' 
% exc.strerror)
-  else:
-stem.util.log.notice('No nyxrc loaded, using defaults. You can customize 
nyx by placing a configuration file at %s (see 
https://nyx.torproject.org/nyxrc.sample for its options).' % path)
-
-
 def _warn_if_root(controller):
   """
   Give a notice if tor or nyx are running with root.
@@ -191,13 +182,11 @@ def _use_unicode(config):
   initializing curses.
   """
 
-  if not config.get('unicode_support', True):
-return
-
-  is_lang_unicode = 'utf-' in os.getenv('LANG', '').lower()
+  if config.get('unicode_support', True):
+is_lang_unicode = 'utf-' in os.getenv('LANG', '').lower()
 
-  if is_lang_unicode and nyx.curses.is_wide_characters_supported():
-locale.setlocale(locale.LC_ALL, '')
+if is_lang_unicode and nyx.curses.is_wide_characters_supported():
+  locale.setlocale(locale.LC_ALL, '')
 
 
 def _set_process_name():



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


[tor-commits] [nyx/master] Couple minor argument tests

2017-09-12 Thread atagar
commit c2bb902f58e7060a58fabe4c0ce6f9e94fe3acf5
Author: Damian Johnson 
Date:   Sun Sep 10 08:29:17 2017 -0700

Couple minor argument tests

Just adding some basic coverage for the rest of the argument module.
---
 test/arguments.py | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/test/arguments.py b/test/arguments.py
index 454c3ca..da55127 100644
--- a/test/arguments.py
+++ b/test/arguments.py
@@ -4,7 +4,7 @@ Unit tests for nyx.arguments.
 
 import unittest
 
-from nyx.arguments import DEFAULT_ARGS, parse
+from nyx.arguments import DEFAULT_ARGS, parse, get_help, get_version
 
 
 class TestArgumentParsing(unittest.TestCase):
@@ -48,7 +48,7 @@ class TestArgumentParsing(unittest.TestCase):
   def test_that_we_reject_unrecognized_arguments(self):
 self.assertRaises(ValueError, parse, ['--blarg', 'stuff'])
 
-  def test_that_port_and_socket_unset_other(self):
+  def test_port_and_socket_unset_other(self):
 args = parse([])
 self.assertEqual(DEFAULT_ARGS['control_port'], args.control_port)
 self.assertEqual(DEFAULT_ARGS['control_socket'], args.control_socket)
@@ -80,3 +80,10 @@ class TestArgumentParsing(unittest.TestCase):
 
 for invalid_input in invalid_inputs:
   self.assertRaises(ValueError, parse, ['--interface', invalid_input])
+
+  def test_help(self):
+self.assertTrue(get_help().startswith('Usage nyx [OPTION]'))
+self.assertTrue('change control interface from 127.0.0.1:9051' in 
get_help())
+
+  def test_version(self):
+self.assertTrue(get_version().startswith('nyx version'))

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


[tor-commits] [nyx/master] Set environment variables inline

2017-09-12 Thread atagar
commit 2a621aeb8838117b7c65ad1932dc37bc223caf43
Author: Damian Johnson 
Date:   Sun Sep 10 03:42:56 2017 -0700

Set environment variables inline

Shortening the starter a bit by dropping a couple helpers. No need to be 
quite
so verbose.
---
 nyx/starter.py | 24 +++-
 1 file changed, 3 insertions(+), 21 deletions(-)

diff --git a/nyx/starter.py b/nyx/starter.py
index 90aa947..40cfc6b 100644
--- a/nyx/starter.py
+++ b/nyx/starter.py
@@ -78,11 +78,12 @@ def main(config):
   _warn_if_root(controller)
   _warn_if_unable_to_get_pid(controller)
   _warn_about_unused_config_keys()
-  _use_english_subcommands()
-  _use_no_esc_delay()
   _use_unicode()
   _set_process_name()
 
+  os.putenv('LANG', 'C')  # make subcommands (ps, netstat, etc) provide 
english results
+  os.putenv('ESCDELAY', '0')  # make 'esc' take effect right away
+
   try:
 nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', 
True), transparent_background = True, cursor = False)
   except KeyboardInterrupt:
@@ -182,25 +183,6 @@ def _warn_about_unused_config_keys(config):
   stem.util.log.notice('Unused configuration entry: %s' % key)
 
 
-def _use_english_subcommands():
-  """
-  Make subcommands we run (ps, netstat, etc) provide us with English results.
-  This is important so we can parse the output.
-  """
-
-  os.putenv('LANG', 'C')
-
-
-def _use_no_esc_delay():
-  """
-  Make it so pressing 'esc' takes effect right away...
-
-
https://stackoverflow.com/questions/27372068/why-does-the-escape-key-have-a-delay-in-python-curses/28020568#28020568
-  """
-
-  os.putenv('ESCDELAY', '0')
-
-
 @uses_settings
 def _use_unicode(config):
   """



___
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

2017-09-12 Thread translation
commit 26eeab0a0fa27ae662b1526781e396d29532bf63
Author: Translation commit bot 
Date:   Tue Sep 12 16:45:32 2017 +

Update translations for https_everywhere
---
 uz/https-everywhere.dtd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uz/https-everywhere.dtd b/uz/https-everywhere.dtd
index 809845d97..07536033b 100644
--- a/uz/https-everywhere.dtd
+++ b/uz/https-everywhere.dtd
@@ -49,7 +49,7 @@
 
 
 
-
+
 
 
 

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


[tor-commits] [tor/master] hs-v3: Rate limit some log statements

2017-09-12 Thread nickm
commit 98953b1fc29a693aa797989402f7205523448408
Author: David Goulet 
Date:   Tue Sep 12 11:02:40 2017 -0400

hs-v3: Rate limit some log statements

Also fix an indentation issue.

Closes #23480

Signed-off-by: David Goulet 
---
 src/or/hs_service.c | 10 --
 src/or/nodelist.c   |  6 --
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index 5759aa812..a8883e03a 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -2978,8 +2978,14 @@ hs_service_lists_fnames_for_sandbox(smartlist_t 
*file_list,
 void
 hs_service_dir_info_changed(void)
 {
-  log_info(LD_REND, "New dirinfo arrived: consider reuploading descriptor");
-  consider_republishing_hs_descriptors = 1;
+  if (hs_service_get_num_services() > 0) {
+/* New directory information usually goes every consensus so rate limit
+ * every 30 minutes to not be too conservative. */
+static struct ratelim_t dir_info_changed_ratelim = RATELIM_INIT(30 * 60);
+log_fn_ratelim(&dir_info_changed_ratelim, LOG_INFO, LD_REND,
+   "New dirinfo arrived: consider reuploading descriptor");
+consider_republishing_hs_descriptors = 1;
+  }
 }
 
 /* Called when we get an INTRODUCE2 cell on the circ. Respond to the cell and
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 01a0e9e85..df735a9d2 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -300,14 +300,16 @@ node_set_hsdir_index(node_t *node, const networkstatus_t 
*ns)
   tor_assert(ns);
 
   if (!networkstatus_is_live(ns, now)) {
-log_info(LD_GENERAL, "Not setting hsdir index with a non-live consensus.");
+static struct ratelim_t live_consensus_ratelim = RATELIM_INIT(30 * 60);
+log_fn_ratelim(&live_consensus_ratelim, LOG_INFO, LD_GENERAL,
+   "Not setting hsdir index with a non-live consensus.");
 goto done;
   }
 
   node_identity_pk = node_get_ed25519_id(node);
   if (node_identity_pk == NULL) {
 log_debug(LD_GENERAL, "ed25519 identity public key not found when "
-  "trying to build the hsdir indexes for node %s",
+  "trying to build the hsdir indexes for node %s",
   node_describe(node));
 goto done;
   }



___
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 'dgoulet/ticket23480_032_01'

2017-09-12 Thread nickm
commit d71a00e91f3921f6bdf160811313e7b32f890b6c
Merge: 6c5c74e11 98953b1fc
Author: Nick Mathewson 
Date:   Tue Sep 12 11:20:27 2017 -0400

Merge remote-tracking branch 'dgoulet/ticket23480_032_01'

 src/or/hs_cache.c   |  6 ++
 src/or/hs_service.c | 10 --
 src/or/nodelist.c   |  6 --
 3 files changed, 14 insertions(+), 8 deletions(-)

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


[tor-commits] [tor/master] hs: Fix digest256 to base64 issue in a log statement

2017-09-12 Thread nickm
commit 184bd2258673f9e33e43cfc1264da78f74ad78a4
Author: David Goulet 
Date:   Tue Sep 12 09:43:34 2017 -0400

hs: Fix digest256 to base64 issue in a log statement

Part of #23480.

Signed-off-by: David Goulet 
---
 src/or/hs_cache.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/or/hs_cache.c b/src/or/hs_cache.c
index 78e2adacf..7f2a9cbbb 100644
--- a/src/or/hs_cache.c
+++ b/src/or/hs_cache.c
@@ -234,8 +234,7 @@ cache_clean_v3_as_dir(time_t now, time_t global_cutoff)
 /* Logging. */
 {
   char key_b64[BASE64_DIGEST256_LEN + 1];
-  base64_encode(key_b64, sizeof(key_b64), (const char *) key,
-DIGEST256_LEN, 0);
+  digest256_to_base64(key_b64, (const char *) key);
   log_info(LD_REND, "Removing v3 descriptor '%s' from HSDir cache",
safe_str_client(key_b64));
 }
@@ -655,8 +654,7 @@ cache_clean_v3_as_client(time_t now)
 /* Logging. */
 {
   char key_b64[BASE64_DIGEST256_LEN + 1];
-  base64_encode(key_b64, sizeof(key_b64), (const char *) key,
-DIGEST256_LEN, 0);
+  digest256_to_base64(key_b64, (const char *) key);
   log_info(LD_REND, "Removing hidden service v3 descriptor '%s' "
 "from client cache",
safe_str_client(key_b64));



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


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

2017-09-12 Thread translation
commit 490ddcbfce0166a39d93383c59ee1b29e50ef0b2
Author: Translation commit bot 
Date:   Tue Sep 12 15:17:17 2017 +

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

diff --git a/my.po b/my.po
index f1f13a86c..1bdbeb007 100644
--- a/my.po
+++ b/my.po
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
-"POT-Creation-Date: 2016-05-25 16:55+0200\n"
-"PO-Revision-Date: 2016-05-26 08:49+\n"
+"POT-Creation-Date: 2017-04-18 12:13+0200\n"
+"PO-Revision-Date: 2017-09-12 14:52+\n"
 "Last-Translator: carolyn \n"
 "Language-Team: Burmese 
(http://www.transifex.com/otf/torproject/language/my/)\n"
 "MIME-Version: 1.0\n"
@@ -201,7 +201,7 @@ msgstr ""
 
 #: ../lib/Tails/IUK/Frontend.pm:614
 msgid "Restart now"
-msgstr ""
+msgstr "ယခုပင်အစမှပြန်ဖွင့်ရန်"
 
 #: ../lib/Tails/IUK/Frontend.pm:615
 msgid "Restart later"

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


[tor-commits] [tor/master] hs-v3: Cancel active descriptor directory connections before uploading

2017-09-12 Thread nickm
commit 7150214baf2385d0e64fd11fe4138932675d444f
Author: David Goulet 
Date:   Mon Sep 11 13:16:23 2017 -0400

hs-v3: Cancel active descriptor directory connections before uploading

It is possible that two descriptor upload requests are launched in a very
short time frame which can lead to the second request finishing before the
first one and where that first one will make the HSDir send back a 400
malformed descriptor leading to a warning.

To avoid such, cancel all active directory connections for the specific
descriptor we are about to upload.

Note that this race is still possible on the HSDir side which triggers a log
info to be printed out but that is fine.

Fixes #23457

Signed-off-by: David Goulet 
---
 src/or/hs_client.c  |  3 ++-
 src/or/hs_ident.c   | 16 
 src/or/hs_ident.h   |  8 
 src/or/hs_service.c | 47 ++-
 4 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/src/or/hs_client.c b/src/or/hs_client.c
index f85ebc847..2f8953ba7 100644
--- a/src/or/hs_client.c
+++ b/src/or/hs_client.c
@@ -156,7 +156,8 @@ directory_launch_v3_desc_fetch(const ed25519_public_key_t 
*onion_identity_pk,
   }
 
   /* Copy onion pk to a dir_ident so that we attach it to the dir conn */
-  ed25519_pubkey_copy(&hs_conn_dir_ident.identity_pk, onion_identity_pk);
+  hs_ident_dir_conn_init(onion_identity_pk, &blinded_pubkey,
+ &hs_conn_dir_ident);
 
   /* Setup directory request */
   directory_request_t *req =
diff --git a/src/or/hs_ident.c b/src/or/hs_ident.c
index df3928515..b0e4e36a9 100644
--- a/src/or/hs_ident.c
+++ b/src/or/hs_ident.c
@@ -65,6 +65,22 @@ hs_ident_dir_conn_free(hs_ident_dir_conn_t *ident)
   tor_free(ident);
 }
 
+/* Initialized the allocated ident object with identity_pk and blinded_pk.
+ * None of them can be NULL since a valid directory connection identifier must
+ * have all fields set. */
+void
+hs_ident_dir_conn_init(const ed25519_public_key_t *identity_pk,
+   const ed25519_public_key_t *blinded_pk,
+   hs_ident_dir_conn_t *ident)
+{
+  tor_assert(identity_pk);
+  tor_assert(blinded_pk);
+  tor_assert(ident);
+
+  ed25519_pubkey_copy(&ident->identity_pk, identity_pk);
+  ed25519_pubkey_copy(&ident->blinded_pk, blinded_pk);
+}
+
 /* Return a newly allocated edge connection identifier. The given public key
  * identity_pk is copied into the identifier. */
 hs_ident_edge_conn_t *
diff --git a/src/or/hs_ident.h b/src/or/hs_ident.h
index cfcde781d..101c1cfff 100644
--- a/src/or/hs_ident.h
+++ b/src/or/hs_ident.h
@@ -96,6 +96,11 @@ typedef struct hs_ident_dir_conn_t {
* in the onion address. */
   ed25519_public_key_t identity_pk;
 
+  /* The blinded public key used to uniquely identify the descriptor that this
+   * directory connection identifier is for. Only used by the service-side code
+   * to fine control descriptor uploads. */
+  ed25519_public_key_t blinded_pk;
+
   /* XXX: Client authorization. */
 } hs_ident_dir_conn_t;
 
@@ -120,6 +125,9 @@ hs_ident_circuit_t *hs_ident_circuit_dup(const 
hs_ident_circuit_t *src);
 /* Directory connection identifier API. */
 hs_ident_dir_conn_t *hs_ident_dir_conn_dup(const hs_ident_dir_conn_t *src);
 void hs_ident_dir_conn_free(hs_ident_dir_conn_t *ident);
+void hs_ident_dir_conn_init(const ed25519_public_key_t *identity_pk,
+const ed25519_public_key_t *blinded_pk,
+hs_ident_dir_conn_t *ident);
 
 /* Edge connection identifier API. */
 hs_ident_edge_conn_t *hs_ident_edge_conn_new(
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index 5759aa812..d32a120bc 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -14,6 +14,7 @@
 #include "circuitlist.h"
 #include "circuituse.h"
 #include "config.h"
+#include "connection.h"
 #include "directory.h"
 #include "main.h"
 #include "networkstatus.h"
@@ -641,6 +642,41 @@ count_desc_circuit_established(const 
hs_service_descriptor_t *desc)
   return count;
 }
 
+/* For a given service and descriptor of that service, close all active
+ * directory connections. */
+static void
+close_directory_connections(const hs_service_t *service,
+const hs_service_descriptor_t *desc)
+{
+  unsigned int count = 0;
+  smartlist_t *dir_conns;
+
+  tor_assert(service);
+  tor_assert(desc);
+
+  /* Close pending HS desc upload connections for the blinded key of 'desc'. */
+  dir_conns = connection_list_by_type_purpose(CONN_TYPE_DIR,
+  DIR_PURPOSE_UPLOAD_HSDESC);
+  SMARTLIST_FOREACH_BEGIN(dir_conns, connection_t *, conn) {
+dir_connection_t *dir_conn = TO_DIR_CONN(conn);
+if (ed25519_pubkey_eq(&dir_conn->hs_ident->identity_pk,
+  &service->keys.identity_pk) &&
+ed25519_pubkey_eq(&dir_conn->hs_ident->blinded_pk,
+  &desc->blinded_

[tor-commits] [tor/master] Merge remote-tracking branch 'asn/bug23457_032_01'

2017-09-12 Thread nickm
commit 6c5c74e11e63f8e1a924ac8de4784edaf56179fa
Merge: 26d462c1f 7150214ba
Author: Nick Mathewson 
Date:   Tue Sep 12 11:10:48 2017 -0400

Merge remote-tracking branch 'asn/bug23457_032_01'

 src/or/hs_client.c  |  3 ++-
 src/or/hs_ident.c   | 16 
 src/or/hs_ident.h   |  8 
 src/or/hs_service.c | 47 ++-
 4 files changed, 72 insertions(+), 2 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 branch 'ticket21031'

2017-09-12 Thread nickm
commit 26d462c1f0d4dd7ebd7f3f24c49a26e62e279b93
Merge: 4027bd2e9 27fa4a98d
Author: Nick Mathewson 
Date:   Tue Sep 12 10:43:34 2017 -0400

Merge branch 'ticket21031'

 changes/ticket21031   |  5 +
 doc/tor.1.txt | 15 ---
 src/or/config.c   |  9 +
 src/or/connection_edge.c  |  2 +-
 src/or/or.h   |  2 +-
 src/or/relay.c|  6 +++---
 src/test/test_relaycell.c |  4 ++--
 7 files changed, 25 insertions(+), 18 deletions(-)

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


[tor-commits] [tor/master] Make ClientDNSRejectInternalAddresses testing-only.

2017-09-12 Thread nickm
commit 27fa4a98d23972213122fa99499efa4baebe49e3
Author: Nick Mathewson 
Date:   Thu Sep 7 10:03:31 2017 -0400

Make ClientDNSRejectInternalAddresses testing-only.

Undeprecate it;
rename it to TestingClientDNSRejectInternalAddresses;
add the old name as an alias;
reject configurations where it is set but TestingTorNetwork is not;
change the documentation accordingly.

Closes tickets 21031 and 21522.
---
 changes/ticket21031   |  5 +
 doc/tor.1.txt | 15 ---
 src/or/config.c   |  9 +
 src/or/connection_edge.c  |  2 +-
 src/or/or.h   |  2 +-
 src/or/relay.c|  6 +++---
 src/test/test_relaycell.c |  4 ++--
 7 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/changes/ticket21031 b/changes/ticket21031
new file mode 100644
index 0..79ad5267b
--- /dev/null
+++ b/changes/ticket21031
@@ -0,0 +1,5 @@
+  o Removed features:
+- The ClientDNSRejectInternalAddresses flag can no longer be set on
+  non-testing networks. It has been deprecated since 0.2.9.2-alpha.
+  Closes ticket 21031.
+
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index aec176705..ddc364bd6 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -1408,12 +1408,6 @@ The following options are useful only for clients (that 
is, if
 addresses/ports. See SocksPort for an explanation of isolation
 flags. (Default: 0)
 
-[[ClientDNSRejectInternalAddresses]] **ClientDNSRejectInternalAddresses** 
**0**|**1**::
-If true, Tor does not believe any anonymously retrieved DNS answer that
-tells it that an address resolves to an internal address (like 127.0.0.1 or
-192.168.0.1). This option prevents certain browser-based attacks; don't
-turn it off unless you know what you're doing. (Default: 1)
-
 [[ClientRejectInternalAddresses]] **ClientRejectInternalAddresses** 
**0**|**1**::
 If true, Tor does not try to fulfill requests to connect to an internal
 address (like 127.0.0.1 or 192.168.0.1) __unless a exit node is
@@ -2468,7 +2462,7 @@ The following options are used for running a testing Tor 
network.
   4 (for 40 seconds), 8, 16, 32, 60
ClientBootstrapConsensusMaxDownloadTries 80
ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries 80
-   ClientDNSRejectInternalAddresses 0
+   TestingClientDNSRejectInternalAddresses 0
ClientRejectInternalAddresses 0
CountPrivateBandwidth 1
ExitPolicyRejectPrivate 0
@@ -2670,6 +2664,13 @@ The following options are used for running a testing Tor 
network.
 we replace it and issue a new key?
 (Default: 3 hours for link and auth; 1 day for signing.)
 
+[[ClientDNSRejectInternalAddresses]] 
[[TestingClientDNSRejectInternalAddresses]] 
**TestingClientDNSRejectInternalAddresses** **0**|**1**::
+If true, Tor does not believe any anonymously retrieved DNS answer that
+tells it that an address resolves to an internal address (like 127.0.0.1 or
+192.168.0.1). This option prevents certain browser-based attacks; don't
+turn it off unless you know what you're doing. (Default: 1)
+
+
 NON-PERSISTENT OPTIONS
 --
 
diff --git a/src/or/config.c b/src/or/config.c
index eb89d6f5e..9d32019a3 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -169,6 +169,8 @@ static config_abbrev_t option_abbrevs_[] = {
   { "BridgeAuthoritativeDirectory", "BridgeAuthoritativeDir", 0, 0},
   { "HashedControlPassword", "__HashedControlSessionPassword", 1, 0},
   { "VirtualAddrNetwork", "VirtualAddrNetworkIPv4", 0, 0},
+  { "ClientDNSRejectInternalAddresses",
+"TestingClientDNSRejectInternalAddresses", 0, 1, },
   { NULL, NULL, 0, 0},
 };
 
@@ -251,7 +253,7 @@ static config_var_t option_vars_[] = {
   V(CircuitsAvailableTimeout,INTERVAL, "0"),
   V(CircuitStreamTimeout,INTERVAL, "0"),
   V(CircuitPriorityHalflife, DOUBLE,  "-100.0"), /*negative:'Use default'*/
-  V(ClientDNSRejectInternalAddresses, BOOL,"1"),
+  V(TestingClientDNSRejectInternalAddresses, BOOL,"1"),
   V(ClientOnly,  BOOL, "0"),
   V(ClientPreferIPv6ORPort,  AUTOBOOL, "auto"),
   V(ClientPreferIPv6DirPort, AUTOBOOL, "auto"),
@@ -626,7 +628,7 @@ static const config_var_t testing_tor_network_defaults[] = {
 "0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 16, 32, 60"),
   V(ClientBootstrapConsensusMaxDownloadTries, UINT, "80"),
   V(ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries, UINT, "80"),
-  V(ClientDNSRejectInternalAddresses, BOOL,"0"), // deprecated in 0.2.9.2-alpha
+  V(TestingClientDNSRejectInternalAddresses, BOOL,"0"),
   V(ClientRejectInternalAddresses, BOOL,   "0"),
   V(CountPrivateBandwidth,   BOOL, "1"),
   V(ExitPolicyRejectPrivate, BOOL, "0"),
@@ -673,8 +675,6 @@ static const config_deprecation_t 
option_deprecation_notes_[] = {
   /* Deprecated since 0.2.9.2-alpha... */
   { "AllowDotExit", "Unrestricted use of the .exit notation can be used for "
 "a wide varie

[tor-commits] [tor/master] Add a missing bridge download status reset

2017-09-12 Thread nickm
commit 1b5e34badb06bb1a844a6e70164fc5c894d95d0a
Author: teor 
Date:   Mon Sep 11 14:03:42 2017 +1000

Add a missing bridge download status reset

17750 made unused download schedules automatically reset.
But we should make that explicit.
---
 src/or/bridges.c   | 2 ++
 src/test/test_entrynodes.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/or/bridges.c b/src/or/bridges.c
index 257bb8920..461f86260 100644
--- a/src/or/bridges.c
+++ b/src/or/bridges.c
@@ -455,6 +455,8 @@ bridge_add_from_config(bridge_line_t *bridge_line)
   b->fetch_status.schedule = DL_SCHED_BRIDGE;
   b->fetch_status.backoff = DL_SCHED_RANDOM_EXPONENTIAL;
   b->fetch_status.increment_on = DL_SCHED_INCREMENT_ATTEMPT;
+  /* This will fail if UseBridges is not set */
+  download_status_reset(&b->fetch_status);
   b->socks_args = bridge_line->socks_args;
   if (!bridge_list)
 bridge_list = smartlist_new();
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index f30bb5ffa..d87670d82 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -917,6 +917,7 @@ test_entry_guard_node_filter(void *arg)
   routerset_parse(get_options_mutable()->ExcludeNodes, "144.144.0.0/16", "");
 
   /* 4: Bridge. */
+  get_options_mutable()->UseBridges = 1;
   sweep_bridge_list();
   bl = tor_malloc_zero(sizeof(bridge_line_t));
   tor_addr_from_ipv4h(&bl->addr, n[4]->rs->addr);
@@ -924,6 +925,7 @@ test_entry_guard_node_filter(void *arg)
   memcpy(bl->digest, n[4]->identity, 20);
   bridge_add_from_config(bl);
   bl = NULL; // prevent free.
+  get_options_mutable()->UseBridges = 0;
 
   /* 5: Unreachable. This stays in the filter, but isn't in usable-filtered */
   g[5]->last_tried_to_connect = approx_time(); // prevent retry.



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

2017-09-12 Thread nickm
commit 4027bd2e9680cb5922b006847aa4db6170826bf6
Merge: 8eef7fc84 1b5e34bad
Author: Nick Mathewson 
Date:   Tue Sep 12 10:38:35 2017 -0400

Merge branch 'bug23347_squashed'

 changes/bug23347   |  9 +
 doc/tor.1.txt  | 21 ++--
 src/or/bridges.c   | 22 -
 src/or/bridges.h   |  2 +-
 src/or/config.c| 16 ++--
 src/or/directory.c | 13 ++---
 src/or/or.h|  4 
 src/test/test_dir.c| 48 +-
 src/test/test_entrynodes.c |  2 ++
 src/test/test_options.c|  1 +
 10 files changed, 112 insertions(+), 26 deletions(-)

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


[tor-commits] [tor/master] Refactor bridge download statuses to increment on attempt

2017-09-12 Thread nickm
commit 6370fb77c586e9ad68c7d1ecb95be36137cb9067
Author: teor 
Date:   Tue Aug 29 15:25:33 2017 +1000

Refactor bridge download statuses to increment on attempt

We were always incrementing bridge download statuses on each attempt,
but we were using the "increment on failure" functions to do it.
And we never incremented them on failure.

No behaviour change.
---
 src/or/bridges.c | 22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/or/bridges.c b/src/or/bridges.c
index f2244004f..fc39ccaa9 100644
--- a/src/or/bridges.c
+++ b/src/or/bridges.c
@@ -454,6 +454,7 @@ bridge_add_from_config(bridge_line_t *bridge_line)
 b->transport_name = bridge_line->transport_name;
   b->fetch_status.schedule = DL_SCHED_BRIDGE;
   b->fetch_status.backoff = DL_SCHED_RANDOM_EXPONENTIAL;
+  b->fetch_status.increment_on = DL_SCHED_INCREMENT_ATTEMPT;
   b->socks_args = bridge_line->socks_args;
   if (!bridge_list)
 bridge_list = smartlist_new();
@@ -632,10 +633,13 @@ fetch_bridge_descriptors(const or_options_t *options, 
time_t now)
 continue;
   }
 
-  /* schedule another fetch as if this one will fail, in case it does
-   * (we can't increment after a failure, because sometimes we use the
-   * bridge authority, and sometimes we use the bridge direct) */
-  download_status_failed(&bridge->fetch_status, 0);
+  /* schedule the next attempt
+   * we can't increment after a failure, because sometimes we use the
+   * bridge authority, and sometimes we use the bridge direct */
+  download_status_increment_attempt(
+&bridge->fetch_status,
+safe_str_client(fmt_and_decorate_addr(&bridge->addr)),
+now);
 
   can_use_bridge_authority = !tor_digest_is_zero(bridge->identity) &&
  num_bridge_auths;
@@ -793,8 +797,14 @@ learned_bridge_descriptor(routerinfo_t *ri, int from_cache)
 download_status_reset(&bridge->fetch_status);
 /* We have two quick attempts in the bridge schedule, and then slow
  * ones */
-download_status_failed(&bridge->fetch_status, 0);
-download_status_failed(&bridge->fetch_status, 0);
+download_status_increment_attempt(
+&bridge->fetch_status,
+safe_str_client(fmt_and_decorate_addr(&bridge->addr)),
+now);
+download_status_increment_attempt(
+&bridge->fetch_status,
+safe_str_client(fmt_and_decorate_addr(&bridge->addr)),
+now);
   }
 
   node = node_get_mutable_by_id(ri->cache_info.identity_digest);



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


[tor-commits] [tor/master] Make clients wait to refresh bridges when they have a recent descriptor

2017-09-12 Thread nickm
commit 93a8ed3b83b5f20768562ca2aff4eba7aca667d8
Author: teor 
Date:   Mon Sep 11 13:56:35 2017 +1000

Make clients wait to refresh bridges when they have a recent descriptor

But when clients are just starting, make them try each bridge a few times
before giving up on it.

These changes make the bridge download schedules more explicit: before
17750, they relied on undocumented behaviour and specific schedule
entries. (And between 17750 and this fix, they were broken.)

Fixes 23347, not in any released version of tor.
---
 changes/bug23347| 15 +--
 doc/tor.1.txt   | 16 
 src/or/bridges.c| 17 +
 src/or/bridges.h|  2 +-
 src/or/config.c | 19 +--
 src/or/directory.c  |  9 -
 src/or/or.h |  4 
 src/test/test_dir.c | 48 +++-
 src/test/test_options.c |  1 +
 9 files changed, 92 insertions(+), 39 deletions(-)

diff --git a/changes/bug23347 b/changes/bug23347
index b0883784d..e73aa48f0 100644
--- a/changes/bug23347
+++ b/changes/bug23347
@@ -1,6 +1,9 @@
-  o Minor bug fixes (bridge client bootstrap):
-- Make bridge clients download bridge descriptors immediately.
-  The bridge schedules were never correct, but we didn't realise until
-  the fix for 17750 made bridge clients hang for 15 minutes before
-  bootstrapping.
-  Fixes bug 23347. Not in any released version of Tor.
+  o Minor fixes (bridge client bootstrap):
+- Make bridge clients with no running bridges try to download
+  bridge descriptors immediately. But when bridge clients have
+  running bridges, make them wait at least 3 hours before
+  refreshing recently received bridge descriptors.
+  Download schedules used to start with an implicit 0, but the
+  fix for 17750 changed this undocumented behaviour, and made
+  bridge clients hang for 15 minutes before bootstrapping.
+  Fixes bug 23347, not in any released version of Tor.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index e3939d115..d8dbcaa13 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -2475,7 +2475,8 @@ The following options are used for running a testing Tor 
network.
TestingClientDownloadSchedule 0, 0, 5, 10, 15, 20, 30, 60
TestingServerConsensusDownloadSchedule 0, 0, 5, 10, 15, 20, 30, 60
TestingClientConsensusDownloadSchedule 0, 0, 5, 10, 15, 20, 30, 60
-   TestingBridgeDownloadSchedule 0, 5, 10, 30, 60
+   TestingBridgeDownloadSchedule 10, 30, 60
+   TestingBridgeBootstrapDownloadSchedule 0, 0, 5, 10, 15, 20, 30, 60
TestingClientMaxIntervalWithoutRequest 5 seconds
TestingDirConnectionMaxStall 30 seconds
TestingConsensusMaxDownloadTries 80
@@ -2540,9 +2541,16 @@ The following options are used for running a testing Tor 
network.
 1800, 3600, 3600, 3600, 10800, 21600, 43200)
 
 [[TestingBridgeDownloadSchedule]] **TestingBridgeDownloadSchedule** 
__N__,__N__,__...__::
-Schedule for when clients should download bridge descriptors. Changing this
-requires that **TestingTorNetwork** is set. (Default: 0, 8, 3600, 10800,
-25200, 54000, 111600, 262800)
+Schedule for when clients should download each bridge descriptor when they
+know that one or more of their configured bridges are running. Changing
+this requires that **TestingTorNetwork** is set. (Default: 10800, 25200,
+54000, 111600, 262800)
+
+[[TestingBridgeBootstrapDownloadSchedule]] 
**TestingBridgeBootstrapDownloadSchedule** __N__,__N__,__...__::
+Schedule for when clients should download each bridge descriptor when they
+have just started, or when they can not contact any of their bridges.
+Changing this requires that **TestingTorNetwork** is set. (Default: 0, 30,
+90, 600, 3600, 10800, 25200, 54000, 111600, 262800)
 
 [[TestingClientMaxIntervalWithoutRequest]] 
**TestingClientMaxIntervalWithoutRequest** __N__ **seconds**|**minutes**::
 When directory clients have only a few descriptors to request, they batch
diff --git a/src/or/bridges.c b/src/or/bridges.c
index fc39ccaa9..257bb8920 100644
--- a/src/or/bridges.c
+++ b/src/or/bridges.c
@@ -794,17 +794,10 @@ learned_bridge_descriptor(routerinfo_t *ri, int 
from_cache)
   node_t *node;
   /* it's here; schedule its re-fetch for a long time from now. */
   if (!from_cache) {
+/* This schedules the re-fetch at a constant interval, which produces
+ * a pattern of bridge traffic. But it's better than trying all
+ * configured briges several times in the first few minutes. */
 download_status_reset(&bridge->fetch_status);
-/* We have two quick attempts in the bridge schedule, and then slow
- * ones */
-download_status_increment_attempt(
-&bridge->fetch_status,
-safe_str_client(fmt_and_decorate_addr(&bridge->add

[tor-commits] [tor/master] Make the download defaults in the tor manual match the code

2017-09-12 Thread nickm
commit 435952538da2d99e7ce46f510ac3f7dc3f910fca
Author: teor 
Date:   Tue Aug 29 13:48:30 2017 +1000

Make the download defaults in the tor manual match the code

Documentation fix on commit 667ba77, which was part of #20534.
---
 doc/tor.1.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 03af9c4be..9949f9dd0 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -1571,8 +1571,8 @@ The following options are useful only for clients (that 
is, if
 live consensus). Only used by clients fetching from a list of fallback
 directory mirrors. This schedule is advanced by (potentially concurrent)
 connection attempts, unlike other schedules, which are advanced by
-connection failures. (Default: 10, 11, 3600, 10800, 25200, 54000,
-111600, 262800)
+connection failures. (Default: 6, 11, 3600, 10800, 25200, 54000, 111600,
+262800)
 
 [[ClientBootstrapConsensusFallbackDownloadSchedule]] 
**ClientBootstrapConsensusFallbackDownloadSchedule** __N__,__N__,__...__::
 Schedule for when clients should download consensuses from fallback
@@ -1602,7 +1602,7 @@ The following options are useful only for clients (that 
is, if
 
 [[ClientBootstrapConsensusMaxInProgressTries]] 
**ClientBootstrapConsensusMaxInProgressTries** __NUM__::
 Try this many simultaneous connections to download a consensus before
-waiting for one to complete, timeout, or error out. (Default: 4)
+waiting for one to complete, timeout, or error out. (Default: 3)
 
 SERVER OPTIONS
 --
@@ -2541,7 +2541,7 @@ The following options are used for running a testing Tor 
network.
 
 [[TestingBridgeDownloadSchedule]] **TestingBridgeDownloadSchedule** 
__N__,__N__,__...__::
 Schedule for when clients should download bridge descriptors. Changing this
-requires that **TestingTorNetwork** is set. (Default: 3600, 900, 900, 3600)
+requires that **TestingTorNetwork** is set. (Default: 1200, 900, 900, 3600)
 
 [[TestingClientMaxIntervalWithoutRequest]] 
**TestingClientMaxIntervalWithoutRequest** __N__ **seconds**|**minutes**::
 When directory clients have only a few descriptors to request, they batch



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


[tor-commits] [tor/master] Make bridge clients download bridge descriptors immediately

2017-09-12 Thread nickm
commit 97249c4f5e389141cb4ff3562a3813bd09bff6ad
Author: teor 
Date:   Tue Aug 29 14:04:24 2017 +1000

Make bridge clients download bridge descriptors immediately

The download schedule tells Tor to wait 15 minutes before downloading
bridge descriptors. But 17750 made Tor ignore that and start immediately.
Since we fixed 17750, Tor waits 15 minutes for bridge client bootstrap,
like the schedule says.

This fixes the download schedule to start immediately, and to try each
bridge 3 times in the first 30 seconds. This should make bridge bootstraps
more reliable.

Fixes 23347.
---
 changes/bug23347   |  6 ++
 doc/tor.1.txt  |  5 +++--
 src/or/bridges.c   | 11 +--
 src/or/config.c|  9 +++--
 src/or/directory.c |  4 ++--
 5 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/changes/bug23347 b/changes/bug23347
new file mode 100644
index 0..b0883784d
--- /dev/null
+++ b/changes/bug23347
@@ -0,0 +1,6 @@
+  o Minor bug fixes (bridge client bootstrap):
+- Make bridge clients download bridge descriptors immediately.
+  The bridge schedules were never correct, but we didn't realise until
+  the fix for 17750 made bridge clients hang for 15 minutes before
+  bootstrapping.
+  Fixes bug 23347. Not in any released version of Tor.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 9949f9dd0..e3939d115 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -2475,7 +2475,7 @@ The following options are used for running a testing Tor 
network.
TestingClientDownloadSchedule 0, 0, 5, 10, 15, 20, 30, 60
TestingServerConsensusDownloadSchedule 0, 0, 5, 10, 15, 20, 30, 60
TestingClientConsensusDownloadSchedule 0, 0, 5, 10, 15, 20, 30, 60
-   TestingBridgeDownloadSchedule 60, 30, 30, 60
+   TestingBridgeDownloadSchedule 0, 5, 10, 30, 60
TestingClientMaxIntervalWithoutRequest 5 seconds
TestingDirConnectionMaxStall 30 seconds
TestingConsensusMaxDownloadTries 80
@@ -2541,7 +2541,8 @@ The following options are used for running a testing Tor 
network.
 
 [[TestingBridgeDownloadSchedule]] **TestingBridgeDownloadSchedule** 
__N__,__N__,__...__::
 Schedule for when clients should download bridge descriptors. Changing this
-requires that **TestingTorNetwork** is set. (Default: 1200, 900, 900, 3600)
+requires that **TestingTorNetwork** is set. (Default: 0, 8, 3600, 10800,
+25200, 54000, 111600, 262800)
 
 [[TestingClientMaxIntervalWithoutRequest]] 
**TestingClientMaxIntervalWithoutRequest** __N__ **seconds**|**minutes**::
 When directory clients have only a few descriptors to request, they batch
diff --git a/src/or/bridges.c b/src/or/bridges.c
index 0818fb081..f2244004f 100644
--- a/src/or/bridges.c
+++ b/src/or/bridges.c
@@ -632,7 +632,9 @@ fetch_bridge_descriptors(const or_options_t *options, 
time_t now)
 continue;
   }
 
-  /* schedule another fetch as if this one will fail, in case it does */
+  /* schedule another fetch as if this one will fail, in case it does
+   * (we can't increment after a failure, because sometimes we use the
+   * bridge authority, and sometimes we use the bridge direct) */
   download_status_failed(&bridge->fetch_status, 0);
 
   can_use_bridge_authority = !tor_digest_is_zero(bridge->identity) &&
@@ -787,8 +789,13 @@ learned_bridge_descriptor(routerinfo_t *ri, int from_cache)
 if (bridge) { /* if we actually want to use this one */
   node_t *node;
   /* it's here; schedule its re-fetch for a long time from now. */
-  if (!from_cache)
+  if (!from_cache) {
 download_status_reset(&bridge->fetch_status);
+/* We have two quick attempts in the bridge schedule, and then slow
+ * ones */
+download_status_failed(&bridge->fetch_status, 0);
+download_status_failed(&bridge->fetch_status, 0);
+  }
 
   node = node_get_mutable_by_id(ri->cache_info.identity_digest);
   tor_assert(node);
diff --git a/src/or/config.c b/src/or/config.c
index 30853724e..54df6c3e5 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -586,7 +586,10 @@ static config_var_t option_vars_[] = {
* blackholed. Clients will try 3 directories simultaneously.
* (Relays never use simultaneous connections.) */
   V(ClientBootstrapConsensusMaxInProgressTries, UINT, "3"),
-  V(TestingBridgeDownloadSchedule, CSV_INTERVAL, "1200, 900, 900, 3600"),
+  /* The bridge code relies on the third item in this schedule being slow
+   * (~ 1 consensus interval) */
+  V(TestingBridgeDownloadSchedule, CSV_INTERVAL,
+"0, 8, 3600, 10800, 25200, 54000, 111600, 262800"),
   V(TestingClientMaxIntervalWithoutRequest, INTERVAL, "10 minutes"),
   V(TestingDirConnectionMaxStall, INTERVAL, "5 minutes"),
   V(TestingConsensusMaxDownloadTries, UINT, "8"),
@@ -648,7 +651,9 @@ static const config_var_t testing_tor_network_defaults[] = {
  "15, 20, 30, 60"),
   V(T

[tor-commits] [tor-messenger-build/master] Add num_procs option to rbm.conf

2017-09-12 Thread sukhbir
commit df4a993027b81b49c5576f85faac071dac9bf158
Author: Sukhbir Singh 
Date:   Tue Sep 12 10:34:03 2017 -0400

Add num_procs option to rbm.conf

Changes borrowed from tor-browser-build/rbm.conf
---
 rbm.conf | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/rbm.conf b/rbm.conf
index 19a0c4d..fbcb49e 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -6,6 +6,12 @@ build_log: '[% GET ENV.RBM_LOGS_DIR ? ENV.RBM_LOGS_DIR : 
"logs" %]/[% project %]
 
 pkg_type: build
 
+# buildconf contains build options that the user can change in rbm.local.conf
+# When adding a new option to buildconf, a default value should be defined
+# in var/build_id, so that changing this option does not affect the build_id.
+buildconf:
+  num_procs: '[% GET ENV.RBM_NUM_PROCS ? ENV.RBM_NUM_PROCS : "8" %]'
+
 var:
   tormessenger_version: '0.5.0b1'
   copyright_year: '2017'
@@ -17,7 +23,7 @@ var:
   # in the same order. In the cases where the installation order is
   # important, sort_deps should be set to 0.
   sort_deps: 1
-  build_id: '[% sha256(c("var/build_id_txt")).substr(0, 6) %]'
+  build_id: '[% sha256(c("var/build_id_txt", { buildconf => { num_procs => 8 } 
})).substr(0, 6) %]'
   build_id_txt: |
 [% c("version") %]
 [% IF c("git_hash") || c("hg_hash"); GET c("abbrev"); END; %]

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


[tor-commits] [tor/master] Changes file for #17857.

2017-09-12 Thread nickm
commit 6689c95d061d440ca16369583dac066cc35a6807
Author: Mike Perry 
Date:   Fri Jun 23 18:44:00 2017 -0400

Changes file for #17857.
---
 changes/bug17857 | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/changes/bug17857 b/changes/bug17857
new file mode 100644
index 0..6c8863823
--- /dev/null
+++ b/changes/bug17857
@@ -0,0 +1,6 @@
+  o Minor features (defensive programming):
+- Create a pair of consensus parameters nf_pad_tor2web and
+  nf_pad_single_onion that allow us to disable netflow padding in the
+  consensus for non-anonymous connections, in case the overhead is high.
+  Closes #17857.
+



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


[tor-commits] [tor/release-0.3.1] Ticket #17857: Padding off-switch for single hop connections

2017-09-12 Thread nickm
commit 79e2e4d3cbabff41675aa1f7defb67f4acba398c
Author: Mike Perry 
Date:   Fri Jun 23 16:53:39 2017 -0400

Ticket #17857: Padding off-switch for single hop connections

This doesn't apply to currently active connections.. yet...
---
 src/or/channel.c   |   7 +-
 src/or/channelpadding.c|  16 
 src/test/test_channelpadding.c | 164 -
 3 files changed, 166 insertions(+), 21 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index df6d7d342..8348ffd64 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -65,6 +65,7 @@
 #include "routerlist.h"
 #include "scheduler.h"
 #include "compat_time.h"
+#include "networkstatus.h"
 
 /* Global lists of channels */
 
@@ -2711,7 +2712,11 @@ channel_do_open_actions(channel_t *chan)
 
   /* Disable or reduce padding according to user prefs. */
   if (chan->padding_enabled || get_options()->ConnectionPadding == 1) {
-if (!get_options()->ConnectionPadding) {
+if (!get_options()->ConnectionPadding ||
+(get_options()->Tor2webMode &&
+ !networkstatus_get_param(NULL, "nf_pad_tor2web", 1, 0, 1))
+|| (get_options()->HiddenServiceSingleHopMode &&
+!networkstatus_get_param(NULL, "nf_pad_single_onion", 1, 0, 1))) {
   channelpadding_disable_padding_on_channel(chan);
 }
 
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index f5248e896..9a2fdc4bb 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -46,6 +46,10 @@ static int consensus_nf_conntimeout_clients;
 static int consensus_nf_pad_before_usage;
 /** Should we pad relay-to-relay connections? */
 static int consensus_nf_pad_relays;
+/** Should we pad tor2web connections? */
+static int consensus_nf_pad_tor2web;
+/** Should we pad rosos connections? */
+static int consensus_nf_pad_single_onion;
 
 #define TOR_MSEC_PER_SEC 1000
 #define TOR_USEC_PER_MSEC 1000
@@ -130,6 +134,12 @@ channelpadding_new_consensus_params(networkstatus_t *ns)
 
   consensus_nf_pad_relays =
 networkstatus_get_param(ns, "nf_pad_relays", 0, 0, 1);
+
+  consensus_nf_pad_tor2web =
+networkstatus_get_param(ns, "nf_pad_tor2web", 1, 0, 1);
+
+  consensus_nf_pad_single_onion =
+networkstatus_get_param(ns, "nf_pad_single_onion", 1, 0, 1);
 }
 
 /**
@@ -707,6 +717,12 @@ channelpadding_decide_to_pad_channel(channel_t *chan)
 return CHANNELPADDING_WONTPAD;
   }
 
+  if (options->Tor2webMode && !consensus_nf_pad_tor2web)
+return CHANNELPADDING_WONTPAD;
+
+  if (options->HiddenServiceSingleHopMode && !consensus_nf_pad_single_onion)
+return CHANNELPADDING_WONTPAD;
+
   if (!chan->has_queued_writes(chan)) {
 int is_client_channel = 0;
 
diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
index 0a70184f8..99f8880a4 100644
--- a/src/test/test_channelpadding.c
+++ b/src/test/test_channelpadding.c
@@ -26,6 +26,7 @@ void test_channelpadding_timers(void *arg);
 void test_channelpadding_consensus(void *arg);
 void test_channelpadding_negotiation(void *arg);
 void test_channelpadding_decide_to_pad_channel(void *arg);
+void test_channelpadding_killonehop(void *arg);
 
 void dummy_nop_timer(void);
 
@@ -111,8 +112,6 @@ setup_fake_connection_for_channel(channel_tls_t *chan)
   conn->base_.conn_array_index = smartlist_len(connection_array);
   smartlist_add(connection_array, conn);
 
-  connection_or_set_canonical(conn, 1);
-
   conn->chan = chan;
   chan->conn = conn;
 
@@ -127,6 +126,8 @@ setup_fake_connection_for_channel(channel_tls_t *chan)
   conn->tls = (tor_tls_t *)((void *)(&fake_tortls));
 
   conn->link_proto = MIN_LINK_PROTO_FOR_CHANNEL_PADDING;
+
+  connection_or_set_canonical(conn, 1);
 }
 
 static channel_tls_t *
@@ -166,16 +167,30 @@ free_fake_channeltls(channel_tls_t *chan)
 }
 
 static void
-setup_mock_network(void)
+setup_mock_consensus(void)
 {
-  routerstatus_t *relay;
-  connection_array = smartlist_new();
-
   current_md_consensus = current_ns_consensus
 = tor_malloc_zero(sizeof(networkstatus_t));
   current_md_consensus->net_params = smartlist_new();
   current_md_consensus->routerstatus_list = smartlist_new();
   channelpadding_new_consensus_params(current_md_consensus);
+}
+
+static void
+free_mock_consensus(void)
+{
+  SMARTLIST_FOREACH(current_md_consensus->routerstatus_list, void *, r,
+tor_free(r));
+  smartlist_free(current_md_consensus->routerstatus_list);
+  smartlist_free(current_ns_consensus->net_params);
+  tor_free(current_ns_consensus);
+}
+
+static void
+setup_mock_network(void)
+{
+  routerstatus_t *relay;
+  connection_array = smartlist_new();
 
   relay1_relay2 = (channel_t*)new_fake_channeltls(2);
   relay1_relay2->write_cell = mock_channel_write_cell_relay1;
@@ -202,6 +217,11 @@ setup_mock_network(void)
   client_relay3 = (channel_t*)new_fake_channeltls(3);
   client_relay3->write_cell = mock_channel_write_cell_client;
   channel_timestamp_active(client_relay3);
+
+  channel_do_open_actions(rela

[tor-commits] [tor/release-0.3.1] Changes file for #17857.

2017-09-12 Thread nickm
commit 6689c95d061d440ca16369583dac066cc35a6807
Author: Mike Perry 
Date:   Fri Jun 23 18:44:00 2017 -0400

Changes file for #17857.
---
 changes/bug17857 | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/changes/bug17857 b/changes/bug17857
new file mode 100644
index 0..6c8863823
--- /dev/null
+++ b/changes/bug17857
@@ -0,0 +1,6 @@
+  o Minor features (defensive programming):
+- Create a pair of consensus parameters nf_pad_tor2web and
+  nf_pad_single_onion that allow us to disable netflow padding in the
+  consensus for non-anonymous connections, in case the overhead is high.
+  Closes #17857.
+



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


[tor-commits] [tor/master] Ticket #17857: Padding off-switch for single hop connections

2017-09-12 Thread nickm
commit 79e2e4d3cbabff41675aa1f7defb67f4acba398c
Author: Mike Perry 
Date:   Fri Jun 23 16:53:39 2017 -0400

Ticket #17857: Padding off-switch for single hop connections

This doesn't apply to currently active connections.. yet...
---
 src/or/channel.c   |   7 +-
 src/or/channelpadding.c|  16 
 src/test/test_channelpadding.c | 164 -
 3 files changed, 166 insertions(+), 21 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index df6d7d342..8348ffd64 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -65,6 +65,7 @@
 #include "routerlist.h"
 #include "scheduler.h"
 #include "compat_time.h"
+#include "networkstatus.h"
 
 /* Global lists of channels */
 
@@ -2711,7 +2712,11 @@ channel_do_open_actions(channel_t *chan)
 
   /* Disable or reduce padding according to user prefs. */
   if (chan->padding_enabled || get_options()->ConnectionPadding == 1) {
-if (!get_options()->ConnectionPadding) {
+if (!get_options()->ConnectionPadding ||
+(get_options()->Tor2webMode &&
+ !networkstatus_get_param(NULL, "nf_pad_tor2web", 1, 0, 1))
+|| (get_options()->HiddenServiceSingleHopMode &&
+!networkstatus_get_param(NULL, "nf_pad_single_onion", 1, 0, 1))) {
   channelpadding_disable_padding_on_channel(chan);
 }
 
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index f5248e896..9a2fdc4bb 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -46,6 +46,10 @@ static int consensus_nf_conntimeout_clients;
 static int consensus_nf_pad_before_usage;
 /** Should we pad relay-to-relay connections? */
 static int consensus_nf_pad_relays;
+/** Should we pad tor2web connections? */
+static int consensus_nf_pad_tor2web;
+/** Should we pad rosos connections? */
+static int consensus_nf_pad_single_onion;
 
 #define TOR_MSEC_PER_SEC 1000
 #define TOR_USEC_PER_MSEC 1000
@@ -130,6 +134,12 @@ channelpadding_new_consensus_params(networkstatus_t *ns)
 
   consensus_nf_pad_relays =
 networkstatus_get_param(ns, "nf_pad_relays", 0, 0, 1);
+
+  consensus_nf_pad_tor2web =
+networkstatus_get_param(ns, "nf_pad_tor2web", 1, 0, 1);
+
+  consensus_nf_pad_single_onion =
+networkstatus_get_param(ns, "nf_pad_single_onion", 1, 0, 1);
 }
 
 /**
@@ -707,6 +717,12 @@ channelpadding_decide_to_pad_channel(channel_t *chan)
 return CHANNELPADDING_WONTPAD;
   }
 
+  if (options->Tor2webMode && !consensus_nf_pad_tor2web)
+return CHANNELPADDING_WONTPAD;
+
+  if (options->HiddenServiceSingleHopMode && !consensus_nf_pad_single_onion)
+return CHANNELPADDING_WONTPAD;
+
   if (!chan->has_queued_writes(chan)) {
 int is_client_channel = 0;
 
diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
index 0a70184f8..99f8880a4 100644
--- a/src/test/test_channelpadding.c
+++ b/src/test/test_channelpadding.c
@@ -26,6 +26,7 @@ void test_channelpadding_timers(void *arg);
 void test_channelpadding_consensus(void *arg);
 void test_channelpadding_negotiation(void *arg);
 void test_channelpadding_decide_to_pad_channel(void *arg);
+void test_channelpadding_killonehop(void *arg);
 
 void dummy_nop_timer(void);
 
@@ -111,8 +112,6 @@ setup_fake_connection_for_channel(channel_tls_t *chan)
   conn->base_.conn_array_index = smartlist_len(connection_array);
   smartlist_add(connection_array, conn);
 
-  connection_or_set_canonical(conn, 1);
-
   conn->chan = chan;
   chan->conn = conn;
 
@@ -127,6 +126,8 @@ setup_fake_connection_for_channel(channel_tls_t *chan)
   conn->tls = (tor_tls_t *)((void *)(&fake_tortls));
 
   conn->link_proto = MIN_LINK_PROTO_FOR_CHANNEL_PADDING;
+
+  connection_or_set_canonical(conn, 1);
 }
 
 static channel_tls_t *
@@ -166,16 +167,30 @@ free_fake_channeltls(channel_tls_t *chan)
 }
 
 static void
-setup_mock_network(void)
+setup_mock_consensus(void)
 {
-  routerstatus_t *relay;
-  connection_array = smartlist_new();
-
   current_md_consensus = current_ns_consensus
 = tor_malloc_zero(sizeof(networkstatus_t));
   current_md_consensus->net_params = smartlist_new();
   current_md_consensus->routerstatus_list = smartlist_new();
   channelpadding_new_consensus_params(current_md_consensus);
+}
+
+static void
+free_mock_consensus(void)
+{
+  SMARTLIST_FOREACH(current_md_consensus->routerstatus_list, void *, r,
+tor_free(r));
+  smartlist_free(current_md_consensus->routerstatus_list);
+  smartlist_free(current_ns_consensus->net_params);
+  tor_free(current_ns_consensus);
+}
+
+static void
+setup_mock_network(void)
+{
+  routerstatus_t *relay;
+  connection_array = smartlist_new();
 
   relay1_relay2 = (channel_t*)new_fake_channeltls(2);
   relay1_relay2->write_cell = mock_channel_write_cell_relay1;
@@ -202,6 +217,11 @@ setup_mock_network(void)
   client_relay3 = (channel_t*)new_fake_channeltls(3);
   client_relay3->write_cell = mock_channel_write_cell_client;
   channel_timestamp_active(client_relay3);
+
+  channel_do_open_actions(rela

[tor-commits] [tor/release-0.3.1] Ticket #17857: Apply padding off-switch to existing connections.

2017-09-12 Thread nickm
commit 6d221c8f371a0c1809552b699f1afab8cde3bd31
Author: Mike Perry 
Date:   Fri Jun 23 18:34:41 2017 -0400

Ticket #17857: Apply padding off-switch to existing connections.
---
 src/or/channel.c   | 30 ---
 src/or/channelpadding.c| 26 ++---
 src/or/channelpadding.h|  5 
 src/test/test_channelpadding.c | 65 +-
 4 files changed, 98 insertions(+), 28 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 8348ffd64..17b2191b7 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -66,6 +66,7 @@
 #include "scheduler.h"
 #include "compat_time.h"
 #include "networkstatus.h"
+#include "rendservice.h"
 
 /* Global lists of channels */
 
@@ -2712,17 +2713,26 @@ channel_do_open_actions(channel_t *chan)
 
   /* Disable or reduce padding according to user prefs. */
   if (chan->padding_enabled || get_options()->ConnectionPadding == 1) {
-if (!get_options()->ConnectionPadding ||
-(get_options()->Tor2webMode &&
- !networkstatus_get_param(NULL, "nf_pad_tor2web", 1, 0, 1))
-|| (get_options()->HiddenServiceSingleHopMode &&
-!networkstatus_get_param(NULL, "nf_pad_single_onion", 1, 0, 1))) {
+if (!get_options()->ConnectionPadding) {
+  /* Disable if torrc disabled */
   channelpadding_disable_padding_on_channel(chan);
-}
-
-/* Padding can be forced and/or reduced by clients, regardless of if
- * the channel supports it */
-if (get_options()->ReducedConnectionPadding) {
+} else if (get_options()->Tor2webMode &&
+!networkstatus_get_param(NULL,
+ CHANNELPADDING_TOR2WEB_PARAM,
+ CHANNELPADDING_TOR2WEB_DEFAULT, 0, 1)) {
+  /* Disable if we're using tor2web and the consensus disabled padding
+   * for tor2web */
+  channelpadding_disable_padding_on_channel(chan);
+} else if (rend_service_allow_non_anonymous_connection(get_options()) &&
+   !networkstatus_get_param(NULL,
+CHANNELPADDING_SOS_PARAM,
+CHANNELPADDING_SOS_DEFAULT, 0, 1)) {
+  /* Disable if we're using RSOS and the consensus disabled padding
+   * for RSOS*/
+  channelpadding_disable_padding_on_channel(chan);
+} else if (get_options()->ReducedConnectionPadding) {
+  /* Padding can be forced and/or reduced by clients, regardless of if
+   * the channel supports it */
   channelpadding_reduce_padding_on_channel(chan);
 }
   }
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index 9a2fdc4bb..ee6d29f7c 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -21,6 +21,7 @@
 #include "router.h"
 #include "compat_time.h"
 #include 
+#include "rendservice.h"
 
 STATIC int channelpadding_get_netflow_inactive_timeout_ms(const channel_t *);
 STATIC int channelpadding_send_disable_command(channel_t *);
@@ -136,10 +137,14 @@ channelpadding_new_consensus_params(networkstatus_t *ns)
 networkstatus_get_param(ns, "nf_pad_relays", 0, 0, 1);
 
   consensus_nf_pad_tor2web =
-networkstatus_get_param(ns, "nf_pad_tor2web", 1, 0, 1);
+networkstatus_get_param(ns,
+CHANNELPADDING_TOR2WEB_PARAM,
+CHANNELPADDING_TOR2WEB_DEFAULT, 0, 1);
 
   consensus_nf_pad_single_onion =
-networkstatus_get_param(ns, "nf_pad_single_onion", 1, 0, 1);
+networkstatus_get_param(ns,
+CHANNELPADDING_SOS_PARAM,
+CHANNELPADDING_SOS_DEFAULT, 0, 1);
 }
 
 /**
@@ -717,11 +722,24 @@ channelpadding_decide_to_pad_channel(channel_t *chan)
 return CHANNELPADDING_WONTPAD;
   }
 
-  if (options->Tor2webMode && !consensus_nf_pad_tor2web)
+  if (options->Tor2webMode && !consensus_nf_pad_tor2web) {
+/* If the consensus just changed values, this channel may still
+ * think padding is enabled. Negotiate it off. */
+if (chan->padding_enabled)
+  channelpadding_disable_padding_on_channel(chan);
+
 return CHANNELPADDING_WONTPAD;
+  }
+
+  if (rend_service_allow_non_anonymous_connection(options) &&
+  !consensus_nf_pad_single_onion) {
+/* If the consensus just changed values, this channel may still
+ * think padding is enabled. Negotiate it off. */
+if (chan->padding_enabled)
+  channelpadding_disable_padding_on_channel(chan);
 
-  if (options->HiddenServiceSingleHopMode && !consensus_nf_pad_single_onion)
 return CHANNELPADDING_WONTPAD;
+  }
 
   if (!chan->has_queued_writes(chan)) {
 int is_client_channel = 0;
diff --git a/src/or/channelpadding.h b/src/or/channelpadding.h
index 2708ee973..a227e27d5 100644
--- a/src/or/channelpadding.h
+++ b/src/or/channelpadding.h
@@ -13,6 +13,11 @@
 
 #include "channelpadding_negotiation.h"
 
+#define CHANNELPADDING_TOR2WEB_PARAM  "nf_pad_tor2web"
+#define CHANNELPADDING_TOR2WEB_DEFAULT 1
+#d

[tor-commits] [tor/maint-0.3.1] Merge branch 'ticket17857_squashed' into maint-0.3.1

2017-09-12 Thread nickm
commit befddf6d2a46cd25beeb46357bf6cc4fe21802ce
Merge: 469189d84 6689c95d0
Author: Nick Mathewson 
Date:   Tue Sep 12 10:29:00 2017 -0400

Merge branch 'ticket17857_squashed' into maint-0.3.1

 changes/bug17857   |   6 ++
 src/or/channel.c   |  25 -
 src/or/channelpadding.c|  34 +++
 src/or/channelpadding.h|   5 +
 src/test/test_channelpadding.c | 201 +
 5 files changed, 246 insertions(+), 25 deletions(-)

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


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

2017-09-12 Thread nickm
commit befddf6d2a46cd25beeb46357bf6cc4fe21802ce
Merge: 469189d84 6689c95d0
Author: Nick Mathewson 
Date:   Tue Sep 12 10:29:00 2017 -0400

Merge branch 'ticket17857_squashed' into maint-0.3.1

 changes/bug17857   |   6 ++
 src/or/channel.c   |  25 -
 src/or/channelpadding.c|  34 +++
 src/or/channelpadding.h|   5 +
 src/test/test_channelpadding.c | 201 +
 5 files changed, 246 insertions(+), 25 deletions(-)




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


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

2017-09-12 Thread nickm
commit 3747807333093a88c8ae0f6b7a754b803430da63
Merge: 931b2dbae befddf6d2
Author: Nick Mathewson 
Date:   Tue Sep 12 10:30:54 2017 -0400

Merge branch 'maint-0.3.1' into release-0.3.1

 changes/bug17857   |   6 ++
 src/or/channel.c   |  25 -
 src/or/channelpadding.c|  34 +++
 src/or/channelpadding.h|   5 +
 src/test/test_channelpadding.c | 201 +
 5 files changed, 246 insertions(+), 25 deletions(-)

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


[tor-commits] [tor/master] Ticket #17857: Apply padding off-switch to existing connections.

2017-09-12 Thread nickm
commit 6d221c8f371a0c1809552b699f1afab8cde3bd31
Author: Mike Perry 
Date:   Fri Jun 23 18:34:41 2017 -0400

Ticket #17857: Apply padding off-switch to existing connections.
---
 src/or/channel.c   | 30 ---
 src/or/channelpadding.c| 26 ++---
 src/or/channelpadding.h|  5 
 src/test/test_channelpadding.c | 65 +-
 4 files changed, 98 insertions(+), 28 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 8348ffd64..17b2191b7 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -66,6 +66,7 @@
 #include "scheduler.h"
 #include "compat_time.h"
 #include "networkstatus.h"
+#include "rendservice.h"
 
 /* Global lists of channels */
 
@@ -2712,17 +2713,26 @@ channel_do_open_actions(channel_t *chan)
 
   /* Disable or reduce padding according to user prefs. */
   if (chan->padding_enabled || get_options()->ConnectionPadding == 1) {
-if (!get_options()->ConnectionPadding ||
-(get_options()->Tor2webMode &&
- !networkstatus_get_param(NULL, "nf_pad_tor2web", 1, 0, 1))
-|| (get_options()->HiddenServiceSingleHopMode &&
-!networkstatus_get_param(NULL, "nf_pad_single_onion", 1, 0, 1))) {
+if (!get_options()->ConnectionPadding) {
+  /* Disable if torrc disabled */
   channelpadding_disable_padding_on_channel(chan);
-}
-
-/* Padding can be forced and/or reduced by clients, regardless of if
- * the channel supports it */
-if (get_options()->ReducedConnectionPadding) {
+} else if (get_options()->Tor2webMode &&
+!networkstatus_get_param(NULL,
+ CHANNELPADDING_TOR2WEB_PARAM,
+ CHANNELPADDING_TOR2WEB_DEFAULT, 0, 1)) {
+  /* Disable if we're using tor2web and the consensus disabled padding
+   * for tor2web */
+  channelpadding_disable_padding_on_channel(chan);
+} else if (rend_service_allow_non_anonymous_connection(get_options()) &&
+   !networkstatus_get_param(NULL,
+CHANNELPADDING_SOS_PARAM,
+CHANNELPADDING_SOS_DEFAULT, 0, 1)) {
+  /* Disable if we're using RSOS and the consensus disabled padding
+   * for RSOS*/
+  channelpadding_disable_padding_on_channel(chan);
+} else if (get_options()->ReducedConnectionPadding) {
+  /* Padding can be forced and/or reduced by clients, regardless of if
+   * the channel supports it */
   channelpadding_reduce_padding_on_channel(chan);
 }
   }
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index 9a2fdc4bb..ee6d29f7c 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -21,6 +21,7 @@
 #include "router.h"
 #include "compat_time.h"
 #include 
+#include "rendservice.h"
 
 STATIC int channelpadding_get_netflow_inactive_timeout_ms(const channel_t *);
 STATIC int channelpadding_send_disable_command(channel_t *);
@@ -136,10 +137,14 @@ channelpadding_new_consensus_params(networkstatus_t *ns)
 networkstatus_get_param(ns, "nf_pad_relays", 0, 0, 1);
 
   consensus_nf_pad_tor2web =
-networkstatus_get_param(ns, "nf_pad_tor2web", 1, 0, 1);
+networkstatus_get_param(ns,
+CHANNELPADDING_TOR2WEB_PARAM,
+CHANNELPADDING_TOR2WEB_DEFAULT, 0, 1);
 
   consensus_nf_pad_single_onion =
-networkstatus_get_param(ns, "nf_pad_single_onion", 1, 0, 1);
+networkstatus_get_param(ns,
+CHANNELPADDING_SOS_PARAM,
+CHANNELPADDING_SOS_DEFAULT, 0, 1);
 }
 
 /**
@@ -717,11 +722,24 @@ channelpadding_decide_to_pad_channel(channel_t *chan)
 return CHANNELPADDING_WONTPAD;
   }
 
-  if (options->Tor2webMode && !consensus_nf_pad_tor2web)
+  if (options->Tor2webMode && !consensus_nf_pad_tor2web) {
+/* If the consensus just changed values, this channel may still
+ * think padding is enabled. Negotiate it off. */
+if (chan->padding_enabled)
+  channelpadding_disable_padding_on_channel(chan);
+
 return CHANNELPADDING_WONTPAD;
+  }
+
+  if (rend_service_allow_non_anonymous_connection(options) &&
+  !consensus_nf_pad_single_onion) {
+/* If the consensus just changed values, this channel may still
+ * think padding is enabled. Negotiate it off. */
+if (chan->padding_enabled)
+  channelpadding_disable_padding_on_channel(chan);
 
-  if (options->HiddenServiceSingleHopMode && !consensus_nf_pad_single_onion)
 return CHANNELPADDING_WONTPAD;
+  }
 
   if (!chan->has_queued_writes(chan)) {
 int is_client_channel = 0;
diff --git a/src/or/channelpadding.h b/src/or/channelpadding.h
index 2708ee973..a227e27d5 100644
--- a/src/or/channelpadding.h
+++ b/src/or/channelpadding.h
@@ -13,6 +13,11 @@
 
 #include "channelpadding_negotiation.h"
 
+#define CHANNELPADDING_TOR2WEB_PARAM  "nf_pad_tor2web"
+#define CHANNELPADDING_TOR2WEB_DEFAULT 1
+#d

[tor-commits] [tor/maint-0.3.1] Ticket #17857: Apply padding off-switch to existing connections.

2017-09-12 Thread nickm
commit 6d221c8f371a0c1809552b699f1afab8cde3bd31
Author: Mike Perry 
Date:   Fri Jun 23 18:34:41 2017 -0400

Ticket #17857: Apply padding off-switch to existing connections.
---
 src/or/channel.c   | 30 ---
 src/or/channelpadding.c| 26 ++---
 src/or/channelpadding.h|  5 
 src/test/test_channelpadding.c | 65 +-
 4 files changed, 98 insertions(+), 28 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index 8348ffd64..17b2191b7 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -66,6 +66,7 @@
 #include "scheduler.h"
 #include "compat_time.h"
 #include "networkstatus.h"
+#include "rendservice.h"
 
 /* Global lists of channels */
 
@@ -2712,17 +2713,26 @@ channel_do_open_actions(channel_t *chan)
 
   /* Disable or reduce padding according to user prefs. */
   if (chan->padding_enabled || get_options()->ConnectionPadding == 1) {
-if (!get_options()->ConnectionPadding ||
-(get_options()->Tor2webMode &&
- !networkstatus_get_param(NULL, "nf_pad_tor2web", 1, 0, 1))
-|| (get_options()->HiddenServiceSingleHopMode &&
-!networkstatus_get_param(NULL, "nf_pad_single_onion", 1, 0, 1))) {
+if (!get_options()->ConnectionPadding) {
+  /* Disable if torrc disabled */
   channelpadding_disable_padding_on_channel(chan);
-}
-
-/* Padding can be forced and/or reduced by clients, regardless of if
- * the channel supports it */
-if (get_options()->ReducedConnectionPadding) {
+} else if (get_options()->Tor2webMode &&
+!networkstatus_get_param(NULL,
+ CHANNELPADDING_TOR2WEB_PARAM,
+ CHANNELPADDING_TOR2WEB_DEFAULT, 0, 1)) {
+  /* Disable if we're using tor2web and the consensus disabled padding
+   * for tor2web */
+  channelpadding_disable_padding_on_channel(chan);
+} else if (rend_service_allow_non_anonymous_connection(get_options()) &&
+   !networkstatus_get_param(NULL,
+CHANNELPADDING_SOS_PARAM,
+CHANNELPADDING_SOS_DEFAULT, 0, 1)) {
+  /* Disable if we're using RSOS and the consensus disabled padding
+   * for RSOS*/
+  channelpadding_disable_padding_on_channel(chan);
+} else if (get_options()->ReducedConnectionPadding) {
+  /* Padding can be forced and/or reduced by clients, regardless of if
+   * the channel supports it */
   channelpadding_reduce_padding_on_channel(chan);
 }
   }
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index 9a2fdc4bb..ee6d29f7c 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -21,6 +21,7 @@
 #include "router.h"
 #include "compat_time.h"
 #include 
+#include "rendservice.h"
 
 STATIC int channelpadding_get_netflow_inactive_timeout_ms(const channel_t *);
 STATIC int channelpadding_send_disable_command(channel_t *);
@@ -136,10 +137,14 @@ channelpadding_new_consensus_params(networkstatus_t *ns)
 networkstatus_get_param(ns, "nf_pad_relays", 0, 0, 1);
 
   consensus_nf_pad_tor2web =
-networkstatus_get_param(ns, "nf_pad_tor2web", 1, 0, 1);
+networkstatus_get_param(ns,
+CHANNELPADDING_TOR2WEB_PARAM,
+CHANNELPADDING_TOR2WEB_DEFAULT, 0, 1);
 
   consensus_nf_pad_single_onion =
-networkstatus_get_param(ns, "nf_pad_single_onion", 1, 0, 1);
+networkstatus_get_param(ns,
+CHANNELPADDING_SOS_PARAM,
+CHANNELPADDING_SOS_DEFAULT, 0, 1);
 }
 
 /**
@@ -717,11 +722,24 @@ channelpadding_decide_to_pad_channel(channel_t *chan)
 return CHANNELPADDING_WONTPAD;
   }
 
-  if (options->Tor2webMode && !consensus_nf_pad_tor2web)
+  if (options->Tor2webMode && !consensus_nf_pad_tor2web) {
+/* If the consensus just changed values, this channel may still
+ * think padding is enabled. Negotiate it off. */
+if (chan->padding_enabled)
+  channelpadding_disable_padding_on_channel(chan);
+
 return CHANNELPADDING_WONTPAD;
+  }
+
+  if (rend_service_allow_non_anonymous_connection(options) &&
+  !consensus_nf_pad_single_onion) {
+/* If the consensus just changed values, this channel may still
+ * think padding is enabled. Negotiate it off. */
+if (chan->padding_enabled)
+  channelpadding_disable_padding_on_channel(chan);
 
-  if (options->HiddenServiceSingleHopMode && !consensus_nf_pad_single_onion)
 return CHANNELPADDING_WONTPAD;
+  }
 
   if (!chan->has_queued_writes(chan)) {
 int is_client_channel = 0;
diff --git a/src/or/channelpadding.h b/src/or/channelpadding.h
index 2708ee973..a227e27d5 100644
--- a/src/or/channelpadding.h
+++ b/src/or/channelpadding.h
@@ -13,6 +13,11 @@
 
 #include "channelpadding_negotiation.h"
 
+#define CHANNELPADDING_TOR2WEB_PARAM  "nf_pad_tor2web"
+#define CHANNELPADDING_TOR2WEB_DEFAULT 1
+#d

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

2017-09-12 Thread nickm
commit 8eef7fc845d76da287dd0888b6753178118f7193
Merge: 5238210da befddf6d2
Author: Nick Mathewson 
Date:   Tue Sep 12 10:30:54 2017 -0400

Merge branch 'maint-0.3.1'

 changes/bug17857   |   6 ++
 src/or/channel.c   |  25 -
 src/or/channelpadding.c|  34 +++
 src/or/channelpadding.h|   5 +
 src/test/test_channelpadding.c | 201 +
 5 files changed, 246 insertions(+), 25 deletions(-)

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


[tor-commits] [tor/maint-0.3.1] Changes file for #17857.

2017-09-12 Thread nickm
commit 6689c95d061d440ca16369583dac066cc35a6807
Author: Mike Perry 
Date:   Fri Jun 23 18:44:00 2017 -0400

Changes file for #17857.
---
 changes/bug17857 | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/changes/bug17857 b/changes/bug17857
new file mode 100644
index 0..6c8863823
--- /dev/null
+++ b/changes/bug17857
@@ -0,0 +1,6 @@
+  o Minor features (defensive programming):
+- Create a pair of consensus parameters nf_pad_tor2web and
+  nf_pad_single_onion that allow us to disable netflow padding in the
+  consensus for non-anonymous connections, in case the overhead is high.
+  Closes #17857.
+



___
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 'ticket17857_squashed' into maint-0.3.1

2017-09-12 Thread nickm
commit befddf6d2a46cd25beeb46357bf6cc4fe21802ce
Merge: 469189d84 6689c95d0
Author: Nick Mathewson 
Date:   Tue Sep 12 10:29:00 2017 -0400

Merge branch 'ticket17857_squashed' into maint-0.3.1

 changes/bug17857   |   6 ++
 src/or/channel.c   |  25 -
 src/or/channelpadding.c|  34 +++
 src/or/channelpadding.h|   5 +
 src/test/test_channelpadding.c | 201 +
 5 files changed, 246 insertions(+), 25 deletions(-)




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


[tor-commits] [tor/maint-0.3.1] Ticket #17857: Padding off-switch for single hop connections

2017-09-12 Thread nickm
commit 79e2e4d3cbabff41675aa1f7defb67f4acba398c
Author: Mike Perry 
Date:   Fri Jun 23 16:53:39 2017 -0400

Ticket #17857: Padding off-switch for single hop connections

This doesn't apply to currently active connections.. yet...
---
 src/or/channel.c   |   7 +-
 src/or/channelpadding.c|  16 
 src/test/test_channelpadding.c | 164 -
 3 files changed, 166 insertions(+), 21 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index df6d7d342..8348ffd64 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -65,6 +65,7 @@
 #include "routerlist.h"
 #include "scheduler.h"
 #include "compat_time.h"
+#include "networkstatus.h"
 
 /* Global lists of channels */
 
@@ -2711,7 +2712,11 @@ channel_do_open_actions(channel_t *chan)
 
   /* Disable or reduce padding according to user prefs. */
   if (chan->padding_enabled || get_options()->ConnectionPadding == 1) {
-if (!get_options()->ConnectionPadding) {
+if (!get_options()->ConnectionPadding ||
+(get_options()->Tor2webMode &&
+ !networkstatus_get_param(NULL, "nf_pad_tor2web", 1, 0, 1))
+|| (get_options()->HiddenServiceSingleHopMode &&
+!networkstatus_get_param(NULL, "nf_pad_single_onion", 1, 0, 1))) {
   channelpadding_disable_padding_on_channel(chan);
 }
 
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index f5248e896..9a2fdc4bb 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -46,6 +46,10 @@ static int consensus_nf_conntimeout_clients;
 static int consensus_nf_pad_before_usage;
 /** Should we pad relay-to-relay connections? */
 static int consensus_nf_pad_relays;
+/** Should we pad tor2web connections? */
+static int consensus_nf_pad_tor2web;
+/** Should we pad rosos connections? */
+static int consensus_nf_pad_single_onion;
 
 #define TOR_MSEC_PER_SEC 1000
 #define TOR_USEC_PER_MSEC 1000
@@ -130,6 +134,12 @@ channelpadding_new_consensus_params(networkstatus_t *ns)
 
   consensus_nf_pad_relays =
 networkstatus_get_param(ns, "nf_pad_relays", 0, 0, 1);
+
+  consensus_nf_pad_tor2web =
+networkstatus_get_param(ns, "nf_pad_tor2web", 1, 0, 1);
+
+  consensus_nf_pad_single_onion =
+networkstatus_get_param(ns, "nf_pad_single_onion", 1, 0, 1);
 }
 
 /**
@@ -707,6 +717,12 @@ channelpadding_decide_to_pad_channel(channel_t *chan)
 return CHANNELPADDING_WONTPAD;
   }
 
+  if (options->Tor2webMode && !consensus_nf_pad_tor2web)
+return CHANNELPADDING_WONTPAD;
+
+  if (options->HiddenServiceSingleHopMode && !consensus_nf_pad_single_onion)
+return CHANNELPADDING_WONTPAD;
+
   if (!chan->has_queued_writes(chan)) {
 int is_client_channel = 0;
 
diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
index 0a70184f8..99f8880a4 100644
--- a/src/test/test_channelpadding.c
+++ b/src/test/test_channelpadding.c
@@ -26,6 +26,7 @@ void test_channelpadding_timers(void *arg);
 void test_channelpadding_consensus(void *arg);
 void test_channelpadding_negotiation(void *arg);
 void test_channelpadding_decide_to_pad_channel(void *arg);
+void test_channelpadding_killonehop(void *arg);
 
 void dummy_nop_timer(void);
 
@@ -111,8 +112,6 @@ setup_fake_connection_for_channel(channel_tls_t *chan)
   conn->base_.conn_array_index = smartlist_len(connection_array);
   smartlist_add(connection_array, conn);
 
-  connection_or_set_canonical(conn, 1);
-
   conn->chan = chan;
   chan->conn = conn;
 
@@ -127,6 +126,8 @@ setup_fake_connection_for_channel(channel_tls_t *chan)
   conn->tls = (tor_tls_t *)((void *)(&fake_tortls));
 
   conn->link_proto = MIN_LINK_PROTO_FOR_CHANNEL_PADDING;
+
+  connection_or_set_canonical(conn, 1);
 }
 
 static channel_tls_t *
@@ -166,16 +167,30 @@ free_fake_channeltls(channel_tls_t *chan)
 }
 
 static void
-setup_mock_network(void)
+setup_mock_consensus(void)
 {
-  routerstatus_t *relay;
-  connection_array = smartlist_new();
-
   current_md_consensus = current_ns_consensus
 = tor_malloc_zero(sizeof(networkstatus_t));
   current_md_consensus->net_params = smartlist_new();
   current_md_consensus->routerstatus_list = smartlist_new();
   channelpadding_new_consensus_params(current_md_consensus);
+}
+
+static void
+free_mock_consensus(void)
+{
+  SMARTLIST_FOREACH(current_md_consensus->routerstatus_list, void *, r,
+tor_free(r));
+  smartlist_free(current_md_consensus->routerstatus_list);
+  smartlist_free(current_ns_consensus->net_params);
+  tor_free(current_ns_consensus);
+}
+
+static void
+setup_mock_network(void)
+{
+  routerstatus_t *relay;
+  connection_array = smartlist_new();
 
   relay1_relay2 = (channel_t*)new_fake_channeltls(2);
   relay1_relay2->write_cell = mock_channel_write_cell_relay1;
@@ -202,6 +217,11 @@ setup_mock_network(void)
   client_relay3 = (channel_t*)new_fake_channeltls(3);
   client_relay3->write_cell = mock_channel_write_cell_client;
   channel_timestamp_active(client_relay3);
+
+  channel_do_open_actions(rela

[tor-commits] [translation/tor-browser-manual] Update translations for tor-browser-manual

2017-09-12 Thread translation
commit 5aef2aaff1ef59a1fa93cb4c85f881982230d675
Author: Translation commit bot 
Date:   Tue Sep 12 14:19:35 2017 +

Update translations for tor-browser-manual
---
 uz/uz.po | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/uz/uz.po b/uz/uz.po
index 9cd6a66fa..72cb3748b 100644
--- a/uz/uz.po
+++ b/uz/uz.po
@@ -1,11 +1,12 @@
 # Translators:
 # Umidjon Almasov , 2016
+# Adham Kurbanov , 2017
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "POT-Creation-Date: 2016-12-06 16:36-0600\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: Umidjon Almasov , 2016\n"
+"Last-Translator: Adham Kurbanov , 2017\n"
 "Language-Team: Uzbek (https://www.transifex.com/otf/teams/1519/uz/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -789,7 +790,7 @@ msgstr ""
 
 #: onionsites.page:58 troubleshooting.page:10
 msgid "Troubleshooting"
-msgstr ""
+msgstr "Muammolarni bartaraf etish"
 
 #: onionsites.page:59
 msgid ""

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


[tor-commits] [torspec/master] Add proposal 282

2017-09-12 Thread nickm
commit cb2960f6ba05c0543fb3ea42abe0db6833205c8b
Author: Nick Mathewson 
Date:   Tue Sep 12 10:13:43 2017 -0400

Add proposal 282
---
 proposals/000-index.txt   |  6 --
 proposals/282-remove-named-from-consensus.txt | 24 
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/proposals/000-index.txt b/proposals/000-index.txt
index 18ff949..e184aab 100644
--- a/proposals/000-index.txt
+++ b/proposals/000-index.txt
@@ -200,8 +200,9 @@ Proposals by number:
 277  Detect multiple relay instances running with same ID [OPEN]
 278  Directory Compression Scheme Negotiation [FINISHED]
 279  A Name System API for Tor Onion Services [DRAFT]
-280  Privacy-Preseving Statistics with Privcount in Tor [DRAFT]
+280  Privacy-Preserving Statistics with Privcount in Tor [DRAFT]
 281  Downloading microdescriptors in bulk [DRAFT]
+282  Remove "Named" and "Unnamed" handling from consensus voting [OPEN]
 
 
 Proposals by status:
@@ -225,7 +226,7 @@ Proposals by status:
270  RebelAlliance: A Post-Quantum Secure Hybrid Handshake Based on NewHope
273  Exit relay pinning for web services [for n/a]
279  A Name System API for Tor Onion Services
-   280  Privacy-Preseving Statistics with Privcount in Tor
+   280  Privacy-Preserving Statistics with Privcount in Tor
281  Downloading microdescriptors in bulk
  NEEDS-REVISION:
190  Bridge Client Authorization Based on a Shared Secret
@@ -257,6 +258,7 @@ Proposals by status:
275  Stop including meaningful "published" time in microdescriptor 
consensus [for 0.3.1.x-alpha]
276  Report bandwidth with lower granularity in consensus documents [for 
0.3.1.x-alpha]
277  Detect multiple relay instances running with same ID [for 0.3.??]
+   282  Remove "Named" and "Unnamed" handling from consensus voting [for 
0.3.3.x]
  ACCEPTED:
172  GETINFO controller option for circuit information
173  GETINFO Option Expansion
diff --git a/proposals/282-remove-named-from-consensus.txt 
b/proposals/282-remove-named-from-consensus.txt
new file mode 100644
index 000..8903caa
--- /dev/null
+++ b/proposals/282-remove-named-from-consensus.txt
@@ -0,0 +1,24 @@
+Filename: 282-remove-named-from-consensus.txt
+Title: Remove "Named" and "Unnamed" handling from consensus voting
+Author: Nick Mathewson
+Created: 12-Sep-2017
+Status: Open
+Target: 0.3.3.x
+
+1. Summary
+
+   Authorities no longer vote for the "Named" and "Unnamed" flags, and we
+   have begun to remove the client code that supports them. (See proposal
+   235). The next logical step is to remove the special handling from these
+   flags from the consensus voting algorithm.  We specify this here.
+
+2. Proposal
+
+   We add a new consensus method, here represented as M, to be allocated
+   when this proposal's implementation is merged.
+
+   We specify that the Named and Unnamed flags are only handled
+   specially when the negotiated consensus method is earlier than M.  If
+   the negotiated method is M or later, then the Named and Unnamed
+   flags are handled as if any they were any other consensus flags.
+

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


[tor-commits] [tor/master] Remove networkstatus_nickname_is_unnamed()

2017-09-12 Thread nickm
commit 42b5e3cbb76eb4a7e0dcca8945217351c3ef1bb4
Author: Neel Chauhan 
Date:   Sat Sep 9 17:12:37 2017 -0400

Remove networkstatus_nickname_is_unnamed()
---
 src/or/networkstatus.c | 10 --
 src/or/networkstatus.h |  1 -
 src/or/nodelist.c  |  8 
 3 files changed, 19 deletions(-)

diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 76e8fe792..014f0f114 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -804,16 +804,6 @@ networkstatus_get_router_digest_by_nickname(const char 
*nickname)
   return strmap_get_lc(named_server_map, nickname);
 }
 
-/** Return true iff nickname is disallowed from being the nickname
- * of any server. */
-int
-networkstatus_nickname_is_unnamed(const char *nickname)
-{
-  if (!unnamed_server_map)
-return 0;
-  return strmap_get_lc(unnamed_server_map, nickname) != NULL;
-}
-
 /** How frequently do directory authorities re-download fresh networkstatus
  * documents? */
 #define AUTHORITY_NS_CACHE_INTERVAL (10*60)
diff --git a/src/or/networkstatus.h b/src/or/networkstatus.h
index 145be37d1..34643667a 100644
--- a/src/or/networkstatus.h
+++ b/src/or/networkstatus.h
@@ -63,7 +63,6 @@ MOCK_DECL(routerstatus_t *,
   router_get_mutable_consensus_status_by_descriptor_digest,
   (networkstatus_t *consensus, const char *digest));
 const char *networkstatus_get_router_digest_by_nickname(const char *nickname);
-int networkstatus_nickname_is_unnamed(const char *nickname);
 int we_want_to_fetch_flavor(const or_options_t *options, int flavor);
 int we_want_to_fetch_unknown_auth_certs(const or_options_t *options);
 void networkstatus_consensus_download_failed(int status_code,
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 00b8fb144..394c3ae73 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -859,14 +859,6 @@ node_get_by_nickname,(const char *nickname, unsigned 
flags))
   return node_get_by_id(named_id);
   }
 
-  /* Is it marked as owned-by-someone-else? */
-  if (networkstatus_nickname_is_unnamed(nickname)) {
-log_info(LD_GENERAL, "The name %s is listed as Unnamed: there is some "
- "router that holds it, but not one listed in the current "
- "consensus.", escaped(nickname));
-return NULL;
-  }
-
   /* Okay, so the name is not canonical for anybody. */
   {
 smartlist_t *matches = smartlist_new();



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


[tor-commits] [tor/master] changes file for 22215

2017-09-12 Thread nickm
commit 5238210da4a830ae3c5837dc903f1f115788949c
Author: Nick Mathewson 
Date:   Tue Sep 12 09:58:07 2017 -0400

changes file for 22215
---
 changes/ticket22215 | 5 +
 1 file changed, 5 insertions(+)

diff --git a/changes/ticket22215 b/changes/ticket22215
new file mode 100644
index 0..4abeaf2c5
--- /dev/null
+++ b/changes/ticket22215
@@ -0,0 +1,5 @@
+  o Code simplification and refactoring:
+- Remove some of the code that once supported "Named" and "Unnamed"
+  routers.  Authorities no longer vote for these flags. Closes ticket
+  23478.
+

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


[tor-commits] [tor/master] Remove named_map and unnamed_map from networkstatus.c

2017-09-12 Thread nickm
commit 035fe2d208633c600ee7164f2eba2e1c4b24c5db
Author: Nick Mathewson 
Date:   Tue Sep 12 09:56:42 2017 -0400

Remove named_map and unnamed_map from networkstatus.c
---
 src/or/networkstatus.c | 53 --
 src/or/networkstatus.h |  1 -
 src/or/nodelist.c  |  9 -
 src/or/router.c| 11 +++
 src/or/routerlist.c| 12 
 src/or/routerlist.h|  1 -
 6 files changed, 3 insertions(+), 84 deletions(-)

diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 014f0f114..8b07a8885 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -66,12 +66,6 @@
 #include "torcert.h"
 #include "channelpadding.h"
 
-/** Map from lowercase nickname to identity digest of named server, if any. */
-static strmap_t *named_server_map = NULL;
-/** Map from lowercase nickname to (void*)1 for all names that are listed
- * as unnamed for some server in the consensus. */
-static strmap_t *unnamed_server_map = NULL;
-
 /** Most recently received and validated v3 "ns"-flavored consensus network
  * status. */
 STATIC networkstatus_t *current_ns_consensus = NULL;
@@ -142,7 +136,6 @@ static int have_warned_about_old_version = 0;
  * listed by the authorities. */
 static int have_warned_about_new_version = 0;
 
-static void routerstatus_list_update_named_server_map(void);
 static void update_consensus_bootstrap_multiple_downloads(
   time_t now,
   const or_options_t *options);
@@ -250,13 +243,6 @@ router_reload_consensus_networkstatus(void)
 }
   }
 
-  if (!networkstatus_get_latest_consensus()) {
-if (!named_server_map)
-  named_server_map = strmap_new();
-if (!unnamed_server_map)
-  unnamed_server_map = strmap_new();
-  }
-
   update_certificate_downloads(time(NULL));
 
   routers_update_all_from_networkstatus(time(NULL), 3);
@@ -794,16 +780,6 @@ router_get_consensus_status_by_id(const char *digest)
   return router_get_mutable_consensus_status_by_id(digest);
 }
 
-/** Return the identity digest that's mapped to officially by
- * nickname. */
-const char *
-networkstatus_get_router_digest_by_nickname(const char *nickname)
-{
-  if (!named_server_map)
-return NULL;
-  return strmap_get_lc(named_server_map, nickname);
-}
-
 /** How frequently do directory authorities re-download fresh networkstatus
  * documents? */
 #define AUTHORITY_NS_CACHE_INTERVAL (10*60)
@@ -1960,7 +1936,6 @@ networkstatus_set_current_consensus(const char *consensus,
 update_consensus_networkstatus_fetch_time(now);
 
 dirvote_recalculate_timing(options, now);
-routerstatus_list_update_named_server_map();
 
 /* Update ewma and adjust policy if needed; first cache the old value */
 old_ewma_enabled = cell_ewma_enabled();
@@ -2129,31 +2104,6 @@ routers_update_all_from_networkstatus(time_t now, int 
dir_version)
   }
 }
 
-/** Update our view of the list of named servers from the most recently
- * retrieved networkstatus consensus. */
-static void
-routerstatus_list_update_named_server_map(void)
-{
-  networkstatus_t *ns = networkstatus_get_latest_consensus();
-  if (!ns)
-return;
-
-  strmap_free(named_server_map, tor_free_);
-  named_server_map = strmap_new();
-  strmap_free(unnamed_server_map, NULL);
-  unnamed_server_map = strmap_new();
-  smartlist_t *rslist = ns->routerstatus_list;
-  SMARTLIST_FOREACH_BEGIN(rslist, const routerstatus_t *, rs) {
-  if (rs->is_named) {
-strmap_set_lc(named_server_map, rs->nickname,
-  tor_memdup(rs->identity_digest, DIGEST_LEN));
-  }
-  if (rs->is_unnamed) {
-strmap_set_lc(unnamed_server_map, rs->nickname, (void*)1);
-  }
-  } SMARTLIST_FOREACH_END(rs);
-}
-
 /** Given a list routers of routerinfo_t *, update each status field
  * according to our current consensus networkstatus.  May re-order
  * routers. */
@@ -2639,8 +2589,5 @@ networkstatus_free_all(void)
 }
 tor_free(waiting->body);
   }
-
-  strmap_free(named_server_map, tor_free_);
-  strmap_free(unnamed_server_map, NULL);
 }
 
diff --git a/src/or/networkstatus.h b/src/or/networkstatus.h
index 34643667a..adaa10890 100644
--- a/src/or/networkstatus.h
+++ b/src/or/networkstatus.h
@@ -62,7 +62,6 @@ const routerstatus_t 
*router_get_consensus_status_by_descriptor_digest(
 MOCK_DECL(routerstatus_t *,
   router_get_mutable_consensus_status_by_descriptor_digest,
   (networkstatus_t *consensus, const char *digest));
-const char *networkstatus_get_router_digest_by_nickname(const char *nickname);
 int we_want_to_fetch_flavor(const or_options_t *options, int flavor);
 int we_want_to_fetch_unknown_auth_certs(const or_options_t *options);
 void networkstatus_consensus_download_failed(int status_code,
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 394c3ae73..01a0e9e85 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -850,15 +850,6 @@ node_get_by

[tor-commits] [torspec/master] Update "protocols" description to say it is obsolete

2017-09-12 Thread nickm
commit 3ab467de6e107c44cc044374d5a2aaf3641f3f0d
Author: Nick Mathewson 
Date:   Tue Sep 12 09:48:02 2017 -0400

Update "protocols" description to say it is obsolete

Closes ticket 23445.
---
 dir-spec.txt | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/dir-spec.txt b/dir-spec.txt
index 20416a6..212a2e8 100644
--- a/dir-spec.txt
+++ b/dir-spec.txt
@@ -692,13 +692,10 @@
 
[At most once.]
 
-   Both lists are space-separated sequences of numbers, to indicate which
-   protocols the server supports.  As of 30 Mar 2008, specified
-   protocols are "Link 1 2 Circuit 1".  See section 4.1 of tor-spec.txt
-   for more information about link protocol versions.
-
-   [NOTE: No version of Tor uses this protocol list.  It will be removed
- in a future version of Tor.]
+   An obsolete list of protocol versions, superseded by the "proto"
+   entry.  This list was never parsed, and has not been emitted
+   since Tor 0.2.9.4-alpha. New code should neither generate nor
+   parse this line.
 
"allow-single-hop-exits" NL
 

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


[tor-commits] [tor/master] Add v3 hidden service support to make test-network-all

2017-09-12 Thread nickm
commit d7d8d2c20e7e18016fce7e3b71de205b2471e3c5
Author: teor 
Date:   Tue Sep 12 17:08:28 2017 +1000

Add v3 hidden service support to make test-network-all

Requires chutney master 50f64ea or later.

Implements ticket 22437.
---
 src/test/include.am | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/test/include.am b/src/test/include.am
index d1488057e..ced16c0a8 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -39,12 +39,13 @@ TESTS += src/test/test src/test/test-slow 
src/test/test-memwipe \
$(TESTSCRIPTS)
 
 # These flavors are run using automake's test-driver and test-network.sh
-TEST_CHUTNEY_FLAVORS = basic-min bridges-min hs-min single-onion
+TEST_CHUTNEY_FLAVORS = basic-min bridges-min hs-v2-min hs-v3-min \
+   single-onion-v23
 # only run if we can ping6 ::1 (localhost)
-TEST_CHUTNEY_FLAVORS_IPV6 = bridges+ipv6-min ipv6-exit-min hs-ipv6 \
-   single-onion-ipv6
+TEST_CHUTNEY_FLAVORS_IPV6 = bridges+ipv6-min ipv6-exit-min hs-v23-ipv6 \
+   single-onion-v23-ipv6
 # only run if we can find a stable (or simply another) version of tor
-TEST_CHUTNEY_FLAVORS_MIXED = mixed
+TEST_CHUTNEY_FLAVORS_MIXED = mixed+hs-v23
 
 ### This is a lovely feature, but it requires automake >= 1.12, and Tor
 ###  doesn't require that yet.



___
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 'teor/ticket22437'

2017-09-12 Thread nickm
commit 2bfc490c1e03ec188dabc22aa78603f3fba34ad6
Merge: 80a22f536 d7d8d2c20
Author: Nick Mathewson 
Date:   Tue Sep 12 09:30:33 2017 -0400

Merge remote-tracking branch 'teor/ticket22437'

 src/test/include.am | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)



___
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 22437.

2017-09-12 Thread nickm
commit 4ace1b96ac2050e2d7c237af6fbf880f38be76bb
Author: Nick Mathewson 
Date:   Tue Sep 12 09:31:57 2017 -0400

Add a changes file for 22437.
---
 changes/ticket22437 | 4 
 1 file changed, 4 insertions(+)

diff --git a/changes/ticket22437 b/changes/ticket22437
new file mode 100644
index 0..8e4c9630c
--- /dev/null
+++ b/changes/ticket22437
@@ -0,0 +1,4 @@
+  o Testing:
+- The default chutney network tests now include tests for the
+  v3 hidden service design. Make sure you have the latest
+  version of chutney if you want to run these. Closes ticket 22437.

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


  1   2   >