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

2018-11-15 Thread translation
commit c8957bdb362420f86efd23750ce8bba43f14f0cb
Author: Translation commit bot 
Date:   Fri Nov 16 06:47:05 2018 +

Update translations for tba-android_stringsdtd
---
 ta/android_strings.dtd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ta/android_strings.dtd b/ta/android_strings.dtd
index 9a8aee420..ef6022cc0 100644
--- a/ta/android_strings.dtd
+++ b/ta/android_strings.dtd
@@ -435,7 +435,7 @@
  actual notification that an update is available. -->
 
 
-
+
 
 
 

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


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

2018-11-15 Thread translation
commit 95dc6fa8ceabae54c37608e253dc642558237a45
Author: Translation commit bot 
Date:   Fri Nov 16 01:45:12 2018 +

Update translations for abouttor-homepage_completed
---
 mk/aboutTor.dtd | 61 +++--
 1 file changed, 29 insertions(+), 32 deletions(-)

diff --git a/mk/aboutTor.dtd b/mk/aboutTor.dtd
index b8145af95..ae02a9d84 100644
--- a/mk/aboutTor.dtd
+++ b/mk/aboutTor.dtd
@@ -1,45 +1,42 @@
 
 
 
 
-
-
-
-
-
-
-
-
-
+
+
 
 
 
-
+
 https://duckduckgo.com;>
 
-
-
-
-
-
-
-
-https://www.torproject.org/download/download.html.en#warning;>
+
+
+
 
-
-
-
-
-https://www.torproject.org/docs/tor-doc-relay.html.en;>
-
-https://www.torproject.org/getinvolved/volunteer.html.en;>
-
-https://www.torproject.org/donate/donate.html.en;>
-
-
-
-https://www.torproject.org/about/overview.html.en;>
+
+
+
+
+https://www.torproject.org/getinvolved/volunteer.html.en;>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

___
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-11-15 Thread translation
commit 58336d8e19130766bd29b92e9712721f70cda3b7
Author: Translation commit bot 
Date:   Fri Nov 16 01:45:28 2018 +

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

diff --git a/locale/mk/LC_MESSAGES/messages.po 
b/locale/mk/LC_MESSAGES/messages.po
index 194624c01..86e0f8e7f 100644
--- a/locale/mk/LC_MESSAGES/messages.po
+++ b/locale/mk/LC_MESSAGES/messages.po
@@ -1,12 +1,12 @@
 # Translators:
 # Dimitar Poposki , 2018
-# Zarko Gjurov , 2018
 # erinm, 2018
 # dejanb , 2018
+# Zarko Gjurov , 2018
 # 
 msgid ""
 msgstr ""
-"Last-Translator: dejanb , 2018\n"
+"Last-Translator: Zarko Gjurov , 2018\n"
 "Language-Team: Macedonian (https://www.transifex.com/otf/teams/1519/mk/)\n"
 "Language: mk\n"
 "Plural-Forms: nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;\n"
@@ -190,7 +190,7 @@ msgstr ""
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:71
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:621
 msgid "Tor: Strength in Numbers"
-msgstr ""
+msgstr "Tor: Сила во бројки"
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:52
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:75
@@ -200,7 +200,7 @@ msgstr ""
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:54
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:77
 msgid "Anonymity loves company."
-msgstr ""
+msgstr "Анонимноста сака друштво."
 
 #: 
tmp/cache_locale/c7/c763c19bb6abb9330294c550c8241bb3874e3b4e17fb6e7b15db26c60df8d5fe.php:63
 msgid "summary_large_image"
@@ -566,6 +566,11 @@ msgid ""
 " and privacy technologies, supporting their unrestricted availability and "
 "use, and furthering their scientific and popular understanding."
 msgstr ""
+"Tor Project е US 501(c)(3) не-профитна организација 
која ги унапредува "
+"човековите права и слободи со креирање и 
имплементирање на слободни и "
+"отворен-код технологии за анонимност и 
приватност, подржувајќи ги нивната "
+"неограничена достапност и употреба, како 
и нивното понатамошно научно и "
+"популарно разбирање."
 
 #: 
tmp/cache_locale/2d/2d5f07aeb16acd7bb0a8dd355b13f59678a1f0ba6ea2b3d9dec8d2b5dcfbfde5.php:31
 msgid "Subscribe to Our Newsletter"

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


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

2018-11-15 Thread translation
commit dff115eb46e4bda9da5c02b05f1332e2977137d2
Author: Translation commit bot 
Date:   Fri Nov 16 01:45:04 2018 +

Update translations for abouttor-homepage
---
 mk/aboutTor.dtd | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/mk/aboutTor.dtd b/mk/aboutTor.dtd
index fc3a35dd2..ae02a9d84 100644
--- a/mk/aboutTor.dtd
+++ b/mk/aboutTor.dtd
@@ -6,37 +6,37 @@
 
 
 
-
-
+
+
 
 
 
-
+
 https://duckduckgo.com;>
 
 
-
+
 
 
-
+
 
-
-
+
+
 https://www.torproject.org/getinvolved/volunteer.html.en;>
 
-
-
+
+
 
-
+
 
-
-
-
-
-
-
+
+
+
+
+
+
 
-
+
 
-
-
+
+

___
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-11-15 Thread translation
commit ad4acc92d3848beb0d86283f9916135420f51123
Author: Translation commit bot 
Date:   Fri Nov 16 00:16:09 2018 +

Update translations for tails-misc
---
 hr_HR.po | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hr_HR.po b/hr_HR.po
index ade084d1e..296aa03e5 100644
--- a/hr_HR.po
+++ b/hr_HR.po
@@ -6,6 +6,7 @@
 # Ana B, 2014
 # Miskha , 2014
 # Igor , 2016-2017
+# Karlo Prikratki , 2018
 # Igor , 2015
 # Neven Lovrić , 2014
 msgid ""
@@ -13,7 +14,7 @@ msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-10-31 16:04+0100\n"
-"PO-Revision-Date: 2018-11-14 20:02+\n"
+"PO-Revision-Date: 2018-11-16 00:09+\n"
 "Last-Translator: Karlo Prikratki \n"
 "Language-Team: Croatian (Croatia) 
