[tor-commits] [translation/torbutton-browseronboardingproperties] Update translations for torbutton-browseronboardingproperties

2018-12-20 Thread translation
commit 57262780def830dd8d277b43fb2b4a98efbf3535
Author: Translation commit bot 
Date:   Fri Dec 21 07:49:16 2018 +

Update translations for torbutton-browseronboardingproperties
---
 bn/browserOnboarding.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bn/browserOnboarding.properties b/bn/browserOnboarding.properties
index ddc95f7ae..5886205c1 100644
--- a/bn/browserOnboarding.properties
+++ b/bn/browserOnboarding.properties
@@ -9,7 +9,7 @@ onboarding.tour-tor-welcome.button=এখন শুরু 
করুন
 
 onboarding.tour-tor-privacy=গোপনীয়তা
 onboarding.tour-tor-privacy.title=Snub ডায়েটের ও snoopers 
।
-onboarding.tour-tor-privacy.description=Tor Browser isolates cookies and 
deletes your browser history after your session. These modifications ensure 
your privacy and security are protected in the browser. Click ‘Tor Network’ 
to learn how we protect you on the network level.
+onboarding.tour-tor-privacy.description=টর ব্রাউজার 
কুকিজ বিচ্ছিন্ন করে এবং আপনার 
সেশনের পরে আপনার ব্রাউজার 
ইতিহাস মুছে ফেলে। এই 
পরিবর্তনগুলি আপনার 
গোপনীয়তা এবং সুরক্ষা 
ব্রাউজারে সুরক্ষিত। 
নেটওয়ার্ক স্তরে আমরা কীভাবে 
আপনার সুরক্ষা করি তা শিখতে 
'টোর নেটওয়ার্ক' এ ক্লিক করুন।
 onboarding.tour-tor-privacy.button=টর নেটওয়ার্কে 
যান
 
 onboarding.tour-tor-network=টর নেটওয়ার্ক

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


[tor-commits] [translation/tba-torbrowserstringsdtd] Update translations for tba-torbrowserstringsdtd

2018-12-20 Thread translation
commit 4a1a213c640ff0957c716c45639182e8e26b8d91
Author: Translation commit bot 
Date:   Fri Dec 21 07:47:26 2018 +

Update translations for tba-torbrowserstringsdtd
---
 bn/android_strings.dtd | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bn/android_strings.dtd b/bn/android_strings.dtd
index d78934120..7e5f548b4 100644
--- a/bn/android_strings.dtd
+++ b/bn/android_strings.dtd
@@ -1,15 +1,15 @@
 
 
 
-
+
 
 
 
-
+
 
 
 
-
+
 
 
 

___
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

2018-12-20 Thread translation
commit 47f90d7568d392d5284df69719afd787e24e341c
Author: Translation commit bot 
Date:   Fri Dec 21 07:46:31 2018 +

Update translations for tails-iuk
---
 bn.po | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bn.po b/bn.po
index 8a0f0262e..8a36e1f1f 100644
--- a/bn.po
+++ b/bn.po
@@ -3,6 +3,7 @@
 # This file is distributed under the same license as the PACKAGE package.
 # 
 # Translators:
+# Al Shahrior Hasan Sagor , 2018
 # Mahmud Numan , 2016
 # Sakib Abrar , 2015
 msgid ""
@@ -10,8 +11,8 @@ msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
 "POT-Creation-Date: 2018-12-09 13:56+0100\n"
-"PO-Revision-Date: 2018-12-09 14:14+\n"
-"Last-Translator: carolyn \n"
+"PO-Revision-Date: 2018-12-21 07:36+\n"
+"Last-Translator: Al Shahrior Hasan Sagor \n"
 "Language-Team: Bengali 
(http://www.transifex.com/otf/torproject/language/bn/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -193,15 +194,15 @@ msgid ""
 "The network connection will now be disabled.\n"
 "\n"
 "Please save your work and close all other applications."
-msgstr ""
+msgstr "আপগ্রেড সফলভাবে ডাউনলোড 
করা হয়েছে।\n\nনেটওয়ার্ক 
সংযোগ এখন নিষ্ক্রিয় করা 
হবে।\n\nআপনার কাজ সংরক্ষণ করুন 
এবং অন্যান্য অন্যান্য অ
্যাপ্লিকেশন বন্ধ করুন।"
 
 #: ../lib/Tails/IUK/Frontend.pm:612
 msgid "Upgrade successfully downloaded"
-msgstr ""
+msgstr "আপগ্রেড সফলভাবে ডাউনলোড 
হয়েছে"
 
 #: ../lib/Tails/IUK/Frontend.pm:614
 msgid "Apply upgrade"
-msgstr ""
+msgstr "আপগ্রেড প্রয়োগ করুন"
 
 #: ../lib/Tails/IUK/Frontend.pm:621
 msgid ""

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


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

2018-12-20 Thread translation
commit 1998c425c4094f5d9e6fd4ee244ff38b7ad6c3cd
Author: Translation commit bot 
Date:   Fri Dec 21 07:46:26 2018 +

Update translations for tails-misc_completed
---
 bn.po | 192 +-
 1 file changed, 107 insertions(+), 85 deletions(-)

diff --git a/bn.po b/bn.po
index 3b26d56bf..783748278 100644
--- a/bn.po
+++ b/bn.po
@@ -3,15 +3,16 @@
 # This file is distributed under the same license as the PACKAGE package.
 # 
 # Translators:
+# Al Shahrior Hasan Sagor , 2018
 # Emma Peel, 2018
 # Mahmud Numan , 2017
 msgid ""
 msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-09-04 11:37+0200\n"
-"PO-Revision-Date: 2018-10-07 00:42+\n"
-"Last-Translator: Emma Peel\n"
+"POT-Creation-Date: 2018-12-07 10:24+0100\n"
+"PO-Revision-Date: 2018-12-21 07:38+\n"
+"Last-Translator: Al Shahrior Hasan Sagor \n"
 "Language-Team: Bengali 
(http://www.transifex.com/otf/torproject/language/bn/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -57,7 +58,7 @@ msgid ""
 msgstr "Tails শুরু করার সময় 
নিম্নোক্ত সফটওয়্যারটি 
আপনার একরোখা ভাণ্ডার থেকে 
স্বয়ংক্রিয়ভাবে সংস্থাপিত 
হয় ।"
 
 #: 
config/chroot_local-includes/usr/share/tails/additional-software/configuration-window.ui:132
-#: 
config/chroot_local-includes/usr/local/bin/tails-additional-software-config:169
+#: 
config/chroot_local-includes/usr/local/bin/tails-additional-software-config:172
 msgid ""
 "To add more, install some software using Synaptic Package Manager or Additional Software feature."
 msgstr "Tails শুরু করার সময় 
স্বয়ংক্রিয়ভাবে এটি 
সংস্থাপন করতে, আপনি একটি 
একরোখা স্টোরেজ তৈরি করতে 
পারেন এবং অতিরিক্ত 
সফটওয়্যার বৈশিষ্ট্য 
সক্রিয় করতে পারবেন ।"
 
-#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:314
+#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:324
 msgid "Create Persistent Storage"
 msgstr "অবিরাম স্টোরেজ তৈরি করুন"
 
-#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:322
+#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:332
 msgid "Creating your persistent storage failed."
 msgstr "আপনার একরোখা ভাণ্ডার তৈরি 
করা ব্যর্থ হয়েছে ।"
 
-#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:329
+#. Translators: Don't translate {packages}, it's a placeholder and
+#. will be replaced.
+#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:341
 #, python-brace-format
 msgid "You could install {packages} automatically when starting Tails"
 msgstr "Tails শুরু করার সময় আপনি 
{packages}-এ ইনস্টল করতে পারেন"
 
-#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:332
+#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:344
 msgid ""
 "To do so, you need to run Tails from a USB stick installed using Tails "
 "Installer."
 msgstr "এটা করতে, Tails ইনস্টলার 
ব্যবহার করে ইনস্টল করা একটি USB 
স্টিক থেকে Tails চালানো প্রয়োজন."
 
-#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:345
+#. Translators: Don't translate {packages}, it's a placeholder and will be
+#. replaced.
+#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:359
 #, python-brace-format
 msgid "Remove {packages} from your additional software?"
 msgstr "আপনার অতিরিক্ত 
সফ্টওয়্যার থেকে {packages} অপসারণ 
করুন?"
 
-#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:347
+#. Translators: Don't translate {packages}, it's a placeholder
+#. and will be replaced.
+#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:363
 #, python-brace-format
 msgid "This will stop installing {packages} automatically."
 msgstr "এটি স্বয়ংক্রিয়ভাবে {packages} 
ইনস্টল করা বন্ধ করবে ।"
 
-#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:349
+#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:365
 msgid "Remove"
 msgstr "অপসারণ"
 
-#: config/chroot_local-includes/usr/local/sbin/tails-additional-software:350
+#: 

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

2018-12-20 Thread translation
commit b8deaab81fbec9a841c99748d3d007e30632b3d4
Author: Translation commit bot 
Date:   Fri Dec 21 07:46:20 2018 +

Update translations for tails-misc
---
 bn.po | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bn.po b/bn.po
index 7e2a031d1..783748278 100644
--- a/bn.po
+++ b/bn.po
@@ -3,6 +3,7 @@
 # This file is distributed under the same license as the PACKAGE package.
 # 
 # Translators:
+# Al Shahrior Hasan Sagor , 2018
 # Emma Peel, 2018
 # Mahmud Numan , 2017
 msgid ""
@@ -10,8 +11,8 @@ msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-12-07 10:24+0100\n"
-"PO-Revision-Date: 2018-12-07 13:55+\n"
-"Last-Translator: carolyn \n"
+"PO-Revision-Date: 2018-12-21 07:38+\n"
+"Last-Translator: Al Shahrior Hasan Sagor \n"
 "Language-Team: Bengali 
(http://www.transifex.com/otf/torproject/language/bn/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -590,11 +591,11 @@ msgstr "{volume_name} – {drive_name}"
 
 #: 
config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py:222
 msgid "Wrong passphrase or parameters"
-msgstr ""
+msgstr "ভুল পাসফ্রেজ বা পরামিতি"
 
 #: 
config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume.py:224
 msgid "Error unlocking volume"
-msgstr ""
+msgstr "ভলিউম আনলক ত্রুটি"
 
 #. Translators: Don't translate {volume_name} or {error_message},
 #. they are placeholder and will be replaced.
@@ -603,7 +604,7 @@ msgstr ""
 msgid ""
 "Couldn't unlock volume {volume_name}:\n"
 "{error_message}"
-msgstr ""
+msgstr "ভলিউম আনলক করা যায়নি 
{volume_name}:\n{error_message}"
 
 #: 
config/chroot_local-includes/usr/local/lib/python3/dist-packages/unlock_veracrypt_volumes/volume_list.py:83
 msgid "No file containers added"

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


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

2018-12-20 Thread translation
commit 9b5e27c877ea6cabc3440cc27693e6f3e314ce78
Author: Translation commit bot 
Date:   Fri Dec 21 07:45:57 2018 +

Update translations for https_everywhere_completed
---
 bn/https-everywhere.dtd | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bn/https-everywhere.dtd b/bn/https-everywhere.dtd
index 1d13b9636..6f6a49046 100644
--- a/bn/https-everywhere.dtd
+++ b/bn/https-everywhere.dtd
@@ -18,6 +18,7 @@
 
 
 
+
 
 
 

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


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

2018-12-20 Thread translation
commit df0511e6afb08dea20c747f72b4af20381a0a744
Author: Translation commit bot 
Date:   Fri Dec 21 07:45:50 2018 +

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

diff --git a/bn/https-everywhere.dtd b/bn/https-everywhere.dtd
index e6d1f8bde..6f6a49046 100644
--- a/bn/https-everywhere.dtd
+++ b/bn/https-everywhere.dtd
@@ -18,7 +18,7 @@
 
 
 
-
+
 
 
 

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


[tor-commits] [translation/abouttor-homepage_completed] Update translations for abouttor-homepage_completed

2018-12-20 Thread translation
commit e2ccdd9512fbdae84112bd8ad95cb5d77c420a93
Author: Translation commit bot 
Date:   Fri Dec 21 07:45:13 2018 +

Update translations for abouttor-homepage_completed
---
 bn/aboutTor.dtd | 5 +
 1 file changed, 5 insertions(+)

diff --git a/bn/aboutTor.dtd b/bn/aboutTor.dtd
index cec6d85b9..4703af65b 100644
--- a/bn/aboutTor.dtd
+++ b/bn/aboutTor.dtd
@@ -35,8 +35,13 @@
 
 
 
+
+
+
+
 
 
+
 
 
 

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


[tor-commits] [translation/abouttor-homepage] Update translations for abouttor-homepage

2018-12-20 Thread translation
commit f8688119bbbabdb5035c56b9f40a3b6a44cba4eb
Author: Translation commit bot 
Date:   Fri Dec 21 07:45:06 2018 +

Update translations for abouttor-homepage
---
 bn/aboutTor.dtd | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bn/aboutTor.dtd b/bn/aboutTor.dtd
index 8e0179f51..4703af65b 100644
--- a/bn/aboutTor.dtd
+++ b/bn/aboutTor.dtd
@@ -35,13 +35,13 @@
 
 
 
-
-
-
-
+
+
+
+
 
 
-
+
 
 
 

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


[tor-commits] [torspec/master] add nsf ack to prop 249

2018-12-20 Thread arma
commit fe3930dccd9499ffb691f364974479de6f6cad12
Author: Roger Dingledine 
Date:   Fri Dec 21 02:14:58 2018 -0500

add nsf ack to prop 249
---
 proposals/249-large-create-cells.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/proposals/249-large-create-cells.txt 
b/proposals/249-large-create-cells.txt
index 2d2eb4f..ad51495 100644
--- a/proposals/249-large-create-cells.txt
+++ b/proposals/249-large-create-cells.txt
@@ -270,3 +270,8 @@ Appendix A. A rejected idea for migration
where authentication hasn't actually been performed).  So I'm
guessing we shouldn't do that.
 
+Appendix B. Acknowledgements
+
+  This research was supported in part by NSF grants CNS-539,
+  CNS-1314637, CNS-1526306, CNS-1619454, and CNS-1640548.
+

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


[tor-commits] [torspec/master] my next surfer band name will be the protocools

2018-12-20 Thread arma
commit df60e9b502d35db410be63699c1c5fe737c490b7
Author: Roger Dingledine 
Date:   Fri Dec 21 01:57:24 2018 -0500

my next surfer band name will be the protocools
---
 tor-spec.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tor-spec.txt b/tor-spec.txt
index 763f0f9..7204989 100644
--- a/tor-spec.txt
+++ b/tor-spec.txt
@@ -1999,7 +1999,7 @@ see tor-design.pdf.
 9.2. "LinkAuth"
 
LinkAuth protocols correspond to varieties of Authenticate cells used for
-   the v3+ link protocools.
+   the v3+ link protocols.
 
Current versions are:
 

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


[tor-commits] [snowflake/master] Bump last updated date.

2018-12-20 Thread dcf
commit 9e2a85d753f8a94c8cab3636fafd54e5ce4e3454
Author: David Fifield 
Date:   Thu Dec 20 20:48:50 2018 -0700

Bump last updated date.
---
 proxy/static/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/static/index.html b/proxy/static/index.html
index 1c78908..74779e5 100644
--- a/proxy/static/index.html
+++ b/proxy/static/index.html
@@ -72,7 +72,7 @@ 
href="https://gitweb.torproject.org/pluggable-transports/snowflake.git/;>
 gitweb.torproject.org/pluggable-transports/snowflake.git
 
 
-Last update: 2018-12-19
+Last update: 2018-12-20
 
 
 

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


[tor-commits] [snowflake/master] Use a relative URL for the embed in the sample page.

2018-12-20 Thread dcf
commit 27b74b1666df03c60954957958c6dc1fb47b7c22
Author: David Fifield 
Date:   Thu Dec 20 17:10:50 2018 -0700

Use a relative URL for the embed in the sample page.

To facilitate local testing.
---
 proxy/static/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/static/index.html b/proxy/static/index.html
index d34d08b..1c78908 100644
--- a/proxy/static/index.html
+++ b/proxy/static/index.html
@@ -60,7 +60,7 @@ It is now possible to embed the Snowflake badge on any 
website:
 
 Which looks like this:
 
-https://snowflake.torproject.org/embed.html; width="88" 
height="16" frameborder="0" scrolling="no">
+
 
 
 If it animates, then congratulations -- you are currently acting as a Tor 
bridge.



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


[tor-commits] [snowflake/master] Escape quoted HTML markup within textarea.

2018-12-20 Thread dcf
commit 82b696709d48d164db540cf790c3c346ba9059ad
Author: David Fifield 
Date:   Thu Dec 20 20:14:47 2018 -0700

Escape quoted HTML markup within textarea.
---
 proxy/static/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/static/index.html b/proxy/static/index.html
index a0c6a48..d34d08b 100644
--- a/proxy/static/index.html
+++ b/proxy/static/index.html
@@ -54,7 +54,7 @@ It is now possible to embed the Snowflake badge on any 
website:
 
 
 
-https://snowflake.torproject.org/embed.html; width="88" 
height="16" frameborder="0" scrolling="no">
+iframe src="https://snowflake.torproject.org/embed.html; width="88" 
height="16" frameborder="0" scrolling="no"/iframe
 
 
 

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


[tor-commits] [snowflake/master] Fix HTML tag typo.

2018-12-20 Thread dcf
commit 5667aa8ebbb69ce9d18f46a29bfc9894835cb650
Author: David Fifield 
Date:   Thu Dec 20 18:29:51 2018 -0700

Fix HTML tag typo.
---
 proxy/static/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/static/index.html b/proxy/static/index.html
index 9b4175e..a0c6a48 100644
--- a/proxy/static/index.html
+++ b/proxy/static/index.html
@@ -75,4 +75,4 @@ gitweb.torproject.org/pluggable-transports/snowflake.git
 Last update: 2018-12-19
 
 
-
+

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


[tor-commits] [snowflake/master] .gitignore broker/broker.

2018-12-20 Thread dcf
commit 9e47cc3b5b40a6677ed572681c605353819776ff
Author: David Fifield 
Date:   Thu Dec 20 16:40:30 2018 -0700

.gitignore broker/broker.
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 18eeb57..165c512 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@
 *.swm
 .DS_Store
 datadir/
+broker/broker
 client/client
 server-webrtc/server-webrtc
 server/server

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


[tor-commits] [tor/master] Escape the PT K/V data before sending it to the logger.

2018-12-20 Thread nickm
commit ab0d7d2dd470a447535eaf7c35bd4877c43bce26
Author: Alexander Færøy 
Date:   Thu Dec 20 19:05:08 2018 +0100

Escape the PT K/V data before sending it to the logger.

See: https://bugs.torproject.org/28846
---
 src/feature/client/transports.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/feature/client/transports.c b/src/feature/client/transports.c
index 45dbd0c88..8a8bcd9f7 100644
--- a/src/feature/client/transports.c
+++ b/src/feature/client/transports.c
@@ -1175,14 +1175,14 @@ parse_log_line(const char *line, managed_proxy_t *mp)
   /* Check if we got a message. */
   if (! message) {
 log_warn(LD_PT, "Managed proxy \"%s\" wrote a LOG line without "
-"MESSAGE: %s", mp->argv[0], data);
+"MESSAGE: %s", mp->argv[0], escaped(data));
 goto done;
   }
 
   /* Check if severity is there and whether it's valid. */
   if (! severity) {
 log_warn(LD_PT, "Managed proxy \"%s\" wrote a LOG line without "
-"SEVERITY: %s", mp->argv[0], data);
+"SEVERITY: %s", mp->argv[0], escaped(data));
 goto done;
   }
 
@@ -1232,7 +1232,7 @@ parse_status_line(const char *line, managed_proxy_t *mp)
 
   if (! values) {
 log_warn(LD_PT, "Managed proxy \"%s\" wrote an invalid "
- "STATUS message: %s", mp->argv[0], data);
+ "STATUS message: %s", mp->argv[0], escaped(data));
 goto done;
   }
 
@@ -1242,7 +1242,7 @@ parse_status_line(const char *line, managed_proxy_t *mp)
 
   if (! type) {
 log_warn(LD_PT, "Managed proxy \"%s\" wrote a STATUS line without "
-"TYPE: %s", mp->argv[0], data);
+"TYPE: %s", mp->argv[0], escaped(data));
 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 'tor-github/pr/609'

2018-12-20 Thread nickm
commit e4109020e9b423a170e7ca14d04727bc3730dc67
Merge: 0e6e902cb ab0d7d2dd
Author: Nick Mathewson 
Date:   Thu Dec 20 16:42:35 2018 -0500

Merge remote-tracking branch 'tor-github/pr/609'

 changes/ticket28180 |   2 +-
 changes/ticket28846 |   3 +
 src/feature/client/transports.c | 140 +---
 src/feature/client/transports.h |   3 +
 src/feature/control/control.c   |  21 --
 src/feature/control/control.h   |   6 +-
 src/test/test_pt.c  |  50 --
 7 files changed, 202 insertions(+), 23 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 support for STATUS messages from Pluggable Transports.

2018-12-20 Thread nickm
commit 4efe4cc2f918ce45075b010d2cdc09ec7791ac6b
Author: Alexander Færøy 
Date:   Thu Dec 20 03:55:02 2018 +0100

Add support for STATUS messages from Pluggable Transports.

This patch adds support for the new STATUS message that PT's can emit
from their standard out. The STATUS message uses the `config_line_t` K/V
format that was recently added in Tor.

See: https://bugs.torproject.org/28846
---
 src/feature/client/transports.c | 60 ++---
 src/feature/client/transports.h |  1 +
 src/feature/control/control.c   | 10 +++
 src/feature/control/control.h   |  4 ++-
 src/test/test_pt.c  | 21 +++
 5 files changed, 92 insertions(+), 4 deletions(-)

diff --git a/src/feature/client/transports.c b/src/feature/client/transports.c
index 6a3479a47..45dbd0c88 100644
--- a/src/feature/client/transports.c
+++ b/src/feature/client/transports.c
@@ -130,6 +130,7 @@ static void parse_method_error(const char *line, int 
is_server_method);
 #define PROTO_PROXY_DONE "PROXY DONE"
 #define PROTO_PROXY_ERROR "PROXY-ERROR"
 #define PROTO_LOG "LOG"
+#define PROTO_STATUS "STATUS"
 
 /** The first and only supported - at the moment - configuration
 protocol version. */
@@ -912,12 +913,16 @@ handle_proxy_line(const char *line, managed_proxy_t *mp)
 parse_proxy_error(line);
 goto err;
 
-/* We check for the additional " " after the PROTO_LOG string to make sure
- * we can later extend this big if/else-if table with something that begins
- * with "LOG" without having to get the order right. */
+/* We check for the additional " " after the PROTO_LOG * PROTO_STATUS
+ * string to make sure we can later extend this big if/else-if table with
+ * something that begins with "LOG" without having to get the order right.
+ * */
   } else if (!strcmpstart(line, PROTO_LOG " ")) {
 parse_log_line(line, mp);
 return;
+  } else if (!strcmpstart(line, PROTO_STATUS " ")) {
+parse_status_line(line, mp);
+return;
   }
 
   log_notice(LD_GENERAL, "Unknown line received by managed proxy (%s).", line);
