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

2018-12-01 Thread translation
commit afbf9c2187a33afef4762f50e2c8c4fff70f019b
Author: Translation commit bot 
Date:   Sun Dec 2 07:45:18 2018 +

Update translations for donatepages-messagespot
---
 locale/ka/LC_MESSAGES/messages.po | 13 +
 1 file changed, 13 insertions(+)

diff --git a/locale/ka/LC_MESSAGES/messages.po 
b/locale/ka/LC_MESSAGES/messages.po
index 97e6426af..0d0ea546f 100644
--- a/locale/ka/LC_MESSAGES/messages.po
+++ b/locale/ka/LC_MESSAGES/messages.po
@@ -578,6 +578,11 @@ msgid ""
 "privacy-enhancing browser for mobile devices and making it easier for third-"
 "party developers to integrate Tor into their applications."
 msgstr ""
+"თქვენი მხარდაჭერითა და 
შესაბამისი თანხების 
მოზიდვით Mozilla-სგან, ჩვენ "
+"შეგვეძლება შევეჭიდოთ ისეთ 
მნიშვნელოვან გამოწვევებს, რ
ოგორიცაა უფრო მეტად "
+"დაცული, პირადი მონაცემების 
ხელშეუხებლობის უზრ
უნველმყოფი ბრაუზერის შექმნა "
+"მობილური 
მოწყობილობებისთვის და 
ცალკეული 
შემმუშავებლებისთვის, Tor-ის 
თავიანთ "
+"პროგრამებში მარტივად 
ჩაშენების შესაძლებლობის 
მიცემა."
 
 #: 
tmp/cache_locale/af/afda2fbd22ed389453e63ca9acc074a25ce820b5bc97120edfd975cf8f46634a.php:56
 msgid ""
@@ -674,6 +679,9 @@ msgid ""
 "href=\"https://www.giantrabbit.com/\; class=\"stamp-bold\" "
 "target=\"_blank\">Giant Rabbit"
 msgstr ""
+"შემქმნელი და შემმუშავებელია 
https://www.giantrabbit.com/\; class=\"stamp-bold\" "
+"target=\"_blank\">Giant Rabbit"
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:34
 msgid "Tor Donor FAQ"
@@ -690,6 +698,11 @@ msgid ""
 "inquiries, or giving(at)torproject.org with "
 "donor-specific questions."
 msgstr ""
+"თუ თქვენს კითხვაზე პასუხს 
ქვემოთ ვერ ნახავთ, მოგვწერეთ 
frontdesk(at)rt.torproject.org მისამარ
თზე, Tor-თან "
+"დაკავშირებულ ზოგად 
საკითხებზე ან giving(at)torproject.org მისამარ
თზე, შემოწირულობებთან"
+" დაკავშირებულ საკითხებზე."
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:68
 msgid "What is the Tor Project and what does it do?"

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


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

2018-12-01 Thread translation
commit 6d3aa85b6d7047c7e8f53559b5aef2c9f99710c6
Author: Translation commit bot 
Date:   Sun Dec 2 06:19:14 2018 +

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

diff --git a/contents+ka.po b/contents+ka.po
index f5448af68..f4919e80a 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -2998,8 +2998,9 @@ msgid ""
 "connecting to http://3g2upl4pq6kufc4m.onion\;>DuckDuckGo's "
 "Onion Service."
 msgstr ""
-"ამასთან, Onion-მომსახურებებთან 
წვდომის შესაძლებლობა 
შეგიძლიათ გადაამოწმოთ "
-"DuckDuckGo-ს Onion-მომსახურებასთან 
დაკავშირების მეშვეობით."
+"ამასთან, Onion-მომსახურებებთან 
წვდომის შესაძლებლობა 
შეგიძლიათ გადაამოწმოთ http://3g2upl4pq6kufc4m.onion\;>DuckDuckGo-ს Onion-"
+"მომსახურებასთან დაკავშირ
ების მეშვეობით."
 
 #: http//localhost/connecting/cannot-reach-x-onion/
 #: (content/connecting/connecting-3/contents+en.lrquestion.seo_slug)
@@ -3373,7 +3374,7 @@ msgstr "Nickname ididnteditheconfig"
 #: http//localhost/operators/how-do-i-run-a-obfs4-bridge-debian/
 #: (content/operators/operators-6/contents+en.lrquestion.description)
 msgid "## Set your own contact info"
-msgstr "## მიუთითეთ თქვენი 
მონაცემების დასაკავშირებლად"
+msgstr "## მიუთითეთ საკუთარი 
საკონტაქტო მონაცემები"
 
 #: http//localhost/operators/how-do-i-run-a-middle-or-guard-relay/
 #: (content/operators/operators-1/contents+en.lrquestion.description)
@@ -4067,8 +4068,9 @@ msgid ""
 "connecting to http://3g2upl4pq6kufc4m.onion\;>DuckDuckGo's onion "
 "service."
 msgstr ""
-"ამასთან, Onion-მომსახურებებთან 
წვდომის შესაძლებლობა 
შეგიძლიათ გადაამოწმოთ "
-"DuckDuckGo-ს Onion-მომსახურებასთან 
დაკავშირების მეშვეობით."
+"ამასთან, Onion-მომსახურებებთან 
წვდომის შესაძლებლობა 
შეგიძლიათ გადაამოწმოთ http://3g2upl4pq6kufc4m.onion\;>DuckDuckGo-ს Onion-"
+"მომსახურებასთან დაკავშირ
ების მეშვეობით."
 
 #: http//localhost/onionservices/i-cannot-reach-x-dot-onion/
 #: (content/onionservices/onionservices-3/contents+en.lrquestion.seo_slug)

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


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

2018-12-01 Thread translation
commit abcdf85368a5f86325d00c6d41cbea1e5a972750
Author: Translation commit bot 
Date:   Sun Dec 2 06:19:08 2018 +

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

diff --git a/contents+ka.po b/contents+ka.po
index f5448af68..f4919e80a 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -2998,8 +2998,9 @@ msgid ""
 "connecting to http://3g2upl4pq6kufc4m.onion\;>DuckDuckGo's "
 "Onion Service."
 msgstr ""
-"ამასთან, Onion-მომსახურებებთან 
წვდომის შესაძლებლობა 
შეგიძლიათ გადაამოწმოთ "
-"DuckDuckGo-ს Onion-მომსახურებასთან 
დაკავშირების მეშვეობით."
+"ამასთან, Onion-მომსახურებებთან 
წვდომის შესაძლებლობა 
შეგიძლიათ გადაამოწმოთ http://3g2upl4pq6kufc4m.onion\;>DuckDuckGo-ს Onion-"
+"მომსახურებასთან დაკავშირ
ების მეშვეობით."
 
 #: http//localhost/connecting/cannot-reach-x-onion/
 #: (content/connecting/connecting-3/contents+en.lrquestion.seo_slug)
@@ -3373,7 +3374,7 @@ msgstr "Nickname ididnteditheconfig"
 #: http//localhost/operators/how-do-i-run-a-obfs4-bridge-debian/
 #: (content/operators/operators-6/contents+en.lrquestion.description)
 msgid "## Set your own contact info"
-msgstr "## მიუთითეთ თქვენი 
მონაცემების დასაკავშირებლად"
+msgstr "## მიუთითეთ საკუთარი 
საკონტაქტო მონაცემები"
 
 #: http//localhost/operators/how-do-i-run-a-middle-or-guard-relay/
 #: (content/operators/operators-1/contents+en.lrquestion.description)
@@ -4067,8 +4068,9 @@ msgid ""
 "connecting to http://3g2upl4pq6kufc4m.onion\;>DuckDuckGo's onion "
 "service."
 msgstr ""
-"ამასთან, Onion-მომსახურებებთან 
წვდომის შესაძლებლობა 
შეგიძლიათ გადაამოწმოთ "
-"DuckDuckGo-ს Onion-მომსახურებასთან 
დაკავშირების მეშვეობით."
+"ამასთან, Onion-მომსახურებებთან 
წვდომის შესაძლებლობა 
შეგიძლიათ გადაამოწმოთ http://3g2upl4pq6kufc4m.onion\;>DuckDuckGo-ს Onion-"
+"მომსახურებასთან დაკავშირ
ების მეშვეობით."
 
 #: http//localhost/onionservices/i-cannot-reach-x-dot-onion/
 #: (content/onionservices/onionservices-3/contents+en.lrquestion.seo_slug)

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


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

2018-12-01 Thread translation
commit 0a16f6b8918b665148f51866d1d495fabfb06c02
Author: Translation commit bot 
Date:   Sun Dec 2 05:49:23 2018 +

Update translations for support-portal_completed
---
 contents+ka.po | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contents+ka.po b/contents+ka.po
index a359ad377..f5448af68 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -2004,7 +2004,7 @@ msgid ""
 "protection is blocking me from accessing Tor Browser, it is "
 "common for anti-virus / anti-malware software to cause this type of issue."
 msgstr ""
-"თუ ანტივირუსული პროგრამა 
გაქვთ გაშვებულია, გთხოვთ 
იხილოთ http://support.torproject.org/#tbb-10\;>ჩემი 
ანტივირუსული/მავნე "
 "პროგრამებისგან დასაცავი 
საშუალება ხელს მიშლის Tor-ბრ
აუზერთან "
 "წვდომაში, ხშირია 
შემთხვევები, როცა ანტივირ
უსული/მავნე "
@@ -2183,8 +2183,8 @@ msgid ""
 "If you are unable to connect to an onion service, please see I cannot reach X.onion!"
 msgstr ""
-"თუ ვერ ახერხებთ onion-მომსახურ
ებასთან დაკავშირებას, გთხოვთ 
იხილოთ ვერ "
-"ვუკავშირდები X.onion-ს!"
+"თუ ვერ ახერხებთ onion-მომსახურ
ებასთან დაკავშირებას, გთხოვთ 
იხილოთ ვერ ვუკავშირდები 
X.onion-ს!"
 
 #: http//localhost/tbb/website-blocking-access-over-tor/
 #: (content/tbb/tbb-7/contents+en.lrquestion.seo_slug)

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


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

2018-12-01 Thread translation
commit e20885f67579e76019f8019fa9548cf58c9669e1
Author: Translation commit bot 
Date:   Sun Dec 2 05:49:16 2018 +

Update translations for support-portal
---
 contents+ka.po | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contents+ka.po b/contents+ka.po
index a359ad377..f5448af68 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -2004,7 +2004,7 @@ msgid ""
 "protection is blocking me from accessing Tor Browser, it is "
 "common for anti-virus / anti-malware software to cause this type of issue."
 msgstr ""
-"თუ ანტივირუსული პროგრამა 
გაქვთ გაშვებულია, გთხოვთ 
იხილოთ http://support.torproject.org/#tbb-10\;>ჩემი 
ანტივირუსული/მავნე "
 "პროგრამებისგან დასაცავი 
საშუალება ხელს მიშლის Tor-ბრ
აუზერთან "
 "წვდომაში, ხშირია 
შემთხვევები, როცა ანტივირ
უსული/მავნე "
@@ -2183,8 +2183,8 @@ msgid ""
 "If you are unable to connect to an onion service, please see I cannot reach X.onion!"
 msgstr ""
-"თუ ვერ ახერხებთ onion-მომსახურ
ებასთან დაკავშირებას, გთხოვთ 
იხილოთ ვერ "
-"ვუკავშირდები X.onion-ს!"
+"თუ ვერ ახერხებთ onion-მომსახურ
ებასთან დაკავშირებას, გთხოვთ 
იხილოთ ვერ ვუკავშირდები 
X.onion-ს!"
 
 #: http//localhost/tbb/website-blocking-access-over-tor/
 #: (content/tbb/tbb-7/contents+en.lrquestion.seo_slug)

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


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

2018-12-01 Thread translation
commit 45415e3ae990510f3700ec9371696208d47782ab
Author: Translation commit bot 
Date:   Sun Dec 2 05:19:19 2018 +

Update translations for support-portal
---
 contents+ka.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contents+ka.po b/contents+ka.po
index 883f81e97..a359ad377 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -152,7 +152,7 @@ msgstr ""
 #: (content/tbb/tbb-3/contents+en.lrquestion.description)
 msgid "Tor Browser prevents people from knowing the websites you visit."
 msgstr ""
-"Tor-ბრაუზერი არ აძლევს სხვებს 
საშუალებას გაიგონ, თუ რა 
საიტებს ეწვევით."
+"Tor-ბრაუზერი არ აძლევს სხვებს 
საშუალებას გაიგონ, თუ რომელ 
საიტებს ნახულობთ."
 
 #: http//localhost/faq/will-anyone-be-able-to-tell-which-website-i-visit/
 #: (content/faq/faq-1/contents+en.lrquestion.description)

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


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

2018-12-01 Thread translation
commit 49d9697aa80e48577707e31089dc920631646358
Author: Translation commit bot 
Date:   Sun Dec 2 05:19:25 2018 +

Update translations for support-portal_completed
---
 contents+ka.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contents+ka.po b/contents+ka.po
index 883f81e97..a359ad377 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -152,7 +152,7 @@ msgstr ""
 #: (content/tbb/tbb-3/contents+en.lrquestion.description)
 msgid "Tor Browser prevents people from knowing the websites you visit."
 msgstr ""
-"Tor-ბრაუზერი არ აძლევს სხვებს 
საშუალებას გაიგონ, თუ რა 
საიტებს ეწვევით."
+"Tor-ბრაუზერი არ აძლევს სხვებს 
საშუალებას გაიგონ, თუ რომელ 
საიტებს ნახულობთ."
 
 #: http//localhost/faq/will-anyone-be-able-to-tell-which-website-i-visit/
 #: (content/faq/faq-1/contents+en.lrquestion.description)

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


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

2018-12-01 Thread translation
commit adb9960764ef776f708c17f6569a1c380a667801
Author: Translation commit bot 
Date:   Sun Dec 2 04:46:06 2018 +

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

diff --git a/ja.po b/ja.po
index a480b7ba2..ced4fb4c9 100644
--- a/ja.po
+++ b/ja.po
@@ -12,18 +12,19 @@
 # Kota Ura, 2017
 # Masaki Saito , 2013
 # mksyslab, 2014
+# Nagai Akihiro , 2018
 # nord stream , 2016
 # Ippei Shinozaki , 2015
 # Tokumei Nanashi, 2015,2018
-# unknown, 2018
+# 323484, 2018
 # 藤前 甲 , 2014
 msgid ""
 msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-12-01 11:05+0100\n"
-"PO-Revision-Date: 2018-12-01 14:39+\n"
-"Last-Translator: carolyn \n"
+"PO-Revision-Date: 2018-12-02 04:23+\n"
+"Last-Translator: Nagai Akihiro \n"
 "Language-Team: Japanese 