(http://www.transifex.com/otf/torproject/language/hr_HR/)\n"
 "MIME-Version: 1.0\n"
@@ -51,13 +52,13 @@ msgstr "Pomozite nam da rješimo Vaš 
problem!\nPročitajte ___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


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

2018-11-15 Thread translation
commit 7a9c30070248a5c44aa10eac937278b00f0ad679
Author: Translation commit bot 
Date:   Thu Nov 15 23:47:54 2018 +

Update translations for torbirdy_completed
---
 mk/torbirdy.dtd| 66 +-
 mk/torbirdy.properties | 15 
 2 files changed, 48 insertions(+), 33 deletions(-)

diff --git a/mk/torbirdy.dtd b/mk/torbirdy.dtd
index 4d108a15a..92b659e5e 100644
--- a/mk/torbirdy.dtd
+++ b/mk/torbirdy.dtd
@@ -1,50 +1,52 @@
 
-
+
 
-
-
+
+
 
 
-
+
 
 
-
-
+
+
 
 
-
+
 
-
-
-
+
+
+
 
 
 
-
-
-
-
-
-
+
+
+
+
+
+
 
-
-
-
+
+
+
 
 
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
 
-
-
-
+
+
+
 
-
+
 
 
 
@@ -53,6 +55,4 @@
 
 
 
-
-
-
+
diff --git a/mk/torbirdy.properties b/mk/torbirdy.properties
new file mode 100644
index 0..d8c3be960
--- /dev/null
+++ b/mk/torbirdy.properties
@@ -0,0 +1,15 @@
+torbirdy.name=TorBirdy
+
+torbirdy.enabled.tor=TorBirdy овозможен: Tor
+torbirdy.enabled.jondo=TorBirdy овозможен: JonDo
+torbirdy.enabled.custom=TorBirdy овозможен: Прилагодено 
прокси
+torbirdy.enabled.torification=TorBirdy овозможен: 
Транспарентна Торификација
+torbirdy.enabled.whonix=TorBirdy овозможен: Whonix
+torbirdy.disabled=TorBirdy: оневозможен!
+torbirdy.enabled=TorBirdy: овозможен
+
+torbirdy.email.prompt=TorBirdy ги оневозможува 
авто-поставките на Thunderbird волшебникот за да 
ја заштити вашата 
анонимност.\n\nПрепорачани безбедносни 
поставки за %S се поставени.\n\nСега може 
рачно да ги конфигурирате другите поставки 
на сметката.
+
+torbirdy.email.advanced=Ве молиме забележете дека 
менувањето на напредните поставки за TorBirdy 
НЕ се препорачани.\n\nПродолжете само 
доколку сте сигурни што правите.
+torbirdy.email.advanced.nextwarning=Прикажи го ова 
предупредување нареден пат
+torbirdy.email.advanced.title=TorBirdy Напредни поставки

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


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

2018-11-15 Thread translation
commit b8a2f209eb3ebc7735359e48a5be1aeefdb7c48b
Author: Translation commit bot 
Date:   Thu Nov 15 23:47:48 2018 +

Update translations for torbirdy
---
 mk/torbirdy.dtd| 64 +-
 mk/torbirdy.properties | 22 -
 2 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/mk/torbirdy.dtd b/mk/torbirdy.dtd
index fdf70cbf8..92b659e5e 100644
--- a/mk/torbirdy.dtd
+++ b/mk/torbirdy.dtd
@@ -1,52 +1,52 @@
 
-
+
 
-
-
+
+
 
 
-
+
 
 
-
-
+
+
 
 
-
+
 
-
-
-
+
+
+
 
 
 
-
-
-
-
-
-
+
+
+
+
+
+
 
-
-
-
+
+
+
 
 
-
-
-
-
-
-
-
+
+
+
+
+
+
+
 
-
+
 
-
-
-
+
+
+
 
-
+
 
 
 
@@ -55,4 +55,4 @@
 
 
 
-
+
diff --git a/mk/torbirdy.properties b/mk/torbirdy.properties
index 0bc5db689..d8c3be960 100644
--- a/mk/torbirdy.properties
+++ b/mk/torbirdy.properties
@@ -1,15 +1,15 @@
 torbirdy.name=TorBirdy
 
-torbirdy.enabled.tor=TorBirdy Enabled:Tor
-torbirdy.enabled.jondo=TorBirdy Enabled:JonDo
-torbirdy.enabled.custom=TorBirdy Enabled:Custom Proxy
-torbirdy.enabled.torification=TorBirdy Enabled:Transparent Torification
-torbirdy.enabled.whonix=TorBirdy Enabled:Whonix
-torbirdy.disabled=TorBirdy:Disabled!
-torbirdy.enabled=TorBirdy:Enabled
+torbirdy.enabled.tor=TorBirdy овозможен: Tor
+torbirdy.enabled.jondo=TorBirdy овозможен: JonDo
+torbirdy.enabled.custom=TorBirdy овозможен: Прилагодено 
прокси
+torbirdy.enabled.torification=TorBirdy овозможен: 
Транспарентна Торификација
+torbirdy.enabled.whonix=TorBirdy овозможен: Whonix
+torbirdy.disabled=TorBirdy: оневозможен!
+torbirdy.enabled=TorBirdy: овозможен
 
-torbirdy.email.prompt=TorBirdy has disabled Thunderbird's auto-configuration 
wizard to protect your anonymity.\n\nThe recommended security settings for %S 
have been set.\n\nYou can now configure the other account settings manually.
+torbirdy.email.prompt=TorBirdy ги оневозможува 
авто-поставките на Thunderbird волшебникот за да 
ја заштити вашата 
анонимност.\n\nПрепорачани безбедносни 
поставки за %S се поставени.\n\nСега може 
рачно да ги конфигурирате другите поставки 
на сметката.
 
-torbirdy.email.advanced=Please note that changing the advanced settings of 
TorBirdy is NOT recommended.\n\nYou should only continue if you are sure of 
what you are doing.
-torbirdy.email.advanced.nextwarning=Show this warning next time
-torbirdy.email.advanced.title=TorBirdy Advanced Settings
+torbirdy.email.advanced=Ве молиме забележете дека 
менувањето на напредните поставки за TorBirdy 
НЕ се препорачани.\n\nПродолжете само 
доколку сте сигурни што правите.
+torbirdy.email.advanced.nextwarning=Прикажи го ова 
предупредување нареден пат
+torbirdy.email.advanced.title=TorBirdy Напредни поставки

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


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

2018-11-15 Thread translation
commit 002ead2ec694136304fdf1d78590c050cf9205c6
Author: Translation commit bot 
Date:   Thu Nov 15 23:47:10 2018 +

Update translations for tails-persistence-setup
---
 mk/mk.po | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/mk/mk.po b/mk/mk.po
index fdcf4cbd5..27dcfeb1d 100644
--- a/mk/mk.po
+++ b/mk/mk.po
@@ -7,9 +7,9 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: Tails developers \n"
-"POT-Creation-Date: 2018-08-16 11:14+0200\n"
-"PO-Revision-Date: 2018-10-20 21:33+\n"
-"Last-Translator: Liljana Ackovska \n"
+"POT-Creation-Date: 2018-11-01 12:21+0100\n"
+"PO-Revision-Date: 2018-11-15 23:19+\n"
+"Last-Translator: Zarko Gjurov \n"
 "Language-Team: Macedonian 
(http://www.transifex.com/otf/torproject/language/mk/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -207,65 +207,65 @@ msgstr ""
 msgid "Create"
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:141
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:142
 msgid ""
 "Beware! Using persistence has consequences that must be well "
 "understood. Tails can't help you if you use it wrong! See the Encrypted "
 "persistence page of the Tails documentation to learn more."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:169
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:170
 msgid "Passphrase:"
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:177
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:178
 msgid "Verify Passphrase:"
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:188
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:244
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:189
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:245
 msgid "Passphrase can't be empty"
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:235
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:236
 msgid "Passphrases do not match"
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:283
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:284
 #: ../lib/Tails/Persistence/Step/Delete.pm:103
 #: ../lib/Tails/Persistence/Step/Configure.pm:181
 msgid "Failed"
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:291
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:292
 msgid "Mounting Tails persistence partition."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:294
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:295
 msgid "The Tails persistence partition will be mounted."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:303
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:304
 msgid "Correcting permissions of the persistent volume."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:306
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:307
 msgid "The permissions of the persistent volume will be corrected."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:314
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:315
 msgid "Creating default persistence configuration."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:317
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:318
 msgid "The default persistence configuration will be created."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:332
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:333
 msgid "Creating..."
 msgstr ""
 
-#: ../lib/Tails/Persistence/Step/Bootstrap.pm:335
+#: ../lib/Tails/Persistence/Step/Bootstrap.pm:336
 msgid "Creating the persistent volume..."
 msgstr ""
 

___
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-11-15 Thread translation
commit 7a1d0f8f6ffd90ebacf09dbc925ef3f55be0e01a
Author: Translation commit bot 
Date:   Thu Nov 15 23:46:43 2018 +

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

diff --git a/mk/mk.po b/mk/mk.po
index e0fdad991..f0efe0160 100644
--- a/mk/mk.po
+++ b/mk/mk.po
@@ -3,14 +3,22 @@
 # This file is distributed under the same license as the PACKAGE package.
 # FIRST AUTHOR , YEAR.
 # 
+# Translators:
+# Viktor Hristov, 2016
+# runasand , 2016
+# orvel_mk , 2016
+# Liljana Ackovska , 2018
+# dejanb , 2018
+# Zarko Gjurov , 2018
+# 
 #, fuzzy
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-09-04 09:46+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: dejanb , 2018\n"
+"PO-Revision-Date: 2016-11-18 21:29+\n"
+"Last-Translator: Zarko Gjurov , 2018\n"
 "Language-Team: Macedonian (https://www.transifex.com/otf/teams/1519/mk/)\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/tails-misc] Update translations for tails-misc

2018-11-15 Thread translation
commit 641b0b30e051195f3da8df138d8792bdfcb603e2
Author: Translation commit bot 
Date:   Thu Nov 15 23:46:16 2018 +

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

diff --git a/mk.po b/mk.po
index 6f21c4ef0..0c54333ee 100644
--- a/mk.po
+++ b/mk.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-10-31 16:04+0100\n"
-"PO-Revision-Date: 2018-11-06 01:54+\n"
+"PO-Revision-Date: 2018-11-15 23:19+\n"
 "Last-Translator: Zarko Gjurov \n"
 "Language-Team: Macedonian 
(http://www.transifex.com/otf/torproject/language/mk/)\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/liveusb-creator] Update translations for liveusb-creator

2018-11-15 Thread translation
commit 1b265542dfbf7d617d52d4d4dbfad7fde918b41b
Author: Translation commit bot 
Date:   Thu Nov 15 23:45:56 2018 +

Update translations for liveusb-creator
---
 mk/mk.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mk/mk.po b/mk/mk.po
index 0e47c9b1a..2b2b5472f 100644
--- a/mk/mk.po
+++ b/mk/mk.po
@@ -9,8 +9,8 @@ msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-10-20 12:34+0200\n"
-"PO-Revision-Date: 2018-10-20 19:13+\n"
-"Last-Translator: Liljana Ackovska \n"
+"PO-Revision-Date: 2018-11-15 23:19+\n"
+"Last-Translator: Zarko Gjurov \n"
 "Language-Team: Macedonian 
(http://www.transifex.com/otf/torproject/language/mk/)\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/tor-launcher-properties] Update translations for tor-launcher-properties

2018-11-15 Thread translation
commit 612d3ae608d2af5adfb4e81811a5c44a48bcb979
Author: Translation commit bot 
Date:   Thu Nov 15 23:19:24 2018 +

Update translations for tor-launcher-properties
---
 mk/torlauncher.properties | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mk/torlauncher.properties b/mk/torlauncher.properties
index 5f5a448de..8dfecbb99 100644
--- a/mk/torlauncher.properties
+++ b/mk/torlauncher.properties
@@ -3,9 +3,9 @@
 
 torlauncher.error_title=Tor стартувач
 
-torlauncher.tor_exited_during_startup=Tor се исклучи за време 
на вклучувањето. Ова може да е поради 
грашка во вашата torrc датотека, грешка во Tor 
или друга програма во вашиот систем, или 
проблем со хардеверот. Додека не го 
поправите проблемот кој го предизвикува 
ова, и повторно не го вклучите Tor, Tor Browser 
нема да се стартува.
-torlauncher.tor_exited=Tor неочекувано се исклучи. Ова 
може да е до грешка во самиот Tor, друга 
програма во системот, или проблем со х
ардверот. Додека повторно го стартувате Tor, 
Tor Browser нема да може да ја отвори било која 
веб страна. Ако проблемот остане, ве молиме 
испратете копија од вашиот Tor лог на тимот 
за поддршка.
-torlauncher.tor_exited2=Повротното старување на Tor 
нема да ви ги затвори табовите во вашиот 
прелистувач.
+torlauncher.tor_exited_during_startup=Tor се исклучи за време 
на вклучувањето. Ова може да е поради 
грашка во вашата torrc датотека, грешка во Tor 
или друга програма во вашиот систем, или 
проблем со хардеверот. Додека не го 
поправите проблемот кој го предизвикува 
ова, и не го рестартирате Tor, Tor Browser нема да 
се стартува.
+torlauncher.tor_exited=Tor неочекувано се исклучи. Ова 
може да е до грешка во самиот Tor, друга 
програма во системот, или проблем со х
ардверот. Додека не го рестартирате Tor, Tor 
Browser нема да може да ја отвори било која веб 
страна. Ако проблемот остане, ве молиме 
испратете копија од вашиот Tor лог на тимот 
за поддршка.
+torlauncher.tor_exited2=Рестартирањето на Tor нема да 
ви ги затвори табовите во вашиот 
прелистувач.
 torlauncher.tor_controlconn_failed=Не може да се поврзе на 
Tor контролната порта.
 torlauncher.tor_failed_to_start=Tor не успеа да се стартува.
 torlauncher.tor_control_failed=Не успеа да преземе 
контрола врз Tor.
@@ -42,7 +42,7 @@ torlauncher.no_meek=Овој прелистувач не е 
конфигурир
 torlauncher.no_bridges_available=Нема достапни мостови во 
овој момент. Извинете.
 
 torlauncher.connect=Поврзи
-torlauncher.restart_tor=Повторно стартување на Tor
+torlauncher.restart_tor= Повторно стартување на Tor
 torlauncher.quit=Прекини
 torlauncher.quit_win=Излез
 torlauncher.done=Завршено

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


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

2018-11-15 Thread translation
commit 6d969521f0dfdffc54a264eb6e9ad79d47b26800
Author: Translation commit bot 
Date:   Thu Nov 15 23:19:30 2018 +

Update translations for tor-launcher-properties_completed
---
 mk/torlauncher.properties | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mk/torlauncher.properties b/mk/torlauncher.properties
index 5f5a448de..8dfecbb99 100644
--- a/mk/torlauncher.properties
+++ b/mk/torlauncher.properties
@@ -3,9 +3,9 @@
 
 torlauncher.error_title=Tor стартувач
 
-torlauncher.tor_exited_during_startup=Tor се исклучи за време 
на вклучувањето. Ова може да е поради 
грашка во вашата torrc датотека, грешка во Tor 
или друга програма во вашиот систем, или 
проблем со хардеверот. Додека не го 
поправите проблемот кој го предизвикува 
ова, и повторно не го вклучите Tor, Tor Browser 
нема да се стартува.
-torlauncher.tor_exited=Tor неочекувано се исклучи. Ова 
може да е до грешка во самиот Tor, друга 
програма во системот, или проблем со х
ардверот. Додека повторно го стартувате Tor, 
Tor Browser нема да може да ја отвори било која 
веб страна. Ако проблемот остане, ве молиме 
испратете копија од вашиот Tor лог на тимот 
за поддршка.
-torlauncher.tor_exited2=Повротното старување на Tor 
нема да ви ги затвори табовите во вашиот 
прелистувач.
+torlauncher.tor_exited_during_startup=Tor се исклучи за време 
на вклучувањето. Ова може да е поради 
грашка во вашата torrc датотека, грешка во Tor 
или друга програма во вашиот систем, или 
проблем со хардеверот. Додека не го 
поправите проблемот кој го предизвикува 
ова, и не го рестартирате Tor, Tor Browser нема да 
се стартува.
+torlauncher.tor_exited=Tor неочекувано се исклучи. Ова 
може да е до грешка во самиот Tor, друга 
програма во системот, или проблем со х
ардверот. Додека не го рестартирате Tor, Tor 
Browser нема да може да ја отвори било која веб 
страна. Ако проблемот остане, ве молиме 
испратете копија од вашиот Tor лог на тимот 
за поддршка.
+torlauncher.tor_exited2=Рестартирањето на Tor нема да 
ви ги затвори табовите во вашиот 
прелистувач.
 torlauncher.tor_controlconn_failed=Не може да се поврзе на 
Tor контролната порта.
 torlauncher.tor_failed_to_start=Tor не успеа да се стартува.
 torlauncher.tor_control_failed=Не успеа да преземе 
контрола врз Tor.
@@ -42,7 +42,7 @@ torlauncher.no_meek=Овој прелистувач не е 
конфигурир
 torlauncher.no_bridges_available=Нема достапни мостови во 
овој момент. Извинете.
 
 torlauncher.connect=Поврзи
-torlauncher.restart_tor=Повторно стартување на Tor
+torlauncher.restart_tor= Повторно стартување на Tor
 torlauncher.quit=Прекини
 torlauncher.quit_win=Излез
 torlauncher.done=Завршено

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


[tor-commits] [translation/tor-launcher-network-settings_completed] Update translations for tor-launcher-network-settings_completed

2018-11-15 Thread translation
commit c29b9720d034e737c7576366092489f4fe90eef0
Author: Translation commit bot 
Date:   Thu Nov 15 23:19:43 2018 +

Update translations for tor-launcher-network-settings_completed
---
 mk/network-settings.dtd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/network-settings.dtd b/mk/network-settings.dtd
index 48d1f8522..7a258c568 100644
--- a/mk/network-settings.dtd
+++ b/mk/network-settings.dtd
@@ -17,7 +17,7 @@
 
 
 
-
+
 
 
 

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


[tor-commits] [translation/tor-launcher-network-settings] Update translations for tor-launcher-network-settings

2018-11-15 Thread translation
commit 4db4992a11059b73d4aca8ad4244bbb7e3c83adb
Author: Translation commit bot 
Date:   Thu Nov 15 23:19:37 2018 +

Update translations for tor-launcher-network-settings
---
 mk/network-settings.dtd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/network-settings.dtd b/mk/network-settings.dtd
index 48d1f8522..7a258c568 100644
--- a/mk/network-settings.dtd
+++ b/mk/network-settings.dtd
@@ -17,7 +17,7 @@
 
 
 
-
+
 
 
 

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


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

2018-11-15 Thread translation
commit 3771d4f0851ca7b858eb559f665230fce7a1e621
Author: Translation commit bot 
Date:   Thu Nov 15 23:18:29 2018 +

Update translations for torbutton-torbuttonproperties_completed
---
 mk/torbutton.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/torbutton.properties b/mk/torbutton.properties
index 52fdf7da1..a27df3d84 100644
--- a/mk/torbutton.properties
+++ b/mk/torbutton.properties
@@ -29,7 +29,7 @@ torbutton.popup.short_torbrowser = Важна Torbutton 
информација!\
 
 torbutton.popup.confirm_plugins = Приклучоците како Flash 
можат да ја повредат вашата приватност и 
анонимност.\n\nТие можат исто така да го 
заобиколат Tor и да ја откријат важата 
локација и IP адресата.\n\nДали сте сигурни 
дека сакате да ги овозможите 
приклучоците?\n\n
 torbutton.popup.never_ask_again = Не ме прашувај никогаш 
повеќе
-torbutton.popup.confirm_newnym = Tor Browser ќе ги затвори сите 
прозорци и табови. Сите веб сесии ќе бидат 
изгубени.\n\nПовторно стартувајте го Tor Browser 
сега да го промените вашиот идентитет.\n\n
+torbutton.popup.confirm_newnym = Tor Browser ќе ги затвори сите 
прозорци и табови. Сите веб сесии ќе бидат 
изгубени.\n\nРестартирајте го Tor Browser сега да 
го промените вашиот идентитет.\n\n
 
 torbutton.maximize_warning = Максимизирањето на Tor Browser 
дозволува на веб страните да ја утврдат 
големината на вашиот монитор, што пак може 
да се користи за ваше следење. Ви 
препорачуваме да ги оставите прозорците на 
Tor Browser во нивната оригинална големина.
 

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


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

2018-11-15 Thread translation
commit ec905855d5ea2442ab1317ab21cc8c0ac657cf6f
Author: Translation commit bot 
Date:   Thu Nov 15 23:18:23 2018 +

Update translations for torbutton-torbuttonproperties
---
 mk/torbutton.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/torbutton.properties b/mk/torbutton.properties
index 52fdf7da1..a27df3d84 100644
--- a/mk/torbutton.properties
+++ b/mk/torbutton.properties
@@ -29,7 +29,7 @@ torbutton.popup.short_torbrowser = Важна Torbutton 
информација!\
 
 torbutton.popup.confirm_plugins = Приклучоците како Flash 
можат да ја повредат вашата приватност и 
анонимност.\n\nТие можат исто така да го 
заобиколат Tor и да ја откријат важата 
локација и IP адресата.\n\nДали сте сигурни 
дека сакате да ги овозможите 
приклучоците?\n\n
 torbutton.popup.never_ask_again = Не ме прашувај никогаш 
повеќе
-torbutton.popup.confirm_newnym = Tor Browser ќе ги затвори сите 
прозорци и табови. Сите веб сесии ќе бидат 
изгубени.\n\nПовторно стартувајте го Tor Browser 
сега да го промените вашиот идентитет.\n\n
+torbutton.popup.confirm_newnym = Tor Browser ќе ги затвори сите 
прозорци и табови. Сите веб сесии ќе бидат 
изгубени.\n\nРестартирајте го Tor Browser сега да 
го промените вашиот идентитет.\n\n
 
 torbutton.maximize_warning = Максимизирањето на Tor Browser 
дозволува на веб страните да ја утврдат 
големината на вашиот монитор, што пак може 
да се користи за ваше следење. Ви 
препорачуваме да ги оставите прозорците на 
Tor Browser во нивната оригинална големина.
 

___
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_completed] Update translations for tor-browser-manual_completed

2018-11-15 Thread translation
commit 06aec9a19ac12d3e5a9a7466f9cd7c6a3ed3f077
Author: Translation commit bot 
Date:   Thu Nov 15 23:17:54 2018 +

Update translations for tor-browser-manual_completed
---
 fr/fr.po | 12 ++--
 mk/mk.po | 24 
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/fr/fr.po b/fr/fr.po
index e037b1624..c678a3802 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -1687,11 +1687,10 @@ msgid ""
 "any other protocol. While still included by default, it is reccomended to "
 "use obfs4 instead, as it has several security improvements over obfs3."
 msgstr ""
-"obfs3 donne l'impression que le trafic de Tor est aléatoire afin qu'il ne "
-"ressemble pas à Tor ou à n'importe quel autre protocole. Malgré le fait "
-"qu'il soit encore inclus par défaut, il est recommandé d'utiliser obfs4 à 
la"
-" place, car il comporte plusieurs améliorations de sécurité par rapport à 
"
-"obfs3."
+"obfs3 donne l’impression que le trafic de Tor est aléatoire afin qu’il 
ne "
+"ressemble ni à Tor ni à n’importe quel autre protocole. Bien qu’il soit 
"
+"encore inclus par défaut, il est plutôt recommandé d’utiliser obfs4, car 
il "
+"comporte plusieurs améliorations de sécurité par rapport à obfs3."
 
 #: transports.page:43
 msgid "obfs4"
@@ -1755,7 +1754,8 @@ msgid ""
 "WebRTC, a peer-to-peer protocol with built-in NAT punching."
 msgstr ""
 "Snowflake est une amélioration par rapport à Flashproxy. Il transmet votre "
-"trafic via WebRTC, un protocole pair à pair avec poinçonnage de NAT 
intégré."
+"trafic par WebRTC, un protocole pair-à-pair avec perçage intégré de trous 
"
+"dans la traduction d’adresses de réseau."
 
 #: troubleshooting.page:6
 msgid "What to do if Tor Browser doesn’t work"
diff --git a/mk/mk.po b/mk/mk.po
index 1e4c0b33d..b9d2ef559 100644
--- a/mk/mk.po
+++ b/mk/mk.po
@@ -296,8 +296,8 @@ msgid ""
 "Network Settings”."
 msgstr ""
 "Можете да ги конфигурирате pluggable transports 
додека е Tor Browser "
-"стартуван, со кликање на зелениот кромид 
близу адресната лента и одбирање на"
-" „Tor мрежни поставки“."
+"стартуван, со кликање на зелениот 
кромид/оnion близу адресната лента и "
+"одбирање на „Tor мрежни поставки“."
 
 #: circumvention.page:41
 msgid ""
@@ -1810,8 +1810,8 @@ msgid ""
 "censoring connections to the Tor network. Read the Circumvention section for possible solutions."
 msgstr ""
-"Ако сеуште не можете да се поврзете, 
вашиот Интернет Сервис Провајдер може "
-"го цензурира поврзувањето на Tor  мрежата. 
Прочитајте ја Заобиколувањесекцијата 
за можни решенија."
 
 #: troubleshooting.page:74
@@ -1827,8 +1827,8 @@ msgid ""
 msgstr ""
 "Tor Browser е под постојано развивање, и некои 
проблеми се познати но сеуште"
 " не се поправени. Ве молиме проверете на 
Познати"
-" Проблемистраницата да видите деали 
проблемот со кој се соочувате е "
-"веќе ислистан таму."
+" Проблемистраницата да видите дали 
проблемот со кој се соочувате е "
+"веќе излистан таму."
 
 #: uninstalling.page:6
 msgid "How to remove Tor Browser from your system"
@@ -1859,8 +1859,8 @@ msgid ""
 "default location, however the folder will be named \"tor-browser_en-US\" if "
 "you are running the English Tor Browser."
 msgstr ""
-"Најдете ја вашиот Tor Browser папка. 
Стандардната локација на Windows е на "
-"вашата работна површина; на Mac OS X е во 
папката Апликации. На Linux, нема "
+"Најдете ја вашата Tor Browser папка. 
Стандардната локација на Windows е на "
+"вашата Работна површина; на Mac OS X е во 
папката Апликации. На Linux, нема "
 "стандардна локација, но како и да е 
папката ќе биде именувана како \"tor-"
 "browser_en-US\" ако користите Tor Browser на англиски 
јазик."
 
@@ -1895,7 +1895,7 @@ msgid ""
 msgstr ""
 "Tor Browser мора да биде ажуриран цело време. 
Ако продолжите да користите "
 "застарена верзија на софтверот, може да 
бидете ранливи на сериозни "
-"безбедносни мани кои ја компромитираат 
вашата приватност и анонимоност."

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

2018-11-15 Thread translation
commit b21b8c97afb167ae91d3229e84e7268a5feeaf6b
Author: Translation commit bot 
Date:   Thu Nov 15 23:17:47 2018 +

Update translations for tor-browser-manual
---
 fr/fr.po | 12 ++--
 mk/mk.po | 24 
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/fr/fr.po b/fr/fr.po
index e037b1624..c678a3802 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -1687,11 +1687,10 @@ msgid ""
 "any other protocol. While still included by default, it is reccomended to "
 "use obfs4 instead, as it has several security improvements over obfs3."
 msgstr ""
-"obfs3 donne l'impression que le trafic de Tor est aléatoire afin qu'il ne "
-"ressemble pas à Tor ou à n'importe quel autre protocole. Malgré le fait "
-"qu'il soit encore inclus par défaut, il est recommandé d'utiliser obfs4 à 
la"
-" place, car il comporte plusieurs améliorations de sécurité par rapport à 
"
-"obfs3."
+"obfs3 donne l’impression que le trafic de Tor est aléatoire afin qu’il 
ne "
+"ressemble ni à Tor ni à n’importe quel autre protocole. Bien qu’il soit 
"
+"encore inclus par défaut, il est plutôt recommandé d’utiliser obfs4, car 
il "
+"comporte plusieurs améliorations de sécurité par rapport à obfs3."
 
 #: transports.page:43
 msgid "obfs4"
@@ -1755,7 +1754,8 @@ msgid ""
 "WebRTC, a peer-to-peer protocol with built-in NAT punching."
 msgstr ""
 "Snowflake est une amélioration par rapport à Flashproxy. Il transmet votre "
-"trafic via WebRTC, un protocole pair à pair avec poinçonnage de NAT 
intégré."
+"trafic par WebRTC, un protocole pair-à-pair avec perçage intégré de trous 
"
+"dans la traduction d’adresses de réseau."
 
 #: troubleshooting.page:6
 msgid "What to do if Tor Browser doesn’t work"
diff --git a/mk/mk.po b/mk/mk.po
index 1e4c0b33d..b9d2ef559 100644
--- a/mk/mk.po
+++ b/mk/mk.po
@@ -296,8 +296,8 @@ msgid ""
 "Network Settings”."
 msgstr ""
 "Можете да ги конфигурирате pluggable transports 
додека е Tor Browser "
-"стартуван, со кликање на зелениот кромид 
близу адресната лента и одбирање на"
-" „Tor мрежни поставки“."
+"стартуван, со кликање на зелениот 
кромид/оnion близу адресната лента и "
+"одбирање на „Tor мрежни поставки“."
 
 #: circumvention.page:41
 msgid ""
@@ -1810,8 +1810,8 @@ msgid ""
 "censoring connections to the Tor network. Read the Circumvention section for possible solutions."
 msgstr ""
-"Ако сеуште не можете да се поврзете, 
вашиот Интернет Сервис Провајдер може "
-"го цензурира поврзувањето на Tor  мрежата. 
Прочитајте ја Заобиколувањесекцијата 
за можни решенија."
 
 #: troubleshooting.page:74
@@ -1827,8 +1827,8 @@ msgid ""
 msgstr ""
 "Tor Browser е под постојано развивање, и некои 
проблеми се познати но сеуште"
 " не се поправени. Ве молиме проверете на 
Познати"
-" Проблемистраницата да видите деали 
проблемот со кој се соочувате е "
-"веќе ислистан таму."
+" Проблемистраницата да видите дали 
проблемот со кој се соочувате е "
+"веќе излистан таму."
 
 #: uninstalling.page:6
 msgid "How to remove Tor Browser from your system"
@@ -1859,8 +1859,8 @@ msgid ""
 "default location, however the folder will be named \"tor-browser_en-US\" if "
 "you are running the English Tor Browser."
 msgstr ""
-"Најдете ја вашиот Tor Browser папка. 
Стандардната локација на Windows е на "
-"вашата работна површина; на Mac OS X е во 
папката Апликации. На Linux, нема "
+"Најдете ја вашата Tor Browser папка. 
Стандардната локација на Windows е на "
+"вашата Работна површина; на Mac OS X е во 
папката Апликации. На Linux, нема "
 "стандардна локација, но како и да е 
папката ќе биде именувана како \"tor-"
 "browser_en-US\" ако користите Tor Browser на англиски 
јазик."
 
@@ -1895,7 +1895,7 @@ msgid ""
 msgstr ""
 "Tor Browser мора да биде ажуриран цело време. 
Ако продолжите да користите "
 "застарена верзија на софтверот, може да 
бидете ранливи на сериозни "
-"безбедносни мани кои ја компромитираат 
вашата приватност и анонимоност."

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

2018-11-15 Thread translation
commit 17e5cc12979a7a2a4ab65866d8e57e9f6c0ba68b
Author: Translation commit bot 
Date:   Thu Nov 15 23:17:19 2018 +

Update translations for tor-and-https_completed
---
 mk.po | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mk.po b/mk.po
index 4d64ecd1a..563830cea 100644
--- a/mk.po
+++ b/mk.po
@@ -1,12 +1,13 @@
 # 
 # Translators:
+# Liljana Ackovska , 2018
 # Zarko Gjurov , 2018
 msgid ""
 msgstr ""
 "Project-Id-Version: Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2018-11-14 20:38+\n"
-"Last-Translator: Zarko Gjurov \n"
+"PO-Revision-Date: 2018-11-15 23:12+\n"
+"Last-Translator: Liljana Ackovska \n"
 "Language-Team: Macedonian 
(http://www.transifex.com/otf/torproject/language/mk/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -102,7 +103,7 @@ msgstr "Полиција"
 #: C/tor-and-https.svg:363
 #, no-wrap
 msgid "NSA"
-msgstr "NSA/УБК"
+msgstr "УБК"
 
 #. (itstool) path: defs/text
 #. Keep it short: 8em is ok, 9em is max.

___
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-11-15 Thread translation
commit 24d446dfae543301e2635f2657c64942d118678b
Author: Translation commit bot 
Date:   Thu Nov 15 23:17:12 2018 +

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

diff --git a/mk.po b/mk.po
index 4d64ecd1a..563830cea 100644
--- a/mk.po
+++ b/mk.po
@@ -1,12 +1,13 @@
 # 
 # Translators:
+# Liljana Ackovska , 2018
 # Zarko Gjurov , 2018
 msgid ""
 msgstr ""
 "Project-Id-Version: Tor Project\n"
 "POT-Creation-Date: 2014-07-17 14:23+\n"
-"PO-Revision-Date: 2018-11-14 20:38+\n"
-"Last-Translator: Zarko Gjurov \n"
+"PO-Revision-Date: 2018-11-15 23:12+\n"
+"Last-Translator: Liljana Ackovska \n"
 "Language-Team: Macedonian 
(http://www.transifex.com/otf/torproject/language/mk/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -102,7 +103,7 @@ msgstr "Полиција"
 #: C/tor-and-https.svg:363
 #, no-wrap
 msgid "NSA"
-msgstr "NSA/УБК"
+msgstr "УБК"
 
 #. (itstool) path: defs/text
 #. Keep it short: 8em is ok, 9em is max.

___
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_completed] Update translations for tor-browser-manual_completed

2018-11-15 Thread translation
commit b1739316c2d03f8ee740c604a8c6e294e5d9c090
Author: Translation commit bot 
Date:   Thu Nov 15 22:48:00 2018 +

Update translations for tor-browser-manual_completed
---
 fr/fr.po | 28 +++-
 mk/mk.po | 14 +++---
 2 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/fr/fr.po b/fr/fr.po
index 5e331287b..e037b1624 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -1558,16 +1558,16 @@ msgstr ""
 #: translate.page:47
 msgid "On the next page, select 'Join an existing project' and continue."
 msgstr ""
-"À la page suivante, sélectionnez « Rejoindre un projet existant » et "
-"poursuivre."
+"Sur la page suivante, sélectionnez « Se joindre à un projet existant » 
et "
+"poursuivez."
 
 #: translate.page:52
 msgid ""
 "On the next page, select the languages you speak from the drop-down menu and"
 " continue."
 msgstr ""
-"À la page suivante, sélectionnez les langues que vous parlez à partir du "
-"menu déroulant et poursuivre."
+"Sur la page suivante, sélectionnez dans le menu déroulant les langues que "
+"vous parlez et poursuivez."
 
 #: translate.page:58
 msgid ""
@@ -1575,13 +1575,15 @@ msgid ""
 "href=\"https://www.transifex.com/otf/torproject/\;>Tor Transifex "
 "page."
 msgstr ""
-"Vous êtes maintenant inscrit ! Allez sur la https://www.transifex.com/otf/torproject/\;>page Transifex de "
 "Tor."
 
 #: translate.page:64
 msgid "Click the blue 'Join Team' button on the far right:"
-msgstr "Cliquez sur le bouton bleu « Rejoindre l'équipe » à droite :"
+msgstr ""
+"Cliquez sur le bouton bleu « Se joindre à l’équipe » situé 
complètement à "
+"droite :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1600,8 +1602,8 @@ msgstr ""
 msgid ""
 "Select the language you would like to translate from the dropdown menu:"
 msgstr ""
-"Sélectionnez la langue à partir de laquelle vous souhaitez traduire dans le 
"
-"menu déroulant :"
+"Sélectionnez dans le menu déroulant la langue vers laquelle vous souhaitez "
+"traduire :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1619,7 +1621,7 @@ msgstr ""
 #: translate.page:80
 msgid "A notification will now show up on the top of the page like so:"
 msgstr ""
-"Une notification apparaîtra maintenant en haut de la page comme ceci :"
+"Une notification comme celle-ci apparaîtra maintenant en haut de la page :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1641,11 +1643,11 @@ msgid ""
 "Transifex page when you are ready to begin. Thanks for your interest "
 "in helping the project!"
 msgstr ""
-"Une fois que votre adhésion est approuvée, vous pouvez commencer à 
traduire;"
-" retournez simplement à la https://www.transifex.com/otf/torproject/\;>page Transifex de "
-"Tor lorsque vous êtes prêt à commencer. Merci de votre intérêt à 
"
-"aider le projet !"
+"Tor quand vous serez prêt à commencer. Nous vous remercions de votre 
"
+"intérêt à aider le projet !"
 
 #: transports.page:6 transports.page:20
 msgid "Types of pluggable transport"
diff --git a/mk/mk.po b/mk/mk.po
index cc0778d98..1e4c0b33d 100644
--- a/mk/mk.po
+++ b/mk/mk.po
@@ -1716,7 +1716,7 @@ msgid ""
 "Web Services; meek-azure makes it look like you are using a Microsoft web "
 "site; and meek-google makes it look like you are using Google search."
 msgstr ""
-"Сите овие транспорти прават да изгледа 
дека вие прелистувате главна веб "
+"Сите овие транспорти прават да изгледа 
дека вие прелистувате позната веб "
 "страна наместо дека користите Tor. meek-amazon 
прави да изгледа дека "
 "користите Amazon Web Services; meek-azure прави да 
изгледа дека користите "
 "Микрософт веб страна; и meek-google прави да 
изгледа дека користите Google "
@@ -1724,15 +1724,15 @@ msgstr ""
 
 #: transports.page:100
 msgid "Snowflake"
-msgstr "Снегулка"
+msgstr "Snowflake"
 
 #: transports.page:105
 msgid ""
 "Snowflake is an improvement upon Flashproxy. It sends your traffic through "
 "WebRTC, a peer-to-peer protocol with built-in NAT punching."
 msgstr ""
-"Снегулка е подобрување на Flashproxy. Таа го 
испраќа вашиот сообраќај преку "
-"WebRTC, пеар-то-пеар протокол со вграден NET 
удирач."
+"Snowflake е подобрување на Flashproxy. Таа го 
испраќа вашиот сообраќај преку"
+" WebRTC, корисник-до-корисник 

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

2018-11-15 Thread translation
commit 63eaacfd943d771f5597f4d1fa085bc47bbe5797
Author: Translation commit bot 
Date:   Thu Nov 15 22:47:52 2018 +

Update translations for tor-browser-manual
---
 fr/fr.po | 28 +++-
 mk/mk.po | 14 +++---
 2 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/fr/fr.po b/fr/fr.po
index 5e331287b..e037b1624 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -1558,16 +1558,16 @@ msgstr ""
 #: translate.page:47
 msgid "On the next page, select 'Join an existing project' and continue."
 msgstr ""
-"À la page suivante, sélectionnez « Rejoindre un projet existant » et "
-"poursuivre."
+"Sur la page suivante, sélectionnez « Se joindre à un projet existant » 
et "
+"poursuivez."
 
 #: translate.page:52
 msgid ""
 "On the next page, select the languages you speak from the drop-down menu and"
 " continue."
 msgstr ""
-"À la page suivante, sélectionnez les langues que vous parlez à partir du "
-"menu déroulant et poursuivre."
+"Sur la page suivante, sélectionnez dans le menu déroulant les langues que "
+"vous parlez et poursuivez."
 
 #: translate.page:58
 msgid ""
@@ -1575,13 +1575,15 @@ msgid ""
 "href=\"https://www.transifex.com/otf/torproject/\;>Tor Transifex "
 "page."
 msgstr ""
-"Vous êtes maintenant inscrit ! Allez sur la https://www.transifex.com/otf/torproject/\;>page Transifex de "
 "Tor."
 
 #: translate.page:64
 msgid "Click the blue 'Join Team' button on the far right:"
-msgstr "Cliquez sur le bouton bleu « Rejoindre l'équipe » à droite :"
+msgstr ""
+"Cliquez sur le bouton bleu « Se joindre à l’équipe » situé 
complètement à "
+"droite :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1600,8 +1602,8 @@ msgstr ""
 msgid ""
 "Select the language you would like to translate from the dropdown menu:"
 msgstr ""
-"Sélectionnez la langue à partir de laquelle vous souhaitez traduire dans le 
"
-"menu déroulant :"
+"Sélectionnez dans le menu déroulant la langue vers laquelle vous souhaitez "
+"traduire :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1619,7 +1621,7 @@ msgstr ""
 #: translate.page:80
 msgid "A notification will now show up on the top of the page like so:"
 msgstr ""
-"Une notification apparaîtra maintenant en haut de la page comme ceci :"
+"Une notification comme celle-ci apparaîtra maintenant en haut de la page :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1641,11 +1643,11 @@ msgid ""
 "Transifex page when you are ready to begin. Thanks for your interest "
 "in helping the project!"
 msgstr ""
-"Une fois que votre adhésion est approuvée, vous pouvez commencer à 
traduire;"
-" retournez simplement à la https://www.transifex.com/otf/torproject/\;>page Transifex de "
-"Tor lorsque vous êtes prêt à commencer. Merci de votre intérêt à 
"
-"aider le projet !"
+"Tor quand vous serez prêt à commencer. Nous vous remercions de votre 
"
+"intérêt à aider le projet !"
 
 #: transports.page:6 transports.page:20
 msgid "Types of pluggable transport"
diff --git a/mk/mk.po b/mk/mk.po
index cc0778d98..1e4c0b33d 100644
--- a/mk/mk.po
+++ b/mk/mk.po
@@ -1716,7 +1716,7 @@ msgid ""
 "Web Services; meek-azure makes it look like you are using a Microsoft web "
 "site; and meek-google makes it look like you are using Google search."
 msgstr ""
-"Сите овие транспорти прават да изгледа 
дека вие прелистувате главна веб "
+"Сите овие транспорти прават да изгледа 
дека вие прелистувате позната веб "
 "страна наместо дека користите Tor. meek-amazon 
прави да изгледа дека "
 "користите Amazon Web Services; meek-azure прави да 
изгледа дека користите "
 "Микрософт веб страна; и meek-google прави да 
изгледа дека користите Google "
@@ -1724,15 +1724,15 @@ msgstr ""
 
 #: transports.page:100
 msgid "Snowflake"
-msgstr "Снегулка"
+msgstr "Snowflake"
 
 #: transports.page:105
 msgid ""
 "Snowflake is an improvement upon Flashproxy. It sends your traffic through "
 "WebRTC, a peer-to-peer protocol with built-in NAT punching."
 msgstr ""
-"Снегулка е подобрување на Flashproxy. Таа го 
испраќа вашиот сообраќај преку "
-"WebRTC, пеар-то-пеар протокол со вграден NET 
удирач."
+"Snowflake е подобрување на Flashproxy. Таа го 
испраќа вашиот сообраќај преку"
+" WebRTC, корисник-до-корисник протокол 

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

2018-11-15 Thread translation
commit db6a24d2a32fb13ceb01a6348a76524b4f76a6a1
Author: Translation commit bot 
Date:   Thu Nov 15 22:19:23 2018 +

Update translations for tor-launcher-properties
---
 fa/torlauncher.properties | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fa/torlauncher.properties b/fa/torlauncher.properties
index 533c4918d..a3af3861e 100644
--- a/fa/torlauncher.properties
+++ b/fa/torlauncher.properties
@@ -26,20 +26,20 @@ torlauncher.error_proxy_addr_missing=شما میبایست 
یک آدرس آی پ
 torlauncher.error_proxy_type_missing=شما باید نوع پراکسی را 
انتخاب کنید.
 torlauncher.error_bridges_missing=شما باید یک یا پل های 
بیشتری را مشخص کنید.
 torlauncher.error_default_bridges_type_missing=نوع انتقال باید 
برای پل‌ها مشخص گردد.
-torlauncher.error_bridgedb_bridges_missing=Please request a bridge.
+torlauncher.error_bridgedb_bridges_missing=لطفا یک پل درخواست 
کنید.
 torlauncher.error_bridge_bad_default_type=هیچ پلی از نوع %S  م
وجود نیست. لطفا تنظیمات را اصلاح کنید.
 
-torlauncher.bridge_suffix.meek-amazon=(works in China)
-torlauncher.bridge_suffix.meek-azure=(works in China)
+torlauncher.bridge_suffix.meek-amazon=(در چین کار می‌کند)
+torlauncher.bridge_suffix.meek-azure=(در چین کار می‌کند)
 
-torlauncher.request_a_bridge=Request a Bridge…
-torlauncher.request_a_new_bridge=Request a New Bridge…
+torlauncher.request_a_bridge=درخواست یک پل...
+torlauncher.request_a_new_bridge=درخواست یک پل جدید...
 torlauncher.contacting_bridgedb=Contacting BridgeDB. Please wait.
-torlauncher.captcha_prompt=Solve the CAPTCHA to request a bridge.
-torlauncher.bad_captcha_solution=The solution is not correct. Please try again.
+torlauncher.captcha_prompt=برای درخواست یک پل کپچا را 
حل کنید.
+torlauncher.bad_captcha_solution=راه حل درست نیست. لطفا 
دوباره تلاش کنید.
 torlauncher.unable_to_get_bridge=Unable to obtain a bridge from BridgeDB.\n\n%S
 torlauncher.no_meek=This browser is not configured for meek, which is needed 
to obtain bridges.
-torlauncher.no_bridges_available=No bridges are available at this time. Sorry.
+torlauncher.no_bridges_available=متاسفم. در حال حاضر هیچ 
کدام از پل‌ها در دسترس نیستند.
 
 torlauncher.connect=اتصال
 torlauncher.restart_tor=تور را ریستارت کنید.
@@ -73,6 +73,6 @@ torlauncher.bootstrapWarning.noroute=نبود مسیر به م
یزبان
 torlauncher.bootstrapWarning.ioerror=خطای خواندن/نوشتن
 torlauncher.bootstrapWarning.pt_missing=انتقال جایگزین مفقود 
است.
 
-torlauncher.nsresult.NS_ERROR_NET_RESET=The connection to the server was lost.
+torlauncher.nsresult.NS_ERROR_NET_RESET=ارتباط با کارساز از 
دست رفت.
 torlauncher.nsresult.NS_ERROR_CONNECTION_REFUSED=Could not connect to the 
server.
 torlauncher.nsresult.NS_ERROR_PROXY_CONNECTION_REFUSED=Could not connect to 
the proxy.

___
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_completed] Update translations for tor-browser-manual_completed

2018-11-15 Thread translation
commit 9779d9f1bcebbb0308451bc06fafbac2581aef0f
Author: Translation commit bot 
Date:   Thu Nov 15 22:17:56 2018 +

Update translations for tor-browser-manual_completed
---
 fr/fr.po | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/fr/fr.po b/fr/fr.po
index 3582a2f63..5e331287b 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -765,8 +765,8 @@ msgstr ""
 #: managing-identities.page:6
 msgid "Learn how to control personally-identifying information in Tor Browser"
 msgstr ""
-"Apprendre à contrôler les informations permettant d’identifier les 
personnes"
-" dans le Navigateur Tor"
+"Apprenez à contrôler dans le Navigateur Tor les renseignements permettant "
+"d’identifier quelqu’un"
 
 #: managing-identities.page:10
 msgid "Managing identities"
@@ -1202,14 +1202,14 @@ msgid ""
 " many websites from displaying correctly, so Tor Browser’s default setting "
 "is to allow all websites to run scripts in \"Standard\" mode."
 msgstr ""
-"Les utilisateurs qui nécessitent un niveau de sécurité élevé 
lorsqu’ils "
+"Les utilisateurs qui exigent un niveau de sécurité élevé quand ils "
 "parcourent le Web devraient régler le curseur"
 " de sécurité du Navigateur Tor à « Plus sûr » (ce qui 
désactive le "
 "JavaScript pour les sites Web sans HTTPS) ou « Le plus sûr » (ce qui le 
fait"
 " pour tous les sites Web). Cependant, la désactivation du JavaScript "
 "empêchera de nombreux sites Web de s’afficher correctement, et c’est "
-"pourquoi les paramètres par défaut du Navigateur Tor permettent aux sites "
-"Web d’exécuter des scripts dans le mode « Standard »."
+"pourquoi les paramètres par défaut du Navigateur Tor permettent à tous les 
"
+"sites Web d’exécuter des scripts en mode « Normal »."
 
 #: plugins.page:59
 msgid "Browser Add-ons"
@@ -1243,7 +1243,7 @@ msgstr ""
 #: secure-connections.page:8
 msgid "Learn how to protect your data using Tor Browser and HTTPS"
 msgstr ""
-"Apprendre comment protéger vos données en utilisant le Navigateur Tor et "
+"Apprenez comment protéger vos données en utilisant le Navigateur Tor et "
 "HTTPS"
 
 #: secure-connections.page:12
@@ -1353,7 +1353,7 @@ msgstr "Si Tor est utilisé ou non."
 
 #: security-slider.page:6
 msgid "Configuring Tor Browser for security and usability"
-msgstr "Configurer le Navigateur Tor pour la sécurité et la facilité 
d’emploi"
+msgstr "Configurez le Navigateur Tor pour la sécurité et la facilité 
d’emploi"
 
 #: security-slider.page:10
 msgid "Security Slider"
@@ -1482,11 +1482,11 @@ msgstr ""
 
 #: translate.page:6
 msgid "Becoming a translator for the Tor Project"
-msgstr "Devenir un traducteur pour le Projet Tor"
+msgstr "Devenez traducteur pour le Projet Tor"
 
 #: translate.page:10
 msgid "Becoming a Tor Translator"
-msgstr "Devenir un Traducteur Tor"
+msgstr "Devenir traducteur de Tor"
 
 #: translate.page:12
 msgid ""
@@ -1505,21 +1505,21 @@ msgstr ""
 
 #: translate.page:21
 msgid "Signing up on Transifex"
-msgstr "Inscription sur Transifex"
+msgstr "S’inscrire sur Transifex"
 
 #: translate.page:24
 msgid ""
 "Head over to the https://transifex.com/signup/\;>Transifex "
 "signup page."
 msgstr ""
-"Dirigez-vous vers la https://transifex.com/signup/\;>page "
+"Rendez-vous sur la https://transifex.com/signup/\;>page "
 "d'inscription de Transifex."
 
 #: translate.page:30
 msgid "Enter your information into the fields and click the 'Sign Up' button:"
 msgstr ""
-"Remplissez les champs avec vos informations et cliquez sur le bouton « "
-"S'inscrire » :"
+"Remplissez les champs avec vos renseignements et cliquez sur le bouton « "
+"S’inscrire » :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1540,7 +1540,7 @@ msgid ""
 "\"Translator\" from the drop-down menus:"
 msgstr ""
 "Remplissez la page suivante avec votre nom et choisissez « Localisation » 
et"
-" « Traducteur » dans les menus déroulants :"
+" « Traducteur » dans les menus déroulants :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to

___
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-11-15 Thread translation
commit 72bb5e7930b302d2c66c91040af3eed31aaac24b
Author: Translation commit bot 
Date:   Thu Nov 15 22:17:50 2018 +

Update translations for tor-browser-manual
---
 fr/fr.po | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/fr/fr.po b/fr/fr.po
index 3582a2f63..5e331287b 100644
--- a/fr/fr.po
+++ b/fr/fr.po
@@ -765,8 +765,8 @@ msgstr ""
 #: managing-identities.page:6
 msgid "Learn how to control personally-identifying information in Tor Browser"
 msgstr ""
-"Apprendre à contrôler les informations permettant d’identifier les 
personnes"
-" dans le Navigateur Tor"
+"Apprenez à contrôler dans le Navigateur Tor les renseignements permettant "
+"d’identifier quelqu’un"
 
 #: managing-identities.page:10
 msgid "Managing identities"
@@ -1202,14 +1202,14 @@ msgid ""
 " many websites from displaying correctly, so Tor Browser’s default setting "
 "is to allow all websites to run scripts in \"Standard\" mode."
 msgstr ""
-"Les utilisateurs qui nécessitent un niveau de sécurité élevé 
lorsqu’ils "
+"Les utilisateurs qui exigent un niveau de sécurité élevé quand ils "
 "parcourent le Web devraient régler le curseur"
 " de sécurité du Navigateur Tor à « Plus sûr » (ce qui 
désactive le "
 "JavaScript pour les sites Web sans HTTPS) ou « Le plus sûr » (ce qui le 
fait"
 " pour tous les sites Web). Cependant, la désactivation du JavaScript "
 "empêchera de nombreux sites Web de s’afficher correctement, et c’est "
-"pourquoi les paramètres par défaut du Navigateur Tor permettent aux sites "
-"Web d’exécuter des scripts dans le mode « Standard »."
+"pourquoi les paramètres par défaut du Navigateur Tor permettent à tous les 
"
+"sites Web d’exécuter des scripts en mode « Normal »."
 
 #: plugins.page:59
 msgid "Browser Add-ons"
@@ -1243,7 +1243,7 @@ msgstr ""
 #: secure-connections.page:8
 msgid "Learn how to protect your data using Tor Browser and HTTPS"
 msgstr ""
-"Apprendre comment protéger vos données en utilisant le Navigateur Tor et "
+"Apprenez comment protéger vos données en utilisant le Navigateur Tor et "
 "HTTPS"
 
 #: secure-connections.page:12
@@ -1353,7 +1353,7 @@ msgstr "Si Tor est utilisé ou non."
 
 #: security-slider.page:6
 msgid "Configuring Tor Browser for security and usability"
-msgstr "Configurer le Navigateur Tor pour la sécurité et la facilité 
d’emploi"
+msgstr "Configurez le Navigateur Tor pour la sécurité et la facilité 
d’emploi"
 
 #: security-slider.page:10
 msgid "Security Slider"
@@ -1482,11 +1482,11 @@ msgstr ""
 
 #: translate.page:6
 msgid "Becoming a translator for the Tor Project"
-msgstr "Devenir un traducteur pour le Projet Tor"
+msgstr "Devenez traducteur pour le Projet Tor"
 
 #: translate.page:10
 msgid "Becoming a Tor Translator"
-msgstr "Devenir un Traducteur Tor"
+msgstr "Devenir traducteur de Tor"
 
 #: translate.page:12
 msgid ""
@@ -1505,21 +1505,21 @@ msgstr ""
 
 #: translate.page:21
 msgid "Signing up on Transifex"
-msgstr "Inscription sur Transifex"
+msgstr "S’inscrire sur Transifex"
 
 #: translate.page:24
 msgid ""
 "Head over to the https://transifex.com/signup/\;>Transifex "
 "signup page."
 msgstr ""
-"Dirigez-vous vers la https://transifex.com/signup/\;>page "
+"Rendez-vous sur la https://transifex.com/signup/\;>page "
 "d'inscription de Transifex."
 
 #: translate.page:30
 msgid "Enter your information into the fields and click the 'Sign Up' button:"
 msgstr ""
-"Remplissez les champs avec vos informations et cliquez sur le bouton « "
-"S'inscrire » :"
+"Remplissez les champs avec vos renseignements et cliquez sur le bouton « "
+"S’inscrire » :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to
@@ -1540,7 +1540,7 @@ msgid ""
 "\"Translator\" from the drop-down menus:"
 msgstr ""
 "Remplissez la page suivante avec votre nom et choisissez « Localisation » 
et"
-" « Traducteur » dans les menus déroulants :"
+" « Traducteur » dans les menus déroulants :"
 
 #. This is a reference to an external file such as an image or video. When
 #. the file changes, the md5 hash will change to let you know you need to

___
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 remote-tracking branch 'public/ticket27686_034' into maint-0.3.4

2018-11-15 Thread nickm
commit fe1fb4b0c3ed175eccacbc1491ccab75375173bb
Merge: 80a6228aa ab92f9342
Author: Nick Mathewson 
Date:   Thu Nov 15 17:01:54 2018 -0500

Merge remote-tracking branch 'public/ticket27686_034' into maint-0.3.4

 src/or/circuitlist.c | 21 ++---
 src/or/connection_edge.c | 23 ++-
 src/or/connection_edge.h |  6 +-
 src/or/relay.c   |  2 +-
 4 files changed, 46 insertions(+), 6 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] Use the correct function signatures in test_relaycell.c

2018-11-15 Thread nickm
commit 6d33f65638734593d10c5c3a5e2eb9d7bdff8000
Author: Nick Mathewson 
Date:   Tue Sep 18 15:07:02 2018 -0400

Use the correct function signatures in test_relaycell.c

This is now officially an antipattern: please let's never copy a
function declaration in two places again.  That's what headers are
for.
---
 src/or/connection_edge.c  |  5 
 src/or/connection_edge.h  |  6 +
 src/test/test_relaycell.c | 65 ---
 3 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 1060e7461..3170dc493 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -136,11 +136,6 @@ static int connection_ap_process_natd(entry_connection_t 
*conn);
 static int connection_exit_connect_dir(edge_connection_t *exitconn);
 static int consider_plaintext_ports(entry_connection_t *conn, uint16_t port);
 static int connection_ap_supports_optimistic_data(const entry_connection_t *);
-STATIC void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-STATIC half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
 
 /** An AP stream has failed/finished. If it hasn't already sent back
  * a socks reply, send one now (based on endreason). Also set
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index 6dbba014c..c607c963e 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -202,6 +202,12 @@ STATIC void 
connection_ap_handshake_rewrite(entry_connection_t *conn,
 rewrite_result_t *out);
 
 STATIC int connection_ap_process_http_connect(entry_connection_t *conn);
+struct half_edge_t;
+STATIC void connection_half_edge_add(const edge_connection_t *conn,
+ origin_circuit_t *circ);
+STATIC struct half_edge_t *connection_half_edge_find_stream_id(
+ const smartlist_t *half_conns,
+ streamid_t stream_id);
 #endif /* defined(CONNECTION_EDGE_PRIVATE) */
 
 #endif /* !defined(TOR_CONNECTION_EDGE_H) */
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index ee495cada..2fc0288f6 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -5,6 +5,9 @@
 
 #define RELAY_PRIVATE
 #define CIRCUITLIST_PRIVATE
+#define CONNECTION_EDGE_PRIVATE
+#define CONNECTION_PRIVATE
+
 #include "or.h"
 #include "main.h"
 #include "config.h"
@@ -18,6 +21,11 @@
 #include "relay.h"
 #include "test.h"
 
+#include "log_test_helpers.h"
+
+#include "circpathbias.h"
+#include "connection_edge.h"
+
 static int srm_ncalls;
 static entry_connection_t *srm_conn;
 static int srm_atype;
@@ -27,23 +35,6 @@ static uint8_t srm_answer[512];
 static int srm_ttl;
 static time_t srm_expires;
 
-void connection_free_minimal(connection_t*);
-int connected_cell_format_payload(uint8_t *payload_out,
-  const tor_addr_t *addr,
-  uint32_t ttl);
-void pathbias_count_valid_cells(origin_circuit_t *circ,
-cell_t *cell);
-half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
-void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-
-int mock_send_command(streamid_t stream_id, circuit_t *circ,
-   uint8_t relay_command, const char *payload,
-   size_t payload_len, crypt_path_t *cpath_layer,
-   const char *filename, int lineno);
-
 /* Mock replacement for connection_ap_hannshake_socks_resolved() */
 static void
 socks_resolved_mock(entry_connection_t *conn,
@@ -143,7 +134,7 @@ mock_start_reading(connection_t *conn)
   return;
 }
 
-int
+static int
 mock_send_command(streamid_t stream_id, circuit_t *circ,
uint8_t relay_command, const char *payload,
size_t payload_len, crypt_path_t *cpath_layer,
@@ -230,7 +221,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Data cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_DATA, "Data1234");
   if (circ->base_.purpose == CIRCUIT_PURPOSE_PATH_BIAS_TESTING)
-pathbias_count_valid_cells(circ, );
+pathbias_count_valid_cells(TO_CIRCUIT(circ), );
   else
 connection_edge_process_relay_cell(, TO_CIRCUIT(circ), NULL,
circ->cpath);
@@ -239,7 +230,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Sendme cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_SENDME, "Data1234");
  

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

2018-11-15 Thread nickm
commit 773ae169eb5e20a29f41e839709230dec424ef89
Merge: f46fcb6d3 1b4075cb2
Author: Nick Mathewson 
Date:   Thu Nov 15 17:08:34 2018 -0500

Merge branch 'maint-0.3.5' into release-0.3.5

___
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-11-15 Thread nickm
commit 1b4075cb272a6f9a14cd0e0b8c73d359666fc479
Merge: 8af8ecabb fe1fb4b0c
Author: Nick Mathewson 
Date:   Thu Nov 15 17:08:04 2018 -0500

Merge branch 'maint-0.3.4' into maint-0.3.5

"ours" merge to avoid taking 25573 and 27686 again.




___
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-11-15 Thread nickm
commit 8517e2d6e9cf1500a1cb531c3bcf49004045989e
Merge: 60bc9675d fe1fb4b0c
Author: Nick Mathewson 
Date:   Thu Nov 15 17:08:34 2018 -0500

Merge branch 'maint-0.3.4' into release-0.3.4

 changes/ticket25573   |   5 +
 src/common/container.c|   2 +-
 src/common/container.h|   2 +-
 src/or/circpathbias.c |  63 +
 src/or/circpathbias.h |   1 +
 src/or/circuitbuild.c |   3 +-
 src/or/circuitbuild.h |   3 +-
 src/or/circuitlist.c  |  25 +-
 src/or/connection_edge.c  | 241 +
 src/or/connection_edge.h  |  23 +-
 src/or/or.h   |  25 ++
 src/or/relay.c|  77 +-
 src/test/test_relaycell.c | 641 ++
 13 files changed, 1057 insertions(+), 54 deletions(-)

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


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

2018-11-15 Thread nickm
commit be88f12b7f6b86cd44f155bb841f943d6af1f1d7
Merge: d612f7d95 1b4075cb2
Author: Nick Mathewson 
Date:   Thu Nov 15 17:08:34 2018 -0500

Merge branch 'maint-0.3.5'

___
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 'public/ticket27686_034' into maint-0.3.4

2018-11-15 Thread nickm
commit fe1fb4b0c3ed175eccacbc1491ccab75375173bb
Merge: 80a6228aa ab92f9342
Author: Nick Mathewson 
Date:   Thu Nov 15 17:01:54 2018 -0500

Merge remote-tracking branch 'public/ticket27686_034' into maint-0.3.4

 src/or/circuitlist.c | 21 ++---
 src/or/connection_edge.c | 23 ++-
 src/or/connection_edge.h |  6 +-
 src/or/relay.c   |  2 +-
 4 files changed, 46 insertions(+), 6 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.4] Merge branch 'bug25573-034-typefix' into maint-0.3.4