@@ -1205,6 +1210,55 @@ parse_log_line(const char *line, managed_proxy_t *mp)
   tor_free(log_message);
 }
 
+/** Parses a STATUS line and emit control events accordingly. */
+STATIC void
+parse_status_line(const char *line, managed_proxy_t *mp)
+{
+  tor_assert(line);
+  tor_assert(mp);
+
+  config_line_t *values = NULL;
+  char *status_message = NULL;
+
+  if (strlen(line) < (strlen(PROTO_STATUS) + 1)) {
+log_warn(LD_PT, "Managed proxy sent us a %s line "
+"with missing argument.", PROTO_STATUS);
+goto done;
+  }
+
+  const char *data = line + strlen(PROTO_STATUS) + 1;
+
+  values = kvline_parse(data, KV_QUOTED);
+
+  if (! values) {
+log_warn(LD_PT, "Managed proxy \"%s\" wrote an invalid "
+ "STATUS message: %s", mp->argv[0], data);
+goto done;
+  }
+
+  /* We check if we received the TYPE parameter, which is the only *required*
+   * value. */
+  const config_line_t *type = config_line_find(values, "TYPE");
+
+  if (! type) {
+log_warn(LD_PT, "Managed proxy \"%s\" wrote a STATUS line without "
+"TYPE: %s", mp->argv[0], data);
+goto done;
+  }
+
+  /* Prepend the PT name. */
+  config_line_prepend(, "PT", mp->argv[0]);
+  status_message = kvline_encode(values, KV_QUOTED);
+
+  /* We have checked that TYPE is there, we can now emit the STATUS event via
+   * the control port. */
+  control_event_pt_status(status_message);
+
+ done:
+  config_free_lines(values);
+  tor_free(status_message);
+}
+
 /** Return a newly allocated string that tor should place in
  * TOR_PT_SERVER_TRANSPORT_OPTIONS while configuring the server
  * manged proxy in mp. Return NULL if no such options are found. */
diff --git a/src/feature/client/transports.h b/src/feature/client/transports.h
index b8d1bb008..1a910ae82 100644
--- a/src/feature/client/transports.h
+++ b/src/feature/client/transports.h
@@ -129,6 +129,7 @@ STATIC void parse_env_error(const char *line);
 STATIC void parse_proxy_error(const char *line);
 STATIC void handle_proxy_line(const char *line, managed_proxy_t *mp);
 STATIC void parse_log_line(const char *line, managed_proxy_t *mp);
+STATIC void parse_status_line(const char *line, managed_proxy_t *mp);
 STATIC char *get_transport_options_for_server_proxy(const managed_proxy_t *mp);
 
 STATIC void managed_proxy_destroy(managed_proxy_t *mp,
diff --git a/src/feature/control/control.c b/src/feature/control/control.c
index 849f11707..4ef550c91 100644
--- a/src/feature/control/control.c
+++ b/src/feature/control/control.c
@@ -7043,6 +7043,16 @@ control_event_pt_log(const char *log)
  log);
 }
 