(http://www.transifex.com/otf/torproject/language/ja/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -174,7 +175,7 @@ msgstr ""
 
 #: config/chroot_local-includes/usr/local/sbin/tails-additional-software:223
 msgid ", "
-msgstr ""
+msgstr ", "
 
 #. Translators: Don't translate {packages}, it's a placeholder and will
 #. be replaced.

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


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

2018-12-01 Thread translation
commit 16f031f9aa09e94c3018e9d848e3ca2e65d2bf1c
Author: Translation commit bot 
Date:   Sun Dec 2 04:46:32 2018 +

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

diff --git a/ja/ja.po b/ja/ja.po
index c74102e84..5aa669f1d 100644
--- a/ja/ja.po
+++ b/ja/ja.po
@@ -17,7 +17,8 @@
 # anon owl , 2018
 # TEN CO , 2018
 # ishikawa satoru , 2018
-# unknown, 2018
+# 323484, 2018
+# Nagai Akihiro , 2018
 # 
 #, fuzzy
 msgid ""
@@ -26,7 +27,7 @@ msgstr ""
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-09-04 09:46+0200\n"
 "PO-Revision-Date: 2016-11-18 21:29+\n"
-"Last-Translator: unknown, 2018\n"
+"Last-Translator: Nagai Akihiro , 2018\n"
 "Language-Team: Japanese (https://www.transifex.com/otf/teams/1519/ja/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -190,7 +191,7 @@ msgstr ""
 
 #: ../data/greeter.ui.h:39
 msgid "Network Configuration"
-msgstr ""
+msgstr "ネットワーク設定"
 
 #: ../data/greeter.ui.h:40
 msgid ""

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


[tor-commits] [tor/master] tor-resolve: Rework SOCKS5 response parsing with trunnel

2018-12-01 Thread nickm
commit 39e158db365fe3c033c3f8f99a2de1bfed3b707a
Author: rl1987 
Date:   Wed Sep 12 15:03:08 2018 +0300

tor-resolve: Rework SOCKS5 response parsing with trunnel
---
 src/tools/tor-resolve.c | 78 -
 1 file changed, 44 insertions(+), 34 deletions(-)

diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index 7aa3871b6..ba83f3e3b 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -15,7 +15,7 @@
 #include "lib/string/util_string.h"
 
 #include "lib/net/socks5_status.h"
-#include "socks5.h"
+#include "trunnel/socks5.h"
 
 #include 
 #include 
@@ -463,56 +463,66 @@ do_resolve(const char *hostname,
   goto err;
 }
   } else {
-char reply_buf[16];
-if (read_all_from_socket(s, reply_buf, 4) != 4) {
-  log_err(LD_NET, "Error reading SOCKS5 response.");
+uint8_t reply_buf[512];
+
+len = read_all_from_socket(s, (char *)reply_buf,
+   sizeof(reply_buf));
+
+socks5_server_reply_t *reply;
+
+ssize_t parsed = socks5_server_reply_parse(,
+   reply_buf,
+   len);
+if (parsed == -1) {
+  log_err(LD_NET, "Failed parsing SOCKS5 response");
   goto err;
 }
 
-if (reply_buf[0] != 5) {
-  log_err(LD_NET, "Bad SOCKS5 reply version.");
+if (parsed == -2) {
+  log_err(LD_NET, "Truncated SOCKS5 response");
   goto err;
 }
+
 /* Give a user some useful feedback about SOCKS5 errors */
-if (reply_buf[1] != 0) {
+uint8_t reply_field = socks5_server_reply_get_reply(reply);
+if (reply_field != 0) {
   log_warn(LD_NET,"Got SOCKS5 status response '%u': %s",
-   (unsigned)reply_buf[1],
-   socks5_reason_to_string(reply_buf[1]));
-  if (reply_buf[1] == 4 && !strcasecmpend(hostname, ".onion")) {
+   (unsigned)reply_field,
+   socks5_reason_to_string(reply_field));
+  if (reply_field == 4 && !strcasecmpend(hostname, ".onion")) {
 onion_warning(hostname);
   }
+
+  socks5_server_reply_free(reply);
   goto err;
 }
-if (reply_buf[3] == 1) {
+
+uint8_t atype = socks5_server_reply_get_atype(reply);
+
+if (atype == SOCKS5_ATYPE_IPV4) {
   /* IPv4 address */
-  if (read_all_from_socket(s, reply_buf, 4) != 4) {
-log_err(LD_NET, "Error reading address in socks5 response.");
-goto err;
-  }
-  tor_addr_from_ipv4n(result_addr, get_uint32(reply_buf));
-} else if (reply_buf[3] == 4) {
+  tor_addr_from_ipv4h(result_addr,
+socks5_server_reply_get_bind_addr_ipv4(reply));
+} else if (atype == SOCKS5_ATYPE_IPV6) {
   /* IPv6 address */
-  if (read_all_from_socket(s, reply_buf, 16) != 16) {
-log_err(LD_NET, "Error reading address in socks5 response.");
-goto err;
-  }
-  tor_addr_from_ipv6_bytes(result_addr, reply_buf);
-} else if (reply_buf[3] == 3) {
+  tor_addr_from_ipv6_bytes(result_addr,
+(const char *)socks5_server_reply_getarray_bind_addr_ipv6(reply));
+} else if (atype == SOCKS5_ATYPE_HOSTNAME) {
   /* Domain name */
-  size_t result_len;
-  if (read_all_from_socket(s, reply_buf, 1) != 1) {
-log_err(LD_NET, "Error reading address_length in socks5 response.");
-goto err;
-  }
-  result_len = *(uint8_t*)(reply_buf);
+  domainname_t *dn =
+socks5_server_reply_get_bind_addr_domainname(reply);
+
+  size_t result_len = (size_t)domainname_get_len(dn);
+
   *result_hostname = tor_malloc(result_len+1);
-  if (read_all_from_socket(s, *result_hostname, result_len)
-  != (int) result_len) {
-log_err(LD_NET, "Error reading hostname in socks5 response.");
-goto err;
-  }
+
+  strncpy(*result_hostname, (char *)domainname_getstr_name(dn),
+  result_len);
+
   (*result_hostname)[result_len] = '\0';
 }
+
+socks5_server_reply_free(reply);
   }
 
   tor_close_socket(s);



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


[tor-commits] [tor/master] Use tor_strdup() in place of malloc+strncpy+terminate.

2018-12-01 Thread nickm
commit 0015d0084262ddc60098b15d6cdf30ea66d59a53
Author: Nick Mathewson 
Date:   Sat Dec 1 20:46:06 2018 -0500

Use tor_strdup() in place of malloc+strncpy+terminate.
---
 src/tools/tor-resolve.c | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index ba83f3e3b..803ed26b3 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -512,14 +512,7 @@ do_resolve(const char *hostname,
   domainname_t *dn =
 socks5_server_reply_get_bind_addr_domainname(reply);
 
-  size_t result_len = (size_t)domainname_get_len(dn);
-
-  *result_hostname = tor_malloc(result_len+1);
-
-  strncpy(*result_hostname, (char *)domainname_getstr_name(dn),
-  result_len);
-
-  (*result_hostname)[result_len] = '\0';
+  *result_hostname = tor_strdup(domainname_getstr_name(dn));
 }
 
 socks5_server_reply_free(reply);

___
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-01 Thread nickm
commit 009205dabe4ba7aba43dffead4087ca94ef9a8e3
Author: rl1987 
Date:   Thu Sep 13 10:18:06 2018 +0300

Add changes file
---
 changes/ticket27620 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/changes/ticket27620 b/changes/ticket27620
new file mode 100644
index 0..6c491696d
--- /dev/null
+++ b/changes/ticket27620
@@ -0,0 +1,3 @@
+  o Code simplification and refactoring:
+- Rework SOCKS wire format handling to rely on trunnel-generated
+  parsing/generation code. Resolves ticket 27620.



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


[tor-commits] [tor/master] Fix coverage build

2018-12-01 Thread nickm
commit 353d2a091d245146576d33a703fe3674c29e0654
Author: rl1987 
Date:   Thu Sep 13 09:57:43 2018 +0300

Fix coverage build
---
 src/tools/include.am | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/tools/include.am b/src/tools/include.am
index 352d4b532..72dfe6017 100644
--- a/src/tools/include.am
+++ b/src/tools/include.am
@@ -17,8 +17,11 @@ if COVERAGE_ENABLED
 src_tools_tor_cov_resolve_SOURCES = src/tools/tor-resolve.c
 src_tools_tor_cov_resolve_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
 src_tools_tor_cov_resolve_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
+src_tools_tor_cov_resolve_LDFLAGS = @TOR_LDFLAGS_openssl@
 src_tools_tor_cov_resolve_LDADD = \
+   src/trunnel/libor-trunnel.a \
$(TOR_UTIL_TESTING_LIBS) \
+   $(TOR_CRYPTO_TESTING_LIBS) $(TOR_LIBS_CRYPTLIB) \
@TOR_LIB_MATH@ @TOR_LIB_WS32@
 endif
 



___
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/556'

2018-12-01 Thread nickm
commit 8accf71c4418990296dbc01ffa4020da10448a7d
Merge: 2b2b97484 009205dab
Author: Nick Mathewson 
Date:   Sat Dec 1 20:35:38 2018 -0500

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

 changes/ticket27620|   3 +
 src/tools/include.am   |   7 +-
 src/tools/tor-resolve.c| 396 +
 src/trunnel/socks5.c   |  13 +-
 src/trunnel/socks5.trunnel |   2 +-
 5 files changed, 313 insertions(+), 108 deletions(-)



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


[tor-commits] [tor/master] tor-resolve: generate SOCKS4a request with trunnel

2018-12-01 Thread nickm
commit a2bb172225e1eecc9e93da655a0d316c4b214ff6
Author: rl1987 
Date:   Tue Sep 11 19:38:30 2018 +0300

tor-resolve: generate SOCKS4a request with trunnel
---
 src/tools/tor-resolve.c | 75 +
 1 file changed, 63 insertions(+), 12 deletions(-)

diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index 95411d173..4ba372b66 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -15,6 +15,7 @@
 #include "lib/string/util_string.h"
 
 #include "lib/net/socks5_status.h"
+#include "socks5.h"
 
 #include 
 #include 
@@ -49,11 +50,68 @@
 
 static void usage(void) ATTR_NORETURN;
 
+/**
+ * Set out to a pointer to newly allocated buffer containing
+ * SOCKS4a RESOLVE request with username and hostname.
+ * Return number of bytes in the buffer if succeeded or -1 if failed.
+ */
+static ssize_t
+build_socks4a_resolve_request(uint8_t **out,
+  const char *username,
+  const char *hostname)
+{
+  tor_assert(out);
+  tor_assert(username);
+  tor_assert(hostname);
+
+  const char *errmsg = NULL;
+  uint8_t *output = NULL;
+  socks4_client_request_t *rq = socks4_client_request_new();
+
+  socks4_client_request_set_version(rq, 4);
+  socks4_client_request_set_command(rq, CMD_RESOLVE);
+  socks4_client_request_set_port(rq, 0);
+  socks4_client_request_set_addr(rq, 0x0001u);
+  socks4_client_request_set_username(rq, username);
+  socks4_client_request_set_socks4a_addr_hostname(rq, hostname);
+
+  errmsg = socks4_client_request_check(rq);
+  if (errmsg) {
+goto cleanup;
+  }
+
+  ssize_t encoded_len = socks4_client_request_encoded_len(rq);
+  if (encoded_len <= 0) {
+errmsg = "socks4_client_request_encoded_len failed";
+goto cleanup;
+  }
+
+  output = tor_malloc(encoded_len);
+  memset(output, 0, encoded_len);
+
+  encoded_len = socks4_client_request_encode(output, encoded_len, rq);
+  if (encoded_len <= 0) {
+errmsg = "socks4_client_request_encode failed";
+goto cleanup;
+  }
+
+  *out = output;
+
+ cleanup:
+  socks4_client_request_free(rq);
+  if (errmsg) {
+log_err(LD_NET, "build_socks4a_resolve_request failed: %s", errmsg);
+*out = NULL;
+tor_free(output);
+  }
+  return errmsg ? -1 : encoded_len;
+}
+
 /** Set *out to a newly allocated SOCKS4a resolve request with
  * username and hostname as provided.  Return the number
  * of bytes in the request. */
 static ssize_t
-build_socks_resolve_request(char **out,
+build_socks_resolve_request(uint8_t **out,
 const char *username,
 const char *hostname,
 int reverse,
@@ -65,14 +123,7 @@ build_socks_resolve_request(char **out,
   tor_assert(hostname);
 
   if (version == 4) {
-len = 8 + strlen(username) + 1 + strlen(hostname) + 1;
-*out = tor_malloc(len);
-(*out)[0] = 4;  /* SOCKS version 4 */
-(*out)[1] = '\xF0'; /* Command: resolve. */
-set_uint16((*out)+2, htons(0)); /* port: 0. */
-set_uint32((*out)+4, htonl(0x0001u)); /* addr: 0.0.0.1 */
-memcpy((*out)+8, username, strlen(username)+1);
-memcpy((*out)+8+strlen(username)+1, hostname, strlen(hostname)+1);
+return build_socks4a_resolve_request(out, username, hostname);
   } else if (version == 5) {
 int is_ip_address;
 tor_addr_t addr;
@@ -205,7 +256,7 @@ do_resolve(const char *hostname,
   int s = -1;
   struct sockaddr_storage ss;
   socklen_t socklen;
-  char *req = NULL;
+  uint8_t *req = NULL;
   ssize_t len = 0;
 
   tor_assert(hostname);
@@ -231,7 +282,7 @@ do_resolve(const char *hostname,
 
   if (version == 5) {
 char method_buf[2];
-if (write_all_to_socket(s, "\x05\x01\x00", 3) != 3) {
+if (write_all_to_socket(s, (const char *)"\x05\x01\x00", 3) != 3) {
   log_err(LD_NET, "Error sending SOCKS5 method list.");
   goto err;
 }
@@ -257,7 +308,7 @@ do_resolve(const char *hostname,
 tor_assert(!req);
 goto err;
   }
-  if (write_all_to_socket(s, req, len) != len) {
+  if (write_all_to_socket(s, (const char *)req, len) != len) {
 log_sock_error("sending SOCKS request", s);
 tor_free(req);
 goto err;



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


[tor-commits] [tor/master] tor-resolve: Use trunnel code for SOCKS5 request generation

2018-12-01 Thread nickm
commit 83af6d6149bb589be01a14b1d800614c1beb9f18
Author: rl1987 
Date:   Tue Sep 11 21:42:38 2018 +0300

tor-resolve: Use trunnel code for SOCKS5 request generation
---
 src/tools/tor-resolve.c | 158 +---
 1 file changed, 122 insertions(+), 36 deletions(-)

diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index 4ba372b66..c255a7112 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -107,6 +107,123 @@ build_socks4a_resolve_request(uint8_t **out,
   return errmsg ? -1 : encoded_len;
 }
 
+#define SOCKS5_ATYPE_HOSTNAME 0x03
+#define SOCKS5_ATYPE_IPV4 0x01
+#define SOCKS5_ATYPE_IPV6 0x04
+
+/**
+ * Set out to pointer to newly allocated buffer containing
+ * SOCKS5 RESOLVE/RESOLVE_PTR request with given hostname.
+ * Generate a reverse request if reverse is true.
+ * Return the number of bytes in the buffer if succeeded or -1 if failed.
+ */
+static ssize_t
+build_socks5_resolve_request(uint8_t **out,
+ const char *hostname,
+ int reverse)
+{
+  const char *errmsg = NULL;
+  uint8_t *outbuf = NULL;
+  int is_ip_address;
+  tor_addr_t addr;
+  size_t addrlen;
+  int ipv6;
+  is_ip_address = tor_addr_parse(, hostname) != -1;
+  if (!is_ip_address && reverse) {
+log_err(LD_GENERAL, "Tried to do a reverse lookup on a non-IP!");
+return -1;
+  }
+  ipv6 = reverse && tor_addr_family() == AF_INET6;
+  addrlen = reverse ? (ipv6 ? 16 : 4) : 1 + strlen(hostname);
+  if (addrlen > UINT8_MAX) {
+log_err(LD_GENERAL, "Hostname is too long!");
+return -1;
+  }
+
+  socks5_client_request_t *rq = socks5_client_request_new();
+
+  socks5_client_request_set_version(rq, 5);
+  /* RESOLVE_PTR or RESOLVE */
+  socks5_client_request_set_command(rq, reverse ? CMD_RESOLVE_PTR :
+  CMD_RESOLVE);
+  socks5_client_request_set_reserved(rq, 0);
+
+  uint8_t atype = SOCKS5_ATYPE_HOSTNAME;
+  if (reverse)
+atype = ipv6 ? SOCKS5_ATYPE_IPV6 : SOCKS5_ATYPE_IPV4;
+
+  socks5_client_request_set_atype(rq, atype);
+
+  switch (atype) {
+case SOCKS5_ATYPE_IPV4: {
+  socks5_client_request_set_dest_addr_ipv4(rq,
+tor_addr_to_ipv4h());
+} break;
+case SOCKS5_ATYPE_IPV6: {
+  uint8_t *ipv6_array =
+socks5_client_request_getarray_dest_addr_ipv6(rq);
+
+  tor_assert(ipv6_array);
+
+  memcpy(ipv6_array, tor_addr_to_in6_addr8(), 16);
+} break;
+
+case SOCKS5_ATYPE_HOSTNAME: {
+  domainname_t *dn = domainname_new();
+  domainname_set_len(dn, addrlen - 1);
+  domainname_setlen_name(dn, addrlen - 1);
+  char *dn_buf = domainname_getarray_name(dn);
+  memcpy(dn_buf, hostname, addrlen - 1);
+
+  errmsg = domainname_check(dn);
+
+  if (errmsg) {
+domainname_free(dn);
+goto cleanup;
+  } else {
+socks5_client_request_set_dest_addr_domainname(rq, dn);
+  }
+} break;
+default:
+  tor_assert_unreached();
+  break;
+  }
+
+  socks5_client_request_set_dest_port(rq, 0);
+
+  errmsg = socks5_client_request_check(rq);
+  if (errmsg) {
+goto cleanup;
+  }
+
+  ssize_t encoded_len = socks5_client_request_encoded_len(rq);
+  if (encoded_len < 0) {
+errmsg = "Cannot predict encoded length";
+goto cleanup;
+  }
+
+  outbuf = tor_malloc(encoded_len);
+  memset(outbuf, 0, encoded_len);
+
+  encoded_len = socks5_client_request_encode(outbuf, encoded_len, rq);
+  if (encoded_len < 0) {
+errmsg = "encoding failed";
+goto cleanup;
+  }
+
+  *out = outbuf;
+
+ cleanup:
+  socks5_client_request_free(rq);
+  if (errmsg) {
+tor_free(outbuf);
+log_err(LD_NET, "build_socks5_resolve_request failed with error: %s",
+errmsg);
+  }
+
+  return errmsg ? -1 : encoded_len;
+}
+
 /** Set *out to a newly allocated SOCKS4a resolve request with
  * username and hostname as provided.  Return the number
  * of bytes in the request. */
@@ -117,51 +234,20 @@ build_socks_resolve_request(uint8_t **out,
 int reverse,
 int version)
 {
-  size_t len = 0;
   tor_assert(out);
   tor_assert(username);
   tor_assert(hostname);
 
+  tor_assert(version == 4 || version == 5);
+
   if (version == 4) {
 return build_socks4a_resolve_request(out, username, hostname);
   } else if (version == 5) {
-int is_ip_address;
-tor_addr_t addr;
-size_t addrlen;
-int ipv6;
-is_ip_address = tor_addr_parse(, hostname) != -1;
-if (!is_ip_address && reverse) {
-  log_err(LD_GENERAL, "Tried to do a reverse lookup on a non-IP!");
-  return -1;
-}
-ipv6 = reverse && tor_addr_family() == AF_INET6;
-addrlen = reverse ? (ipv6 ? 16 : 4) : 1 + strlen(hostname);
-if (addrlen > UINT8_MAX) {
-  log_err(LD_GENERAL, "Hostname is too long!");
-  return -1;
-}
-len = 6 + addrlen;
-*out = tor_malloc(len);
-(*out)[0] 

[tor-commits] [tor/master] tor-resolve: parse SOCKS4a reply

2018-12-01 Thread nickm
commit 1051969a1d7f642c9062afefd760577d0eda35f5
Author: rl1987 
Date:   Wed Sep 12 11:30:01 2018 +0300

tor-resolve: parse SOCKS4a reply
---
 src/tools/tor-resolve.c | 39 ---
 1 file changed, 28 insertions(+), 11 deletions(-)

diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index c255a7112..659d51179 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -271,34 +271,50 @@ parse_socks4a_resolve_response(const char *hostname,
const char *response, size_t len,
tor_addr_t *addr_out)
 {
+  int result = 0;
   uint8_t status;
   tor_assert(response);
   tor_assert(addr_out);
 
-  if (len < RESPONSE_LEN_4) {
+  socks4_server_reply_t *reply;
+
+  ssize_t parsed = socks4_server_reply_parse(,
+ (const uint8_t *)response,
+ len);
+
+  if (parsed == -1) {
+log_warn(LD_PROTOCOL, "Failed parsing SOCKS4a response");
+result = -1; goto cleanup;
+  }
+
+  if (parsed == -2) {
 log_warn(LD_PROTOCOL,"Truncated socks response.");
-return -1;
+result = -1; goto cleanup;
   }
-  if (((uint8_t)response[0])!=0) { /* version: 0 */
+
+  if (socks4_server_reply_get_version(reply) != 0) { /* version: 0 */
 log_warn(LD_PROTOCOL,"Nonzero version in socks response: bad format.");
-return -1;
+result = -1; goto cleanup;
   }
-  status = (uint8_t)response[1];
-  if (get_uint16(response+2)!=0) { /* port: 0 */
+  if (socks4_server_reply_get_port(reply) != 0) { /* port: 0 */
 log_warn(LD_PROTOCOL,"Nonzero port in socks response: bad format.");
-return -1;
+result = -1; goto cleanup;
   }
+  status = socks4_server_reply_get_status(reply);
   if (status != 90) {
 log_warn(LD_NET,"Got status response '%d': socks request failed.", status);
 if (!strcasecmpend(hostname, ".onion")) {
   onion_warning(hostname);
-  return -1;
+  result = -1; goto cleanup;
 }
-return -1;
+result = -1; goto cleanup;
   }
 
-  tor_addr_from_ipv4n(addr_out, get_uint32(response+4));
-  return 0;
+  tor_addr_from_ipv4h(addr_out, socks4_server_reply_get_addr(reply));
+
+ cleanup:
+  socks4_server_reply_free(reply);
+  return result;
 }
 
 /* It would be nice to let someone know what SOCKS5 issue a user may have */
@@ -418,6 +434,7 @@ do_resolve(const char *hostname,
   log_err(LD_NET, "Error reading SOCKS5 response.");
   goto err;
 }
+
 if (reply_buf[0] != 5) {
   log_err(LD_NET, "Bad SOCKS5 reply version.");
   goto err;



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


[tor-commits] [tor/master] tor-resolve: Rework SOCKS5 method negotiation client part with trunnel

2018-12-01 Thread nickm
commit 8b9d6581f6d00ff1c5739174e6f2ea47b7a393a7
Author: rl1987 
Date:   Wed Sep 12 13:12:51 2018 +0300

tor-resolve: Rework SOCKS5 method negotiation client part with trunnel
---
 src/tools/tor-resolve.c | 50 +
 1 file changed, 42 insertions(+), 8 deletions(-)

diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index 659d51179..7aa3871b6 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -383,23 +383,57 @@ do_resolve(const char *hostname,
   }
 
   if (version == 5) {
-char method_buf[2];
-if (write_all_to_socket(s, (const char *)"\x05\x01\x00", 3) != 3) {
+socks5_client_version_t *v = socks5_client_version_new();
+
+socks5_client_version_set_version(v, 5);
+socks5_client_version_set_n_methods(v, 1);
+socks5_client_version_setlen_methods(v, 1);
+socks5_client_version_set_methods(v, 0, 0x00);
+
+tor_assert(!socks5_client_version_check(v));
+ssize_t encoded_len = socks5_client_version_encoded_len(v);
+tor_assert(encoded_len > 0);
+
+uint8_t *buf = tor_malloc(encoded_len);
+encoded_len = socks5_client_version_encode(buf, encoded_len, v);
+tor_assert(encoded_len > 0);
+
+socks5_client_version_free(v);
+
+if (write_all_to_socket(s, (const char *)buf,
+encoded_len) != encoded_len) {
   log_err(LD_NET, "Error sending SOCKS5 method list.");
+  tor_free(buf);
+
   goto err;
 }
-if (read_all_from_socket(s, method_buf, 2) != 2) {
+
+tor_free(buf);
+
+uint8_t method_buf[2];
+
+if (read_all_from_socket(s, (char *)method_buf, 2) != 2) {
   log_err(LD_NET, "Error reading SOCKS5 methods.");
   goto err;
 }
-if (method_buf[0] != '\x05') {
-  log_err(LD_NET, "Unrecognized socks version: %u",
-  (unsigned)method_buf[0]);
+
+socks5_server_method_t *m;
+ssize_t parsed = socks5_server_method_parse(, method_buf,
+sizeof(method_buf));
+
+if (parsed < 2) {
+  log_err(LD_NET, "Failed to parse SOCKS5 method selection "
+  "message");
   goto err;
 }
-if (method_buf[1] != '\x00') {
+
+uint8_t method = socks5_server_method_get_method(m);
+
+socks5_server_method_free(m);
+
+if (method != 0x00) {
   log_err(LD_NET, "Unrecognized socks authentication method: %u",
-  (unsigned)method_buf[1]);
+  (unsigned)method);
   goto err;
 }
   }



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


[tor-commits] [tor/master] Allow socks4_server_reply version to be 0 (for tor-resolve)

2018-12-01 Thread nickm
commit d49baa77b5586ecb473a822deb60dbe70c6769c8
Author: rl1987 
Date:   Wed Sep 12 11:18:43 2018 +0300

Allow socks4_server_reply version to be 0 (for tor-resolve)
---
 src/trunnel/socks5.c   | 13 ++---
 src/trunnel/socks5.trunnel |  2 +-
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/trunnel/socks5.c b/src/trunnel/socks5.c
index 9e5f6fcfe..057a52b04 100644
--- a/src/trunnel/socks5.c
+++ b/src/trunnel/socks5.c
@@ -1694,7 +1694,6 @@ socks4_server_reply_new(void)
   socks4_server_reply_t *val = trunnel_calloc(1, 
sizeof(socks4_server_reply_t));
   if (NULL == val)
 return NULL;
-  val->version = 4;
   return val;
 }
 
@@ -1724,7 +1723,7 @@ socks4_server_reply_get_version(const 
socks4_server_reply_t *inp)
 int
 socks4_server_reply_set_version(socks4_server_reply_t *inp, uint8_t val)
 {
-  if (! ((val == 4))) {
+  if (! ((val == 0 || val == 4))) {
  TRUNNEL_SET_ERROR_CODE(inp);
  return -1;
   }
@@ -1771,7 +1770,7 @@ socks4_server_reply_check(const socks4_server_reply_t 
*obj)
 return "Object was NULL";
   if (obj->trunnel_error_code_)
 return "A set function failed on this object";
-  if (! (obj->version == 4))
+  if (! (obj->version == 0 || obj->version == 4))
 return "Integer out of bounds";
   return NULL;
 }
@@ -1785,7 +1784,7 @@ socks4_server_reply_encoded_len(const 
socks4_server_reply_t *obj)
  return -1;
 
 
-  /* Length of u8 version IN [4] */
+  /* Length of u8 version IN [0, 4] */
   result += 1;
 
   /* Length of u8 status */
@@ -1823,7 +1822,7 @@ socks4_server_reply_encode(uint8_t *output, const size_t 
avail, const socks4_ser
   trunnel_assert(encoded_len >= 0);
 #endif
 
-  /* Encode u8 version IN [4] */
+  /* Encode u8 version IN [0, 4] */
   trunnel_assert(written <= avail);
   if (avail - written < 1)
 goto truncated;
@@ -1886,11 +1885,11 @@ socks4_server_reply_parse_into(socks4_server_reply_t 
*obj, const uint8_t *input,
   ssize_t result = 0;
   (void)result;
 
-  /* Parse u8 version IN [4] */
+  /* Parse u8 version IN [0, 4] */
   CHECK_REMAINING(1, truncated);
   obj->version = (trunnel_get_uint8(ptr));
   remaining -= 1; ptr += 1;
-  if (! (obj->version == 4))
+  if (! (obj->version == 0 || obj->version == 4))
 goto fail;
 
   /* Parse u8 status */
diff --git a/src/trunnel/socks5.trunnel b/src/trunnel/socks5.trunnel
index b86ec03b9..17fa2ed99 100644
--- a/src/trunnel/socks5.trunnel
+++ b/src/trunnel/socks5.trunnel
@@ -86,7 +86,7 @@ struct socks4_client_request {
 }
 
 struct socks4_server_reply {
-   u8 version IN [4];
+   u8 version IN [0,4];
u8 status;
u16 port;
u32 addr;



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


[tor-commits] [tor/master] tor-resolve: link tor-resolve binary with trunnel lib

2018-12-01 Thread nickm
commit 30582b940e22897e68c50d4d0c9c36f82472e9b2
Author: rl1987 
Date:   Tue Sep 11 19:39:00 2018 +0300

tor-resolve: link tor-resolve binary with trunnel lib
---
 src/tools/include.am | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/tools/include.am b/src/tools/include.am
index f7aa7e0d1..352d4b532 100644
--- a/src/tools/include.am
+++ b/src/tools/include.am
@@ -5,9 +5,11 @@ noinst_PROGRAMS+= src/tools/tor-cov-resolve
 endif
 
 src_tools_tor_resolve_SOURCES = src/tools/tor-resolve.c
-src_tools_tor_resolve_LDFLAGS =
+src_tools_tor_resolve_LDFLAGS = @TOR_LDFLAGS_openssl@
 src_tools_tor_resolve_LDADD = \
+   src/trunnel/libor-trunnel.a \
$(TOR_UTIL_LIBS) \
+$(TOR_CRYPTO_LIBS) $(TOR_LIBS_CRYPTLIB)\
$(rust_ldadd) \
@TOR_LIB_MATH@ @TOR_LIB_WS32@ @TOR_LIB_IPHLPAPI@ @TOR_LIB_USERENV@
 



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


[tor-commits] [tor/master] Add new option ClientAutoIPv6ORPort to switch between IPv4 and IPv6 OR ports

2018-12-01 Thread nickm
commit 822cb93cab59e9735e2efda70bc88c47cc92c498
Author: Neel Chauhan 
Date:   Wed Sep 26 19:14:33 2018 -0400

Add new option ClientAutoIPv6ORPort to switch between IPv4 and IPv6 OR ports
---
 changes/ticket27490|  6 ++
 doc/tor.1.txt  |  6 ++
 src/app/config/config.c|  1 +
 src/app/config/or_options_st.h |  3 +++
 src/core/mainloop/connection.c |  5 +
 src/core/or/policies.c | 15 ++-
 src/feature/client/bridges.c   |  3 ++-
 7 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/changes/ticket27490 b/changes/ticket27490
new file mode 100644
index 0..523477dfe
--- /dev/null
+++ b/changes/ticket27490
@@ -0,0 +1,6 @@
+  o Minor features (ipv6):
+- We add an option ClientAutoIPv6ORPort which makes clients randomly
+  prefer a node's IPv4 or IPv6 ORPort. The random preference is set
+  every time a node is loaded from a new consensus or bridge config.
+  Closes ticket 27490. Patch by Neel Chauhan.
+
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 406372433..bd4dbbcbd 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -1748,6 +1748,12 @@ The following options are useful only for clients (that 
is, if
 other clients prefer IPv4. Other things may influence the choice. This
 option breaks a tie to the favor of IPv6. (Default: auto)
 
+[[ClientAutoIPv6ORPort]] **ClientAutoIPv6ORPort** **0**|**1**::
+If this option is set to 1, Tor clients randomly prefer a node's IPv4 or
+IPv6 ORPort. The random preference is set every time a node is loaded
+from a new consensus or bridge config. When this option is set to 1,
+**ClientPreferIPv6ORPort** is ignored. (Default: 0)
+
 [[PathsNeededToBuildCircuits]] **PathsNeededToBuildCircuits** __NUM__::
 Tor clients don't build circuits for user traffic until they know
 about enough of the network so that they could potentially construct
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 01b48e3c5..6a510c56d 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -332,6 +332,7 @@ static config_var_t option_vars_[] = {
   V(ClientOnly,  BOOL, "0"),
   V(ClientPreferIPv6ORPort,  AUTOBOOL, "auto"),
   V(ClientPreferIPv6DirPort, AUTOBOOL, "auto"),
+  V(ClientAutoIPv6ORPort,BOOL, "0"),
   V(ClientRejectInternalAddresses, BOOL,   "1"),
   V(ClientTransportPlugin,   LINELIST, NULL),
   V(ClientUseIPv6,   BOOL, "0"),
diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h
index 3524b99b5..ff3d30d7e 100644
--- a/src/app/config/or_options_st.h
+++ b/src/app/config/or_options_st.h
@@ -666,6 +666,9 @@ struct or_options_t {
* accessing this value directly.  */
   int ClientPreferIPv6DirPort;
 
+  /** If true, prefer an IPv4 or IPv6 OR port at random. */
+  int ClientAutoIPv6ORPort;
+
   /** The length of time that we think a consensus should be fresh. */
   int V3AuthVotingInterval;
   /** The length of time we think it will take to distribute votes. */
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 4231bec01..9f8169082 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -2069,6 +2069,11 @@ connection_connect_log_client_use_ip_version(const 
connection_t *conn)
 return;
   }
 
+  if (fascist_firewall_use_ipv6(options)) {
+log_info(LD_NET, "Our outgoing connection is using IPv%d.",
+ tor_addr_family(_addr) == AF_INET6 ? 6 : 4);
+  }
+
   /* Check if we couldn't satisfy an address family preference */
   if ((!pref_ipv6 && tor_addr_family(_addr) == AF_INET6)
   || (pref_ipv6 && tor_addr_family(_addr) == AF_INET)) {
diff --git a/src/core/or/policies.c b/src/core/or/policies.c
index 3443a1710..e51a49cf6 100644
--- a/src/core/or/policies.c
+++ b/src/core/or/policies.c
@@ -28,6 +28,7 @@
 #include "feature/nodelist/routerparse.h"
 #include "feature/stats/geoip.h"
 #include "ht.h"
+#include "lib/crypt_ops/crypto_rand.h"
 #include "lib/encoding/confline.h"
 
 #include "core/or/addr_policy_st.h"
@@ -487,6 +488,15 @@ fascist_firewall_prefer_ipv6_impl(const or_options_t 
*options)
   return -1;
 }
 
+/* Choose whether we prefer IPv4 or IPv6 by randomly choosing an address
+ * family. Return 0 for IPv4, and 1 for IPv6. */
+static int
+fascist_firewall_rand_prefer_ipv6_addr(void)
+{
+  /* TODO: Check for failures, and infer our preference based on this. */
+  return crypto_rand_int(2);
+}
+
 /** Do we prefer to connect to IPv6 ORPorts?
  * Use node_ipv6_or_preferred() whenever possible: it supports bridge client
  * per-node IPv6 preferences.
@@ -501,7 +511,10 @@ fascist_firewall_prefer_ipv6_orport(const or_options_t 
*options)
   }
 
   /* We can use both IPv4 and IPv6 - which do we prefer? */
-  if (options->ClientPreferIPv6ORPort == 1) {
+  if (options->ClientAutoIPv6ORPort == 1) {
+/* If ClientAutoIPv6ORPort is 1, we prefer IPv4 or IPv6 at random. */
+return 

[tor-commits] [tor/master] Add regression test for ClientAutoIPv6ORPort

2018-12-01 Thread nickm
commit ad031b64ce355ac3af15adb716a4322858dce4a8
Author: Neel Chauhan 
Date:   Tue Oct 16 20:14:27 2018 -0400

Add regression test for ClientAutoIPv6ORPort
---
 src/core/or/policies.c |  4 ++--
 src/core/or/policies.h |  1 +
 src/test/test_policy.c | 50 ++
 3 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/src/core/or/policies.c b/src/core/or/policies.c
index 6da369bf3..c630c2fbd 100644
--- a/src/core/or/policies.c
+++ b/src/core/or/policies.c
@@ -491,8 +491,8 @@ fascist_firewall_prefer_ipv6_impl(const or_options_t 
*options)
 
 /* Choose whether we prefer IPv4 or IPv6 by randomly choosing an address
  * family. Return 0 for IPv4, and 1 for IPv6. */
-static int
-fascist_firewall_rand_prefer_ipv6_addr(void)
+MOCK_IMPL(int,
+fascist_firewall_rand_prefer_ipv6_addr, (void))
 {
   /* TODO: Check for failures, and infer our preference based on this. */
   return crypto_rand_int(2);
diff --git a/src/core/or/policies.h b/src/core/or/policies.h
index 7da3ba031..0c64ecf37 100644
--- a/src/core/or/policies.h
+++ b/src/core/or/policies.h
@@ -70,6 +70,7 @@ typedef struct short_policy_t {
 int firewall_is_fascist_or(void);
 int firewall_is_fascist_dir(void);
 int fascist_firewall_use_ipv6(const or_options_t *options);
+MOCK_DECL(int, fascist_firewall_rand_prefer_ipv6_addr, (void));
 int fascist_firewall_prefer_ipv6_orport(const or_options_t *options);
 int fascist_firewall_prefer_ipv6_dirport(const or_options_t *options);
 
diff --git a/src/test/test_policy.c b/src/test/test_policy.c
index 6a07e5b1f..cc9023d6a 100644
--- a/src/test/test_policy.c
+++ b/src/test/test_policy.c
@@ -2023,6 +2023,20 @@ test_policies_fascist_firewall_allows_address(void *arg)
expect_ap); \
   STMT_END
 
+/** Mock the preferred address function to return zero (prefer IPv4). */
+static int
+mock_fascist_firewall_rand_prefer_ipv6_addr_use_ipv4(void)
+{
+  return 0;
+}
+
+/** Mock the preferred address function to return one (prefer IPv6). */
+static int
+mock_fascist_firewall_rand_prefer_ipv6_addr_use_ipv6(void)
+{
+  return 1;
+}
+
 /** Run unit tests for fascist_firewall_choose_address */
 static void
 test_policies_fascist_firewall_choose_address(void *arg)
@@ -2421,6 +2435,42 @@ test_policies_fascist_firewall_choose_address(void *arg)
   CHECK_CHOSEN_ADDR_RN(fake_rs, fake_node, FIREWALL_DIR_CONNECTION, 1, 1,
ipv4_dir_ap);
 
+  /* Test ClientAutoIPv6ORPort and pretend we prefer IPv4. */
+  memset(_options, 0, sizeof(or_options_t));
+  mock_options.ClientAutoIPv6ORPort = 1;
+  mock_options.ClientUseIPv4 = 1;
+  mock_options.ClientUseIPv6 = 1;
+  MOCK(fascist_firewall_rand_prefer_ipv6_addr,
+   mock_fascist_firewall_rand_prefer_ipv6_addr_use_ipv4);
+  /* Simulate the initialisation of fake_node.ipv6_preferred */
+  fake_node.ipv6_preferred = fascist_firewall_prefer_ipv6_orport(
+_options);
+
+  CHECK_CHOSEN_ADDR_RN(fake_rs, fake_node, FIREWALL_OR_CONNECTION, 0, 1,
+   ipv4_or_ap);
+  CHECK_CHOSEN_ADDR_RN(fake_rs, fake_node, FIREWALL_OR_CONNECTION, 1, 1,
+   ipv4_or_ap);
+
+  UNMOCK(fascist_firewall_rand_prefer_ipv6_addr);
+
+  /* Test ClientAutoIPv6ORPort and pretend we prefer IPv6. */
+  memset(_options, 0, sizeof(or_options_t));
+  mock_options.ClientAutoIPv6ORPort = 1;
+  mock_options.ClientUseIPv4 = 1;
+  mock_options.ClientUseIPv6 = 1;
+  MOCK(fascist_firewall_rand_prefer_ipv6_addr,
+   mock_fascist_firewall_rand_prefer_ipv6_addr_use_ipv6);
+  /* Simulate the initialisation of fake_node.ipv6_preferred */
+  fake_node.ipv6_preferred = fascist_firewall_prefer_ipv6_orport(
+_options);
+
+  CHECK_CHOSEN_ADDR_RN(fake_rs, fake_node, FIREWALL_OR_CONNECTION, 0, 1,
+   ipv6_or_ap);
+  CHECK_CHOSEN_ADDR_RN(fake_rs, fake_node, FIREWALL_OR_CONNECTION, 1, 1,
+   ipv6_or_ap);
+
+  UNMOCK(fascist_firewall_rand_prefer_ipv6_addr);
+
  done:
   UNMOCK(get_options);
 }



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


[tor-commits] [tor/master] In fascist_firewall_use_ipv6(), say we can use IPv6 if ClientAutoIPv6ORPort is 1

2018-12-01 Thread nickm
commit 81f2828d67f0853c028617511f3846c02f0d6628
Author: Neel Chauhan 
Date:   Wed Sep 26 19:19:11 2018 -0400

In fascist_firewall_use_ipv6(), say we can use IPv6 if ClientAutoIPv6ORPort 
is 1
---
 src/core/or/policies.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/or/policies.c b/src/core/or/policies.c
index e51a49cf6..6da369bf3 100644
--- a/src/core/or/policies.c
+++ b/src/core/or/policies.c
@@ -461,7 +461,8 @@ fascist_firewall_use_ipv6(const or_options_t *options)
* ClientPreferIPv6DirPort is deprecated, but check it anyway. */
   return (options->ClientUseIPv6 == 1 || options->ClientUseIPv4 == 0 ||
   options->ClientPreferIPv6ORPort == 1 ||
-  options->ClientPreferIPv6DirPort == 1 || options->UseBridges == 1);
+  options->ClientPreferIPv6DirPort == 1 || options->UseBridges == 1 ||
+  options->ClientAutoIPv6ORPort == 1);
 }
 
 /** Do we prefer to connect to IPv6, ignoring ClientPreferIPv6ORPort and



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

2018-12-01 Thread nickm
commit 2b2b97484ad07c91ac410735a96fe8710e60cf23
Merge: 701eaef98 ad031b64c
Author: Nick Mathewson 
Date:   Sat Dec 1 20:32:18 2018 -0500

Merge branch 'ticket27490a_squashed'

 changes/ticket27490|  6 +
 doc/tor.1.txt  |  6 +
 src/app/config/config.c|  1 +
 src/app/config/or_options_st.h |  3 +++
 src/core/mainloop/connection.c |  5 +
 src/core/or/policies.c | 18 +--
 src/core/or/policies.h |  1 +
 src/feature/client/bridges.c   |  3 ++-
 src/test/test_policy.c | 50 ++
 9 files changed, 90 insertions(+), 3 deletions(-)

diff --cc src/core/or/policies.c
index 0eda93c5f,c630c2fbd..123fc8566
--- a/src/core/or/policies.c
+++ b/src/core/or/policies.c
@@@ -25,10 -23,12 +25,11 @@@
  #include "feature/nodelist/microdesc.h"
  #include "feature/nodelist/networkstatus.h"
  #include "feature/nodelist/nodelist.h"
 -#include "core/or/policies.h"
  #include "feature/relay/router.h"
 -#include "feature/nodelist/routerparse.h"
 -#include "feature/stats/geoip.h"
 +#include "feature/relay/routermode.h"
 +#include "lib/geoip/geoip.h"
  #include "ht.h"
+ #include "lib/crypt_ops/crypto_rand.h"
  #include "lib/encoding/confline.h"
  
  #include "core/or/addr_policy_st.h"

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


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

2018-12-01 Thread translation
commit 46a30f83e78f76d97efa311905eb325319072d27
Author: Translation commit bot 
Date:   Sat Dec 1 20:17:52 2018 +

Update translations for tor-browser-manual
---
 cs/cs.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cs/cs.po b/cs/cs.po
index efeaaf32d..7d3148c6f 100644
--- a/cs/cs.po
+++ b/cs/cs.po
@@ -5,7 +5,7 @@
 # Adam Slovacek , 2016
 # Jiří Vírava , 2017
 # Michal Vašíček , 2017
-# J. Podhorecky , 2018
+# trendspotter , 2018
 # Mikuláš Vrba , 2018
 # Michal Stanke , 2018
 # 

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


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

2018-12-01 Thread translation
commit 4aa28a35ac1b448e7ea52dbca15f27823d1a7222
Author: Translation commit bot 
Date:   Sat Dec 1 20:17:09 2018 +

Update translations for tba-torbrowserstringsdtd_completed
---
 cs/android_strings.dtd | 25 +
 1 file changed, 25 insertions(+)

diff --git a/cs/android_strings.dtd b/cs/android_strings.dtd
new file mode 100644
index 0..b296d4224
--- /dev/null
+++ b/cs/android_strings.dtd
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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


[tor-commits] [translation/tbmanual-contentspot] Update translations for tbmanual-contentspot

2018-12-01 Thread translation
commit b6ea5956d2860e256c42ac32fb242c3fc82e8fa5
Author: Translation commit bot 
Date:   Sat Dec 1 20:17:15 2018 +

Update translations for tbmanual-contentspot
---
 contents+cs.po | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/contents+cs.po b/contents+cs.po
index 1e311a87c..2d21c1ae5 100644
--- a/contents+cs.po
+++ b/contents+cs.po
@@ -445,7 +445,7 @@ msgstr ""
 msgid ""
 "Once you have obtained some bridge addresses, you will need to enter them "
 "into Tor Launcher."
-msgstr "Jakmile jste získali adresy mostů, musíte je zadat do Tor 
Launcheru."
+msgstr "Jakmile získáte adresy mostů, musíte je zadat do spuštěče Toru."
 
 #: https//tb-manual.torproject.org/en-US/bridges/
 #: (content/bridges/contents+en-US.lrtopic.body)
@@ -1141,7 +1141,7 @@ msgstr ""
 #: https//tb-manual.torproject.org/en-US/secure-connections/
 #: (content/secure-connections/contents+en-US.lrtopic.body)
 msgid "Site.com"
-msgstr "Site.com"
+msgstr "Example.com"
 
 #: https//tb-manual.torproject.org/en-US/secure-connections/
 #: (content/secure-connections/contents+en-US.lrtopic.body)
@@ -1212,7 +1212,7 @@ msgstr ""
 #: https//tb-manual.torproject.org/en-US/secure-connections/
 #: (content/secure-connections/contents+en-US.lrtopic.body)
 msgid "Tor"
-msgstr "TOr"
+msgstr "Tor"
 
 #: https//tb-manual.torproject.org/en-US/secure-connections/
 #: (content/secure-connections/contents+en-US.lrtopic.body)
@@ -1323,12 +1323,12 @@ msgid ""
 "disabled by default on all sites; most video and audio formats are disabled;"
 " and some fonts and icons may not display correctly."
 msgstr ""
-"Na této úrovni se multimediální a zvukové média HTML5 stávají 
\"click-to-"
-"play\" přes NoScript; všechny optimalizace výkonu JavaScript jsou 
zakázány; "
-"některé matematické rovnice se nemusí zobrazovat správně; některé 
funkce "
-"vykreslování písma jsou zakázány; některé typy obrázků jsou 
zakázány; "
-"Javascript je ve výchozím nastavení zakázán na všech stránkách; 
většina "
-"video a audio formátů je vypnuto; a některé písma a ikony se nemusí 
zobrazit"
+"Na této úrovni se video a zvuky v HTML5 spouštějí až po klepnutí díky 
"
+"NoScriptu. Všechny optimalizace výkonu JavaScriptu jsou zakázány a 
některé "
+"matematické rovnice se nemusí zobrazovat správně. Některé funkce "
+"vykreslování písma jsou zakázány, stejně jako některé typy obrázků. 
"
+"Javascript je ve výchozím nastavení zakázán na všech stránkách a 
většina "
+"video a audio formátů je vypnuta. A některá písma a ikony se nemusí 
zobrazit"
 " správně."
 
 #: https//tb-manual.torproject.org/en-US/security-slider/
@@ -1402,7 +1402,7 @@ msgid ""
 "been released: the Torbutton icon will display a yellow triangle, and you "
 "may see a written update indicator when Tor Browser opens. You can update "
 "either automatically or manually."
-msgstr "prohlížeč"
+msgstr ""
 
 #: https//tb-manual.torproject.org/en-US/updating/
 #: (content/updating/contents+en-US.lrtopic.body)

___
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-01 Thread translation
commit 51a73f7817248cb3c9763cd75da9aab46a635b9f
Author: Translation commit bot 
Date:   Sat Dec 1 20:17:23 2018 +

Update translations for tor-and-https
---
 cs.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cs.po b/cs.po
index 6ef7e0c38..21e6040bd 100644
--- a/cs.po
+++ b/cs.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2018-10-26 11:54+\n"
+"PO-Revision-Date: 2018-12-01 19:55+\n"
 "Last-Translator: Michal Stanke \n"
 "Language-Team: Czech (http://www.transifex.com/otf/torproject/language/cs/)\n"
 "MIME-Version: 1.0\n"

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


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

2018-12-01 Thread translation
commit e6ff9ed11912f0cddbc196ace1a56a09a18bd776
Author: Translation commit bot 
Date:   Sat Dec 1 20:17:04 2018 +

Update translations for tba-torbrowserstringsdtd
---
 cs/android_strings.dtd | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/cs/android_strings.dtd b/cs/android_strings.dtd
index 984e6f736..b296d4224 100644
--- a/cs/android_strings.dtd
+++ b/cs/android_strings.dtd
@@ -17,9 +17,9 @@
 
 
 
-
+
 
-
-
-
-
+
+
+
+

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


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

2018-12-01 Thread translation
commit 7097920ebd2ef89fac84c60622a1f056b13ec858
Author: Translation commit bot 
Date:   Sat Dec 1 20:16:05 2018 +

Update translations for tails-misc
---
 cs.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cs.po b/cs.po
index e68429124..8e21bb066 100644
--- a/cs.po
+++ b/cs.po
@@ -18,8 +18,8 @@ msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-12-01 11:05+0100\n"
-"PO-Revision-Date: 2018-12-01 14:39+\n"
-"Last-Translator: carolyn \n"
+"PO-Revision-Date: 2018-12-01 19:55+\n"
+"Last-Translator: Michal Stanke \n"
 "Language-Team: Czech (http://www.transifex.com/otf/torproject/language/cs/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"

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


[tor-commits] [translation/tbmanual-contentspot] Update translations for tbmanual-contentspot

2018-12-01 Thread translation
commit d17f9a9d4978cb9bde3c512e5003906faf165bc6
Author: Translation commit bot 
Date:   Sat Dec 1 19:47:12 2018 +

Update translations for tbmanual-contentspot
---
 contents+zh-CN.po | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/contents+zh-CN.po b/contents+zh-CN.po
index a8d028a2a..316be6af1 100644
--- a/contents+zh-CN.po
+++ b/contents+zh-CN.po
@@ -1,6 +1,7 @@
 # Translators:
 # Emma Peel, 2018
 # erinm, 2018
+# Chris Xiao, 2018
 # 
 msgid ""
 msgstr ""
@@ -8,7 +9,7 @@ msgstr ""
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-11-30 09:02+CET\n"
 "PO-Revision-Date: 2018-11-14 12:31+\n"
-"Last-Translator: erinm, 2018\n"
+"Last-Translator: Chris Xiao, 2018\n"
 "Language-Team: Chinese (China) 
(https://www.transifex.com/otf/teams/1519/zh_CN/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -1974,6 +1975,8 @@ msgid ""
 " back to the https://www.transifex.com/otf/torproject/\;>Tor "
 "Transifex page when you are ready to begin."
 msgstr ""
+"当您的成员资æ 
¼è¢«æ‰¹å‡†ä¹‹åŽï¼Œæ‚¨å°±å¯ä»¥å¼€å§‹ç¿»è¯‘工作了。当您准备好开始的时候,请返回到https://www.transifex.com/otf/torproject/\;>Tor Transifex 
page页面。"
 
 #: https//tb-manual.torproject.org/en-US/becoming-tor-translator/
 #: (content/becoming-tor-translator/contents+en-US.lrtopic.body)
@@ -1983,16 +1986,18 @@ msgid ""
 "There you will find translation guidelines and resources that will help you "
 "contribute to Tor translations."
 msgstr ""
+"开始翻译之前,请通读[Localization Lab "
+"Wiki](https://wiki.localizationlab.org/index.php/Tor)上的Tor项目页面。在那里,您可以找到翻译准则和能够帮助您翻译Tor的资源"
 
 #: https//tb-manual.torproject.org/en-US/becoming-tor-translator/
 #: (content/becoming-tor-translator/contents+en-US.lrtopic.body)
 msgid "Thanks for your interest in helping the project!"
-msgstr ""
+msgstr "感谢您有兴趣对这个项目做出贡献!"
 
 #: https//tb-manual.torproject.org/en-US/becoming-tor-translator/
 #: (content/becoming-tor-translator/contents+en-US.lrtopic.seo_slug)
 msgid "becoming-tor-translator"
-msgstr ""
+msgstr "成为 Tor 翻译者"
 
 #: templates/footer.html:5
 msgid "Our mission:"

___
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-01 Thread translation
commit fc73166b8b58fc96e98bdfe734d52e0ed1793638
Author: Translation commit bot 
Date:   Sat Dec 1 19:47:01 2018 +

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

diff --git a/cs/android_strings.dtd b/cs/android_strings.dtd
index 47d5041aa..984e6f736 100644
--- a/cs/android_strings.dtd
+++ b/cs/android_strings.dtd
@@ -1,22 +1,22 @@
 
 
-
-
-
+
+
+
 
 
 
 
 
 
-
+
 
 
 
-
+
 
 
-
+
 
 
 

___
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-01 Thread translation
commit 443759789174484826dd63772f4ab59b30c40a3d
Author: Translation commit bot 
Date:   Sat Dec 1 19:45:25 2018 +

Update translations for donatepages-messagespot
---
 locale/ka/LC_MESSAGES/messages.po|  5 +
 locale/zh_CN/LC_MESSAGES/messages.po | 17 +
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/locale/ka/LC_MESSAGES/messages.po 
b/locale/ka/LC_MESSAGES/messages.po
index 880514841..97e6426af 100644
--- a/locale/ka/LC_MESSAGES/messages.po
+++ b/locale/ka/LC_MESSAGES/messages.po
@@ -547,6 +547,9 @@ msgid ""
 "Stand up for the universal human rights to privacy and freedom and help keep"
 " Tor independent, robust, and secure."
 msgstr ""
+"მხარში დაუდექით ადამიანის 
საყოველთაო უფლებების დაცვას 
პირადი ცხოვრების "
+"ხელშეუხებლობის კუთხით და 
დაგვეხმარეთ რომ შევინარ
ჩუნოთ Tor დამოუკიდებელი, "
+"ძლიერი და  დაცული."
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:627
 msgid "Mozilla will match your gift and double your impact."
@@ -581,6 +584,8 @@ msgid ""
 "It's an incredible time to stand up for world-leading security and privacy "
 "software."
 msgstr ""
+"საუკეთესო დროა მხარში 
ამოუდგეთ მსოფლიოში წამყვან 
პროგრამას, უსაფრთხოებისა და"
+" პირადი მონაცემების დაცვის 
კუთხით."
 
 #: 
tmp/cache_locale/af/afda2fbd22ed389453e63ca9acc074a25ce820b5bc97120edfd975cf8f46634a.php:58
 msgid ""
diff --git a/locale/zh_CN/LC_MESSAGES/messages.po 
b/locale/zh_CN/LC_MESSAGES/messages.po
index 95b6ff59a..f44fc8075 100644
--- a/locale/zh_CN/LC_MESSAGES/messages.po
+++ b/locale/zh_CN/LC_MESSAGES/messages.po
@@ -308,7 +308,7 @@ msgstr "T恤"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:253
 msgid "Get our limited edition Tor: Strength in Numbers shirt."
-msgstr ""
+msgstr "获得我们的限量版“Tor:众人拾柴火焰高”T恤衫"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:264
 msgid "t-shirt pack"
@@ -320,14 +320,15 @@ msgid ""
 "the Digital Resistance, Open Observatory of Network Interference (OONI), or "
 "Tor at the Heart of Internet Freedom t-shirts."
 msgstr ""
+"我们的“Tor:众人抬柴火焰高”T恤,加上“Tor:壮大数ç 
æŠµæŠ—”T恤, “网络干预开放观测站(OONI)” 
T恤,或”Tor在互联网自由的核心“T恤。"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:280
 msgid "Tor at the Heart of Internet Freedom"
-msgstr ""
+msgstr "Tor在互联网自由的核心"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:284
 msgid "Powering the Digital Resistance"
-msgstr ""
+msgstr "壮大数码抵抗"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:288
 msgid "Open Observatory of Network Interference"
@@ -339,7 +340,7 @@ msgstr "卫衣"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:306
 msgid "Your generous support of Tor gets you this high-quality zip hoodie."
-msgstr ""
+msgstr "您对 Tor 的强力支持可以得到这件高质量拉链卫衣。"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:316
 msgid "how do you want to DONATE?"
@@ -445,11 +446,11 @@ msgstr "请为每一件T恤选择适合你的尺ç 
å’Œèº«åž‹ã€‚"
 msgid ""
 "Tor at the Heart of Internet, Powering Digital Resistance or Open "
 "Observvatory of Network Interference (OONI) T-Shirt"
-msgstr ""
+msgstr "“Tor在互联网自由的核心”, “壮大数ç 
æŠµæŠ—”,或“网络干预开放观测站(OONI)” T恤"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:488
 msgid "Strength in Numbers T-Shirt"
-msgstr ""
+msgstr "\"众人拾柴火焰高\"T恤衫"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:492
 msgid "Choose your size."
@@ -513,11 +514,11 @@ msgstr "感谢您!"
 
 #: 
tmp/cache_locale/af/afda2fbd22ed389453e63ca9acc074a25ce820b5bc97120edfd975cf8f46634a.php:48
 msgid "Thank you for supporting Tor's Strength in Numbers campaign."
-msgstr ""
+msgstr "感谢您支持Tor的“众人拾柴火焰高”活动"
 
 #: 
tmp/cache_locale/af/afda2fbd22ed389453e63ca9acc074a25ce820b5bc97120edfd975cf8f46634a.php:50
 msgid "You should receive an email receipt shortly."
-msgstr ""
+msgstr 

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

2018-12-01 Thread translation
commit 74d27c2481c9dce5c2068ad78d0141d24943cc6c
Author: Translation commit bot 
Date:   Sat Dec 1 19:15:20 2018 +

Update translations for donatepages-messagespot
---
 locale/ka/LC_MESSAGES/messages.po| 26 +++---
 locale/zh_CN/LC_MESSAGES/messages.po | 11 ++-
 2 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/locale/ka/LC_MESSAGES/messages.po 
b/locale/ka/LC_MESSAGES/messages.po
index 956f82c37..880514841 100644
--- a/locale/ka/LC_MESSAGES/messages.po
+++ b/locale/ka/LC_MESSAGES/messages.po
@@ -116,12 +116,19 @@ 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/fa/fadd8d2107638a3de94449a9eddfca4e8f010bb26f3f6a71e2d875cb910cc5f1.php:89
 msgid ""
 "But, that information is redacted from the publicly-available version of our"
 " Form 990."
 msgstr ""
+"თუმცა, ეს ინფორმაცია წარ
მოადგენს შეცვლილ ვარიანტს 
ჩვენი ფორმა 900-ის საჯაროდ"
+" ხელმისაწვდომი ვერსიის."
 
 #: 
tmp/cache_locale/fa/fadd8d2107638a3de94449a9eddfca4e8f010bb26f3f6a71e2d875cb910cc5f1.php:91
 msgid ""
@@ -177,23 +184,23 @@ msgstr ""
 
 #: 
tmp/cache_locale/ce/ce708c1cd991748e8c1c29f932e6ddbd1be5be1b4cc2c5b49b607cae1df80432.php:36
 msgid "Fit"
-msgstr ""
+msgstr "შეკერვის სახე"
 
 #: 
tmp/cache_locale/ce/ce708c1cd991748e8c1c29f932e6ddbd1be5be1b4cc2c5b49b607cae1df80432.php:40
 msgid "Select Fit"
-msgstr ""
+msgstr "მიუთითეთ შეკერვის სახე"
 
 #: 
tmp/cache_locale/ce/ce708c1cd991748e8c1c29f932e6ddbd1be5be1b4cc2c5b49b607cae1df80432.php:44
 msgid "Slim"
-msgstr ""
+msgstr "ტანზე მომდგარი"
 
 #: 
tmp/cache_locale/ce/ce708c1cd991748e8c1c29f932e6ddbd1be5be1b4cc2c5b49b607cae1df80432.php:48
 msgid "Classic"
-msgstr ""
+msgstr "კლასიკური"
 
 #: 
tmp/cache_locale/ce/ce708c1cd991748e8c1c29f932e6ddbd1be5be1b4cc2c5b49b607cae1df80432.php:56
 msgid "European"
-msgstr ""
+msgstr "ევროპული"
 
 #: 
tmp/cache_locale/ce/ce708c1cd991748e8c1c29f932e6ddbd1be5be1b4cc2c5b49b607cae1df80432.php:66
 msgid "Size"
@@ -344,7 +351,7 @@ msgstr "მაისური"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:253
 msgid "Get our limited edition Tor: Strength in Numbers shirt."
-msgstr "მიიღეთ Tor-ის შეზღუდული 
გამოშვება: სიძლიერე ციფრ
ებშია მაისური."
+msgstr "მიიღეთ შეზღუდული 
გამოშვების Tor: სიძლიერე ციფრ
ებშია მაისური."
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:264
 msgid "t-shirt pack"
@@ -356,6 +363,9 @@ msgid ""
 "the Digital Resistance, Open Observatory of Network Interference (OONI), or "
 "Tor at the Heart of Internet Freedom t-shirts."
 msgstr ""
+"ჩვენი Tor: სიძლიერე ციფრებშია 
მაისური და კიდევ ერთ-ერთი რ
ომელიმე ჩვენი Tor: "
+"Powering the Digital Resistance, Open Observatory of Network Interference "
+"(OONI) ან Tor at the Heart of Internet Freedom მაისურ
ებიდან."
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:280
 msgid "Tor at the Heart of Internet Freedom"
@@ -453,7 +463,7 @@ msgstr "CVC"
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:427
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:472
 msgid "Choose your size and fit."
-msgstr ""
+msgstr "შეარჩიეთ თქვენი ზომა და 
შეკერვის სახე"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:432
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:440
@@ -483,6 +493,8 @@ msgid ""
 "Tor at the Heart of Internet, Powering Digital Resistance or Open "
 "Observvatory of Network Interference (OONI) T-Shirt"
 msgstr ""
+"Tor at the Heart of Internet, 

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

2018-12-01 Thread translation
commit 884ae8a4b4ce7591ecee286076eb24c92b5e1a26
Author: Translation commit bot 
Date:   Sat Dec 1 18:45:22 2018 +

Update translations for donatepages-messagespot
---
 locale/ka/LC_MESSAGES/messages.po | 32 +++-
 locale/pl/LC_MESSAGES/messages.po | 22 +++---
 2 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/locale/ka/LC_MESSAGES/messages.po 
b/locale/ka/LC_MESSAGES/messages.po
index 448c49ca4..956f82c37 100644
--- a/locale/ka/LC_MESSAGES/messages.po
+++ b/locale/ka/LC_MESSAGES/messages.po
@@ -42,12 +42,18 @@ msgid ""
 "be collected and retained by third-party service providers and/or the Tor "
 "Project, as described below."
 msgstr ""
+"თუ თქვენ პირად მონაცემებს 
მოგვაწვდით შემოწირულობის ფარ
გლებში, იგი შესაძლოა "
+"აღრიცხოს და შეინახოს 
მომსახურების მესამე მხარის 
მომწოდებლებმა და/ან Tor-"
+"პროექტმა, როგორც ქვემოთაა 
აღნიშნული."
 
 #: 
tmp/cache_locale/fa/fadd8d2107638a3de94449a9eddfca4e8f010bb26f3f6a71e2d875cb910cc5f1.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 ""
+"Tor-პროექტს ძალიან მცირე 
შეხება აქვს მომსახურების 
მესამე მხარის "
+"მომწოდებლებმთან, როგორიცაა 
თუნდაც PayPal, რომელიც შესაძლოა 
აღრიცხავდეს და "
+"იყენებდეს თქვენს 
მონაცემებს."
 
 #: 
tmp/cache_locale/fa/fadd8d2107638a3de94449a9eddfca4e8f010bb26f3f6a71e2d875cb910cc5f1.php:69
 msgid ""
@@ -55,6 +61,10 @@ msgid ""
 "links\" target=\"_blank\" href=\"https://www.paypal.com/webapps/mpp/ua;
 "/privacy-full\">policies, especially if you have privacy concerns."
 msgstr ""
+"შესაბამისად, ჩვენ გირჩევთ, რ
ომ კარგად გაეცნოთ მათ https://www.paypal.com/webapps/mpp/ua;
+"/privacy-full\">დებულებებს, 
განსაკუთრებით პირადი 
მონაცემების დაცვის "
+"საკითხებზე."
 
 #: 
tmp/cache_locale/fa/fadd8d2107638a3de94449a9eddfca4e8f010bb26f3f6a71e2d875cb910cc5f1.php:74
 msgid ""
@@ -72,23 +82,32 @@ msgid ""
 "We may also learn incidental data such as the date and time of your "
 "donation."
 msgstr ""
+"ჩვენ ასევე შეიძლება გარ
კვეული შემთხვევითი 
მონაცემებიც დავურთოთ, როგორ
იცაა "
+"შეტანის თარიღი."
 
 #: 
tmp/cache_locale/fa/fadd8d2107638a3de94449a9eddfca4e8f010bb26f3f6a71e2d875cb910cc5f1.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 ""
+"Tor-პროექტს არასდროს ექნება 
წვდომა თქვენს ფინანსურ ინფორ
მაციასთან, როგორიცაა"
+" თქვენი საკრედიტო ბარათის 
მონაცემები. ჩვენ სიფრთხილით 
ვეკიდებით თქვენს "
+"მონაცემებს."
 
 #: 
tmp/cache_locale/fa/fadd8d2107638a3de94449a9eddfca4e8f010bb26f3f6a71e2d875cb910cc5f1.php:83
 msgid ""
 "If you have provided your email address, we will email you once to thank you"
 " and give you a receipt."
 msgstr ""
+"თუ თქვენ მოგვაწვდით 
ელფოსტის მისამართს, ჩვენ 
მხოლოდ ერთხელ გამოგიგზავნით "
+"მადლობას და გადმოგცემთ 
ქვითარს."
 
 #: 
tmp/cache_locale/fa/fadd8d2107638a3de94449a9eddfca4e8f010bb26f3f6a71e2d875cb910cc5f1.php:85
 msgid ""
 "If you opt in during the donation process, we may email you again in future."
 msgstr ""
+"თუ გაწევრიანდებით შემოწირ
ულობის დროს, შესაძლოა კიდევ ერ
თხელ მოგწეროთ "
+"ელფოსტაზე მომავალში."
 
 #: 
tmp/cache_locale/fa/fadd8d2107638a3de94449a9eddfca4e8f010bb26f3f6a71e2d875cb910cc5f1.php:87
 msgid ""
@@ -108,16 +127,22 @@ msgstr ""
 msgid ""
 "We will never publicly identify you as a donor without 

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

2018-12-01 Thread translation
commit 631c2e3b1a10c8cb5a9fc3b7b251b14d11fc4d2b
Author: Translation commit bot 
Date:   Sat Dec 1 18:19:26 2018 +

Update translations for support-portal
---
 contents+ka.po | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contents+ka.po b/contents+ka.po
index 453f0992c..883f81e97 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -4614,15 +4614,15 @@ msgstr "გამოიწერეთ ჩვენი 
სიახლეებ
 msgid "Get monthly updates and opportunities from the Tor Project"
 msgstr ""
 "გაეცანით ყოველთვიურად Tor-პრ
ოექტთან დაკავშირებულ ახალ 
ამბებსა და ახალ "
-"შესაძლებლობებს."
+"შესაძლებლობებს"
 
 #: templates/footer.html:32
 msgid ""
 "Trademark, copyright notices, and rules for use by third parties can be "
 "found in our "
 msgstr ""
-"სავაჭრო ნიშნები, საავტორო 
უფლებების დაცვის 
განაცხადები და მესამე მხარის 
მიერ"
-" გამოსაყენებელი წესები, 
შეგიძლიათ იხილოთ "
+"სავაჭრო ნიშნების, საავტორო 
უფლებების დაცვის 
განაცხადებისა და მესამე მხარ
ის "
+"მიერ გამოსაყენებელი წესების 
თაობაზე, შეგიძლიათ იხილოთ 
ჩვენი"
 
 #: templates/layout.html:7
 msgid "Tor Project | Support"

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


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

2018-12-01 Thread translation
commit f4713f73179897251fa4c6e246eea4a20a9fac38
Author: Translation commit bot 
Date:   Sat Dec 1 18:19:32 2018 +

Update translations for support-portal_completed
---
 contents+ka.po | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contents+ka.po b/contents+ka.po
index 453f0992c..883f81e97 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -4614,15 +4614,15 @@ msgstr "გამოიწერეთ ჩვენი 
სიახლეებ
 msgid "Get monthly updates and opportunities from the Tor Project"
 msgstr ""
 "გაეცანით ყოველთვიურად Tor-პრ
ოექტთან დაკავშირებულ ახალ 
ამბებსა და ახალ "
-"შესაძლებლობებს."
+"შესაძლებლობებს"
 
 #: templates/footer.html:32
 msgid ""
 "Trademark, copyright notices, and rules for use by third parties can be "
 "found in our "
 msgstr ""
-"სავაჭრო ნიშნები, საავტორო 
უფლებების დაცვის 
განაცხადები და მესამე მხარის 
მიერ"
-" გამოსაყენებელი წესები, 
შეგიძლიათ იხილოთ "
+"სავაჭრო ნიშნების, საავტორო 
უფლებების დაცვის 
განაცხადებისა და მესამე მხარ
ის "
+"მიერ გამოსაყენებელი წესების 
თაობაზე, შეგიძლიათ იხილოთ 
ჩვენი"
 
 #: templates/layout.html:7
 msgid "Tor Project | Support"

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


[tor-commits] [translation/tbmanual-contentspot] Update translations for tbmanual-contentspot

2018-12-01 Thread translation
commit 1c1e4ed5bb189d03bb54a626f5907d1b547b1b58
Author: Translation commit bot 
Date:   Sat Dec 1 18:17:05 2018 +

Update translations for tbmanual-contentspot
---
 contents+ka.po | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/contents+ka.po b/contents+ka.po
index c70fa06af..0303257b6 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -480,7 +480,7 @@ msgid ""
 "Because bridge addresses are not public, you will need to request them "
 "yourself. You have two options:"
 msgstr ""
-"ვინაიდან, გადამცემი ხიდები 
არაა საჯაროდ ხელმისაწვდომი, 
დაგჭირდებათ მისი "
+"ვინაიდან, გადამცემი ხიდები 
არაა საჯაროდ ხელმისაწვდომი, 
დაგჭირდებათ მათი "
 "მოთხოვნა. გაქვთ ორი არჩევანი:"
 
 #: https//tb-manual.torproject.org/en-US/bridges/
@@ -889,8 +889,8 @@ msgstr ""
 "თქვენს შესვლას. დღესდღეობით, 
საიტების უმეტესობა იყენებს 
სხვა საიტების "
 "მომსახურებებს, მათ შორის 
სოციალური ქსელების 
„მოწონების“ ღილაკებს, "
 "სტატისტიკის აღმრიცხველებსა 
და დარეკლამების საშუალებებს, 
რომელთაგან თითოეულს "
-"შეუძლია სხვადასხვა საიტზე 
თქვენი მოქმედებების დაკავშირ
ება და ერთიანად "
-"აღრიცხვა."
+"შეუძლია სხვადასხვა საიტზე 
თქვენს მოქმედებებს შორის 
კავშირის დადგენა და "
+"ერთიანად აღრიცხვა."
 
 #: https//tb-manual.torproject.org/en-US/managing-identities/
 #: (content/managing-identities/contents+en-US.lrtopic.body)
@@ -2353,15 +2353,15 @@ msgstr "გამოიწერეთ ჩვენი 
სიახლეებ
 msgid "Get monthly updates and opportunities from the Tor Project"
 msgstr ""
 "გაეცანით ყოველთვიურად Tor-პრ
ოექტთან დაკავშირებულ ახალ 
ამბებსა და ახალ "
-"შესაძლებლობებს."
+"შესაძლებლობებს"
 
 #: templates/footer.html:32
 msgid ""
 "Trademark, copyright notices, and rules for use by third parties can be "
 "found in our "
 msgstr ""
-"სავაჭრო ნიშნები, საავტორო 
უფლებების დაცვის 
განაცხადები და მესამე მხარის 
მიერ"
-" გამოსაყენებელი წესები, 
შეგიძლიათ იხილოთ "
+"სავაჭრო ნიშნების, საავტორო 
უფლებების დაცვის 
განაცხადებისა და მესამე მხარ
ის "
+"მიერ გამოსაყენებელი წესების 
თაობაზე, შეგიძლიათ იხილოთ 
ჩვენი"
 
 #: templates/layout.html:7
 msgid "Tor Project | Tor Browser Manual"

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


[tor-commits] [translation/tbmanual-contentspot_completed] Update translations for tbmanual-contentspot_completed

2018-12-01 Thread translation
commit ef9c9d5a01d75d20b50fab855048ad7ea4a44d18
Author: Translation commit bot 
Date:   Sat Dec 1 18:17:10 2018 +

Update translations for tbmanual-contentspot_completed
---
 contents+ka.po | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/contents+ka.po b/contents+ka.po
index c70fa06af..0303257b6 100644
--- a/contents+ka.po
+++ b/contents+ka.po
@@ -480,7 +480,7 @@ msgid ""
 "Because bridge addresses are not public, you will need to request them "
 "yourself. You have two options:"
 msgstr ""
-"ვინაიდან, გადამცემი ხიდები 
არაა საჯაროდ ხელმისაწვდომი, 
დაგჭირდებათ მისი "
+"ვინაიდან, გადამცემი ხიდები 
არაა საჯაროდ ხელმისაწვდომი, 
დაგჭირდებათ მათი "
 "მოთხოვნა. გაქვთ ორი არჩევანი:"
 
 #: https//tb-manual.torproject.org/en-US/bridges/
@@ -889,8 +889,8 @@ msgstr ""
 "თქვენს შესვლას. დღესდღეობით, 
საიტების უმეტესობა იყენებს 
სხვა საიტების "
 "მომსახურებებს, მათ შორის 
სოციალური ქსელების 
„მოწონების“ ღილაკებს, "
 "სტატისტიკის აღმრიცხველებსა 
და დარეკლამების საშუალებებს, 
რომელთაგან თითოეულს "
-"შეუძლია სხვადასხვა საიტზე 
თქვენი მოქმედებების დაკავშირ
ება და ერთიანად "
-"აღრიცხვა."
+"შეუძლია სხვადასხვა საიტზე 
თქვენს მოქმედებებს შორის 
კავშირის დადგენა და "
+"ერთიანად აღრიცხვა."
 
 #: https//tb-manual.torproject.org/en-US/managing-identities/
 #: (content/managing-identities/contents+en-US.lrtopic.body)
@@ -2353,15 +2353,15 @@ msgstr "გამოიწერეთ ჩვენი 
სიახლეებ
 msgid "Get monthly updates and opportunities from the Tor Project"
 msgstr ""
 "გაეცანით ყოველთვიურად Tor-პრ
ოექტთან დაკავშირებულ ახალ 
ამბებსა და ახალ "
-"შესაძლებლობებს."
+"შესაძლებლობებს"
 
 #: templates/footer.html:32
 msgid ""
 "Trademark, copyright notices, and rules for use by third parties can be "
 "found in our "
 msgstr ""
-"სავაჭრო ნიშნები, საავტორო 
უფლებების დაცვის 
განაცხადები და მესამე მხარის 
მიერ"
-" გამოსაყენებელი წესები, 
შეგიძლიათ იხილოთ "
+"სავაჭრო ნიშნების, საავტორო 
უფლებების დაცვის 
განაცხადებისა და მესამე მხარ
ის "
+"მიერ გამოსაყენებელი წესების 
თაობაზე, შეგიძლიათ იხილოთ 
ჩვენი"
 
 #: templates/layout.html:7
 msgid "Tor Project | Tor Browser Manual"

___
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-01 Thread translation
commit 37c38cfba97a50eafe1cde0da90b2ea03851e2ca
Author: Translation commit bot 
Date:   Sat Dec 1 18:15:21 2018 +

Update translations for donatepages-messagespot
---
 locale/pl/LC_MESSAGES/messages.po | 63 ---
 1 file changed, 53 insertions(+), 10 deletions(-)

diff --git a/locale/pl/LC_MESSAGES/messages.po 
b/locale/pl/LC_MESSAGES/messages.po
index c3225e5d5..a7b45ded5 100644
--- a/locale/pl/LC_MESSAGES/messages.po
+++ b/locale/pl/LC_MESSAGES/messages.po
@@ -723,14 +723,21 @@ msgid ""
 "OS X and https://www.torproject.org/projects/torbrowser.html.en#linux\;>Linux."
 msgstr ""
+"Oferujemy instrukcję jak pobrać dla https://www.torproject.org/projects/torbrowser.html.en#windows\;>Windows,"
+" https://www.torproject.org/projects/torbrowser.html.en#macosx\;>Max "
+"OS X i https://www.torproject.org/projects/torbrowser.html.en#linux\;>Linux."
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:123
 msgid "What kinds of people support Tor?"
-msgstr ""
+msgstr "Jakie typy ludzi wspierają Tor?"
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:127
 msgid "All kinds of people."
-msgstr ""
+msgstr "Wiele typów ludzi."
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:129
 msgid ""
@@ -800,7 +807,7 @@ msgstr ""
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:166
 msgid "Does the Tor software work?"
-msgstr ""
+msgstr "Czy oprogramowanie Tor działa?"
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:170
 msgid ""
@@ -834,12 +841,16 @@ msgid ""
 "Downloading Tor Browser or using the Tor network is legal in nearly every "
 "country."
 msgstr ""
+"Pobranie przeglądarki Tor lub używanie sieci Tor jest legalne w prawie "
+"każdym kraju."
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:186
 msgid ""
 "A few web sites occasionally block Tor, but that doesn't mean you're doing "
 "anything wrong."
 msgstr ""
+"Kilka stron sporadycznie blokuje Tor, ale to nie oznacza że robisz coś "
+"złego."
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:188
 msgid ""
@@ -847,12 +858,17 @@ msgid ""
 "using Tor in the past, or that they misunderstand what Tor is and how it "
 "works (were working to change this)."
 msgstr ""
+"Zwykle oznacza to że ta strona miała problemy z wizytorami używającymi 
Tor w"
+" przeszłości lub to że nie rozumieją czym jest Tor ani jak działa 
(pracujemy"
+" nad zmienieniem tego)."
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:190
 msgid ""
 "But it is not illegal to use Tor, and you shouldn't get in trouble for doing"
 " it."
 msgstr ""
+"Ale używanie Tor nie jest nielegalne i nie powinieneś wpaść w kłopoty za 
"
+"używanie go."
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:192
 msgid ""
@@ -860,12 +876,17 @@ msgid ""
 "class=\"hyperlinks links\" target=\"_blank\" "
 "href=\"https://www.eff.org/torchallenge/faq.html\;>EFF site."
 msgstr ""
+"Więcej informacji o statusie prawnym Tor'a na https://www.eff.org/torchallenge/faq.html\;>stronie"
+" EFF."
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:198
 msgid ""
 "Where can I find out more about the Tor Project, especially financial "
 "information?"
 msgstr ""
+"Gdzie mogę znaleźć więcej informacji o Projekcie Tor, zwłaszcza 
finansowe "
+"informacje?"
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:202
 msgid ""
@@ -876,7 +897,7 @@ msgstr ""
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:208
 msgid "Where does the Tor Project's money come from?"
-msgstr ""
+msgstr "Skąd pochodzą pieniądze Projektu Tor?"
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:212
 msgid ""
@@ -891,6 +912,9 @@ msgid ""
 
"href=\"https://www.torproject.org/about/sponsors.html.en\;>https://www.torproject.org/about/sponsors"
 " for more.)"
 msgstr ""
+"(Zobacz https://www.torproject.org/about/sponsors.html.en\;>https://www.torproject.org/about/sponsors"
+" dla większej ilości informacji.)"
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:216
 msgid ""
@@ -968,10 +992,11 @@ msgstr ""
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:266
 msgid "If I am not in the United States, can I still donate?"
 msgstr ""
+"Jeżeli nie jestem w Stanach Zjednoczonych, czy mogę nadal przekazać 
dotację?"
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:270
 msgid "Yes, definitely."

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

2018-12-01 Thread translation
commit 0f4e3945e9e2fab68abd958001e403df5c2ca692
Author: Translation commit bot 
Date:   Sat Dec 1 17:45:23 2018 +

Update translations for donatepages-messagespot
---
 locale/pl/LC_MESSAGES/messages.po | 54 ++-
 1 file changed, 31 insertions(+), 23 deletions(-)

diff --git a/locale/pl/LC_MESSAGES/messages.po 
b/locale/pl/LC_MESSAGES/messages.po
index 3923c0854..c3225e5d5 100644
--- a/locale/pl/LC_MESSAGES/messages.po
+++ b/locale/pl/LC_MESSAGES/messages.po
@@ -336,30 +336,32 @@ msgstr "bluza"
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:306
 msgid "Your generous support of Tor gets you this high-quality zip hoodie."
 msgstr ""
+"Twoje hojne wsparcie projektu Tor zdobywa Ci tą wysokiej jakości zapinaną "
+"bluzę z kapturem."
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:316
 msgid "how do you want to DONATE?"
-msgstr ""
+msgstr "Jak chcesz przekazać DOTACJĘ?"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:322
 msgid "Credit Card"
-msgstr ""
+msgstr "Karta Kredytowa"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:338
 msgid "Your Info"
-msgstr ""
+msgstr "Twoje informacje"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:342
 msgid "* required fields"
-msgstr ""
+msgstr "* pola wymagane"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:347
 msgid "First Name"
-msgstr ""
+msgstr "Imię"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:351
 msgid "Last Name"
-msgstr ""
+msgstr "Nazwisko"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:357
 msgid "Street Address"
@@ -379,11 +381,11 @@ msgstr "Stan"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:380
 msgid "Zip"
-msgstr ""
+msgstr "Kod pocztowy"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:386
 msgid "Enter email"
-msgstr ""
+msgstr "Wpisz email"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:390
 msgid "Well email you your receipt"
@@ -445,23 +447,23 @@ msgstr ""
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:488
 msgid "Strength in Numbers T-Shirt"
-msgstr ""
+msgstr "Koszulka \"Siła w liczbach\""
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:492
 msgid "Choose your size."
-msgstr ""
+msgstr "Wybierz swój rozmiar"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:496
 msgid "Sweatshirt"
-msgstr ""
+msgstr "Bluza"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:500
 msgid "A required field is missing from the form."
-msgstr ""
+msgstr "Pole wymagane jest niewypełnione w formularzu."
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:502
 msgid "Please reload the page and try again."
-msgstr ""
+msgstr "Proszę odświeżyć stronę i spróbować ponownie."
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:506
 msgid "There was a problem submitting your request to the server:"
@@ -483,7 +485,7 @@ msgstr "Te pole jest wymagane"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:525
 msgid "Invalid email address."
-msgstr ""
+msgstr "Nieprawidłowy adres email"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:538
 msgid "One moment while we shovel coal into our servers."
@@ -501,7 +503,7 @@ msgstr ""
 
 #: 
tmp/cache_locale/af/afda2fbd22ed389453e63ca9acc074a25ce820b5bc97120edfd975cf8f46634a.php:34
 msgid "Tor Thanks You"
-msgstr ""
+msgstr "Tor Ci dziękuje"
 
 #: 
tmp/cache_locale/af/afda2fbd22ed389453e63ca9acc074a25ce820b5bc97120edfd975cf8f46634a.php:44
 msgid "Thank you!"
@@ -587,11 +589,11 @@ msgstr ""
 
 #: 
tmp/cache_locale/2d/2d5f07aeb16acd7bb0a8dd355b13f59678a1f0ba6ea2b3d9dec8d2b5dcfbfde5.php:39
 msgid "Sign Up"
-msgstr ""
+msgstr "Zarejestruj się"
 
 #: 
tmp/cache_locale/2d/2d5f07aeb16acd7bb0a8dd355b13f59678a1f0ba6ea2b3d9dec8d2b5dcfbfde5.php:47
 msgid "Donate FAQs"
-msgstr ""
+msgstr "FAQs dotacji"
 
 #: 
tmp/cache_locale/2d/2d5f07aeb16acd7bb0a8dd355b13f59678a1f0ba6ea2b3d9dec8d2b5dcfbfde5.php:51
 msgid "Privacy Policy"
@@ -622,7 +624,7 @@ msgstr ""
 
 #: 
tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:68
 msgid "What is the Tor Project and what does it do?"
-msgstr ""
+msgstr "Czym jest Projekt Tor i co on robi?"
 
 #: 

[tor-commits] [tor/master] Add changes file for #28518.

2018-12-01 Thread nickm
commit d020124138cc0d16e685bfd35dd388a4db7f68af
Author: Alexander Færøy 
Date:   Mon Nov 19 16:33:06 2018 +0100

Add changes file for #28518.

See: https://bugs.torproject.org/28518
---
 changes/bug28518 | 4 
 1 file changed, 4 insertions(+)

diff --git a/changes/bug28518 b/changes/bug28518
new file mode 100644
index 0..d7ebab29b
--- /dev/null
+++ b/changes/bug28518
@@ -0,0 +1,4 @@
+  o Minor features (FreeBSD):
+- Warn relay operators if the "net.inet.ip.random_id" sysctl (IP ID
+  randomization) is disabled on their relay if it is running on FreeBSD
+  based operating systems. Closes ticket 28518.



___
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/527'

2018-12-01 Thread nickm
commit d4d4a4b2dd95ce0cb8db6fc0074f0ac66d659469
Merge: c63d951e7 d02012413
Author: Nick Mathewson 
Date:   Sat Dec 1 11:30:53 2018 -0500

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

 changes/bug28518|  4 
 src/app/config/config.c | 21 +
 2 files changed, 25 insertions(+)




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


[tor-commits] [tor/master] Move net.inet.ip.random_id code to lib/net/

2018-12-01 Thread nickm
commit 701eaef980de4f7dbb5c31c4fee9b7e1e266d7a1
Author: Nick Mathewson 
Date:   Sat Dec 1 11:36:03 2018 -0500

Move net.inet.ip.random_id code to lib/net/
---
 src/app/config/config.c | 21 +
 src/lib/net/socket.c| 29 +
 src/lib/net/socket.h|  1 +
 3 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/src/app/config/config.c b/src/app/config/config.c
index d907b0713..50f3793d6 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -157,10 +157,6 @@
 #include "core/or/connection_st.h"
 #include "core/or/port_cfg_st.h"
 
-#ifdef __FreeBSD__
-#include 
-#endif
-
 #ifdef HAVE_SYSTEMD
 #   if defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__)
 /* Systemd's use of gcc's __INCLUDE_LEVEL__ extension macro appears to confuse
@@ -3386,22 +3382,7 @@ options_validate(or_options_t *old_options, or_options_t 
*options,
   if (ContactInfo && !string_is_utf8(ContactInfo, strlen(ContactInfo)))
 REJECT("ContactInfo config option must be UTF-8.");
 
-#ifdef __FreeBSD__
-  if (server_mode(options)) {
-int random_id_state;
-size_t state_size = sizeof(random_id_state);
-
-if (sysctlbyname("net.inet.ip.random_id", _id_state,
-_size, NULL, 0)) {
-  log_warn(LD_CONFIG,
-  "Failed to figure out if IP ids are randomized.");
-} else if (random_id_state == 0) {
-  log_warn(LD_CONFIG, "Looks like IP ids are not randomized. "
-  "Please consider setting the net.inet.ip.random_id sysctl, "
-  "so your relay makes it harder to figure out how busy it is.");
-}
-  }
-#endif
+  check_network_configuration(server_mode(options));
 
   /* Special case on first boot if no Log options are given. */
   if (!options->Logs && !options->RunAsDaemon && !from_setconf) {
diff --git a/src/lib/net/socket.c b/src/lib/net/socket.c
index cd7c9685c..8940e0059 100644
--- a/src/lib/net/socket.c
+++ b/src/lib/net/socket.c
@@ -31,6 +31,9 @@
 #endif
 #include 
 #include 
+#ifdef __FreeBSD__
+#include 
+#endif
 
 /** Called before we make any calls to network-related functions.
  * (Some operating systems require their network libraries to be
@@ -60,6 +63,32 @@ network_init(void)
   return 0;
 }
 
+/**
+ * Warn the user if any system network parameters should be changed.
+ */
+void
+check_network_configuration(bool server_mode)
+{
+#ifdef __FreeBSD__
+  if (server_mode) {
+int random_id_state;
+size_t state_size = sizeof(random_id_state);
+
+if (sysctlbyname("net.inet.ip.random_id", _id_state,
+ _size, NULL, 0)) {
+  log_warn(LD_CONFIG,
+   "Failed to figure out if IP ids are randomized.");
+} else if (random_id_state == 0) {
+  log_warn(LD_CONFIG, "Looks like IP ids are not randomized. "
+   "Please consider setting the net.inet.ip.random_id sysctl, "
+   "so your relay makes it harder to figure out how busy it is.");
+}
+  }
+#else
+  (void) server_mode;
+#endif
+}
+
 /* When set_max_file_sockets() is called, update this with the max file
  * descriptor value so we can use it to check the limit when opening a new
  * socket. Default value is what Debian sets as the default hard limit. */
diff --git a/src/lib/net/socket.h b/src/lib/net/socket.h
index 2b87441fc..822b9975e 100644
--- a/src/lib/net/socket.h
+++ b/src/lib/net/socket.h
@@ -54,6 +54,7 @@ int tor_addr_from_getsockname(struct tor_addr_t *addr_out, 
tor_socket_t sock);
 int set_socket_nonblocking(tor_socket_t socket);
 int tor_socketpair(int family, int type, int protocol, tor_socket_t fd[2]);
 int network_init(void);
+void check_network_configuration(bool server_mode);
 
 int get_max_sockets(void);
 void set_max_sockets(int);

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


[tor-commits] [tor/master] Complain if net.inet.ip.random_id is not set on FreeBSD-based servers

2018-12-01 Thread nickm
commit 71651ea4aa507ee50865bd9584873e0c9a422c14
Author: Fabian Keil 
Date:   Tue Apr 7 16:36:05 2015 +0200

Complain if net.inet.ip.random_id is not set on FreeBSD-based servers

Apparently a couple of operators haven't gotten the memos [0] yet
and it looks like FreeBSD's default value will not change any time
soon [1].

[0]:
https://lists.torproject.org/pipermail/tor-relays/2014-March/004199.html
https://lists.torproject.org/pipermail/tor-relays/2014-November/005687.html
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195828

[1]:
https://lists.freebsd.org/pipermail/freebsd-net/2015-April/041942.html
---
 src/app/config/config.c | 21 +
 1 file changed, 21 insertions(+)

diff --git a/src/app/config/config.c b/src/app/config/config.c
index 45a23d67d..56fca1549 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -157,6 +157,10 @@
 #include "core/or/connection_st.h"
 #include "core/or/port_cfg_st.h"
 
+#ifdef __FreeBSD__
+#include 
+#endif
+
 #ifdef HAVE_SYSTEMD
 #   if defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__)
 /* Systemd's use of gcc's __INCLUDE_LEVEL__ extension macro appears to confuse
@@ -3383,6 +3387,23 @@ options_validate(or_options_t *old_options, or_options_t 
*options,
   if (ContactInfo && !string_is_utf8(ContactInfo, strlen(ContactInfo)))
 REJECT("ContactInfo config option must be UTF-8.");
 
+#ifdef __FreeBSD__
+  if (server_mode(options)) {
+int random_id_state;
+size_t state_size = sizeof(random_id_state);
+
+if (sysctlbyname("net.inet.ip.random_id", _id_state,
+_size, NULL, 0)) {
+  log_warn(LD_CONFIG,
+  "Failed to figure out if IP ids are randomized.");
+} else if (random_id_state == 0) {
+  log_warn(LD_CONFIG, "Looks like IP ids are not randomized. "
+  "Please consider setting the net.inet.ip.random_id sysctl, "
+  "so your relay makes it harder to figure out how busy it is.");
+}
+  }
+#endif
+
   /* Special case on first boot if no Log options are given. */
   if (!options->Logs && !options->RunAsDaemon && !from_setconf) {
 if (quiet_level == 0)



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


[tor-commits] [tor/master] Mention --no-verify in error message

2018-12-01 Thread nickm
commit 9c90bddc42467396909812746d5b4256adcb5d2d
Author: rl1987 
Date:   Thu Nov 29 11:10:48 2018 +0200

Mention --no-verify in error message
---
 scripts/maint/pre-push.git-hook | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/maint/pre-push.git-hook b/scripts/maint/pre-push.git-hook
index 11f062b53..26296023f 100755
--- a/scripts/maint/pre-push.git-hook
+++ b/scripts/maint/pre-push.git-hook
@@ -42,6 +42,7 @@ do
if [ -n "$commit" ]
then
echo >&2 "Found fixup! commit in $local_ref, not 
pushing"
+   echo >&2 "If you really want to push this, use 
--no-verify."
exit 1
fi
 
@@ -50,6 +51,7 @@ do
if [ -n "$commit" ]
then
echo >&2 "Found squash! commit in $local_ref, not 
pushing"
+   echo >&2 "If you really want to push this, use 
--no-verify."
exit 1
fi
fi



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


[tor-commits] [tor/master] Rename to pre-push.git-hook

2018-12-01 Thread nickm
commit e2b418bab5c3249fba7b430b942da67ddf8a43dc
Author: rl1987 
Date:   Thu Nov 29 10:56:56 2018 +0200

Rename to pre-push.git-hook
---
 scripts/maint/{pre-push => pre-push.git-hook} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/scripts/maint/pre-push b/scripts/maint/pre-push.git-hook
similarity index 100%
rename from scripts/maint/pre-push
rename to scripts/maint/pre-push.git-hook



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


[tor-commits] [tor/master] Improve comment at the top

2018-12-01 Thread nickm
commit 7c6dc2888144e587bc8d62c7b2bddae4fb6606b9
Author: rl1987 
Date:   Thu Nov 29 11:10:30 2018 +0200

Improve comment at the top
---
 scripts/maint/pre-push.git-hook | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/maint/pre-push.git-hook b/scripts/maint/pre-push.git-hook
index 26c48c4e2..11f062b53 100755
--- a/scripts/maint/pre-push.git-hook
+++ b/scripts/maint/pre-push.git-hook
@@ -1,8 +1,10 @@
 #!/bin/bash
 
-# git pre-push hook script to prevent "fixup!" and "squash!" commit
-# from ending up in master, or in any branch if CUR_BRANCH check is removed.
-# It is meant to be placed in .git/hooks directory.
+# To install this script, copy it into .git/hooks/pre-push path in your
+# local copy of git repository. Make sure it has permission to execute.
+#
+# This is git pre-push hook script to prevent "fixup!" and "squash!" commits
+# from ending up in upstream branches (master, release-* or maint-*).
 #
 # The following sample script was used as starting point:
 # https://github.com/git/git/blob/master/templates/hooks--pre-push.sample



___
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/530'

2018-12-01 Thread nickm
commit c63d951e7f093f3a97748f96314b669d0cd1da54
Merge: 51d94cea3 9c90bddc4
Author: Nick Mathewson 
Date:   Sat Dec 1 11:28:22 2018 -0500

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

 changes/ticket27993 |  3 ++
 scripts/maint/pre-push.git-hook | 61 +
 2 files changed, 64 insertions(+)

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


[tor-commits] [tor/master] Also disallow fixup/squash commits in maint-* and release-*

2018-12-01 Thread nickm
commit b2053cfc44f4876a52f8d71f2308077c6e39498d
Author: rl1987 
Date:   Tue Nov 20 16:37:30 2018 +0200

Also disallow fixup/squash commits in maint-* and release-*
---
 scripts/maint/pre-push | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/maint/pre-push b/scripts/maint/pre-push
index 2cf1837b8..26c48c4e2 100755
--- a/scripts/maint/pre-push
+++ b/scripts/maint/pre-push
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # git pre-push hook script to prevent "fixup!" and "squash!" commit
 # from ending up in master, or in any branch if CUR_BRANCH check is removed.
@@ -10,7 +10,8 @@
 z40=
 
 CUR_BRANCH=$(git rev-parse --abbrev-ref HEAD)
-if [ "$CUR_BRANCH" != "master" ]
+if [ "$CUR_BRANCH" != "master" ] && [[ $CUR_BRANCH != release-* ]] &&
+[[ $CUR_BRANCH != maint-* ]]
 then
 exit 0
 fi



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


[tor-commits] [tor/master] Add pre-push git hook to prevent fixup and squash commits from ending up in master

2018-12-01 Thread nickm
commit ffee0a6384e751486bb4ca2752b6a00527b923ca
Author: rl1987 
Date:   Tue Nov 20 15:40:52 2018 +0200

Add pre-push git hook to prevent fixup and squash commits from ending up in 
master
---
 changes/ticket27993|  3 +++
 scripts/maint/pre-push | 56 ++
 2 files changed, 59 insertions(+)

diff --git a/changes/ticket27993 b/changes/ticket27993
new file mode 100644
index 0..78ee7c205
--- /dev/null
+++ b/changes/ticket27993
@@ -0,0 +1,3 @@
+  o Minor features (developer tooling):
+- Provide git hook script to prevent "fixup!" and "squash!" commits from
+  ending up in master. Closes ticket 27993.
diff --git a/scripts/maint/pre-push b/scripts/maint/pre-push
new file mode 100755
index 0..2cf1837b8
--- /dev/null
+++ b/scripts/maint/pre-push
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# git pre-push hook script to prevent "fixup!" and "squash!" commit
+# from ending up in master, or in any branch if CUR_BRANCH check is removed.
+# It is meant to be placed in .git/hooks directory.
+#
+# The following sample script was used as starting point:
+# https://github.com/git/git/blob/master/templates/hooks--pre-push.sample
+
+z40=
+
+CUR_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+if [ "$CUR_BRANCH" != "master" ]
+then
+exit 0
+fi
+
+echo "Running pre-push hook"
+
+# shellcheck disable=SC2034
+while read -r local_ref local_sha remote_ref remote_sha
+do
+   if [ "$local_sha" = $z40 ]
+   then
+   # Handle delete
+   :
+   else
+   if [ "$remote_sha" = $z40 ]
+   then
+   # New branch, examine all commits
+   range="$local_sha"
+   else
+   # Update to existing branch, examine new commits
+   range="$remote_sha..$local_sha"
+   fi
+
+# Check for fixup! commit
+commit=$(git rev-list -n 1 --grep '^fixup!' "$range")
+   if [ -n "$commit" ]
+   then
+   echo >&2 "Found fixup! commit in $local_ref, not 
pushing"
+   exit 1
+   fi
+
+# Check for squash! commit
+commit=$(git rev-list -n 1 --grep '^squash!' "$range")
+   if [ -n "$commit" ]
+   then
+   echo >&2 "Found squash! commit in $local_ref, not 
pushing"
+   exit 1
+   fi
+   fi
+done
+
+exit 0
+



___
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] sr: Switch from tor_assert() to BUG()

2018-12-01 Thread nickm
commit d18a167ff38799ea5cd846dd80acccab6404952a
Author: Neel Chauhan 
Date:   Tue Sep 19 16:08:24 2017 -0400

sr: Switch from tor_assert() to BUG()

Closes #19566

Signed-off-by: David Goulet 
---
 changes/ticket19566   |  6 ++
 src/feature/dirauth/shared_random.c   |  3 ++-
 src/feature/dirauth/shared_random_state.c | 18 --
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/changes/ticket19566 b/changes/ticket19566
new file mode 100644
index 0..bf7071e66
--- /dev/null
+++ b/changes/ticket19566
@@ -0,0 +1,6 @@
+  o Code simplification and refactoring (shared random, dirauth):
+- Change many tor_assert() to use BUG() instead. The idea is to not crash
+  a dirauth but rather scream loudly with a stacktrace and let it continue
+  run. The shared random subsystem is very resilient and if anything wrong
+  happens with it, at worst a non coherent value will be put in the vote
+  and discarded by the other authorities. Closes ticket 19566.
diff --git a/src/feature/dirauth/shared_random.c 
b/src/feature/dirauth/shared_random.c
index db4f9d328..b027d9e37 100644
--- a/src/feature/dirauth/shared_random.c
+++ b/src/feature/dirauth/shared_random.c
@@ -949,7 +949,8 @@ sr_compute_srv(void)
   /* Computing a shared random value in the commit phase is very wrong. This
* should only happen at the very end of the reveal phase when a new
* protocol run is about to start. */
-  tor_assert(sr_state_get_phase() == SR_PHASE_REVEAL);
+  if (BUG(sr_state_get_phase() != SR_PHASE_REVEAL))
+return;
   state_commits = sr_state_get_commits();
 
   commits = smartlist_new();
diff --git a/src/feature/dirauth/shared_random_state.c 
b/src/feature/dirauth/shared_random_state.c
index 38c7fd76d..7ae4a5dc8 100644
--- a/src/feature/dirauth/shared_random_state.c
+++ b/src/feature/dirauth/shared_random_state.c
@@ -594,8 +594,10 @@ disk_state_update(void)
 {
   config_line_t **next, *line;
 
-  tor_assert(sr_disk_state);
-  tor_assert(sr_state);
+  if (BUG(!sr_disk_state))
+return;
+  if (BUG(!sr_state))
+return;
 
   /* Reset current disk state. */
   disk_state_reset();
@@ -759,7 +761,8 @@ disk_state_save_to_disk(void)
 STATIC void
 reset_state_for_new_protocol_run(time_t valid_after)
 {
-  tor_assert(sr_state);
+  if (BUG(!sr_state))
+return;
 
   /* Keep counters in track */
   sr_state->n_reveal_rounds = 0;
@@ -1091,7 +1094,8 @@ sr_state_update(time_t valid_after)
 {
   sr_phase_t next_phase;
 
-  tor_assert(sr_state);
+  if (BUG(!sr_state))
+return;
 
   /* Don't call this function twice in the same voting period. */
   if (valid_after <= sr_state->valid_after) {
@@ -1130,7 +1134,8 @@ sr_state_update(time_t valid_after)
   /* Count the current round */
   if (sr_state->phase == SR_PHASE_COMMIT) {
 /* invariant check: we've not entered reveal phase yet */
-tor_assert(sr_state->n_reveal_rounds == 0);
+if (BUG(sr_state->n_reveal_rounds != 0))
+  return;
 sr_state->n_commit_rounds++;
   } else {
 sr_state->n_reveal_rounds++;
@@ -1320,7 +1325,8 @@ sr_state_init(int save_to_disk, int read_from_disk)
 void
 set_sr_phase(sr_phase_t phase)
 {
-  tor_assert(sr_state);
+  if (BUG(!sr_state))
+return;
   sr_state->phase = phase;
 }
 



___
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/554' into maint-0.3.5

2018-12-01 Thread nickm
commit 1a97379e5e5d349b4debd5ac61bedcca623dd386
Merge: 11a91ef72 d18a167ff
Author: Nick Mathewson 
Date:   Sat Dec 1 11:26:52 2018 -0500

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

 changes/ticket19566   |  6 ++
 src/feature/dirauth/shared_random.c   |  3 ++-
 src/feature/dirauth/shared_random_state.c | 18 --
 3 files changed, 20 insertions(+), 7 deletions(-)

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


[tor-commits] [tor/master] Merge remote-tracking branch 'tor-github/pr/554' into maint-0.3.5

2018-12-01 Thread nickm
commit 1a97379e5e5d349b4debd5ac61bedcca623dd386
Merge: 11a91ef72 d18a167ff
Author: Nick Mathewson 
Date:   Sat Dec 1 11:26:52 2018 -0500

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

 changes/ticket19566   |  6 ++
 src/feature/dirauth/shared_random.c   |  3 ++-
 src/feature/dirauth/shared_random_state.c | 18 --
 3 files changed, 20 insertions(+), 7 deletions(-)



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


[tor-commits] [tor/master] sr: Switch from tor_assert() to BUG()

2018-12-01 Thread nickm
commit d18a167ff38799ea5cd846dd80acccab6404952a
Author: Neel Chauhan 
Date:   Tue Sep 19 16:08:24 2017 -0400

sr: Switch from tor_assert() to BUG()

Closes #19566

Signed-off-by: David Goulet 
---
 changes/ticket19566   |  6 ++
 src/feature/dirauth/shared_random.c   |  3 ++-
 src/feature/dirauth/shared_random_state.c | 18 --
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/changes/ticket19566 b/changes/ticket19566
new file mode 100644
index 0..bf7071e66
--- /dev/null
+++ b/changes/ticket19566
@@ -0,0 +1,6 @@
+  o Code simplification and refactoring (shared random, dirauth):
+- Change many tor_assert() to use BUG() instead. The idea is to not crash
+  a dirauth but rather scream loudly with a stacktrace and let it continue
+  run. The shared random subsystem is very resilient and if anything wrong
+  happens with it, at worst a non coherent value will be put in the vote
+  and discarded by the other authorities. Closes ticket 19566.
diff --git a/src/feature/dirauth/shared_random.c 
b/src/feature/dirauth/shared_random.c
index db4f9d328..b027d9e37 100644
--- a/src/feature/dirauth/shared_random.c
+++ b/src/feature/dirauth/shared_random.c
@@ -949,7 +949,8 @@ sr_compute_srv(void)
   /* Computing a shared random value in the commit phase is very wrong. This
* should only happen at the very end of the reveal phase when a new
* protocol run is about to start. */
-  tor_assert(sr_state_get_phase() == SR_PHASE_REVEAL);
+  if (BUG(sr_state_get_phase() != SR_PHASE_REVEAL))
+return;
   state_commits = sr_state_get_commits();
 
   commits = smartlist_new();
diff --git a/src/feature/dirauth/shared_random_state.c 
b/src/feature/dirauth/shared_random_state.c
index 38c7fd76d..7ae4a5dc8 100644
--- a/src/feature/dirauth/shared_random_state.c
+++ b/src/feature/dirauth/shared_random_state.c
@@ -594,8 +594,10 @@ disk_state_update(void)
 {
   config_line_t **next, *line;
 
-  tor_assert(sr_disk_state);
-  tor_assert(sr_state);
+  if (BUG(!sr_disk_state))
+return;
+  if (BUG(!sr_state))
+return;
 
   /* Reset current disk state. */
   disk_state_reset();
@@ -759,7 +761,8 @@ disk_state_save_to_disk(void)
 STATIC void
 reset_state_for_new_protocol_run(time_t valid_after)
 {
-  tor_assert(sr_state);
+  if (BUG(!sr_state))
+return;
 
   /* Keep counters in track */
   sr_state->n_reveal_rounds = 0;
@@ -1091,7 +1094,8 @@ sr_state_update(time_t valid_after)
 {
   sr_phase_t next_phase;
 
-  tor_assert(sr_state);
+  if (BUG(!sr_state))
+return;
 
   /* Don't call this function twice in the same voting period. */
   if (valid_after <= sr_state->valid_after) {
@@ -1130,7 +1134,8 @@ sr_state_update(time_t valid_after)
   /* Count the current round */
   if (sr_state->phase == SR_PHASE_COMMIT) {
 /* invariant check: we've not entered reveal phase yet */
-tor_assert(sr_state->n_reveal_rounds == 0);
+if (BUG(sr_state->n_reveal_rounds != 0))
+  return;
 sr_state->n_commit_rounds++;
   } else {
 sr_state->n_reveal_rounds++;
@@ -1320,7 +1325,8 @@ sr_state_init(int save_to_disk, int read_from_disk)
 void
 set_sr_phase(sr_phase_t phase)
 {
-  tor_assert(sr_state);
+  if (BUG(!sr_state))
+return;
   sr_state->phase = phase;
 }
 



___
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-01 Thread nickm
commit 51d94cea3370c0ddc7c18993f2a81eea11e51e36
Merge: 7e9985b75 1a97379e5
Author: Nick Mathewson 
Date:   Sat Dec 1 11:26:55 2018 -0500

Merge branch 'maint-0.3.5'

 changes/ticket19566   |  6 ++
 src/feature/dirauth/shared_random.c   |  3 ++-
 src/feature/dirauth/shared_random_state.c | 18 --
 3 files changed, 20 insertions(+), 7 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] Merge remote-tracking branch 'tor-github/pr/554' into maint-0.3.5

2018-12-01 Thread nickm
commit 1a97379e5e5d349b4debd5ac61bedcca623dd386
Merge: 11a91ef72 d18a167ff
Author: Nick Mathewson 
Date:   Sat Dec 1 11:26:52 2018 -0500

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

 changes/ticket19566   |  6 ++
 src/feature/dirauth/shared_random.c   |  3 ++-
 src/feature/dirauth/shared_random_state.c | 18 --
 3 files changed, 20 insertions(+), 7 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] Merge branch 'maint-0.3.5' into release-0.3.5

2018-12-01 Thread nickm
commit c811ae3bd6ef12b909419ebda1a561995cb561c7
Merge: 6267ea5fb 1a97379e5
Author: Nick Mathewson 
Date:   Sat Dec 1 11:26:55 2018 -0500

Merge branch 'maint-0.3.5' into release-0.3.5

 changes/ticket19566   |  6 ++
 src/feature/dirauth/shared_random.c   |  3 ++-
 src/feature/dirauth/shared_random_state.c | 18 --
 3 files changed, 20 insertions(+), 7 deletions(-)

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


[tor-commits] [tor/maint-0.3.5] sr: Switch from tor_assert() to BUG()

2018-12-01 Thread nickm
commit d18a167ff38799ea5cd846dd80acccab6404952a
Author: Neel Chauhan 
Date:   Tue Sep 19 16:08:24 2017 -0400

sr: Switch from tor_assert() to BUG()

Closes #19566

Signed-off-by: David Goulet 
---
 changes/ticket19566   |  6 ++
 src/feature/dirauth/shared_random.c   |  3 ++-
 src/feature/dirauth/shared_random_state.c | 18 --
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/changes/ticket19566 b/changes/ticket19566
new file mode 100644
index 0..bf7071e66
--- /dev/null
+++ b/changes/ticket19566
@@ -0,0 +1,6 @@
+  o Code simplification and refactoring (shared random, dirauth):
+- Change many tor_assert() to use BUG() instead. The idea is to not crash
+  a dirauth but rather scream loudly with a stacktrace and let it continue
+  run. The shared random subsystem is very resilient and if anything wrong
+  happens with it, at worst a non coherent value will be put in the vote
+  and discarded by the other authorities. Closes ticket 19566.
diff --git a/src/feature/dirauth/shared_random.c 
b/src/feature/dirauth/shared_random.c
index db4f9d328..b027d9e37 100644
--- a/src/feature/dirauth/shared_random.c
+++ b/src/feature/dirauth/shared_random.c
@@ -949,7 +949,8 @@ sr_compute_srv(void)
   /* Computing a shared random value in the commit phase is very wrong. This
* should only happen at the very end of the reveal phase when a new
* protocol run is about to start. */
-  tor_assert(sr_state_get_phase() == SR_PHASE_REVEAL);
+  if (BUG(sr_state_get_phase() != SR_PHASE_REVEAL))
+return;
   state_commits = sr_state_get_commits();
 
   commits = smartlist_new();
diff --git a/src/feature/dirauth/shared_random_state.c 
b/src/feature/dirauth/shared_random_state.c
index 38c7fd76d..7ae4a5dc8 100644
--- a/src/feature/dirauth/shared_random_state.c
+++ b/src/feature/dirauth/shared_random_state.c
@@ -594,8 +594,10 @@ disk_state_update(void)
 {
   config_line_t **next, *line;
 
-  tor_assert(sr_disk_state);
-  tor_assert(sr_state);
+  if (BUG(!sr_disk_state))
+return;
+  if (BUG(!sr_state))
+return;
 
   /* Reset current disk state. */
   disk_state_reset();
@@ -759,7 +761,8 @@ disk_state_save_to_disk(void)
 STATIC void
 reset_state_for_new_protocol_run(time_t valid_after)
 {
-  tor_assert(sr_state);
+  if (BUG(!sr_state))
+return;
 
   /* Keep counters in track */
   sr_state->n_reveal_rounds = 0;
@@ -1091,7 +1094,8 @@ sr_state_update(time_t valid_after)
 {
   sr_phase_t next_phase;
 
-  tor_assert(sr_state);
+  if (BUG(!sr_state))
+return;
 
   /* Don't call this function twice in the same voting period. */
   if (valid_after <= sr_state->valid_after) {
@@ -1130,7 +1134,8 @@ sr_state_update(time_t valid_after)
   /* Count the current round */
   if (sr_state->phase == SR_PHASE_COMMIT) {
 /* invariant check: we've not entered reveal phase yet */
-tor_assert(sr_state->n_reveal_rounds == 0);
+if (BUG(sr_state->n_reveal_rounds != 0))
+  return;
 sr_state->n_commit_rounds++;
   } else {
 sr_state->n_reveal_rounds++;
@@ -1320,7 +1325,8 @@ sr_state_init(int save_to_disk, int read_from_disk)
 void
 set_sr_phase(sr_phase_t phase)
 {
-  tor_assert(sr_state);
+  if (BUG(!sr_state))
+return;
   sr_state->phase = phase;
 }
 



___
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/536'

2018-12-01 Thread nickm
commit 7e9985b75aa69d4572aac739d44d50056ed20e82
Merge: af9dc12fa 805f75182
Author: Nick Mathewson 
Date:   Sat Dec 1 11:24:02 2018 -0500

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

 changes/bug24661 |  3 ++
 changes/bug28569 |  3 ++
 src/feature/client/entrynodes.c  | 27 ++
 src/feature/nodelist/microdesc.c | 10 ++--
 src/feature/nodelist/networkstatus.c |  7 +--
 src/feature/nodelist/networkstatus.h |  5 +-
 src/test/test_entrynodes.c   | 98 ++--
 7 files changed, 93 insertions(+), 60 deletions(-)

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


[tor-commits] [tor/master] Entry Nodes: refactor tests to use macros

2018-12-01 Thread nickm
commit 390112d07e7daad1ce1e79b37c3357ca936fd9ae
Author: teor 
Date:   Thu Nov 22 17:10:28 2018 +1000

Entry Nodes: refactor tests to use macros

Part of 24661.
---
 src/test/test_entrynodes.c | 67 +++---
 1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 3653feaff..1071b04ce 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -2692,7 +2692,7 @@ 
test_entry_guard_upgrade_not_blocked_by_worse_circ_pending(void *arg)
 }
 
 static void
-test_enty_guard_should_expire_waiting(void *arg)
+test_entry_guard_should_expire_waiting(void *arg)
 {
   (void)arg;
   circuit_guard_state_t *fake_state = tor_malloc_zero(sizeof(*fake_state));
@@ -3010,39 +3010,38 @@ static const struct testcase_setup_t upgrade_circuits = 
{
   upgrade_circuits_setup, upgrade_circuits_cleanup
 };
 
+#define NO_PREFIX_TEST(name) \
+  { #name, test_ ## name, 0, NULL, NULL }
+
+#define EN_TEST_BASE(name, fork, setup, arg) \
+  { #name, test_entry_guard_ ## name, fork, setup, (void*)(arg) }
+
+#define EN_TEST(name)  EN_TEST_BASE(name, 0,   NULL, NULL)
+#define EN_TEST_FORK(name) EN_TEST_BASE(name, TT_FORK, NULL, NULL)
+
 #define BFN_TEST(name) \
-  { #name, test_entry_guard_ ## name, TT_FORK, _fake_network, NULL }
+  EN_TEST_BASE(name, TT_FORK, _fake_network, NULL)
 
-#define UPGRADE_TEST(name, arg) \
-  { #name, test_entry_guard_ ## name, TT_FORK, _circuits,   \
-  (void*)(arg) }
+#define UPGRADE_TEST(name, arg) \
+  EN_TEST_BASE(name, TT_FORK, _circuits, arg)
 
 struct testcase_t entrynodes_tests[] = {
-  { "node_preferred_orport",
-test_node_preferred_orport,
-0, NULL, NULL },
-  { "entry_guard_describe", test_entry_guard_describe, 0, NULL, NULL },
-  { "randomize_time", test_entry_guard_randomize_time, 0, NULL, NULL },
-  { "encode_for_state_minimal",
-test_entry_guard_encode_for_state_minimal, 0, NULL, NULL },
-  { "encode_for_state_maximal",
-test_entry_guard_encode_for_state_maximal, 0, NULL, NULL },
-  { "parse_from_state_minimal",
-test_entry_guard_parse_from_state_minimal, 0, NULL, NULL },
-  { "parse_from_state_maximal",
-test_entry_guard_parse_from_state_maximal, 0, NULL, NULL },
-  { "parse_from_state_failure",
-test_entry_guard_parse_from_state_failure, 0, NULL, NULL },
-  { "parse_from_state_partial_failure",
-test_entry_guard_parse_from_state_partial_failure, 0, NULL, NULL },
-  { "parse_from_state_full",
-test_entry_guard_parse_from_state_full, TT_FORK, NULL, NULL },
-  { "parse_from_state_broken",
-test_entry_guard_parse_from_state_broken, TT_FORK, NULL, NULL },
-  { "get_guard_selection_by_name",
-test_entry_guard_get_guard_selection_by_name, TT_FORK, NULL, NULL },
-  { "number_of_primaries",
-test_entry_guard_number_of_primaries, TT_FORK, NULL, NULL },
+  NO_PREFIX_TEST(node_preferred_orport),
+  NO_PREFIX_TEST(entry_guard_describe),
+
+  EN_TEST(randomize_time),
+  EN_TEST(encode_for_state_minimal),
+  EN_TEST(encode_for_state_maximal),
+  EN_TEST(parse_from_state_minimal),
+  EN_TEST(parse_from_state_maximal),
+  EN_TEST(parse_from_state_failure),
+  EN_TEST(parse_from_state_partial_failure),
+
+  EN_TEST_FORK(parse_from_state_full),
+  EN_TEST_FORK(parse_from_state_broken),
+  EN_TEST_FORK(get_guard_selection_by_name),
+  EN_TEST_FORK(number_of_primaries),
+
   BFN_TEST(choose_selection_initial),
   BFN_TEST(add_single_guard),
   BFN_TEST(node_filter),
@@ -3056,7 +3055,9 @@ struct testcase_t entrynodes_tests[] = {
   BFN_TEST(sample_reachable_filtered_empty),
   BFN_TEST(retry_unreachable),
   BFN_TEST(manage_primary),
-  { "guard_preferred", test_entry_guard_guard_preferred, TT_FORK, NULL, NULL },
+
+  EN_TEST_FORK(guard_preferred),
+
   BFN_TEST(select_for_circuit_no_confirmed),
   BFN_TEST(select_for_circuit_confirmed),
   BFN_TEST(select_for_circuit_highlevel_primary),
@@ -3079,8 +3080,8 @@ struct testcase_t entrynodes_tests[] = {
   UPGRADE_TEST(upgrade_not_blocked_by_restricted_circ_pending,
"c2-done"),
   UPGRADE_TEST(upgrade_not_blocked_by_worse_circ_pending, "c1-done"),
-  { "should_expire_waiting", test_enty_guard_should_expire_waiting, TT_FORK,
-NULL, NULL },
+
+  EN_TEST_FORK(should_expire_waiting),
 
   END_OF_TESTCASES
 };



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


[tor-commits] [tor/master] Test: make unit tests use a reasonably live consensus

2018-12-01 Thread nickm
commit cebc39bcd56dde8f9824055fcd54707de56ab9b1
Author: teor 
Date:   Wed Nov 21 15:55:43 2018 +1000

Test: make unit tests use a reasonably live consensus

Cleanup after 24661.
---
 src/feature/nodelist/networkstatus.c | 7 ++-
 src/feature/nodelist/networkstatus.h | 5 +++--
 src/test/test_entrynodes.c   | 9 +
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/feature/nodelist/networkstatus.c 
b/src/feature/nodelist/networkstatus.c
index de2451b79..51e720a98 100644
--- a/src/feature/nodelist/networkstatus.c
+++ b/src/feature/nodelist/networkstatus.c
@@ -1448,13 +1448,10 @@ networkstatus_valid_until_is_reasonably_live(time_t 
valid_until,
   return (now <= valid_until + REASONABLY_LIVE_TIME);
 }
 
-/*  remove this in favor of get_live_consensus. But actually,
- * leave something like it for bridge users, who need to not totally
- * lose if they spend a while fetching a new consensus. */
 /** As networkstatus_get_live_consensus(), but is way more tolerant of expired
  * consensuses. */
-networkstatus_t *
-networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
+MOCK_IMPL(networkstatus_t *,
+networkstatus_get_reasonably_live_consensus,(time_t now, int flavor))
 {
   networkstatus_t *consensus =
 networkstatus_get_latest_consensus_by_flavor(flavor);
diff --git a/src/feature/nodelist/networkstatus.h 
b/src/feature/nodelist/networkstatus.h
index 6f8b2dc96..7b1a0ff72 100644
--- a/src/feature/nodelist/networkstatus.h
+++ b/src/feature/nodelist/networkstatus.h
@@ -89,8 +89,9 @@ int networkstatus_consensus_reasonably_live(const 
networkstatus_t *consensus,
 time_t now);
 int networkstatus_valid_until_is_reasonably_live(time_t valid_until,
  time_t now);
-networkstatus_t *networkstatus_get_reasonably_live_consensus(time_t now,
- int flavor);
+MOCK_DECL(networkstatus_t *,networkstatus_get_reasonably_live_consensus,
+(time_t now,
+ int flavor));
 MOCK_DECL(int, networkstatus_consensus_is_bootstrapping,(time_t now));
 int networkstatus_consensus_can_use_multiple_directories(
 const or_options_t *options);
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index b67c9fae5..3653feaff 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -74,9 +74,10 @@ bfn_mock_nodelist_get_list(void)
 }
 
 static networkstatus_t *
-bfn_mock_networkstatus_get_live_consensus(time_t now)
+bfn_mock_networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
 {
   (void)now;
+  (void)flavor;
   return dummy_consensus;
 }
 
@@ -118,7 +119,7 @@ big_fake_network_cleanup(const struct testcase_t *testcase, 
void *ptr)
   UNMOCK(nodelist_get_list);
   UNMOCK(node_get_by_id);
   UNMOCK(get_or_state);
-  UNMOCK(networkstatus_get_live_consensus);
+  UNMOCK(networkstatus_get_reasonably_live_consensus);
   or_state_free(dummy_state);
   dummy_state = NULL;
   tor_free(dummy_consensus);
@@ -198,8 +199,8 @@ big_fake_network_setup(const struct testcase_t *testcase)
   MOCK(node_get_by_id, bfn_mock_node_get_by_id);
   MOCK(get_or_state,
get_or_state_replacement);
-  MOCK(networkstatus_get_live_consensus,
-   bfn_mock_networkstatus_get_live_consensus);
+  MOCK(networkstatus_get_reasonably_live_consensus,
+   bfn_mock_networkstatus_get_reasonably_live_consensus);
   /* Return anything but NULL (it's interpreted as test fail) */
   return (void*)testcase;
 }



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


[tor-commits] [tor/master] Entry Nodes: Mark outdated dirservers in reasonably live consensuses

2018-12-01 Thread nickm
commit 657618ba9bd96830b0a283c28db203bf9fffb15d
Author: teor 
Date:   Wed Nov 21 19:51:34 2018 +1000

Entry Nodes: Mark outdated dirservers in reasonably live consensuses

Fixes bug 28569; bugfix on Tor 0.3.2.5-alpha.
---
 changes/bug28569 |  3 +++
 src/feature/nodelist/microdesc.c | 10 ++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/changes/bug28569 b/changes/bug28569
new file mode 100644
index 0..45a57a80a
--- /dev/null
+++ b/changes/bug28569
@@ -0,0 +1,3 @@
+  o Minor bugfixes (unit tests, directory clients):
+- Mark outdated dirservers when Tor only has a reasonably live consensus.
+  Fixes bug 28569; bugfix on 0.3.2.5-alpha.
diff --git a/src/feature/nodelist/microdesc.c b/src/feature/nodelist/microdesc.c
index 146c772da..3f5085412 100644
--- a/src/feature/nodelist/microdesc.c
+++ b/src/feature/nodelist/microdesc.c
@@ -108,10 +108,12 @@ microdesc_note_outdated_dirserver(const char 
*relay_digest)
 {
   char relay_hexdigest[HEX_DIGEST_LEN+1];
 
-  /* Don't register outdated dirservers if we don't have a live consensus,
-   * since we might be trying to fetch microdescriptors that are not even
-   * currently active. */
-  if (!networkstatus_get_live_consensus(approx_time())) {
+  /* If we have a reasonably live consensus, then most of our dirservers should
+   * still be caching all the microdescriptors in it. Reasonably live
+   * consensuses are up to a day old. But microdescriptors expire 7 days after
+   * the last consensus that referenced them. */
+  if (!networkstatus_get_reasonably_live_consensus(approx_time(),
+   FLAV_MICRODESC)) {
 return;
   }
 



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


[tor-commits] [tor/master] Entry Nodes: Test on reasonably live consensuses

2018-12-01 Thread nickm
commit 805f75182a87286a727df323be7c37add595bdff
Author: teor 
Date:   Thu Nov 22 17:47:12 2018 +1000

Entry Nodes: Test on reasonably live consensuses

As well as live consensuses.

Tests for 24661.
---
 src/test/test_entrynodes.c | 26 ++
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 1071b04ce..52b87a84a 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -137,6 +137,12 @@ big_fake_network_setup(const struct testcase_t *testcase)
* that we need for entrynodes.c. */
   const int N_NODES = 271;
 
+  const char *argument = testcase->setup_data;
+  int reasonably_live_consensus = 0;
+  if (argument) {
+reasonably_live_consensus = strstr(argument, "reasonably-live") != NULL;
+  }
+
   big_fake_net_nodes = smartlist_new();
   for (i = 0; i < N_NODES; ++i) {
 curve25519_secret_key_t curve25519_secret_key;
@@ -192,8 +198,16 @@ big_fake_network_setup(const struct testcase_t *testcase)
 
   dummy_state = tor_malloc_zero(sizeof(or_state_t));
   dummy_consensus = tor_malloc_zero(sizeof(networkstatus_t));
-  dummy_consensus->valid_after = approx_time() - 3600;
-  dummy_consensus->valid_until = approx_time() + 3600;
+  if (reasonably_live_consensus) {
+/* Make the dummy consensus valid from 4 hours ago, but expired an hour
+ * ago. */
+dummy_consensus->valid_after = approx_time() - 4*3600;
+dummy_consensus->valid_until = approx_time() - 3600;
+  } else {
+/* Make the dummy consensus valid for an hour either side of now. */
+dummy_consensus->valid_after = approx_time() - 3600;
+dummy_consensus->valid_until = approx_time() + 3600;
+  }
 
   MOCK(nodelist_get_list, bfn_mock_nodelist_get_list);
   MOCK(node_get_by_id, bfn_mock_node_get_by_id);
@@ -3020,10 +3034,14 @@ static const struct testcase_setup_t upgrade_circuits = 
{
 #define EN_TEST_FORK(name) EN_TEST_BASE(name, TT_FORK, NULL, NULL)
 
 #define BFN_TEST(name) \
-  EN_TEST_BASE(name, TT_FORK, _fake_network, NULL)
+  EN_TEST_BASE(name, TT_FORK, _fake_network, NULL), \
+  { #name "_reasonably_live", test_entry_guard_ ## name, TT_FORK, \
+_fake_network, (void*)("reasonably-live") }
 
 #define UPGRADE_TEST(name, arg) \
-  EN_TEST_BASE(name, TT_FORK, _circuits, arg)
+  EN_TEST_BASE(name, TT_FORK, _circuits, arg), \
+  { #name "_reasonably_live", test_entry_guard_ ## name, TT_FORK, \
+_circuits, (void*)(arg " reasonably-live") }
 
 struct testcase_t entrynodes_tests[] = {
   NO_PREFIX_TEST(node_preferred_orport),



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


[tor-commits] [tor/master] Entry Nodes: Use a reasonably live consensus to select guards

2018-12-01 Thread nickm
commit d1ac5613fc832f4b298fbc243a35660dbd0976e3
Author: teor 
Date:   Mon Nov 5 15:27:38 2018 +1000

Entry Nodes: Use a reasonably live consensus to select guards

Fixes bug 24661; bugfix on 0.3.0.1-alpha.
---
 changes/bug24661|  3 +++
 src/feature/client/entrynodes.c | 27 +--
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/changes/bug24661 b/changes/bug24661
new file mode 100644
index 0..a915a93e0
--- /dev/null
+++ b/changes/bug24661
@@ -0,0 +1,3 @@
+  o Minor bugfixes (client, guard selection):
+- When Tor's consensus has expired, but is still reasonably live, use it
+  to select guards. Fixes bug 24661; bugfix on 0.3.0.1-alpha.
diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c
index 20208ef61..e0fe1b9a5 100644
--- a/src/feature/client/entrynodes.c
+++ b/src/feature/client/entrynodes.c
@@ -287,7 +287,9 @@ create_initial_guard_context(void)
   guard_selection_type_t type = GS_TYPE_INFER;
   const char *name = choose_guard_selection(
  get_options(),
- networkstatus_get_live_consensus(approx_time()),
+ networkstatus_get_reasonably_live_consensus(
+approx_time(),
+usable_consensus_flavor()),
  NULL,
  );
   tor_assert(name); // "name" can only be NULL if we had an old name.
@@ -726,7 +728,9 @@ update_guard_selection_choice(const or_options_t *options)
   guard_selection_type_t type = GS_TYPE_INFER;
   const char *new_name = choose_guard_selection(
  options,
- networkstatus_get_live_consensus(approx_time()),
+ networkstatus_get_reasonably_live_consensus(
+approx_time(),
+usable_consensus_flavor()),
  curr_guard_context,
  );
   tor_assert(new_name);
@@ -1125,14 +1129,16 @@ select_and_add_guard_item_for_sample(guard_selection_t 
*gs,
  * or if we don't need a consensus because we're using bridges.)
  */
 static int
-live_consensus_is_missing(const guard_selection_t *gs)
+reasonably_live_consensus_is_missing(const guard_selection_t *gs)
 {
   tor_assert(gs);
   if (gs->type == GS_TYPE_BRIDGE) {
 /* We don't update bridges from the consensus; they aren't there. */
 return 0;
   }
-  return networkstatus_get_live_consensus(approx_time()) == NULL;
+  return networkstatus_get_reasonably_live_consensus(
+approx_time(),
+usable_consensus_flavor()) == NULL;
 }
 
 /**
@@ -1147,9 +1153,9 @@ entry_guards_expand_sample(guard_selection_t *gs)
   tor_assert(gs);
   const or_options_t *options = get_options();
 
-  if (live_consensus_is_missing(gs)) {
+  if (reasonably_live_consensus_is_missing(gs)) {
 log_info(LD_GUARD, "Not expanding the sample guard set; we have "
- "no live consensus.");
+ "no reasonably live consensus.");
 return NULL;
   }
 
@@ -1395,11 +1401,12 @@ sampled_guards_update_from_consensus(guard_selection_t 
*gs)
 {
   tor_assert(gs);
 
-  // It's important to use only a live consensus here; we don't want to
-  // make changes based on anything expired or old.
-  if (live_consensus_is_missing(gs)) {
+  // It's important to use a reasonably live consensus here; we want clients
+  // to bootstrap even if their clock is skewed by more than 2-3 hours.
+  // But we don't want to make changes based on anything that's really old.
+  if (reasonably_live_consensus_is_missing(gs)) {
 log_info(LD_GUARD, "Not updating the sample guard set; we have "
- "no live consensus.");
+ "no reasonably live consensus.");
 return;
   }
   log_info(LD_GUARD, "Updating sampled guard status based on received "



___
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-01 Thread nickm
commit 6267ea5fbe7c6f07f06a0877d61026b0840e7a39
Merge: 8954cbfcf 11a91ef72
Author: Nick Mathewson 
Date:   Sat Dec 1 11:20:10 2018 -0500

Merge branch 'maint-0.3.5' into release-0.3.5

 changes/ticket28229_diag |  3 +++
 src/test/test_rebind.py  | 16 
 2 files changed, 15 insertions(+), 4 deletions(-)

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


[tor-commits] [tor/release-0.3.5] 1 ms. resolution for Tor logs

2018-12-01 Thread nickm
commit 4c4ed413ee5d865e46a5659c4f6b5b88f12f37b7
Author: rl1987 
Date:   Tue Nov 13 11:15:40 2018 +0200

1 ms. resolution for Tor logs
---
 src/test/test_rebind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index dfd0ccbcb..cab6aafbb 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -81,6 +81,7 @@ tor_process = subprocess.Popen([tor_path,
'-ControlPort', 
'127.0.0.1:{}'.format(control_port),
'-SOCKSPort', '127.0.0.1:{}'.format(socks_port),
'-Log', 'debug stdout',
+   '-LogTimeGranularity', '1',
'-FetchServerDescriptors', '0'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)



___
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] Also log a Tor log entry when it has a substring we are waiting for

2018-12-01 Thread nickm
commit 945c4dfda014724375e499afef77a9abd1449631
Author: rl1987 
Date:   Tue Nov 13 11:38:51 2018 +0200

Also log a Tor log entry when it has a substring we are waiting for
---
 src/test/test_rebind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index cab6aafbb..2215b4225 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -30,6 +30,7 @@ def wait_for_log(s):
 l = tor_process.stdout.readline()
 l = l.decode('utf8')
 if s in l:
+logging.info('Tor logged: "{}"'.format(l.strip()))
 return
 logging.info('Tor logged: "{}", waiting for "{}"'.format(l.strip(), s))
 # readline() returns a blank string when there is no output



___
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 'bug28229_diag_035' into maint-0.3.5

2018-12-01 Thread nickm
commit 11a91ef728b18f86cee4a56b946d7c6f1f7958ba
Merge: e82023d2f 945c4dfda
Author: Nick Mathewson 
Date:   Sat Dec 1 11:20:04 2018 -0500

Merge branch 'bug28229_diag_035' into maint-0.3.5

 changes/ticket28229_diag |  3 +++
 src/test/test_rebind.py  | 16 
 2 files changed, 15 insertions(+), 4 deletions(-)



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


[tor-commits] [tor/master] Merge branch 'bug28229_diag_035' into maint-0.3.5

2018-12-01 Thread nickm
commit 11a91ef728b18f86cee4a56b946d7c6f1f7958ba
Merge: e82023d2f 945c4dfda
Author: Nick Mathewson 
Date:   Sat Dec 1 11:20:04 2018 -0500

Merge branch 'bug28229_diag_035' into maint-0.3.5

 changes/ticket28229_diag |  3 +++
 src/test/test_rebind.py  | 16 
 2 files changed, 15 insertions(+), 4 deletions(-)



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


[tor-commits] [tor/master] Log everything from tor down to debug loglevel

2018-12-01 Thread nickm
commit 0bb25931dc620fd4b96146d11144bee3754c077f
Author: rl1987 
Date:   Sun Nov 4 19:01:00 2018 +0200

Log everything from tor down to debug loglevel
---
 src/test/test_rebind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index 64eba14f0..dfd0ccbcb 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -80,6 +80,7 @@ tor_path = sys.argv[1]
 tor_process = subprocess.Popen([tor_path,
'-ControlPort', 
'127.0.0.1:{}'.format(control_port),
'-SOCKSPort', '127.0.0.1:{}'.format(socks_port),
+   '-Log', 'debug stdout',
'-FetchServerDescriptors', '0'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)



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


[tor-commits] [tor/master] Also log a Tor log entry when it has a substring we are waiting for

2018-12-01 Thread nickm
commit 945c4dfda014724375e499afef77a9abd1449631
Author: rl1987 
Date:   Tue Nov 13 11:38:51 2018 +0200

Also log a Tor log entry when it has a substring we are waiting for
---
 src/test/test_rebind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index cab6aafbb..2215b4225 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -30,6 +30,7 @@ def wait_for_log(s):
 l = tor_process.stdout.readline()
 l = l.decode('utf8')
 if s in l:
+logging.info('Tor logged: "{}"'.format(l.strip()))
 return
 logging.info('Tor logged: "{}", waiting for "{}"'.format(l.strip(), s))
 # readline() returns a blank string when there is no output



___
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 branch 'bug28229_diag_035' into maint-0.3.5

2018-12-01 Thread nickm
commit 11a91ef728b18f86cee4a56b946d7c6f1f7958ba
Merge: e82023d2f 945c4dfda
Author: Nick Mathewson 
Date:   Sat Dec 1 11:20:04 2018 -0500

Merge branch 'bug28229_diag_035' into maint-0.3.5

 changes/ticket28229_diag |  3 +++
 src/test/test_rebind.py  | 16 
 2 files changed, 15 insertions(+), 4 deletions(-)

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


[tor-commits] [tor/release-0.3.5] In test_rebind.py, log stuff with timestamps

2018-12-01 Thread nickm
commit 320f5f30b35695adf1cb1254f26af3b87ec4d2a3
Author: rl1987 
Date:   Sun Nov 4 18:09:31 2018 +0200

In test_rebind.py, log stuff with timestamps
---
 src/test/test_rebind.py | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index c63341a68..64eba14f0 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -1,6 +1,7 @@
 from __future__ import print_function
 
 import errno
+import logging
 import os
 import random
 import socket
@@ -13,7 +14,7 @@ LOG_WAIT = 0.1
 LOG_CHECK_LIMIT = LOG_TIMEOUT / LOG_WAIT
 
 def fail(msg):
-print('FAIL')
+logging.error('FAIL')
 sys.exit(msg)
 
 def try_connecting_to_socksport():
@@ -30,7 +31,7 @@ def wait_for_log(s):
 l = l.decode('utf8')
 if s in l:
 return
-print('Tor logged: "{}", waiting for "{}"'.format(l.strip(), s))
+logging.info('Tor logged: "{}", waiting for "{}"'.format(l.strip(), s))
 # readline() returns a blank string when there is no output
 # avoid busy-waiting
 if len(s) == 0:
@@ -55,6 +56,10 @@ def pick_random_port():
 
 return port
 
+logging.basicConfig(level=logging.DEBUG,
+format='%(asctime)s.%(msecs)03d %(message)s',
+datefmt='%Y-%m-%d %H:%M:%S')
+
 if sys.hexversion < 0x0207:
 fail("ERROR: unsupported Python version (should be >= 2.7)")
 
@@ -108,13 +113,13 @@ try_connecting_to_socksport()
 control_socket.sendall('SIGNAL HALT\r\n'.encode('utf8'))
 
 wait_for_log('exiting cleanly')
-print('OK')
+logging.info('OK')
 
 try:
 tor_process.terminate()
 except OSError as e:
 if e.errno == errno.ESRCH: # errno 3: No such process
 # assume tor has already exited due to SIGNAL HALT
-print("Tor has already exited")
+logging.warn("Tor has already exited")
 else:
 raise



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


[tor-commits] [tor/master] 1 ms. resolution for Tor logs

2018-12-01 Thread nickm
commit 4c4ed413ee5d865e46a5659c4f6b5b88f12f37b7
Author: rl1987 
Date:   Tue Nov 13 11:15:40 2018 +0200

1 ms. resolution for Tor logs
---
 src/test/test_rebind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index dfd0ccbcb..cab6aafbb 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -81,6 +81,7 @@ tor_process = subprocess.Popen([tor_path,
'-ControlPort', 
'127.0.0.1:{}'.format(control_port),
'-SOCKSPort', '127.0.0.1:{}'.format(socks_port),
'-Log', 'debug stdout',
+   '-LogTimeGranularity', '1',
'-FetchServerDescriptors', '0'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)



___
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] Log everything from tor down to debug loglevel

2018-12-01 Thread nickm
commit 0bb25931dc620fd4b96146d11144bee3754c077f
Author: rl1987 
Date:   Sun Nov 4 19:01:00 2018 +0200

Log everything from tor down to debug loglevel
---
 src/test/test_rebind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index 64eba14f0..dfd0ccbcb 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -80,6 +80,7 @@ tor_path = sys.argv[1]
 tor_process = subprocess.Popen([tor_path,
'-ControlPort', 
'127.0.0.1:{}'.format(control_port),
'-SOCKSPort', '127.0.0.1:{}'.format(socks_port),
+   '-Log', 'debug stdout',
'-FetchServerDescriptors', '0'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)



___
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-01 Thread nickm
commit af9dc12fabb664ea100ae12f9c9493ed403cb5c2
Merge: cf3f7753c 11a91ef72
Author: Nick Mathewson 
Date:   Sat Dec 1 11:20:10 2018 -0500

Merge branch 'maint-0.3.5'

 changes/ticket28229_diag |  3 +++
 src/test/test_rebind.py  | 16 
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --cc src/test/test_rebind.py
index 2f366b271,2215b4225..6f759b717
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@@ -67,21 -73,16 +73,23 @@@ socks_port = pick_random_port(
  assert control_port != 0
  assert socks_port != 0
  
 +if len(sys.argv) < 3:
 + fail('Usage: %s  ' % sys.argv[0])
 +
  if not os.path.exists(sys.argv[1]):
  fail('ERROR: cannot find tor at %s' % sys.argv[1])
 +if not os.path.exists(sys.argv[2]):
 +fail('ERROR: cannot find datadir at %s' % sys.argv[2])
  
  tor_path = sys.argv[1]
 +data_dir = sys.argv[2]
  
  tor_process = subprocess.Popen([tor_path,
 +   '-DataDirectory', data_dir,
 '-ControlPort', 
'127.0.0.1:{}'.format(control_port),
 '-SOCKSPort', 
'127.0.0.1:{}'.format(socks_port),
+'-Log', 'debug stdout',
+'-LogTimeGranularity', '1',
 '-FetchServerDescriptors', '0'],
 stdout=subprocess.PIPE,
 stderr=subprocess.PIPE)

___
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-01 Thread nickm
commit 9bbf7ec3031a2597944e2df59b634ff77a36a3f8
Author: rl1987 
Date:   Sun Nov 4 19:10:40 2018 +0200

Add changes file
---
 changes/ticket28229_diag | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/changes/ticket28229_diag b/changes/ticket28229_diag
new file mode 100644
index 0..cd02b81fa
--- /dev/null
+++ b/changes/ticket28229_diag
@@ -0,0 +1,3 @@
+  o Testing:
+- Increase logging and tag all log entries with timestamps
+  in test_rebind.py. Provides diagnostics for issue 28229.



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


[tor-commits] [tor/master] In test_rebind.py, log stuff with timestamps

2018-12-01 Thread nickm
commit 320f5f30b35695adf1cb1254f26af3b87ec4d2a3
Author: rl1987 
Date:   Sun Nov 4 18:09:31 2018 +0200

In test_rebind.py, log stuff with timestamps
---
 src/test/test_rebind.py | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index c63341a68..64eba14f0 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -1,6 +1,7 @@
 from __future__ import print_function
 
 import errno
+import logging
 import os
 import random
 import socket
@@ -13,7 +14,7 @@ LOG_WAIT = 0.1
 LOG_CHECK_LIMIT = LOG_TIMEOUT / LOG_WAIT
 
 def fail(msg):
-print('FAIL')
+logging.error('FAIL')
 sys.exit(msg)
 
 def try_connecting_to_socksport():
@@ -30,7 +31,7 @@ def wait_for_log(s):
 l = l.decode('utf8')
 if s in l:
 return
-print('Tor logged: "{}", waiting for "{}"'.format(l.strip(), s))
+logging.info('Tor logged: "{}", waiting for "{}"'.format(l.strip(), s))
 # readline() returns a blank string when there is no output
 # avoid busy-waiting
 if len(s) == 0:
@@ -55,6 +56,10 @@ def pick_random_port():
 
 return port
 
+logging.basicConfig(level=logging.DEBUG,
+format='%(asctime)s.%(msecs)03d %(message)s',
+datefmt='%Y-%m-%d %H:%M:%S')
+
 if sys.hexversion < 0x0207:
 fail("ERROR: unsupported Python version (should be >= 2.7)")
 
@@ -108,13 +113,13 @@ try_connecting_to_socksport()
 control_socket.sendall('SIGNAL HALT\r\n'.encode('utf8'))
 
 wait_for_log('exiting cleanly')
-print('OK')
+logging.info('OK')
 
 try:
 tor_process.terminate()
 except OSError as e:
 if e.errno == errno.ESRCH: # errno 3: No such process
 # assume tor has already exited due to SIGNAL HALT
-print("Tor has already exited")
+logging.warn("Tor has already exited")
 else:
 raise



___
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] Log everything from tor down to debug loglevel

2018-12-01 Thread nickm
commit 0bb25931dc620fd4b96146d11144bee3754c077f
Author: rl1987 
Date:   Sun Nov 4 19:01:00 2018 +0200

Log everything from tor down to debug loglevel
---
 src/test/test_rebind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index 64eba14f0..dfd0ccbcb 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -80,6 +80,7 @@ tor_path = sys.argv[1]
 tor_process = subprocess.Popen([tor_path,
'-ControlPort', 
'127.0.0.1:{}'.format(control_port),
'-SOCKSPort', '127.0.0.1:{}'.format(socks_port),
+   '-Log', 'debug stdout',
'-FetchServerDescriptors', '0'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)



___
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] Also log a Tor log entry when it has a substring we are waiting for

2018-12-01 Thread nickm
commit 945c4dfda014724375e499afef77a9abd1449631
Author: rl1987 
Date:   Tue Nov 13 11:38:51 2018 +0200

Also log a Tor log entry when it has a substring we are waiting for
---
 src/test/test_rebind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index cab6aafbb..2215b4225 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -30,6 +30,7 @@ def wait_for_log(s):
 l = tor_process.stdout.readline()
 l = l.decode('utf8')
 if s in l:
+logging.info('Tor logged: "{}"'.format(l.strip()))
 return
 logging.info('Tor logged: "{}", waiting for "{}"'.format(l.strip(), s))
 # readline() returns a blank string when there is no output



___
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] In test_rebind.py, log stuff with timestamps

2018-12-01 Thread nickm
commit 320f5f30b35695adf1cb1254f26af3b87ec4d2a3
Author: rl1987 
Date:   Sun Nov 4 18:09:31 2018 +0200

In test_rebind.py, log stuff with timestamps
---
 src/test/test_rebind.py | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index c63341a68..64eba14f0 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -1,6 +1,7 @@
 from __future__ import print_function
 
 import errno
+import logging
 import os
 import random
 import socket
@@ -13,7 +14,7 @@ LOG_WAIT = 0.1
 LOG_CHECK_LIMIT = LOG_TIMEOUT / LOG_WAIT
 
 def fail(msg):
-print('FAIL')
+logging.error('FAIL')
 sys.exit(msg)
 
 def try_connecting_to_socksport():
@@ -30,7 +31,7 @@ def wait_for_log(s):
 l = l.decode('utf8')
 if s in l:
 return
-print('Tor logged: "{}", waiting for "{}"'.format(l.strip(), s))
+logging.info('Tor logged: "{}", waiting for "{}"'.format(l.strip(), s))
 # readline() returns a blank string when there is no output
 # avoid busy-waiting
 if len(s) == 0:
@@ -55,6 +56,10 @@ def pick_random_port():
 
 return port
 
+logging.basicConfig(level=logging.DEBUG,
+format='%(asctime)s.%(msecs)03d %(message)s',
+datefmt='%Y-%m-%d %H:%M:%S')
+
 if sys.hexversion < 0x0207:
 fail("ERROR: unsupported Python version (should be >= 2.7)")
 
@@ -108,13 +113,13 @@ try_connecting_to_socksport()
 control_socket.sendall('SIGNAL HALT\r\n'.encode('utf8'))
 
 wait_for_log('exiting cleanly')
-print('OK')
+logging.info('OK')
 
 try:
 tor_process.terminate()
 except OSError as e:
 if e.errno == errno.ESRCH: # errno 3: No such process
 # assume tor has already exited due to SIGNAL HALT
-print("Tor has already exited")
+logging.warn("Tor has already exited")
 else:
 raise



___
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] 1 ms. resolution for Tor logs

2018-12-01 Thread nickm
commit 4c4ed413ee5d865e46a5659c4f6b5b88f12f37b7
Author: rl1987 
Date:   Tue Nov 13 11:15:40 2018 +0200

1 ms. resolution for Tor logs
---
 src/test/test_rebind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py
index dfd0ccbcb..cab6aafbb 100644
--- a/src/test/test_rebind.py
+++ b/src/test/test_rebind.py
@@ -81,6 +81,7 @@ tor_process = subprocess.Popen([tor_path,
'-ControlPort', 
'127.0.0.1:{}'.format(control_port),
'-SOCKSPort', '127.0.0.1:{}'.format(socks_port),
'-Log', 'debug stdout',
+   '-LogTimeGranularity', '1',
'-FetchServerDescriptors', '0'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)



___
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] Add changes file

2018-12-01 Thread nickm
commit 9bbf7ec3031a2597944e2df59b634ff77a36a3f8
Author: rl1987 
Date:   Sun Nov 4 19:10:40 2018 +0200

Add changes file
---
 changes/ticket28229_diag | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/changes/ticket28229_diag b/changes/ticket28229_diag
new file mode 100644
index 0..cd02b81fa
--- /dev/null
+++ b/changes/ticket28229_diag
@@ -0,0 +1,3 @@
+  o Testing:
+- Increase logging and tag all log entries with timestamps
+  in test_rebind.py. Provides diagnostics for issue 28229.



___
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.4' into maint-0.3.5

2018-12-01 Thread nickm
commit e82023d2f7b75f9ff8c4bf1ddb3c4e251142d3ab
Merge: 72c1303ce e3a19b1c7
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.4' into maint-0.3.5

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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.3' into maint-0.3.4

2018-12-01 Thread nickm
commit e3a19b1c788ba303a41cab0dcba945af84041764
Merge: 36c323553 ffc7b81b5
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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.4] Test: Fix memory leaks and missing unmocks in entry guard tests

2018-12-01 Thread nickm
commit ffc7b81b5dd909f0c4325e7a5b893504f76b9c77
Author: teor 
Date:   Wed Nov 21 15:56:30 2018 +1000

Test: Fix memory leaks and missing unmocks in entry guard tests

test_entry_guard_outdated_dirserver_exclusion leaks memory, and is
missing some unmocks.

Fixes 28554; bugfix on 0.3.0.1-alpha.
---
 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/changes/bug28554 b/changes/bug28554
new file mode 100644
index 0..9a0b28140
--- /dev/null
+++ b/changes/bug28554
@@ -0,0 +1,3 @@
+  o Minor bugfixes (unit tests, guard selection):
+- Stop leaking memory in an entry guard unit test. Fixes bug 28554;
+  bugfix on 0.3.0.1-alpha.
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 505e09e36..3b54ffa2e 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -2779,13 +2779,16 @@ test_entry_guard_outdated_dirserver_exclusion(void *arg)
   digests, 3, 7, 0);
 
 /* ... and check that because we failed to fetch microdescs from all our
- * primaries, we didnt end up selecting a primary for fetching dir info */
+ * primaries, we didn't end up selecting a primary for fetching dir info */
 expect_log_msg_containing("No primary or confirmed guards available.");
 teardown_capture_of_logs();
   }
 
  done:
+  UNMOCK(networkstatus_get_latest_consensus_by_flavor);
+  UNMOCK(directory_initiate_request);
   smartlist_free(digests);
+  tor_free(mock_ns_val);
   tor_free(args);
   if (conn) {
 tor_free(conn->requested_resource);



___
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.3' into maint-0.3.4

2018-12-01 Thread nickm
commit e3a19b1c788ba303a41cab0dcba945af84041764
Merge: 36c323553 ffc7b81b5
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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] Test: Fix memory leaks and missing unmocks in entry guard tests

2018-12-01 Thread nickm
commit ffc7b81b5dd909f0c4325e7a5b893504f76b9c77
Author: teor 
Date:   Wed Nov 21 15:56:30 2018 +1000

Test: Fix memory leaks and missing unmocks in entry guard tests

test_entry_guard_outdated_dirserver_exclusion leaks memory, and is
missing some unmocks.

Fixes 28554; bugfix on 0.3.0.1-alpha.
---
 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/changes/bug28554 b/changes/bug28554
new file mode 100644
index 0..9a0b28140
--- /dev/null
+++ b/changes/bug28554
@@ -0,0 +1,3 @@
+  o Minor bugfixes (unit tests, guard selection):
+- Stop leaking memory in an entry guard unit test. Fixes bug 28554;
+  bugfix on 0.3.0.1-alpha.
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 505e09e36..3b54ffa2e 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -2779,13 +2779,16 @@ test_entry_guard_outdated_dirserver_exclusion(void *arg)
   digests, 3, 7, 0);
 
 /* ... and check that because we failed to fetch microdescs from all our
- * primaries, we didnt end up selecting a primary for fetching dir info */
+ * primaries, we didn't end up selecting a primary for fetching dir info */
 expect_log_msg_containing("No primary or confirmed guards available.");
 teardown_capture_of_logs();
   }
 
  done:
+  UNMOCK(networkstatus_get_latest_consensus_by_flavor);
+  UNMOCK(directory_initiate_request);
   smartlist_free(digests);
+  tor_free(mock_ns_val);
   tor_free(args);
   if (conn) {
 tor_free(conn->requested_resource);



___
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-01 Thread nickm
commit cf3f7753c3f85cdb77b5602fbc29970177defa01
Merge: 9c2b114b2 e82023d2f
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.5'

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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] Merge branch 'maint-0.3.4' into maint-0.3.5

2018-12-01 Thread nickm
commit e82023d2f7b75f9ff8c4bf1ddb3c4e251142d3ab
Merge: 72c1303ce e3a19b1c7
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.4' into maint-0.3.5

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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.4] Merge branch 'maint-0.3.3' into maint-0.3.4

2018-12-01 Thread nickm
commit e3a19b1c788ba303a41cab0dcba945af84041764
Merge: 36c323553 ffc7b81b5
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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.4] Merge branch 'maint-0.3.4' into release-0.3.4

2018-12-01 Thread nickm
commit 92fb9f9342923891ce34eff0448406842e232532
Merge: 84b219757 e3a19b1c7
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.4' into release-0.3.4

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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.3] Test: Fix memory leaks and missing unmocks in entry guard tests

2018-12-01 Thread nickm
commit ffc7b81b5dd909f0c4325e7a5b893504f76b9c77
Author: teor 
Date:   Wed Nov 21 15:56:30 2018 +1000

Test: Fix memory leaks and missing unmocks in entry guard tests

test_entry_guard_outdated_dirserver_exclusion leaks memory, and is
missing some unmocks.

Fixes 28554; bugfix on 0.3.0.1-alpha.
---
 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/changes/bug28554 b/changes/bug28554
new file mode 100644
index 0..9a0b28140
--- /dev/null
+++ b/changes/bug28554
@@ -0,0 +1,3 @@
+  o Minor bugfixes (unit tests, guard selection):
+- Stop leaking memory in an entry guard unit test. Fixes bug 28554;
+  bugfix on 0.3.0.1-alpha.
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 505e09e36..3b54ffa2e 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -2779,13 +2779,16 @@ test_entry_guard_outdated_dirserver_exclusion(void *arg)
   digests, 3, 7, 0);
 
 /* ... and check that because we failed to fetch microdescs from all our
- * primaries, we didnt end up selecting a primary for fetching dir info */
+ * primaries, we didn't end up selecting a primary for fetching dir info */
 expect_log_msg_containing("No primary or confirmed guards available.");
 teardown_capture_of_logs();
   }
 
  done:
+  UNMOCK(networkstatus_get_latest_consensus_by_flavor);
+  UNMOCK(directory_initiate_request);
   smartlist_free(digests);
+  tor_free(mock_ns_val);
   tor_free(args);
   if (conn) {
 tor_free(conn->requested_resource);



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

2018-12-01 Thread nickm
commit 8c1eb28d610706d15e97531d778e78173d6701b1
Merge: b3235e21a ffc7b81b5
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.3' into release-0.3.3

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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.4' into maint-0.3.5

2018-12-01 Thread nickm
commit e82023d2f7b75f9ff8c4bf1ddb3c4e251142d3ab
Merge: 72c1303ce e3a19b1c7
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.4' into maint-0.3.5

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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-01 Thread nickm
commit 8954cbfcf868ca1246b61ed5ac9ffaf37052cc77
Merge: 4b37c2d1d e82023d2f
Author: Nick Mathewson 
Date:   Sat Dec 1 11:15:09 2018 -0500

Merge branch 'maint-0.3.5' into release-0.3.5

 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 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.4] Test: Fix memory leaks and missing unmocks in entry guard tests

2018-12-01 Thread nickm
commit ffc7b81b5dd909f0c4325e7a5b893504f76b9c77
Author: teor 
Date:   Wed Nov 21 15:56:30 2018 +1000

Test: Fix memory leaks and missing unmocks in entry guard tests

test_entry_guard_outdated_dirserver_exclusion leaks memory, and is
missing some unmocks.

Fixes 28554; bugfix on 0.3.0.1-alpha.
---
 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/changes/bug28554 b/changes/bug28554
new file mode 100644
index 0..9a0b28140
--- /dev/null
+++ b/changes/bug28554
@@ -0,0 +1,3 @@
+  o Minor bugfixes (unit tests, guard selection):
+- Stop leaking memory in an entry guard unit test. Fixes bug 28554;
+  bugfix on 0.3.0.1-alpha.
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 505e09e36..3b54ffa2e 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -2779,13 +2779,16 @@ test_entry_guard_outdated_dirserver_exclusion(void *arg)
   digests, 3, 7, 0);
 
 /* ... and check that because we failed to fetch microdescs from all our
- * primaries, we didnt end up selecting a primary for fetching dir info */
+ * primaries, we didn't end up selecting a primary for fetching dir info */
 expect_log_msg_containing("No primary or confirmed guards available.");
 teardown_capture_of_logs();
   }
 
  done:
+  UNMOCK(networkstatus_get_latest_consensus_by_flavor);
+  UNMOCK(directory_initiate_request);
   smartlist_free(digests);
+  tor_free(mock_ns_val);
   tor_free(args);
   if (conn) {
 tor_free(conn->requested_resource);



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


[tor-commits] [tor/master] Test: Fix memory leaks and missing unmocks in entry guard tests

2018-12-01 Thread nickm
commit ffc7b81b5dd909f0c4325e7a5b893504f76b9c77
Author: teor 
Date:   Wed Nov 21 15:56:30 2018 +1000

Test: Fix memory leaks and missing unmocks in entry guard tests

test_entry_guard_outdated_dirserver_exclusion leaks memory, and is
missing some unmocks.

Fixes 28554; bugfix on 0.3.0.1-alpha.
---
 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/changes/bug28554 b/changes/bug28554
new file mode 100644
index 0..9a0b28140
--- /dev/null
+++ b/changes/bug28554
@@ -0,0 +1,3 @@
+  o Minor bugfixes (unit tests, guard selection):
+- Stop leaking memory in an entry guard unit test. Fixes bug 28554;
+  bugfix on 0.3.0.1-alpha.
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 505e09e36..3b54ffa2e 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -2779,13 +2779,16 @@ test_entry_guard_outdated_dirserver_exclusion(void *arg)
   digests, 3, 7, 0);
 
 /* ... and check that because we failed to fetch microdescs from all our
- * primaries, we didnt end up selecting a primary for fetching dir info */
+ * primaries, we didn't end up selecting a primary for fetching dir info */
 expect_log_msg_containing("No primary or confirmed guards available.");
 teardown_capture_of_logs();
   }
 
  done:
+  UNMOCK(networkstatus_get_latest_consensus_by_flavor);
+  UNMOCK(directory_initiate_request);
   smartlist_free(digests);
+  tor_free(mock_ns_val);
   tor_free(args);
   if (conn) {
 tor_free(conn->requested_resource);



___
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.3] Test: Fix memory leaks and missing unmocks in entry guard tests

2018-12-01 Thread nickm
commit ffc7b81b5dd909f0c4325e7a5b893504f76b9c77
Author: teor 
Date:   Wed Nov 21 15:56:30 2018 +1000

Test: Fix memory leaks and missing unmocks in entry guard tests

test_entry_guard_outdated_dirserver_exclusion leaks memory, and is
missing some unmocks.

Fixes 28554; bugfix on 0.3.0.1-alpha.
---
 changes/bug28554   | 3 +++
 src/test/test_entrynodes.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/changes/bug28554 b/changes/bug28554
new file mode 100644
index 0..9a0b28140
--- /dev/null
+++ b/changes/bug28554
@@ -0,0 +1,3 @@
+  o Minor bugfixes (unit tests, guard selection):
+- Stop leaking memory in an entry guard unit test. Fixes bug 28554;
+  bugfix on 0.3.0.1-alpha.
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 505e09e36..3b54ffa2e 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -2779,13 +2779,16 @@ test_entry_guard_outdated_dirserver_exclusion(void *arg)
   digests, 3, 7, 0);
 
 /* ... and check that because we failed to fetch microdescs from all our
- * primaries, we didnt end up selecting a primary for fetching dir info */
+ * primaries, we didn't end up selecting a primary for fetching dir info */
 expect_log_msg_containing("No primary or confirmed guards available.");
 teardown_capture_of_logs();
   }
 
  done:
+  UNMOCK(networkstatus_get_latest_consensus_by_flavor);
+  UNMOCK(directory_initiate_request);
   smartlist_free(digests);
+  tor_free(mock_ns_val);
   tor_free(args);
   if (conn) {
 tor_free(conn->requested_resource);

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


  1   2   >