2018-11-15 Thread nickm
commit 80a6228aacc9083fae07d4373d9c41017420e6b9
Merge: 15e752e6b 6d33f6563
Author: Nick Mathewson 
Date:   Thu Nov 15 16:58:16 2018 -0500

Merge branch 'bug25573-034-typefix' into maint-0.3.4

 changes/ticket25573   |   5 +
 src/common/container.c|   2 +-
 src/common/container.h|   2 +-
 src/or/circpathbias.c |  63 +
 src/or/circpathbias.h |   1 +
 src/or/circuitbuild.c |   3 +-
 src/or/circuitbuild.h |   3 +-
 src/or/circuitlist.c  |   8 +
 src/or/connection_edge.c  | 220 
 src/or/connection_edge.h  |  17 ++
 src/or/or.h   |  25 ++
 src/or/relay.c|  75 +-
 src/test/test_relaycell.c | 641 ++
 13 files changed, 1014 insertions(+), 51 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 'bug25573-034-typefix' into maint-0.3.4

2018-11-15 Thread nickm
commit 80a6228aacc9083fae07d4373d9c41017420e6b9
Merge: 15e752e6b 6d33f6563
Author: Nick Mathewson 
Date:   Thu Nov 15 16:58:16 2018 -0500

Merge branch 'bug25573-034-typefix' into maint-0.3.4

 changes/ticket25573   |   5 +
 src/common/container.c|   2 +-
 src/common/container.h|   2 +-
 src/or/circpathbias.c |  63 +
 src/or/circpathbias.h |   1 +
 src/or/circuitbuild.c |   3 +-
 src/or/circuitbuild.h |   3 +-
 src/or/circuitlist.c  |   8 +
 src/or/connection_edge.c  | 220 
 src/or/connection_edge.h  |  17 ++
 src/or/or.h   |  25 ++
 src/or/relay.c|  75 +-
 src/test/test_relaycell.c | 641 ++
 13 files changed, 1014 insertions(+), 51 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 'public/ticket27686_034' into maint-0.3.4

2018-11-15 Thread nickm
commit fe1fb4b0c3ed175eccacbc1491ccab75375173bb
Merge: 80a6228aa ab92f9342
Author: Nick Mathewson 
Date:   Thu Nov 15 17:01:54 2018 -0500

Merge remote-tracking branch 'public/ticket27686_034' into maint-0.3.4

 src/or/circuitlist.c | 21 ++---
 src/or/connection_edge.c | 23 ++-
 src/or/connection_edge.h |  6 +-
 src/or/relay.c   |  2 +-
 4 files changed, 46 insertions(+), 6 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.4] Teach the OOM module to handle half-open stream info. #27686

2018-11-15 Thread nickm
commit ab92f934212f0f91f74cd17127d20a28cc1e
Author: Nick Mathewson 
Date:   Fri Sep 14 10:16:27 2018 -0400

Teach the OOM module to handle half-open stream info. #27686
---
 src/or/circuitlist.c | 21 ++---
 src/or/connection_edge.c | 24 ++--
 src/or/connection_edge.h |  6 +-
 src/or/relay.c   |  2 +-
 4 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index a1efe9b74..ad9b902ac 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1042,9 +1042,9 @@ circuit_free_(circuit_t *circ)
 circuit_remove_from_origin_circuit_list(ocirc);
 
 if (ocirc->half_streams) {
-  SMARTLIST_FOREACH_BEGIN(ocirc->half_streams, half_edge_t*,
+  SMARTLIST_FOREACH_BEGIN(ocirc->half_streams, half_edge_t *,
   half_conn) {
-  tor_free(half_conn);
+half_edge_free(half_conn);
   } SMARTLIST_FOREACH_END(half_conn);
   smartlist_free(ocirc->half_streams);
 }
@@ -2324,6 +2324,20 @@ n_cells_in_circ_queues(const circuit_t *c)
   return n;
 }
 
+/** Return the number of bytes allocated for c's half-open streams. */
+static size_t
+circuit_alloc_in_half_streams(const circuit_t *c)
+{
+  if (! CIRCUIT_IS_ORIGIN(c)) {
+return 0;
+  }
+  const origin_circuit_t *ocirc = CONST_TO_ORIGIN_CIRCUIT(c);
+  if (ocirc->half_streams)
+return smartlist_len(ocirc->half_streams) * sizeof(half_edge_t);
+  else
+return 0;
+}
+
 /**
  * Return the age of the oldest cell queued on c, in timestamp units.
  * Return 0 if there are no cells queued on c.  Requires that now be
@@ -2558,6 +2572,7 @@ circuits_handle_oom(size_t current_allocation)
 
 /* Now, kill the circuit. */
 n = n_cells_in_circ_queues(circ);
+const size_t half_stream_alloc = circuit_alloc_in_half_streams(circ);
 if (! circ->marked_for_close) {
   circuit_mark_for_close(circ, END_CIRC_REASON_RESOURCELIMIT);
 }
@@ -2567,6 +2582,7 @@ circuits_handle_oom(size_t current_allocation)
 ++n_circuits_killed;
 
 mem_recovered += n * packed_cell_mem_cost();
+mem_recovered += half_stream_alloc;
 mem_recovered += freed;
 
 if (mem_recovered >= mem_to_recover)
@@ -2711,4 +2727,3 @@ assert_circuit_ok,(const circuit_t *c))
 tor_assert(!or_circ || !or_circ->rend_splice);
   }
 }
-
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 1060e7461..eea364ffd 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -477,6 +477,9 @@ connection_half_edge_compare_bsearch(const void *key, const 
void **member)
   return *(const streamid_t*)key - e2->stream_id;
 }
 
+/** Total number of half_edge_t objects allocated */
+static size_t n_half_conns_allocated = 0;
+
 /**
  * Add a half-closed connection to the list, to watch for activity.
  *
@@ -501,6 +504,7 @@ connection_half_edge_add(const edge_connection_t *conn,
   }
 
   half_conn = tor_malloc_zero(sizeof(half_edge_t));
+  ++n_half_conns_allocated;
 
   if (!circ->half_streams) {
 circ->half_streams = smartlist_new();
@@ -530,6 +534,23 @@ connection_half_edge_add(const edge_connection_t *conn,
   smartlist_insert(circ->half_streams, insert_at, half_conn);
 }
 
+/** Release space held by he */
+void
+half_edge_free_(half_edge_t *he)
+{
+  if (!he)
+return;
+  --n_half_conns_allocated;
+  tor_free(he);
+}
+
+/** Return the number of bytes devoted to storing info on half-open streams. */
+size_t
+half_streams_get_total_allocation(void)
+{
+  return n_half_conns_allocated * sizeof(half_edge_t);
+}
+
 /**
  * Find a stream_id_t in the list in O(lg(n)).
  *
@@ -650,7 +671,7 @@ connection_half_edge_is_valid_end(smartlist_t *half_conns,
 
   half = smartlist_get(half_conns, remove_idx);
   smartlist_del_keeporder(half_conns, remove_idx);
-  tor_free(half);
+  half_edge_free(half);
   return 1;
 }
 
@@ -4412,4 +4433,3 @@ connection_edge_free_all(void)
   pending_entry_connections = NULL;
   mainloop_event_free(attach_pending_entry_connections_ev);
 }
-
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index 6dbba014c..7bef01e40 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -133,6 +133,11 @@ int connection_half_edge_is_valid_end(smartlist_t 
*half_conns,
 int connection_half_edge_is_valid_resolved(smartlist_t *half_conns,
streamid_t stream_id);
 
+size_t half_streams_get_total_allocation(void);
+void half_edge_free_(half_edge_t *he);
+#define half_edge_free(he) \
+  FREE_AND_NULL(half_edge_t, half_edge_free_, (he))
+
 /** @name Begin-cell flags
  *
  * These flags are used in RELAY_BEGIN cells to change the default behavior
@@ -205,4 +210,3 @@ STATIC int 
connection_ap_process_http_connect(entry_connection_t *conn);
 #endif /* defined(CONNECTION_EDGE_PRIVATE) */
 
 #endif /* !defined(TOR_CONNECTION_EDGE_H) */
-
diff --git a/src/or/relay.c b/src/or/relay.c
index 81bb94d5a..497afe756 100644
--- 

[tor-commits] [tor/release-0.3.4] Mark smartlist_bsearch as taking a const list.

2018-11-15 Thread nickm
commit dac7d929185e5f2643a29fc046ee439a826239eb
Author: Mike Perry 
Date:   Sat Aug 25 00:26:42 2018 +

Mark smartlist_bsearch as taking a const list.

It does not modify the actual list.
---
 src/common/container.c | 2 +-
 src/common/container.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common/container.c b/src/common/container.c