+/** A pluggable transport has emitted a STATUS message found in
+ * status. */
+void
+control_event_pt_status(const char *status)
+{
+  send_control_event(EVENT_PT_STATUS,
+ "650 PT_STATUS %s\r\n",
+ 

[tor-commits] [tor/master] Add and update changes files for #28846.

2018-12-20 Thread nickm
commit e2c36b9ca064580208ac0976aaad28f08f3a744b
Author: Alexander Færøy 
Date:   Thu Dec 20 04:08:04 2018 +0100

Add and update changes files for #28846.

This ticket finishes the implementatoin of #28180 and adds the new
STATUS message from #28846.

See: https://bugs.torproject.org/28846
---
 changes/ticket28180 | 2 +-
 changes/ticket28846 | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/changes/ticket28180 b/changes/ticket28180
index 2ec547bd4..59de1c625 100644
--- a/changes/ticket28180
+++ b/changes/ticket28180
@@ -1,3 +1,3 @@
   o Minor features (pluggable transports):
 - Add support for logging to Tor's logging subsystem from a pluggable
-  transport process. Partial implementation for ticket 28180
+  transport process. Closes ticket 28180
diff --git a/changes/ticket28846 b/changes/ticket28846
new file mode 100644
index 0..efb5b9938
--- /dev/null
+++ b/changes/ticket28846
@@ -0,0 +1,3 @@
+  o Minor features (pluggable transports):
+- Add support for emitting STATUS updates to Tor's control port from a
+  pluggable transport process. Closes ticket 28846.



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


[tor-commits] [tor/master] Use K/V parser to handle LOG messages for pluggable transports.

2018-12-20 Thread nickm
commit 426c52b377057dc5f4428c664ee56ca77d648c9e
Author: Alexander Færøy 
Date:   Thu Dec 20 02:10:42 2018 +0100

Use K/V parser to handle LOG messages for pluggable transports.

This patch changes the LOG pluggable transport message to use the recent
K/V parser that landed in Tor. This allows PT's to specify the log
severity level as well as the message. A mapping between the PT log
severity levels and Tor's log serverity level is provided.

See: https://bugs.torproject.org/28846
---
 src/feature/client/transports.c | 80 ++---
 src/feature/client/transports.h |  2 ++
 src/feature/control/control.c   | 11 +++---
 src/feature/control/control.h   |  2 +-
 src/test/test_pt.c  | 29 +++
 5 files changed, 106 insertions(+), 18 deletions(-)

diff --git a/src/feature/client/transports.c b/src/feature/client/transports.c
index de53fe346..6a3479a47 100644
--- a/src/feature/client/transports.c
+++ b/src/feature/client/transports.c
@@ -101,6 +101,8 @@
 #include "core/or/connection_or.h"
 #include "feature/relay/ext_orport.h"
 #include "feature/control/control.h"
+#include "lib/encoding/confline.h"
+#include "lib/encoding/kvline.h"
 
 #include "lib/process/process.h"
 #include "lib/process/env.h"
@@ -1144,22 +1146,63 @@ parse_log_line(const char *line, managed_proxy_t *mp)
   tor_assert(line);
   tor_assert(mp);
 
+  config_line_t *values = NULL;
+  char *log_message = NULL;
+
   if (strlen(line) < (strlen(PROTO_LOG) + 1)) {
 log_warn(LD_PT, "Managed proxy sent us a %s line "
 "with missing argument.", PROTO_LOG);
 goto done;
   }
 
-  const char *message = line + strlen(PROTO_LOG) + 1;
+  const char *data = line + strlen(PROTO_LOG) + 1;
+  values = kvline_parse(data, KV_QUOTED);
+
+  if (! values) {
+log_warn(LD_PT, "Managed proxy \"%s\" wrote an invalid LOG message: %s",
+ mp->argv[0], data);
+goto done;
+  }
+
+  const config_line_t *severity = config_line_find(values, "SEVERITY");
+  const config_line_t *message = config_line_find(values, "MESSAGE");
+
+  /* Check if we got a message. */
+  if (! message) {
+log_warn(LD_PT, "Managed proxy \"%s\" wrote a LOG line without "
+"MESSAGE: %s", mp->argv[0], data);
+goto done;
+  }
+
+  /* Check if severity is there and whether it's valid. */
+  if (! severity) {
+log_warn(LD_PT, "Managed proxy \"%s\" wrote a LOG line without "
+"SEVERITY: %s", mp->argv[0], data);
+goto done;
+  }
 
-  log_info(LD_PT, "Managed proxy \"%s\" says: %s",
-   mp->argv[0], message);
+  int log_severity = managed_proxy_severity_parse(severity->value);
+
+  if (log_severity == -1) {
+log_warn(LD_PT, "Managed proxy \"%s\" wrote a LOG line with an "
+"invalid severity level: %s",
+mp->argv[0], severity->value);
+goto done;
+  }
+
+  tor_log(log_severity, LD_PT, "Managed proxy \"%s\": %s",
+  mp->argv[0], message->value);
+
+  /* Prepend the PT name. */
+  config_line_prepend(, "PT", mp->argv[0]);
+  log_message = kvline_encode(values, KV_QUOTED);
 
   /* Emit control port event. */
-  control_event_pt_log(mp->argv[0], message);
+  control_event_pt_log(log_message);
 
  done:
-  return;
+  config_free_lines(values);
+  tor_free(log_message);
 }
 
 /** Return a newly allocated string that tor should place in
@@ -1779,3 +1822,30 @@ managed_proxy_exit_callback(process_t *process, 
process_exit_code_t exit_code)
 
   return true;
 }
+
+/** Returns a valid integer log severity level from severity that
+ * is compatible with Tor's logging functions. Returns -1 on
+ * error. */
+STATIC int
+managed_proxy_severity_parse(const char *severity)
+{
+  tor_assert(severity);
+
+  /* Slightly different than log.c's parse_log_level :-( */
+  if (! strcmp(severity, "debug"))
+return LOG_DEBUG;
+
+  if (! strcmp(severity, "info"))
+return LOG_INFO;
+
+  if (! strcmp(severity, "notice"))
+return LOG_NOTICE;
+
+  if (! strcmp(severity, "warning"))
+return LOG_WARN;
+
+  if (! strcmp(severity, "error"))
+return LOG_ERR;
+
+  return -1;
+}
diff --git a/src/feature/client/transports.h b/src/feature/client/transports.h
index a3994a009..b8d1bb008 100644
--- a/src/feature/client/transports.h
+++ b/src/feature/client/transports.h
@@ -147,6 +147,8 @@ STATIC void managed_proxy_stdout_callback(process_t *, 
const char *, size_t);
 STATIC void managed_proxy_stderr_callback(process_t *, const char *, size_t);
 STATIC bool managed_proxy_exit_callback(process_t *, process_exit_code_t);
 
+STATIC int managed_proxy_severity_parse(const char *);
+
 #endif /* defined(PT_PRIVATE) */
 
 #endif /* !defined(TOR_TRANSPORTS_H) */
diff --git a/src/feature/control/control.c b/src/feature/control/control.c
index 7fae3b7a1..849f11707 100644
--- a/src/feature/control/control.c
+++ b/src/feature/control/control.c
@@ -7033,15 +7033,14 @@ 

[tor-commits] [webwml/master] if no jobs open, uncomment the 'no jobs' text

2018-12-20 Thread arma
commit a3e21ccb54300a31384e326128a4f39e533e3b16
Author: Roger Dingledine 
Date:   Thu Dec 20 16:37:58 2018 -0500

if no jobs open, uncomment the 'no jobs' text
---
 about/en/jobs.wml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/about/en/jobs.wml b/about/en/jobs.wml
index d082a48d..9084843b 100644
--- a/about/en/jobs.wml
+++ b/about/en/jobs.wml
@@ -12,8 +12,8 @@
   
 The Tor Project is always looking for more great people to join our 
team!
 
-# At the moment, we don't have any official open positions. Please 
check back soon, though! In the meantime, you may want to glance at our
-# volunteers page.
+  At the moment, we don't have any official open positions. Please 
check back soon, though! In the meantime, you may want to glance at our
+  volunteers page.
 
 

[tor-commits] [stem/master] Blank inputs cause server descriptor parsing to fail

2018-12-20 Thread atagar
commit 5488849baaf2402a8a315d9d474dc69207b2e6ef
Author: Damian Johnson 
Date:   Thu Dec 20 11:47:34 2018 -0800

Blank inputs cause server descriptor parsing to fail

Honestly I'm not digging in too much, but DocTor has started providing
me with notifications of...

  Unable to retrieve the present server descriptors...

  source: http://204.13.164.118:80/tor/server/all
  time: 12/20/2018 11:44
  error: Content conform to being a server descriptor:

We strip annotation whitespace if we have descritor content to parse but 
didn't
if we didnn't. No reason I can think of to not do so in both cases.
---
 stem/descriptor/server_descriptor.py | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/stem/descriptor/server_descriptor.py 
b/stem/descriptor/server_descriptor.py
index 89b80d0a..98300775 100644
--- a/stem/descriptor/server_descriptor.py
+++ b/stem/descriptor/server_descriptor.py
@@ -195,6 +195,9 @@ def _parse_file(descriptor_file, is_bridge = False, 
validate = False, **kwargs):
 
   while True:
 annotations = _read_until_keywords('router', descriptor_file)
+annotations = map(bytes.strip, annotations)  # strip 
newlines
+annotations = map(stem.util.str_tools._to_unicode, annotations)  # convert 
to unicode
+annotations = list(filter(lambda x: x != '', annotations))   # drop 
any blanks
 
 if not is_bridge:
   descriptor_content = _read_until_keywords('router-signature', 
descriptor_file)
@@ -210,9 +213,6 @@ def _parse_file(descriptor_file, is_bridge = False, 
validate = False, **kwargs):
   if descriptor_content[0].startswith(b'@type'):
 descriptor_content = descriptor_content[1:]
 
-  # strip newlines from annotations
-  annotations = list(map(bytes.strip, annotations))
-
   descriptor_text = bytes.join(b'', descriptor_content)
 
   if is_bridge:
@@ -221,8 +221,7 @@ def _parse_file(descriptor_file, is_bridge = False, 
validate = False, **kwargs):
 yield RelayDescriptor(descriptor_text, validate, annotations, **kwargs)
 else:
   if validate and annotations:
-orphaned_annotations = 
stem.util.str_tools._to_unicode(b'\n'.join(annotations))
-raise ValueError('Content conform to being a server descriptor:\n%s' % 
orphaned_annotations)
+raise ValueError('Content conform to being a server descriptor:\n%s' % 
'\n'.join(annotations))
 
   break  # done parsing descriptors
 

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


[tor-commits] [translation/donatepages-messagespot] Update translations for donatepages-messagespot

2018-12-20 Thread translation
commit 52366ce2625d50c50a4add16ae4558df28fecd32
Author: Translation commit bot 
Date:   Thu Dec 20 18:45:24 2018 +

Update translations for donatepages-messagespot
---
 locale/pt_BR/LC_MESSAGES/messages.po | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/locale/pt_BR/LC_MESSAGES/messages.po 
b/locale/pt_BR/LC_MESSAGES/messages.po
index f07905bd0..0f5c19098 100644
--- a/locale/pt_BR/LC_MESSAGES/messages.po
+++ b/locale/pt_BR/LC_MESSAGES/messages.po
@@ -411,6 +411,8 @@ msgstr ""
 msgid ""
 "The paid staff of the Tor Project is very small: about 47 people in total."
 msgstr ""
+"A equipe remunerada do Projeto Tor é muito pequena: cerca de 47 pessoas no "
+"total."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:90
 msgid ""
@@ -573,6 +575,8 @@ msgid ""
 "I would like to know more about how Tor works, what onion services are, or "
 "how to run a relay."
 msgstr ""
+"Eu gostaria de saber mais sobre como o Tor funciona, o que são serviços de "
+"Onion ou como executar um retransmissor."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:158
 msgid ""
@@ -700,6 +704,9 @@ msgid ""
 " foundations, research institutions, private companies, and over 20,000 "
 "personal donations from people like you."
 msgstr ""
+"O Tor é apoiado por agências de financiamento do governo dos Estados 
Unidos,"
+" ONGs, fundações privadas, instituições de pesquisa, empresas privadas, e 
"
+"quase 20,000 doações pessoais de pessoas como você. "
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:212
 msgid ""
@@ -746,7 +753,7 @@ msgstr "Quanto dinheiro o Projeto Tor gasta anualmente e 
para que é usado?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:228
 msgid "The Tor Project spends about $4 million annually."
-msgstr ""
+msgstr "O Projeto Tor gasta cerca de $4 milhões de dólares anualmente. "
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:230
 #, php-format
@@ -1081,6 +1088,8 @@ msgid ""
 "(Also, if you wanted, you could give us $4,999 in late 2018 and $4,999 in "
 "early 2019.)"
 msgstr ""
+"(No entanto, se você quiser, você poderá nos dar US $4.999 no final de 
2018 "
+"e US $4.999 no início de 2019;)"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:403
 msgid ""
@@ -1254,6 +1263,8 @@ msgid ""
 "Our mailing address is The Tor Project, 217 First Avenue South #4903, "
 "Seattle WA 98194, USA"
 msgstr ""
+"O nosso endereço para correspondência é, Projeto Tor, 217 First Avenue 
South"
+" #4903, Seattle WA 98194, USA"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:486
 msgid "Do you accept cash donations?"
@@ -1841,7 +1852,7 @@ msgstr "Comentários"
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:463
 msgid "Donating:"
-msgstr ""
+msgstr "Doando:"
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:470
 msgid "Donate"
@@ -1907,7 +1918,7 @@ msgstr "Endereço de e-mail inválido."
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:537
 msgid "per month"
-msgstr ""
+msgstr "por mês"
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:551
 msgid "One moment while we shovel coal into our servers."
@@ -1918,6 +1929,8 @@ msgid ""
 "Stand up for the universal human rights to privacy and freedom and help keep"
 " Tor robust and secure."
 msgstr ""
+"Defenda os direitos humanos universais à privacidade e liberdade e ajude a "
+"manter o Tor robusto e seguro."
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:640
 msgid "Mozilla will match your gift and double your impact."

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


[tor-commits] [translation/tor-and-https] Update translations for tor-and-https

2018-12-20 Thread translation
commit b2a9993b42d5f058f43a68ffcba612e7be20ebf6
Author: Translation commit bot 
Date:   Thu Dec 20 17:17:31 2018 +

Update translations for tor-and-https
---
 gl.po | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gl.po b/gl.po
index f5d1ad1e1..98a8a5e65 100644
--- a/gl.po
+++ b/gl.po
@@ -3,10 +3,10 @@
 # Ero Balsa , 2015
 msgid ""
 msgstr ""
-"Project-Id-Version: The Tor Project\n"
+"Project-Id-Version: Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2017-12-26 11:49+\n"
-"Last-Translator: Ero Balsa \n"
+"PO-Revision-Date: 2018-12-20 17:02+\n"
+"Last-Translator: Rodrigo Boado \n"
 "Language-Team: Galician 
(http://www.transifex.com/otf/torproject/language/gl/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -61,7 +61,7 @@ msgstr ""
 #: C/tor-and-https.svg:363
 #, no-wrap
 msgid "WiFi"
-msgstr ""
+msgstr "WiFi"
 
 #. (itstool) path: defs/text
 #. Keep it short: 4em max.

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


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

2018-12-20 Thread translation
commit b54510903068a8b560d9359935375963b7178f85
Author: Translation commit bot 
Date:   Thu Dec 20 17:16:59 2018 +

Update translations for tails-persistence-setup
---
 gl/gl.po | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/gl/gl.po b/gl/gl.po
index 7b4bf89b5..f25ef787d 100644
--- a/gl/gl.po
+++ b/gl/gl.po
@@ -10,11 +10,11 @@
 # Xnake, 2016
 msgid ""
 msgstr ""
-"Project-Id-Version: The Tor Project\n"
+"Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
-"POT-Creation-Date: 2018-08-16 11:14+0200\n"
-"PO-Revision-Date: 2018-08-16 14:16+\n"
-"Last-Translator: Miguel Anxo Bouzada \n"
+"POT-Creation-Date: 2018-11-01 12:21+0100\n"
+"PO-Revision-Date: 2018-12-20 17:12+\n"
+"Last-Translator: Rodrigo Boado \n"
 "Language-Team: Galician 
(http://www.transifex.com/otf/torproject/language/gl/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -212,65 +212,65 @@ msgstr "Crearase un volume persistente %s no dispositivo 
%s %s. Os datos
 msgid "Create"
 msgstr "Crear"
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:141
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:142
 msgid ""
 "Beware! Using persistence has consequences that must be well "
 "understood. Tails can't help you if you use it wrong! See the Encrypted "
 "persistence page of the Tails documentation to learn more."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:169
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:170
 msgid "Passphrase:"
 msgstr "Frase de acceso:"
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:177
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:178
 msgid "Verify Passphrase:"
 msgstr "Comprobe a frase de acceso:"
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:188
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:244
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:189
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:245
 msgid "Passphrase can't be empty"
 msgstr "A frase de acceso non pode estar baleira"
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:235
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:236
 msgid "Passphrases do not match"
 msgstr "As frases de acceso non coinciden"
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:283
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:284
 #: ../lib/Tails/Persistence/Step/Delete.pm:103
 #: ../lib/Tails/Persistence/Step/Configure.pm:181
 msgid "Failed"
 msgstr "Fracasou"
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:291
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:292
 msgid "Mounting Tails persistence partition."
 msgstr "Montaxe da partición de persistencia do Tails."
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:294
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:295
 msgid "The Tails persistence partition will be mounted."
 msgstr "Montarase a partición de persistencia do Tails."
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:303
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:304
 msgid "Correcting permissions of the persistent volume."
 msgstr "A corrixir os permisos do volume persistente."
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:306
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:307
 msgid "The permissions of the persistent volume will be corrected."
 msgstr "Os permisos de volume persistente serán corrixidos."
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:314
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:315
 msgid "Creating default persistence configuration."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:317
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:318
 msgid "The default persistence configuration will be created."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:332
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:333
 msgid "Creating..."
 msgstr "Creando ..."
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:335
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:336
 msgid "Creating the persistent volume..."
 msgstr "Creando o volume persistente ..."
 

___
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 'document_--version'

2018-12-20 Thread nickm
commit 0e6e902cbc2e98028e58c73f7b1a8dece89fc03f
Merge: 5c85ba307 4d9b55907
Author: Nick Mathewson 
Date:   Thu Dec 20 11:50:48 2018 -0500

Merge branch 'document_--version'

 changes/document_version | 2 ++
 doc/tor.1.txt| 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

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


[tor-commits] [tor/master] Document the output of --version

2018-12-20 Thread nickm
commit 508837b62bcb31afbba711ec3dd7b7c18630d604
Author: Nick Mathewson 
Date:   Mon Dec 17 17:54:01 2018 -0500

Document the output of --version

Closes 28889
---
 changes/document_version | 2 ++
 doc/tor.1.txt| 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/changes/document_version b/changes/document_version
new file mode 100644
index 0..a45992b6b
--- /dev/null
+++ b/changes/document_version
@@ -0,0 +1,2 @@
+  o Documentation:
+- Document the exact output of "tor --version". Closes ticket 28889.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 8c419b1a6..4ecc4ee38 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -89,7 +89,8 @@ COMMAND-LINE OPTIONS
 future version. (This is a warning, not a promise.)
 
 [[opt-version]] **--version**::
-Display Tor version and exit.
+Display Tor version and exit. The output is a line of the format,
+"Tor version [version number]."
 
 [[opt-quiet]] **--quiet**|**--hush**::
 Override the default console log.  By default, Tor starts out logging



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


[tor-commits] [tor/master] Even more clarify on --version.

2018-12-20 Thread nickm
commit 4d9b55907c4a5223ea7ef603a87ba6089bf5b3e9
Author: Nick Mathewson 
Date:   Thu Dec 20 11:50:40 2018 -0500

Even more clarify on --version.
---
 doc/tor.1.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 4ecc4ee38..5c0138117 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -89,8 +89,9 @@ COMMAND-LINE OPTIONS
 future version. (This is a warning, not a promise.)
 
 [[opt-version]] **--version**::
-Display Tor version and exit. The output is a line of the format,
-"Tor version [version number]."
+Display Tor version and exit. The output is a single line of the format
+"Tor version [version number]."  (The version number format
+is as specified in version-spec.txt.)
 
 [[opt-quiet]] **--quiet**|**--hush**::
 Override the default console log.  By default, Tor starts out logging



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


[tor-commits] [tor/master] Delay checking process for termination until both stdout and stderr are closed.

2018-12-20 Thread nickm
commit 44586a89ef636b0d3f736e44a1d2fc6497080bfc
Author: Alexander Færøy 
Date:   Thu Dec 20 12:53:28 2018 +0100

Delay checking process for termination until both stdout and stderr are 
closed.

This patch makes us delay checking for whether we have an exit code
value (via GetExitCodeProcess()) until both stdout and stderr have been
closed by the operating system either by the process itself or by
process cleanup after termination.

See: https://bugs.torproject.org/28179
---
 src/lib/process/process_win32.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c
index a09664b50..52acf4937 100644
--- a/src/lib/process/process_win32.c
+++ b/src/lib/process/process_win32.c
@@ -525,6 +525,28 @@ process_win32_timer_test_process(process_t *process)
   BOOL ret = FALSE;
   DWORD exit_code = 0;
 
+  /* Sometimes the Windows kernel wont give us the EOF/Broken Pipe error
+   * message until some time after the process have actually terminated. We
+   * make sure that our ReadFileEx() calls for the process have *all* returned
+   * and both standard out and error have been marked as EOF before we try to
+   * see if the process terminated.
+   *
+   * This ensures that we *never* call the exit callback of the `process_t`,
+   * which potentially ends up calling `process_free()` on our `process_t`,
+   * before all data have been received from the process.
+   *
+   * We do NOT have a check here for whether standard in reached EOF since
+   * standard in's WriteFileEx() function is only called on-demand when we have
+   * something to write and is thus usually not awaiting to finish any
+   * operations. If we WriteFileEx() to a file that has terminated we'll simply
+   * get an error from ReadFileEx() or its completion routine and move on with
+   * life.  */
+  if (! win32_process->stdout_handle.reached_eof)
+return false;
+
+  if (! win32_process->stderr_handle.reached_eof)
+return false;
+
   /* We start by testing whether our process is still running. */
   ret = GetExitCodeProcess(win32_process->process_information.hProcess,
_code);



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


[tor-commits] [tor/master] No need to log ordinary EOF conditions as LOG_WARN.

2018-12-20 Thread nickm
commit 776208896756651519fd6540103c73a369b6d485
Author: Alexander Færøy 
Date:   Thu Dec 20 13:12:53 2018 +0100

No need to log ordinary EOF conditions as LOG_WARN.

Let's not use log_warn() when a pipe is closed under what should be
considered normal conditions.

See: https://bugs.torproject.org/28179
---
 src/lib/process/process_win32.c | 26 ++
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c
index 641af2bb0..d8a895875 100644
--- a/src/lib/process/process_win32.c
+++ b/src/lib/process/process_win32.c
@@ -365,8 +365,17 @@ process_win32_write(struct process_t *process, buf_t 
*buffer)
 process_win32_stdin_write_done);
 
   if (! ret) {
-log_warn(LD_PROCESS, "WriteFileEx() failed: %s",
- format_win32_error(GetLastError()));
+error_code = GetLastError();
+
+/* No need to log at warning level for these two. */
+if (error_code == ERROR_HANDLE_EOF || error_code == ERROR_BROKEN_PIPE) {
+  log_debug(LD_PROCESS, "WriteFileEx() returned EOF from pipe: %s",
+format_win32_error(error_code));
+} else {
+  log_warn(LD_PROCESS, "WriteFileEx() failed: %s",
+   format_win32_error(error_code));
+}
+
 win32_process->stdin_handle.reached_eof = true;
 return 0;
   }
@@ -897,8 +906,17 @@ process_win32_read_from_handle(process_win32_handle_t 
*handle,
callback);
 
   if (! ret) {
-log_warn(LD_PROCESS, "ReadFileEx() failed: %s",
- format_win32_error(GetLastError()));
+error_code = GetLastError();
+
+/* No need to log at warning level for these two. */
+if (error_code == ERROR_HANDLE_EOF || error_code == ERROR_BROKEN_PIPE) {
+  log_debug(LD_PROCESS, "ReadFileEx() returned EOF from pipe: %s",
+format_win32_error(error_code));
+} else {
+  log_warn(LD_PROCESS, "ReadFileEx() failed: %s",
+   format_win32_error(error_code));
+}
+
 handle->reached_eof = true;
 return bytes_available;
   }



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


[tor-commits] [tor/master] Remember to set `reached_eof` when our handles are reporting errors.

2018-12-20 Thread nickm
commit 36e24782f87c25d13b4c918c66cd4affaab8df79
Author: Alexander Færøy 
Date:   Thu Dec 20 13:02:22 2018 +0100

Remember to set `reached_eof` when our handles are reporting errors.

This patch adds some missing calls to set `reached_eof` of our handles
when various error conditions happens or when we close our handle (which
happens at `process_terminate()`.

See: https://bugs.torproject.org/28179
---
 src/lib/process/process_win32.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c
index 71dd4001c..358765f79 100644
--- a/src/lib/process/process_win32.c
+++ b/src/lib/process/process_win32.c
@@ -367,6 +367,7 @@ process_win32_write(struct process_t *process, buf_t 
*buffer)
   if (! ret) {
 log_warn(LD_PROCESS, "WriteFileEx() failed: %s",
  format_win32_error(GetLastError()));
+win32_process->stdin_handle.reached_eof = true;
 return 0;
   }
 
@@ -749,6 +750,7 @@ process_win32_cleanup_handle(process_win32_handle_t *handle)
   if (handle->pipe != INVALID_HANDLE_VALUE) {
 CloseHandle(handle->pipe);
 handle->pipe = INVALID_HANDLE_VALUE;
+handle->reached_eof = true;
   }
 }
 
@@ -930,6 +932,7 @@ process_win32_read_from_handle(process_win32_handle_t 
*handle,
   if (! ret) {
 log_warn(LD_PROCESS, "ReadFileEx() failed: %s",
  format_win32_error(GetLastError()));
+handle->reached_eof = true;
 return bytes_available;
   }
 



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


[tor-commits] [tor/master] Remember to check for whether we actually did exit in tests.

2018-12-20 Thread nickm
commit fe2f4f3ec58ef03e8d3fe802283b848d54b5eb76
Author: Alexander Færøy 
Date:   Thu Dec 20 12:45:52 2018 +0100

Remember to check for whether we actually did exit in tests.

See: https://bugs.torproject.org/28179
---
 src/test/test_process_slow.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_process_slow.c b/src/test/test_process_slow.c
index a1f99bff0..3f8c07f31 100644
--- a/src/test/test_process_slow.c
+++ b/src/test/test_process_slow.c
@@ -242,6 +242,7 @@ test_callbacks(void *arg)
   /* We returned. Let's see what our event loop said. */
   tt_int_op(smartlist_len(process_data->stdout_data), OP_EQ, 12);
   tt_int_op(smartlist_len(process_data->stderr_data), OP_EQ, 3);
+  tt_assert(process_data->did_exit);
   tt_int_op(process_data->exit_code, OP_EQ, 0);
 
   /* Check stdout output. */



___
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 'tor-github/pr/608'

2018-12-20 Thread nickm
commit 5c85ba3077a7ee90b2ac73b1b1afd6555e718382
Merge: 973a5db80 776208896
Author: Nick Mathewson 
Date:   Thu Dec 20 11:42:26 2018 -0500

Merge remote-tracking branch 'tor-github/pr/608'

 src/lib/process/process_win32.c | 160 
 src/test/test_process_slow.c|   1 +
 2 files changed, 114 insertions(+), 47 deletions(-)

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


[tor-commits] [tor/master] Remember to close the child process' ends of the pipes.

2018-12-20 Thread nickm
commit 1d8dcb416c989ad86a1e3ae2aa92f4c2c1339183
Author: Alexander Færøy 
Date:   Thu Dec 20 12:47:04 2018 +0100

Remember to close the child process' ends of the pipes.

This prevents us from leaking the HANDLE for stdout, stderr, and stdin.

See: https://bugs.torproject.org/28179
---
 src/lib/process/process_win32.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c
index c92b0975a..a09664b50 100644
--- a/src/lib/process/process_win32.c
+++ b/src/lib/process/process_win32.c
@@ -248,6 +248,11 @@ process_win32_exec(process_t *process)
   win32_process->stderr_handle.pipe = stderr_pipe_read;
   win32_process->stdin_handle.pipe = stdin_pipe_write;
 
+  /* Close our ends of the pipes that is now owned by the child process. */
+  CloseHandle(stdout_pipe_write);
+  CloseHandle(stderr_pipe_write);
+  CloseHandle(stdin_pipe_read);
+
   /* Used by the callback functions from ReadFileEx() and WriteFileEx() such
* that we can figure out which process_t that was responsible for the event.
*



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


[tor-commits] [tor/master] Handle ERROR_BROKEN_PIPE in completion routines.

2018-12-20 Thread nickm
commit f58e597d42c204e25101143f9618d55aef666edc
Author: Alexander Færøy 
Date:   Thu Dec 20 13:04:49 2018 +0100

Handle ERROR_BROKEN_PIPE in completion routines.

Handle `ERROR_BROKEN_PIPE` from ReadFileEx() and WriteFileEx() in
process_win32_stdin_write_done() and
process_win32_handle_read_completion() instead of in the early handler.
This most importantmly makes sure that `reached_eof` is set to true when
these errors appears.

See: https://bugs.torproject.org/28179
---
 src/lib/process/process_win32.c | 37 ++---
 1 file changed, 6 insertions(+), 31 deletions(-)

diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c
index 358765f79..3b4373f42 100644
--- a/src/lib/process/process_win32.c
+++ b/src/lib/process/process_win32.c
@@ -765,15 +765,6 @@ process_win32_stdout_read_done(DWORD error_code,
   tor_assert(overlapped);
   tor_assert(overlapped->hEvent);
 
-  /* This happens when we have asked ReadFileEx() to read some data, but we
-   * then decided to call CloseHandle() on the HANDLE. This can happen if
-   * someone runs process_free() in the exit_callback of process_t, which means
-   * we cannot call process_get_win32_process() here. */
-  if (error_code == ERROR_BROKEN_PIPE) {
-log_debug(LD_PROCESS, "Process reported broken pipe on standard out");
-return;
-  }
-
   /* Extract our process_t from the hEvent member of OVERLAPPED. */
   process_t *process = (process_t *)overlapped->hEvent;
   process_win32_t *win32_process = process_get_win32_process(process);
@@ -797,15 +788,6 @@ process_win32_stderr_read_done(DWORD error_code,
   tor_assert(overlapped);
   tor_assert(overlapped->hEvent);
 
-  /* This happens when we have asked ReadFileEx() to read some data, but we
-   * then decided to call CloseHandle() on the HANDLE. This can happen if
-   * someone runs process_free() in the exit_callback of process_t, which means
-   * we cannot call process_get_win32_process() here. */
-  if (error_code == ERROR_BROKEN_PIPE) {
-log_debug(LD_PROCESS, "Process reported broken pipe on standard error");
-return;
-  }
-
   /* Extract our process_t from the hEvent member of OVERLAPPED. */
   process_t *process = (process_t *)overlapped->hEvent;
   process_win32_t *win32_process = process_get_win32_process(process);
@@ -831,15 +813,6 @@ process_win32_stdin_write_done(DWORD error_code,
 
   (void)byte_count;
 
-  /* This happens when we have asked WriteFileEx() to write some data, but we
-   * then decided to call CloseHandle() on the HANDLE. This can happen if
-   * someone runs process_free() in the exit_callback of process_t, which means
-   * we cannot call process_get_win32_process() here. */
-  if (error_code == ERROR_BROKEN_PIPE) {
-log_debug(LD_PROCESS, "Process reported broken pipe on standard input");
-return;
-  }
-
   process_t *process = (process_t *)overlapped->hEvent;
   process_win32_t *win32_process = process_get_win32_process(process);
 
@@ -860,7 +833,8 @@ process_win32_stdin_write_done(DWORD error_code,
 
 /* Schedule the next write. */
 process_notify_event_stdin(process);
-  } else if (error_code == ERROR_HANDLE_EOF) {
+  } else if (error_code == ERROR_HANDLE_EOF ||
+ error_code == ERROR_BROKEN_PIPE) {
 /* Our WriteFileEx() call was succesful, but we reached the end of our
  * file.  We mark our handle as having reached EOF and returns. */
 tor_assert(byte_count == 0);
@@ -983,9 +957,10 @@ 
process_win32_handle_read_completion(process_win32_handle_t *handle,
 
 /* Tell our caller to schedule the next read. */
 return true;
-  } else if (error_code == ERROR_HANDLE_EOF) {
-/* Our ReadFileEx() call was succesful, but we reached the end of our file.
- * We mark our handle as having reached EOF and returns. */
+  } else if (error_code == ERROR_HANDLE_EOF ||
+ error_code == ERROR_BROKEN_PIPE) {
+/* Our ReadFileEx() finished, but we reached the end of our file.  We mark
+ * our handle as having reached EOF and returns. */
 tor_assert(byte_count == 0);
 
 handle->reached_eof = true;



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


[tor-commits] [tor/master] Make example CancelIoEx() code use CancelIo().

2018-12-20 Thread nickm
commit 412fbe9f177f742e0e56df612f44261f6771973a
Author: Alexander Færøy 
Date:   Thu Dec 20 13:11:24 2018 +0100

Make example CancelIoEx() code use CancelIo().

This patch changes the CancelIoEx() example code to use CancelIo(),
which is available for older versions of Windows too. I still think the
kernel handles this nicely by sending broken pipes if either side
closes the pipe while I/O operations are pending.

See: https://bugs.torproject.org/28179
---
 src/lib/process/process_win32.c | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c
index 3b4373f42..641af2bb0 100644
--- a/src/lib/process/process_win32.c
+++ b/src/lib/process/process_win32.c
@@ -720,31 +720,24 @@ process_win32_cleanup_handle(process_win32_handle_t 
*handle)
   tor_assert(handle);
 
 #if 0
-  /* FIXME(ahf): My compiler does not set _WIN32_WINNT to a high enough value
-   * for this code to be available. Should we force it? CancelIoEx() is
-   * available from Windows 7 and above. If we decide to require this, we need
-   * to update the checks in all the three I/O completion callbacks to handle
-   * the ERROR_OPERATION_ABORTED as well as ERROR_BROKEN_PIPE. */
-
-#if _WIN32_WINNT >= 0x0600
-  /* This code is only supported from Windows 7 and onwards. */
   BOOL ret;
   DWORD error_code;
 
-  /* Cancel any pending I/O requests. */
-  ret = CancelIoEx(handle->pipe, >overlapped);
+  /* Cancel any pending I/O requests: This means that instead of getting
+   * ERROR_BROKEN_PIPE we get ERROR_OPERATION_ABORTED, but it doesn't seem
+   * like this is needed. */
+  ret = CancelIo(handle->pipe);
 
   if (! ret) {
 error_code = GetLastError();
 
 /* There was no pending I/O requests for our handle. */
 if (error_code != ERROR_NOT_FOUND) {
-  log_warn(LD_PROCESS, "CancelIoEx() failed: %s",
+  log_warn(LD_PROCESS, "CancelIo() failed: %s",
format_win32_error(error_code));
 }
   }
 #endif
-#endif
 
   /* Close our handle. */
   if (handle->pipe != INVALID_HANDLE_VALUE) {



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


[tor-commits] [tor/master] Handle errors even after success from ReadFileEx() and WriteFileEx().

2018-12-20 Thread nickm
commit c6e041e3d8dcc6f887014f9dd8887faebf5f4a49
Author: Alexander Færøy 
Date:   Thu Dec 20 12:57:20 2018 +0100

Handle errors even after success from ReadFileEx() and WriteFileEx().

This patch adds some additional error checking after calls to
ReadFileEx() and WriteFileEx(). I have not managed to get this code to
reach the branch where `error_code` is NOT `ERROR_SUCCESS`, but MSDN
says one should check for this condition so we do so just to be safe.

See: https://bugs.torproject.org/28179
---
 src/lib/process/process_win32.c | 50 +
 1 file changed, 50 insertions(+)

diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c
index 52acf4937..71dd4001c 100644
--- a/src/lib/process/process_win32.c
+++ b/src/lib/process/process_win32.c
@@ -329,6 +329,7 @@ process_win32_write(struct process_t *process, buf_t 
*buffer)
 
   process_win32_t *win32_process = process_get_win32_process(process);
   BOOL ret = FALSE;
+  DWORD error_code = 0;
   const size_t buffer_size = buf_datalen(buffer);
 
   /* Windows is still writing our buffer. */
@@ -350,6 +351,12 @@ process_win32_write(struct process_t *process, buf_t 
*buffer)
   /* Read data from the process_t buffer into our intermediate buffer. */
   buf_get_bytes(buffer, win32_process->stdin_handle.buffer, write_size);
 
+  /* Because of the slightly weird API for WriteFileEx() we must set this to 0
+   * before we call WriteFileEx() because WriteFileEx() does not reset the last
+   * error itself when it's succesful. See comment below after the call to
+   * GetLastError(). */
+  SetLastError(0);
+
   /* Schedule our write. */
   ret = WriteFileEx(win32_process->stdin_handle.pipe,
 win32_process->stdin_handle.buffer,
@@ -363,6 +370,24 @@ process_win32_write(struct process_t *process, buf_t 
*buffer)
 return 0;
   }
 
+  /* Here be dragons: According to MSDN's documentation for WriteFileEx() we
+   * should check GetLastError() after a call to WriteFileEx() even though the
+   * `ret` return value was successful. If everything is good, GetLastError()
+   * returns `ERROR_SUCCESS` and nothing happens.
+   *
+   * XXX(ahf): I have not managed to trigger this code while stress-testing
+   * this code. */
+  error_code = GetLastError();
+
+  if (error_code != ERROR_SUCCESS) {
+/* LCOV_EXCL_START */
+log_warn(LD_PROCESS, "WriteFileEx() failed after returning success: %s",
+ format_win32_error(error_code));
+win32_process->stdin_handle.reached_eof = true;
+return 0;
+/* LCOV_EXCL_STOP */
+  }
+
   /* This cast should be safe since our buffer can maximum be BUFFER_SIZE
* large. */
   return (int)write_size;
@@ -864,6 +889,7 @@ process_win32_read_from_handle(process_win32_handle_t 
*handle,
 
   BOOL ret = FALSE;
   int bytes_available = 0;
+  DWORD error_code = 0;
 
   /* We already have a request to read data that isn't complete yet. */
   if (BUG(handle->busy))
@@ -887,6 +913,12 @@ process_win32_read_from_handle(process_win32_handle_t 
*handle,
 memset(handle->buffer, 0, sizeof(handle->buffer));
   }
 
+  /* Because of the slightly weird API for ReadFileEx() we must set this to 0
+   * before we call ReadFileEx() because ReadFileEx() does not reset the last
+   * error itself when it's succesful. See comment below after the call to
+   * GetLastError(). */
+  SetLastError(0);
+
   /* Ask the Windows kernel to read data from our pipe into our buffer and call
* the callback function when it is done. */
   ret = ReadFileEx(handle->pipe,
@@ -901,6 +933,24 @@ process_win32_read_from_handle(process_win32_handle_t 
*handle,
 return bytes_available;
   }
 
+  /* Here be dragons: According to MSDN's documentation for ReadFileEx() we
+   * should check GetLastError() after a call to ReadFileEx() even though the
+   * `ret` return value was successful. If everything is good, GetLastError()
+   * returns `ERROR_SUCCESS` and nothing happens.
+   *
+   * XXX(ahf): I have not managed to trigger this code while stress-testing
+   * this code. */
+  error_code = GetLastError();
+
+  if (error_code != ERROR_SUCCESS) {
+/* LCOV_EXCL_START */
+log_warn(LD_PROCESS, "ReadFileEx() failed after returning success: %s",
+ format_win32_error(error_code));
+handle->reached_eof = true;
+return bytes_available;
+/* LCOV_EXCL_STOP */
+  }
+
   /* We mark our handle as having a pending I/O request. */
   handle->busy = true;
 



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


[tor-commits] [fuzzing-corpora/master] Add new fuzz_strop cases (base32?)

2018-12-20 Thread nickm
commit a6b615a5c5bff3d26dbe7568e5abd45a1510763b
Author: Nick Mathewson 
Date:   Thu Dec 20 09:09:02 2018 -0500

Add new fuzz_strop cases (base32?)
---
 ...f5474fd732d6cde475ab4bf73d411645f7029cd2f22c9523a4adb84 |   3 +++
 ...2c631ef67718bbba1c9e71082b69200ff9bd96e4768c7ca1a05892e | Bin 0 -> 64 bytes
 ...fec59ad78ae136ce3e1a0b5131f8ca05946568f207f64095a35c73e | Bin 0 -> 9 bytes
 ...fa8f5d234a5a8b232296af100985d17b54d122fbb23e078a2ed2067 | Bin 0 -> 29 bytes
 ...005e1e20b81ebee6bcdd589808a46c1e1e7f37dbc9a933071deee12 |   2 ++
 5 files changed, 5 insertions(+)

diff --git 
a/strops/1bb1cddbff5474fd732d6cde475ab4bf73d411645f7029cd2f22c9523a4adb84 
b/strops/1bb1cddbff5474fd732d6cde475ab4bf73d411645f7029cd2f22c9523a4adb84
new file mode 100644
index 000..b7fb7a4
--- /dev/null
+++ b/strops/1bb1cddbff5474fd732d6cde475ab4bf73d411645f7029cd2f22c9523a4adb84
@@ -0,0 +1,3 @@
+ÿÿ rm=: m=: m:= mm=: m=: mm=: m=: m=ÿ
+:= m
+:= mm=: m=: mm=
\ No newline at end of file
diff --git 
a/strops/5674f46c52c631ef67718bbba1c9e71082b69200ff9bd96e4768c7ca1a05892e 
b/strops/5674f46c52c631ef67718bbba1c9e71082b69200ff9bd96e4768c7ca1a05892e
new file mode 100644
index 000..747169c
Binary files /dev/null and 
b/strops/5674f46c52c631ef67718bbba1c9e71082b69200ff9bd96e4768c7ca1a05892e differ
diff --git 
a/strops/75dcde3dcfec59ad78ae136ce3e1a0b5131f8ca05946568f207f64095a35c73e 
b/strops/75dcde3dcfec59ad78ae136ce3e1a0b5131f8ca05946568f207f64095a35c73e
new file mode 100644
index 000..c3a4af5
Binary files /dev/null and 
b/strops/75dcde3dcfec59ad78ae136ce3e1a0b5131f8ca05946568f207f64095a35c73e differ
diff --git 
a/strops/8ee3a1f1afa8f5d234a5a8b232296af100985d17b54d122fbb23e078a2ed2067 
b/strops/8ee3a1f1afa8f5d234a5a8b232296af100985d17b54d122fbb23e078a2ed2067
new file mode 100644
index 000..52cf04e
Binary files /dev/null and 
b/strops/8ee3a1f1afa8f5d234a5a8b232296af100985d17b54d122fbb23e078a2ed2067 differ
diff --git 
a/strops/96c21813d005e1e20b81ebee6bcdd589808a46c1e1e7f37dbc9a933071deee12 
b/strops/96c21813d005e1e20b81ebee6bcdd589808a46c1e1e7f37dbc9a933071deee12
new file mode 100644
index 000..d642fe5
--- /dev/null
+++ b/strops/96c21813d005e1e20b81ebee6bcdd589808a46c1e1e7f37dbc9a933071deee12
@@ -0,0 +1,2 @@
+ÿÿ rm=: m=: mm=: m:= mm=: m=: mm=: m=: m=ÿ
+:= mm=: m=: mm=
\ No newline at end of file

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


[tor-commits] [webwml/master] deactivate job postings (#28907, #28908)

2018-12-20 Thread hiro
commit fef41936ba802fee67656f59956ba4f340162047
Author: traumschule 
Date:   Wed Dec 19 20:55:12 2018 -0500

deactivate job postings (#28907, #28908)
---
 about/en/jobs.wml | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/about/en/jobs.wml b/about/en/jobs.wml
index 583ece67..d082a48d 100644
--- a/about/en/jobs.wml
+++ b/about/en/jobs.wml
@@ -15,12 +15,11 @@
 # At the moment, we don't have any official open positions. Please 
check back soon, though! In the meantime, you may want to glance at our
 # volunteers page.
 
+
 
 In the past, we looked for the following people:
 
@@ -46,6 +45,9 @@
   Bookkeeper/Payroll Specialist
   Grants Manager
   Grant Writer
+  Metrics data architect
+  Senior Systems Administrator
+  Software Developer
 
 
 About the company:

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


[tor-commits] [metrics-web/master] Remove two unused R files from censorship detector.

2018-12-20 Thread karsten
commit c0a18aab9092c57f107732cb2f97f034909e94d9
Author: Karsten Loesing 
Date:   Thu Dec 20 14:09:24 2018 +0100

Remove two unused R files from censorship detector.

Still part of #21588.
---
 src/main/R/clients/merge-clients.R  | 19 ---
 src/main/R/clients/userstats-detector.R | 18 --
 2 files changed, 37 deletions(-)

diff --git a/src/main/R/clients/merge-clients.R 
b/src/main/R/clients/merge-clients.R
deleted file mode 100644
index cce7e9d..000
--- a/src/main/R/clients/merge-clients.R
+++ /dev/null
@@ -1,19 +0,0 @@
-require(reshape)
-r <- read.csv("userstats-ranges.csv", stringsAsFactors = FALSE)
-r <- melt(r, id.vars = c("date", "country"))
-r <- data.frame(date = r$date, node = "relay", country = r$country,
-  transport = "", version = "",
-  variable = ifelse(r$variable == "maxusers", "upper", "lower"),
-  value = floor(r$value))
-u <- read.csv("userstats.csv", stringsAsFactors = FALSE)
-u <- melt(u, id.vars = c("date", "node", "country", "transport",
-  "version"))
-u <- data.frame(date = u$date, node = u$node, country = u$country,
-  transport = u$transport, version = u$version,
-  variable = ifelse(u$variable == "frac", "frac", "clients"),
-  value = u$value)
-c <- rbind(r, u)
-c <- cast(c, date + node + country + transport + version ~ variable)
-c <- c[order(as.Date(c$date), c$node, c$country, c$transport, c$version), ]
-write.csv(c, "clients.csv", quote = FALSE, row.names = FALSE, na = "")
-
diff --git a/src/main/R/clients/userstats-detector.R 
b/src/main/R/clients/userstats-detector.R
deleted file mode 100644
index c3a9041..000
--- a/src/main/R/clients/userstats-detector.R
+++ /dev/null
@@ -1,18 +0,0 @@
-library("reshape")
-export_userstats_detector <- function(path) {
-  c <- read.csv("userstats.csv", stringsAsFactors = FALSE)
-  c <- c[c$country != '' & c$transport == '' & c$version == '' &
- c$node == 'relay', ]
-  u <- data.frame(country = c$country, date = c$date, users = c$users,
-  stringsAsFactors = FALSE)
-  u <- rbind(u, data.frame(country = "zy",
-aggregate(list(users = u$users),
-  by = list(date = u$date), sum)))
-  u <- data.frame(date = u$date, country = u$country,
-  users = floor(u$users))
-  u <- cast(u, date ~ country, value = "users")
-  names(u)[names(u) == "zy"] <- "all"
-  write.csv(u, path, quote = FALSE, row.names = FALSE)
-}
-export_userstats_detector("userstats-detector.csv")
-

___
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 'tor-github/pr/445'

2018-12-20 Thread nickm
commit 973a5db80851838e4516de40afe028bc10c425f0
Merge: 9c6283732 c659603ac
Author: Nick Mathewson 
Date:   Thu Dec 20 07:53:57 2018 -0500

Merge remote-tracking branch 'tor-github/pr/445'

 changes/ticket27325 |   4 +
 src/core/or/channeltls.c|  98 --
 src/core/or/connection_or.c |  82 +++--
 src/test/include.am |   1 +
 src/test/test.c |   1 +
 src/test/test.h |   1 +
 src/test/test_netinfo.c |  48 +++
 src/trunnel/include.am  |   6 +-
 src/trunnel/netinfo.c   | 723 
 src/trunnel/netinfo.h   | 226 ++
 src/trunnel/netinfo.trunnel |  24 ++
 11 files changed, 1164 insertions(+), 50 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 changes file

2018-12-20 Thread nickm
commit b64e1e602bac5e108e40a284616e3fe7f7597b17
Author: rl1987 
Date:   Sat Sep 22 20:01:15 2018 +0300

Add changes file
---
 changes/ticket27325 | 4 
 1 file changed, 4 insertions(+)

diff --git a/changes/ticket27325 b/changes/ticket27325
new file mode 100644
index 0..2cf2bb7d6
--- /dev/null
+++ b/changes/ticket27325
@@ -0,0 +1,4 @@
+  o Code simplification and refactoring:
+- Reimplement NETINFO cell parsing and generation to rely on
+  trunnel-generated wire format handling code. Closes ticket
+  27325.



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


[tor-commits] [tor/master] Generate NETINFO cell using trunnel

2018-12-20 Thread nickm
commit 5cc86e364f4efbaa39b599e007765fc1770c8010
Author: rl1987 
Date:   Fri Sep 21 17:56:39 2018 +0300

Generate NETINFO cell using trunnel
---
 src/core/or/connection_or.c | 82 +
 1 file changed, 61 insertions(+), 21 deletions(-)

diff --git a/src/core/or/connection_or.c b/src/core/or/connection_or.c
index 65f4e28c9..274cf8590 100644
--- a/src/core/or/connection_or.c
+++ b/src/core/or/connection_or.c
@@ -46,6 +46,7 @@
 #include "lib/geoip/geoip.h"
 #include "core/mainloop/mainloop.h"
 #include "trunnel/link_handshake.h"
+#include "trunnel/netinfo.h"
 #include "feature/nodelist/microdesc.h"
 #include "feature/nodelist/networkstatus.h"
 #include "feature/nodelist/nodelist.h"
@@ -2428,6 +2429,31 @@ connection_or_send_versions(or_connection_t *conn, int 
v3_plus)
   return 0;
 }
 
+static netinfo_addr_t *
+netinfo_addr_from_tor_addr(const tor_addr_t *tor_addr)
+{
+  sa_family_t addr_family = tor_addr_family(tor_addr);
+
+  if (BUG(addr_family != AF_INET && addr_family != AF_INET6))
+return NULL;
+
+  netinfo_addr_t *netinfo_addr = netinfo_addr_new();
+
+  if (addr_family == AF_INET) {
+netinfo_addr_set_addr_type(netinfo_addr, NETINFO_ADDR_TYPE_IPV4);
+netinfo_addr_set_len(netinfo_addr, 4);
+netinfo_addr_set_addr_ipv4(netinfo_addr, tor_addr_to_ipv4h(tor_addr));
+  } else if (addr_family == AF_INET6) {
+netinfo_addr_set_addr_type(netinfo_addr, NETINFO_ADDR_TYPE_IPV6);
+netinfo_addr_set_len(netinfo_addr, 16);
+uint8_t *ipv6_buf = netinfo_addr_getarray_addr_ipv6(netinfo_addr);
+const uint8_t *in6_addr = tor_addr_to_in6_addr8(tor_addr);
+memcpy(ipv6_buf, in6_addr, 16);
+  }
+
+  return netinfo_addr;
+}
+
 /** Send a NETINFO cell on conn, telling the other server what we know
  * about their address, our address, and the current time. */
 MOCK_IMPL(int,
@@ -2436,8 +2462,7 @@ connection_or_send_netinfo,(or_connection_t *conn))
   cell_t cell;
   time_t now = time(NULL);
   const routerinfo_t *me;
-  int len;
-  uint8_t *out;
+  int r = -1;
 
   tor_assert(conn->handshake_state);
 
@@ -2450,20 +2475,21 @@ connection_or_send_netinfo,(or_connection_t *conn))
   memset(, 0, sizeof(cell_t));
   cell.command = CELL_NETINFO;
 
+  netinfo_cell_t *netinfo_cell = netinfo_cell_new();
+
   /* Timestamp, if we're a relay. */
   if (public_server_mode(get_options()) || ! conn->is_outgoing)
-set_uint32(cell.payload, htonl((uint32_t)now));
+netinfo_cell_set_timestamp(netinfo_cell, (uint32_t)now);
 
   /* Their address. */
-  out = cell.payload + 4;
+  const tor_addr_t *remote_tor_addr =
+!tor_addr_is_null(>real_addr) ? >real_addr : >base_.addr;
   /* We use >real_addr below, unless it hasn't yet been set. If it
* hasn't yet been set, we know that base_.addr hasn't been tampered with
* yet either. */
-  len = append_address_to_payload(out, !tor_addr_is_null(>real_addr)
-   ? >real_addr : >base_.addr);
-  if (len<0)
-return -1;
-  out += len;
+  netinfo_addr_t *their_addr = netinfo_addr_from_tor_addr(remote_tor_addr);
+
+  netinfo_cell_set_other_addr(netinfo_cell, their_addr);
 
   /* My address -- only include it if I'm a public relay, or if I'm a
* bridge and this is an incoming connection. If I'm a bridge and this
@@ -2471,28 +2497,42 @@ connection_or_send_netinfo,(or_connection_t *conn))
   if ((public_server_mode(get_options()) || !conn->is_outgoing) &&
   (me = router_get_my_routerinfo())) {
 tor_addr_t my_addr;
-*out++ = 1 + !tor_addr_is_null(>ipv6_addr);
-
 tor_addr_from_ipv4h(_addr, me->addr);
-len = append_address_to_payload(out, _addr);
-if (len < 0)
-  return -1;
-out += len;
+
+uint8_t n_my_addrs = 1 + !tor_addr_is_null(>ipv6_addr);
+netinfo_cell_set_n_my_addrs(netinfo_cell, n_my_addrs);
+
+netinfo_cell_add_my_addrs(netinfo_cell,
+  netinfo_addr_from_tor_addr(_addr));
 
 if (!tor_addr_is_null(>ipv6_addr)) {
-  len = append_address_to_payload(out, >ipv6_addr);
-  if (len < 0)
-return -1;
+  netinfo_cell_add_my_addrs(netinfo_cell,
+netinfo_addr_from_tor_addr(>ipv6_addr));
 }
-  } else {
-*out = 0;
+  }
+
+  const char *errmsg = NULL;
+  if ((errmsg = netinfo_cell_check(netinfo_cell))) {
+log_warn(LD_OR, "Failed to validate NETINFO cell with error: %s",
+errmsg);
+goto cleanup;
+  }
+
+  if (netinfo_cell_encode(cell.payload, CELL_PAYLOAD_SIZE,
+  netinfo_cell) < 0) {
+log_warn(LD_OR, "Failed generating NETINFO cell");
+goto cleanup;
   }
 
   conn->handshake_state->digest_sent_data = 0;
   conn->handshake_state->sent_netinfo = 1;
   connection_or_write_cell_to_buf(, conn);
 
-  return 0;
+  r = 0;
+ cleanup:
+  netinfo_cell_free(netinfo_cell);
+
+  return r;
 }
 
 /** Helper used to add an encoded certs to a cert cell */



___
tor-commits 

[tor-commits] [tor/master] Refrain from hardcoding address length and type in netinfo.trunnel

2018-12-20 Thread nickm
commit 3bec371d04b291ec0351f01eeafdc842ea2a51d6
Author: rl1987 
Date:   Sun Dec 16 10:05:35 2018 +0200

Refrain from hardcoding address length and type in netinfo.trunnel
---
 src/trunnel/netinfo.c   | 30 ++
 src/trunnel/netinfo.trunnel |  6 +++---
 2 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/src/trunnel/netinfo.c b/src/trunnel/netinfo.c
index 170e9bf03..de389eb13 100644
--- a/src/trunnel/netinfo.c
+++ b/src/trunnel/netinfo.c
@@ -34,8 +34,6 @@ netinfo_addr_new(void)
   netinfo_addr_t *val = trunnel_calloc(1, sizeof(netinfo_addr_t));
   if (NULL == val)
 return NULL;
-  val->addr_type = NETINFO_ADDR_TYPE_IPV4;
-  val->len = 4;
   return val;
 }
 
@@ -65,10 +63,6 @@ netinfo_addr_get_addr_type(const netinfo_addr_t *inp)
 int
 netinfo_addr_set_addr_type(netinfo_addr_t *inp, uint8_t val)
 {
-  if (! ((val == NETINFO_ADDR_TYPE_IPV4 || val == NETINFO_ADDR_TYPE_IPV6))) {
- TRUNNEL_SET_ERROR_CODE(inp);
- return -1;
-  }
   inp->addr_type = val;
   return 0;
 }
@@ -80,10 +74,6 @@ netinfo_addr_get_len(const netinfo_addr_t *inp)
 int
 netinfo_addr_set_len(netinfo_addr_t *inp, uint8_t val)
 {
-  if (! ((val == 4 || val == 16))) {
- TRUNNEL_SET_ERROR_CODE(inp);
- return -1;
-  }
   inp->len = val;
   return 0;
 }
@@ -141,10 +131,6 @@ netinfo_addr_check(const netinfo_addr_t *obj)
 return "Object was NULL";
   if (obj->trunnel_error_code_)
 return "A set function failed on this object";
-  if (! (obj->addr_type == NETINFO_ADDR_TYPE_IPV4 || obj->addr_type == 
NETINFO_ADDR_TYPE_IPV6))
-return "Integer out of bounds";
-  if (! (obj->len == 4 || obj->len == 16))
-return "Integer out of bounds";
   switch (obj->addr_type) {
 
 case NETINFO_ADDR_TYPE_IPV4:
@@ -169,10 +155,10 @@ netinfo_addr_encoded_len(const netinfo_addr_t *obj)
  return -1;
 
 
-  /* Length of u8 addr_type IN [NETINFO_ADDR_TYPE_IPV4, 
NETINFO_ADDR_TYPE_IPV6] */
+  /* Length of u8 addr_type */
   result += 1;
 
-  /* Length of u8 len IN [4, 16] */
+  /* Length of u8 len */
   result += 1;
   switch (obj->addr_type) {
 
@@ -219,14 +205,14 @@ netinfo_addr_encode(uint8_t *output, const size_t avail, 
const netinfo_addr_t *o
   trunnel_assert(encoded_len >= 0);
 #endif
 
-  /* Encode u8 addr_type IN [NETINFO_ADDR_TYPE_IPV4, NETINFO_ADDR_TYPE_IPV6] */
+  /* Encode u8 addr_type */
   trunnel_assert(written <= avail);
   if (avail - written < 1)
 goto truncated;
   trunnel_set_uint8(ptr, (obj->addr_type));
   written += 1; ptr += 1;
 
-  /* Encode u8 len IN [4, 16] */
+  /* Encode u8 len */
   trunnel_assert(written <= avail);
   if (avail - written < 1)
 goto truncated;
@@ -296,19 +282,15 @@ netinfo_addr_parse_into(netinfo_addr_t *obj, const 
uint8_t *input, const size_t
   ssize_t result = 0;
   (void)result;
 
-  /* Parse u8 addr_type IN [NETINFO_ADDR_TYPE_IPV4, NETINFO_ADDR_TYPE_IPV6] */
+  /* Parse u8 addr_type */
   CHECK_REMAINING(1, truncated);
   obj->addr_type = (trunnel_get_uint8(ptr));
   remaining -= 1; ptr += 1;
-  if (! (obj->addr_type == NETINFO_ADDR_TYPE_IPV4 || obj->addr_type == 
NETINFO_ADDR_TYPE_IPV6))
-goto fail;
 
-  /* Parse u8 len IN [4, 16] */
+  /* Parse u8 len */
   CHECK_REMAINING(1, truncated);
   obj->len = (trunnel_get_uint8(ptr));
   remaining -= 1; ptr += 1;
-  if (! (obj->len == 4 || obj->len == 16))
-goto fail;
 
   /* Parse union addr[addr_type] */
   switch (obj->addr_type) {
diff --git a/src/trunnel/netinfo.trunnel b/src/trunnel/netinfo.trunnel
index 21afcd136..83c3a9e40 100644
--- a/src/trunnel/netinfo.trunnel
+++ b/src/trunnel/netinfo.trunnel
@@ -5,14 +5,14 @@ const NETINFO_ADDR_TYPE_IPV4 = 4;
 const NETINFO_ADDR_TYPE_IPV6 = 6;
 
 struct netinfo_addr {
-  u8 addr_type IN [NETINFO_ADDR_TYPE_IPV4, NETINFO_ADDR_TYPE_IPV6];
-  u8 len IN [4, 16];
+  u8 addr_type;
+  u8 len;
   union addr[addr_type] {
 NETINFO_ADDR_TYPE_IPV4: u32 ipv4;
 NETINFO_ADDR_TYPE_IPV6: u8 ipv6[16];
 default: fail;
   };
-  
+
 }
 
 struct netinfo_cell {



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


[tor-commits] [tor/master] Add trunnel spec and impl for NETINFO cells

2018-12-20 Thread nickm
commit b59eedc25992f8c460d4c99968a1fbaa28896610
Author: rl1987 
Date:   Fri Sep 21 12:39:11 2018 +0300

Add trunnel spec and impl for NETINFO cells
---
 src/trunnel/include.am  |   6 +-
 src/trunnel/netinfo.c   | 721 
 src/trunnel/netinfo.h   | 226 ++
 src/trunnel/netinfo.trunnel |  21 ++
 4 files changed, 972 insertions(+), 2 deletions(-)

diff --git a/src/trunnel/include.am b/src/trunnel/include.am
index 03c1753e9..b5db0609a 100644
--- a/src/trunnel/include.am
+++ b/src/trunnel/include.am
@@ -23,7 +23,8 @@ TRUNNELSOURCES = \
src/trunnel/hs/cell_introduce1.c \
src/trunnel/hs/cell_rendezvous.c \
src/trunnel/channelpadding_negotiation.c \
-   src/trunnel/socks5.c
+   src/trunnel/socks5.c\
+   src/trunnel/netinfo.c
 
 TRUNNELHEADERS = \
src/ext/trunnel/trunnel.h   \
@@ -37,7 +38,8 @@ TRUNNELHEADERS = \
src/trunnel/hs/cell_introduce1.h \
src/trunnel/hs/cell_rendezvous.h \
src/trunnel/channelpadding_negotiation.h \
-   src/trunnel/socks5.h
+   src/trunnel/socks5.h\
+   src/trunnel/netinfo.h
 
 src_trunnel_libor_trunnel_a_SOURCES = $(TRUNNELSOURCES)
 src_trunnel_libor_trunnel_a_CPPFLAGS = \
diff --git a/src/trunnel/netinfo.c b/src/trunnel/netinfo.c
new file mode 100644
index 0..170e9bf03
--- /dev/null
+++ b/src/trunnel/netinfo.c
@@ -0,0 +1,721 @@
+/* netinfo.c -- generated by Trunnel v1.5.2.
+ * https://gitweb.torproject.org/trunnel.git
+ * You probably shouldn't edit this file.
+ */
+#include 
+#include "trunnel-impl.h"
+
+#include "netinfo.h"
+
+#define TRUNNEL_SET_ERROR_CODE(obj) \
+  do {  \
+(obj)->trunnel_error_code_ = 1; \
+  } while (0)
+
+#if defined(__COVERITY__) || defined(__clang_analyzer__)
+/* If we're running a static analysis tool, we don't want it to complain
+ * that some of our remaining-bytes checks are dead-code. */
+int netinfo_deadcode_dummy__ = 0;
+#define OR_DEADCODE_DUMMY || netinfo_deadcode_dummy__
+#else
+#define OR_DEADCODE_DUMMY
+#endif
+
+#define CHECK_REMAINING(nbytes, label)   \
+  do {   \
+if (remaining < (nbytes) OR_DEADCODE_DUMMY) {\
+  goto label;\
+}\
+  } while (0)
+
+netinfo_addr_t *
+netinfo_addr_new(void)
+{
+  netinfo_addr_t *val = trunnel_calloc(1, sizeof(netinfo_addr_t));
+  if (NULL == val)
+return NULL;
+  val->addr_type = NETINFO_ADDR_TYPE_IPV4;
+  val->len = 4;
+  return val;
+}
+
+/** Release all storage held inside 'obj', but do not free 'obj'.
+ */
+static void
+netinfo_addr_clear(netinfo_addr_t *obj)
+{
+  (void) obj;
+}
+
+void
+netinfo_addr_free(netinfo_addr_t *obj)
+{
+  if (obj == NULL)
+return;
+  netinfo_addr_clear(obj);
+  trunnel_memwipe(obj, sizeof(netinfo_addr_t));
+  trunnel_free_(obj);
+}
+
+uint8_t
+netinfo_addr_get_addr_type(const netinfo_addr_t *inp)
+{
+  return inp->addr_type;
+}
+int
+netinfo_addr_set_addr_type(netinfo_addr_t *inp, uint8_t val)
+{
+  if (! ((val == NETINFO_ADDR_TYPE_IPV4 || val == NETINFO_ADDR_TYPE_IPV6))) {
+ TRUNNEL_SET_ERROR_CODE(inp);
+ return -1;
+  }
+  inp->addr_type = val;
+  return 0;
+}
+uint8_t
+netinfo_addr_get_len(const netinfo_addr_t *inp)
+{
+  return inp->len;
+}
+int
+netinfo_addr_set_len(netinfo_addr_t *inp, uint8_t val)
+{
+  if (! ((val == 4 || val == 16))) {
+ TRUNNEL_SET_ERROR_CODE(inp);
+ return -1;
+  }
+  inp->len = val;
+  return 0;
+}
+uint32_t
+netinfo_addr_get_addr_ipv4(const netinfo_addr_t *inp)
+{
+  return inp->addr_ipv4;
+}
+int
+netinfo_addr_set_addr_ipv4(netinfo_addr_t *inp, uint32_t val)
+{
+  inp->addr_ipv4 = val;
+  return 0;
+}
+size_t
+netinfo_addr_getlen_addr_ipv6(const netinfo_addr_t *inp)
+{
+  (void)inp;  return 16;
+}
+
+uint8_t
+netinfo_addr_get_addr_ipv6(netinfo_addr_t *inp, size_t idx)
+{
+  trunnel_assert(idx < 16);
+  return inp->addr_ipv6[idx];
+}
+
+uint8_t
+netinfo_addr_getconst_addr_ipv6(const netinfo_addr_t *inp, size_t idx)
+{
+  return netinfo_addr_get_addr_ipv6((netinfo_addr_t*)inp, idx);
+}
+int
+netinfo_addr_set_addr_ipv6(netinfo_addr_t *inp, size_t idx, uint8_t elt)
+{
+  trunnel_assert(idx < 16);
+  inp->addr_ipv6[idx] = elt;
+  return 0;
+}
+
+uint8_t *
+netinfo_addr_getarray_addr_ipv6(netinfo_addr_t *inp)
+{
+  return inp->addr_ipv6;
+}
+const uint8_t  *
+netinfo_addr_getconstarray_addr_ipv6(const netinfo_addr_t *inp)
+{
+  return (const uint8_t  
*)netinfo_addr_getarray_addr_ipv6((netinfo_addr_t*)inp);
+}
+const char *
+netinfo_addr_check(const netinfo_addr_t *obj)
+{
+  if (obj == NULL)
+return "Object was NULL";
+  if (obj->trunnel_error_code_)
+return "A set function failed on this object";
+  if (! (obj->addr_type == NETINFO_ADDR_TYPE_IPV4 || obj->addr_type == 

[tor-commits] [tor/master] Unit test to check that we can parse NETINFO cell with unsupported address type

2018-12-20 Thread nickm
commit c659603ac5a428d93ea625aa28b6b51ef9f2f9b3
Author: rl1987 
Date:   Tue Dec 18 12:11:33 2018 +0200

Unit test to check that we can parse NETINFO cell with unsupported address 
type
---
 src/test/test_netinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_netinfo.c b/src/test/test_netinfo.c
index 1fee2a1eb..8fc5330a4 100644
--- a/src/test/test_netinfo.c
+++ b/src/test/test_netinfo.c
@@ -2,7 +2,7 @@
 /* See LICENSE for licensing information */
 
 #include "orconfig.h"
-#include "core/or/or.h" // XXX: is this needed?
+#include "core/or/or.h"
 #include "trunnel/netinfo.h"
 #include "test/test.h"
 



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


[tor-commits] [tor/master] Refrain from closing connection if found one unrecognized address in NETINFO cell

2018-12-20 Thread nickm
commit 5b2acbec0e50a1858c43d0cafe9c4696152cde27
Author: rl1987 
Date:   Sun Dec 16 10:19:37 2018 +0200

Refrain from closing connection if found one unrecognized address in 
NETINFO cell
---
 src/core/or/channeltls.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c
index 392e78506..8f407d5e1 100644
--- a/src/core/or/channeltls.c
+++ b/src/core/or/channeltls.c
@@ -1809,10 +1809,8 @@ channel_tls_process_netinfo_cell(cell_t *cell, 
channel_tls_t *chan)
 
 if (tor_addr_from_netinfo_addr(, netinfo_addr) == -1) {
   log_fn(LOG_PROTOCOL_WARN,  LD_OR,
- "Bad address in netinfo cell; closing connection.");
-  connection_or_close_for_error(chan->conn, 0);
-  netinfo_cell_free(netinfo_cell);
-  return;
+ "Bad address in netinfo cell; Skipping.");
+  continue;
 }
 /* A relay can connect from anywhere and be canonical, so
  * long as it tells you from where it came. This may sound a bit



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


[tor-commits] [tor/master] Actually allow unrecognized address types in NETINFO cell

2018-12-20 Thread nickm
commit c92c0cbc9f7a1ad889cfdda6943ca484d110438e
Author: rl1987 
Date:   Tue Dec 18 11:58:40 2018 +0200

Actually allow unrecognized address types in NETINFO cell

Ignore the address value instead of failing with error condition in case
unrecognized address type is found.
---
 src/test/include.am |   1 +
 src/test/test.c |   1 +
 src/test/test.h |   1 +
 src/test/test_netinfo.c |  48 +
 src/trunnel/netinfo.c   | 124 +---
 src/trunnel/netinfo.trunnel |   4 +-
 6 files changed, 125 insertions(+), 54 deletions(-)

diff --git a/src/test/include.am b/src/test/include.am
index dd2986c67..d90d78d58 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -147,6 +147,7 @@ src_test_test_SOURCES += \
src/test/test_logging.c \
src/test/test_mainloop.c \
src/test/test_microdesc.c \
+   src/test/test_netinfo.c \
src/test/test_nodelist.c \
src/test/test_oom.c \
src/test/test_oos.c \
diff --git a/src/test/test.c b/src/test/test.c
index 17b736d30..7f4f6017e 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -890,6 +890,7 @@ struct testgroup_t testgroups[] = {
   { "legacy_hs/", hs_tests },
   { "link-handshake/", link_handshake_tests },
   { "mainloop/", mainloop_tests },
+  { "netinfo/", netinfo_tests },
   { "nodelist/", nodelist_tests },
   { "oom/", oom_tests },
   { "oos/", oos_tests },
diff --git a/src/test/test.h b/src/test/test.h
index 092356f0f..970a9b555 100644
--- a/src/test/test.h
+++ b/src/test/test.h
@@ -232,6 +232,7 @@ extern struct testcase_t link_handshake_tests[];
 extern struct testcase_t logging_tests[];
 extern struct testcase_t mainloop_tests[];
 extern struct testcase_t microdesc_tests[];
+extern struct testcase_t netinfo_tests[];
 extern struct testcase_t nodelist_tests[];
 extern struct testcase_t oom_tests[];
 extern struct testcase_t oos_tests[];
diff --git a/src/test/test_netinfo.c b/src/test/test_netinfo.c
new file mode 100644
index 0..1fee2a1eb
--- /dev/null
+++ b/src/test/test_netinfo.c
@@ -0,0 +1,48 @@
+/* Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#include "orconfig.h"
+#include "core/or/or.h" // XXX: is this needed?
+#include "trunnel/netinfo.h"
+#include "test/test.h"
+
+static void
+test_netinfo_unsupported_addr(void *arg)
+{
+  const uint8_t wire_data[] =
+{ // TIME
+  0x00, 0x00, 0x00, 0x01,
+  // OTHERADDR
+  0x04, // ATYPE
+  0x04, // ALEN
+  0x08, 0x08, 0x08, 0x08, // AVAL
+  0x01, // NMYADDR
+  0x03, // ATYPE (unsupported)
+  0x05, // ALEN
+  'a', 'd', 'r', 'r', '!' // AVAL (unsupported)
+};
+
+  (void)arg;
+
+  netinfo_cell_t *parsed_cell = NULL;
+
+  ssize_t parsed = netinfo_cell_parse(_cell, wire_data,
+  sizeof(wire_data));
+
+  tt_assert(parsed == sizeof(wire_data));
+
+  netinfo_addr_t *addr = netinfo_cell_get_my_addrs(parsed_cell, 0);
+  tt_assert(addr);
+
+  tt_int_op(3, OP_EQ, netinfo_addr_get_addr_type(addr));
+  tt_int_op(5, OP_EQ, netinfo_addr_get_len(addr));
+
+ done:
+  netinfo_cell_free(parsed_cell);
+}
+
+struct testcase_t netinfo_tests[] = {
+  { "unsupported_addr", test_netinfo_unsupported_addr, 0, NULL, NULL },
+  END_OF_TESTCASES
+};
+
diff --git a/src/trunnel/netinfo.c b/src/trunnel/netinfo.c
index de389eb13..5d815b9b1 100644
--- a/src/trunnel/netinfo.c
+++ b/src/trunnel/netinfo.c
@@ -140,7 +140,6 @@ netinfo_addr_check(const netinfo_addr_t *obj)
   break;
 
 default:
-return "Bad tag for union";
   break;
   }
   return NULL;
@@ -175,7 +174,6 @@ netinfo_addr_encoded_len(const netinfo_addr_t *obj)
   break;
 
 default:
-  trunnel_assert(0);
   break;
   }
   return result;
@@ -198,6 +196,8 @@ netinfo_addr_encode(uint8_t *output, const size_t avail, 
const netinfo_addr_t *o
   const ssize_t encoded_len = netinfo_addr_encoded_len(obj);
 #endif
 
+  uint8_t *backptr_len = NULL;
+
   if (NULL != (msg = netinfo_addr_check(obj)))
 goto check_failed;
 
@@ -213,39 +213,49 @@ netinfo_addr_encode(uint8_t *output, const size_t avail, 
const netinfo_addr_t *o
   written += 1; ptr += 1;
 
   /* Encode u8 len */
+  backptr_len = ptr;
   trunnel_assert(written <= avail);
   if (avail - written < 1)
 goto truncated;
   trunnel_set_uint8(ptr, (obj->len));
   written += 1; ptr += 1;
-
-  /* Encode union addr[addr_type] */
-  trunnel_assert(written <= avail);
-  switch (obj->addr_type) {
-
-case NETINFO_ADDR_TYPE_IPV4:
-
-  /* Encode u32 addr_ipv4 */
-  trunnel_assert(written <= avail);
-  if (avail - written < 4)
-goto truncated;
-  trunnel_set_uint32(ptr, trunnel_htonl(obj->addr_ipv4));
-  written += 4; ptr += 4;
-  break;
-
-case NETINFO_ADDR_TYPE_IPV6:
-
-  /* Encode u8 addr_ipv6[16] */
-  trunnel_assert(written <= avail);
-  if (avail - written < 16)
-goto truncated;
-  

[tor-commits] [tor/master] Add a comment about address type field to netinfo.trunnel

2018-12-20 Thread nickm
commit bdf6540edf5b9d3d45214393412b8fe7e42da5ca
Author: rl1987 
Date:   Fri Oct 26 11:30:26 2018 +0300

Add a comment about address type field to netinfo.trunnel
---
 src/trunnel/netinfo.trunnel | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/trunnel/netinfo.trunnel b/src/trunnel/netinfo.trunnel
index 9c80fcc53..21afcd136 100644
--- a/src/trunnel/netinfo.trunnel
+++ b/src/trunnel/netinfo.trunnel
@@ -1,3 +1,6 @@
+// Warning: make sure these values are consistent with RESOLVED_TYPE_*
+// constants in Tor code and numbers in Section 6.4 of tor-spec.txt.
+
 const NETINFO_ADDR_TYPE_IPV4 = 4;
 const NETINFO_ADDR_TYPE_IPV6 = 6;
 



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


[tor-commits] [tor/master] Use trunnel for NETINFO cell parsing

2018-12-20 Thread nickm
commit d3e6112bb2536f0437cabc3e675177a95d3e374c
Author: rl1987 
Date:   Fri Sep 21 14:58:19 2018 +0300

Use trunnel for NETINFO cell parsing
---
 src/core/or/channeltls.c | 94 +++-
 1 file changed, 70 insertions(+), 24 deletions(-)

diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c
index 883acacf3..392e78506 100644
--- a/src/core/or/channeltls.c
+++ b/src/core/or/channeltls.c
@@ -59,6 +59,7 @@
 #include "feature/nodelist/torcert.h"
 #include "feature/nodelist/networkstatus.h"
 #include "trunnel/channelpadding_negotiation.h"
+#include "trunnel/netinfo.h"
 #include "core/or/channelpadding.h"
 
 #include "core/or/cell_st.h"
@@ -1637,6 +1638,35 @@ channel_tls_process_padding_negotiate_cell(cell_t *cell, 
channel_tls_t *chan)
 }
 
 /**
+ * Convert netinfo_addr into corresponding tor_addr.
+ * Return 0 on success; on failure, return -1 and log a warning.
+ */
+static int
+tor_addr_from_netinfo_addr(tor_addr_t *tor_addr,
+   const netinfo_addr_t *netinfo_addr) {
+  tor_assert(tor_addr);
+  tor_assert(netinfo_addr);
+
+  uint8_t type = netinfo_addr_get_addr_type(netinfo_addr);
+  uint8_t len = netinfo_addr_get_len(netinfo_addr);
+
+  if (type == NETINFO_ADDR_TYPE_IPV4 && len == 4)  {
+uint32_t ipv4 = netinfo_addr_get_addr_ipv4(netinfo_addr);
+tor_addr_from_ipv4h(tor_addr, ipv4);
+  } else if (type == NETINFO_ADDR_TYPE_IPV6 && len == 16) {
+const uint8_t *ipv6_bytes = netinfo_addr_getconstarray_addr_ipv6(
+  netinfo_addr);
+tor_addr_from_ipv6_bytes(tor_addr, (const char *)ipv6_bytes);
+  } else {
+log_fn(LOG_PROTOCOL_WARN, LD_OR, "Cannot read address from NETINFO "
+ "- wrong type/length.");
+return -1;
+  }
+
+  return 0;
+}
+
+/**
  * Process a 'netinfo' cell.
  *
  * This function is called to handle an incoming NETINFO cell; read and act
@@ -1648,8 +1678,6 @@ channel_tls_process_netinfo_cell(cell_t *cell, 
channel_tls_t *chan)
   time_t timestamp;
   uint8_t my_addr_type;
   uint8_t my_addr_len;
-  const uint8_t *my_addr_ptr;
-  const uint8_t *cp, *end;
   uint8_t n_other_addrs;
   time_t now = time(NULL);
   const routerinfo_t *me = router_get_my_routerinfo();
@@ -1720,34 +1748,48 @@ channel_tls_process_netinfo_cell(cell_t *cell, 
channel_tls_t *chan)
   }
 
   /* Decode the cell. */
-  timestamp = ntohl(get_uint32(cell->payload));
-  if (labs(now - chan->conn->handshake_state->sent_versions_at) < 180) {
-apparent_skew = now - timestamp;
+  netinfo_cell_t *netinfo_cell = NULL;
+
+  ssize_t parsed = netinfo_cell_parse(_cell, cell->payload,
+  CELL_PAYLOAD_SIZE);
+
+  if (parsed < 0) {
+log_fn(LOG_PROTOCOL_WARN, LD_OR,
+   "Failed to parse NETINFO cell - closing connection.");
+connection_or_close_for_error(chan->conn, 0);
+return;
   }
 
-  my_addr_type = (uint8_t) cell->payload[4];
-  my_addr_len = (uint8_t) cell->payload[5];
-  my_addr_ptr = (uint8_t*) cell->payload + 6;
-  end = cell->payload + CELL_PAYLOAD_SIZE;
-  cp = cell->payload + 6 + my_addr_len;
+  timestamp = netinfo_cell_get_timestamp(netinfo_cell);
+
+  const netinfo_addr_t *my_addr =
+netinfo_cell_getconst_other_addr(netinfo_cell);
 
+  my_addr_type = netinfo_addr_get_addr_type(my_addr);
+  my_addr_len = netinfo_addr_get_len(my_addr);
+
+  if (labs(now - chan->conn->handshake_state->sent_versions_at) < 180) {
+apparent_skew = now - timestamp;
+  }
   /* We used to check:
*if (my_addr_len >= CELL_PAYLOAD_SIZE - 6) {
*
* This is actually never going to happen, since my_addr_len is at most 255,
* and CELL_PAYLOAD_LEN - 6 is 503.  So we know that cp is < end. */
 
-  if (my_addr_type == RESOLVED_TYPE_IPV4 && my_addr_len == 4) {
-tor_addr_from_ipv4n(_apparent_addr, get_uint32(my_addr_ptr));
+  if (tor_addr_from_netinfo_addr(_apparent_addr, my_addr) == -1) {
+connection_or_close_for_error(chan->conn, 0);
+netinfo_cell_free(netinfo_cell);
+return;
+  }
 
+  if (my_addr_type == NETINFO_ADDR_TYPE_IPV4 && my_addr_len == 4) {
 if (!get_options()->BridgeRelay && me &&
-get_uint32(my_addr_ptr) == htonl(me->addr)) {
+tor_addr_eq_ipv4h(_apparent_addr, me->addr)) {
   TLS_CHAN_TO_BASE(chan)->is_canonical_to_peer = 1;
 }
-
-  } else if (my_addr_type == RESOLVED_TYPE_IPV6 && my_addr_len == 16) {
-tor_addr_from_ipv6_bytes(_apparent_addr, (const char *) my_addr_ptr);
-
+  } else if (my_addr_type == NETINFO_ADDR_TYPE_IPV6 &&
+ my_addr_len == 16) {
 if (!get_options()->BridgeRelay && me &&
 !tor_addr_is_null(>ipv6_addr) &&
 tor_addr_eq(_apparent_addr, >ipv6_addr)) {
@@ -1755,17 +1797,21 @@ channel_tls_process_netinfo_cell(cell_t *cell, 
channel_tls_t *chan)
 }
   }
 
-  n_other_addrs = (uint8_t) *cp++;
-  while (n_other_addrs && cp < end-2) {
+  n_other_addrs = netinfo_cell_get_n_my_addrs(netinfo_cell);
+  for (uint8_t i = 

[tor-commits] [torspec/master] Update syntax that describes NETINFO cell

2018-12-20 Thread nickm
commit 11d0fb3de4935bc6b60c65924a245977257d3237
Author: rl1987 
Date:   Thu Dec 6 15:05:31 2018 +0200

Update syntax that describes NETINFO cell
---
 tor-spec.txt | 31 +--
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/tor-spec.txt b/tor-spec.txt
index 9203842..07b2c42 100644
--- a/tor-spec.txt
+++ b/tor-spec.txt
@@ -852,20 +852,23 @@ see tor-design.pdf.
If version 2 or higher is negotiated, each party sends the other a
NETINFO cell.  The cell's payload is:
 
- Timestamp  [4 bytes]
- Other OR's address [variable]
- Number of addresses[1 byte]
- This OR's addresses[variable]
-
-   The address format is as follows:
- Type [1 byte]
-   * 0x04 - IPv4
-   * 0x06 - IPv6
- Length (size of Value field) [1 byte]
-   * 4 if Type is IPv4
-   * 16 if Type is IPv6
- Value [Variable-width]
-   * Address value in network byte order.
+  TIME   (Timestamp) [4 bytes]
+  OTHERADDR  (Other OR's address)[variable]
+ ATYPE   (Address type)  [1 byte]
+ ALEN(Adress length) [1 byte]
+ AVAL(Address value in NBO)  [ALEN bytes]
+  NMYADDR(Number of this OR's addresses) [1 byte]
+NMYADDR times:
+  ATYPE   (Address type) [1 byte]
+  ALEN(Adress length)[1 byte]
+  AVAL(Address value in NBO))[ALEN bytes]
+
+   Recognized address types (ATYPE) are:
+ [04] IPv4.
+ [06] IPv6.
+
+   ALEN MUST be 4 when ATYPE is 0x04 (IPv4) and 16 when ATYPE is 0x06
+   (IPv6).
 
The timestamp is a big-endian unsigned integer number of seconds
since the Unix epoch. Implementations MUST ignore unexpected bytes



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


[tor-commits] [torspec/master] Reword address format definition in section 4.5

2018-12-20 Thread nickm
commit 7282e122886e9198e8a9fb368252e9e99dde6eb9
Author: rl1987 
Date:   Thu Nov 29 12:19:33 2018 +0200

Reword address format definition in section 4.5

Let's refrain from mentioning section 6.4 in here, as the format
is not exactly the same - not all address type field values from
section 6.4 make sense in NETINFO cell and NETINFO cell does not
have a TTL value at the end of each address. It's a little confusing
to suggest that there is a reuse of wire format fragment between
RELAY_RESOLVED and NETINFO cells.
---
 tor-spec.txt | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/tor-spec.txt b/tor-spec.txt
index 97d5159..9203842 100644
--- a/tor-spec.txt
+++ b/tor-spec.txt
@@ -857,10 +857,19 @@ see tor-design.pdf.
  Number of addresses[1 byte]
  This OR's addresses[variable]
 
-   The address format is a type/length/value sequence as given in
-   section 6.4 below, without the final TTL.  The timestamp is a
-   big-endian unsigned integer number of seconds since the Unix epoch.
-   Implementations MUST ignore unexpected bytes at the end of the cell.
+   The address format is as follows:
+ Type [1 byte]
+   * 0x04 - IPv4
+   * 0x06 - IPv6
+ Length (size of Value field) [1 byte]
+   * 4 if Type is IPv4
+   * 16 if Type is IPv6
+ Value [Variable-width]
+   * Address value in network byte order.
+
+   The timestamp is a big-endian unsigned integer number of seconds
+   since the Unix epoch. Implementations MUST ignore unexpected bytes
+   at the end of the cell.
 
Implementations MAY use the timestamp value to help decide if their
clocks are skewed.  Initiators MAY use "other OR's address" to help



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


[tor-commits] [torspec/master] Merge remote-tracking branch 'tor-github/pr/46'

2018-12-20 Thread nickm
commit ecf241e224f8be825df43e0fa6475b8689f21ebf
Merge: 18fcb9a 11d0fb3
Author: Nick Mathewson 
Date:   Thu Dec 20 07:54:39 2018 -0500

Merge remote-tracking branch 'tor-github/pr/46'

 tor-spec.txt | 30 +-
 1 file changed, 21 insertions(+), 9 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.5] Stop running stem's unit tests as part of "make test-stem"

2018-12-20 Thread nickm
commit 02009c66c011f16fe051cbe32d79f6e59daee8d2
Author: teor 
Date:   Thu Dec 20 13:01:18 2018 +1000

Stop running stem's unit tests as part of "make test-stem"

But continue to run stem's unit and online tests during
"make test-stem-full".

Fixes bug 28568; bugfix on 0.2.6.3-alpha.
---
 Makefile.am  | 2 +-
 changes/bug28568 | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index e4be3f26f..c5b2f5f93 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -139,7 +139,7 @@ need-stem-path:
fi
 
 test-stem: need-stem-path $(TESTING_TOR_BINARY)
-   @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor 
"$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL;
+   @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor 
"$(TESTING_TOR_BINARY)" --integ --log notice --target RUN_ALL;
 
 test-stem-full: need-stem-path $(TESTING_TOR_BINARY)
@$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor 
"$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL,ONLINE -v;
diff --git a/changes/bug28568 b/changes/bug28568
new file mode 100644
index 0..919ec0890
--- /dev/null
+++ b/changes/bug28568
@@ -0,0 +1,4 @@
+  o Minor bugfixes (testing):
+- Stop running stem's unit tests as part of "make test-stem". But continue
+  to run stem's unit and online tests during "make test-stem-full".
+  Fixes bug 28568; bugfix on 0.2.6.3-alpha.



___
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 'tor-github/pr/607' into maint-0.3.5

2018-12-20 Thread nickm
commit ef975432703754ca8ea10ac6db5ec171447bb345
Merge: b7018b1a2 02009c66c
Author: Nick Mathewson 
Date:   Thu Dec 20 07:49:59 2018 -0500

Merge remote-tracking branch 'tor-github/pr/607' into maint-0.3.5

 Makefile.am  | 2 +-
 changes/bug28568 | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)




___
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.5] Merge branch 'maint-0.3.5' into release-0.3.5

2018-12-20 Thread nickm
commit 57931fae0a50d2b429fc4c8edf23e6dc96e45417
Merge: bc6f14913 ef9754327
Author: Nick Mathewson 
Date:   Thu Dec 20 07:50:04 2018 -0500

Merge branch 'maint-0.3.5' into release-0.3.5

 Makefile.am  | 2 +-
 changes/bug28568 | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

___
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.5] Merge remote-tracking branch 'tor-github/pr/607' into maint-0.3.5

2018-12-20 Thread nickm
commit ef975432703754ca8ea10ac6db5ec171447bb345
Merge: b7018b1a2 02009c66c
Author: Nick Mathewson 
Date:   Thu Dec 20 07:49:59 2018 -0500

Merge remote-tracking branch 'tor-github/pr/607' into maint-0.3.5

 Makefile.am  | 2 +-
 changes/bug28568 | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)




___
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.5] Stop running stem's unit tests as part of "make test-stem"

2018-12-20 Thread nickm
commit 02009c66c011f16fe051cbe32d79f6e59daee8d2
Author: teor 
Date:   Thu Dec 20 13:01:18 2018 +1000

Stop running stem's unit tests as part of "make test-stem"

But continue to run stem's unit and online tests during
"make test-stem-full".

Fixes bug 28568; bugfix on 0.2.6.3-alpha.
---
 Makefile.am  | 2 +-
 changes/bug28568 | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index e4be3f26f..c5b2f5f93 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -139,7 +139,7 @@ need-stem-path:
fi
 
 test-stem: need-stem-path $(TESTING_TOR_BINARY)
-   @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor 
"$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL;
+   @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor 
"$(TESTING_TOR_BINARY)" --integ --log notice --target RUN_ALL;
 
 test-stem-full: need-stem-path $(TESTING_TOR_BINARY)
@$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor 
"$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL,ONLINE -v;
diff --git a/changes/bug28568 b/changes/bug28568
new file mode 100644
index 0..919ec0890
--- /dev/null
+++ b/changes/bug28568
@@ -0,0 +1,4 @@
+  o Minor bugfixes (testing):
+- Stop running stem's unit tests as part of "make test-stem". But continue
+  to run stem's unit and online tests during "make test-stem-full".
+  Fixes bug 28568; bugfix on 0.2.6.3-alpha.



___
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.5] Merge remote-tracking branch 'tor-github/pr/607' into maint-0.3.5

2018-12-20 Thread nickm
commit ef975432703754ca8ea10ac6db5ec171447bb345
Merge: b7018b1a2 02009c66c
Author: Nick Mathewson 
Date:   Thu Dec 20 07:49:59 2018 -0500

Merge remote-tracking branch 'tor-github/pr/607' into maint-0.3.5

 Makefile.am  | 2 +-
 changes/bug28568 | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

___
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.5'

2018-12-20 Thread nickm
commit 9c6283732a376b21d110f1ef95b4b2af423a8e59
Merge: 1c47459e5 ef9754327
Author: Nick Mathewson 
Date:   Thu Dec 20 07:50:04 2018 -0500

Merge branch 'maint-0.3.5'

 Makefile.am  | 2 +-
 changes/bug28568 | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

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


[tor-commits] [tor/master] Stop running stem's unit tests as part of "make test-stem"

2018-12-20 Thread nickm
commit 02009c66c011f16fe051cbe32d79f6e59daee8d2
Author: teor 
Date:   Thu Dec 20 13:01:18 2018 +1000

Stop running stem's unit tests as part of "make test-stem"

But continue to run stem's unit and online tests during
"make test-stem-full".

Fixes bug 28568; bugfix on 0.2.6.3-alpha.
---
 Makefile.am  | 2 +-
 changes/bug28568 | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index e4be3f26f..c5b2f5f93 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -139,7 +139,7 @@ need-stem-path:
fi
 
 test-stem: need-stem-path $(TESTING_TOR_BINARY)
-   @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor 
"$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL;
+   @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor 
"$(TESTING_TOR_BINARY)" --integ --log notice --target RUN_ALL;
 
 test-stem-full: need-stem-path $(TESTING_TOR_BINARY)
@$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor 
"$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL,ONLINE -v;
diff --git a/changes/bug28568 b/changes/bug28568
new file mode 100644
index 0..919ec0890
--- /dev/null
+++ b/changes/bug28568
@@ -0,0 +1,4 @@
+  o Minor bugfixes (testing):
+- Stop running stem's unit tests as part of "make test-stem". But continue
+  to run stem's unit and online tests during "make test-stem-full".
+  Fixes bug 28568; bugfix on 0.2.6.3-alpha.



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


[tor-commits] [metrics-web/master] Access userstats database from Java only.

2018-12-20 Thread karsten
commit f5ef5fb0d8f46e28dc7e8536a11d95d43ee61c08
Author: Karsten Loesing 
Date:   Sat Dec 8 11:06:17 2018 +0100

Access userstats database from Java only.

Previously, we used Java to write .sql files, imported them using
psql, and afterwards made queries via psql. Now we're using Java to
interact with the database directly. This is another step towards
making the daily updater Java-only.
---
 build.xml  |  22 ---
 .../torproject/metrics/stats/clients/Database.java | 156 
 .../org/torproject/metrics/stats/clients/Main.java | 206 +++--
 .../torproject/metrics/stats/clients/Writer.java   |  42 +
 4 files changed, 263 insertions(+), 163 deletions(-)

diff --git a/build.xml b/build.xml
index 250417e..6736e19 100644
--- a/build.xml
+++ b/build.xml
@@ -367,28 +367,6 @@
 
 
 
-
-  
-  
-  
-
-
-
-  
-  
-  
-
-
-
-  
-  
-  
-
 
 
   
diff --git a/src/main/java/org/torproject/metrics/stats/clients/Database.java 
b/src/main/java/org/torproject/metrics/stats/clients/Database.java
new file mode 100644
index 000..7e783dc
--- /dev/null
+++ b/src/main/java/org/torproject/metrics/stats/clients/Database.java
@@ -0,0 +1,156 @@
+/* Copyright 2017--2018 The Tor Project
+ * See LICENSE for licensing information */
+
+package org.torproject.metrics.stats.clients;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Locale;
+import java.util.TimeZone;
+
+/** Database wrapper to connect to the database, insert data, run the stored
+ * procedure for aggregating data, and query aggregated data as output. */
+class Database implements AutoCloseable {
+
+  /** Database connection string. */
+  private String jdbcString;
+
+  /** Connection object for all interactions with the database. */
+  private Connection connection;
+
+  /** Prepared statement for inserting a platform string into the imported
+   * table. */
+  private PreparedStatement psImportedInsert;
+
+  /** Create a new Database instance and prepare for inserting or querying
+   * data. */
+  Database(String jdbcString) throws SQLException {
+this.jdbcString = jdbcString;
+this.connect();
+this.prepareStatements();
+  }
+
+  private void connect() throws SQLException {
+this.connection = DriverManager.getConnection(this.jdbcString);
+this.connection.setAutoCommit(false);
+  }
+
+  private void prepareStatements() throws SQLException {
+this.psImportedInsert = this.connection.prepareStatement(
+"INSERT INTO imported (fingerprint, node, metric, country, transport, "
++ "version, stats_start, stats_end, val) "
++ "VALUES (?, CAST(? AS node), CAST(? AS metric), ?, ?, ?, ?, ?, ?)");
+  }
+
+  /** Insert into the imported table. */
+  void insertIntoImported(String fingerprint, String node, String metric,
+  String country, String transport, String version, long fromMillis,
+  long toMillis, double val) throws SQLException {
+if (fromMillis > toMillis) {
+  return;
+}
+psImportedInsert.clearParameters();
+psImportedInsert.setString(1, fingerprint);
+psImportedInsert.setString(2, node);
+psImportedInsert.setString(3, metric);
+psImportedInsert.setString(4, country);
+psImportedInsert.setString(5, transport);
+psImportedInsert.setString(6, version);
+psImportedInsert.setTimestamp(7,
+Timestamp.from(Instant.ofEpochMilli(fromMillis)));
+psImportedInsert.setTimestamp(8,
+Timestamp.from(Instant.ofEpochMilli(toMillis)));
+psImportedInsert.setDouble(9, Math.round(val * 10.0) / 10.0);
+psImportedInsert.execute();
+  }
+
+  /** Process the newly imported data by calling the various stored procedures
+   * and then truncating the imported table. */
+  void processImported() throws SQLException {
+this.connection.createStatement().execute("SELECT merge()");
+this.connection.createStatement().execute("SELECT aggregate()");
+this.connection.createStatement().execute("SELECT combine()");
+this.connection.createStatement().execute("TRUNCATE imported");
+  }
+
+  /** Commit all changes made in this execution. */
+  void commit() throws SQLException {
+this.connection.commit();
+  }
+
+  /** Query the estimated view. */
+  List queryEstimated() throws SQLException {
+List statistics = new ArrayList<>();
+String columns = "date, node, country, transport, version, frac, users";
+statistics.add(columns.split(", "));
+Statement st = this.connection.createStatement();
+Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
+Locale.US);
+String 

[tor-commits] [metrics-web/master] Rewrite censorship detector in Java.

2018-12-20 Thread karsten
commit a367168a782e864bdacb610857b1dc5d58fd192d
Author: Karsten Loesing 
Date:   Sun Dec 9 12:02:42 2018 +0100

Rewrite censorship detector in Java.

This allows us to remove the last remaining Python parts from the daily
updater.

Implements #21588.
---
 build.xml  |  26 --
 .../torproject/metrics/stats/clients/Detector.java | 433 +
 .../org/torproject/metrics/stats/clients/Main.java |   5 +
 src/main/python/clients/country_info.py| 255 
 src/main/python/clients/detector.py| 242 
 5 files changed, 438 insertions(+), 523 deletions(-)

diff --git a/build.xml b/build.xml
index 6736e19..93eda7b 100644
--- a/build.xml
+++ b/build.xml
@@ -23,7 +23,6 @@
   
 
   
-  
 
   
 
@@ -360,32 +359,7 @@
 
   
 
-
-
-
-
-
 
-
-
-  
-
-
-
-  
-  
-  
-
-
-
-  
-
-
-
-
   
 
   
diff --git a/src/main/java/org/torproject/metrics/stats/clients/Detector.java 
b/src/main/java/org/torproject/metrics/stats/clients/Detector.java
new file mode 100644
index 000..1a523c2
--- /dev/null
+++ b/src/main/java/org/torproject/metrics/stats/clients/Detector.java
@@ -0,0 +1,433 @@
+/* Copyright 2011 George Danezis 
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the
+ * disclaimer below) provided that the following conditions are met:
+ *
+ *  * Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ *
+ *  * Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the
+ *distribution.
+ *
+ *  * Neither the name of  nor the names of its
+ *contributors may be used to endorse or promote products derived
+ *from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ * GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * (Clear BSD license:
+ * http://labs.metacarta.com/license-explanation.html#license)
+ *
+ * Copyright 2018 The Tor Project
+ * See LICENSE for licensing information */
+
+package org.torproject.metrics.stats.clients;
+
+import org.apache.commons.math3.distribution.NormalDistribution;
+import org.apache.commons.math3.distribution.PoissonDistribution;
+import org.apache.commons.math3.stat.descriptive.moment.Mean;
+import org.apache.commons.math3.stat.descriptive.moment.StandardDeviation;
+import org.apache.commons.math3.stat.descriptive.rank.Percentile;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.LineNumberReader;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.LocalDate;
+import java.time.format.DateTimeParseException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.stream.Collectors;
+
+/** Censorship detector that reads a .csv file of the number of Tor clients and
+ * finds anomalies that might be indicative of censorship. */
+public class Detector {
+
+  /** Input file. */
+  private static final Path INPUT_PATH = Paths.get("stats", "userstats.csv");
+
+  /** Output file. */
+  private static final Path OUTPUT_PATH = Paths.get("stats", "clients.csv");
+
+  /** Number of largest locations to be included in the detection algorithm. */
+  private static final int NUM_LARGEST_LOCATIONS = 50;
+
+  /** Time interval in days to model connection rates. */
+  private static final int INTERV = 7;
+
+  /** Compound key under which client estimates are stored in both input and
+   * output files. */
+  private static class ClientsKey implements Comparable {
+
+/** Date when clients connected to the Tor network. */
+private LocalDate date;
+
+/** 

[tor-commits] [translation/donatepages-messagespot] Update translations for donatepages-messagespot

2018-12-20 Thread translation
commit 386d98d45b3e40955ab01360816f6b40b9b51dc3
Author: Translation commit bot 
Date:   Thu Dec 20 10:45:25 2018 +

Update translations for donatepages-messagespot
---
 locale/it/LC_MESSAGES/messages.po | 42 +++
 1 file changed, 38 insertions(+), 4 deletions(-)

diff --git a/locale/it/LC_MESSAGES/messages.po 
b/locale/it/LC_MESSAGES/messages.po
index b25ad5f31..f930d73df 100644
--- a/locale/it/LC_MESSAGES/messages.po
+++ b/locale/it/LC_MESSAGES/messages.po
@@ -1281,6 +1281,9 @@ msgid ""
 "Verizon, Red Hat, many universities, and others-- will match donations made "
 "by their employees."
 msgstr ""
+"Sì! Molte aziende --come Google, Microsoft, eBay, PayPal, Apple, Verizon, "
+"Red Hat, diverse università e altri-- corrisponderà le donazioni fatte dai "
+"loro dipendenti."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:502
 msgid ""
@@ -1289,28 +1292,38 @@ msgid ""
 " https://www.matchinggifts.com/rit/\;>https://www.matchinggifts.com/rit/."
 msgstr ""
+"Il modo più veloce per capire se la tua azienda corrisponde le donazioni "
+"solitamente è controllando il tuo Ufficio Risorse Umane, o puoi cercare il "
+"nome della tua azienda su https://www.matchinggifts.com/rit/\;>https://www.matchinggifts.com/rit/."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:504
 msgid ""
 "If your company isn't currently set up to match donations to the Tor "
 "Project, we would be happy to help with the paperwork."
 msgstr ""
+"Se la tua azienda attualmente non corrisponde le donazioni al Progetto Tor, "
+"saremmo lieti di aiutare con i documenti."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:506
 msgid ""
 "If you want help figuring out the process, write us at giving(at)torproject.org."
 msgstr ""
+"Se vuoi essere d'aiuto per capire il processo, scrivici a giving(at)torproject.org."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:512
 msgid "Can I become a Tor Project member?"
-msgstr ""
+msgstr "Posso diventare un membro del Progetto Tor?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:516
 msgid ""
 "Right now, we don't have a membership program, but we may set one up in the "
 "future."
 msgstr ""
+"Al momento non abbiamo un programma di affiliazione, ma potremmo crearne uno"
+" in futuro."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:518
 msgid ""
@@ -1319,10 +1332,14 @@ msgid ""
 "href=\"https://www.torproject.org/getinvolved/volunteer.html.en\;>this is a "
 "good place to start."
 msgstr ""
+"Se vuoi partecipare al Progetto Tor, https://www.torproject.org/getinvolved/volunteer.html.en\;>questo è "
+"un buon punto per iniziare."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:524
 msgid "How can I get a Tor t-shirt or stickers?"
-msgstr ""
+msgstr "Come posso ottenere una maglietta o degli adesivi di Tor?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:528
 msgid ""
@@ -1330,12 +1347,17 @@ msgid ""
 "stickers, are presented on our main https://donate.torproject.org\;>donation page."
 msgstr ""
+"Numerosi regali di ringraziamento per i donatori, incluse magliette, felpe e"
+" adesivi, sono presentati nella nostra https://donate.torproject.org\;>pagina delle donazioni."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:534
 msgid ""
 "If I want to stay in touch with the Tor Project, what's the best way for me "
 "to do that?"
 msgstr ""
+"Se volessi restare in contatto con il Progetto Tor, qual è il modo migliore "
+"per farlo?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:538
 msgid ""
@@ -1346,21 +1368,29 @@ msgid ""
 " links\" target=\"_blank\" href=\"https://twitter.com/torproject\;>follow us"
 " on Twitter."
 msgstr ""
+"Puoi registrarti per ricevere https://newsletter.torproject.org/\;>notizie su "
+"Tor, leggere il https://blog.torproject.org/\;>blog di Tor, o puoi https://twitter.com/torproject\;>seguirci su Twitter."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:544
 msgid ""
 "Does the Tor Project participate in the Combined Federal Campaign program?"
-msgstr ""
+msgstr "Il Progetto Tor partecipa al programma Combined Federal Campaign?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:548
 msgid "No, Tor doesn't currently participate in the CFC program."
-msgstr ""
+msgstr "No, Tor attualmente non partecipa al programma CFC."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:550
 msgid ""
 "If you'd like to get Tor added to the CFC program in 

[tor-commits] [translation/donatepages-messagespot_completed] Update translations for donatepages-messagespot_completed

2018-12-20 Thread translation
commit b37d0a68494e25344e98f0f967095e4029ba29f5
Author: Translation commit bot 
Date:   Thu Dec 20 10:45:32 2018 +

Update translations for donatepages-messagespot_completed
---
 locale/it/LC_MESSAGES/messages.po | 1931 +
 1 file changed, 1931 insertions(+)

diff --git a/locale/it/LC_MESSAGES/messages.po 
b/locale/it/LC_MESSAGES/messages.po
new file mode 100644
index 0..f930d73df
--- /dev/null
+++ b/locale/it/LC_MESSAGES/messages.po
@@ -0,0 +1,1931 @@
+# Translators:
+# Yvette Agostini , 2018
+# Matteo Sechi , 2018
+# Thomas Di Cristofaro , 2018
+# Sebastiano Pistore , 2018
+# mattia_b89 , 2018
+# erinm, 2018
+# Giuseppe Pignataro (Fastbyte01) , 2018
+# Emanuele Trotta , 2018
+# Edoardo (chap) , 2018
+# Random_R, 2018
+# 
+msgid ""
+msgstr ""
+"Last-Translator: Random_R, 2018\n"
+"Language-Team: Italian (https://www.transifex.com/otf/teams/1519/it/)\n"
+"Language: it\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: 
tmp/cache_locale/e1/e1e12763540d9524f8871157240d5a8fbf2ea77ace1c46527b3031db68943acc.php:34
+msgid "Processing Donation - Tor"
+msgstr "Elaborazione donazione - Tor"
+
+#: 
tmp/cache_locale/e1/e1e12763540d9524f8871157240d5a8fbf2ea77ace1c46527b3031db68943acc.php:44
+msgid "Processing Donation. Please Wait..."
+msgstr "Elaborazione donazione. Attendere..."
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:34
+msgid "Tor Privacy Policy"
+msgstr "Politica sullla privacy di Tor"
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:44
+msgid "Donor privacy policy"
+msgstr "Politica sulla privacy del donatore"
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:58
+msgid ""
+"The Tor Project respects donor privacy and welcomes anonymous donations."
+msgstr ""
+"Il Progetto Tor rispetta la privacy dei donatori e accoglie le donazioni "
+"anonime."
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:60
+msgid ""
+"If being anonymous is important to you, the best way to preserve your "
+"anonymity is by donating using a method that doesn't disclose your personal "
+"information."
+msgstr ""
+"Se essere anonimi per te è importante, il modo migliore per preservare il "
+"tuo anonimato è donare utilizzando un metodo che non rivela le tue "
+"informazioni personali."
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:65
+msgid ""
+"If you provide personal information as part of the donation process, it may "
+"be collected and retained by third-party service providers and/or the Tor "
+"Project, as described below."
+msgstr ""
+"Se fornisci dati personali come parte del processo di donazione, possono "
+"essere raccolti e conservati da fornitori terzi di servizi e/o dal Progetto "
+"Tor, come descritto sotto."
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:67
+msgid ""
+"The Tor Project has very little influence over how third-party service "
+"providers, such as PayPal, may collect and use your information."
+msgstr ""
+"Il Progetto Tor ha una scarsa influenza su come i fornitori terzi di "
+"servizi, come PayPal, possono raccogliere e usare le tue informazioni."
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:69
+msgid ""
+"We recommend you familiarize yourself with their https://www.paypal.com/webapps/mpp/ua;
+"/privacy-full\">policies, especially if you have privacy concerns."
+msgstr ""
+"Ti consigliamo di familiarizzare con le loro https://www.paypal.com/webapps/mpp/ua/privacy-;
+"full\">politiche, soprattutto se ci tieni alla privacy."
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:74
+msgid ""
+"When you donate to the Tor Project, depending what mechanism you use, we may"
+" learn your name, the amount you donated, your email address, phone number "
+"and/or mailing address, as well as any other information you provide."
+msgstr ""
+"Quando doni al Progetto Tor, a seconda del meccanismo che usi, potremmo "
+"conoscere il tuo nome, l'importo donato, il tuo indirizzo email, numero di "
+"telefono e/o indirizzo postale, così come qualsiasi altra informazione che "
+"ci fornisci."
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:76
+msgid ""
+"We may also learn incidental data such as the date and time of your "
+"donation."
+msgstr ""
+"Potremmo anche apprendere dati annessi come la data e l'ora della tua "
+"donazione."
+
+#: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:78
+msgid ""
+"The Tor Project will never have access to your financial data, such as your "
+"credit card information.We aim to be careful with your information."
+msgstr ""
+"Il Progetto Tor non avrà mai accesso ai tuoi 

[tor-commits] [metrics-web/master] Re-add missing COMMIT commands to bwhist module.

2018-12-20 Thread karsten
commit 9dd35e29084ed9380cb374c80a4f9bfb0d9a91e2
Author: Karsten Loesing 
Date:   Thu Dec 20 11:28:46 2018 +0100

Re-add missing COMMIT commands to bwhist module.

Last month, in commit f8fa108 where we modernized the legacy module
and renamed it to bwhist, we split up the closeConnection() into one
method commit() to commit changes and another method closeConnection()
to close the connection. However, we somehow forgot to invoke the
commit() method.

This had two effects:

 1. Newly added data was not made persistent in the database. This
lead to a moving window of roughly one week for new data and an
increasing gap between the last committed data and this 1-week
window.

 2. The result of aggregating newly added data was not made
persistent. So, even after fixing the first issue above, we
accumulated newly added data, rather than only keeping the most
recent two weeks. This made the database slower over time.

This change adds two commit() calls at the right places.
---
 .../metrics/stats/bwhist/RelayDescriptorDatabaseImporter.java   | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/src/main/java/org/torproject/metrics/stats/bwhist/RelayDescriptorDatabaseImporter.java
 
b/src/main/java/org/torproject/metrics/stats/bwhist/RelayDescriptorDatabaseImporter.java
index a6cf0cc..9f9ecff 100644
--- 
a/src/main/java/org/torproject/metrics/stats/bwhist/RelayDescriptorDatabaseImporter.java
+++ 
b/src/main/java/org/torproject/metrics/stats/bwhist/RelayDescriptorDatabaseImporter.java
@@ -532,6 +532,7 @@ public final class RelayDescriptorDatabaseImporter {
 this.addExtraInfoDescriptor((ExtraInfoDescriptor) descriptor);
   }
 }
+this.commit();
 reader.saveHistoryFile(this.historyFile);
   }
 
@@ -615,6 +616,7 @@ public final class RelayDescriptorDatabaseImporter {
   void aggregate() throws SQLException {
 Statement st = this.conn.createStatement();
 st.executeQuery("SELECT refresh_all()");
+this.commit();
   }
 
   /** Query the servers_platforms view. */

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


[tor-commits] [metrics-web/master] Remove bandwidth and bwhist-flags graphs.

2018-12-20 Thread karsten
commit 59b800a491f93d08bcec6bda1b393a762156226d
Author: Karsten Loesing 
Date:   Wed Dec 12 12:08:52 2018 +0100

Remove bandwidth and bwhist-flags graphs.

The "Advertised and consumed bandwidth by relay flags" graph now
contains everything that's contained in the "Total relay bandwidth"
and the "Consumed bandwidth by Exit/Guard flag combination" graphs.
Removing these two graphs as obsolete.

Also update documentation for the newly deployed "Advertised and
consumed bandwidth by relay flags" graph.

Part of #28353.
---
 src/main/R/rserver/graphs.R| 79 --
 src/main/resources/web.xml |  8 ---
 src/main/resources/web/json/categories.json|  2 -
 src/main/resources/web/json/metrics.json   | 22 --
 .../resources/web/jsps/reproducible-metrics.jsp| 17 ++---
 src/main/resources/web/jsps/stats.jsp  | 68 ++-
 6 files changed, 13 insertions(+), 183 deletions(-)

diff --git a/src/main/R/rserver/graphs.R b/src/main/R/rserver/graphs.R
index cb40d52..1ca9357 100644
--- a/src/main/R/rserver/graphs.R
+++ b/src/main/R/rserver/graphs.R
@@ -448,85 +448,6 @@ write_platforms <- function(start_p = NULL, end_p = NULL, 
path_p) {
 write.csv(path_p, quote = FALSE, row.names = FALSE, na = "")
 }
 
-prepare_bandwidth <- function(start_p, end_p) {
-  advbw <- read.csv(paste(stats_dir, "advbw.csv", sep = ""),
-colClasses = c("date" = "Date")) %>%
-transmute(date, variable = "advbw", value = advbw * 8 / 1e9)
-  bwhist <- read.csv(paste(stats_dir, "bandwidth.csv", sep = ""),
-colClasses = c("date" = "Date")) %>%
-transmute(date, variable = "bwhist", value = (bwread + bwwrite) * 8 / 2e9)
-  rbind(advbw, bwhist) %>%
-filter(if (!is.null(start_p)) date >= as.Date(start_p) else TRUE) %>%
-filter(if (!is.null(end_p)) date <= as.Date(end_p) else TRUE) %>%
-filter(!is.na(value)) %>%
-group_by(date, variable) %>%
-summarize(value = sum(value)) %>%
-spread(variable, value)
-}
-
-plot_bandwidth <- function(start_p, end_p, path_p) {
-  prepare_bandwidth(start_p, end_p) %>%
-gather(variable, value, -date) %>%
-ggplot(aes(x = date, y = value, colour = variable)) +
-geom_line() +
-scale_x_date(name = "", breaks = custom_breaks,
-  labels = custom_labels, minor_breaks = custom_minor_breaks) +
-scale_y_continuous(name = "", labels = unit_format(unit = "Gbit/s"),
-  limits = c(0, NA)) +
-scale_colour_hue(name = "", h.start = 90,
-breaks = c("advbw", "bwhist"),
-labels = c("Advertised bandwidth", "Bandwidth history")) +
-ggtitle("Total relay bandwidth") +
-labs(caption = copyright_notice) +
-theme(legend.position = "top")
-  ggsave(filename = path_p, width = 8, height = 5, dpi = 150)
-}
-
-write_bandwidth <- function(start_p = NULL, end_p = NULL, path_p) {
-  prepare_bandwidth(start_p, end_p) %>%
-write.csv(path_p, quote = FALSE, row.names = FALSE, na = "")
-}
-
-prepare_bwhist_flags <- function(start_p, end_p) {
-  read.csv(paste(stats_dir, "bandwidth.csv", sep = ""),
-colClasses = c("date" = "Date")) %>%
-filter(if (!is.null(start_p)) date >= as.Date(start_p) else TRUE) %>%
-filter(if (!is.null(end_p)) date <= as.Date(end_p) else TRUE) %>%
-filter(isexit != "") %>%
-filter(isguard != "") %>%
-mutate(variable = ifelse(isexit == "t",
-ifelse(isguard == "t", "guard_and_exit", "exit_only"),
-ifelse(isguard == "t", "guard_only", "middle_only")),
-  value = (bwread + bwwrite) * 8 / 2e9) %>%
-select(date, variable, value)
-}
-
-plot_bwhist_flags <- function(start_p, end_p, path_p) {
-  prepare_bwhist_flags(start_p, end_p) %>%
-complete(date = full_seq(date, period = 1),
-  variable = unique(variable)) %>%
-ggplot(aes(x = date, y = value, colour = variable)) +
-geom_line() +
-scale_x_date(name = "", breaks = custom_breaks,
-  labels = custom_labels, minor_breaks = custom_minor_breaks) +
-scale_y_continuous(name = "", labels = unit_format(unit = "Gbit/s"),
-  limits = c(0, NA)) +
-scale_colour_manual(name = "",
-  breaks = c("exit_only", "guard_and_exit", "guard_only", "middle_only"),
-  labels = c("Exit only", "Guard & Exit", "Guard only", "Middle only"),
-  values = c("#E69F00", "#56B4E9", "#009E73", "#0072B2")) +
-ggtitle("Bandwidth history by relay flags") +
-labs(caption = copyright_notice) +
-theme(legend.position = "top")
-  ggsave(filename = path_p, width = 8, height = 5, dpi = 150)
-}
-
-write_bwhist_flags <- function(start_p = NULL, end_p = NULL, path_p) {
-  prepare_bwhist_flags(start_p, end_p) %>%
-spread(variable, value) %>%
-write.csv(path_p, quote = FALSE, row.names = FALSE, na = "")
-}
-
 prepare_dirbytes <- function(start_p, end_p, path_p) {
   read.csv(paste(stats_dir, "bandwidth.csv", sep = ""),
 colClasses = c("date" = "Date")) %>%
diff --git 

[tor-commits] [metrics-web/master] Tweak Advertised and consumed bandwidth by relay flag graph.

2018-12-20 Thread karsten
commit 6b5f75996ad0d9ac5151da48f9693d478dd682de
Author: Karsten Loesing 
Date:   Wed Dec 5 21:32:55 2018 +0100

Tweak Advertised and consumed bandwidth by relay flag graph.

This graph now contains everything that's contained in the Total relay
bandwidth and the Consumed bandwidth by Exit/Guard flag combination
graph.

Removing those graphs will be done in a separate commit.

Part of #28353.
---
 src/main/R/rserver/graphs.R  | 40 ++--
 src/main/resources/web/json/metrics.json |  4 ++--
 2 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/src/main/R/rserver/graphs.R b/src/main/R/rserver/graphs.R
index 1f7309b..cb40d52 100644
--- a/src/main/R/rserver/graphs.R
+++ b/src/main/R/rserver/graphs.R
@@ -788,41 +788,37 @@ write_connbidirect <- function(start_p = NULL, end_p = 
NULL, path_p) {
 prepare_bandwidth_flags <- function(start_p, end_p) {
   advbw <- read.csv(paste(stats_dir, "advbw.csv", sep = ""),
 colClasses = c("date" = "Date")) %>%
-transmute(date, isguard, isexit, variable = "advbw",
-  value = advbw * 8 / 1e9)
+transmute(date, have_guard_flag = isguard, have_exit_flag = isexit,
+  variable = "advbw", value = advbw * 8 / 1e9)
   bwhist <- read.csv(paste(stats_dir, "bandwidth.csv", sep = ""),
 colClasses = c("date" = "Date")) %>%
-transmute(date, isguard, isexit, variable = "bwhist",
-  value = (bwread + bwwrite) * 8 / 2e9)
+transmute(date, have_guard_flag = isguard, have_exit_flag = isexit,
+  variable = "bwhist", value = (bwread + bwwrite) * 8 / 2e9)
   rbind(advbw, bwhist) %>%
 filter(if (!is.null(start_p)) date >= as.Date(start_p) else TRUE) %>%
 filter(if (!is.null(end_p)) date <= as.Date(end_p) else TRUE) %>%
-group_by(date, variable) %>%
-summarize(exit = sum(value[isexit == "t"]),
-  guard = sum(value[isguard == "t"])) %>%
-gather(flag, value, -date, -variable) %>%
-unite(variable, flag, variable) %>%
-mutate(variable = factor(variable,
-  levels = c("guard_advbw", "guard_bwhist", "exit_advbw", "exit_bwhist")))
+filter(have_exit_flag != "") %>%
+filter(have_guard_flag != "")
 }
 
 plot_bandwidth_flags <- function(start_p, end_p, path_p) {
   prepare_bandwidth_flags(start_p, end_p) %>%
-complete(date = full_seq(date, period = 1),
-  variable = unique(variable)) %>%
-ggplot(aes(x = date, y = value, colour = variable)) +
-geom_line() +
+unite(flags, have_guard_flag, have_exit_flag) %>%
+mutate(flags = factor(flags, levels = c("f_t", "t_t", "t_f", "f_f"),
+  labels = c("Exit only", "Guard and Exit", "Guard only",
+  "Neither Guard nor Exit"))) %>%
+mutate(variable = ifelse(variable == "advbw",
+  "Advertised bandwidth", "Consumed bandwidth")) %>%
+ggplot(aes(x = date, y = value, fill = flags)) +
+geom_area() +
 scale_x_date(name = "", breaks = custom_breaks,
   labels = custom_labels, minor_breaks = custom_minor_breaks) +
 scale_y_continuous(name = "", labels = unit_format(unit = "Gbit/s"),
   limits = c(0, NA)) +
-scale_colour_manual(name = "",
-breaks = c("guard_advbw", "guard_bwhist", "exit_advbw", "exit_bwhist"),
-labels = c("Guard, advertised bandwidth", "Guard, bandwidth history",
-   "Exit, advertised bandwidth", "Exit, bandwidth history"),
-values = c("#E69F00", "#D6C827", "#009E73", "#00C34F")) +
-ggtitle(paste("Advertised bandwidth and bandwidth history by",
-"relay flags")) +
+scale_fill_manual(name = "",
+  values = c("#03B3FF", "#39FF02", "#00", "#99")) +
+facet_grid(variable ~ .) +
+ggtitle("Advertised and consumed bandwidth by relay flags") +
 labs(caption = copyright_notice) +
 theme(legend.position = "top")
   ggsave(filename = path_p, width = 8, height = 5, dpi = 150)
diff --git a/src/main/resources/web/json/metrics.json 
b/src/main/resources/web/json/metrics.json
index b351814..5173ae4 100644
--- a/src/main/resources/web/json/metrics.json
+++ b/src/main/resources/web/json/metrics.json
@@ -90,9 +90,9 @@
   },
   {
 "id": "bandwidth-flags",
-"title": "Advertised and consumed bandwidth by relay flag",
+"title": "Advertised and consumed bandwidth by relay flags",
 "type": "Graph",
-"description": "This graph shows advertised and consumed bandwidth of relays with 
either \"Exit\" or \"Guard\" flags 
assigned by the directory authorities.  These sets are not distinct, because a 
relay that has both the \"Exit\" and \"Guard\" flags assigned will be included 
in both sets.",
+"description": "This graph shows advertised and consumed bandwidth of relays with 
\"Exit\" and/or \"Guard\" flags 
assigned by the directory authorities.",
 "function": "bandwidth_flags",
 "parameters": [
   "start",



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

[tor-commits] [translation/donatepages-messagespot] Update translations for donatepages-messagespot

2018-12-20 Thread translation
commit 54c36e30b40333b6ef5a16fa2ff486a7e5caca4c
Author: Translation commit bot 
Date:   Thu Dec 20 10:15:26 2018 +

Update translations for donatepages-messagespot
---
 locale/it/LC_MESSAGES/messages.po | 35 +--
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/locale/it/LC_MESSAGES/messages.po 
b/locale/it/LC_MESSAGES/messages.po
index e34a0f33d..b25ad5f31 100644
--- a/locale/it/LC_MESSAGES/messages.po
+++ b/locale/it/LC_MESSAGES/messages.po
@@ -187,7 +187,7 @@ msgstr "Torna alla pagina donazioni"
 
 #: 
tmp/cache_locale/6f/6f67db0a5268c67c9254c73517aaaea60c8c65a268f9242703a3299173f14b74.php:22
 msgid "See if your employer offers employee gift matching"
-msgstr ""
+msgstr "Controlla se il tuo datore offre una corrispondenza per i dipendenti"
 
 #: 
tmp/cache_locale/6f/6f67db0a5268c67c9254c73517aaaea60c8c65a268f9242703a3299173f14b74.php:52
 msgid "Company"
@@ -195,7 +195,7 @@ msgstr "Azienda"
 
 #: 
tmp/cache_locale/6f/6f67db0a5268c67c9254c73517aaaea60c8c65a268f9242703a3299173f14b74.php:60
 msgid "Matching Conditions"
-msgstr ""
+msgstr "Condizioni di corrispondenza"
 
 #: 
tmp/cache_locale/6f/6f67db0a5268c67c9254c73517aaaea60c8c65a268f9242703a3299173f14b74.php:68
 msgid "Contact Information"
@@ -1206,16 +1206,21 @@ msgid ""
 "Here is the Tor Project donor privacy policy."
 msgstr ""
+"Ecco l'informativa sulla privacy per donatori del Progetto"
+" Tor."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:458
 msgid "What is your refund policy?"
-msgstr ""
+msgstr "Qual è la vostra politica sui rimborsi?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:462
 msgid ""
 "If you want your donation refunded, please tell us by emailing giving(at)torproject.org."
 msgstr ""
+"Se vuoi che ti venga rimborsata la donazione, faccelo sapere inviando "
+"un'email a giving(at)torproject.org."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:464
 msgid ""
@@ -1223,10 +1228,13 @@ msgid ""
 "amount you donated, your full name, the payment method you used and your "
 "country of origin."
 msgstr ""
+"Per elaborare il rimborso dovremo conoscere la data della tua donazione, "
+"l'importo donato, il tuo nome completo, il metodo di pagamento utilizzato e "
+"il tuo Paese di origine."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:466
 msgid "Please also tell us why you're asking for a refund."
-msgstr ""
+msgstr "Per favore, facci anche sapere perchè stai chiedendo un rimborso."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:468
 msgid ""
@@ -1234,25 +1242,30 @@ msgid ""
 " to be made in a specific way, so we may need additional information from "
 "you in order to process yours."
 msgstr ""
+"Si prega di notare che alcuni metodi di pagamento non supportano i rimborsi,"
+" o richiedono che siano effettuati in un modo specifico, quindi potremmo "
+"chiederti ulteriori informazioni per procedere."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:474
 msgid "Can I donate by mail?"
-msgstr ""
+msgstr "Posso donare per posta?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:478
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:584
 msgid "Yes."
-msgstr ""
+msgstr "Sì."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:480
 msgid ""
 "Our mailing address is The Tor Project, 217 First Avenue South #4903, "
 "Seattle WA 98194, USA"
 msgstr ""
+"La nostra casella postale è The Tor Project, 217 First Avenue South #4903, "
+"Seattle WA 98194, USA"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:486
 msgid "Do you accept cash donations?"
-msgstr ""
+msgstr "Accettate donazioni in contanti?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:490
 msgid "Yes"
@@ -1260,7 +1273,7 @@ msgstr "Sì"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:496
 msgid "Does Tor Project accept matching donations?"
-msgstr ""
+msgstr "Il Progetto Tor accetta donazioni di corrispondenza?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:500
 msgid ""
@@ -1799,7 +1812,7 @@ msgstr "Commenti"
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:463
 msgid "Donating:"
-msgstr ""
+msgstr "Donazione:"
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:470
 msgid "Donate"
@@ -1865,7 +1878,7 @@ msgstr "Indirizzo email non valido."
 
 #: 

[tor-commits] [translation/donatepages-messagespot] Update translations for donatepages-messagespot

2018-12-20 Thread translation
commit 49eacb71669b4857cc41168d7b7134581d6f5524
Author: Translation commit bot 
Date:   Thu Dec 20 09:45:24 2018 +

Update translations for donatepages-messagespot
---
 locale/it/LC_MESSAGES/messages.po | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/locale/it/LC_MESSAGES/messages.po 
b/locale/it/LC_MESSAGES/messages.po
index 9e8c0bcfc..e34a0f33d 100644
--- a/locale/it/LC_MESSAGES/messages.po
+++ b/locale/it/LC_MESSAGES/messages.po
@@ -1144,12 +1144,16 @@ msgid ""
 "It's important to me that my donation be tax-deductible, but I don't pay "
 "taxes in the United States."
 msgstr ""
+"Per me è importante che la mia donazione sia detraibile dalle tasse, ma non "
+"pago tasse negli Stati Uniti."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:427
 msgid ""
 "Right now, we can only offer tax-deductibility to donors who pay taxes in "
 "the United States."
 msgstr ""
+"Al momento possiamo offrire la detraibilità dalle tasse solo ai donatori che"
+" pagano le tasse negli Stati Uniti."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:429
 msgid ""
@@ -1157,6 +1161,9 @@ msgid ""
 "different country, let us know and we will try to offer tax-deductibility in"
 " your country in future."
 msgstr ""
+"Se per te è importante che le tue donazioni siano detraibili dalle tasse in "
+"un altro Paese, faccelo sapere e cercheremo di offrire la detraibilità "
+"fiscale nel tuo Paese in futuro."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:431
 msgid ""
@@ -1166,12 +1173,19 @@ msgid ""
 "organizations support the Tor network and may be able to offer you tax-"
 "deductibility for your donation."
 msgstr ""
+"Oppure, se sei in Germania, Francia o Svezia, https://www.torproject.org/docs/faq.html.en#RelayDonations\;>queste "
+"organizzazioni sostengono la rete Tor e potrebbero essere in grado di "
+"offrirti la detraibilità fiscale per la tua donazione."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:437
 msgid ""
 "What if I don't want to use credit card or PayPal? Is there another way I "
 "can donate?"
 msgstr ""
+"E se non volessi usare la carta di credito o PayPal? C'è un altro modo per "
+"donare?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:441
 msgid ""
@@ -1179,10 +1193,13 @@ msgid ""
 "options.html.en\" class=\"hyperlinks links\" target=\"_blank\">other ways "
 "you can donate."
 msgstr ""
+"Sì! Ecco un elenco di https://www.torproject.org/donate/donate-;
+"options.html.en\" class=\"hyperlinks links\" target=\"_blank\">altri modi "
+"per donare."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:448
 msgid "What is your donor privacy policy?"
-msgstr ""
+msgstr "Qual è la vostra informativa sulla privacy per i donatori?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:452
 msgid ""

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


[tor-commits] [metrics-web/master] Document another change to OnionPerf graphs.

2018-12-20 Thread karsten
commit 0ca51404b70258e1594df2d88f460fd6a6daf351
Author: Karsten Loesing 
Date:   Thu Dec 20 10:33:00 2018 +0100

Document another change to OnionPerf graphs.

Still related to #28603.
---
 src/main/resources/web/jsps/stats.jsp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/resources/web/jsps/stats.jsp 
b/src/main/resources/web/jsps/stats.jsp
index 2ae6726..a78da8a 100644
--- a/src/main/resources/web/jsps/stats.jsp
+++ b/src/main/resources/web/jsps/stats.jsp
@@ -610,6 +610,7 @@ Performance #
 
 start: First UTC date (-MM-DD) to include in the file.
 end: Last UTC date (-MM-DD) to include in the file.
+server: Either "public" for requests to a server on the 
public internet, or "onion" for requests to a version 2 onion 
server.
 
 
 Columns

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


[tor-commits] [tor-browser-build/master] Bug 28784: Pass --force --delete_unversioned_trees --reset to "gclient sync".

2018-12-20 Thread gk
commit 1b7e0de3690364bfdd29889676f5ff8ec6b1cd3b
Author: David Fifield 
Date:   Thu Dec 20 03:17:25 2018 +

Bug 28784: Pass --force --delete_unversioned_trees --reset to "gclient 
sync".

This is supposed to remove and reset modified or unversioned files. This
ought to work around the problem with versioning of src/testing/gmock
and src/testing/gtest across upgrades.

$ gclient help sync
  -f, --force  force update even for unchanged modules
  -D, --delete_unversioned_trees
   Deletes from the working copy any dependencies that
   have been removed since the last sync, as long as
   there are no local modifications. When used with
   --force, such dependencies are removed even if they
   have local modifications. When used with --reset, all
   untracked directories are removed from the working
   copy, excluding those which are explicitly ignored in
   the repository.
  -R, --reset  resets any local changes before updating (git only)
---
 projects/webrtc/config | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/projects/webrtc/config b/projects/webrtc/config
index 2955095..37b4615 100644
--- a/projects/webrtc/config
+++ b/projects/webrtc/config
@@ -102,11 +102,8 @@ steps:
 git config diff.ignoreSubmodules all
 cd ..
   fi
-  # Delete the unversioned gmock and gtest directories, which cause 
"gclient sync"
-  # to fail when upgrading between webrtc branch-heads/58 and 
branch-heads/64.
-  rm -rf src/testing/gmock src/testing/gtest
   # "gclient" is part of depot_tools. This download takes a long time the 
first time.
-  gclient sync --no-history --with_branch_heads -r [% c("var/webrtc_tag") 
%]
+  gclient sync --force --delete_unversioned_trees --reset --no-history 
--with_branch_heads -r [% c("var/webrtc_tag") %]
   cd ..
   tar --exclude .git -czf [% dest_dir _ '/' _ c('filename') %] webrtc
 input_files:

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


[tor-commits] [metrics-web/master] Remove Torperf/OnionPerf plots with all sources.

2018-12-20 Thread karsten
commit c39472548511175a6eaa0d67de62d3b5fa59dbe3
Author: Karsten Loesing 
Date:   Wed Dec 5 11:56:19 2018 +0100

Remove Torperf/OnionPerf plots with all sources.

OnionPerf results look to be comparable over time, but between vantage
points there are systematic deltas between the results. The "all"
plots show rises and falls where they actually don't exist, it's just
that a particular vantage point was offline so the average of the two
remaining moves noticeably.

In this commit we remove the source parameter from these graphs and
always include all sources separately in the graph, but not a
combination of all measurements together.

Implements #28603.
---
 src/main/R/rserver/graphs.R| 178 +
 .../metrics/web/GraphParameterChecker.java |  24 ---
 .../org/torproject/metrics/web/GraphServlet.java   |   8 -
 src/main/resources/web/json/metrics.json   |   7 +-
 src/main/resources/web/jsps/graph.jsp  |   9 --
 5 files changed, 76 insertions(+), 150 deletions(-)

diff --git a/src/main/R/rserver/graphs.R b/src/main/R/rserver/graphs.R
index e541c30..1f7309b 100644
--- a/src/main/R/rserver/graphs.R
+++ b/src/main/R/rserver/graphs.R
@@ -592,70 +592,49 @@ write_relayflags <- function(start_p = NULL, end_p = 
NULL, flag_p = NULL,
 write.csv(path_p, quote = FALSE, row.names = FALSE, na = "")
 }
 
-plot_torperf <- function(start_p, end_p, source_p, server_p, filesize_p,
-path_p) {
-  filesize_val <- ifelse(filesize_p == "50kb", 50 * 1024,
-  ifelse(filesize_p == "1mb", 1024 * 1024, 5 * 1024 * 1024))
-  t <- read.csv(paste(stats_dir, "torperf-1.1.csv", sep = ""),
-colClasses = c("date" = "Date", "source" = "character"))
-  known_sources <- c("all", unique(t[t$source != "", "source"]))
-  colours <- data.frame(source = known_sources,
-  colour = brewer.pal(length(known_sources), "Paired"),
-  stringsAsFactors = FALSE)
-  colour <- colours[colours$source == source_p, "colour"]
-  filesizes <- data.frame(filesizes = c("5mb", "1mb", "50kb"),
-  label = c("5 MiB", "1 MiB", "50 KiB"), stringsAsFactors = FALSE)
-  filesize_str <- filesizes[filesizes$filesize == filesize_p, "label"]
-  t[t$date >= as.Date(start_p) & t$date <= as.Date(end_p) &
- t$filesize == filesize_val &
- t$source == ifelse(source_p == "all", "", source_p) &
- t$server == server_p, ] %>%
-transmute(date, q1 = q1 / 1e3, md = md / 1e3, q3 = q3 / 1e3) %>%
-complete(date = full_seq(date, period = 1)) %>%
-ggplot(aes(x = date, y = md, fill = "line")) +
-geom_line(colour = colour, size = 0.75) +
-geom_ribbon(aes(x = date, ymin = q1, ymax = q3, fill = "ribbon")) +
+prepare_torperf <- function(start_p, end_p, server_p, filesize_p, path_p) {
+  read.csv(paste(stats_dir, "torperf-1.1.csv", sep = ""),
+colClasses = c("date" = "Date", "source" = "character")) %>%
+filter(if (!is.null(start_p)) date >= as.Date(start_p) else TRUE) %>%
+filter(if (!is.null(end_p)) date <= as.Date(end_p) else TRUE) %>%
+filter(if (!is.null(server_p)) server == server_p else TRUE) %>%
+filter(if (!is.null(filesize_p))
+filesize == ifelse(filesize_p == "50kb", 50 * 1024,
+ifelse(filesize_p == "1mb", 1024 * 1024, 5 * 1024 * 1024)) else
+TRUE) %>%
+transmute(date, filesize, source, server, q1 = q1 / 1e3, md = md / 1e3,
+  q3 = q3 / 1e3)
+}
+
+plot_torperf <- function(start_p, end_p, server_p, filesize_p, path_p) {
+  prepare_torperf(start_p, end_p, server_p, filesize_p, path_p) %>%
+filter(source != "") %>%
+complete(date = full_seq(date, period = 1), nesting(source)) %>%
+ggplot(aes(x = date, y = md, ymin = q1, ymax = q3, fill = source)) +
+geom_ribbon(alpha = 0.5) +
+geom_line(aes(colour = source), size = 0.75) +
 scale_x_date(name = "", breaks = custom_breaks,
   labels = custom_labels, minor_breaks = custom_minor_breaks) +
 scale_y_continuous(name = "", labels = unit_format(unit = "s"),
   limits = c(0, NA)) +
-scale_fill_manual(name = paste("Measured times on",
-ifelse(source_p == "all", "all sources", source_p), "per day"),
-  breaks = c("line", "ribbon"),
-  labels = c("Median", "1st to 3rd quartile"),
-  values = paste(colour, c("", "66"), sep = "")) +
-ggtitle(paste("Time to complete", filesize_str,
+scale_fill_hue(name = "Source") +
+scale_colour_hue(name = "Source") +
+ggtitle(paste("Time to complete",
+ifelse(filesize_p == "50kb", "50 KiB",
+ifelse(filesize_p == "1mb", "1 MiB", "5 MiB")),
 "request to", server_p, "server")) +
 labs(caption = copyright_notice) +
 theme(legend.position = "top")
   ggsave(filename = path_p, width = 8, height = 5, dpi = 150)
 }
 
-# Ideally, this function would share code with plot_torperf by using a
-# common prepare_torperf function. This just turned out to be a bit
-# harder than for other 

[tor-commits] [metrics-web/master] Document changes to OnionPerf graphs.

2018-12-20 Thread karsten
commit ad1221cb980aa5bf3bf075338d2588d803e652c2
Author: Karsten Loesing 
Date:   Thu Dec 20 10:03:31 2018 +0100

Document changes to OnionPerf graphs.

Still related to #28603.
---
 src/main/resources/web/jsps/stats.jsp | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/main/resources/web/jsps/stats.jsp 
b/src/main/resources/web/jsps/stats.jsp
index e5f9c6a..2ae6726 100644
--- a/src/main/resources/web/jsps/stats.jsp
+++ b/src/main/resources/web/jsps/stats.jsp
@@ -48,7 +48,7 @@ https://metrics.torproject.org/identifier.csv
 August 15, 2018: Made the first batch of changes to per-graph CSV 
files.
 September 15, 2018: Removed all pre-aggregated CSV files.
 October 28, 2018: Added and/or removed columns to Tor Browser downloads and updates by platform 
and Tor Browser downloads and updates by 
locale graphs.
-December 20, 2018 (scheduled): Remove source parameters and output 
rows with aggregates over all sources from Time to download 
files over Tor, Timeouts and failures of 
downloading files over Tor, Circuit build 
times, Circuit round-trip latencies 
graphs.
+December 20, 2018: Removed source parameters and output rows with 
aggregates over all sources from Time to download files over 
Tor, Timeouts and failures of downloading files 
over Tor, Circuit build times, Circuit round-trip latencies graphs.
 December 20, 2018 (scheduled): Remove two graphs Total relay bandwidth and Consumed bandwidth by Exit/Guard flag combination, and 
update the data format of the Advertised and 
consumed bandwidth by relay flag graph to cover all data previously 
contained in the first two graphs.
 
 
@@ -536,7 +536,6 @@ Performance #
 
 start: First UTC date (-MM-DD) to include in the file.
 end: Last UTC date (-MM-DD) to include in the file.
-source: Name of the OnionPerf or Torperf service performing 
measurements, or "all" for measurements performed by any service. This parameter is going to be removed after December 20, 
2018.
 server: Either "public" for requests to a server on the 
public internet, or "onion" for requests to a version 2 onion 
server.
 filesize: Size of the downloaded file in bytes, with pre-defined 
possible values: "50kb", "1mb", or "5mb".
 
@@ -546,7 +545,7 @@ Performance #
 
 date: UTC date (-MM-DD) when download performance was 
measured.
 filesize: Size of the downloaded file in bytes.
-source: Name of the OnionPerf or Torperf service performing 
measurements. If this column contains the empty string, all measurements are 
included, regardless of which service performed them. Output 
rows with aggregates over all sources are going to be removed after December 
20, 2018.
+source: Name of the OnionPerf or Torperf service performing 
measurements.
 server: Either "public" if the request was made to a server 
on the public internet, or "onion" if the request was made to a version 
2 onion server.
 q1: First quartile of time in milliseconds until receiving the last 
byte.
 md: Median of time in milliseconds until receiving the last 
byte.
@@ -563,7 +562,6 @@ Performance #
 
 start: First UTC date (-MM-DD) to include in the file.
 end: Last UTC date (-MM-DD) to include in the file.
-source: Name of the OnionPerf or Torperf service performing 
measurements, or "all" for measurements performed by any service. This parameter is going to be removed after December 20, 
2018.
 server: Either "public" for requests to a server on the 
public internet, or "onion" for requests to a version 2 onion 
server.
 filesize: Size of the downloaded file in bytes, with pre-defined 
possible values: "50kb", "1mb", or "5mb".
 
@@ -573,7 +571,7 @@ Performance #
 
 date: UTC date (-MM-DD) when download performance was 
measured.
 filesize: Size of the downloaded file in bytes.
-source: Name of the OnionPerf or Torperf service performing 
measurements. If this column contains the empty string, all measurements are 
included, regardless of which service performed them. Output 
rows with aggregates over all sources are going to be removed after December 
20, 2018.
+source: Name of the OnionPerf or Torperf service performing 
measurements.
 server: Either "public" if the request was made to a server 
on the public internet, or "onion" if the request was made to a version 
2 onion server.
 timeouts: Fraction of requests that timed out when attempting to 
download the static file over Tor.
 failures: Fraction of requests that failed when attempting to 
download the static file over Tor.
@@ -589,14 +587,13 @@ Performance #
 
 start: First UTC date (-MM-DD) to include in the file.
 end: Last UTC date (-MM-DD) to include in the file.
-source: Name of the OnionPerf or Torperf service performing 
measurements, or "all" for measurements performed by any service. This parameter is going to be removed after December 20, 
2018.
 
 
 Columns
 
 
 date: UTC date (-MM-DD) when download performance was 
measured.
-source: Name of the OnionPerf or Torperf 

[tor-commits] [translation/donatepages-messagespot] Update translations for donatepages-messagespot

2018-12-20 Thread translation
commit fb69dc0c3710f62cde9e6bc611becc1b8dc6618b
Author: Translation commit bot 
Date:   Thu Dec 20 09:15:25 2018 +

Update translations for donatepages-messagespot
---
 locale/he/LC_MESSAGES/messages.po | 23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/locale/he/LC_MESSAGES/messages.po 
b/locale/he/LC_MESSAGES/messages.po
index 029bf0fbc..769523bb8 100644
--- a/locale/he/LC_MESSAGES/messages.po
+++ b/locale/he/LC_MESSAGES/messages.po
@@ -510,13 +510,14 @@ msgstr "האם מה ש־Tor עושה חוקי? האם אנ
י יכול להסתב
 msgid ""
 "Downloading Tor Browser or using the Tor network is legal in nearly every "
 "country."
-msgstr ""
+msgstr "הורדת דפדפן Tor או שימוש ברשת Tor הם 
חוקיים בכמעט כל מדינה."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:184
 msgid ""
 "A few web sites occasionally block Tor, but that doesn't mean you're doing "
 "anything wrong."
 msgstr ""
+"אתרים אחדים חוסמים לעיתים את Tor, אבל זה לא 
אומר שאתה עושה משהו בצורה שגויה."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:186
 msgid ""
@@ -530,6 +531,7 @@ msgid ""
 "But it is not illegal to use Tor, and you shouldn't get in trouble for doing"
 " it."
 msgstr ""
+"אבל זה לא בלתי חוקי להשתמש ב־Tor, ואתה לא 
אמור להיכנס לצרות על שימוש בו."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:190
 msgid ""
@@ -537,6 +539,9 @@ msgid ""
 "class=\"hyperlinks links\" target=\"_blank\" "
 "href=\"https://www.eff.org/torchallenge/faq.html\;>EFF site."
 msgstr ""
+"אתה יכול למצוא עוד מידע אודות המעמד המשפטי 
של Tor בhttps://www.eff.org/torchallenge/faq.html\;>אתר של EFF."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:196
 msgid ""
@@ -648,6 +653,13 @@ msgid ""
 "  Phone number: 206-420-3136\n"
 "  Contact person: Isabela Bagueros, Executive Director"
 msgstr ""
+"מספר זהות מס של Tor Project הוא (EIN#): 
20-8096820\n"
+"  כתובת:\n"
+"  The Tor Project, Inc.\n"
+"  217 First Avenue South #4903\n"
+"  Seattle, WA  98194\n"
+"  מספר טלפון: 206-420-3136\n"
+"  איש קשר: Isabela Bagueros, Executive Director"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:264
 msgid "If I am not in the United States, can I still donate?"
@@ -881,6 +893,7 @@ msgid ""
 "(Also, if you wanted, you could give us $4,999 in late 2018 and $4,999 in "
 "early 2019.)"
 msgstr ""
+"(כמו כן, אילו רצית, יכולת לתת לנו $4,999 בסוף 
2018 ו־$4,999 בתחילת 2019.)"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:403
 msgid ""
@@ -1078,6 +1091,8 @@ msgid ""
 "If you want help figuring out the process, write us at giving(at)torproject.org."
 msgstr ""
+"אם אתה רוצה עזרה בקליטת התהליך, כתוב לנו 
בכתובת giving(at)torproject.org."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:512
 msgid "Can I become a Tor Project member?"
@@ -1087,7 +1102,7 @@ msgstr "האם אני יכול להפוך לחבר 
במיזם Tor?"
 msgid ""
 "Right now, we don't have a membership program, but we may set one up in the "
 "future."
-msgstr ""
+msgstr "כרגע אין לנו תוכנית חֲבֵרוּת, אבל אולי 
נקים אחת בעתיד."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:518
 msgid ""
@@ -1096,6 +,10 @@ msgid ""
 "href=\"https://www.torproject.org/getinvolved/volunteer.html.en\;>this is a "
 "good place to start."
 msgstr ""
+"אם אתה רוצה להיות מעורב במיזם Tor, https://www.torproject.org/getinvolved/volunteer.html.en\;>זהו 
מקום "
+"טוב להתחיל בו."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:524
 msgid "How can I get a Tor t-shirt or stickers?"

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


[tor-commits] [translation/donatepages-messagespot] Update translations for donatepages-messagespot

2018-12-20 Thread translation
commit 116605a15b42191783970cb0dd83dfaab28c4976
Author: Translation commit bot 
Date:   Thu Dec 20 08:45:26 2018 +

Update translations for donatepages-messagespot
---
 locale/he/LC_MESSAGES/messages.po | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/locale/he/LC_MESSAGES/messages.po 
b/locale/he/LC_MESSAGES/messages.po
index efc77254d..029bf0fbc 100644
--- a/locale/he/LC_MESSAGES/messages.po
+++ b/locale/he/LC_MESSAGES/messages.po
@@ -763,12 +763,14 @@ msgid ""
 "This allows our payment processor to verify your identity, process your "
 "payment, and prevent fraudulent charges to your credit card."
 msgstr ""
+"זה מתיר למעבד התשלומים שלנו לוודא את 
זהותך, לעבד את תשלומך ולמנוע חיובי "
+"נוכלים בכרטיס האשראי שלך."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:332
 msgid ""
 "We don't ask for information beyond what's required by the payment "
 "processor."
-msgstr ""
+msgstr "אנחנו לא מבקשים מידע מעבר למה שנדרש 
ע\"י מעבד התשלומים."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:338
 msgid "Why is there a minimum donation?"
@@ -779,12 +781,16 @@ msgid ""
 "People who have stolen credit card information often donate to nonprofits as"
 " a way of testing whether the card works."
 msgstr ""
+"אנשים שגנבו מידע של כרטיסי אשראי לעיתים 
תורמים אל ארגונים ללא מטרות רווח "
+"כדרך לבדיקה אם הכרטיס עובד."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:344
 msgid ""
 "These people typically use a very small amount for their testing, and we've "
 "found that setting a $1 minimum donation seems to deter them."
 msgstr ""
+"אנשים אלו משתמשים בד\"כ בסכום קטן מאוד 
לבדיקה שלהם, וגילינו שקביעת תרומת "
+"מיזער של $1 מרתיעה אותם."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:350
 msgid "Is there a maximum donation?"
@@ -942,6 +948,10 @@ msgid ""
 "organizations support the Tor network and may be able to offer you tax-"
 "deductibility for your donation."
 msgstr ""
+"או, אם אתה בגרמניה, צרפת או שוודיה, https://www.torproject.org/docs/faq.html.en#RelayDonations\;>ארגונ
ים "
+"אלו תומכים ברשת Tor ועשויים להציע לך 
אפשרות ניכוי של מס עבור תרומתך."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:437
 msgid ""
@@ -982,6 +992,8 @@ msgid ""
 "If you want your donation refunded, please tell us by emailing giving(at)torproject.org."
 msgstr ""
+"אם אתה רוצה שתרומתך תזוכה, אנא ספר לנו ע\"י 
שליחת דוא\"ל אל giving(at)torproject.org."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:464
 msgid ""
@@ -989,6 +1001,8 @@ msgid ""
 "amount you donated, your full name, the payment method you used and your "
 "country of origin."
 msgstr ""
+"כדי לעבד את זיכויך נצטרך לדעת את תאריך 
התרומה שלך, הסכום שתרמת, שמך המלא, "
+"שיטת התשלום שהשתמשת בה ומדינת המוצא שלך."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:466
 msgid "Please also tell us why you're asking for a refund."
@@ -1000,6 +1014,8 @@ msgid ""
 " to be made in a specific way, so we may need additional information from "
 "you in order to process yours."
 msgstr ""
+"אנא שים לב שכמה שיטות תשלום לא יתמכו 
בזיכויים, או ידרשו שהם ייעשו בדרך "
+"מסוימת, כך שיתכן שנצטרך ממך מידע נוסף על מנ
ת לעבד את זיכויך."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:474
 msgid "Can I donate by mail?"
@@ -1015,6 +1031,8 @@ msgid ""
 "Our mailing address is The Tor Project, 217 First Avenue South #4903, "
 "Seattle WA 98194, USA"
 msgstr ""
+"כתובת משלוח הדואר שלנו היא The Tor Project, 217 First 
Avenue South #4903, "
+"Seattle WA 98194, USA"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:486
 msgid "Do you accept cash donations?"
@@ -1034,6 +1052,8 @@ msgid ""
 "Verizon, Red Hat, many universities, and others-- will match donations made "
 "by their employees."
 msgstr ""
+"כן! חברות רבות כגון Google, Microsoft, eBay, PayPal, Apple, 
Verizon, Red "
+"Hat, אוניברסיטאות רבות וחברות אחרות, ישוו 
תרומות הנעשות ע\"י עובדיהן."
 
 #: 

[tor-commits] [translation/donatepages-messagespot] Update translations for donatepages-messagespot

2018-12-20 Thread translation
commit 4259360bd5a9ad793b67e434967bb9e6272b3c0a
Author: Translation commit bot 
Date:   Thu Dec 20 08:15:25 2018 +

Update translations for donatepages-messagespot
---
 locale/he/LC_MESSAGES/messages.po | 34 --
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/locale/he/LC_MESSAGES/messages.po 
b/locale/he/LC_MESSAGES/messages.po
index c328a12cf..efc77254d 100644
--- a/locale/he/LC_MESSAGES/messages.po
+++ b/locale/he/LC_MESSAGES/messages.po
@@ -109,6 +109,10 @@ msgid ""
 "target=\"_blank\" href=\"https://www.irs.gov/pub/irs-;
 "pdf/f990ezb.pdf\">Schedule B of the Form 990."
 msgstr ""
+"אם תתרום יותר מן $5,000 ונדע את שמך ואת 
כתובתך, אנחנו נדרשים לחשוף זאת בפני "
+"IRS בhttps://www.irs.gov/pub/irs-pdf/f990ezb.pdf\;>מפרט B של 
הטופס "
+"990."
 
 #: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:89
 msgid ""
@@ -130,6 +134,8 @@ msgid ""
 "For our records, we retain your name, the amount of your donation, the date "
 "of the donation, and your contact information."
 msgstr ""
+"לצורך רישומינו, אנחנו שומרים את שמך, סכום 
תרומתך, תאריך התרומה ומידע "
+"ההתקשרות שלך."
 
 #: 
tmp/cache_locale/ad/ad05838d90eae883761f0bcec6c27d77959c6e2884e8abf6c4aec89d7a741ea9.php:100
 msgid ""
@@ -699,7 +705,7 @@ msgstr "האם אני יכול לתרום בעת שימוש 
בדפדפן Tor?"
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:298
 msgid "Yes! In our testing, donation works via Tor Browser."
-msgstr ""
+msgstr "כן! בבדיקה שלנו, תרומה עובדת דרך דפדפן 
Tor."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:300
 msgid ""
@@ -735,6 +741,9 @@ msgid ""
 "Discover or American Express) or via PayPal, please visit our https://donate.torproject.org\;>donate page."
 msgstr ""
+"כדי לתרום ע\"י שימוש בכרטיס אשראי או כרטיס 
של חיוב מיידי (VISA, MasterCard, "
+"Discover או American Express) או דרך PayPal, אנא בקר בhttps://donate.torproject.org\;>דף התרומה שלנו."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:324
 msgid "Why do you ask for my address and similar information?"
@@ -746,6 +755,8 @@ msgid ""
 "required to process your credit card payment, including your billing "
 "address."
 msgstr ""
+"אם אתה תורם באמצעות כרטיס אשראי, תתבקש 
להזין מידע מסוים הדרוש כדי לעבד את "
+"תשלום כרטיס האשראי שלך, כולל כתובת החיוב 
שלך."
 
 #: 
tmp/cache_locale/4a/4ab2d928dab25aeb8c96bb2d1c2ad651173d6c029f40a442edf6925bfd038cd2.php:330
 msgid ""
@@ -1318,7 +1329,7 @@ msgstr "Tor: חוזק במספרים"
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:52
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:75
 msgid "Donate to the Tor Project and protect the privacy of millions."
-msgstr ""
+msgstr "תרום אל מיזם Tor והגן על הפרטיוּת של 
מיליונים."
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:54
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:77
@@ -1347,6 +1358,9 @@ msgid ""
 " https://www.torproject.org/donate/donate-options.html.en\;>other "
 "donations options page."
 msgstr ""
+"אם אתה רוצה לתרום ללא אפשור JavaScript, אנא העף 
מבט בhttps://www.torproject.org/donate/donate-options.html.en\;>דף "
+"אפשרויות תרומה אחרות שלנו."
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:123
 msgid "Number of Donations"
@@ -1401,7 +1415,7 @@ msgstr "לא תודה, אני לא רוצה שי."
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:218
 #, php-format
 msgid "I would prefer 100% of my donation to go to the Tor Project's work."
-msgstr ""
+msgstr "אני מעדיף כי 100% מתרומתי תלך אל העבודה 
של מיזם Tor."
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:229
 msgid "sticker Pack"
@@ -1420,7 +1434,7 @@ msgstr "חולצה קצרה"
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:254
 msgid "Get our limited edition Tor: Strength in Numbers shirt."
-msgstr ""
+msgstr "השג את Tor במהדורה המוגבלת שלנו: חולצת 
חוזק במספרים."
 
 #: 
tmp/cache_locale/04/0421bb9119a5b92b0e2e4a49c25d718283ccfa1495534b2a08ff967a0f4fd06a.php:265
 msgid "t-shirt pack"
@@ -1435,7 +1449,7 @@ msgstr ""