index 5386e6458..72ad3a925 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -628,7 +628,7 @@ smartlist_uniq(smartlist_t *sl,
  * less than member, and greater than 0 if key is greater then member.
  */
 void *
-smartlist_bsearch(smartlist_t *sl, const void *key,
+smartlist_bsearch(const smartlist_t *sl, const void *key,
   int (*compare)(const void *key, const void **member))
 {
   int found, idx;
diff --git a/src/common/container.h b/src/common/container.h
index 5d2dce541..7457c1e91 100644
--- a/src/common/container.h
+++ b/src/common/container.h
@@ -120,7 +120,7 @@ const uint8_t 
*smartlist_get_most_frequent_digest256(smartlist_t *sl);
 void smartlist_uniq_strings(smartlist_t *sl);
 void smartlist_uniq_digests(smartlist_t *sl);
 void smartlist_uniq_digests256(smartlist_t *sl);
-void *smartlist_bsearch(smartlist_t *sl, const void *key,
+void *smartlist_bsearch(const smartlist_t *sl, const void *key,
 int (*compare)(const void *key, const void **member));
 int smartlist_bsearch_idx(const smartlist_t *sl, const void *key,
   int (*compare)(const void *key, const void **member),



___
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-11-15 Thread nickm
commit 1b4075cb272a6f9a14cd0e0b8c73d359666fc479
Merge: 8af8ecabb fe1fb4b0c
Author: Nick Mathewson 
Date:   Thu Nov 15 17:08:04 2018 -0500

Merge branch 'maint-0.3.4' into maint-0.3.5

"ours" merge to avoid taking 25573 and 27686 again.

___
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] Use the correct function signatures in test_relaycell.c

2018-11-15 Thread nickm
commit 6d33f65638734593d10c5c3a5e2eb9d7bdff8000
Author: Nick Mathewson 
Date:   Tue Sep 18 15:07:02 2018 -0400

Use the correct function signatures in test_relaycell.c

This is now officially an antipattern: please let's never copy a
function declaration in two places again.  That's what headers are
for.
---
 src/or/connection_edge.c  |  5 
 src/or/connection_edge.h  |  6 +
 src/test/test_relaycell.c | 65 ---
 3 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 1060e7461..3170dc493 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -136,11 +136,6 @@ static int connection_ap_process_natd(entry_connection_t 
*conn);
 static int connection_exit_connect_dir(edge_connection_t *exitconn);
 static int consider_plaintext_ports(entry_connection_t *conn, uint16_t port);
 static int connection_ap_supports_optimistic_data(const entry_connection_t *);
-STATIC void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-STATIC half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
 
 /** An AP stream has failed/finished. If it hasn't already sent back
  * a socks reply, send one now (based on endreason). Also set
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index 6dbba014c..c607c963e 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -202,6 +202,12 @@ STATIC void 
connection_ap_handshake_rewrite(entry_connection_t *conn,
 rewrite_result_t *out);
 
 STATIC int connection_ap_process_http_connect(entry_connection_t *conn);
+struct half_edge_t;
+STATIC void connection_half_edge_add(const edge_connection_t *conn,
+ origin_circuit_t *circ);
+STATIC struct half_edge_t *connection_half_edge_find_stream_id(
+ const smartlist_t *half_conns,
+ streamid_t stream_id);
 #endif /* defined(CONNECTION_EDGE_PRIVATE) */
 
 #endif /* !defined(TOR_CONNECTION_EDGE_H) */
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index ee495cada..2fc0288f6 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -5,6 +5,9 @@
 
 #define RELAY_PRIVATE
 #define CIRCUITLIST_PRIVATE
+#define CONNECTION_EDGE_PRIVATE
+#define CONNECTION_PRIVATE
+
 #include "or.h"
 #include "main.h"
 #include "config.h"
@@ -18,6 +21,11 @@
 #include "relay.h"
 #include "test.h"
 
+#include "log_test_helpers.h"
+
+#include "circpathbias.h"
+#include "connection_edge.h"
+
 static int srm_ncalls;
 static entry_connection_t *srm_conn;
 static int srm_atype;
@@ -27,23 +35,6 @@ static uint8_t srm_answer[512];
 static int srm_ttl;
 static time_t srm_expires;
 
-void connection_free_minimal(connection_t*);
-int connected_cell_format_payload(uint8_t *payload_out,
-  const tor_addr_t *addr,
-  uint32_t ttl);
-void pathbias_count_valid_cells(origin_circuit_t *circ,
-cell_t *cell);
-half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
-void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-
-int mock_send_command(streamid_t stream_id, circuit_t *circ,
-   uint8_t relay_command, const char *payload,
-   size_t payload_len, crypt_path_t *cpath_layer,
-   const char *filename, int lineno);
-
 /* Mock replacement for connection_ap_hannshake_socks_resolved() */
 static void
 socks_resolved_mock(entry_connection_t *conn,
@@ -143,7 +134,7 @@ mock_start_reading(connection_t *conn)
   return;
 }
 
-int
+static int
 mock_send_command(streamid_t stream_id, circuit_t *circ,
uint8_t relay_command, const char *payload,
size_t payload_len, crypt_path_t *cpath_layer,
@@ -230,7 +221,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Data cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_DATA, "Data1234");
   if (circ->base_.purpose == CIRCUIT_PURPOSE_PATH_BIAS_TESTING)
-pathbias_count_valid_cells(circ, );
+pathbias_count_valid_cells(TO_CIRCUIT(circ), );
   else
 connection_edge_process_relay_cell(, TO_CIRCUIT(circ), NULL,
circ->cpath);
@@ -239,7 +230,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Sendme cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_SENDME, "Data1234");
  

[tor-commits] [tor/release-0.3.4] Fix duplicate declaration of pathbias_count_valid_cells.

2018-11-15 Thread nickm
commit 7fd61cf536543283353b618d5bba9a1db637ed14
Author: Nick Mathewson 
Date:   Sun Sep 16 13:45:43 2018 -0400

Fix duplicate declaration of pathbias_count_valid_cells.
---
 src/test/test_relaycell.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index 3f84ee830..ee495cada 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -31,8 +31,8 @@ void connection_free_minimal(connection_t*);
 int connected_cell_format_payload(uint8_t *payload_out,
   const tor_addr_t *addr,
   uint32_t ttl);
-int pathbias_count_valid_cells(origin_circuit_t *circ,
-  cell_t *cell);
+void pathbias_count_valid_cells(origin_circuit_t *circ,
+cell_t *cell);
 half_edge_t *connection_half_edge_find_stream_id(
 const smartlist_t *half_conns,
 streamid_t stream_id);
@@ -1072,4 +1072,3 @@ struct testcase_t relaycell_tests[] = {
   { "streamwrap", test_halfstream_wrap, TT_FORK, NULL, NULL },
   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] Use the correct function signatures in test_relaycell.c

2018-11-15 Thread nickm
commit 6d33f65638734593d10c5c3a5e2eb9d7bdff8000
Author: Nick Mathewson 
Date:   Tue Sep 18 15:07:02 2018 -0400

Use the correct function signatures in test_relaycell.c

This is now officially an antipattern: please let's never copy a
function declaration in two places again.  That's what headers are
for.
---
 src/or/connection_edge.c  |  5 
 src/or/connection_edge.h  |  6 +
 src/test/test_relaycell.c | 65 ---
 3 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 1060e7461..3170dc493 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -136,11 +136,6 @@ static int connection_ap_process_natd(entry_connection_t 
*conn);
 static int connection_exit_connect_dir(edge_connection_t *exitconn);
 static int consider_plaintext_ports(entry_connection_t *conn, uint16_t port);
 static int connection_ap_supports_optimistic_data(const entry_connection_t *);
-STATIC void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-STATIC half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
 
 /** An AP stream has failed/finished. If it hasn't already sent back
  * a socks reply, send one now (based on endreason). Also set
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index 6dbba014c..c607c963e 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -202,6 +202,12 @@ STATIC void 
connection_ap_handshake_rewrite(entry_connection_t *conn,
 rewrite_result_t *out);
 
 STATIC int connection_ap_process_http_connect(entry_connection_t *conn);
+struct half_edge_t;
+STATIC void connection_half_edge_add(const edge_connection_t *conn,
+ origin_circuit_t *circ);
+STATIC struct half_edge_t *connection_half_edge_find_stream_id(
+ const smartlist_t *half_conns,
+ streamid_t stream_id);
 #endif /* defined(CONNECTION_EDGE_PRIVATE) */
 
 #endif /* !defined(TOR_CONNECTION_EDGE_H) */
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index ee495cada..2fc0288f6 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -5,6 +5,9 @@
 
 #define RELAY_PRIVATE
 #define CIRCUITLIST_PRIVATE
+#define CONNECTION_EDGE_PRIVATE
+#define CONNECTION_PRIVATE
+
 #include "or.h"
 #include "main.h"
 #include "config.h"
@@ -18,6 +21,11 @@
 #include "relay.h"
 #include "test.h"
 
+#include "log_test_helpers.h"
+
+#include "circpathbias.h"
+#include "connection_edge.h"
+
 static int srm_ncalls;
 static entry_connection_t *srm_conn;
 static int srm_atype;
@@ -27,23 +35,6 @@ static uint8_t srm_answer[512];
 static int srm_ttl;
 static time_t srm_expires;
 
-void connection_free_minimal(connection_t*);
-int connected_cell_format_payload(uint8_t *payload_out,
-  const tor_addr_t *addr,
-  uint32_t ttl);
-void pathbias_count_valid_cells(origin_circuit_t *circ,
-cell_t *cell);
-half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
-void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-
-int mock_send_command(streamid_t stream_id, circuit_t *circ,
-   uint8_t relay_command, const char *payload,
-   size_t payload_len, crypt_path_t *cpath_layer,
-   const char *filename, int lineno);
-
 /* Mock replacement for connection_ap_hannshake_socks_resolved() */
 static void
 socks_resolved_mock(entry_connection_t *conn,
@@ -143,7 +134,7 @@ mock_start_reading(connection_t *conn)
   return;
 }
 
-int
+static int
 mock_send_command(streamid_t stream_id, circuit_t *circ,
uint8_t relay_command, const char *payload,
size_t payload_len, crypt_path_t *cpath_layer,
@@ -230,7 +221,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Data cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_DATA, "Data1234");
   if (circ->base_.purpose == CIRCUIT_PURPOSE_PATH_BIAS_TESTING)
-pathbias_count_valid_cells(circ, );
+pathbias_count_valid_cells(TO_CIRCUIT(circ), );
   else
 connection_edge_process_relay_cell(, TO_CIRCUIT(circ), NULL,
circ->cpath);
@@ -239,7 +230,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Sendme cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_SENDME, "Data1234");
  

[tor-commits] [tor/maint-0.3.5] Merge remote-tracking branch 'public/ticket27686_034' into maint-0.3.4

2018-11-15 Thread nickm
commit fe1fb4b0c3ed175eccacbc1491ccab75375173bb
Merge: 80a6228aa ab92f9342
Author: Nick Mathewson 
Date:   Thu Nov 15 17:01:54 2018 -0500

Merge remote-tracking branch 'public/ticket27686_034' into maint-0.3.4

 src/or/circuitlist.c | 21 ++---
 src/or/connection_edge.c | 23 ++-
 src/or/connection_edge.h |  6 +-
 src/or/relay.c   |  2 +-
 4 files changed, 46 insertions(+), 6 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 'bug25573-034-typefix' into maint-0.3.4

2018-11-15 Thread nickm
commit 80a6228aacc9083fae07d4373d9c41017420e6b9
Merge: 15e752e6b 6d33f6563
Author: Nick Mathewson 
Date:   Thu Nov 15 16:58:16 2018 -0500

Merge branch 'bug25573-034-typefix' into maint-0.3.4

 changes/ticket25573   |   5 +
 src/common/container.c|   2 +-
 src/common/container.h|   2 +-
 src/or/circpathbias.c |  63 +
 src/or/circpathbias.h |   1 +
 src/or/circuitbuild.c |   3 +-
 src/or/circuitbuild.h |   3 +-
 src/or/circuitlist.c  |   8 +
 src/or/connection_edge.c  | 220 
 src/or/connection_edge.h  |  17 ++
 src/or/or.h   |  25 ++
 src/or/relay.c|  75 +-
 src/test/test_relaycell.c | 641 ++
 13 files changed, 1014 insertions(+), 51 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.4] Ticket #25573: Track half-closed stream ids

2018-11-15 Thread nickm
commit c56f63eadbc5b83b48e57235b194bd8f76b534bb
Author: Mike Perry 
Date:   Sat Aug 4 19:38:38 2018 +

Ticket #25573: Track half-closed stream ids

We allow their CONNECTEDs, RESOLVEDs, ENDs, SENDMEs, and DATA cells to not
count as dropped until the windows are empty, or we get an END.

This commit does not change behavior. It only changes CIRC_BW event field
values.
---
 changes/ticket25573   |   5 +
 src/or/circpathbias.c |  53 +
 src/or/circpathbias.h |   1 +
 src/or/circuitlist.c  |   8 +
 src/or/connection_edge.c  | 220 ++
 src/or/connection_edge.h  |  11 +
 src/or/or.h   |  25 +++
 src/or/relay.c|  66 +-
 src/test/test_relaycell.c | 561 +++---
 9 files changed, 912 insertions(+), 38 deletions(-)

diff --git a/changes/ticket25573 b/changes/ticket25573
new file mode 100644
index 0..9939601b5
--- /dev/null
+++ b/changes/ticket25573
@@ -0,0 +1,5 @@
+  o Minor features (controller):
+- For purposes of CIRC_BW-based dropped cell detection, track half-closed
+  stream ids, and allow their ENDs, SENDMEs, DATA and path bias check
+  cells to arrive without counting it as dropped until either the END 
arrvies,
+  or the windows are empty. Closes ticket 25573.
diff --git a/src/or/circpathbias.c b/src/or/circpathbias.c
index ff42bf91e..923941e5b 100644
--- a/src/or/circpathbias.c
+++ b/src/or/circpathbias.c
@@ -893,6 +893,7 @@ pathbias_check_probe_response(circuit_t *circ, const cell_t 
*cell)
 /* Check nonce */
 if (ipv4_host == ocirc->pathbias_probe_nonce) {
   pathbias_mark_use_success(ocirc);
+  circuit_read_valid_data(ocirc, rh.length);
   circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED);
   log_info(LD_CIRC,
"Got valid path bias probe back for circ %d, stream %d.",
@@ -914,6 +915,58 @@ pathbias_check_probe_response(circuit_t *circ, const 
cell_t *cell)
 }
 
 /**
+ * Check if a cell is counts as valid data for a circuit,
+ * and if so, count it as valid.
+ */
+void
+pathbias_count_valid_cells(circuit_t *circ, const cell_t *cell)
+{
+  origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
+  relay_header_t rh;
+
+  relay_header_unpack(, cell->payload);
+
+  /* Check to see if this is a cell from a previous connection,
+   * or is a request to close the circuit. */
+  switch (rh.command) {
+case RELAY_COMMAND_END:
+  if (connection_half_edge_is_valid_end(ocirc->half_streams,
+ rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+
+case RELAY_COMMAND_DATA:
+  if (connection_half_edge_is_valid_data(ocirc->half_streams,
+ rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+
+case RELAY_COMMAND_SENDME:
+  if (connection_half_edge_is_valid_sendme(ocirc->half_streams,
+ rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+
+case RELAY_COMMAND_CONNECTED:
+  if (connection_half_edge_is_valid_connected(ocirc->half_streams,
+  rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+
+case RELAY_COMMAND_RESOLVED:
+  if (connection_half_edge_is_valid_resolved(ocirc->half_streams,
+ rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+  }
+}
+
+/**
  * Check if a circuit was used and/or closed successfully.
  *
  * If we attempted to use the circuit to carry a stream but failed
diff --git a/src/or/circpathbias.h b/src/or/circpathbias.h
index c9e572d2a..689b2a620 100644
--- a/src/or/circpathbias.h
+++ b/src/or/circpathbias.h
@@ -20,6 +20,7 @@ void pathbias_count_build_success(origin_circuit_t *circ);
 int pathbias_count_build_attempt(origin_circuit_t *circ);
 int pathbias_check_close(origin_circuit_t *circ, int reason);
 int pathbias_check_probe_response(circuit_t *circ, const cell_t *cell);
+void pathbias_count_valid_cells(circuit_t *circ, const cell_t *cell);
 void pathbias_count_use_attempt(origin_circuit_t *circ);
 void pathbias_mark_use_success(origin_circuit_t *circ);
 void pathbias_mark_use_rollback(origin_circuit_t *circ);
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 45fff7cc1..a1efe9b74 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1041,6 +1041,14 @@ circuit_free_(circuit_t *circ)
 
 circuit_remove_from_origin_circuit_list(ocirc);
 
+if (ocirc->half_streams) {
+  SMARTLIST_FOREACH_BEGIN(ocirc->half_streams, half_edge_t*,
+  half_conn) {
+  tor_free(half_conn);
+  } 

[tor-commits] [tor/release-0.3.4] Ticket #25573: Check half-opened stream ids when choosing a new one

2018-11-15 Thread nickm
commit 144647031aa9e7eacc6f7cdd8fed663c7229b2aa
Author: Mike Perry 
Date:   Wed Aug 29 00:06:38 2018 +

Ticket #25573: Check half-opened stream ids when choosing a new one

Avoid data corrupton by avoiding mixing up old stream ids with new ones.

This commit changes client behavior.
---
 src/or/connection_edge.c  |  5 
 src/test/test_relaycell.c | 60 +++
 2 files changed, 65 insertions(+)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 91cefe9ff..1060e7461 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -2813,6 +2813,11 @@ get_unique_stream_id_by_circ(origin_circuit_t *circ)
   for (tmpconn = circ->p_streams; tmpconn; tmpconn=tmpconn->next_stream)
 if (tmpconn->stream_id == test_stream_id)
   goto again;
+
+  if (connection_half_edge_find_stream_id(circ->half_streams,
+   test_stream_id))
+goto again;
+
   return test_stream_id;
 }
 
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index 1570e1516..4c406a9b7 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -618,6 +618,65 @@ test_halfstream_insertremove(void *arg)
 }
 
 static void
+test_halfstream_wrap(void *arg)
+{
+  origin_circuit_t *circ =
+  helper_create_origin_circuit(CIRCUIT_PURPOSE_C_GENERAL, 0);
+  edge_connection_t *edgeconn;
+  entry_connection_t *entryconn;
+
+  circ->cpath->state = CPATH_STATE_AWAITING_KEYS;
+  circ->cpath->deliver_window = CIRCWINDOW_START;
+
+  entryconn = fake_entry_conn(circ, 23);
+  edgeconn = ENTRY_TO_EDGE_CONN(entryconn);
+
+  (void)arg;
+
+  /* Suppress the WARN message we generate in this test */
+  setup_full_capture_of_logs(LOG_WARN);
+  MOCK(connection_mark_for_close_internal_, mock_mark_for_close);
+
+  /* Verify that get_unique_stream_id_by_circ() can wrap uint16_t */
+  circ->next_stream_id = 65530;
+  halfstream_insert(circ, edgeconn, NULL, 7, 0);
+  tt_int_op(circ->next_stream_id, OP_EQ, 2);
+  tt_int_op(smartlist_len(circ->half_streams), OP_EQ, 7);
+
+  /* Insert full-1 */
+  halfstream_insert(circ, edgeconn, NULL,
+65534-smartlist_len(circ->half_streams), 0);
+  tt_int_op(smartlist_len(circ->half_streams), OP_EQ, 65534);
+
+  /* Verify that we can get_unique_stream_id_by_circ() successfully */
+  edgeconn->stream_id = get_unique_stream_id_by_circ(circ);
+  tt_int_op(edgeconn->stream_id, OP_NE, 0); /* 0 is failure */
+
+  /* Insert an opened stream on the circ with that id */
+  ENTRY_TO_CONN(entryconn)->marked_for_close = 0;
+  ENTRY_TO_CONN(entryconn)->outbuf_flushlen = 0;
+  edgeconn->base_.state = AP_CONN_STATE_CONNECT_WAIT;
+  circ->p_streams = edgeconn;
+
+  /* Verify that get_unique_stream_id_by_circ() fails */
+  tt_int_op(get_unique_stream_id_by_circ(circ), OP_EQ, 0); /* 0 is failure */
+
+  /* eof the one opened stream. Verify it is now in half-closed */
+  tt_int_op(smartlist_len(circ->half_streams), OP_EQ, 65534);
+  connection_edge_reached_eof(edgeconn);
+  tt_int_op(smartlist_len(circ->half_streams), OP_EQ, 65535);
+
+  /* Verify get_unique_stream_id_by_circ() fails due to full half-closed */
+  circ->p_streams = NULL;
+  tt_int_op(get_unique_stream_id_by_circ(circ), OP_EQ, 0); /* 0 is failure */
+
+ done:
+  circuit_free_(TO_CIRCUIT(circ));
+  connection_free_minimal(ENTRY_TO_CONN(entryconn));
+  UNMOCK(connection_mark_for_close_internal_);
+}
+
+static void
 test_circbw_relay(void *arg)
 {
   cell_t cell;
@@ -992,6 +1051,7 @@ struct testcase_t relaycell_tests[] = {
   { "resolved", test_relaycell_resolved, TT_FORK, NULL, NULL },
   { "circbw", test_circbw_relay, TT_FORK, NULL, NULL },
   { "halfstream", test_halfstream_insertremove, TT_FORK, NULL, NULL },
+  { "streamwrap", test_halfstream_wrap, TT_FORK, NULL, NULL },
   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] Merge branch 'maint-0.3.4' into maint-0.3.5

2018-11-15 Thread nickm
commit 1b4075cb272a6f9a14cd0e0b8c73d359666fc479
Merge: 8af8ecabb fe1fb4b0c
Author: Nick Mathewson 
Date:   Thu Nov 15 17:08:04 2018 -0500

Merge branch 'maint-0.3.4' into maint-0.3.5

"ours" merge to avoid taking 25573 and 27686 again.




___
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 'bug25573-034-typefix' into maint-0.3.4

2018-11-15 Thread nickm
commit 80a6228aacc9083fae07d4373d9c41017420e6b9
Merge: 15e752e6b 6d33f6563
Author: Nick Mathewson 
Date:   Thu Nov 15 16:58:16 2018 -0500

Merge branch 'bug25573-034-typefix' into maint-0.3.4

 changes/ticket25573   |   5 +
 src/common/container.c|   2 +-
 src/common/container.h|   2 +-
 src/or/circpathbias.c |  63 +
 src/or/circpathbias.h |   1 +
 src/or/circuitbuild.c |   3 +-
 src/or/circuitbuild.h |   3 +-
 src/or/circuitlist.c  |   8 +
 src/or/connection_edge.c  | 220 
 src/or/connection_edge.h  |  17 ++
 src/or/or.h   |  25 ++
 src/or/relay.c|  75 +-
 src/test/test_relaycell.c | 641 ++
 13 files changed, 1014 insertions(+), 51 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.4] Merge remote-tracking branch 'public/ticket27686_034' into maint-0.3.4

2018-11-15 Thread nickm
commit fe1fb4b0c3ed175eccacbc1491ccab75375173bb
Merge: 80a6228aa ab92f9342
Author: Nick Mathewson 
Date:   Thu Nov 15 17:01:54 2018 -0500

Merge remote-tracking branch 'public/ticket27686_034' into maint-0.3.4

 src/or/circuitlist.c | 21 ++---
 src/or/connection_edge.c | 23 ++-
 src/or/connection_edge.h |  6 +-
 src/or/relay.c   |  2 +-
 4 files changed, 46 insertions(+), 6 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.4] Ticket #25573: Count TRUNCATED cells.

2018-11-15 Thread nickm
commit ce894e20b597d2d21b56ac8a8f13d1ea4063731d
Author: Mike Perry 
Date:   Tue Aug 7 04:23:33 2018 +

Ticket #25573: Count TRUNCATED cells.

TRUNCATED cells were ignored while in path bias. Now they are obeyed, and
cause us to tear down the circuit. The actual impact is minimal, since we
would just wait around for a probe that would never arrive before.

This commit changes client behavior.
---
 src/or/circpathbias.c | 10 ++
 src/or/circuitbuild.c |  3 +--
 src/or/circuitbuild.h |  3 +--
 src/or/relay.c|  9 -
 src/test/test_relaycell.c | 18 ++
 5 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/src/or/circpathbias.c b/src/or/circpathbias.c
index 923941e5b..3cdd16261 100644
--- a/src/or/circpathbias.c
+++ b/src/or/circpathbias.c
@@ -929,6 +929,16 @@ pathbias_count_valid_cells(circuit_t *circ, const cell_t 
*cell)
   /* Check to see if this is a cell from a previous connection,
* or is a request to close the circuit. */
   switch (rh.command) {
+case RELAY_COMMAND_TRUNCATED:
+  /* Truncated cells can arrive on path bias circs. When they do,
+   * just process them. This closes the circ, but it was junk anyway.
+   * No reason to wait for the probe. */
+  circuit_read_valid_data(ocirc, rh.length);
+  circuit_truncated(TO_ORIGIN_CIRCUIT(circ),
+get_uint8(cell->payload + RELAY_HEADER_SIZE));
+
+  break;
+
 case RELAY_COMMAND_END:
   if (connection_half_edge_is_valid_end(ocirc->half_streams,
  rh.stream_id)) {
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 3d1c9c1ab..8f17f2786 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1419,13 +1419,12 @@ circuit_finish_handshake(origin_circuit_t *circ,
  * just give up: force circ to close, and return 0.
  */
 int
-circuit_truncated(origin_circuit_t *circ, crypt_path_t *layer, int reason)
+circuit_truncated(origin_circuit_t *circ, int reason)
 {
 //  crypt_path_t *victim;
 //  connection_t *stream;
 
   tor_assert(circ);
-  tor_assert(layer);
 
   /* XXX Since we don't send truncates currently, getting a truncated
* means that a connection broke or an extend failed. For now,
diff --git a/src/or/circuitbuild.h b/src/or/circuitbuild.h
index 0184898e2..e3d30c110 100644
--- a/src/or/circuitbuild.h
+++ b/src/or/circuitbuild.h
@@ -37,8 +37,7 @@ int circuit_init_cpath_crypto(crypt_path_t *cpath,
 struct created_cell_t;
 int circuit_finish_handshake(origin_circuit_t *circ,
  const struct created_cell_t *created_cell);
-int circuit_truncated(origin_circuit_t *circ, crypt_path_t *layer,
-  int reason);
+int circuit_truncated(origin_circuit_t *circ, int reason);
 int onionskin_answer(or_circuit_t *circ,
  const struct created_cell_t *created_cell,
  const char *keys, size_t keys_len,
diff --git a/src/or/relay.c b/src/or/relay.c
index 13f2b56bc..81bb94d5a 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1748,7 +1748,14 @@ connection_edge_process_relay_cell(cell_t *cell, 
circuit_t *circ,
"'truncated' unsupported at non-origin. Dropping.");
 return 0;
   }
-  circuit_truncated(TO_ORIGIN_CIRCUIT(circ), layer_hint,
+
+  /* Count the truncated as valid, for completeness. The
+   * circuit is being torn down anyway, though.  */
+  if (CIRCUIT_IS_ORIGIN(circ)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ),
+rh.length);
+  }
+  circuit_truncated(TO_ORIGIN_CIRCUIT(circ),
 get_uint8(cell->payload + RELAY_HEADER_SIZE));
   return 0;
 case RELAY_COMMAND_CONNECTED:
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index 4c406a9b7..3f84ee830 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -116,6 +116,16 @@ mock_connection_mark_unattached_ap_(entry_connection_t 
*conn, int endreason,
 }
 
 static void
+mock_mark_circ_for_close(circuit_t *circ, int reason, int line,
+  const char *file)
+{
+  (void)reason; (void)line; (void)file;
+
+  circ->marked_for_close = 1;
+  return;
+}
+
+static void
 mock_mark_for_close(connection_t *conn,
 int line, const char *file)
 {
@@ -694,6 +704,7 @@ test_circbw_relay(void *arg)
   MOCK(connection_start_reading, mock_start_reading);
   MOCK(connection_mark_for_close_internal_, mock_mark_for_close);
   MOCK(relay_send_command_from_edge_, mock_send_command);
+  MOCK(circuit_mark_for_close_, mock_mark_circ_for_close);
 
   circ = helper_create_origin_circuit(CIRCUIT_PURPOSE_C_GENERAL, 0);
   circ->cpath->state = CPATH_STATE_AWAITING_KEYS;
@@ -856,11 +867,18 @@ test_circbw_relay(void *arg)
   if (!subtest_circbw_halfclosed(circ, 6))
 goto done;
 
+  /* Path bias: truncated */
+  

[tor-commits] [tor/maint-0.3.4] Merge branch 'bug25573-034-typefix' into maint-0.3.4

2018-11-15 Thread nickm
commit 80a6228aacc9083fae07d4373d9c41017420e6b9
Merge: 15e752e6b 6d33f6563
Author: Nick Mathewson 
Date:   Thu Nov 15 16:58:16 2018 -0500

Merge branch 'bug25573-034-typefix' into maint-0.3.4

 changes/ticket25573   |   5 +
 src/common/container.c|   2 +-
 src/common/container.h|   2 +-
 src/or/circpathbias.c |  63 +
 src/or/circpathbias.h |   1 +
 src/or/circuitbuild.c |   3 +-
 src/or/circuitbuild.h |   3 +-
 src/or/circuitlist.c  |   8 +
 src/or/connection_edge.c  | 220 
 src/or/connection_edge.h  |  17 ++
 src/or/or.h   |  25 ++
 src/or/relay.c|  75 +-
 src/test/test_relaycell.c | 641 ++
 13 files changed, 1014 insertions(+), 51 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.4] Use the correct function signatures in test_relaycell.c

2018-11-15 Thread nickm
commit 6d33f65638734593d10c5c3a5e2eb9d7bdff8000
Author: Nick Mathewson 
Date:   Tue Sep 18 15:07:02 2018 -0400

Use the correct function signatures in test_relaycell.c

This is now officially an antipattern: please let's never copy a
function declaration in two places again.  That's what headers are
for.
---
 src/or/connection_edge.c  |  5 
 src/or/connection_edge.h  |  6 +
 src/test/test_relaycell.c | 65 ---
 3 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 1060e7461..3170dc493 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -136,11 +136,6 @@ static int connection_ap_process_natd(entry_connection_t 
*conn);
 static int connection_exit_connect_dir(edge_connection_t *exitconn);
 static int consider_plaintext_ports(entry_connection_t *conn, uint16_t port);
 static int connection_ap_supports_optimistic_data(const entry_connection_t *);
-STATIC void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-STATIC half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
 
 /** An AP stream has failed/finished. If it hasn't already sent back
  * a socks reply, send one now (based on endreason). Also set
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index 6dbba014c..c607c963e 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -202,6 +202,12 @@ STATIC void 
connection_ap_handshake_rewrite(entry_connection_t *conn,
 rewrite_result_t *out);
 
 STATIC int connection_ap_process_http_connect(entry_connection_t *conn);
+struct half_edge_t;
+STATIC void connection_half_edge_add(const edge_connection_t *conn,
+ origin_circuit_t *circ);
+STATIC struct half_edge_t *connection_half_edge_find_stream_id(
+ const smartlist_t *half_conns,
+ streamid_t stream_id);
 #endif /* defined(CONNECTION_EDGE_PRIVATE) */
 
 #endif /* !defined(TOR_CONNECTION_EDGE_H) */
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index ee495cada..2fc0288f6 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -5,6 +5,9 @@
 
 #define RELAY_PRIVATE
 #define CIRCUITLIST_PRIVATE
+#define CONNECTION_EDGE_PRIVATE
+#define CONNECTION_PRIVATE
+
 #include "or.h"
 #include "main.h"
 #include "config.h"
@@ -18,6 +21,11 @@
 #include "relay.h"
 #include "test.h"
 
+#include "log_test_helpers.h"
+
+#include "circpathbias.h"
+#include "connection_edge.h"
+
 static int srm_ncalls;
 static entry_connection_t *srm_conn;
 static int srm_atype;
@@ -27,23 +35,6 @@ static uint8_t srm_answer[512];
 static int srm_ttl;
 static time_t srm_expires;
 
-void connection_free_minimal(connection_t*);
-int connected_cell_format_payload(uint8_t *payload_out,
-  const tor_addr_t *addr,
-  uint32_t ttl);
-void pathbias_count_valid_cells(origin_circuit_t *circ,
-cell_t *cell);
-half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
-void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-
-int mock_send_command(streamid_t stream_id, circuit_t *circ,
-   uint8_t relay_command, const char *payload,
-   size_t payload_len, crypt_path_t *cpath_layer,
-   const char *filename, int lineno);
-
 /* Mock replacement for connection_ap_hannshake_socks_resolved() */
 static void
 socks_resolved_mock(entry_connection_t *conn,
@@ -143,7 +134,7 @@ mock_start_reading(connection_t *conn)
   return;
 }
 
-int
+static int
 mock_send_command(streamid_t stream_id, circuit_t *circ,
uint8_t relay_command, const char *payload,
size_t payload_len, crypt_path_t *cpath_layer,
@@ -230,7 +221,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Data cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_DATA, "Data1234");
   if (circ->base_.purpose == CIRCUIT_PURPOSE_PATH_BIAS_TESTING)
-pathbias_count_valid_cells(circ, );
+pathbias_count_valid_cells(TO_CIRCUIT(circ), );
   else
 connection_edge_process_relay_cell(, TO_CIRCUIT(circ), NULL,
circ->cpath);
@@ -239,7 +230,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Sendme cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_SENDME, "Data1234");
  

[tor-commits] [tor/maint-0.3.4] Teach the OOM module to handle half-open stream info. #27686

2018-11-15 Thread nickm
commit ab92f934212f0f91f74cd17127d20a28cc1e
Author: Nick Mathewson 
Date:   Fri Sep 14 10:16:27 2018 -0400

Teach the OOM module to handle half-open stream info. #27686
---
 src/or/circuitlist.c | 21 ++---
 src/or/connection_edge.c | 24 ++--
 src/or/connection_edge.h |  6 +-
 src/or/relay.c   |  2 +-
 4 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index a1efe9b74..ad9b902ac 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1042,9 +1042,9 @@ circuit_free_(circuit_t *circ)
 circuit_remove_from_origin_circuit_list(ocirc);
 
 if (ocirc->half_streams) {
-  SMARTLIST_FOREACH_BEGIN(ocirc->half_streams, half_edge_t*,
+  SMARTLIST_FOREACH_BEGIN(ocirc->half_streams, half_edge_t *,
   half_conn) {
-  tor_free(half_conn);
+half_edge_free(half_conn);
   } SMARTLIST_FOREACH_END(half_conn);
   smartlist_free(ocirc->half_streams);
 }
@@ -2324,6 +2324,20 @@ n_cells_in_circ_queues(const circuit_t *c)
   return n;
 }
 
+/** Return the number of bytes allocated for c's half-open streams. */
+static size_t
+circuit_alloc_in_half_streams(const circuit_t *c)
+{
+  if (! CIRCUIT_IS_ORIGIN(c)) {
+return 0;
+  }
+  const origin_circuit_t *ocirc = CONST_TO_ORIGIN_CIRCUIT(c);
+  if (ocirc->half_streams)
+return smartlist_len(ocirc->half_streams) * sizeof(half_edge_t);
+  else
+return 0;
+}
+
 /**
  * Return the age of the oldest cell queued on c, in timestamp units.
  * Return 0 if there are no cells queued on c.  Requires that now be
@@ -2558,6 +2572,7 @@ circuits_handle_oom(size_t current_allocation)
 
 /* Now, kill the circuit. */
 n = n_cells_in_circ_queues(circ);
+const size_t half_stream_alloc = circuit_alloc_in_half_streams(circ);
 if (! circ->marked_for_close) {
   circuit_mark_for_close(circ, END_CIRC_REASON_RESOURCELIMIT);
 }
@@ -2567,6 +2582,7 @@ circuits_handle_oom(size_t current_allocation)
 ++n_circuits_killed;
 
 mem_recovered += n * packed_cell_mem_cost();
+mem_recovered += half_stream_alloc;
 mem_recovered += freed;
 
 if (mem_recovered >= mem_to_recover)
@@ -2711,4 +2727,3 @@ assert_circuit_ok,(const circuit_t *c))
 tor_assert(!or_circ || !or_circ->rend_splice);
   }
 }
-
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 1060e7461..eea364ffd 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -477,6 +477,9 @@ connection_half_edge_compare_bsearch(const void *key, const 
void **member)
   return *(const streamid_t*)key - e2->stream_id;
 }
 
+/** Total number of half_edge_t objects allocated */
+static size_t n_half_conns_allocated = 0;
+
 /**
  * Add a half-closed connection to the list, to watch for activity.
  *
@@ -501,6 +504,7 @@ connection_half_edge_add(const edge_connection_t *conn,
   }
 
   half_conn = tor_malloc_zero(sizeof(half_edge_t));
+  ++n_half_conns_allocated;
 
   if (!circ->half_streams) {
 circ->half_streams = smartlist_new();
@@ -530,6 +534,23 @@ connection_half_edge_add(const edge_connection_t *conn,
   smartlist_insert(circ->half_streams, insert_at, half_conn);
 }
 
+/** Release space held by he */
+void
+half_edge_free_(half_edge_t *he)
+{
+  if (!he)
+return;
+  --n_half_conns_allocated;
+  tor_free(he);
+}
+
+/** Return the number of bytes devoted to storing info on half-open streams. */
+size_t
+half_streams_get_total_allocation(void)
+{
+  return n_half_conns_allocated * sizeof(half_edge_t);
+}
+
 /**
  * Find a stream_id_t in the list in O(lg(n)).
  *
@@ -650,7 +671,7 @@ connection_half_edge_is_valid_end(smartlist_t *half_conns,
 
   half = smartlist_get(half_conns, remove_idx);
   smartlist_del_keeporder(half_conns, remove_idx);
-  tor_free(half);
+  half_edge_free(half);
   return 1;
 }
 
@@ -4412,4 +4433,3 @@ connection_edge_free_all(void)
   pending_entry_connections = NULL;
   mainloop_event_free(attach_pending_entry_connections_ev);
 }
-
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index 6dbba014c..7bef01e40 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -133,6 +133,11 @@ int connection_half_edge_is_valid_end(smartlist_t 
*half_conns,
 int connection_half_edge_is_valid_resolved(smartlist_t *half_conns,
streamid_t stream_id);
 
+size_t half_streams_get_total_allocation(void);
+void half_edge_free_(half_edge_t *he);
+#define half_edge_free(he) \
+  FREE_AND_NULL(half_edge_t, half_edge_free_, (he))
+
 /** @name Begin-cell flags
  *
  * These flags are used in RELAY_BEGIN cells to change the default behavior
@@ -205,4 +210,3 @@ STATIC int 
connection_ap_process_http_connect(entry_connection_t *conn);
 #endif /* defined(CONNECTION_EDGE_PRIVATE) */
 
 #endif /* !defined(TOR_CONNECTION_EDGE_H) */
-
diff --git a/src/or/relay.c b/src/or/relay.c
index 81bb94d5a..497afe756 100644
--- 

[tor-commits] [tor/maint-0.3.5] Use the correct function signatures in test_relaycell.c

2018-11-15 Thread nickm
commit 6d33f65638734593d10c5c3a5e2eb9d7bdff8000
Author: Nick Mathewson 
Date:   Tue Sep 18 15:07:02 2018 -0400

Use the correct function signatures in test_relaycell.c

This is now officially an antipattern: please let's never copy a
function declaration in two places again.  That's what headers are
for.
---
 src/or/connection_edge.c  |  5 
 src/or/connection_edge.h  |  6 +
 src/test/test_relaycell.c | 65 ---
 3 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 1060e7461..3170dc493 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -136,11 +136,6 @@ static int connection_ap_process_natd(entry_connection_t 
*conn);
 static int connection_exit_connect_dir(edge_connection_t *exitconn);
 static int consider_plaintext_ports(entry_connection_t *conn, uint16_t port);
 static int connection_ap_supports_optimistic_data(const entry_connection_t *);
-STATIC void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-STATIC half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
 
 /** An AP stream has failed/finished. If it hasn't already sent back
  * a socks reply, send one now (based on endreason). Also set
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index 6dbba014c..c607c963e 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -202,6 +202,12 @@ STATIC void 
connection_ap_handshake_rewrite(entry_connection_t *conn,
 rewrite_result_t *out);
 
 STATIC int connection_ap_process_http_connect(entry_connection_t *conn);
+struct half_edge_t;
+STATIC void connection_half_edge_add(const edge_connection_t *conn,
+ origin_circuit_t *circ);
+STATIC struct half_edge_t *connection_half_edge_find_stream_id(
+ const smartlist_t *half_conns,
+ streamid_t stream_id);
 #endif /* defined(CONNECTION_EDGE_PRIVATE) */
 
 #endif /* !defined(TOR_CONNECTION_EDGE_H) */
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index ee495cada..2fc0288f6 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -5,6 +5,9 @@
 
 #define RELAY_PRIVATE
 #define CIRCUITLIST_PRIVATE
+#define CONNECTION_EDGE_PRIVATE
+#define CONNECTION_PRIVATE
+
 #include "or.h"
 #include "main.h"
 #include "config.h"
@@ -18,6 +21,11 @@
 #include "relay.h"
 #include "test.h"
 
+#include "log_test_helpers.h"
+
+#include "circpathbias.h"
+#include "connection_edge.h"
+
 static int srm_ncalls;
 static entry_connection_t *srm_conn;
 static int srm_atype;
@@ -27,23 +35,6 @@ static uint8_t srm_answer[512];
 static int srm_ttl;
 static time_t srm_expires;
 
-void connection_free_minimal(connection_t*);
-int connected_cell_format_payload(uint8_t *payload_out,
-  const tor_addr_t *addr,
-  uint32_t ttl);
-void pathbias_count_valid_cells(origin_circuit_t *circ,
-cell_t *cell);
-half_edge_t *connection_half_edge_find_stream_id(
-const smartlist_t *half_conns,
-streamid_t stream_id);
-void connection_half_edge_add(const edge_connection_t *conn,
- origin_circuit_t *circ);
-
-int mock_send_command(streamid_t stream_id, circuit_t *circ,
-   uint8_t relay_command, const char *payload,
-   size_t payload_len, crypt_path_t *cpath_layer,
-   const char *filename, int lineno);
-
 /* Mock replacement for connection_ap_hannshake_socks_resolved() */
 static void
 socks_resolved_mock(entry_connection_t *conn,
@@ -143,7 +134,7 @@ mock_start_reading(connection_t *conn)
   return;
 }
 
-int
+static int
 mock_send_command(streamid_t stream_id, circuit_t *circ,
uint8_t relay_command, const char *payload,
size_t payload_len, crypt_path_t *cpath_layer,
@@ -230,7 +221,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Data cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_DATA, "Data1234");
   if (circ->base_.purpose == CIRCUIT_PURPOSE_PATH_BIAS_TESTING)
-pathbias_count_valid_cells(circ, );
+pathbias_count_valid_cells(TO_CIRCUIT(circ), );
   else
 connection_edge_process_relay_cell(, TO_CIRCUIT(circ), NULL,
circ->cpath);
@@ -239,7 +230,7 @@ subtest_circbw_halfclosed(origin_circuit_t *circ, 
streamid_t init_id)
   /* Sendme cell not in the half-opened list */
   PACK_CELL(4000, RELAY_COMMAND_SENDME, "Data1234");
  

[tor-commits] [tor/maint-0.3.4] Fix duplicate declaration of pathbias_count_valid_cells.

2018-11-15 Thread nickm
commit 7fd61cf536543283353b618d5bba9a1db637ed14
Author: Nick Mathewson 
Date:   Sun Sep 16 13:45:43 2018 -0400

Fix duplicate declaration of pathbias_count_valid_cells.
---
 src/test/test_relaycell.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index 3f84ee830..ee495cada 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -31,8 +31,8 @@ void connection_free_minimal(connection_t*);
 int connected_cell_format_payload(uint8_t *payload_out,
   const tor_addr_t *addr,
   uint32_t ttl);
-int pathbias_count_valid_cells(origin_circuit_t *circ,
-  cell_t *cell);
+void pathbias_count_valid_cells(origin_circuit_t *circ,
+cell_t *cell);
 half_edge_t *connection_half_edge_find_stream_id(
 const smartlist_t *half_conns,
 streamid_t stream_id);
@@ -1072,4 +1072,3 @@ struct testcase_t relaycell_tests[] = {
   { "streamwrap", test_halfstream_wrap, TT_FORK, NULL, NULL },
   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/maint-0.3.4] Ticket #25573: Track half-closed stream ids

2018-11-15 Thread nickm
commit c56f63eadbc5b83b48e57235b194bd8f76b534bb
Author: Mike Perry 
Date:   Sat Aug 4 19:38:38 2018 +

Ticket #25573: Track half-closed stream ids

We allow their CONNECTEDs, RESOLVEDs, ENDs, SENDMEs, and DATA cells to not
count as dropped until the windows are empty, or we get an END.

This commit does not change behavior. It only changes CIRC_BW event field
values.
---
 changes/ticket25573   |   5 +
 src/or/circpathbias.c |  53 +
 src/or/circpathbias.h |   1 +
 src/or/circuitlist.c  |   8 +
 src/or/connection_edge.c  | 220 ++
 src/or/connection_edge.h  |  11 +
 src/or/or.h   |  25 +++
 src/or/relay.c|  66 +-
 src/test/test_relaycell.c | 561 +++---
 9 files changed, 912 insertions(+), 38 deletions(-)

diff --git a/changes/ticket25573 b/changes/ticket25573
new file mode 100644
index 0..9939601b5
--- /dev/null
+++ b/changes/ticket25573
@@ -0,0 +1,5 @@
+  o Minor features (controller):
+- For purposes of CIRC_BW-based dropped cell detection, track half-closed
+  stream ids, and allow their ENDs, SENDMEs, DATA and path bias check
+  cells to arrive without counting it as dropped until either the END 
arrvies,
+  or the windows are empty. Closes ticket 25573.
diff --git a/src/or/circpathbias.c b/src/or/circpathbias.c
index ff42bf91e..923941e5b 100644
--- a/src/or/circpathbias.c
+++ b/src/or/circpathbias.c
@@ -893,6 +893,7 @@ pathbias_check_probe_response(circuit_t *circ, const cell_t 
*cell)
 /* Check nonce */
 if (ipv4_host == ocirc->pathbias_probe_nonce) {
   pathbias_mark_use_success(ocirc);
+  circuit_read_valid_data(ocirc, rh.length);
   circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED);
   log_info(LD_CIRC,
"Got valid path bias probe back for circ %d, stream %d.",
@@ -914,6 +915,58 @@ pathbias_check_probe_response(circuit_t *circ, const 
cell_t *cell)
 }
 
 /**
+ * Check if a cell is counts as valid data for a circuit,
+ * and if so, count it as valid.
+ */
+void
+pathbias_count_valid_cells(circuit_t *circ, const cell_t *cell)
+{
+  origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
+  relay_header_t rh;
+
+  relay_header_unpack(, cell->payload);
+
+  /* Check to see if this is a cell from a previous connection,
+   * or is a request to close the circuit. */
+  switch (rh.command) {
+case RELAY_COMMAND_END:
+  if (connection_half_edge_is_valid_end(ocirc->half_streams,
+ rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+
+case RELAY_COMMAND_DATA:
+  if (connection_half_edge_is_valid_data(ocirc->half_streams,
+ rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+
+case RELAY_COMMAND_SENDME:
+  if (connection_half_edge_is_valid_sendme(ocirc->half_streams,
+ rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+
+case RELAY_COMMAND_CONNECTED:
+  if (connection_half_edge_is_valid_connected(ocirc->half_streams,
+  rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+
+case RELAY_COMMAND_RESOLVED:
+  if (connection_half_edge_is_valid_resolved(ocirc->half_streams,
+ rh.stream_id)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
+  }
+  break;
+  }
+}
+
+/**
  * Check if a circuit was used and/or closed successfully.
  *
  * If we attempted to use the circuit to carry a stream but failed
diff --git a/src/or/circpathbias.h b/src/or/circpathbias.h
index c9e572d2a..689b2a620 100644
--- a/src/or/circpathbias.h
+++ b/src/or/circpathbias.h
@@ -20,6 +20,7 @@ void pathbias_count_build_success(origin_circuit_t *circ);
 int pathbias_count_build_attempt(origin_circuit_t *circ);
 int pathbias_check_close(origin_circuit_t *circ, int reason);
 int pathbias_check_probe_response(circuit_t *circ, const cell_t *cell);
+void pathbias_count_valid_cells(circuit_t *circ, const cell_t *cell);
 void pathbias_count_use_attempt(origin_circuit_t *circ);
 void pathbias_mark_use_success(origin_circuit_t *circ);
 void pathbias_mark_use_rollback(origin_circuit_t *circ);
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 45fff7cc1..a1efe9b74 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1041,6 +1041,14 @@ circuit_free_(circuit_t *circ)
 
 circuit_remove_from_origin_circuit_list(ocirc);
 
+if (ocirc->half_streams) {
+  SMARTLIST_FOREACH_BEGIN(ocirc->half_streams, half_edge_t*,
+  half_conn) {
+  tor_free(half_conn);
+  } 

[tor-commits] [tor/maint-0.3.4] Ticket #25573: Count TRUNCATED cells.

2018-11-15 Thread nickm
commit ce894e20b597d2d21b56ac8a8f13d1ea4063731d
Author: Mike Perry 
Date:   Tue Aug 7 04:23:33 2018 +

Ticket #25573: Count TRUNCATED cells.

TRUNCATED cells were ignored while in path bias. Now they are obeyed, and
cause us to tear down the circuit. The actual impact is minimal, since we
would just wait around for a probe that would never arrive before.

This commit changes client behavior.
---
 src/or/circpathbias.c | 10 ++
 src/or/circuitbuild.c |  3 +--
 src/or/circuitbuild.h |  3 +--
 src/or/relay.c|  9 -
 src/test/test_relaycell.c | 18 ++
 5 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/src/or/circpathbias.c b/src/or/circpathbias.c
index 923941e5b..3cdd16261 100644
--- a/src/or/circpathbias.c
+++ b/src/or/circpathbias.c
@@ -929,6 +929,16 @@ pathbias_count_valid_cells(circuit_t *circ, const cell_t 
*cell)
   /* Check to see if this is a cell from a previous connection,
* or is a request to close the circuit. */
   switch (rh.command) {
+case RELAY_COMMAND_TRUNCATED:
+  /* Truncated cells can arrive on path bias circs. When they do,
+   * just process them. This closes the circ, but it was junk anyway.
+   * No reason to wait for the probe. */
+  circuit_read_valid_data(ocirc, rh.length);
+  circuit_truncated(TO_ORIGIN_CIRCUIT(circ),
+get_uint8(cell->payload + RELAY_HEADER_SIZE));
+
+  break;
+
 case RELAY_COMMAND_END:
   if (connection_half_edge_is_valid_end(ocirc->half_streams,
  rh.stream_id)) {
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 3d1c9c1ab..8f17f2786 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1419,13 +1419,12 @@ circuit_finish_handshake(origin_circuit_t *circ,
  * just give up: force circ to close, and return 0.
  */
 int
-circuit_truncated(origin_circuit_t *circ, crypt_path_t *layer, int reason)
+circuit_truncated(origin_circuit_t *circ, int reason)
 {
 //  crypt_path_t *victim;
 //  connection_t *stream;
 
   tor_assert(circ);
-  tor_assert(layer);
 
   /* XXX Since we don't send truncates currently, getting a truncated
* means that a connection broke or an extend failed. For now,
diff --git a/src/or/circuitbuild.h b/src/or/circuitbuild.h
index 0184898e2..e3d30c110 100644
--- a/src/or/circuitbuild.h
+++ b/src/or/circuitbuild.h
@@ -37,8 +37,7 @@ int circuit_init_cpath_crypto(crypt_path_t *cpath,
 struct created_cell_t;
 int circuit_finish_handshake(origin_circuit_t *circ,
  const struct created_cell_t *created_cell);
-int circuit_truncated(origin_circuit_t *circ, crypt_path_t *layer,
-  int reason);
+int circuit_truncated(origin_circuit_t *circ, int reason);
 int onionskin_answer(or_circuit_t *circ,
  const struct created_cell_t *created_cell,
  const char *keys, size_t keys_len,
diff --git a/src/or/relay.c b/src/or/relay.c
index 13f2b56bc..81bb94d5a 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1748,7 +1748,14 @@ connection_edge_process_relay_cell(cell_t *cell, 
circuit_t *circ,
"'truncated' unsupported at non-origin. Dropping.");
 return 0;
   }
-  circuit_truncated(TO_ORIGIN_CIRCUIT(circ), layer_hint,
+
+  /* Count the truncated as valid, for completeness. The
+   * circuit is being torn down anyway, though.  */
+  if (CIRCUIT_IS_ORIGIN(circ)) {
+circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ),
+rh.length);
+  }
+  circuit_truncated(TO_ORIGIN_CIRCUIT(circ),
 get_uint8(cell->payload + RELAY_HEADER_SIZE));
   return 0;
 case RELAY_COMMAND_CONNECTED:
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index 4c406a9b7..3f84ee830 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -116,6 +116,16 @@ mock_connection_mark_unattached_ap_(entry_connection_t 
*conn, int endreason,
 }
 
 static void
+mock_mark_circ_for_close(circuit_t *circ, int reason, int line,
+  const char *file)
+{
+  (void)reason; (void)line; (void)file;
+
+  circ->marked_for_close = 1;
+  return;
+}
+
+static void
 mock_mark_for_close(connection_t *conn,
 int line, const char *file)
 {
@@ -694,6 +704,7 @@ test_circbw_relay(void *arg)
   MOCK(connection_start_reading, mock_start_reading);
   MOCK(connection_mark_for_close_internal_, mock_mark_for_close);
   MOCK(relay_send_command_from_edge_, mock_send_command);
+  MOCK(circuit_mark_for_close_, mock_mark_circ_for_close);
 
   circ = helper_create_origin_circuit(CIRCUIT_PURPOSE_C_GENERAL, 0);
   circ->cpath->state = CPATH_STATE_AWAITING_KEYS;
@@ -856,11 +867,18 @@ test_circbw_relay(void *arg)
   if (!subtest_circbw_halfclosed(circ, 6))
 goto done;
 
+  /* Path bias: truncated */
+  

[tor-commits] [tor/maint-0.3.4] Ticket #25573: Check half-opened stream ids when choosing a new one

2018-11-15 Thread nickm
commit 144647031aa9e7eacc6f7cdd8fed663c7229b2aa
Author: Mike Perry 
Date:   Wed Aug 29 00:06:38 2018 +

Ticket #25573: Check half-opened stream ids when choosing a new one

Avoid data corrupton by avoiding mixing up old stream ids with new ones.

This commit changes client behavior.
---
 src/or/connection_edge.c  |  5 
 src/test/test_relaycell.c | 60 +++
 2 files changed, 65 insertions(+)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 91cefe9ff..1060e7461 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -2813,6 +2813,11 @@ get_unique_stream_id_by_circ(origin_circuit_t *circ)
   for (tmpconn = circ->p_streams; tmpconn; tmpconn=tmpconn->next_stream)
 if (tmpconn->stream_id == test_stream_id)
   goto again;
+
+  if (connection_half_edge_find_stream_id(circ->half_streams,
+   test_stream_id))
+goto again;
+
   return test_stream_id;
 }
 
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index 1570e1516..4c406a9b7 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -618,6 +618,65 @@ test_halfstream_insertremove(void *arg)
 }
 
 static void
+test_halfstream_wrap(void *arg)
+{
+  origin_circuit_t *circ =
+  helper_create_origin_circuit(CIRCUIT_PURPOSE_C_GENERAL, 0);
+  edge_connection_t *edgeconn;
+  entry_connection_t *entryconn;
+
+  circ->cpath->state = CPATH_STATE_AWAITING_KEYS;
+  circ->cpath->deliver_window = CIRCWINDOW_START;
+
+  entryconn = fake_entry_conn(circ, 23);
+  edgeconn = ENTRY_TO_EDGE_CONN(entryconn);
+
+  (void)arg;
+
+  /* Suppress the WARN message we generate in this test */
+  setup_full_capture_of_logs(LOG_WARN);
+  MOCK(connection_mark_for_close_internal_, mock_mark_for_close);
+
+  /* Verify that get_unique_stream_id_by_circ() can wrap uint16_t */
+  circ->next_stream_id = 65530;
+  halfstream_insert(circ, edgeconn, NULL, 7, 0);
+  tt_int_op(circ->next_stream_id, OP_EQ, 2);
+  tt_int_op(smartlist_len(circ->half_streams), OP_EQ, 7);
+
+  /* Insert full-1 */
+  halfstream_insert(circ, edgeconn, NULL,
+65534-smartlist_len(circ->half_streams), 0);
+  tt_int_op(smartlist_len(circ->half_streams), OP_EQ, 65534);
+
+  /* Verify that we can get_unique_stream_id_by_circ() successfully */
+  edgeconn->stream_id = get_unique_stream_id_by_circ(circ);
+  tt_int_op(edgeconn->stream_id, OP_NE, 0); /* 0 is failure */
+
+  /* Insert an opened stream on the circ with that id */
+  ENTRY_TO_CONN(entryconn)->marked_for_close = 0;
+  ENTRY_TO_CONN(entryconn)->outbuf_flushlen = 0;
+  edgeconn->base_.state = AP_CONN_STATE_CONNECT_WAIT;
+  circ->p_streams = edgeconn;
+
+  /* Verify that get_unique_stream_id_by_circ() fails */
+  tt_int_op(get_unique_stream_id_by_circ(circ), OP_EQ, 0); /* 0 is failure */
+
+  /* eof the one opened stream. Verify it is now in half-closed */
+  tt_int_op(smartlist_len(circ->half_streams), OP_EQ, 65534);
+  connection_edge_reached_eof(edgeconn);
+  tt_int_op(smartlist_len(circ->half_streams), OP_EQ, 65535);
+
+  /* Verify get_unique_stream_id_by_circ() fails due to full half-closed */
+  circ->p_streams = NULL;
+  tt_int_op(get_unique_stream_id_by_circ(circ), OP_EQ, 0); /* 0 is failure */
+
+ done:
+  circuit_free_(TO_CIRCUIT(circ));
+  connection_free_minimal(ENTRY_TO_CONN(entryconn));
+  UNMOCK(connection_mark_for_close_internal_);
+}
+
+static void
 test_circbw_relay(void *arg)
 {
   cell_t cell;
@@ -992,6 +1051,7 @@ struct testcase_t relaycell_tests[] = {
   { "resolved", test_relaycell_resolved, TT_FORK, NULL, NULL },
   { "circbw", test_circbw_relay, TT_FORK, NULL, NULL },
   { "halfstream", test_halfstream_insertremove, TT_FORK, NULL, NULL },
+  { "streamwrap", test_halfstream_wrap, TT_FORK, NULL, NULL },
   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/maint-0.3.4] Mark smartlist_bsearch as taking a const list.

2018-11-15 Thread nickm
commit dac7d929185e5f2643a29fc046ee439a826239eb
Author: Mike Perry 
Date:   Sat Aug 25 00:26:42 2018 +

Mark smartlist_bsearch as taking a const list.

It does not modify the actual list.
---
 src/common/container.c | 2 +-
 src/common/container.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common/container.c b/src/common/container.c
index 5386e6458..72ad3a925 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -628,7 +628,7 @@ smartlist_uniq(smartlist_t *sl,
  * less than member, and greater than 0 if key is greater then member.
  */
 void *
-smartlist_bsearch(smartlist_t *sl, const void *key,
+smartlist_bsearch(const smartlist_t *sl, const void *key,
   int (*compare)(const void *key, const void **member))
 {
   int found, idx;
diff --git a/src/common/container.h b/src/common/container.h
index 5d2dce541..7457c1e91 100644
--- a/src/common/container.h
+++ b/src/common/container.h
@@ -120,7 +120,7 @@ const uint8_t 
*smartlist_get_most_frequent_digest256(smartlist_t *sl);
 void smartlist_uniq_strings(smartlist_t *sl);
 void smartlist_uniq_digests(smartlist_t *sl);
 void smartlist_uniq_digests256(smartlist_t *sl);
-void *smartlist_bsearch(smartlist_t *sl, const void *key,
+void *smartlist_bsearch(const smartlist_t *sl, const void *key,
 int (*compare)(const void *key, const void **member));
 int smartlist_bsearch_idx(const smartlist_t *sl, const void *key,
   int (*compare)(const void *key, const void **member),



___
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 remote-tracking branch 'public/bug24104_029_squashed' into maint-0.2.9

2018-11-15 Thread nickm
commit 8569166c70f99bf908e78ce272e71eb60cdc84d0
Merge: 7f042cbc0 81f422332
Author: Nick Mathewson 
Date:   Thu Nov 15 16:43:50 2018 -0500

Merge remote-tracking branch 'public/bug24104_029_squashed' into maint-0.2.9

Resolved conflicts with the 26269 fix in 015fcd0e1191aa6f.

 changes/bug24104|   4 ++
 src/or/rephist.c|   6 +-
 src/or/rephist.h|   4 +-
 src/or/router.c |  25 ++--
 src/test/include.am |   1 +
 src/test/log_test_helpers.c |  22 ++-
 src/test/log_test_helpers.h |   7 ++-
 src/test/test.c |   1 +
 src/test/test_router.c  | 142 
 9 files changed, 200 insertions(+), 12 deletions(-)

diff --cc src/or/router.c
index 35b6bd203,f1a99364e..c41647422
--- a/src/or/router.c
+++ b/src/or/router.c
@@@ -2433,15 -2440,21 +2441,23 @@@ check_descriptor_bandwidth_changed(time
  {
static time_t last_changed = 0;
uint64_t prev, cur;
 +  const routerinfo_t *my_ri = router_get_my_routerinfo();
++
+   int hibernating = we_are_hibernating();
+ 
+   /* If the relay uptime is bigger than MAX_UPTIME_BANDWIDTH_CHANGE,
+* the next regularly scheduled descriptor update (18h) will be enough */
+   if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE && !hibernating)
+ return;
+ 
 -  if (!router_get_my_routerinfo())
 +  if (!my_ri) /* make sure routerinfo exists */
  return;
  
 -  prev = router_get_my_routerinfo()->bandwidthcapacity;
 +  prev = my_ri->bandwidthcapacity;
-   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+   cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
-   cur > prev*2 ||
-   cur < prev/2) {
+   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
  if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
log_info(LD_GENERAL,
 "Measured bandwidth has changed; rebuilding descriptor.");
@@@ -3640,4 -3652,4 +3656,3 @@@ router_get_all_orports(const routerinfo
fake_node.ri = (routerinfo_t *)ri;
return node_get_all_orports(_node);
  }
--



___
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 'public/bug24104_029_squashed' into maint-0.2.9

2018-11-15 Thread nickm
commit 8569166c70f99bf908e78ce272e71eb60cdc84d0
Merge: 7f042cbc0 81f422332
Author: Nick Mathewson 
Date:   Thu Nov 15 16:43:50 2018 -0500

Merge remote-tracking branch 'public/bug24104_029_squashed' into maint-0.2.9

Resolved conflicts with the 26269 fix in 015fcd0e1191aa6f.

 changes/bug24104|   4 ++
 src/or/rephist.c|   6 +-
 src/or/rephist.h|   4 +-
 src/or/router.c |  25 ++--
 src/test/include.am |   1 +
 src/test/log_test_helpers.c |  22 ++-
 src/test/log_test_helpers.h |   7 ++-
 src/test/test.c |   1 +
 src/test/test_router.c  | 142 
 9 files changed, 200 insertions(+), 12 deletions(-)

diff --cc src/or/router.c
index 35b6bd203,f1a99364e..c41647422
--- a/src/or/router.c
+++ b/src/or/router.c
@@@ -2433,15 -2440,21 +2441,23 @@@ check_descriptor_bandwidth_changed(time
  {
static time_t last_changed = 0;
uint64_t prev, cur;
 +  const routerinfo_t *my_ri = router_get_my_routerinfo();
++
+   int hibernating = we_are_hibernating();
+ 
+   /* If the relay uptime is bigger than MAX_UPTIME_BANDWIDTH_CHANGE,
+* the next regularly scheduled descriptor update (18h) will be enough */
+   if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE && !hibernating)
+ return;
+ 
 -  if (!router_get_my_routerinfo())
 +  if (!my_ri) /* make sure routerinfo exists */
  return;
  
 -  prev = router_get_my_routerinfo()->bandwidthcapacity;
 +  prev = my_ri->bandwidthcapacity;
-   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+   cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
-   cur > prev*2 ||
-   cur < prev/2) {
+   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
  if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
log_info(LD_GENERAL,
 "Measured bandwidth has changed; rebuilding descriptor.");
@@@ -3640,4 -3652,4 +3656,3 @@@ router_get_all_orports(const routerinfo
fake_node.ri = (routerinfo_t *)ri;
return node_get_all_orports(_node);
  }
--



___
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-11-15 Thread nickm
commit 15e752e6b111e159b1dee3bb4692d8de3c4d1c7f
Merge: 63312e029 cbe04d455
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:56 2018 -0500

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  24 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 16 deletions(-)

diff --cc src/or/router.c
index 5485ec913,edaa040dd..03959e907
--- a/src/or/router.c
+++ b/src/or/router.c
@@@ -2642,13 -2544,10 +2658,13 @@@ check_descriptor_bandwidth_changed(time
  return;
  
prev = my_ri->bandwidthcapacity;
 +
 +  /* Consider ourselves to have zero bandwidth if we're hibernating or
 +   * shutting down. */
-   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+   cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
-   cur > prev*2 ||
-   cur < prev/2) {
+   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
  if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
log_info(LD_GENERAL,
 "Measured bandwidth has changed; rebuilding descriptor.");



___
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 for descriptor does not change when hibernating

2018-11-15 Thread nickm
commit 81f4223329a709e5138532b037a58c118b30dd7f
Author: juga0 
Date:   Mon Jul 2 09:02:32 2018 +

Test for descriptor does not change when hibernating
---
 src/test/test_router.c | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/test/test_router.c b/src/test/test_router.c
index a4921da9b..51055a336 100644
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@ -41,6 +41,12 @@ mock_rep_hist_bandwidth_assess(void)
 }
 
 static int
+mock_we_are_not_hibernating(void)
+{
+  return 0;
+}
+
+static int
 mock_we_are_hibernating(void)
 {
   return 0;
@@ -54,7 +60,7 @@ test_router_check_descriptor_bandwidth_changed(void *arg)
   memset(, 0, sizeof(routerinfo));
   mock_router_get_my_routerinfo_result = NULL;
 
-  MOCK(we_are_hibernating, mock_we_are_hibernating);
+  MOCK(we_are_hibernating, mock_we_are_not_hibernating);
   MOCK(router_get_my_routerinfo, mock_router_get_my_routerinfo);
   mock_router_get_my_routerinfo_result = 
 
@@ -78,6 +84,21 @@ test_router_check_descriptor_bandwidth_changed(void *arg)
  "Measured bandwidth has changed; rebuilding descriptor.");
   teardown_capture_of_logs();
 
+  /* When uptime is less than 24h, previous bandwidth,
+   * last_changed more than 3h ago, and hibernating
+   * Uptime: 10800, last_changed: 0, Previous bw: 1, Current bw: 0 */
+
+  UNMOCK(we_are_hibernating);
+  MOCK(we_are_hibernating, mock_we_are_hibernating);
+  routerinfo.bandwidthcapacity = 1;
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_not_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  teardown_capture_of_logs();
+  UNMOCK(we_are_hibernating);
+  MOCK(we_are_hibernating, mock_we_are_not_hibernating);
+
   /* When uptime is less than 24h, last_changed is not more than 3h ago
* Uptime: 10800, last_changed: x, Previous bw: 1, Current bw: 0 */
   setup_full_capture_of_logs(LOG_INFO);
@@ -103,11 +124,12 @@ test_router_check_descriptor_bandwidth_changed(void *arg)
   check_descriptor_bandwidth_changed(time(NULL));
   expect_log_msg_not_containing(
  "Measured bandwidth has changed; rebuilding descriptor.");
-  UNMOCK(get_uptime);
   teardown_capture_of_logs();
 
  done:
+  UNMOCK(get_uptime);
   UNMOCK(router_get_my_routerinfo);
+  UNMOCK(we_are_hibernating);
 }
 
 #define ROUTER_TEST(name, flags)  \



___
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-11-15 Thread nickm
commit 8af8ecabbe429503a4ff9d5510df610907c6e45a
Merge: c0e18d2f8 15e752e6b
Author: Nick Mathewson 
Date:   Thu Nov 15 16:55:42 2018 -0500

Merge branch 'maint-0.3.4' into maint-0.3.5

"ours" merge to avoid duplicating conflict resolution in merge of 24104




___
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.2.9' into maint-0.3.3

2018-11-15 Thread nickm
commit cbe04d455016233f4759fe281c07dd7db6096c2a
Merge: aebe8a82c 8569166c7
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:16 2018 -0500

Merge branch 'maint-0.2.9' into maint-0.3.3

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  25 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 17 deletions(-)

diff --cc src/or/rephist.c
index 43494692c,2844c4d74..67e4d3150
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@@ -3205,4 -3292,4 +3205,3 @@@ rep_hist_free_all(void
tor_assert_nonfatal(rephist_total_alloc == 0);
tor_assert_nonfatal_once(rephist_total_num == 0);
  }
--
diff --cc src/or/rephist.h
index 507272159,6d35ac67f..3e64a3de4
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@@ -111,30 -119,5 +111,29 @@@ extern int onion_handshakes_requested[M
  extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1];
  #endif
  
 -#endif
 -
 +/**
 + * Represents the type of a cell for padding accounting
 + */
 +typedef enum padding_type_t {
 +/** A RELAY_DROP cell */
 +PADDING_TYPE_DROP,
 +/** A CELL_PADDING cell */
 +PADDING_TYPE_CELL,
 +/** Total counts of padding and non-padding together */
 +PADDING_TYPE_TOTAL,
 +/** Total cell counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_TOTAL,
 +/** CELL_PADDING counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_CELL
 +} padding_type_t;
 +
 +/** The amount of time over which the padding cell counts were counted */
 +#define REPHIST_CELL_PADDING_COUNTS_INTERVAL (24*60*60)
 +void rep_hist_padding_count_read(padding_type_t type);
 +void rep_hist_padding_count_write(padding_type_t type);
 +char *rep_hist_get_padding_count_lines(void);
 +void rep_hist_reset_padding_counts(void);
 +void rep_hist_prep_published_padding_counts(time_t now);
 +void rep_hist_padding_count_timers(uint64_t num_timers);
 +
 +#endif /* !defined(TOR_REPHIST_H) */
- 
diff --cc src/test/log_test_helpers.c
index d5a39cfee,c5368b6cb..1ad01afc8
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@@ -238,4 -258,4 +258,3 @@@ mock_dump_saved_logs(void
 escaped(m->generated_msg));
} SMARTLIST_FOREACH_END(m);
  }
--
diff --cc src/test/log_test_helpers.h
index 70c584eb3,a087b913f..f74028a8a
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@@ -101,5 -106,5 +106,4 @@@ void mock_dump_saved_logs(void)
assert_log_predicate(!mock_saved_log_has_entry(), \
  "expected log to not contain entries");
  
 -#endif
 -
 +#endif /* !defined(TOR_LOG_TEST_HELPERS_H) */
- 
diff --cc src/test/test_router.c
index 4e96e2453,51055a336..84473822a
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@@ -8,105 -7,136 +8,227 @@@
   **/
  
  #include "or.h"
 +#include "config.h"
 +#include "crypto_curve25519.h"
 +#include "crypto_ed25519.h"
+ #include "hibernate.h"
 -#include "log_test_helpers.h"
+ #include "main.h"
+ #include "rephist.h"
  #include "router.h"
 +#include "routerlist.h"
 +
 +/* Test suite stuff */
  #include "test.h"
++#include "log_test_helpers.h"
 +
 +NS_DECL(const routerinfo_t *, router_get_my_routerinfo, (void));
 +
 +static routerinfo_t* mock_routerinfo;
 +
 +static const routerinfo_t*
 +NS(router_get_my_routerinfo)(void)
 +{
 +  crypto_pk_t* ident_key;
 +  crypto_pk_t* tap_key;
 +  time_t now;
 +
 +  if (!mock_routerinfo) {
 +/* Mock the published timestamp, otherwise router_dump_router_to_string()
 + * will poop its pants. */
 +time();
 +
 +/* We'll need keys, or router_dump_router_to_string() would return NULL. 
*/
 +ident_key = pk_generate(0);
 +tap_key = pk_generate(0);
 +
 +tor_assert(ident_key != NULL);
 +tor_assert(tap_key != NULL);
 +
 +mock_routerinfo = tor_malloc_zero(sizeof(routerinfo_t));
 +mock_routerinfo->nickname = tor_strdup("ConlonNancarrow");
 +mock_routerinfo->addr = 123456789;
 +mock_routerinfo->or_port = 443;
 +mock_routerinfo->platform = tor_strdup("unittest");
 +mock_routerinfo->cache_info.published_on = now;
 +mock_routerinfo->identity_pkey = crypto_pk_dup_key(ident_key);
 +mock_routerinfo->onion_pkey = crypto_pk_dup_key(tap_key);
 +mock_routerinfo->bandwidthrate = 9001;
 +mock_routerinfo->bandwidthburst = 9002;
 +  }
 +
 +  return mock_routerinfo;
 +}
 +
 +/* If no distribution option was set, then check_bridge_distribution_setting()
 + * should have set it to "any". */
 +static void
 +test_router_dump_router_to_string_no_bridge_distribution_method(void *arg)
 +{
 +  const char* needle = "bridge-distribution-request any";
 +  or_options_t* options = get_options_mutable();
 +  routerinfo_t* router = NULL;
 +  curve25519_keypair_t ntor_keypair;
 +  ed25519_keypair_t signing_keypair;
 +  char* desc = NULL;
 +  

[tor-commits] [tor/release-0.3.4] Check bandwidth changes only if small uptime

2018-11-15 Thread nickm
commit 7d70f67deaeea1a3dc80a763f13bcec5d7a2425d
Author: juga0 
Date:   Sun Jun 3 09:31:19 2018 +

Check bandwidth changes only if small uptime

to upload a new descriptor.
---
 src/or/router.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/or/router.c b/src/or/router.c
index 31f2ff00d..ab916fb6e 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2425,13 +2425,24 @@ mark_my_descriptor_dirty(const char *reason)
  * if our previous bandwidth estimate was exactly 0. */
 #define MAX_BANDWIDTH_CHANGE_FREQ (3*60*60)
 
+/** Maximum uptime to republish our descriptor because of large shifts in
+ * estimated bandwidth. */
+#define MAX_UPTIME_BANDWIDTH_CHANGE (24*60*60)
+
 /** Check whether bandwidth has changed a lot since the last time we announced
- * bandwidth. If so, mark our descriptor dirty. */
+ * bandwidth while the uptime is smaller than MAX_UPTIME_BANDWIDTH_CHANGE.
+ * If so, mark our descriptor dirty. */
 void
 check_descriptor_bandwidth_changed(time_t now)
 {
   static time_t last_changed = 0;
   uint64_t prev, cur;
+
+  /* If the relay uptime is bigger than MAX_UPTIME_BANDWIDTH_CHANGE,
+   * the next regularly scheduled descriptor update (18h) will be enough */
+  if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE)
+return;
+
   if (!router_get_my_routerinfo())
 return;
 



___
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-11-15 Thread nickm
commit d612f7d9508e4233c9e49c077f27b0393a00508e
Merge: 066d25767 8af8ecabb
Author: Nick Mathewson 
Date:   Thu Nov 15 16:56:11 2018 -0500

Merge branch 'maint-0.3.5'

___
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-11-15 Thread nickm
commit 8af8ecabbe429503a4ff9d5510df610907c6e45a
Merge: c0e18d2f8 15e752e6b
Author: Nick Mathewson 
Date:   Thu Nov 15 16:55:42 2018 -0500

Merge branch 'maint-0.3.4' into maint-0.3.5

"ours" merge to avoid duplicating conflict resolution in merge of 24104




___
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-11-15 Thread nickm
commit 60bc9675da30e266f9d22e2db3db5adaaa73f6d0
Merge: 57ff37430 15e752e6b
Author: Nick Mathewson 
Date:   Thu Nov 15 16:56:11 2018 -0500

Merge branch 'maint-0.3.4' into release-0.3.4

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  24 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 16 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 'public/bug24104_029_squashed' into maint-0.2.9

2018-11-15 Thread nickm
commit 8569166c70f99bf908e78ce272e71eb60cdc84d0
Merge: 7f042cbc0 81f422332
Author: Nick Mathewson 
Date:   Thu Nov 15 16:43:50 2018 -0500

Merge remote-tracking branch 'public/bug24104_029_squashed' into maint-0.2.9

Resolved conflicts with the 26269 fix in 015fcd0e1191aa6f.

 changes/bug24104|   4 ++
 src/or/rephist.c|   6 +-
 src/or/rephist.h|   4 +-
 src/or/router.c |  25 ++--
 src/test/include.am |   1 +
 src/test/log_test_helpers.c |  22 ++-
 src/test/log_test_helpers.h |   7 ++-
 src/test/test.c |   1 +
 src/test/test_router.c  | 142 
 9 files changed, 200 insertions(+), 12 deletions(-)

diff --cc src/or/router.c
index 35b6bd203,f1a99364e..c41647422
--- a/src/or/router.c
+++ b/src/or/router.c
@@@ -2433,15 -2440,21 +2441,23 @@@ check_descriptor_bandwidth_changed(time
  {
static time_t last_changed = 0;
uint64_t prev, cur;
 +  const routerinfo_t *my_ri = router_get_my_routerinfo();
++
+   int hibernating = we_are_hibernating();
+ 
+   /* If the relay uptime is bigger than MAX_UPTIME_BANDWIDTH_CHANGE,
+* the next regularly scheduled descriptor update (18h) will be enough */
+   if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE && !hibernating)
+ return;
+ 
 -  if (!router_get_my_routerinfo())
 +  if (!my_ri) /* make sure routerinfo exists */
  return;
  
 -  prev = router_get_my_routerinfo()->bandwidthcapacity;
 +  prev = my_ri->bandwidthcapacity;
-   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+   cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
-   cur > prev*2 ||
-   cur < prev/2) {
+   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
  if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
log_info(LD_GENERAL,
 "Measured bandwidth has changed; rebuilding descriptor.");
@@@ -3640,4 -3652,4 +3656,3 @@@ router_get_all_orports(const routerinfo
fake_node.ri = (routerinfo_t *)ri;
return node_get_all_orports(_node);
  }
--



___
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.2.9' into maint-0.3.3

2018-11-15 Thread nickm
commit cbe04d455016233f4759fe281c07dd7db6096c2a
Merge: aebe8a82c 8569166c7
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:16 2018 -0500

Merge branch 'maint-0.2.9' into maint-0.3.3

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  25 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 17 deletions(-)

diff --cc src/or/rephist.c
index 43494692c,2844c4d74..67e4d3150
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@@ -3205,4 -3292,4 +3205,3 @@@ rep_hist_free_all(void
tor_assert_nonfatal(rephist_total_alloc == 0);
tor_assert_nonfatal_once(rephist_total_num == 0);
  }
--
diff --cc src/or/rephist.h
index 507272159,6d35ac67f..3e64a3de4
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@@ -111,30 -119,5 +111,29 @@@ extern int onion_handshakes_requested[M
  extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1];
  #endif
  
 -#endif
 -
 +/**
 + * Represents the type of a cell for padding accounting
 + */
 +typedef enum padding_type_t {
 +/** A RELAY_DROP cell */
 +PADDING_TYPE_DROP,
 +/** A CELL_PADDING cell */
 +PADDING_TYPE_CELL,
 +/** Total counts of padding and non-padding together */
 +PADDING_TYPE_TOTAL,
 +/** Total cell counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_TOTAL,
 +/** CELL_PADDING counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_CELL
 +} padding_type_t;
 +
 +/** The amount of time over which the padding cell counts were counted */
 +#define REPHIST_CELL_PADDING_COUNTS_INTERVAL (24*60*60)
 +void rep_hist_padding_count_read(padding_type_t type);
 +void rep_hist_padding_count_write(padding_type_t type);
 +char *rep_hist_get_padding_count_lines(void);
 +void rep_hist_reset_padding_counts(void);
 +void rep_hist_prep_published_padding_counts(time_t now);
 +void rep_hist_padding_count_timers(uint64_t num_timers);
 +
 +#endif /* !defined(TOR_REPHIST_H) */
- 
diff --cc src/test/log_test_helpers.c
index d5a39cfee,c5368b6cb..1ad01afc8
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@@ -238,4 -258,4 +258,3 @@@ mock_dump_saved_logs(void
 escaped(m->generated_msg));
} SMARTLIST_FOREACH_END(m);
  }
--
diff --cc src/test/log_test_helpers.h
index 70c584eb3,a087b913f..f74028a8a
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@@ -101,5 -106,5 +106,4 @@@ void mock_dump_saved_logs(void)
assert_log_predicate(!mock_saved_log_has_entry(), \
  "expected log to not contain entries");
  
 -#endif
 -
 +#endif /* !defined(TOR_LOG_TEST_HELPERS_H) */
- 
diff --cc src/test/test_router.c
index 4e96e2453,51055a336..84473822a
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@@ -8,105 -7,136 +8,227 @@@
   **/
  
  #include "or.h"
 +#include "config.h"
 +#include "crypto_curve25519.h"
 +#include "crypto_ed25519.h"
+ #include "hibernate.h"
 -#include "log_test_helpers.h"
+ #include "main.h"
+ #include "rephist.h"
  #include "router.h"
 +#include "routerlist.h"
 +
 +/* Test suite stuff */
  #include "test.h"
++#include "log_test_helpers.h"
 +
 +NS_DECL(const routerinfo_t *, router_get_my_routerinfo, (void));
 +
 +static routerinfo_t* mock_routerinfo;
 +
 +static const routerinfo_t*
 +NS(router_get_my_routerinfo)(void)
 +{
 +  crypto_pk_t* ident_key;
 +  crypto_pk_t* tap_key;
 +  time_t now;
 +
 +  if (!mock_routerinfo) {
 +/* Mock the published timestamp, otherwise router_dump_router_to_string()
 + * will poop its pants. */
 +time();
 +
 +/* We'll need keys, or router_dump_router_to_string() would return NULL. 
*/
 +ident_key = pk_generate(0);
 +tap_key = pk_generate(0);
 +
 +tor_assert(ident_key != NULL);
 +tor_assert(tap_key != NULL);
 +
 +mock_routerinfo = tor_malloc_zero(sizeof(routerinfo_t));
 +mock_routerinfo->nickname = tor_strdup("ConlonNancarrow");
 +mock_routerinfo->addr = 123456789;
 +mock_routerinfo->or_port = 443;
 +mock_routerinfo->platform = tor_strdup("unittest");
 +mock_routerinfo->cache_info.published_on = now;
 +mock_routerinfo->identity_pkey = crypto_pk_dup_key(ident_key);
 +mock_routerinfo->onion_pkey = crypto_pk_dup_key(tap_key);
 +mock_routerinfo->bandwidthrate = 9001;
 +mock_routerinfo->bandwidthburst = 9002;
 +  }
 +
 +  return mock_routerinfo;
 +}
 +
 +/* If no distribution option was set, then check_bridge_distribution_setting()
 + * should have set it to "any". */
 +static void
 +test_router_dump_router_to_string_no_bridge_distribution_method(void *arg)
 +{
 +  const char* needle = "bridge-distribution-request any";
 +  or_options_t* options = get_options_mutable();
 +  routerinfo_t* router = NULL;
 +  curve25519_keypair_t ntor_keypair;
 +  ed25519_keypair_t signing_keypair;
 +  char* desc = NULL;
 +  

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

2018-11-15 Thread nickm
commit cbe04d455016233f4759fe281c07dd7db6096c2a
Merge: aebe8a82c 8569166c7
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:16 2018 -0500

Merge branch 'maint-0.2.9' into maint-0.3.3

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  25 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 17 deletions(-)

diff --cc src/or/rephist.c
index 43494692c,2844c4d74..67e4d3150
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@@ -3205,4 -3292,4 +3205,3 @@@ rep_hist_free_all(void
tor_assert_nonfatal(rephist_total_alloc == 0);
tor_assert_nonfatal_once(rephist_total_num == 0);
  }
--
diff --cc src/or/rephist.h
index 507272159,6d35ac67f..3e64a3de4
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@@ -111,30 -119,5 +111,29 @@@ extern int onion_handshakes_requested[M
  extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1];
  #endif
  
 -#endif
 -
 +/**
 + * Represents the type of a cell for padding accounting
 + */
 +typedef enum padding_type_t {
 +/** A RELAY_DROP cell */
 +PADDING_TYPE_DROP,
 +/** A CELL_PADDING cell */
 +PADDING_TYPE_CELL,
 +/** Total counts of padding and non-padding together */
 +PADDING_TYPE_TOTAL,
 +/** Total cell counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_TOTAL,
 +/** CELL_PADDING counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_CELL
 +} padding_type_t;
 +
 +/** The amount of time over which the padding cell counts were counted */
 +#define REPHIST_CELL_PADDING_COUNTS_INTERVAL (24*60*60)
 +void rep_hist_padding_count_read(padding_type_t type);
 +void rep_hist_padding_count_write(padding_type_t type);
 +char *rep_hist_get_padding_count_lines(void);
 +void rep_hist_reset_padding_counts(void);
 +void rep_hist_prep_published_padding_counts(time_t now);
 +void rep_hist_padding_count_timers(uint64_t num_timers);
 +
 +#endif /* !defined(TOR_REPHIST_H) */
- 
diff --cc src/test/log_test_helpers.c
index d5a39cfee,c5368b6cb..1ad01afc8
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@@ -238,4 -258,4 +258,3 @@@ mock_dump_saved_logs(void
 escaped(m->generated_msg));
} SMARTLIST_FOREACH_END(m);
  }
--
diff --cc src/test/log_test_helpers.h
index 70c584eb3,a087b913f..f74028a8a
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@@ -101,5 -106,5 +106,4 @@@ void mock_dump_saved_logs(void)
assert_log_predicate(!mock_saved_log_has_entry(), \
  "expected log to not contain entries");
  
 -#endif
 -
 +#endif /* !defined(TOR_LOG_TEST_HELPERS_H) */
- 
diff --cc src/test/test_router.c
index 4e96e2453,51055a336..84473822a
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@@ -8,105 -7,136 +8,227 @@@
   **/
  
  #include "or.h"
 +#include "config.h"
 +#include "crypto_curve25519.h"
 +#include "crypto_ed25519.h"
+ #include "hibernate.h"
 -#include "log_test_helpers.h"
+ #include "main.h"
+ #include "rephist.h"
  #include "router.h"
 +#include "routerlist.h"
 +
 +/* Test suite stuff */
  #include "test.h"
++#include "log_test_helpers.h"
 +
 +NS_DECL(const routerinfo_t *, router_get_my_routerinfo, (void));
 +
 +static routerinfo_t* mock_routerinfo;
 +
 +static const routerinfo_t*
 +NS(router_get_my_routerinfo)(void)
 +{
 +  crypto_pk_t* ident_key;
 +  crypto_pk_t* tap_key;
 +  time_t now;
 +
 +  if (!mock_routerinfo) {
 +/* Mock the published timestamp, otherwise router_dump_router_to_string()
 + * will poop its pants. */
 +time();
 +
 +/* We'll need keys, or router_dump_router_to_string() would return NULL. 
*/
 +ident_key = pk_generate(0);
 +tap_key = pk_generate(0);
 +
 +tor_assert(ident_key != NULL);
 +tor_assert(tap_key != NULL);
 +
 +mock_routerinfo = tor_malloc_zero(sizeof(routerinfo_t));
 +mock_routerinfo->nickname = tor_strdup("ConlonNancarrow");
 +mock_routerinfo->addr = 123456789;
 +mock_routerinfo->or_port = 443;
 +mock_routerinfo->platform = tor_strdup("unittest");
 +mock_routerinfo->cache_info.published_on = now;
 +mock_routerinfo->identity_pkey = crypto_pk_dup_key(ident_key);
 +mock_routerinfo->onion_pkey = crypto_pk_dup_key(tap_key);
 +mock_routerinfo->bandwidthrate = 9001;
 +mock_routerinfo->bandwidthburst = 9002;
 +  }
 +
 +  return mock_routerinfo;
 +}
 +
 +/* If no distribution option was set, then check_bridge_distribution_setting()
 + * should have set it to "any". */
 +static void
 +test_router_dump_router_to_string_no_bridge_distribution_method(void *arg)
 +{
 +  const char* needle = "bridge-distribution-request any";
 +  or_options_t* options = get_options_mutable();
 +  routerinfo_t* router = NULL;
 +  curve25519_keypair_t ntor_keypair;
 +  ed25519_keypair_t signing_keypair;
 +  char* desc = NULL;
 +  

[tor-commits] [tor/release-0.3.3] Allow mocking rep_hist_bandwidth_assess

2018-11-15 Thread nickm
commit e13ddee1665bc83442be04820b51b425fa98e848
Author: juga0 
Date:   Sat Jun 9 12:54:08 2018 +

Allow mocking rep_hist_bandwidth_assess
---
 src/or/rephist.c | 6 +++---
 src/or/rephist.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/or/rephist.c b/src/or/rephist.c
index f0bac5789..2844c4d74 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1,5 +1,5 @@
 /* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2016, The Tor Project, Inc. */
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
 /**
@@ -1427,8 +1427,8 @@ find_largest_max(bw_array_t *b)
  *
  * Return the smaller of these sums, divided by NUM_SECS_ROLLING_MEASURE.
  */
-int
-rep_hist_bandwidth_assess(void)
+MOCK_IMPL(int,
+rep_hist_bandwidth_assess,(void))
 {
   uint64_t w,r;
   r = find_largest_max(read_array);
diff --git a/src/or/rephist.h b/src/or/rephist.h
index ff4810a56..6d35ac67f 100644
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@ -1,7 +1,7 @@
 /* Copyright (c) 2001 Matej Pfajfar.
  * Copyright (c) 2001-2004, Roger Dingledine.
  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2016, The Tor Project, Inc. */
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
 /**
@@ -29,7 +29,7 @@ void rep_hist_make_router_pessimal(const char *id, time_t 
when);
 void rep_hist_note_dir_bytes_read(size_t num_bytes, time_t when);
 void rep_hist_note_dir_bytes_written(size_t num_bytes, time_t when);
 
-int rep_hist_bandwidth_assess(void);
+MOCK_DECL(int, rep_hist_bandwidth_assess, (void));
 char *rep_hist_get_bandwidth_lines(void);
 void rep_hist_update_state(or_state_t *state);
 int rep_hist_load_state(or_state_t *state, char **err);



___
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] Allow mocking rep_hist_bandwidth_assess

2018-11-15 Thread nickm
commit e13ddee1665bc83442be04820b51b425fa98e848
Author: juga0 
Date:   Sat Jun 9 12:54:08 2018 +

Allow mocking rep_hist_bandwidth_assess
---
 src/or/rephist.c | 6 +++---
 src/or/rephist.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/or/rephist.c b/src/or/rephist.c
index f0bac5789..2844c4d74 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1,5 +1,5 @@
 /* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2016, The Tor Project, Inc. */
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
 /**
@@ -1427,8 +1427,8 @@ find_largest_max(bw_array_t *b)
  *
  * Return the smaller of these sums, divided by NUM_SECS_ROLLING_MEASURE.
  */
-int
-rep_hist_bandwidth_assess(void)
+MOCK_IMPL(int,
+rep_hist_bandwidth_assess,(void))
 {
   uint64_t w,r;
   r = find_largest_max(read_array);
diff --git a/src/or/rephist.h b/src/or/rephist.h
index ff4810a56..6d35ac67f 100644
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@ -1,7 +1,7 @@
 /* Copyright (c) 2001 Matej Pfajfar.
  * Copyright (c) 2001-2004, Roger Dingledine.
  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2016, The Tor Project, Inc. */
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
 /**
@@ -29,7 +29,7 @@ void rep_hist_make_router_pessimal(const char *id, time_t 
when);
 void rep_hist_note_dir_bytes_read(size_t num_bytes, time_t when);
 void rep_hist_note_dir_bytes_written(size_t num_bytes, time_t when);
 
-int rep_hist_bandwidth_assess(void);
+MOCK_DECL(int, rep_hist_bandwidth_assess, (void));
 char *rep_hist_get_bandwidth_lines(void);
 void rep_hist_update_state(or_state_t *state);
 int rep_hist_load_state(or_state_t *state, char **err);



___
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] Add test log helpers for msgs not containing str

2018-11-15 Thread nickm
commit 842b18ab26ac12da7e63c38413d193905b8fbed5
Author: juga0 
Date:   Sat Jun 9 10:34:17 2018 +

Add test log helpers for msgs not containing str
---
 src/test/log_test_helpers.c | 22 +-
 src/test/log_test_helpers.h |  7 ++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c
index c788a33c1..c5368b6cb 100644
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, The Tor Project, Inc. */
+/* Copyright (c) 2015-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 #define LOG_PRIVATE
 #include "torlog.h"
@@ -158,6 +158,26 @@ mock_saved_log_has_message_containing(const char *msg)
   return 0;
 }
 
+/**
+ * Return true iff there is not a message recorded by log capture
+ * that contains msg as a substring.
+ */
+int
+mock_saved_log_has_message_not_containing(const char *msg)
+{
+  if (saved_logs) {
+SMARTLIST_FOREACH(
+  saved_logs, mock_saved_log_entry_t *, m,
+  {
+if (msg && m->generated_msg && strstr(m->generated_msg, msg))
+  return 0;
+  }
+);
+  }
+
+  return 1;
+}
+
 /** Return true iff the saved logs have any messages with severity */
 int
 mock_saved_log_has_severity(int severity)
diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h
index 922c68b42..a087b913f 100644
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016, The Tor Project, Inc. */
+/* Copyright (c) 2014-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
 #include "or.h"
@@ -24,6 +24,7 @@ void teardown_capture_of_logs(void);
 
 int mock_saved_log_has_message(const char *msg);
 int mock_saved_log_has_message_containing(const char *msg);
+int mock_saved_log_has_message_not_containing(const char *msg);
 int mock_saved_log_has_severity(int severity);
 int mock_saved_log_has_entry(void);
 int mock_saved_log_n_entries(void);
@@ -46,6 +47,10 @@ void mock_dump_saved_logs(void);
   assert_log_predicate(mock_saved_log_has_message_containing(str), \
 "expected log to contain " # str);
 
+#define expect_log_msg_not_containing(str) \
+  assert_log_predicate(mock_saved_log_has_message_not_containing(str), \
+"expected log to not contain " # str);
+
 #define expect_log_msg_containing_either(str1, str2)\
   assert_log_predicate(mock_saved_log_has_message_containing(str1) ||   \
mock_saved_log_has_message_containing(str2), \



___
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-11-15 Thread nickm
commit 15e752e6b111e159b1dee3bb4692d8de3c4d1c7f
Merge: 63312e029 cbe04d455
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:56 2018 -0500

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  24 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 16 deletions(-)

diff --cc src/or/router.c
index 5485ec913,edaa040dd..03959e907
--- a/src/or/router.c
+++ b/src/or/router.c
@@@ -2642,13 -2544,10 +2658,13 @@@ check_descriptor_bandwidth_changed(time
  return;
  
prev = my_ri->bandwidthcapacity;
 +
 +  /* Consider ourselves to have zero bandwidth if we're hibernating or
 +   * shutting down. */
-   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+   cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
-   cur > prev*2 ||
-   cur < prev/2) {
+   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
  if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
log_info(LD_GENERAL,
 "Measured bandwidth has changed; rebuilding descriptor.");



___
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] Add test log helpers for msgs not containing str

2018-11-15 Thread nickm
commit 842b18ab26ac12da7e63c38413d193905b8fbed5
Author: juga0 
Date:   Sat Jun 9 10:34:17 2018 +

Add test log helpers for msgs not containing str
---
 src/test/log_test_helpers.c | 22 +-
 src/test/log_test_helpers.h |  7 ++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c
index c788a33c1..c5368b6cb 100644
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, The Tor Project, Inc. */
+/* Copyright (c) 2015-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 #define LOG_PRIVATE
 #include "torlog.h"
@@ -158,6 +158,26 @@ mock_saved_log_has_message_containing(const char *msg)
   return 0;
 }
 
+/**
+ * Return true iff there is not a message recorded by log capture
+ * that contains msg as a substring.
+ */
+int
+mock_saved_log_has_message_not_containing(const char *msg)
+{
+  if (saved_logs) {
+SMARTLIST_FOREACH(
+  saved_logs, mock_saved_log_entry_t *, m,
+  {
+if (msg && m->generated_msg && strstr(m->generated_msg, msg))
+  return 0;
+  }
+);
+  }
+
+  return 1;
+}
+
 /** Return true iff the saved logs have any messages with severity */
 int
 mock_saved_log_has_severity(int severity)
diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h
index 922c68b42..a087b913f 100644
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016, The Tor Project, Inc. */
+/* Copyright (c) 2014-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
 #include "or.h"
@@ -24,6 +24,7 @@ void teardown_capture_of_logs(void);
 
 int mock_saved_log_has_message(const char *msg);
 int mock_saved_log_has_message_containing(const char *msg);
+int mock_saved_log_has_message_not_containing(const char *msg);
 int mock_saved_log_has_severity(int severity);
 int mock_saved_log_has_entry(void);
 int mock_saved_log_n_entries(void);
@@ -46,6 +47,10 @@ void mock_dump_saved_logs(void);
   assert_log_predicate(mock_saved_log_has_message_containing(str), \
 "expected log to contain " # str);
 
+#define expect_log_msg_not_containing(str) \
+  assert_log_predicate(mock_saved_log_has_message_not_containing(str), \
+"expected log to not contain " # str);
+
 #define expect_log_msg_containing_either(str1, str2)\
   assert_log_predicate(mock_saved_log_has_message_containing(str1) ||   \
mock_saved_log_has_message_containing(str2), \



___
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 remote-tracking branch 'public/bug24104_029_squashed' into maint-0.2.9

2018-11-15 Thread nickm
commit 8569166c70f99bf908e78ce272e71eb60cdc84d0
Merge: 7f042cbc0 81f422332
Author: Nick Mathewson 
Date:   Thu Nov 15 16:43:50 2018 -0500

Merge remote-tracking branch 'public/bug24104_029_squashed' into maint-0.2.9

Resolved conflicts with the 26269 fix in 015fcd0e1191aa6f.

 changes/bug24104|   4 ++
 src/or/rephist.c|   6 +-
 src/or/rephist.h|   4 +-
 src/or/router.c |  25 ++--
 src/test/include.am |   1 +
 src/test/log_test_helpers.c |  22 ++-
 src/test/log_test_helpers.h |   7 ++-
 src/test/test.c |   1 +
 src/test/test_router.c  | 142 
 9 files changed, 200 insertions(+), 12 deletions(-)

diff --cc src/or/router.c
index 35b6bd203,f1a99364e..c41647422
--- a/src/or/router.c
+++ b/src/or/router.c
@@@ -2433,15 -2440,21 +2441,23 @@@ check_descriptor_bandwidth_changed(time
  {
static time_t last_changed = 0;
uint64_t prev, cur;
 +  const routerinfo_t *my_ri = router_get_my_routerinfo();
++
+   int hibernating = we_are_hibernating();
+ 
+   /* If the relay uptime is bigger than MAX_UPTIME_BANDWIDTH_CHANGE,
+* the next regularly scheduled descriptor update (18h) will be enough */
+   if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE && !hibernating)
+ return;
+ 
 -  if (!router_get_my_routerinfo())
 +  if (!my_ri) /* make sure routerinfo exists */
  return;
  
 -  prev = router_get_my_routerinfo()->bandwidthcapacity;
 +  prev = my_ri->bandwidthcapacity;
-   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+   cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
-   cur > prev*2 ||
-   cur < prev/2) {
+   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
  if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
log_info(LD_GENERAL,
 "Measured bandwidth has changed; rebuilding descriptor.");
@@@ -3640,4 -3652,4 +3656,3 @@@ router_get_all_orports(const routerinfo
fake_node.ri = (routerinfo_t *)ri;
return node_get_all_orports(_node);
  }
--



___
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-11-15 Thread nickm
commit 15e752e6b111e159b1dee3bb4692d8de3c4d1c7f
Merge: 63312e029 cbe04d455
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:56 2018 -0500

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  24 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 16 deletions(-)

diff --cc src/or/router.c
index 5485ec913,edaa040dd..03959e907
--- a/src/or/router.c
+++ b/src/or/router.c
@@@ -2642,13 -2544,10 +2658,13 @@@ check_descriptor_bandwidth_changed(time
  return;
  
prev = my_ri->bandwidthcapacity;
 +
 +  /* Consider ourselves to have zero bandwidth if we're hibernating or
 +   * shutting down. */
-   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+   cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
-   cur > prev*2 ||
-   cur < prev/2) {
+   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
  if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
log_info(LD_GENERAL,
 "Measured bandwidth has changed; rebuilding descriptor.");



___
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] Add missing router_tests to test.h

2018-11-15 Thread nickm
commit d4e51a2eeb173fab25d3945d045499b80cb4565c
Author: juga0 
Date:   Mon Jul 2 08:48:36 2018 +

Add missing router_tests to test.h
---
 src/test/test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test.c b/src/test/test.c
index 0fef69790..4632ea497 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1240,6 +1240,7 @@ struct testgroup_t testgroups[] = {
   { "relaycell/", relaycell_tests },
   { "rend_cache/", rend_cache_tests },
   { "replaycache/", replaycache_tests },
+  { "router/", router_tests },
   { "routerkeys/", routerkeys_tests },
   { "routerlist/", routerlist_tests },
   { "routerset/" , routerset_tests },



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

2018-11-15 Thread nickm
commit bbb82a52491de244fbdf5d7b6f22ae26f8b4ea19
Author: juga0 
Date:   Mon Jun 4 20:40:21 2018 +

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

diff --git a/changes/bug24104 b/changes/bug24104
new file mode 100644
index 0..ca2a3537f
--- /dev/null
+++ b/changes/bug24104
@@ -0,0 +1,4 @@
+  o Minor bugfix (relay statistics):
+- Update relay descriptor on bandwidth changes only when the uptime is
+  smaller than 24h in order to reduce the efficiency of guard discovery
+  attacks. Fixes bug 24104; bugfix on 0.1.1.6-alpha.



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

2018-11-15 Thread nickm
commit bbb82a52491de244fbdf5d7b6f22ae26f8b4ea19
Author: juga0 
Date:   Mon Jun 4 20:40:21 2018 +

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

diff --git a/changes/bug24104 b/changes/bug24104
new file mode 100644
index 0..ca2a3537f
--- /dev/null
+++ b/changes/bug24104
@@ -0,0 +1,4 @@
+  o Minor bugfix (relay statistics):
+- Update relay descriptor on bandwidth changes only when the uptime is
+  smaller than 24h in order to reduce the efficiency of guard discovery
+  attacks. Fixes bug 24104; bugfix on 0.1.1.6-alpha.



___
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] Check descriptor bandwidth changed if not hibernating

2018-11-15 Thread nickm
commit e033d98f79a950a342a7db6909709b5dc987b2cb
Author: juga0 
Date:   Mon Jul 2 08:21:43 2018 +

Check descriptor bandwidth changed if not hibernating

There should be a separate check to update descriptor when start
or end hibernating.
---
 src/or/router.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/or/router.c b/src/or/router.c
index 4afba6549..f1a99364e 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2440,17 +2440,18 @@ check_descriptor_bandwidth_changed(time_t now)
 {
   static time_t last_changed = 0;
   uint64_t prev, cur;
+  int hibernating = we_are_hibernating();
 
   /* If the relay uptime is bigger than MAX_UPTIME_BANDWIDTH_CHANGE,
* the next regularly scheduled descriptor update (18h) will be enough */
-  if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE)
+  if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE && !hibernating)
 return;
 
   if (!router_get_my_routerinfo())
 return;
 
   prev = router_get_my_routerinfo()->bandwidthcapacity;
-  cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+  cur = hibernating ? 0 : rep_hist_bandwidth_assess();
   if ((prev != cur && (!prev || !cur)) ||
   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {



___
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] Check descriptor bandwidth changed if not hibernating

2018-11-15 Thread nickm
commit e033d98f79a950a342a7db6909709b5dc987b2cb
Author: juga0 
Date:   Mon Jul 2 08:21:43 2018 +

Check descriptor bandwidth changed if not hibernating

There should be a separate check to update descriptor when start
or end hibernating.
---
 src/or/router.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/or/router.c b/src/or/router.c
index 4afba6549..f1a99364e 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2440,17 +2440,18 @@ check_descriptor_bandwidth_changed(time_t now)
 {
   static time_t last_changed = 0;
   uint64_t prev, cur;
+  int hibernating = we_are_hibernating();
 
   /* If the relay uptime is bigger than MAX_UPTIME_BANDWIDTH_CHANGE,
* the next regularly scheduled descriptor update (18h) will be enough */
-  if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE)
+  if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE && !hibernating)
 return;
 
   if (!router_get_my_routerinfo())
 return;
 
   prev = router_get_my_routerinfo()->bandwidthcapacity;
-  cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+  cur = hibernating ? 0 : rep_hist_bandwidth_assess();
   if ((prev != cur && (!prev || !cur)) ||
   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {



___
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] Add missing router_tests to test.h

2018-11-15 Thread nickm
commit d4e51a2eeb173fab25d3945d045499b80cb4565c
Author: juga0 
Date:   Mon Jul 2 08:48:36 2018 +

Add missing router_tests to test.h
---
 src/test/test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test.c b/src/test/test.c
index 0fef69790..4632ea497 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1240,6 +1240,7 @@ struct testgroup_t testgroups[] = {
   { "relaycell/", relaycell_tests },
   { "rend_cache/", rend_cache_tests },
   { "replaycache/", replaycache_tests },
+  { "router/", router_tests },
   { "routerkeys/", routerkeys_tests },
   { "routerlist/", routerlist_tests },
   { "routerset/" , routerset_tests },



___
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-11-15 Thread nickm
commit 8af8ecabbe429503a4ff9d5510df610907c6e45a
Merge: c0e18d2f8 15e752e6b
Author: Nick Mathewson 
Date:   Thu Nov 15 16:55:42 2018 -0500

Merge branch 'maint-0.3.4' into maint-0.3.5

"ours" merge to avoid duplicating conflict resolution in merge of 24104

___
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] Make bandwidth change factor a constant

2018-11-15 Thread nickm
commit 6210d568ecc5c2fd1833126d68505f42e4399820
Author: juga0 
Date:   Sun Jun 3 09:40:57 2018 +

Make bandwidth change factor a constant

used to determine large changes in bandwidth.
---
 src/or/router.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/or/router.c b/src/or/router.c
index ab916fb6e..4afba6549 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2429,6 +2429,9 @@ mark_my_descriptor_dirty(const char *reason)
  * estimated bandwidth. */
 #define MAX_UPTIME_BANDWIDTH_CHANGE (24*60*60)
 
+/** By which factor bandwidth shifts have to change to be considered large. */
+#define BANDWIDTH_CHANGE_FACTOR 2
+
 /** Check whether bandwidth has changed a lot since the last time we announced
  * bandwidth while the uptime is smaller than MAX_UPTIME_BANDWIDTH_CHANGE.
  * If so, mark our descriptor dirty. */
@@ -2449,8 +2452,8 @@ check_descriptor_bandwidth_changed(time_t now)
   prev = router_get_my_routerinfo()->bandwidthcapacity;
   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
   if ((prev != cur && (!prev || !cur)) ||
-  cur > prev*2 ||
-  cur < prev/2) {
+  cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+  cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
 if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
   log_info(LD_GENERAL,
"Measured bandwidth has changed; rebuilding descriptor.");



___
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] Make bandwidth change factor a constant

2018-11-15 Thread nickm
commit 6210d568ecc5c2fd1833126d68505f42e4399820
Author: juga0 
Date:   Sun Jun 3 09:40:57 2018 +

Make bandwidth change factor a constant

used to determine large changes in bandwidth.
---
 src/or/router.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/or/router.c b/src/or/router.c
index ab916fb6e..4afba6549 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2429,6 +2429,9 @@ mark_my_descriptor_dirty(const char *reason)
  * estimated bandwidth. */
 #define MAX_UPTIME_BANDWIDTH_CHANGE (24*60*60)
 
+/** By which factor bandwidth shifts have to change to be considered large. */
+#define BANDWIDTH_CHANGE_FACTOR 2
+
 /** Check whether bandwidth has changed a lot since the last time we announced
  * bandwidth while the uptime is smaller than MAX_UPTIME_BANDWIDTH_CHANGE.
  * If so, mark our descriptor dirty. */
@@ -2449,8 +2452,8 @@ check_descriptor_bandwidth_changed(time_t now)
   prev = router_get_my_routerinfo()->bandwidthcapacity;
   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
   if ((prev != cur && (!prev || !cur)) ||
-  cur > prev*2 ||
-  cur < prev/2) {
+  cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+  cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
 if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
   log_info(LD_GENERAL,
"Measured bandwidth has changed; rebuilding descriptor.");



___
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] Add test for check_descriptor_bandwidth_changed

2018-11-15 Thread nickm
commit 1066fdd8d1e084ef38281c9817032e68e2a490ff
Author: juga0 
Date:   Sat Jun 9 10:34:41 2018 +

Add test for check_descriptor_bandwidth_changed
---
 src/test/include.am|   1 +
 src/test/test_router.c | 120 +
 2 files changed, 121 insertions(+)

diff --git a/src/test/include.am b/src/test/include.am
index 0ee3d1169..7864d7d9f 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -117,6 +117,7 @@ src_test_test_SOURCES = \
src/test/test_relaycell.c \
src/test/test_rendcache.c \
src/test/test_replay.c \
+   src/test/test_router.c \
src/test/test_routerkeys.c \
src/test/test_routerlist.c \
src/test/test_routerset.c \
diff --git a/src/test/test_router.c b/src/test/test_router.c
new file mode 100644
index 0..a4921da9b
--- /dev/null
+++ b/src/test/test_router.c
@@ -0,0 +1,120 @@
+/* Copyright (c) 2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file test_router.c
+ * \brief Unittests for code in src/or/router.c
+ **/
+
+#include "or.h"
+#include "hibernate.h"
+#include "log_test_helpers.h"
+#include "main.h"
+#include "rephist.h"
+#include "router.h"
+#include "test.h"
+
+static routerinfo_t *mock_router_get_my_routerinfo_result = NULL;
+
+static const routerinfo_t *
+mock_router_get_my_routerinfo(void)
+{
+  return mock_router_get_my_routerinfo_result;
+}
+
+static long
+mock_get_uptime_3h(void)
+{
+  return 3*60*60;
+}
+
+static long
+mock_get_uptime_1d(void)
+{
+  return 24*60*60;
+}
+
+static int
+mock_rep_hist_bandwidth_assess(void)
+{
+  return 20001;
+}
+
+static int
+mock_we_are_hibernating(void)
+{
+  return 0;
+}
+
+static void
+test_router_check_descriptor_bandwidth_changed(void *arg)
+{
+  (void)arg;
+  routerinfo_t routerinfo;
+  memset(, 0, sizeof(routerinfo));
+  mock_router_get_my_routerinfo_result = NULL;
+
+  MOCK(we_are_hibernating, mock_we_are_hibernating);
+  MOCK(router_get_my_routerinfo, mock_router_get_my_routerinfo);
+  mock_router_get_my_routerinfo_result = 
+
+  /* When uptime is less than 24h, no previous bandwidth, no last_changed
+   * Uptime: 10800, last_changed: 0, Previous bw: 0, Current bw: 0 */
+  routerinfo.bandwidthcapacity = 0;
+  MOCK(get_uptime, mock_get_uptime_3h);
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_not_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  teardown_capture_of_logs();
+
+  /* When uptime is less than 24h, previous bandwidth,
+   * last_changed more than 3h ago
+   * Uptime: 10800, last_changed: 0, Previous bw: 1, Current bw: 0 */
+  routerinfo.bandwidthcapacity = 1;
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  teardown_capture_of_logs();
+
+  /* When uptime is less than 24h, last_changed is not more than 3h ago
+   * Uptime: 10800, last_changed: x, Previous bw: 1, Current bw: 0 */
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_not_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  teardown_capture_of_logs();
+
+  /* When uptime is less than 24h and bandwidthcapacity does not change
+   * Uptime: 10800, last_changed: x, Previous bw: 1, Current bw: 20001 */
+  MOCK(rep_hist_bandwidth_assess, mock_rep_hist_bandwidth_assess);
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL) + 6*60*60 + 1);
+  expect_log_msg_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  UNMOCK(get_uptime);
+  UNMOCK(rep_hist_bandwidth_assess);
+  teardown_capture_of_logs();
+
+  /* When uptime is more than 24h */
+  MOCK(get_uptime, mock_get_uptime_1d);
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_not_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  UNMOCK(get_uptime);
+  teardown_capture_of_logs();
+
+ done:
+  UNMOCK(router_get_my_routerinfo);
+}
+
+#define ROUTER_TEST(name, flags)  \
+  { #name, test_router_ ## name, flags, NULL, NULL }
+
+struct testcase_t router_tests[] = {
+  ROUTER_TEST(check_descriptor_bandwidth_changed, TT_FORK),
+  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/release-0.3.3] Merge branch 'maint-0.3.3' into release-0.3.3

2018-11-15 Thread nickm
commit b3235e21ab3dc2d31e6bd5a874290675ff4756bf
Merge: e8708c2fb cbe04d455
Author: Nick Mathewson 
Date:   Thu Nov 15 16:56:11 2018 -0500

Merge branch 'maint-0.3.3' into release-0.3.3

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  25 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 17 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] Merge branch 'maint-0.3.3' into maint-0.3.4

2018-11-15 Thread nickm
commit 15e752e6b111e159b1dee3bb4692d8de3c4d1c7f
Merge: 63312e029 cbe04d455
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:56 2018 -0500

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  24 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 16 deletions(-)

diff --cc src/or/router.c
index 5485ec913,edaa040dd..03959e907
--- a/src/or/router.c
+++ b/src/or/router.c
@@@ -2642,13 -2544,10 +2658,13 @@@ check_descriptor_bandwidth_changed(time
  return;
  
prev = my_ri->bandwidthcapacity;
 +
 +  /* Consider ourselves to have zero bandwidth if we're hibernating or
 +   * shutting down. */
-   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+   cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
-   cur > prev*2 ||
-   cur < prev/2) {
+   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
  if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
log_info(LD_GENERAL,
 "Measured bandwidth has changed; rebuilding descriptor.");



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

2018-11-15 Thread nickm
commit 15e752e6b111e159b1dee3bb4692d8de3c4d1c7f
Merge: 63312e029 cbe04d455
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:56 2018 -0500

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  24 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 16 deletions(-)

diff --cc src/or/router.c
index 5485ec913,edaa040dd..03959e907
--- a/src/or/router.c
+++ b/src/or/router.c
@@@ -2642,13 -2544,10 +2658,13 @@@ check_descriptor_bandwidth_changed(time
  return;
  
prev = my_ri->bandwidthcapacity;
 +
 +  /* Consider ourselves to have zero bandwidth if we're hibernating or
 +   * shutting down. */
-   cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
+   cur = hibernating ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
-   cur > prev*2 ||
-   cur < prev/2) {
+   cur > (prev * BANDWIDTH_CHANGE_FACTOR) ||
+   cur < (prev / BANDWIDTH_CHANGE_FACTOR) ) {
  if (last_changed+MAX_BANDWIDTH_CHANGE_FREQ < now || !prev) {
log_info(LD_GENERAL,
 "Measured bandwidth has changed; rebuilding descriptor.");

___
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 for descriptor does not change when hibernating

2018-11-15 Thread nickm
commit 81f4223329a709e5138532b037a58c118b30dd7f
Author: juga0 
Date:   Mon Jul 2 09:02:32 2018 +

Test for descriptor does not change when hibernating
---
 src/test/test_router.c | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/test/test_router.c b/src/test/test_router.c
index a4921da9b..51055a336 100644
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@ -41,6 +41,12 @@ mock_rep_hist_bandwidth_assess(void)
 }
 
 static int
+mock_we_are_not_hibernating(void)
+{
+  return 0;
+}
+
+static int
 mock_we_are_hibernating(void)
 {
   return 0;
@@ -54,7 +60,7 @@ test_router_check_descriptor_bandwidth_changed(void *arg)
   memset(, 0, sizeof(routerinfo));
   mock_router_get_my_routerinfo_result = NULL;
 
-  MOCK(we_are_hibernating, mock_we_are_hibernating);
+  MOCK(we_are_hibernating, mock_we_are_not_hibernating);
   MOCK(router_get_my_routerinfo, mock_router_get_my_routerinfo);
   mock_router_get_my_routerinfo_result = 
 
@@ -78,6 +84,21 @@ test_router_check_descriptor_bandwidth_changed(void *arg)
  "Measured bandwidth has changed; rebuilding descriptor.");
   teardown_capture_of_logs();
 
+  /* When uptime is less than 24h, previous bandwidth,
+   * last_changed more than 3h ago, and hibernating
+   * Uptime: 10800, last_changed: 0, Previous bw: 1, Current bw: 0 */
+
+  UNMOCK(we_are_hibernating);
+  MOCK(we_are_hibernating, mock_we_are_hibernating);
+  routerinfo.bandwidthcapacity = 1;
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_not_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  teardown_capture_of_logs();
+  UNMOCK(we_are_hibernating);
+  MOCK(we_are_hibernating, mock_we_are_not_hibernating);
+
   /* When uptime is less than 24h, last_changed is not more than 3h ago
* Uptime: 10800, last_changed: x, Previous bw: 1, Current bw: 0 */
   setup_full_capture_of_logs(LOG_INFO);
@@ -103,11 +124,12 @@ test_router_check_descriptor_bandwidth_changed(void *arg)
   check_descriptor_bandwidth_changed(time(NULL));
   expect_log_msg_not_containing(
  "Measured bandwidth has changed; rebuilding descriptor.");
-  UNMOCK(get_uptime);
   teardown_capture_of_logs();
 
  done:
+  UNMOCK(get_uptime);
   UNMOCK(router_get_my_routerinfo);
+  UNMOCK(we_are_hibernating);
 }
 
 #define ROUTER_TEST(name, flags)  \



___
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-11-15 Thread nickm
commit f46fcb6d33548bfa3f0a5980867f392b5bec8e66
Merge: d46b0a3c4 8af8ecabb
Author: Nick Mathewson 
Date:   Thu Nov 15 16:56:11 2018 -0500

Merge branch 'maint-0.3.5' into release-0.3.5

___
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] Check bandwidth changes only if small uptime

2018-11-15 Thread nickm
commit 7d70f67deaeea1a3dc80a763f13bcec5d7a2425d
Author: juga0 
Date:   Sun Jun 3 09:31:19 2018 +

Check bandwidth changes only if small uptime

to upload a new descriptor.
---
 src/or/router.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/or/router.c b/src/or/router.c
index 31f2ff00d..ab916fb6e 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2425,13 +2425,24 @@ mark_my_descriptor_dirty(const char *reason)
  * if our previous bandwidth estimate was exactly 0. */
 #define MAX_BANDWIDTH_CHANGE_FREQ (3*60*60)
 
+/** Maximum uptime to republish our descriptor because of large shifts in
+ * estimated bandwidth. */
+#define MAX_UPTIME_BANDWIDTH_CHANGE (24*60*60)
+
 /** Check whether bandwidth has changed a lot since the last time we announced
- * bandwidth. If so, mark our descriptor dirty. */
+ * bandwidth while the uptime is smaller than MAX_UPTIME_BANDWIDTH_CHANGE.
+ * If so, mark our descriptor dirty. */
 void
 check_descriptor_bandwidth_changed(time_t now)
 {
   static time_t last_changed = 0;
   uint64_t prev, cur;
+
+  /* If the relay uptime is bigger than MAX_UPTIME_BANDWIDTH_CHANGE,
+   * the next regularly scheduled descriptor update (18h) will be enough */
+  if (get_uptime() > MAX_UPTIME_BANDWIDTH_CHANGE)
+return;
+
   if (!router_get_my_routerinfo())
 return;
 



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


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

2018-11-15 Thread nickm
commit cbe04d455016233f4759fe281c07dd7db6096c2a
Merge: aebe8a82c 8569166c7
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:16 2018 -0500

Merge branch 'maint-0.2.9' into maint-0.3.3

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  25 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 17 deletions(-)

diff --cc src/or/rephist.c
index 43494692c,2844c4d74..67e4d3150
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@@ -3205,4 -3292,4 +3205,3 @@@ rep_hist_free_all(void
tor_assert_nonfatal(rephist_total_alloc == 0);
tor_assert_nonfatal_once(rephist_total_num == 0);
  }
--
diff --cc src/or/rephist.h
index 507272159,6d35ac67f..3e64a3de4
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@@ -111,30 -119,5 +111,29 @@@ extern int onion_handshakes_requested[M
  extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1];
  #endif
  
 -#endif
 -
 +/**
 + * Represents the type of a cell for padding accounting
 + */
 +typedef enum padding_type_t {
 +/** A RELAY_DROP cell */
 +PADDING_TYPE_DROP,
 +/** A CELL_PADDING cell */
 +PADDING_TYPE_CELL,
 +/** Total counts of padding and non-padding together */
 +PADDING_TYPE_TOTAL,
 +/** Total cell counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_TOTAL,
 +/** CELL_PADDING counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_CELL
 +} padding_type_t;
 +
 +/** The amount of time over which the padding cell counts were counted */
 +#define REPHIST_CELL_PADDING_COUNTS_INTERVAL (24*60*60)
 +void rep_hist_padding_count_read(padding_type_t type);
 +void rep_hist_padding_count_write(padding_type_t type);
 +char *rep_hist_get_padding_count_lines(void);
 +void rep_hist_reset_padding_counts(void);
 +void rep_hist_prep_published_padding_counts(time_t now);
 +void rep_hist_padding_count_timers(uint64_t num_timers);
 +
 +#endif /* !defined(TOR_REPHIST_H) */
- 
diff --cc src/test/log_test_helpers.c
index d5a39cfee,c5368b6cb..1ad01afc8
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@@ -238,4 -258,4 +258,3 @@@ mock_dump_saved_logs(void
 escaped(m->generated_msg));
} SMARTLIST_FOREACH_END(m);
  }
--
diff --cc src/test/log_test_helpers.h
index 70c584eb3,a087b913f..f74028a8a
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@@ -101,5 -106,5 +106,4 @@@ void mock_dump_saved_logs(void)
assert_log_predicate(!mock_saved_log_has_entry(), \
  "expected log to not contain entries");
  
 -#endif
 -
 +#endif /* !defined(TOR_LOG_TEST_HELPERS_H) */
- 
diff --cc src/test/test_router.c
index 4e96e2453,51055a336..84473822a
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@@ -8,105 -7,136 +8,227 @@@
   **/
  
  #include "or.h"
 +#include "config.h"
 +#include "crypto_curve25519.h"
 +#include "crypto_ed25519.h"
+ #include "hibernate.h"
 -#include "log_test_helpers.h"
+ #include "main.h"
+ #include "rephist.h"
  #include "router.h"
 +#include "routerlist.h"
 +
 +/* Test suite stuff */
  #include "test.h"
++#include "log_test_helpers.h"
 +
 +NS_DECL(const routerinfo_t *, router_get_my_routerinfo, (void));
 +
 +static routerinfo_t* mock_routerinfo;
 +
 +static const routerinfo_t*
 +NS(router_get_my_routerinfo)(void)
 +{
 +  crypto_pk_t* ident_key;
 +  crypto_pk_t* tap_key;
 +  time_t now;
 +
 +  if (!mock_routerinfo) {
 +/* Mock the published timestamp, otherwise router_dump_router_to_string()
 + * will poop its pants. */
 +time();
 +
 +/* We'll need keys, or router_dump_router_to_string() would return NULL. 
*/
 +ident_key = pk_generate(0);
 +tap_key = pk_generate(0);
 +
 +tor_assert(ident_key != NULL);
 +tor_assert(tap_key != NULL);
 +
 +mock_routerinfo = tor_malloc_zero(sizeof(routerinfo_t));
 +mock_routerinfo->nickname = tor_strdup("ConlonNancarrow");
 +mock_routerinfo->addr = 123456789;
 +mock_routerinfo->or_port = 443;
 +mock_routerinfo->platform = tor_strdup("unittest");
 +mock_routerinfo->cache_info.published_on = now;
 +mock_routerinfo->identity_pkey = crypto_pk_dup_key(ident_key);
 +mock_routerinfo->onion_pkey = crypto_pk_dup_key(tap_key);
 +mock_routerinfo->bandwidthrate = 9001;
 +mock_routerinfo->bandwidthburst = 9002;
 +  }
 +
 +  return mock_routerinfo;
 +}
 +
 +/* If no distribution option was set, then check_bridge_distribution_setting()
 + * should have set it to "any". */
 +static void
 +test_router_dump_router_to_string_no_bridge_distribution_method(void *arg)
 +{
 +  const char* needle = "bridge-distribution-request any";
 +  or_options_t* options = get_options_mutable();
 +  routerinfo_t* router = NULL;
 +  curve25519_keypair_t ntor_keypair;
 +  ed25519_keypair_t signing_keypair;
 +  char* desc = NULL;
 +  

[tor-commits] [tor/release-0.3.3] Add test for check_descriptor_bandwidth_changed

2018-11-15 Thread nickm
commit 1066fdd8d1e084ef38281c9817032e68e2a490ff
Author: juga0 
Date:   Sat Jun 9 10:34:41 2018 +

Add test for check_descriptor_bandwidth_changed
---
 src/test/include.am|   1 +
 src/test/test_router.c | 120 +
 2 files changed, 121 insertions(+)

diff --git a/src/test/include.am b/src/test/include.am
index 0ee3d1169..7864d7d9f 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -117,6 +117,7 @@ src_test_test_SOURCES = \
src/test/test_relaycell.c \
src/test/test_rendcache.c \
src/test/test_replay.c \
+   src/test/test_router.c \
src/test/test_routerkeys.c \
src/test/test_routerlist.c \
src/test/test_routerset.c \
diff --git a/src/test/test_router.c b/src/test/test_router.c
new file mode 100644
index 0..a4921da9b
--- /dev/null
+++ b/src/test/test_router.c
@@ -0,0 +1,120 @@
+/* Copyright (c) 2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file test_router.c
+ * \brief Unittests for code in src/or/router.c
+ **/
+
+#include "or.h"
+#include "hibernate.h"
+#include "log_test_helpers.h"
+#include "main.h"
+#include "rephist.h"
+#include "router.h"
+#include "test.h"
+
+static routerinfo_t *mock_router_get_my_routerinfo_result = NULL;
+
+static const routerinfo_t *
+mock_router_get_my_routerinfo(void)
+{
+  return mock_router_get_my_routerinfo_result;
+}
+
+static long
+mock_get_uptime_3h(void)
+{
+  return 3*60*60;
+}
+
+static long
+mock_get_uptime_1d(void)
+{
+  return 24*60*60;
+}
+
+static int
+mock_rep_hist_bandwidth_assess(void)
+{
+  return 20001;
+}
+
+static int
+mock_we_are_hibernating(void)
+{
+  return 0;
+}
+
+static void
+test_router_check_descriptor_bandwidth_changed(void *arg)
+{
+  (void)arg;
+  routerinfo_t routerinfo;
+  memset(, 0, sizeof(routerinfo));
+  mock_router_get_my_routerinfo_result = NULL;
+
+  MOCK(we_are_hibernating, mock_we_are_hibernating);
+  MOCK(router_get_my_routerinfo, mock_router_get_my_routerinfo);
+  mock_router_get_my_routerinfo_result = 
+
+  /* When uptime is less than 24h, no previous bandwidth, no last_changed
+   * Uptime: 10800, last_changed: 0, Previous bw: 0, Current bw: 0 */
+  routerinfo.bandwidthcapacity = 0;
+  MOCK(get_uptime, mock_get_uptime_3h);
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_not_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  teardown_capture_of_logs();
+
+  /* When uptime is less than 24h, previous bandwidth,
+   * last_changed more than 3h ago
+   * Uptime: 10800, last_changed: 0, Previous bw: 1, Current bw: 0 */
+  routerinfo.bandwidthcapacity = 1;
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  teardown_capture_of_logs();
+
+  /* When uptime is less than 24h, last_changed is not more than 3h ago
+   * Uptime: 10800, last_changed: x, Previous bw: 1, Current bw: 0 */
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_not_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  teardown_capture_of_logs();
+
+  /* When uptime is less than 24h and bandwidthcapacity does not change
+   * Uptime: 10800, last_changed: x, Previous bw: 1, Current bw: 20001 */
+  MOCK(rep_hist_bandwidth_assess, mock_rep_hist_bandwidth_assess);
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL) + 6*60*60 + 1);
+  expect_log_msg_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  UNMOCK(get_uptime);
+  UNMOCK(rep_hist_bandwidth_assess);
+  teardown_capture_of_logs();
+
+  /* When uptime is more than 24h */
+  MOCK(get_uptime, mock_get_uptime_1d);
+  setup_full_capture_of_logs(LOG_INFO);
+  check_descriptor_bandwidth_changed(time(NULL));
+  expect_log_msg_not_containing(
+ "Measured bandwidth has changed; rebuilding descriptor.");
+  UNMOCK(get_uptime);
+  teardown_capture_of_logs();
+
+ done:
+  UNMOCK(router_get_my_routerinfo);
+}
+
+#define ROUTER_TEST(name, flags)  \
+  { #name, test_router_ ## name, flags, NULL, NULL }
+
+struct testcase_t router_tests[] = {
+  ROUTER_TEST(check_descriptor_bandwidth_changed, TT_FORK),
+  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/maint-0.3.4] Add missing router_tests to test.h

2018-11-15 Thread nickm
commit d4e51a2eeb173fab25d3945d045499b80cb4565c
Author: juga0 
Date:   Mon Jul 2 08:48:36 2018 +

Add missing router_tests to test.h
---
 src/test/test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test.c b/src/test/test.c
index 0fef69790..4632ea497 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1240,6 +1240,7 @@ struct testgroup_t testgroups[] = {
   { "relaycell/", relaycell_tests },
   { "rend_cache/", rend_cache_tests },
   { "replaycache/", replaycache_tests },
+  { "router/", router_tests },
   { "routerkeys/", routerkeys_tests },
   { "routerlist/", routerlist_tests },
   { "routerset/" , routerset_tests },



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

2018-11-15 Thread nickm
commit cbe04d455016233f4759fe281c07dd7db6096c2a
Merge: aebe8a82c 8569166c7
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:16 2018 -0500

Merge branch 'maint-0.2.9' into maint-0.3.3

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  25 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 17 deletions(-)

diff --cc src/or/rephist.c
index 43494692c,2844c4d74..67e4d3150
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@@ -3205,4 -3292,4 +3205,3 @@@ rep_hist_free_all(void
tor_assert_nonfatal(rephist_total_alloc == 0);
tor_assert_nonfatal_once(rephist_total_num == 0);
  }
--
diff --cc src/or/rephist.h
index 507272159,6d35ac67f..3e64a3de4
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@@ -111,30 -119,5 +111,29 @@@ extern int onion_handshakes_requested[M
  extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1];
  #endif
  
 -#endif
 -
 +/**
 + * Represents the type of a cell for padding accounting
 + */
 +typedef enum padding_type_t {
 +/** A RELAY_DROP cell */
 +PADDING_TYPE_DROP,
 +/** A CELL_PADDING cell */
 +PADDING_TYPE_CELL,
 +/** Total counts of padding and non-padding together */
 +PADDING_TYPE_TOTAL,
 +/** Total cell counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_TOTAL,
 +/** CELL_PADDING counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_CELL
 +} padding_type_t;
 +
 +/** The amount of time over which the padding cell counts were counted */
 +#define REPHIST_CELL_PADDING_COUNTS_INTERVAL (24*60*60)
 +void rep_hist_padding_count_read(padding_type_t type);
 +void rep_hist_padding_count_write(padding_type_t type);
 +char *rep_hist_get_padding_count_lines(void);
 +void rep_hist_reset_padding_counts(void);
 +void rep_hist_prep_published_padding_counts(time_t now);
 +void rep_hist_padding_count_timers(uint64_t num_timers);
 +
 +#endif /* !defined(TOR_REPHIST_H) */
- 
diff --cc src/test/log_test_helpers.c
index d5a39cfee,c5368b6cb..1ad01afc8
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@@ -238,4 -258,4 +258,3 @@@ mock_dump_saved_logs(void
 escaped(m->generated_msg));
} SMARTLIST_FOREACH_END(m);
  }
--
diff --cc src/test/log_test_helpers.h
index 70c584eb3,a087b913f..f74028a8a
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@@ -101,5 -106,5 +106,4 @@@ void mock_dump_saved_logs(void)
assert_log_predicate(!mock_saved_log_has_entry(), \
  "expected log to not contain entries");
  
 -#endif
 -
 +#endif /* !defined(TOR_LOG_TEST_HELPERS_H) */
- 
diff --cc src/test/test_router.c
index 4e96e2453,51055a336..84473822a
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@@ -8,105 -7,136 +8,227 @@@
   **/
  
  #include "or.h"
 +#include "config.h"
 +#include "crypto_curve25519.h"
 +#include "crypto_ed25519.h"
+ #include "hibernate.h"
 -#include "log_test_helpers.h"
+ #include "main.h"
+ #include "rephist.h"
  #include "router.h"
 +#include "routerlist.h"
 +
 +/* Test suite stuff */
  #include "test.h"
++#include "log_test_helpers.h"
 +
 +NS_DECL(const routerinfo_t *, router_get_my_routerinfo, (void));
 +
 +static routerinfo_t* mock_routerinfo;
 +
 +static const routerinfo_t*
 +NS(router_get_my_routerinfo)(void)
 +{
 +  crypto_pk_t* ident_key;
 +  crypto_pk_t* tap_key;
 +  time_t now;
 +
 +  if (!mock_routerinfo) {
 +/* Mock the published timestamp, otherwise router_dump_router_to_string()
 + * will poop its pants. */
 +time();
 +
 +/* We'll need keys, or router_dump_router_to_string() would return NULL. 
*/
 +ident_key = pk_generate(0);
 +tap_key = pk_generate(0);
 +
 +tor_assert(ident_key != NULL);
 +tor_assert(tap_key != NULL);
 +
 +mock_routerinfo = tor_malloc_zero(sizeof(routerinfo_t));
 +mock_routerinfo->nickname = tor_strdup("ConlonNancarrow");
 +mock_routerinfo->addr = 123456789;
 +mock_routerinfo->or_port = 443;
 +mock_routerinfo->platform = tor_strdup("unittest");
 +mock_routerinfo->cache_info.published_on = now;
 +mock_routerinfo->identity_pkey = crypto_pk_dup_key(ident_key);
 +mock_routerinfo->onion_pkey = crypto_pk_dup_key(tap_key);
 +mock_routerinfo->bandwidthrate = 9001;
 +mock_routerinfo->bandwidthburst = 9002;
 +  }
 +
 +  return mock_routerinfo;
 +}
 +
 +/* If no distribution option was set, then check_bridge_distribution_setting()
 + * should have set it to "any". */
 +static void
 +test_router_dump_router_to_string_no_bridge_distribution_method(void *arg)
 +{
 +  const char* needle = "bridge-distribution-request any";
 +  or_options_t* options = get_options_mutable();
 +  routerinfo_t* router = NULL;
 +  curve25519_keypair_t ntor_keypair;
 +  ed25519_keypair_t signing_keypair;
 +  char* desc = NULL;
 +  

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

2018-11-15 Thread nickm
commit cbe04d455016233f4759fe281c07dd7db6096c2a
Merge: aebe8a82c 8569166c7
Author: Nick Mathewson 
Date:   Thu Nov 15 16:54:16 2018 -0500

Merge branch 'maint-0.2.9' into maint-0.3.3

 changes/bug24104|   4 ++
 src/or/rephist.c|   7 ++-
 src/or/rephist.h|   5 +-
 src/or/router.c |  25 +++--
 src/test/log_test_helpers.c |  23 +++-
 src/test/log_test_helpers.h |   8 ++-
 src/test/test_router.c  | 124 +++-
 7 files changed, 179 insertions(+), 17 deletions(-)

diff --cc src/or/rephist.c
index 43494692c,2844c4d74..67e4d3150
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@@ -3205,4 -3292,4 +3205,3 @@@ rep_hist_free_all(void
tor_assert_nonfatal(rephist_total_alloc == 0);
tor_assert_nonfatal_once(rephist_total_num == 0);
  }
--
diff --cc src/or/rephist.h
index 507272159,6d35ac67f..3e64a3de4
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@@ -111,30 -119,5 +111,29 @@@ extern int onion_handshakes_requested[M
  extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1];
  #endif
  
 -#endif
 -
 +/**
 + * Represents the type of a cell for padding accounting
 + */
 +typedef enum padding_type_t {
 +/** A RELAY_DROP cell */
 +PADDING_TYPE_DROP,
 +/** A CELL_PADDING cell */
 +PADDING_TYPE_CELL,
 +/** Total counts of padding and non-padding together */
 +PADDING_TYPE_TOTAL,
 +/** Total cell counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_TOTAL,
 +/** CELL_PADDING counts for all padding-enabled channels */
 +PADDING_TYPE_ENABLED_CELL
 +} padding_type_t;
 +
 +/** The amount of time over which the padding cell counts were counted */
 +#define REPHIST_CELL_PADDING_COUNTS_INTERVAL (24*60*60)
 +void rep_hist_padding_count_read(padding_type_t type);
 +void rep_hist_padding_count_write(padding_type_t type);
 +char *rep_hist_get_padding_count_lines(void);
 +void rep_hist_reset_padding_counts(void);
 +void rep_hist_prep_published_padding_counts(time_t now);
 +void rep_hist_padding_count_timers(uint64_t num_timers);
 +
 +#endif /* !defined(TOR_REPHIST_H) */
- 
diff --cc src/test/log_test_helpers.c
index d5a39cfee,c5368b6cb..1ad01afc8
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@@ -238,4 -258,4 +258,3 @@@ mock_dump_saved_logs(void
 escaped(m->generated_msg));
} SMARTLIST_FOREACH_END(m);
  }
--
diff --cc src/test/log_test_helpers.h
index 70c584eb3,a087b913f..f74028a8a
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@@ -101,5 -106,5 +106,4 @@@ void mock_dump_saved_logs(void)
assert_log_predicate(!mock_saved_log_has_entry(), \
  "expected log to not contain entries");
  
 -#endif
 -
 +#endif /* !defined(TOR_LOG_TEST_HELPERS_H) */
- 
diff --cc src/test/test_router.c
index 4e96e2453,51055a336..84473822a
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@@ -8,105 -7,136 +8,227 @@@
   **/
  
  #include "or.h"
 +#include "config.h"
 +#include "crypto_curve25519.h"
 +#include "crypto_ed25519.h"
+ #include "hibernate.h"
 -#include "log_test_helpers.h"
+ #include "main.h"
+ #include "rephist.h"
  #include "router.h"
 +#include "routerlist.h"
 +
 +/* Test suite stuff */
  #include "test.h"
++#include "log_test_helpers.h"
 +
 +NS_DECL(const routerinfo_t *, router_get_my_routerinfo, (void));
 +
 +static routerinfo_t* mock_routerinfo;
 +
 +static const routerinfo_t*
 +NS(router_get_my_routerinfo)(void)
 +{
 +  crypto_pk_t* ident_key;
 +  crypto_pk_t* tap_key;
 +  time_t now;
 +
 +  if (!mock_routerinfo) {
 +/* Mock the published timestamp, otherwise router_dump_router_to_string()
 + * will poop its pants. */
 +time();
 +
 +/* We'll need keys, or router_dump_router_to_string() would return NULL. 
*/
 +ident_key = pk_generate(0);
 +tap_key = pk_generate(0);
 +
 +tor_assert(ident_key != NULL);
 +tor_assert(tap_key != NULL);
 +
 +mock_routerinfo = tor_malloc_zero(sizeof(routerinfo_t));
 +mock_routerinfo->nickname = tor_strdup("ConlonNancarrow");
 +mock_routerinfo->addr = 123456789;
 +mock_routerinfo->or_port = 443;
 +mock_routerinfo->platform = tor_strdup("unittest");
 +mock_routerinfo->cache_info.published_on = now;
 +mock_routerinfo->identity_pkey = crypto_pk_dup_key(ident_key);
 +mock_routerinfo->onion_pkey = crypto_pk_dup_key(tap_key);
 +mock_routerinfo->bandwidthrate = 9001;
 +mock_routerinfo->bandwidthburst = 9002;
 +  }
 +
 +  return mock_routerinfo;
 +}
 +
 +/* If no distribution option was set, then check_bridge_distribution_setting()
 + * should have set it to "any". */
 +static void
 +test_router_dump_router_to_string_no_bridge_distribution_method(void *arg)
 +{
 +  const char* needle = "bridge-distribution-request any";
 +  or_options_t* options = get_options_mutable();
 +  routerinfo_t* router = NULL;
 +  curve25519_keypair_t ntor_keypair;
 +  ed25519_keypair_t signing_keypair;
 +  char* desc = NULL;
 +  

  1   2   3   4   >