tor-commits
Threads by month
- ----- 2025 -----
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
October 2018
- 17 participants
- 2350 discussions

[translation/donatepages-messagespot] Update translations for donatepages-messagespot
by translation@torproject.org 12 Oct '18
by translation@torproject.org 12 Oct '18
12 Oct '18
commit fc497d5f28418a9983ccf121e23f302a9bb7158c
Author: Translation commit bot <translation(a)torproject.org>
Date: Fri Oct 12 19:15:19 2018 +0000
Update translations for donatepages-messagespot
---
locale/pt_BR/LC_MESSAGES/messages.po | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/locale/pt_BR/LC_MESSAGES/messages.po b/locale/pt_BR/LC_MESSAGES/messages.po
index 6e5433fd0..31125d4f6 100644
--- a/locale/pt_BR/LC_MESSAGES/messages.po
+++ b/locale/pt_BR/LC_MESSAGES/messages.po
@@ -738,8 +738,8 @@ msgid ""
msgstr ""
"A missão do Projeto Tor é ampliar os direitos e as liberdades humanas a "
"partir da criação e implementação de tecnologias livres e abertas de "
-"anonimato e privacidade, apoiando seu uso e disponibilidade irrestrito, e "
-"promovendo sua compreensão científica e popular. "
+"anonimato e privacidade, apoiando o seu uso e disponibilidade irrestrita, "
+"promovendo a sua compreensão científica e popular. "
#: tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:71
msgid ""
@@ -749,8 +749,7 @@ msgid ""
msgstr ""
"O principal produto do Projeto Tor é o <a "
"href=\"https://www.torproject.org/download/download-easy.html.en\">Navegador"
-" Tor</a>, que permite que as pessoas naveguem pela internet de forma "
-"anônima. "
+" Tor</a>, que permite que as pessoas naveguem pela internet anonimamente. "
#: tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:73
msgid ""
@@ -766,7 +765,7 @@ msgstr "Foi fundado em 2006."
#: tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:81
msgid "Who works for the Tor Project, and what do they do?"
-msgstr "Quem trabalha para o Projeto Tor e o que fazem?"
+msgstr "Quem trabalha para o Projeto Tor e o que eles fazem?"
#: tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:85
msgid ""
@@ -808,8 +807,8 @@ msgid ""
"The vast majority of Tor users are ordinary people who want control of their"
" privacy online or people whose internet use is censored."
msgstr ""
-"A grande maioria de usuários do Tor são pessoas comuns que querem ter "
-"controle sob sua privacidade online ou pessoas que tem o acesso a internet "
+"A grande maioria de usuários do Tor são pessoas comuns que querem ter o "
+"controle de sua privacidade online ou pessoas que tem o acesso a internet "
"censurada. "
#: tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:100
@@ -818,8 +817,8 @@ msgid ""
"survivors, policymakers, diplomats, and academic and research institutions."
msgstr ""
"Outros usuários do Tor são jornalistas, defensores de direitos humanos, "
-"sobreviventes de violência doméstica, formuladores de políticas, diplomatas,"
-" e instituições acadêmicas e de pesquisa. "
+"sobreviventes de violência doméstica, desenvolvedores de leis, diplomatas, e"
+" instituições acadêmicas de pesquisa. "
#: tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:106
msgid "Can anyone use Tor?"
1
0

[translation/donatepages-messagespot] Update translations for donatepages-messagespot
by translation@torproject.org 12 Oct '18
by translation@torproject.org 12 Oct '18
12 Oct '18
commit 401e7142ac03dde2c4cab8144d8f0e4b7f7f83c4
Author: Translation commit bot <translation(a)torproject.org>
Date: Fri Oct 12 18:45:19 2018 +0000
Update translations for donatepages-messagespot
---
locale/pt_BR/LC_MESSAGES/messages.po | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/locale/pt_BR/LC_MESSAGES/messages.po b/locale/pt_BR/LC_MESSAGES/messages.po
index 24a9a238f..6e5433fd0 100644
--- a/locale/pt_BR/LC_MESSAGES/messages.po
+++ b/locale/pt_BR/LC_MESSAGES/messages.po
@@ -662,7 +662,7 @@ msgid ""
"We need people to run relays, write code, organize the community and spread "
"the word about our good work. Learn how you can help."
msgstr ""
-"Precisamos de pessoas que rodem relays, escrevam código, organizem a "
+"Nós precisamos de pessoas que rodem relays, escrevam código, organizem a "
"comunidade e espalhem a mensagem sobre o nosso trabalho. Veja de que maneira"
" você pode ajudar. "
@@ -672,11 +672,11 @@ msgstr "Eu quero ser um voluntário"
#: tmp/cache_locale/92/9248b30ecfc0bb3509fc7e1db98f98ec86e72399ad551da3d5abe54c7cd987af.php:34
msgid "Processing Donation - Tor"
-msgstr "Processando Doação - Tor"
+msgstr "Processando a sua Doação - Tor"
#: tmp/cache_locale/92/9248b30ecfc0bb3509fc7e1db98f98ec86e72399ad551da3d5abe54c7cd987af.php:44
msgid "Processing Donation. Please Wait..."
-msgstr "Processando Doação - Por Favor Aguarde..."
+msgstr "Processando a sua Doação - Por Favor Aguarde..."
#: tmp/cache_locale/2d/2d5f07aeb16acd7bb0a8dd355b13f59678a1f0ba6ea2b3d9dec8d2b5dcfbfde5.php:24
msgid ""
@@ -687,13 +687,12 @@ msgid ""
msgstr ""
"O Projeto Tor é uma organização sem fins lucrativos dos EUA 501 (c) (3) que "
"promove direitos humanos e liberdades, criando e implantando tecnologias de "
-"privacidade e anonimato, de fonte aberta e livre, apoiando sua "
-"disponibilidade e uso irrestritos e promovendo seu entendimento científico e"
-" popular"
+"código aberto de privacidade e anonimato, apoiando sua disponibilidade e uso"
+" irrestritos e promovendo o seu entendimento científico e popular."
#: tmp/cache_locale/2d/2d5f07aeb16acd7bb0a8dd355b13f59678a1f0ba6ea2b3d9dec8d2b5dcfbfde5.php:31
msgid "privacy policy"
-msgstr "política de privacidade"
+msgstr "regras de privacidade"
#: tmp/cache_locale/2d/2d5f07aeb16acd7bb0a8dd355b13f59678a1f0ba6ea2b3d9dec8d2b5dcfbfde5.php:36
msgid "donor faq"
@@ -707,7 +706,7 @@ msgid ""
msgstr ""
"Projetado e construído por <span class=\"stamp-bold\"><a "
"href=\"https://www.giantrabbit.com/\" class=\"stamp-bold\" "
-"target=\"_blank\">Coelho Gigante</a></span>"
+"target=\"_blank\">Um Coelho Gigante</a></span>"
#: tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:34
msgid "Tor Donor FAQ"
@@ -720,11 +719,11 @@ msgid ""
"inquiries, or <span class=\"email\">giving(at)torproject.org</span> with "
"donor-specific questions."
msgstr ""
-"Se a resposta a sua pergunta não consta na lista abaixo, mande um email "
+"Se a resposta a sua pergunta não consta na lista abaixo, mande um e-mail "
"para<span class=\"email\">frontdesk(at)rt.torproject.org</span>com perguntas"
" gerais sobre o Tor, ou para <span "
"class=\"email\">giving(at)torproject.org</span>com perguntas específicas "
-"sobre doação. "
+"sobre doações. "
#: tmp/cache_locale/0e/0e65c68f2900f432bc062864e7bafc989d6286e272f5e98882a99f52ea4c5c89.php:65
msgid "What is the Tor Project and what does it do?"
1
0

[translation/donatepages-messagespot] Update translations for donatepages-messagespot
by translation@torproject.org 12 Oct '18
by translation@torproject.org 12 Oct '18
12 Oct '18
commit fbf1cdc54c9b65e442a58d901216a59889f514dc
Author: Translation commit bot <translation(a)torproject.org>
Date: Fri Oct 12 18:15:19 2018 +0000
Update translations for donatepages-messagespot
---
locale/pt_BR/LC_MESSAGES/messages.po | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/locale/pt_BR/LC_MESSAGES/messages.po b/locale/pt_BR/LC_MESSAGES/messages.po
index 7e8dc1024..24a9a238f 100644
--- a/locale/pt_BR/LC_MESSAGES/messages.po
+++ b/locale/pt_BR/LC_MESSAGES/messages.po
@@ -651,7 +651,7 @@ msgstr "COMPARTILHE O PROJETO TOR"
#: tmp/cache_locale/af/afda2fbd22ed389453e63ca9acc074a25ce820b5bc97120edfd975cf8f46634a.php:79
msgid "Got Skills?"
-msgstr "Tem habilidades?"
+msgstr "Tem Habilidades?"
#: tmp/cache_locale/af/afda2fbd22ed389453e63ca9acc074a25ce820b5bc97120edfd975cf8f46634a.php:85
msgid "The Tor network depends on volunteers."
@@ -663,8 +663,8 @@ msgid ""
"the word about our good work. Learn how you can help."
msgstr ""
"Precisamos de pessoas que rodem relays, escrevam código, organizem a "
-"comunidade e espalhem a mensagem sobre nosso trabalho. Veja de que maneira "
-"você pode ajudar. "
+"comunidade e espalhem a mensagem sobre o nosso trabalho. Veja de que maneira"
+" você pode ajudar. "
#: tmp/cache_locale/af/afda2fbd22ed389453e63ca9acc074a25ce820b5bc97120edfd975cf8f46634a.php:99
msgid "I Want To Volunteer"
1
0

[translation/tails-iuk_completed] Update translations for tails-iuk_completed
by translation@torproject.org 12 Oct '18
by translation@torproject.org 12 Oct '18
12 Oct '18
commit 453815423cdcb10dcbcfdaa34f78637e51cfca02
Author: Translation commit bot <translation(a)torproject.org>
Date: Fri Oct 12 16:46:11 2018 +0000
Update translations for tails-iuk_completed
---
ka.po | 248 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 248 insertions(+)
diff --git a/ka.po b/ka.po
new file mode 100644
index 000000000..5dfdfade8
--- /dev/null
+++ b/ka.po
@@ -0,0 +1,248 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Tails developers
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+# A. C. <georgianization(a)outlook.com>, 2018
+msgid ""
+msgstr ""
+"Project-Id-Version: Tor Project\n"
+"Report-Msgid-Bugs-To: Tails developers <tails(a)boum.org>\n"
+"POT-Creation-Date: 2018-08-16 11:16+0200\n"
+"PO-Revision-Date: 2018-10-12 16:40+0000\n"
+"Last-Translator: A. C. <georgianization(a)outlook.com>\n"
+"Language-Team: Georgian (http://www.transifex.com/otf/torproject/language/ka/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: ka\n"
+"Plural-Forms: nplurals=2; plural=(n!=1);\n"
+
+#: ../lib/Tails/IUK/Frontend.pm:147 ../lib/Tails/IUK/Frontend.pm:523
+#: ../lib/Tails/IUK/Frontend.pm:696
+msgid ""
+"For debugging information, execute the following command: sudo tails-"
+"debugging-info"
+msgstr "გამართვისთვის საჭირო ინფორმაციისთვის, გაუშვით შემდეგი ბრძანება: sudo tails-debugging-info"
+
+#: ../lib/Tails/IUK/Frontend.pm:216
+msgid "Error while checking for upgrades"
+msgstr "შეცდომა განახლებების ძიებისას"
+
+#: ../lib/Tails/IUK/Frontend.pm:219
+msgid ""
+"<b>Could not determine whether an upgrade is available from our website.</b>\n"
+"\n"
+"Check your network connection, and restart Tails to try upgrading again.\n"
+"\n"
+"If the problem persists, go to file:///usr/share/doc/tails/website/doc/upgrade/error/check.en.html"
+msgstr "<b>ვერ ხერხდება დადგენა, არის თუ არა განახლება ხელმისაწვდომი ჩვენს საიტზე.</b>\n\nშეამოწმეთ თქვენი ქსელის კავშირი და ხელახლა გაუშვით Tails, განახლების გასამეორებლად.\n\nთუ ხარვეზი არ გამოსწორდება, იხილეთ file:///usr/share/doc/tails/website/doc/upgrade/error/check.en.html"
+
+#: ../lib/Tails/IUK/Frontend.pm:234
+msgid "no automatic upgrade is available from our website for this version"
+msgstr "ამ ვერსიისთვის ჩვენი საიტიდან თვითგანახლება არაა ხელმისაწვდომი"
+
+#: ../lib/Tails/IUK/Frontend.pm:240
+msgid "your device was not created using Tails Installer"
+msgstr "თქვენი მოწყობილობა არაა შექმნილი Tails-ის დასაყენებელი პროგრამით"
+
+#: ../lib/Tails/IUK/Frontend.pm:245
+msgid "Tails was started from a DVD or a read-only device"
+msgstr "Tails გაშვებულია DVD-იდან ან სხვა მხოლოდ წაკითხვის შესაძლებლობის მქონე მოწყობილობიდან"
+
+#: ../lib/Tails/IUK/Frontend.pm:250
+msgid "there is not enough free space on the Tails system partition"
+msgstr "არაა საკმარისი თავისუფალი ადგილი Tails-ის სისტემურ დანაყოფზე"
+
+#: ../lib/Tails/IUK/Frontend.pm:255
+msgid "not enough memory is available on this system"
+msgstr "არაა ხელმისაწვდომი საკმარისი მეხსიერება სისტემაში"
+
+#: ../lib/Tails/IUK/Frontend.pm:261
+#, perl-brace-format
+msgid "No explanation available for reason '%{reason}s'."
+msgstr "ახსნა-განმარტება არაა ხელმისაწვდომი მიზეზისთვის '%{reason}s'."
+
+#: ../lib/Tails/IUK/Frontend.pm:281
+msgid "The system is up-to-date"
+msgstr "სისტემა განახლებულია"
+
+#: ../lib/Tails/IUK/Frontend.pm:286
+msgid "This version of Tails is outdated, and may have security issues."
+msgstr "Tails-ის ეს ვერსია მოძველებულია და შესაძლოა ხარვეზები გააჩნდეს უსაფრთხოებაში."
+
+#: ../lib/Tails/IUK/Frontend.pm:318
+#, perl-brace-format
+msgid ""
+"The available incremental upgrade requires %{space_needed}s of free space on"
+" Tails system partition, but only %{free_space}s is available."
+msgstr "ხელმისაწვდომი დამატებითი განახლება საჭიროებს %{space_needed}s თავისუფალ ადგილს Tails-ის სისტემურ დანაყოფზე, მაგრამ მხოლოდ %{free_space}s არის ხელმისაწვდომი."
+
+#: ../lib/Tails/IUK/Frontend.pm:334
+#, perl-brace-format
+msgid ""
+"The available incremental upgrade requires %{memory_needed}s of free memory,"
+" but only %{free_memory}s is available."
+msgstr "ხელმისაწვდომი დამატებითი განახლება საჭიროებს %{memory_needed}s თავისუფალ მეხსიერებას, მაგრამ მხოლოდ %{free_memory}s არის ხელმისაწვდომი."
+
+#: ../lib/Tails/IUK/Frontend.pm:356
+msgid ""
+"An incremental upgrade is available, but no full upgrade is.\n"
+"This should not happen. Please report a bug."
+msgstr "ხელმისაწვდომია დამატებითი განახლება, თუმცა არა სრული არ მოიძებნა.\nწესით, ასე არ უნდა მომხდარიყო. გთხოვთ, მოგვახსენოთ ხარვეზის შესახებ."
+
+#: ../lib/Tails/IUK/Frontend.pm:360
+msgid "Error while detecting available upgrades"
+msgstr "შეცდომა, ხელმისაწვდომი განახლებების აღმოჩენისას"
+
+#: ../lib/Tails/IUK/Frontend.pm:370
+#, perl-brace-format
+msgid ""
+"<b>You should upgrade to %{name}s %{version}s.</b>\n"
+"\n"
+"For more information about this new version, go to %{details_url}s\n"
+"\n"
+"It is recommended to close all the open applications during the upgrade.\n"
+"Downloading the upgrade might take a long time, from several minutes to a few hours.\n"
+"The networking will be disabled after downloading the upgrade.\n"
+"\n"
+"Download size: %{size}s\n"
+"\n"
+"Do you want to upgrade now?"
+msgstr "<b>თქვენი უნდა განაახლოთ ვერსიაზე %{name}s %{version}s.</b>\n\nდამატებითი ინფორმაციისთვის ახალი ვერსიის შესახებ, იხილეთ %{details_url}s\n\nსასურველია დახუროთ ყველა გახსნილი პროგრამა განახლების მიმდინარეობისას.\nგანახლების ჩამოტვირთვამ, შესაძლოა დიდ ხანს გასტანოს, რამდენიმე წუთიდან, საათებამდეც კი.\nქსელთან კავშირი გაითიშება, განახლების ჩამოტვირთვის შემდგომ.\n\nჩამოტვირთვის მოცულობა: %{size}s\n\nგსურთ ა
ხლავე განახლება?"
+
+#: ../lib/Tails/IUK/Frontend.pm:385
+msgid "Upgrade available"
+msgstr "ხელმისაწვდომია განახლება"
+
+#: ../lib/Tails/IUK/Frontend.pm:386
+msgid "Upgrade now"
+msgstr "ახლავე განახლება"
+
+#: ../lib/Tails/IUK/Frontend.pm:387
+msgid "Upgrade later"
+msgstr "განახლება მოგვიანებით"
+
+#: ../lib/Tails/IUK/Frontend.pm:395
+#, perl-brace-format
+msgid ""
+"<b>You should do a manual upgrade to %{name}s %{version}s.</b>\n"
+"\n"
+"For more information about this new version, go to %{details_url}s\n"
+"\n"
+"It is not possible to automatically upgrade your device to this new version: %{explanation}s.\n"
+"\n"
+"To learn how to do a manual upgrade, go to https://tails.boum.org/doc/first_steps/upgrade/#manual"
+msgstr "<b>თქვენ ხელით უნდა განაახლოთ ვერსიაზე %{name}s %{version}s.</b>\n\nდამატებითი ინფორმაციისთვის ამ ვერსიის შესახებ, იხილეთ %{details_url}s\n\nშეუძლებელია თქვენი მოწყობილობის ავტომატური განახლება ამ ახალ ვერსიაზე: %{explanation}s.\n\nვრცლად, ხელით განახლების შესახებ, იხილეთ https://tails.boum.org/doc/first_steps/upgrade/#manual"
+
+#: ../lib/Tails/IUK/Frontend.pm:411
+msgid "New version available"
+msgstr "ხელმისაწვდომია ახალი ვერსია"
+
+#: ../lib/Tails/IUK/Frontend.pm:468
+msgid "Downloading upgrade"
+msgstr "განახლების ჩამოტვირთვა"
+
+#: ../lib/Tails/IUK/Frontend.pm:471
+#, perl-brace-format
+msgid "Downloading the upgrade to %{name}s %{version}s..."
+msgstr "მიმდინარეობს ჩამოტვირთვა განახლების %{name}s %{version}s..."
+
+#: ../lib/Tails/IUK/Frontend.pm:512
+msgid ""
+"<b>The upgrade could not be downloaded.</b>\\n\\nCheck your network "
+"connection, and restart Tails to try upgrading again.\\n\\nIf the problem "
+"persists, go to "
+"file:///usr/share/doc/tails/website/doc/upgrade/error/download.en.html"
+msgstr "<b>განახლება ვერ ჩამოიტვირთა.</b>\\n\\nშეამოწმეთ თქვენი ქსელის კავშირი და ხელახლა გაუშვით Tails განახლების გასამეორებლად.\\n\\nთუ ხარვეზი არ გამოსწორდება, იხილეთ file:///usr/share/doc/tails/website/doc/upgrade/error/download.en.html"
+
+#: ../lib/Tails/IUK/Frontend.pm:528 ../lib/Tails/IUK/Frontend.pm:547
+msgid "Error while downloading the upgrade"
+msgstr "შეცდომა, განახლების ჩამოტვირთვისას"
+
+#: ../lib/Tails/IUK/Frontend.pm:540
+#, perl-brace-format
+msgid ""
+"Output file '%{output_file}s' does not exist, but tails-iuk-get-target-file "
+"did not complain. Please report a bug."
+msgstr "გამოსატანი ფაილი '%{output_file}s' არ არსებობს, მაგრამ tails-iuk-get-target-file არ იტყობინება ამის შესახებ. გთხოვთ, მოგვახსენოთ ამ ხარვეზის შესახებ."
+
+#: ../lib/Tails/IUK/Frontend.pm:559
+msgid "Error while creating temporary downloading directory"
+msgstr "შეცდომა, ჩამოტვირთვის დროებითი საქაღალდის შექმნისას"
+
+#: ../lib/Tails/IUK/Frontend.pm:562
+msgid "Failed to create temporary download directory"
+msgstr "ჩამოტვირთვის დროებითი საქაღალდის შექმნა ვერ მოხერხდა"
+
+#: ../lib/Tails/IUK/Frontend.pm:586
+msgid ""
+"<b>Could not choose a download server.</b>\n"
+"\n"
+"This should not happen. Please report a bug."
+msgstr "<b>ვერ ხერხდება ჩამოტვირთვის სერვერის არჩევა.</b>\n\nწესით, ეს ასე არ უნდა მომხდარიყო. გთხოვთ, მოგვახსენოთ ხარვეზის შესახებ."
+
+#: ../lib/Tails/IUK/Frontend.pm:590
+msgid "Error while choosing a download server"
+msgstr "შეცდომა, ჩამოტვირთვის სერვერის არჩევისას"
+
+#: ../lib/Tails/IUK/Frontend.pm:607
+msgid ""
+"<b>Your Tails device was successfully upgraded.</b>\n"
+"\n"
+"Some security features were temporarily disabled.\n"
+"You should restart Tails on the new version as soon as possible.\n"
+"\n"
+"Do you want to restart now?"
+msgstr "<b>თქვენი Tails-მოწყობილობა წარმატებით განახლდა.</b>\n\nუსაფრთხოების საშუალებების ნაწილი, დროებით გამორთულია.\nხელახლა უნდა გაუშვათ Tails, როგორც კი ახალი ვერსია იქნება ხელმისაწვდომი.\n\nგსურთ, ხელახლა გაშვება ახლავე?"
+
+#: ../lib/Tails/IUK/Frontend.pm:612
+msgid "Restart Tails"
+msgstr "ხელახლა გაეშვას Tails"
+
+#: ../lib/Tails/IUK/Frontend.pm:613
+msgid "Restart now"
+msgstr "ხელახლა გაშვება ახლავე"
+
+#: ../lib/Tails/IUK/Frontend.pm:614
+msgid "Restart later"
+msgstr "ხელახლა გაშვება მოგვიანებით"
+
+#: ../lib/Tails/IUK/Frontend.pm:625
+msgid "Error while restarting the system"
+msgstr "შეცდომა, სისტემის ხელახლა გაშვებისას"
+
+#: ../lib/Tails/IUK/Frontend.pm:628
+msgid "Failed to restart the system"
+msgstr "სისტემის ხელახლა გაშვება ვერ მოხერხდა"
+
+#: ../lib/Tails/IUK/Frontend.pm:643
+msgid "Error while shutting down the network"
+msgstr "შეცდომა ქსელის კავშირის დახურვისას"
+
+#: ../lib/Tails/IUK/Frontend.pm:646
+msgid "Failed to shutdown network"
+msgstr "ქსელის კავშირის დახურვა ვერ მოხერხდა"
+
+#: ../lib/Tails/IUK/Frontend.pm:656
+msgid "Upgrading the system"
+msgstr "სისტემა ახლდება"
+
+#: ../lib/Tails/IUK/Frontend.pm:658
+msgid ""
+"<b>Your Tails device is being upgraded...</b>\n"
+"\n"
+"For security reasons, the networking is now disabled."
+msgstr "<b>თქვენი Tails-მოწყობილობა ახლდება...</b>\n\nუსაფრთხოების მიზნით, ქსელი ახლა გამორთულია."
+
+#: ../lib/Tails/IUK/Frontend.pm:691
+msgid ""
+"<b>An error occured while installing the upgrade.</b>\\n\\nYour Tails device"
+" needs to be repaired and might be unable to restart.\\n\\nPlease follow the"
+" instructions at "
+"file:///usr/share/doc/tails/website/doc/upgrade/error/install.en.html"
+msgstr "<b>შეცდომა მოხდა განახლების დაყენებისას.</b>\\n\\nთქვენი Tails-მოწყობილობა საჭიროებს შეკეთებას და ხელახლა გაშვები შეიძლება ვერ მოხერხდეს.\\n\\nგთხოვთ მიჰყევით მითითებებს file:///usr/share/doc/tails/website/doc/upgrade/error/install.en.html"
+
+#: ../lib/Tails/IUK/Frontend.pm:701
+msgid "Error while installing the upgrade"
+msgstr "შეცდომა განახლების დაყენებისას"
1
0

12 Oct '18
commit 2ebc7d901f99bc092944625f8de9176f0f8e679e
Author: Translation commit bot <translation(a)torproject.org>
Date: Fri Oct 12 16:46:06 2018 +0000
Update translations for tails-iuk
---
ka.po | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/ka.po b/ka.po
index 7393c55af..5dfdfade8 100644
--- a/ka.po
+++ b/ka.po
@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Tor Project\n"
"Report-Msgid-Bugs-To: Tails developers <tails(a)boum.org>\n"
"POT-Creation-Date: 2018-08-16 11:16+0200\n"
-"PO-Revision-Date: 2018-10-12 16:15+0000\n"
+"PO-Revision-Date: 2018-10-12 16:40+0000\n"
"Last-Translator: A. C. <georgianization(a)outlook.com>\n"
"Language-Team: Georgian (http://www.transifex.com/otf/torproject/language/ka/)\n"
"MIME-Version: 1.0\n"
@@ -23,7 +23,7 @@ msgstr ""
msgid ""
"For debugging information, execute the following command: sudo tails-"
"debugging-info"
-msgstr ""
+msgstr "გამართვისთვის საჭირო ინფორმაციისთვის, გაუშვით შემდეგი ბრძანება: sudo tails-debugging-info"
#: ../lib/Tails/IUK/Frontend.pm:216
msgid "Error while checking for upgrades"
@@ -36,7 +36,7 @@ msgid ""
"Check your network connection, and restart Tails to try upgrading again.\n"
"\n"
"If the problem persists, go to file:///usr/share/doc/tails/website/doc/upgrade/error/check.en.html"
-msgstr ""
+msgstr "<b>ვერ ხერხდება დადგენა, არის თუ არა განახლება ხელმისაწვდომი ჩვენს საიტზე.</b>\n\nშეამოწმეთ თქვენი ქსელის კავშირი და ხელახლა გაუშვით Tails, განახლების გასამეორებლად.\n\nთუ ხარვეზი არ გამოსწორდება, იხილეთ file:///usr/share/doc/tails/website/doc/upgrade/error/check.en.html"
#: ../lib/Tails/IUK/Frontend.pm:234
msgid "no automatic upgrade is available from our website for this version"
@@ -44,11 +44,11 @@ msgstr "ამ ვერსიისთვის ჩვენი საიტი
#: ../lib/Tails/IUK/Frontend.pm:240
msgid "your device was not created using Tails Installer"
-msgstr ""
+msgstr "თქვენი მოწყობილობა არაა შექმნილი Tails-ის დასაყენებელი პროგრამით"
#: ../lib/Tails/IUK/Frontend.pm:245
msgid "Tails was started from a DVD or a read-only device"
-msgstr ""
+msgstr "Tails გაშვებულია DVD-იდან ან სხვა მხოლოდ წაკითხვის შესაძლებლობის მქონე მოწყობილობიდან"
#: ../lib/Tails/IUK/Frontend.pm:250
msgid "there is not enough free space on the Tails system partition"
@@ -56,12 +56,12 @@ msgstr "არაა საკმარისი თავისუფალი
#: ../lib/Tails/IUK/Frontend.pm:255
msgid "not enough memory is available on this system"
-msgstr ""
+msgstr "არაა ხელმისაწვდომი საკმარისი მეხსიერება სისტემაში"
#: ../lib/Tails/IUK/Frontend.pm:261
#, perl-brace-format
msgid "No explanation available for reason '%{reason}s'."
-msgstr ""
+msgstr "ახსნა-განმარტება არაა ხელმისაწვდომი მიზეზისთვის '%{reason}s'."
#: ../lib/Tails/IUK/Frontend.pm:281
msgid "The system is up-to-date"
@@ -69,27 +69,27 @@ msgstr "სისტემა განახლებულია"
#: ../lib/Tails/IUK/Frontend.pm:286
msgid "This version of Tails is outdated, and may have security issues."
-msgstr ""
+msgstr "Tails-ის ეს ვერსია მოძველებულია და შესაძლოა ხარვეზები გააჩნდეს უსაფრთხოებაში."
#: ../lib/Tails/IUK/Frontend.pm:318
#, perl-brace-format
msgid ""
"The available incremental upgrade requires %{space_needed}s of free space on"
" Tails system partition, but only %{free_space}s is available."
-msgstr ""
+msgstr "ხელმისაწვდომი დამატებითი განახლება საჭიროებს %{space_needed}s თავისუფალ ადგილს Tails-ის სისტემურ დანაყოფზე, მაგრამ მხოლოდ %{free_space}s არის ხელმისაწვდომი."
#: ../lib/Tails/IUK/Frontend.pm:334
#, perl-brace-format
msgid ""
"The available incremental upgrade requires %{memory_needed}s of free memory,"
" but only %{free_memory}s is available."
-msgstr ""
+msgstr "ხელმისაწვდომი დამატებითი განახლება საჭიროებს %{memory_needed}s თავისუფალ მეხსიერებას, მაგრამ მხოლოდ %{free_memory}s არის ხელმისაწვდომი."
#: ../lib/Tails/IUK/Frontend.pm:356
msgid ""
"An incremental upgrade is available, but no full upgrade is.\n"
"This should not happen. Please report a bug."
-msgstr ""
+msgstr "ხელმისაწვდომია დამატებითი განახლება, თუმცა არა სრული არ მოიძებნა.\nწესით, ასე არ უნდა მომხდარიყო. გთხოვთ, მოგვახსენოთ ხარვეზის შესახებ."
#: ../lib/Tails/IUK/Frontend.pm:360
msgid "Error while detecting available upgrades"
@@ -109,7 +109,7 @@ msgid ""
"Download size: %{size}s\n"
"\n"
"Do you want to upgrade now?"
-msgstr ""
+msgstr "<b>თქვენი უნდა განაახლოთ ვერსიაზე %{name}s %{version}s.</b>\n\nდამატებითი ინფორმაციისთვის ახალი ვერსიის შესახებ, იხილეთ %{details_url}s\n\nსასურველია დახუროთ ყველა გახსნილი პროგრამა განახლების მიმდინარეობისას.\nგანახლების ჩამოტვირთვამ, შესაძლოა დიდ ხანს გასტანოს, რამდენიმე წუთიდან, საათებამდეც კი.\nქსელთან კავშირი გაითიშება, განახლების ჩამოტვირთვის შემდგომ.\n\nჩამოტვირთვის მოცულობა: %{size}s\n\nგსურთ ა
ხლავე განახლება?"
#: ../lib/Tails/IUK/Frontend.pm:385
msgid "Upgrade available"
@@ -133,7 +133,7 @@ msgid ""
"It is not possible to automatically upgrade your device to this new version: %{explanation}s.\n"
"\n"
"To learn how to do a manual upgrade, go to https://tails.boum.org/doc/first_steps/upgrade/#manual"
-msgstr ""
+msgstr "<b>თქვენ ხელით უნდა განაახლოთ ვერსიაზე %{name}s %{version}s.</b>\n\nდამატებითი ინფორმაციისთვის ამ ვერსიის შესახებ, იხილეთ %{details_url}s\n\nშეუძლებელია თქვენი მოწყობილობის ავტომატური განახლება ამ ახალ ვერსიაზე: %{explanation}s.\n\nვრცლად, ხელით განახლების შესახებ, იხილეთ https://tails.boum.org/doc/first_steps/upgrade/#manual"
#: ../lib/Tails/IUK/Frontend.pm:411
msgid "New version available"
@@ -146,7 +146,7 @@ msgstr "განახლების ჩამოტვირთვა"
#: ../lib/Tails/IUK/Frontend.pm:471
#, perl-brace-format
msgid "Downloading the upgrade to %{name}s %{version}s..."
-msgstr ""
+msgstr "მიმდინარეობს ჩამოტვირთვა განახლების %{name}s %{version}s..."
#: ../lib/Tails/IUK/Frontend.pm:512
msgid ""
@@ -154,7 +154,7 @@ msgid ""
"connection, and restart Tails to try upgrading again.\\n\\nIf the problem "
"persists, go to "
"file:///usr/share/doc/tails/website/doc/upgrade/error/download.en.html"
-msgstr ""
+msgstr "<b>განახლება ვერ ჩამოიტვირთა.</b>\\n\\nშეამოწმეთ თქვენი ქსელის კავშირი და ხელახლა გაუშვით Tails განახლების გასამეორებლად.\\n\\nთუ ხარვეზი არ გამოსწორდება, იხილეთ file:///usr/share/doc/tails/website/doc/upgrade/error/download.en.html"
#: ../lib/Tails/IUK/Frontend.pm:528 ../lib/Tails/IUK/Frontend.pm:547
msgid "Error while downloading the upgrade"
@@ -165,26 +165,26 @@ msgstr "შეცდომა, განახლების ჩამოტვ
msgid ""
"Output file '%{output_file}s' does not exist, but tails-iuk-get-target-file "
"did not complain. Please report a bug."
-msgstr ""
+msgstr "გამოსატანი ფაილი '%{output_file}s' არ არსებობს, მაგრამ tails-iuk-get-target-file არ იტყობინება ამის შესახებ. გთხოვთ, მოგვახსენოთ ამ ხარვეზის შესახებ."
#: ../lib/Tails/IUK/Frontend.pm:559
msgid "Error while creating temporary downloading directory"
-msgstr ""
+msgstr "შეცდომა, ჩამოტვირთვის დროებითი საქაღალდის შექმნისას"
#: ../lib/Tails/IUK/Frontend.pm:562
msgid "Failed to create temporary download directory"
-msgstr ""
+msgstr "ჩამოტვირთვის დროებითი საქაღალდის შექმნა ვერ მოხერხდა"
#: ../lib/Tails/IUK/Frontend.pm:586
msgid ""
"<b>Could not choose a download server.</b>\n"
"\n"
"This should not happen. Please report a bug."
-msgstr ""
+msgstr "<b>ვერ ხერხდება ჩამოტვირთვის სერვერის არჩევა.</b>\n\nწესით, ეს ასე არ უნდა მომხდარიყო. გთხოვთ, მოგვახსენოთ ხარვეზის შესახებ."
#: ../lib/Tails/IUK/Frontend.pm:590
msgid "Error while choosing a download server"
-msgstr ""
+msgstr "შეცდომა, ჩამოტვირთვის სერვერის არჩევისას"
#: ../lib/Tails/IUK/Frontend.pm:607
msgid ""
@@ -194,7 +194,7 @@ msgid ""
"You should restart Tails on the new version as soon as possible.\n"
"\n"
"Do you want to restart now?"
-msgstr ""
+msgstr "<b>თქვენი Tails-მოწყობილობა წარმატებით განახლდა.</b>\n\nუსაფრთხოების საშუალებების ნაწილი, დროებით გამორთულია.\nხელახლა უნდა გაუშვათ Tails, როგორც კი ახალი ვერსია იქნება ხელმისაწვდომი.\n\nგსურთ, ხელახლა გაშვება ახლავე?"
#: ../lib/Tails/IUK/Frontend.pm:612
msgid "Restart Tails"
1
0

12 Oct '18
commit f7287eea0421d85118f95a56a8bc89593460ffd4
Author: Translation commit bot <translation(a)torproject.org>
Date: Fri Oct 12 16:16:06 2018 +0000
Update translations for tails-iuk
---
ka.po | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/ka.po b/ka.po
index 91a22c101..7393c55af 100644
--- a/ka.po
+++ b/ka.po
@@ -6,10 +6,10 @@
# A. C. <georgianization(a)outlook.com>, 2018
msgid ""
msgstr ""
-"Project-Id-Version: The Tor Project\n"
+"Project-Id-Version: Tor Project\n"
"Report-Msgid-Bugs-To: Tails developers <tails(a)boum.org>\n"
"POT-Creation-Date: 2018-08-16 11:16+0200\n"
-"PO-Revision-Date: 2018-09-22 00:05+0000\n"
+"PO-Revision-Date: 2018-10-12 16:15+0000\n"
"Last-Translator: A. C. <georgianization(a)outlook.com>\n"
"Language-Team: Georgian (http://www.transifex.com/otf/torproject/language/ka/)\n"
"MIME-Version: 1.0\n"
@@ -198,42 +198,42 @@ msgstr ""
#: ../lib/Tails/IUK/Frontend.pm:612
msgid "Restart Tails"
-msgstr ""
+msgstr "ხელახლა გაეშვას Tails"
#: ../lib/Tails/IUK/Frontend.pm:613
msgid "Restart now"
-msgstr ""
+msgstr "ხელახლა გაშვება ახლავე"
#: ../lib/Tails/IUK/Frontend.pm:614
msgid "Restart later"
-msgstr ""
+msgstr "ხელახლა გაშვება მოგვიანებით"
#: ../lib/Tails/IUK/Frontend.pm:625
msgid "Error while restarting the system"
-msgstr ""
+msgstr "შეცდომა, სისტემის ხელახლა გაშვებისას"
#: ../lib/Tails/IUK/Frontend.pm:628
msgid "Failed to restart the system"
-msgstr ""
+msgstr "სისტემის ხელახლა გაშვება ვერ მოხერხდა"
#: ../lib/Tails/IUK/Frontend.pm:643
msgid "Error while shutting down the network"
-msgstr ""
+msgstr "შეცდომა ქსელის კავშირის დახურვისას"
#: ../lib/Tails/IUK/Frontend.pm:646
msgid "Failed to shutdown network"
-msgstr ""
+msgstr "ქსელის კავშირის დახურვა ვერ მოხერხდა"
#: ../lib/Tails/IUK/Frontend.pm:656
msgid "Upgrading the system"
-msgstr ""
+msgstr "სისტემა ახლდება"
#: ../lib/Tails/IUK/Frontend.pm:658
msgid ""
"<b>Your Tails device is being upgraded...</b>\n"
"\n"
"For security reasons, the networking is now disabled."
-msgstr ""
+msgstr "<b>თქვენი Tails-მოწყობილობა ახლდება...</b>\n\nუსაფრთხოების მიზნით, ქსელი ახლა გამორთულია."
#: ../lib/Tails/IUK/Frontend.pm:691
msgid ""
@@ -241,8 +241,8 @@ msgid ""
" needs to be repaired and might be unable to restart.\\n\\nPlease follow the"
" instructions at "
"file:///usr/share/doc/tails/website/doc/upgrade/error/install.en.html"
-msgstr ""
+msgstr "<b>შეცდომა მოხდა განახლების დაყენებისას.</b>\\n\\nთქვენი Tails-მოწყობილობა საჭიროებს შეკეთებას და ხელახლა გაშვები შეიძლება ვერ მოხერხდეს.\\n\\nგთხოვთ მიჰყევით მითითებებს file:///usr/share/doc/tails/website/doc/upgrade/error/install.en.html"
#: ../lib/Tails/IUK/Frontend.pm:701
msgid "Error while installing the upgrade"
-msgstr ""
+msgstr "შეცდომა განახლების დაყენებისას"
1
0

[translation/support-portal] Update translations for support-portal
by translation@torproject.org 12 Oct '18
by translation@torproject.org 12 Oct '18
12 Oct '18
commit 4fe648c8ee2f00e726f7fb6efe5ded4a07d40b54
Author: Translation commit bot <translation(a)torproject.org>
Date: Fri Oct 12 15:48:51 2018 +0000
Update translations for support-portal
---
contents+el.po | 35 +++++++++++++++++++++++++++++------
1 file changed, 29 insertions(+), 6 deletions(-)
diff --git a/contents+el.po b/contents+el.po
index 5a2467877..fa30c83be 100644
--- a/contents+el.po
+++ b/contents+el.po
@@ -3082,6 +3082,9 @@ msgid ""
"Onion services allow people to browse but also to publish anonymously, "
"including publishing anonymous websites."
msgstr ""
+"Οι υπηρεσίες onion επιτρέπουν στους χρήστες να περιηγούνται αλλά και να "
+"δημοσιεύουν ανώνυμα, συμπεριλαμβανομένης της δημοσίευσης ανώνυμων "
+"ιστοσελίδων."
#: http//localhost/tbb/tbb-37/
#: (content/tbb/tbb-37/contents+en.lrquestion.seo_slug)
@@ -3124,6 +3127,8 @@ msgid ""
"If you see lines like these in your Tor log, it means your Tor failed to "
"connect to the first node in the Tor circuit."
msgstr ""
+"Αν δείτε γραμμές όπως αυτό στο αρχείο καταγραφής Tor, αυτό σημαίνει ότι ο "
+"Tor σας απέτυχε να συνδεθεί με τον πρώτο κόμβο στο κύκλωμα Tor."
#: http//localhost/tormessenger/tormessenger-1/
#: (content/tormessenger/tormessenger-1/contents+en.lrquestion.description)
@@ -3132,6 +3137,9 @@ msgid ""
"href=\"https://www.torproject.org/about/contact.html.en\">Contact "
"us</a></mark>."
msgstr ""
+"<mark><a "
+"href=\"https://www.torproject.org/about/contact.html.en\">Επικοινωνήστε μαζί"
+" μας</a></mark>."
#: http//localhost/gettor/gettor-1/
#: (content/gettor/gettor-1/contents+en.lrquestion.seo_slug)
@@ -3192,7 +3200,7 @@ msgstr "<div class=\"card\">"
#: http//localhost/operators/operators-4/
#: (content/operators/operators-4/contents+en.lrquestion.title)
msgid "How do I make sure that I'm using the correct packages on Ubuntu?"
-msgstr ""
+msgstr "Πώς μπορώ να βεβαιωθώ ότι χρησιμοποιώ τα σωστά πακέτα στο Ubuntu;"
#: http//localhost/tormobile/tormobile-2/
#: (content/tormobile/tormobile-2/contents+en.lrquestion.description)
@@ -3202,6 +3210,10 @@ msgid ""
"href=\"https://guardianproject.info/\">Guardian Project's "
"website</a></mark>."
msgstr ""
+"Το Guardian Project διατηρεί το Tor (και άλλες εφαρμογές απορρήτου) για "
+"Android. Περισσότερες πληροφορίες μπορείτε να βρείτε στην <mark><a "
+"href=\"https://guardianproject.info/\">ιστοσελίδα του Guardian "
+"Project</a></mark>."
#: http//localhost/tbb/tbb-29/
#: (content/tbb/tbb-29/contents+en.lrquestion.description)
@@ -3265,6 +3277,9 @@ msgid ""
"entered the 16-character onion address correctly: even a small mistake will "
"stop Tor Browser from being able to reach the site."
msgstr ""
+"Αν δεν μπορείτε να συνδεθείτε στην υπηρεσία onion που επιθυμείτε, "
+"βεβαιωθείτε ότι έχετε εισάγει σωστά τη διεύθυνση onion 16 χαρακτήρων: ακόμα "
+"και ένα μικρό λάθος θα εμποδίσει τον Tor Browser να βρει την ιστοσελίδα."
#: http//localhost/tbb/tbb-18/
#: (content/tbb/tbb-18/contents+en.lrquestion.description)
@@ -3330,12 +3345,12 @@ msgstr "δεν-μπορώ-να-συνδεθώ-στον-περιηγητή-tor-ε
#: http//localhost/tbb/tbb-30/
#: (content/tbb/tbb-30/contents+en.lrquestion.description)
msgid "Contact your provider and ask them if they provide 2FA."
-msgstr ""
+msgstr "Επικοινωνήστε με τον πάροχο σας και ρωτήστε τους αν παρέχουν 2FA."
#: http//localhost/misc/misc-2/
#: (content/misc/misc-2/contents+en.lrquestion.seo_slug)
msgid "prevent-bad-people-doing-bad-things-with-tor"
-msgstr ""
+msgstr "prevent-bad-people-doing-bad-things-with-tor"
#: http//localhost/faq/ (content/faq/contents+en.lrtopic.title)
msgid "Most Frequently Asked Questions"
@@ -3344,7 +3359,7 @@ msgstr "Συχνές Ερωτήσεις"
#: http//localhost/tbb/tbb-28/
#: (content/tbb/tbb-28/contents+en.lrquestion.title)
msgid "How do I uninstall Tor Browser?"
-msgstr ""
+msgstr "Πώς μπορώ να απεγκαταστήσω τον Tor Browser;"
#: http//localhost/tbb/tbb-11/
#: (content/tbb/tbb-11/contents+en.lrquestion.title)
@@ -3357,7 +3372,7 @@ msgstr ""
#: http//localhost/tbb/tbb-28/
#: (content/tbb/tbb-28/contents+en.lrquestion.description)
msgid "* Empty your Trash."
-msgstr ""
+msgstr "* Αδειάστε τον Κάδο Απορριμάτων σας"
#: http//localhost/tormobile/tormobile-3/
#: (content/tormobile/tormobile-3/contents+en.lrquestion.title)
@@ -3493,6 +3508,9 @@ msgid ""
"Please take a strong stance in favor of digital privacy and internet "
"freedom, and allow Tor users access to xyz.com."
msgstr ""
+"Παρακαλώ να λάβετε μια ισχυρή θέση υπέρ της ψηφιακής ιδιωτικότητας και της "
+"ελευθερίας του διαδικτύου, και να επιτρέψετε στους χρήστες του Tor να έχουν "
+"πρόσβαση στο xyz.com."
#: http//localhost/tbb/tbb-20/
#: (content/tbb/tbb-20/contents+en.lrquestion.title)
@@ -3672,7 +3690,7 @@ msgstr ""
#: http//localhost/misc/misc-10/
#: (content/misc/misc-10/contents+en.lrquestion.title)
msgid "Does the Tor Project offer hosting?"
-msgstr ""
+msgstr "Το Tor Project προσφέρει υπηρεσίες hosting;"
#: http//localhost/faq/faq-5/ (content/faq/faq-5/contents+en.lrquestion.title)
#: http//localhost/misc/misc-13/
@@ -3694,6 +3712,9 @@ msgid ""
"connecting to <a href=\"http://3g2upl4pq6kufc4m.onion\">DuckDuckGo</a>'s "
"Onion Service."
msgstr ""
+"Μπορείτε επίσης να εξασφαλίσετε ότι έχετε πρόσβαση σε άλλες υπηρεσίες onion,"
+" με σύνδεση στην Onion Υπηρεσία του<a "
+"href=\"http://3g2upl4pq6kufc4m.onion\">DuckDuckGo</a>."
#: http//localhost/gettor/gettor-4/
#: (content/gettor/gettor-4/contents+en.lrquestion.description)
@@ -3701,6 +3722,8 @@ msgid ""
"To get links for downloading Tor Browser, send a message to "
"gettor(a)torproject.org with one of the following codes in it:"
msgstr ""
+"Για να λάβετε συνδέσμους για λήψη του Tor Browser, στείλτε ένα μήνυμα στο "
+"gettor(a)torproject.org με έναν από τους παρακάτω κωδικούς:"
#: http//localhost/tbb/tbb-7/
#: (content/tbb/tbb-7/contents+en.lrquestion.description)
1
0

[tor/master] Extract logic for dumping unparseable junk from routerparse.c
by nickm@torproject.org 12 Oct '18
by nickm@torproject.org 12 Oct '18
12 Oct '18
commit fec3b3bb9389d9d9f927c370d560fc50ec65c93b
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sun Sep 30 18:15:00 2018 -0500
Extract logic for dumping unparseable junk from routerparse.c
---
src/core/include.am | 2 +
src/feature/dirparse/routerparse.c | 582 +-----------------------------------
src/feature/dirparse/routerparse.h | 19 --
src/feature/dirparse/unparseable.c | 591 +++++++++++++++++++++++++++++++++++++
src/feature/dirparse/unparseable.h | 44 +++
src/test/fuzz/fuzz_consensus.c | 1 +
src/test/fuzz/fuzz_descriptor.c | 1 +
src/test/fuzz/fuzz_extrainfo.c | 1 +
src/test/fuzz/fuzz_hsdescv2.c | 1 +
src/test/fuzz/fuzz_hsdescv3.c | 1 +
src/test/fuzz/fuzz_iptsv2.c | 1 +
src/test/fuzz/fuzz_microdesc.c | 1 +
src/test/fuzz/fuzz_vrs.c | 1 +
src/test/test_dir.c | 2 +
14 files changed, 651 insertions(+), 597 deletions(-)
diff --git a/src/core/include.am b/src/core/include.am
index aa8e29ad3..45f4cb5c4 100644
--- a/src/core/include.am
+++ b/src/core/include.am
@@ -74,6 +74,7 @@ LIBTOR_APP_A_SOURCES = \
src/feature/dircommon/voting_schedule.c \
src/feature/dirparse/parsecommon.c \
src/feature/dirparse/routerparse.c \
+ src/feature/dirparse/unparseable.c \
src/feature/hibernate/hibernate.c \
src/feature/hs/hs_cache.c \
src/feature/hs/hs_cell.c \
@@ -287,6 +288,7 @@ noinst_HEADERS += \
src/feature/dircommon/voting_schedule.h \
src/feature/dirparse/parsecommon.h \
src/feature/dirparse/routerparse.h \
+ src/feature/dirparse/unparseable.h \
src/feature/hibernate/hibernate.h \
src/feature/hs/hs_cache.h \
src/feature/hs/hs_cell.h \
diff --git a/src/feature/dirparse/routerparse.c b/src/feature/dirparse/routerparse.c
index ea5ac6f00..83890cdb9 100644
--- a/src/feature/dirparse/routerparse.c
+++ b/src/feature/dirparse/routerparse.c
@@ -82,6 +82,7 @@
#include "lib/crypt_ops/crypto_util.h"
#include "lib/memarea/memarea.h"
#include "lib/sandbox/sandbox.h"
+#include "feature/dirparse/unparseable.h"
#include "feature/dirauth/dirvote.h"
@@ -107,9 +108,9 @@
#undef log
#include <math.h>
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
+//#ifdef HAVE_SYS_STAT_H
+//#include <sys/stat.h>
+//#endif
/****************************************************************************/
@@ -423,581 +424,6 @@ static int check_signature_token(const char *digest,
#define DUMP_AREA(a,name) STMT_NIL
#endif /* defined(DEBUG_AREA_ALLOC) */
-/* Dump mechanism for unparseable descriptors */
-
-/** List of dumped descriptors for FIFO cleanup purposes */
-STATIC smartlist_t *descs_dumped = NULL;
-/** Total size of dumped descriptors for FIFO cleanup */
-STATIC uint64_t len_descs_dumped = 0;
-/** Directory to stash dumps in */
-static int have_dump_desc_dir = 0;
-static int problem_with_dump_desc_dir = 0;
-
-#define DESC_DUMP_DATADIR_SUBDIR "unparseable-descs"
-#define DESC_DUMP_BASE_FILENAME "unparseable-desc"
-
-/** Find the dump directory and check if we'll be able to create it */
-static void
-dump_desc_init(void)
-{
- char *dump_desc_dir;
-
- dump_desc_dir = get_datadir_fname(DESC_DUMP_DATADIR_SUBDIR);
-
- /*
- * We just check for it, don't create it at this point; we'll
- * create it when we need it if it isn't already there.
- */
- if (check_private_dir(dump_desc_dir, CPD_CHECK, get_options()->User) < 0) {
- /* Error, log and flag it as having a problem */
- log_notice(LD_DIR,
- "Doesn't look like we'll be able to create descriptor dump "
- "directory %s; dumps will be disabled.",
- dump_desc_dir);
- problem_with_dump_desc_dir = 1;
- tor_free(dump_desc_dir);
- return;
- }
-
- /* Check if it exists */
- switch (file_status(dump_desc_dir)) {
- case FN_DIR:
- /* We already have a directory */
- have_dump_desc_dir = 1;
- break;
- case FN_NOENT:
- /* Nothing, we'll need to create it later */
- have_dump_desc_dir = 0;
- break;
- case FN_ERROR:
- /* Log and flag having a problem */
- log_notice(LD_DIR,
- "Couldn't check whether descriptor dump directory %s already"
- " exists: %s",
- dump_desc_dir, strerror(errno));
- problem_with_dump_desc_dir = 1;
- break;
- case FN_FILE:
- case FN_EMPTY:
- default:
- /* Something else was here! */
- log_notice(LD_DIR,
- "Descriptor dump directory %s already exists and isn't a "
- "directory",
- dump_desc_dir);
- problem_with_dump_desc_dir = 1;
- }
-
- if (have_dump_desc_dir && !problem_with_dump_desc_dir) {
- dump_desc_populate_fifo_from_directory(dump_desc_dir);
- }
-
- tor_free(dump_desc_dir);
-}
-
-/** Create the dump directory if needed and possible */
-static void
-dump_desc_create_dir(void)
-{
- char *dump_desc_dir;
-
- /* If the problem flag is set, skip it */
- if (problem_with_dump_desc_dir) return;
-
- /* Do we need it? */
- if (!have_dump_desc_dir) {
- dump_desc_dir = get_datadir_fname(DESC_DUMP_DATADIR_SUBDIR);
-
- if (check_private_dir(dump_desc_dir, CPD_CREATE,
- get_options()->User) < 0) {
- log_notice(LD_DIR,
- "Failed to create descriptor dump directory %s",
- dump_desc_dir);
- problem_with_dump_desc_dir = 1;
- }
-
- /* Okay, we created it */
- have_dump_desc_dir = 1;
-
- tor_free(dump_desc_dir);
- }
-}
-
-/** Dump desc FIFO/cleanup; take ownership of the given filename, add it to
- * the FIFO, and clean up the oldest entries to the extent they exceed the
- * configured cap. If any old entries with a matching hash existed, they
- * just got overwritten right before this was called and we should adjust
- * the total size counter without deleting them.
- */
-static void
-dump_desc_fifo_add_and_clean(char *filename, const uint8_t *digest_sha256,
- size_t len)
-{
- dumped_desc_t *ent = NULL, *tmp;
- uint64_t max_len;
-
- tor_assert(filename != NULL);
- tor_assert(digest_sha256 != NULL);
-
- if (descs_dumped == NULL) {
- /* We better have no length, then */
- tor_assert(len_descs_dumped == 0);
- /* Make a smartlist */
- descs_dumped = smartlist_new();
- }
-
- /* Make a new entry to put this one in */
- ent = tor_malloc_zero(sizeof(*ent));
- ent->filename = filename;
- ent->len = len;
- ent->when = time(NULL);
- memcpy(ent->digest_sha256, digest_sha256, DIGEST256_LEN);
-
- /* Do we need to do some cleanup? */
- max_len = get_options()->MaxUnparseableDescSizeToLog;
- /* Iterate over the list until we've freed enough space */
- while (len > max_len - len_descs_dumped &&
- smartlist_len(descs_dumped) > 0) {
- /* Get the oldest thing on the list */
- tmp = (dumped_desc_t *)(smartlist_get(descs_dumped, 0));
-
- /*
- * Check if it matches the filename we just added, so we don't delete
- * something we just emitted if we get repeated identical descriptors.
- */
- if (strcmp(tmp->filename, filename) != 0) {
- /* Delete it and adjust the length counter */
- tor_unlink(tmp->filename);
- tor_assert(len_descs_dumped >= tmp->len);
- len_descs_dumped -= tmp->len;
- log_info(LD_DIR,
- "Deleting old unparseable descriptor dump %s due to "
- "space limits",
- tmp->filename);
- } else {
- /*
- * Don't delete, but do adjust the counter since we will bump it
- * later
- */
- tor_assert(len_descs_dumped >= tmp->len);
- len_descs_dumped -= tmp->len;
- log_info(LD_DIR,
- "Replacing old descriptor dump %s with new identical one",
- tmp->filename);
- }
-
- /* Free it and remove it from the list */
- smartlist_del_keeporder(descs_dumped, 0);
- tor_free(tmp->filename);
- tor_free(tmp);
- }
-
- /* Append our entry to the end of the list and bump the counter */
- smartlist_add(descs_dumped, ent);
- len_descs_dumped += len;
-}
-
-/** Check if we already have a descriptor for this hash and move it to the
- * head of the queue if so. Return 1 if one existed and 0 otherwise.
- */
-static int
-dump_desc_fifo_bump_hash(const uint8_t *digest_sha256)
-{
- dumped_desc_t *match = NULL;
-
- tor_assert(digest_sha256);
-
- if (descs_dumped) {
- /* Find a match if one exists */
- SMARTLIST_FOREACH_BEGIN(descs_dumped, dumped_desc_t *, ent) {
- if (ent &&
- tor_memeq(ent->digest_sha256, digest_sha256, DIGEST256_LEN)) {
- /*
- * Save a pointer to the match and remove it from its current
- * position.
- */
- match = ent;
- SMARTLIST_DEL_CURRENT_KEEPORDER(descs_dumped, ent);
- break;
- }
- } SMARTLIST_FOREACH_END(ent);
-
- if (match) {
- /* Update the timestamp */
- match->when = time(NULL);
- /* Add it back at the end of the list */
- smartlist_add(descs_dumped, match);
-
- /* Indicate we found one */
- return 1;
- }
- }
-
- return 0;
-}
-
-/** Clean up on exit; just memory, leave the dumps behind
- */
-STATIC void
-dump_desc_fifo_cleanup(void)
-{
- if (descs_dumped) {
- /* Free each descriptor */
- SMARTLIST_FOREACH_BEGIN(descs_dumped, dumped_desc_t *, ent) {
- tor_assert(ent);
- tor_free(ent->filename);
- tor_free(ent);
- } SMARTLIST_FOREACH_END(ent);
- /* Free the list */
- smartlist_free(descs_dumped);
- descs_dumped = NULL;
- len_descs_dumped = 0;
- }
-}
-
-/** Handle one file for dump_desc_populate_fifo_from_directory(); make sure
- * the filename is sensibly formed and matches the file content, and either
- * return a dumped_desc_t for it or remove the file and return NULL.
- */
-MOCK_IMPL(STATIC dumped_desc_t *,
-dump_desc_populate_one_file, (const char *dirname, const char *f))
-{
- dumped_desc_t *ent = NULL;
- char *path = NULL, *desc = NULL;
- const char *digest_str;
- char digest[DIGEST256_LEN], content_digest[DIGEST256_LEN];
- /* Expected prefix before digest in filenames */
- const char *f_pfx = DESC_DUMP_BASE_FILENAME ".";
- /*
- * Stat while reading; this is important in case the file
- * contains a NUL character.
- */
- struct stat st;
-
- /* Sanity-check args */
- tor_assert(dirname != NULL);
- tor_assert(f != NULL);
-
- /* Form the full path */
- tor_asprintf(&path, "%s" PATH_SEPARATOR "%s", dirname, f);
-
- /* Check that f has the form DESC_DUMP_BASE_FILENAME.<digest256> */
-
- if (!strcmpstart(f, f_pfx)) {
- /* It matches the form, but is the digest parseable as such? */
- digest_str = f + strlen(f_pfx);
- if (base16_decode(digest, DIGEST256_LEN,
- digest_str, strlen(digest_str)) != DIGEST256_LEN) {
- /* We failed to decode it */
- digest_str = NULL;
- }
- } else {
- /* No match */
- digest_str = NULL;
- }
-
- if (!digest_str) {
- /* We couldn't get a sensible digest */
- log_notice(LD_DIR,
- "Removing unrecognized filename %s from unparseable "
- "descriptors directory", f);
- tor_unlink(path);
- /* We're done */
- goto done;
- }
-
- /*
- * The filename has the form DESC_DUMP_BASE_FILENAME "." <digest256> and
- * we've decoded the digest. Next, check that we can read it and the
- * content matches this digest. We are relying on the fact that if the
- * file contains a '\0', read_file_to_str() will allocate space for and
- * read the entire file and return the correct size in st.
- */
- desc = read_file_to_str(path, RFTS_IGNORE_MISSING|RFTS_BIN, &st);
- if (!desc) {
- /* We couldn't read it */
- log_notice(LD_DIR,
- "Failed to read %s from unparseable descriptors directory; "
- "attempting to remove it.", f);
- tor_unlink(path);
- /* We're done */
- goto done;
- }
-
-#if SIZE_MAX > UINT64_MAX
- if (BUG((uint64_t)st.st_size > (uint64_t)SIZE_MAX)) {
- /* LCOV_EXCL_START
- * Should be impossible since RFTS above should have failed to read the
- * huge file into RAM. */
- goto done;
- /* LCOV_EXCL_STOP */
- }
-#endif /* SIZE_MAX > UINT64_MAX */
- if (BUG(st.st_size < 0)) {
- /* LCOV_EXCL_START
- * Should be impossible, since the OS isn't supposed to be b0rken. */
- goto done;
- /* LCOV_EXCL_STOP */
- }
- /* (Now we can be sure that st.st_size is safe to cast to a size_t.) */
-
- /*
- * We got one; now compute its digest and check that it matches the
- * filename.
- */
- if (crypto_digest256((char *)content_digest, desc, (size_t) st.st_size,
- DIGEST_SHA256) < 0) {
- /* Weird, but okay */
- log_info(LD_DIR,
- "Unable to hash content of %s from unparseable descriptors "
- "directory", f);
- tor_unlink(path);
- /* We're done */
- goto done;
- }
-
- /* Compare the digests */
- if (tor_memneq(digest, content_digest, DIGEST256_LEN)) {
- /* No match */
- log_info(LD_DIR,
- "Hash of %s from unparseable descriptors directory didn't "
- "match its filename; removing it", f);
- tor_unlink(path);
- /* We're done */
- goto done;
- }
-
- /* Okay, it's a match, we should prepare ent */
- ent = tor_malloc_zero(sizeof(dumped_desc_t));
- ent->filename = path;
- memcpy(ent->digest_sha256, digest, DIGEST256_LEN);
- ent->len = (size_t) st.st_size;
- ent->when = st.st_mtime;
- /* Null out path so we don't free it out from under ent */
- path = NULL;
-
- done:
- /* Free allocations if we had them */
- tor_free(desc);
- tor_free(path);
-
- return ent;
-}
-
-/** Sort helper for dump_desc_populate_fifo_from_directory(); compares
- * the when field of dumped_desc_ts in a smartlist to put the FIFO in
- * the correct order after reconstructing it from the directory.
- */
-static int
-dump_desc_compare_fifo_entries(const void **a_v, const void **b_v)
-{
- const dumped_desc_t **a = (const dumped_desc_t **)a_v;
- const dumped_desc_t **b = (const dumped_desc_t **)b_v;
-
- if ((a != NULL) && (*a != NULL)) {
- if ((b != NULL) && (*b != NULL)) {
- /* We have sensible dumped_desc_ts to compare */
- if ((*a)->when < (*b)->when) {
- return -1;
- } else if ((*a)->when == (*b)->when) {
- return 0;
- } else {
- return 1;
- }
- } else {
- /*
- * We shouldn't see this, but what the hell, NULLs precede everythin
- * else
- */
- return 1;
- }
- } else {
- return -1;
- }
-}
-
-/** Scan the contents of the directory, and update FIFO/counters; this will
- * consistency-check descriptor dump filenames against hashes of descriptor
- * dump file content, and remove any inconsistent/unreadable dumps, and then
- * reconstruct the dump FIFO as closely as possible for the last time the
- * tor process shut down. If a previous dump was repeated more than once and
- * moved ahead in the FIFO, the mtime will not have been updated and the
- * reconstructed order will be wrong, but will always be a permutation of
- * the original.
- */
-STATIC void
-dump_desc_populate_fifo_from_directory(const char *dirname)
-{
- smartlist_t *files = NULL;
- dumped_desc_t *ent = NULL;
-
- tor_assert(dirname != NULL);
-
- /* Get a list of files */
- files = tor_listdir(dirname);
- if (!files) {
- log_notice(LD_DIR,
- "Unable to get contents of unparseable descriptor dump "
- "directory %s",
- dirname);
- return;
- }
-
- /*
- * Iterate through the list and decide which files should go in the
- * FIFO and which should be purged.
- */
-
- SMARTLIST_FOREACH_BEGIN(files, char *, f) {
- /* Try to get a FIFO entry */
- ent = dump_desc_populate_one_file(dirname, f);
- if (ent) {
- /*
- * We got one; add it to the FIFO. No need for duplicate checking
- * here since we just verified the name and digest match.
- */
-
- /* Make sure we have a list to add it to */
- if (!descs_dumped) {
- descs_dumped = smartlist_new();
- len_descs_dumped = 0;
- }
-
- /* Add it and adjust the counter */
- smartlist_add(descs_dumped, ent);
- len_descs_dumped += ent->len;
- }
- /*
- * If we didn't, we will have unlinked the file if necessary and
- * possible, and emitted a log message about it, so just go on to
- * the next.
- */
- } SMARTLIST_FOREACH_END(f);
-
- /* Did we get anything? */
- if (descs_dumped != NULL) {
- /* Sort the FIFO in order of increasing timestamp */
- smartlist_sort(descs_dumped, dump_desc_compare_fifo_entries);
-
- /* Log some stats */
- log_info(LD_DIR,
- "Reloaded unparseable descriptor dump FIFO with %d dump(s) "
- "totaling %"PRIu64 " bytes",
- smartlist_len(descs_dumped), (len_descs_dumped));
- }
-
- /* Free the original list */
- SMARTLIST_FOREACH(files, char *, f, tor_free(f));
- smartlist_free(files);
-}
-
-/** For debugging purposes, dump unparseable descriptor *<b>desc</b> of
- * type *<b>type</b> to file $DATADIR/unparseable-desc. Do not write more
- * than one descriptor to disk per minute. If there is already such a
- * file in the data directory, overwrite it. */
-MOCK_IMPL(STATIC void,
-dump_desc,(const char *desc, const char *type))
-{
- tor_assert(desc);
- tor_assert(type);
- size_t len;
- /* The SHA256 of the string */
- uint8_t digest_sha256[DIGEST256_LEN];
- char digest_sha256_hex[HEX_DIGEST256_LEN+1];
- /* Filename to log it to */
- char *debugfile, *debugfile_base;
-
- /* Get the hash for logging purposes anyway */
- len = strlen(desc);
- if (crypto_digest256((char *)digest_sha256, desc, len,
- DIGEST_SHA256) < 0) {
- log_info(LD_DIR,
- "Unable to parse descriptor of type %s, and unable to even hash"
- " it!", type);
- goto err;
- }
-
- base16_encode(digest_sha256_hex, sizeof(digest_sha256_hex),
- (const char *)digest_sha256, sizeof(digest_sha256));
-
- /*
- * We mention type and hash in the main log; don't clutter up the files
- * with anything but the exact dump.
- */
- tor_asprintf(&debugfile_base,
- DESC_DUMP_BASE_FILENAME ".%s", digest_sha256_hex);
- debugfile = get_datadir_fname2(DESC_DUMP_DATADIR_SUBDIR, debugfile_base);
-
- /*
- * Check if the sandbox is active or will become active; see comment
- * below at the log message for why.
- */
- if (!(sandbox_is_active() || get_options()->Sandbox)) {
- if (len <= get_options()->MaxUnparseableDescSizeToLog) {
- if (!dump_desc_fifo_bump_hash(digest_sha256)) {
- /* Create the directory if needed */
- dump_desc_create_dir();
- /* Make sure we've got it */
- if (have_dump_desc_dir && !problem_with_dump_desc_dir) {
- /* Write it, and tell the main log about it */
- write_str_to_file(debugfile, desc, 1);
- log_info(LD_DIR,
- "Unable to parse descriptor of type %s with hash %s and "
- "length %lu. See file %s in data directory for details.",
- type, digest_sha256_hex, (unsigned long)len,
- debugfile_base);
- dump_desc_fifo_add_and_clean(debugfile, digest_sha256, len);
- /* Since we handed ownership over, don't free debugfile later */
- debugfile = NULL;
- } else {
- /* Problem with the subdirectory */
- log_info(LD_DIR,
- "Unable to parse descriptor of type %s with hash %s and "
- "length %lu. Descriptor not dumped because we had a "
- "problem creating the " DESC_DUMP_DATADIR_SUBDIR
- " subdirectory",
- type, digest_sha256_hex, (unsigned long)len);
- /* We do have to free debugfile in this case */
- }
- } else {
- /* We already had one with this hash dumped */
- log_info(LD_DIR,
- "Unable to parse descriptor of type %s with hash %s and "
- "length %lu. Descriptor not dumped because one with that "
- "hash has already been dumped.",
- type, digest_sha256_hex, (unsigned long)len);
- /* We do have to free debugfile in this case */
- }
- } else {
- /* Just log that it happened without dumping */
- log_info(LD_DIR,
- "Unable to parse descriptor of type %s with hash %s and "
- "length %lu. Descriptor not dumped because it exceeds maximum"
- " log size all by itself.",
- type, digest_sha256_hex, (unsigned long)len);
- /* We do have to free debugfile in this case */
- }
- } else {
- /*
- * Not logging because the sandbox is active and seccomp2 apparently
- * doesn't have a sensible way to allow filenames according to a pattern
- * match. (If we ever figure out how to say "allow writes to /regex/",
- * remove this checK).
- */
- log_info(LD_DIR,
- "Unable to parse descriptor of type %s with hash %s and "
- "length %lu. Descriptor not dumped because the sandbox is "
- "configured",
- type, digest_sha256_hex, (unsigned long)len);
- }
-
- tor_free(debugfile_base);
- tor_free(debugfile);
-
- err:
- return;
-}
-
/** Set <b>digest</b> to the SHA-1 digest of the hash of the directory in
* <b>s</b>. Return 0 on success, -1 on failure.
*/
diff --git a/src/feature/dirparse/routerparse.h b/src/feature/dirparse/routerparse.h
index 87c2a75aa..51d39c617 100644
--- a/src/feature/dirparse/routerparse.h
+++ b/src/feature/dirparse/routerparse.h
@@ -114,28 +114,10 @@ void routerparse_init(void);
void routerparse_free_all(void);
#ifdef ROUTERPARSE_PRIVATE
-/*
- * One entry in the list of dumped descriptors; filename dumped to, length,
- * SHA-256 and timestamp.
- */
-
-typedef struct {
- char *filename;
- size_t len;
- uint8_t digest_sha256[DIGEST256_LEN];
- time_t when;
-} dumped_desc_t;
-
-EXTERN(uint64_t, len_descs_dumped)
-EXTERN(smartlist_t *, descs_dumped)
STATIC int routerstatus_parse_guardfraction(const char *guardfraction_str,
networkstatus_t *vote,
vote_routerstatus_t *vote_rs,
routerstatus_t *rs);
-MOCK_DECL(STATIC dumped_desc_t *, dump_desc_populate_one_file,
- (const char *dirname, const char *f));
-STATIC void dump_desc_populate_fifo_from_directory(const char *dirname);
-STATIC void dump_desc_fifo_cleanup(void);
struct memarea_t;
STATIC routerstatus_t *routerstatus_parse_entry_from_string(
struct memarea_t *area,
@@ -144,7 +126,6 @@ STATIC routerstatus_t *routerstatus_parse_entry_from_string(
vote_routerstatus_t *vote_rs,
int consensus_method,
consensus_flavor_t flav);
-MOCK_DECL(STATIC void,dump_desc,(const char *desc, const char *type));
MOCK_DECL(STATIC int, router_compute_hash_final,(char *digest,
const char *start, size_t len,
digest_algorithm_t alg));
diff --git a/src/feature/dirparse/unparseable.c b/src/feature/dirparse/unparseable.c
new file mode 100644
index 000000000..80e38d070
--- /dev/null
+++ b/src/feature/dirparse/unparseable.c
@@ -0,0 +1,591 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#define UNPARSEABLE_PRIVATE
+
+#include "core/or/or.h"
+#include "app/config/config.h"
+#include "feature/dirparse/unparseable.h"
+#include "lib/sandbox/sandbox.h"
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+/* Dump mechanism for unparseable descriptors */
+
+/** List of dumped descriptors for FIFO cleanup purposes */
+STATIC smartlist_t *descs_dumped = NULL;
+/** Total size of dumped descriptors for FIFO cleanup */
+STATIC uint64_t len_descs_dumped = 0;
+/** Directory to stash dumps in */
+static int have_dump_desc_dir = 0;
+static int problem_with_dump_desc_dir = 0;
+
+#define DESC_DUMP_DATADIR_SUBDIR "unparseable-descs"
+#define DESC_DUMP_BASE_FILENAME "unparseable-desc"
+
+/** Find the dump directory and check if we'll be able to create it */
+void
+dump_desc_init(void)
+{
+ char *dump_desc_dir;
+
+ dump_desc_dir = get_datadir_fname(DESC_DUMP_DATADIR_SUBDIR);
+
+ /*
+ * We just check for it, don't create it at this point; we'll
+ * create it when we need it if it isn't already there.
+ */
+ if (check_private_dir(dump_desc_dir, CPD_CHECK, get_options()->User) < 0) {
+ /* Error, log and flag it as having a problem */
+ log_notice(LD_DIR,
+ "Doesn't look like we'll be able to create descriptor dump "
+ "directory %s; dumps will be disabled.",
+ dump_desc_dir);
+ problem_with_dump_desc_dir = 1;
+ tor_free(dump_desc_dir);
+ return;
+ }
+
+ /* Check if it exists */
+ switch (file_status(dump_desc_dir)) {
+ case FN_DIR:
+ /* We already have a directory */
+ have_dump_desc_dir = 1;
+ break;
+ case FN_NOENT:
+ /* Nothing, we'll need to create it later */
+ have_dump_desc_dir = 0;
+ break;
+ case FN_ERROR:
+ /* Log and flag having a problem */
+ log_notice(LD_DIR,
+ "Couldn't check whether descriptor dump directory %s already"
+ " exists: %s",
+ dump_desc_dir, strerror(errno));
+ problem_with_dump_desc_dir = 1;
+ break;
+ case FN_FILE:
+ case FN_EMPTY:
+ default:
+ /* Something else was here! */
+ log_notice(LD_DIR,
+ "Descriptor dump directory %s already exists and isn't a "
+ "directory",
+ dump_desc_dir);
+ problem_with_dump_desc_dir = 1;
+ }
+
+ if (have_dump_desc_dir && !problem_with_dump_desc_dir) {
+ dump_desc_populate_fifo_from_directory(dump_desc_dir);
+ }
+
+ tor_free(dump_desc_dir);
+}
+
+/** Create the dump directory if needed and possible */
+static void
+dump_desc_create_dir(void)
+{
+ char *dump_desc_dir;
+
+ /* If the problem flag is set, skip it */
+ if (problem_with_dump_desc_dir) return;
+
+ /* Do we need it? */
+ if (!have_dump_desc_dir) {
+ dump_desc_dir = get_datadir_fname(DESC_DUMP_DATADIR_SUBDIR);
+
+ if (check_private_dir(dump_desc_dir, CPD_CREATE,
+ get_options()->User) < 0) {
+ log_notice(LD_DIR,
+ "Failed to create descriptor dump directory %s",
+ dump_desc_dir);
+ problem_with_dump_desc_dir = 1;
+ }
+
+ /* Okay, we created it */
+ have_dump_desc_dir = 1;
+
+ tor_free(dump_desc_dir);
+ }
+}
+
+/** Dump desc FIFO/cleanup; take ownership of the given filename, add it to
+ * the FIFO, and clean up the oldest entries to the extent they exceed the
+ * configured cap. If any old entries with a matching hash existed, they
+ * just got overwritten right before this was called and we should adjust
+ * the total size counter without deleting them.
+ */
+static void
+dump_desc_fifo_add_and_clean(char *filename, const uint8_t *digest_sha256,
+ size_t len)
+{
+ dumped_desc_t *ent = NULL, *tmp;
+ uint64_t max_len;
+
+ tor_assert(filename != NULL);
+ tor_assert(digest_sha256 != NULL);
+
+ if (descs_dumped == NULL) {
+ /* We better have no length, then */
+ tor_assert(len_descs_dumped == 0);
+ /* Make a smartlist */
+ descs_dumped = smartlist_new();
+ }
+
+ /* Make a new entry to put this one in */
+ ent = tor_malloc_zero(sizeof(*ent));
+ ent->filename = filename;
+ ent->len = len;
+ ent->when = time(NULL);
+ memcpy(ent->digest_sha256, digest_sha256, DIGEST256_LEN);
+
+ /* Do we need to do some cleanup? */
+ max_len = get_options()->MaxUnparseableDescSizeToLog;
+ /* Iterate over the list until we've freed enough space */
+ while (len > max_len - len_descs_dumped &&
+ smartlist_len(descs_dumped) > 0) {
+ /* Get the oldest thing on the list */
+ tmp = (dumped_desc_t *)(smartlist_get(descs_dumped, 0));
+
+ /*
+ * Check if it matches the filename we just added, so we don't delete
+ * something we just emitted if we get repeated identical descriptors.
+ */
+ if (strcmp(tmp->filename, filename) != 0) {
+ /* Delete it and adjust the length counter */
+ tor_unlink(tmp->filename);
+ tor_assert(len_descs_dumped >= tmp->len);
+ len_descs_dumped -= tmp->len;
+ log_info(LD_DIR,
+ "Deleting old unparseable descriptor dump %s due to "
+ "space limits",
+ tmp->filename);
+ } else {
+ /*
+ * Don't delete, but do adjust the counter since we will bump it
+ * later
+ */
+ tor_assert(len_descs_dumped >= tmp->len);
+ len_descs_dumped -= tmp->len;
+ log_info(LD_DIR,
+ "Replacing old descriptor dump %s with new identical one",
+ tmp->filename);
+ }
+
+ /* Free it and remove it from the list */
+ smartlist_del_keeporder(descs_dumped, 0);
+ tor_free(tmp->filename);
+ tor_free(tmp);
+ }
+
+ /* Append our entry to the end of the list and bump the counter */
+ smartlist_add(descs_dumped, ent);
+ len_descs_dumped += len;
+}
+
+/** Check if we already have a descriptor for this hash and move it to the
+ * head of the queue if so. Return 1 if one existed and 0 otherwise.
+ */
+static int
+dump_desc_fifo_bump_hash(const uint8_t *digest_sha256)
+{
+ dumped_desc_t *match = NULL;
+
+ tor_assert(digest_sha256);
+
+ if (descs_dumped) {
+ /* Find a match if one exists */
+ SMARTLIST_FOREACH_BEGIN(descs_dumped, dumped_desc_t *, ent) {
+ if (ent &&
+ tor_memeq(ent->digest_sha256, digest_sha256, DIGEST256_LEN)) {
+ /*
+ * Save a pointer to the match and remove it from its current
+ * position.
+ */
+ match = ent;
+ SMARTLIST_DEL_CURRENT_KEEPORDER(descs_dumped, ent);
+ break;
+ }
+ } SMARTLIST_FOREACH_END(ent);
+
+ if (match) {
+ /* Update the timestamp */
+ match->when = time(NULL);
+ /* Add it back at the end of the list */
+ smartlist_add(descs_dumped, match);
+
+ /* Indicate we found one */
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/** Clean up on exit; just memory, leave the dumps behind
+ */
+void
+dump_desc_fifo_cleanup(void)
+{
+ if (descs_dumped) {
+ /* Free each descriptor */
+ SMARTLIST_FOREACH_BEGIN(descs_dumped, dumped_desc_t *, ent) {
+ tor_assert(ent);
+ tor_free(ent->filename);
+ tor_free(ent);
+ } SMARTLIST_FOREACH_END(ent);
+ /* Free the list */
+ smartlist_free(descs_dumped);
+ descs_dumped = NULL;
+ len_descs_dumped = 0;
+ }
+}
+
+/** Handle one file for dump_desc_populate_fifo_from_directory(); make sure
+ * the filename is sensibly formed and matches the file content, and either
+ * return a dumped_desc_t for it or remove the file and return NULL.
+ */
+MOCK_IMPL(STATIC dumped_desc_t *,
+dump_desc_populate_one_file, (const char *dirname, const char *f))
+{
+ dumped_desc_t *ent = NULL;
+ char *path = NULL, *desc = NULL;
+ const char *digest_str;
+ char digest[DIGEST256_LEN], content_digest[DIGEST256_LEN];
+ /* Expected prefix before digest in filenames */
+ const char *f_pfx = DESC_DUMP_BASE_FILENAME ".";
+ /*
+ * Stat while reading; this is important in case the file
+ * contains a NUL character.
+ */
+ struct stat st;
+
+ /* Sanity-check args */
+ tor_assert(dirname != NULL);
+ tor_assert(f != NULL);
+
+ /* Form the full path */
+ tor_asprintf(&path, "%s" PATH_SEPARATOR "%s", dirname, f);
+
+ /* Check that f has the form DESC_DUMP_BASE_FILENAME.<digest256> */
+
+ if (!strcmpstart(f, f_pfx)) {
+ /* It matches the form, but is the digest parseable as such? */
+ digest_str = f + strlen(f_pfx);
+ if (base16_decode(digest, DIGEST256_LEN,
+ digest_str, strlen(digest_str)) != DIGEST256_LEN) {
+ /* We failed to decode it */
+ digest_str = NULL;
+ }
+ } else {
+ /* No match */
+ digest_str = NULL;
+ }
+
+ if (!digest_str) {
+ /* We couldn't get a sensible digest */
+ log_notice(LD_DIR,
+ "Removing unrecognized filename %s from unparseable "
+ "descriptors directory", f);
+ tor_unlink(path);
+ /* We're done */
+ goto done;
+ }
+
+ /*
+ * The filename has the form DESC_DUMP_BASE_FILENAME "." <digest256> and
+ * we've decoded the digest. Next, check that we can read it and the
+ * content matches this digest. We are relying on the fact that if the
+ * file contains a '\0', read_file_to_str() will allocate space for and
+ * read the entire file and return the correct size in st.
+ */
+ desc = read_file_to_str(path, RFTS_IGNORE_MISSING|RFTS_BIN, &st);
+ if (!desc) {
+ /* We couldn't read it */
+ log_notice(LD_DIR,
+ "Failed to read %s from unparseable descriptors directory; "
+ "attempting to remove it.", f);
+ tor_unlink(path);
+ /* We're done */
+ goto done;
+ }
+
+#if SIZE_MAX > UINT64_MAX
+ if (BUG((uint64_t)st.st_size > (uint64_t)SIZE_MAX)) {
+ /* LCOV_EXCL_START
+ * Should be impossible since RFTS above should have failed to read the
+ * huge file into RAM. */
+ goto done;
+ /* LCOV_EXCL_STOP */
+ }
+#endif /* SIZE_MAX > UINT64_MAX */
+ if (BUG(st.st_size < 0)) {
+ /* LCOV_EXCL_START
+ * Should be impossible, since the OS isn't supposed to be b0rken. */
+ goto done;
+ /* LCOV_EXCL_STOP */
+ }
+ /* (Now we can be sure that st.st_size is safe to cast to a size_t.) */
+
+ /*
+ * We got one; now compute its digest and check that it matches the
+ * filename.
+ */
+ if (crypto_digest256((char *)content_digest, desc, (size_t) st.st_size,
+ DIGEST_SHA256) < 0) {
+ /* Weird, but okay */
+ log_info(LD_DIR,
+ "Unable to hash content of %s from unparseable descriptors "
+ "directory", f);
+ tor_unlink(path);
+ /* We're done */
+ goto done;
+ }
+
+ /* Compare the digests */
+ if (tor_memneq(digest, content_digest, DIGEST256_LEN)) {
+ /* No match */
+ log_info(LD_DIR,
+ "Hash of %s from unparseable descriptors directory didn't "
+ "match its filename; removing it", f);
+ tor_unlink(path);
+ /* We're done */
+ goto done;
+ }
+
+ /* Okay, it's a match, we should prepare ent */
+ ent = tor_malloc_zero(sizeof(dumped_desc_t));
+ ent->filename = path;
+ memcpy(ent->digest_sha256, digest, DIGEST256_LEN);
+ ent->len = (size_t) st.st_size;
+ ent->when = st.st_mtime;
+ /* Null out path so we don't free it out from under ent */
+ path = NULL;
+
+ done:
+ /* Free allocations if we had them */
+ tor_free(desc);
+ tor_free(path);
+
+ return ent;
+}
+
+/** Sort helper for dump_desc_populate_fifo_from_directory(); compares
+ * the when field of dumped_desc_ts in a smartlist to put the FIFO in
+ * the correct order after reconstructing it from the directory.
+ */
+static int
+dump_desc_compare_fifo_entries(const void **a_v, const void **b_v)
+{
+ const dumped_desc_t **a = (const dumped_desc_t **)a_v;
+ const dumped_desc_t **b = (const dumped_desc_t **)b_v;
+
+ if ((a != NULL) && (*a != NULL)) {
+ if ((b != NULL) && (*b != NULL)) {
+ /* We have sensible dumped_desc_ts to compare */
+ if ((*a)->when < (*b)->when) {
+ return -1;
+ } else if ((*a)->when == (*b)->when) {
+ return 0;
+ } else {
+ return 1;
+ }
+ } else {
+ /*
+ * We shouldn't see this, but what the hell, NULLs precede everythin
+ * else
+ */
+ return 1;
+ }
+ } else {
+ return -1;
+ }
+}
+
+/** Scan the contents of the directory, and update FIFO/counters; this will
+ * consistency-check descriptor dump filenames against hashes of descriptor
+ * dump file content, and remove any inconsistent/unreadable dumps, and then
+ * reconstruct the dump FIFO as closely as possible for the last time the
+ * tor process shut down. If a previous dump was repeated more than once and
+ * moved ahead in the FIFO, the mtime will not have been updated and the
+ * reconstructed order will be wrong, but will always be a permutation of
+ * the original.
+ */
+STATIC void
+dump_desc_populate_fifo_from_directory(const char *dirname)
+{
+ smartlist_t *files = NULL;
+ dumped_desc_t *ent = NULL;
+
+ tor_assert(dirname != NULL);
+
+ /* Get a list of files */
+ files = tor_listdir(dirname);
+ if (!files) {
+ log_notice(LD_DIR,
+ "Unable to get contents of unparseable descriptor dump "
+ "directory %s",
+ dirname);
+ return;
+ }
+
+ /*
+ * Iterate through the list and decide which files should go in the
+ * FIFO and which should be purged.
+ */
+
+ SMARTLIST_FOREACH_BEGIN(files, char *, f) {
+ /* Try to get a FIFO entry */
+ ent = dump_desc_populate_one_file(dirname, f);
+ if (ent) {
+ /*
+ * We got one; add it to the FIFO. No need for duplicate checking
+ * here since we just verified the name and digest match.
+ */
+
+ /* Make sure we have a list to add it to */
+ if (!descs_dumped) {
+ descs_dumped = smartlist_new();
+ len_descs_dumped = 0;
+ }
+
+ /* Add it and adjust the counter */
+ smartlist_add(descs_dumped, ent);
+ len_descs_dumped += ent->len;
+ }
+ /*
+ * If we didn't, we will have unlinked the file if necessary and
+ * possible, and emitted a log message about it, so just go on to
+ * the next.
+ */
+ } SMARTLIST_FOREACH_END(f);
+
+ /* Did we get anything? */
+ if (descs_dumped != NULL) {
+ /* Sort the FIFO in order of increasing timestamp */
+ smartlist_sort(descs_dumped, dump_desc_compare_fifo_entries);
+
+ /* Log some stats */
+ log_info(LD_DIR,
+ "Reloaded unparseable descriptor dump FIFO with %d dump(s) "
+ "totaling %"PRIu64 " bytes",
+ smartlist_len(descs_dumped), (len_descs_dumped));
+ }
+
+ /* Free the original list */
+ SMARTLIST_FOREACH(files, char *, f, tor_free(f));
+ smartlist_free(files);
+}
+
+/** For debugging purposes, dump unparseable descriptor *<b>desc</b> of
+ * type *<b>type</b> to file $DATADIR/unparseable-desc. Do not write more
+ * than one descriptor to disk per minute. If there is already such a
+ * file in the data directory, overwrite it. */
+MOCK_IMPL(void,
+dump_desc,(const char *desc, const char *type))
+{
+ tor_assert(desc);
+ tor_assert(type);
+ size_t len;
+ /* The SHA256 of the string */
+ uint8_t digest_sha256[DIGEST256_LEN];
+ char digest_sha256_hex[HEX_DIGEST256_LEN+1];
+ /* Filename to log it to */
+ char *debugfile, *debugfile_base;
+
+ /* Get the hash for logging purposes anyway */
+ len = strlen(desc);
+ if (crypto_digest256((char *)digest_sha256, desc, len,
+ DIGEST_SHA256) < 0) {
+ log_info(LD_DIR,
+ "Unable to parse descriptor of type %s, and unable to even hash"
+ " it!", type);
+ goto err;
+ }
+
+ base16_encode(digest_sha256_hex, sizeof(digest_sha256_hex),
+ (const char *)digest_sha256, sizeof(digest_sha256));
+
+ /*
+ * We mention type and hash in the main log; don't clutter up the files
+ * with anything but the exact dump.
+ */
+ tor_asprintf(&debugfile_base,
+ DESC_DUMP_BASE_FILENAME ".%s", digest_sha256_hex);
+ debugfile = get_datadir_fname2(DESC_DUMP_DATADIR_SUBDIR, debugfile_base);
+
+ /*
+ * Check if the sandbox is active or will become active; see comment
+ * below at the log message for why.
+ */
+ if (!(sandbox_is_active() || get_options()->Sandbox)) {
+ if (len <= get_options()->MaxUnparseableDescSizeToLog) {
+ if (!dump_desc_fifo_bump_hash(digest_sha256)) {
+ /* Create the directory if needed */
+ dump_desc_create_dir();
+ /* Make sure we've got it */
+ if (have_dump_desc_dir && !problem_with_dump_desc_dir) {
+ /* Write it, and tell the main log about it */
+ write_str_to_file(debugfile, desc, 1);
+ log_info(LD_DIR,
+ "Unable to parse descriptor of type %s with hash %s and "
+ "length %lu. See file %s in data directory for details.",
+ type, digest_sha256_hex, (unsigned long)len,
+ debugfile_base);
+ dump_desc_fifo_add_and_clean(debugfile, digest_sha256, len);
+ /* Since we handed ownership over, don't free debugfile later */
+ debugfile = NULL;
+ } else {
+ /* Problem with the subdirectory */
+ log_info(LD_DIR,
+ "Unable to parse descriptor of type %s with hash %s and "
+ "length %lu. Descriptor not dumped because we had a "
+ "problem creating the " DESC_DUMP_DATADIR_SUBDIR
+ " subdirectory",
+ type, digest_sha256_hex, (unsigned long)len);
+ /* We do have to free debugfile in this case */
+ }
+ } else {
+ /* We already had one with this hash dumped */
+ log_info(LD_DIR,
+ "Unable to parse descriptor of type %s with hash %s and "
+ "length %lu. Descriptor not dumped because one with that "
+ "hash has already been dumped.",
+ type, digest_sha256_hex, (unsigned long)len);
+ /* We do have to free debugfile in this case */
+ }
+ } else {
+ /* Just log that it happened without dumping */
+ log_info(LD_DIR,
+ "Unable to parse descriptor of type %s with hash %s and "
+ "length %lu. Descriptor not dumped because it exceeds maximum"
+ " log size all by itself.",
+ type, digest_sha256_hex, (unsigned long)len);
+ /* We do have to free debugfile in this case */
+ }
+ } else {
+ /*
+ * Not logging because the sandbox is active and seccomp2 apparently
+ * doesn't have a sensible way to allow filenames according to a pattern
+ * match. (If we ever figure out how to say "allow writes to /regex/",
+ * remove this checK).
+ */
+ log_info(LD_DIR,
+ "Unable to parse descriptor of type %s with hash %s and "
+ "length %lu. Descriptor not dumped because the sandbox is "
+ "configured",
+ type, digest_sha256_hex, (unsigned long)len);
+ }
+
+ tor_free(debugfile_base);
+ tor_free(debugfile);
+
+ err:
+ return;
+}
diff --git a/src/feature/dirparse/unparseable.h b/src/feature/dirparse/unparseable.h
new file mode 100644
index 000000000..831ab6777
--- /dev/null
+++ b/src/feature/dirparse/unparseable.h
@@ -0,0 +1,44 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file unparseable.h
+ * \brief Header file for unparseable.c.
+ **/
+
+#ifndef TOR_UNPARSEABLE_H
+#define TOR_UNPARSEABLE_H
+
+#include "lib/cc/torint.h"
+
+MOCK_DECL(void,dump_desc,(const char *desc, const char *type));
+void dump_desc_fifo_cleanup(void);
+void dump_desc_init(void);
+
+#ifdef UNPARSEABLE_PRIVATE
+
+/*
+ * One entry in the list of dumped descriptors; filename dumped to, length,
+ * SHA-256 and timestamp.
+ */
+
+typedef struct {
+ char *filename;
+ size_t len;
+ uint8_t digest_sha256[DIGEST256_LEN];
+ time_t when;
+} dumped_desc_t;
+struct smartlist_t;
+
+EXTERN(uint64_t, len_descs_dumped)
+EXTERN(struct smartlist_t *, descs_dumped)
+
+MOCK_DECL(STATIC dumped_desc_t *, dump_desc_populate_one_file,
+ (const char *dirname, const char *f));
+STATIC void dump_desc_populate_fifo_from_directory(const char *dirname);
+#endif
+
+#endif /* !defined(TOR_UNPARSEABLE_H) */
diff --git a/src/test/fuzz/fuzz_consensus.c b/src/test/fuzz/fuzz_consensus.c
index c368b58d0..1b3f01986 100644
--- a/src/test/fuzz/fuzz_consensus.c
+++ b/src/test/fuzz/fuzz_consensus.c
@@ -3,6 +3,7 @@
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
#include "feature/dirparse/routerparse.h"
+#include "feature/dirparse/unparseable.h"
#include "feature/nodelist/networkstatus.h"
#include "lib/crypt_ops/crypto_ed25519.h"
#include "feature/nodelist/networkstatus_st.h"
diff --git a/src/test/fuzz/fuzz_descriptor.c b/src/test/fuzz/fuzz_descriptor.c
index f7d4a7911..8087e1639 100644
--- a/src/test/fuzz/fuzz_descriptor.c
+++ b/src/test/fuzz/fuzz_descriptor.c
@@ -3,6 +3,7 @@
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
#include "feature/dirparse/routerparse.h"
+#include "feature/dirparse/unparseable.h"
#include "feature/nodelist/routerlist.h"
#include "feature/nodelist/torcert.h"
#include "feature/keymgt/loadkey.h"
diff --git a/src/test/fuzz/fuzz_extrainfo.c b/src/test/fuzz/fuzz_extrainfo.c
index 56fd6b759..3ec2baf1e 100644
--- a/src/test/fuzz/fuzz_extrainfo.c
+++ b/src/test/fuzz/fuzz_extrainfo.c
@@ -3,6 +3,7 @@
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
#include "feature/dirparse/routerparse.h"
+#include "feature/dirparse/unparseable.h"
#include "feature/nodelist/routerlist.h"
#include "feature/relay/routerkeys.h"
#include "test/fuzz/fuzzing.h"
diff --git a/src/test/fuzz/fuzz_hsdescv2.c b/src/test/fuzz/fuzz_hsdescv2.c
index ebab5c6ce..1963114ca 100644
--- a/src/test/fuzz/fuzz_hsdescv2.c
+++ b/src/test/fuzz/fuzz_hsdescv2.c
@@ -3,6 +3,7 @@
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
#include "feature/dirparse/routerparse.h"
+#include "feature/dirparse/unparseable.h"
#include "feature/rend/rendcommon.h"
#include "lib/crypt_ops/crypto_ed25519.h"
#include "test/fuzz/fuzzing.h"
diff --git a/src/test/fuzz/fuzz_hsdescv3.c b/src/test/fuzz/fuzz_hsdescv3.c
index 4d630bf9b..ce6dfb177 100644
--- a/src/test/fuzz/fuzz_hsdescv3.c
+++ b/src/test/fuzz/fuzz_hsdescv3.c
@@ -9,6 +9,7 @@
#include "lib/crypt_ops/crypto_ed25519.h"
#include "feature/hs/hs_descriptor.h"
#include "feature/dirparse/routerparse.h"
+#include "feature/dirparse/unparseable.h"
#include "test/fuzz/fuzzing.h"
diff --git a/src/test/fuzz/fuzz_iptsv2.c b/src/test/fuzz/fuzz_iptsv2.c
index 6fdfec3c9..c2147c8ba 100644
--- a/src/test/fuzz/fuzz_iptsv2.c
+++ b/src/test/fuzz/fuzz_iptsv2.c
@@ -3,6 +3,7 @@
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
#include "feature/dirparse/routerparse.h"
+#include "feature/dirparse/unparseable.h"
#include "feature/rend/rendcommon.h"
#include "lib/crypt_ops/crypto_ed25519.h"
diff --git a/src/test/fuzz/fuzz_microdesc.c b/src/test/fuzz/fuzz_microdesc.c
index 15e8b004c..789e522af 100644
--- a/src/test/fuzz/fuzz_microdesc.c
+++ b/src/test/fuzz/fuzz_microdesc.c
@@ -3,6 +3,7 @@
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
#include "feature/dirparse/routerparse.h"
+#include "feature/dirparse/unparseable.h"
#include "feature/nodelist/microdesc.h"
#include "lib/crypt_ops/crypto_ed25519.h"
diff --git a/src/test/fuzz/fuzz_vrs.c b/src/test/fuzz/fuzz_vrs.c
index 6b22077ae..8fb6e6ef2 100644
--- a/src/test/fuzz/fuzz_vrs.c
+++ b/src/test/fuzz/fuzz_vrs.c
@@ -4,6 +4,7 @@
#define NETWORKSTATUS_PRIVATE
#include "core/or/or.h"
#include "feature/dirparse/routerparse.h"
+#include "feature/dirparse/unparseable.h"
#include "lib/memarea/memarea.h"
#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 23c8c4a1d..9c189ba6b 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -21,6 +21,7 @@
#define ROUTERLIST_PRIVATE
#define ROUTERPARSE_PRIVATE
#define ROUTER_PRIVATE
+#define UNPARSEABLE_PRIVATE
#define VOTEFLAGS_PRIVATE
#include "core/or/or.h"
@@ -52,6 +53,7 @@
#include "feature/nodelist/node_select.h"
#include "feature/nodelist/routerlist.h"
#include "feature/dirparse/routerparse.h"
+#include "feature/dirparse/unparseable.h"
#include "feature/nodelist/routerset.h"
#include "feature/nodelist/torcert.h"
#include "feature/relay/router.h"
1
0

[tor/master] Move routerparse and parsecommon to their own module.
by nickm@torproject.org 12 Oct '18
by nickm@torproject.org 12 Oct '18
12 Oct '18
commit 6785aa4010c141ab8792e41745acc2267ce46ca4
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sun Sep 30 17:53:58 2018 -0500
Move routerparse and parsecommon to their own module.
---
src/app/main/main.c | 5 +++--
src/core/include.am | 8 ++++----
src/core/mainloop/connection.c | 4 ++--
src/core/or/circuitbuild.c | 2 +-
src/core/or/policies.c | 4 ++--
src/core/or/protover.c | 2 +-
src/core/or/relay.c | 2 +-
src/feature/client/entrynodes.c | 4 ++--
src/feature/control/control.c | 2 +-
src/feature/dirauth/bwauth.c | 2 +-
src/feature/dirauth/dirvote.c | 4 ++--
src/feature/dirauth/guardfraction.c | 2 +-
src/feature/dirauth/process_descs.c | 2 +-
src/feature/dircache/consdiffmgr.c | 2 +-
src/feature/dircommon/consdiff.c | 2 +-
src/feature/{nodelist => dirparse}/parsecommon.c | 2 +-
src/feature/{nodelist => dirparse}/parsecommon.h | 0
src/feature/{nodelist => dirparse}/routerparse.c | 4 ++--
src/feature/{nodelist => dirparse}/routerparse.h | 0
src/feature/hs/hs_descriptor.c | 2 +-
src/feature/nodelist/authcert.c | 4 ++--
src/feature/nodelist/microdesc.c | 2 +-
src/feature/nodelist/networkstatus.c | 2 +-
src/feature/nodelist/nodelist.c | 2 +-
src/feature/nodelist/routerlist.c | 2 +-
src/feature/nodelist/routerset.c | 2 +-
src/feature/relay/router.c | 2 +-
src/feature/rend/rendcache.c | 2 +-
src/feature/rend/rendcommon.c | 2 +-
src/feature/rend/rendservice.c | 2 +-
src/test/fuzz/fuzz_consensus.c | 2 +-
src/test/fuzz/fuzz_descriptor.c | 2 +-
src/test/fuzz/fuzz_extrainfo.c | 2 +-
src/test/fuzz/fuzz_hsdescv2.c | 2 +-
src/test/fuzz/fuzz_hsdescv3.c | 2 +-
src/test/fuzz/fuzz_iptsv2.c | 2 +-
src/test/fuzz/fuzz_microdesc.c | 2 +-
src/test/fuzz/fuzz_vrs.c | 2 +-
src/test/test.c | 2 +-
src/test/test_consdiffmgr.c | 2 +-
src/test/test_dir.c | 2 +-
src/test/test_dir_common.h | 2 +-
src/test/test_dir_handle_get.c | 2 +-
src/test/test_entrynodes.c | 2 +-
src/test/test_guardfraction.c | 2 +-
src/test/test_hs_service.c | 2 +-
src/test/test_microdesc.c | 2 +-
src/test/test_policy.c | 2 +-
src/test/test_routerlist.c | 2 +-
src/test/test_routerset.c | 2 +-
src/test/test_shared_random.c | 2 +-
51 files changed, 60 insertions(+), 59 deletions(-)
diff --git a/src/app/main/main.c b/src/app/main/main.c
index 8a24df210..2e3efadc0 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -45,6 +45,7 @@
#include "feature/dirauth/process_descs.h"
#include "feature/dircache/consdiffmgr.h"
#include "feature/dircache/dirserv.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/hibernate/hibernate.h"
#include "feature/hs/hs_cache.h"
#include "feature/nodelist/authcert.h"
@@ -52,7 +53,6 @@
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
#include "feature/relay/dns.h"
#include "feature/relay/ext_orport.h"
#include "feature/relay/onion_queue.h"
@@ -61,7 +61,6 @@
#include "feature/rend/rendcache.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendservice.h"
-#include "lib/geoip/geoip.h"
#include "feature/stats/geoip_stats.h"
#include "feature/stats/predict_ports.h"
#include "feature/stats/rephist.h"
@@ -70,6 +69,8 @@
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_s2k.h"
#include "lib/err/backtrace.h"
+#include "lib/geoip/geoip.h"
+
#include "lib/process/waitpid.h"
#include "lib/meminfo/meminfo.h"
diff --git a/src/core/include.am b/src/core/include.am
index e51819fa2..aa8e29ad3 100644
--- a/src/core/include.am
+++ b/src/core/include.am
@@ -72,6 +72,8 @@ LIBTOR_APP_A_SOURCES = \
src/feature/dircommon/directory.c \
src/feature/dircommon/fp_pair.c \
src/feature/dircommon/voting_schedule.c \
+ src/feature/dirparse/parsecommon.c \
+ src/feature/dirparse/routerparse.c \
src/feature/hibernate/hibernate.c \
src/feature/hs/hs_cache.c \
src/feature/hs/hs_cell.c \
@@ -98,10 +100,8 @@ LIBTOR_APP_A_SOURCES = \
src/feature/nodelist/nickname.c \
src/feature/nodelist/nodelist.c \
src/feature/nodelist/node_select.c \
- src/feature/nodelist/parsecommon.c \
src/feature/nodelist/routerinfo.c \
src/feature/nodelist/routerlist.c \
- src/feature/nodelist/routerparse.c \
src/feature/nodelist/routerset.c \
src/feature/nodelist/fmt_routerstatus.c \
src/feature/nodelist/torcert.c \
@@ -285,6 +285,8 @@ noinst_HEADERS += \
src/feature/dircommon/fp_pair.h \
src/feature/dircommon/vote_timing_st.h \
src/feature/dircommon/voting_schedule.h \
+ src/feature/dirparse/parsecommon.h \
+ src/feature/dirparse/routerparse.h \
src/feature/hibernate/hibernate.h \
src/feature/hs/hs_cache.h \
src/feature/hs/hs_cell.h \
@@ -320,12 +322,10 @@ noinst_HEADERS += \
src/feature/nodelist/node_st.h \
src/feature/nodelist/nodelist.h \
src/feature/nodelist/node_select.h \
- src/feature/nodelist/parsecommon.h \
src/feature/nodelist/routerinfo.h \
src/feature/nodelist/routerinfo_st.h \
src/feature/nodelist/routerlist.h \
src/feature/nodelist/routerlist_st.h \
- src/feature/nodelist/routerparse.h \
src/feature/nodelist/routerset.h \
src/feature/nodelist/fmt_routerstatus.h \
src/feature/nodelist/routerstatus_st.h \
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index d8326a5be..c5f474e03 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -91,20 +91,20 @@
#include "feature/dirauth/authmode.h"
#include "feature/dircache/dirserv.h"
#include "feature/dircommon/directory.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/hibernate/hibernate.h"
#include "feature/hs/hs_common.h"
#include "feature/hs/hs_ident.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
#include "feature/relay/dns.h"
#include "feature/relay/ext_orport.h"
#include "feature/relay/routermode.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendcommon.h"
-#include "lib/geoip/geoip.h"
#include "feature/stats/rephist.h"
#include "lib/crypt_ops/crypto_util.h"
+#include "lib/geoip/geoip.h"
#include "lib/sandbox/sandbox.h"
#include "lib/net/buffers_net.h"
diff --git a/src/core/or/circuitbuild.c b/src/core/or/circuitbuild.c
index 822129d80..2943b7e80 100644
--- a/src/core/or/circuitbuild.c
+++ b/src/core/or/circuitbuild.c
@@ -61,7 +61,7 @@
#include "feature/nodelist/node_select.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/routerset.h"
#include "feature/relay/router.h"
#include "feature/relay/routermode.h"
diff --git a/src/core/or/policies.c b/src/core/or/policies.c
index c3fded1fb..36970cf15 100644
--- a/src/core/or/policies.c
+++ b/src/core/or/policies.c
@@ -20,13 +20,13 @@
#include "core/or/or.h"
#include "feature/client/bridges.h"
#include "app/config/config.h"
+#include "core/or/policies.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nodelist.h"
-#include "core/or/policies.h"
#include "feature/relay/router.h"
#include "feature/relay/routermode.h"
-#include "feature/nodelist/routerparse.h"
#include "lib/geoip/geoip.h"
#include "ht.h"
#include "lib/encoding/confline.h"
diff --git a/src/core/or/protover.c b/src/core/or/protover.c
index f0791366f..4458316c9 100644
--- a/src/core/or/protover.c
+++ b/src/core/or/protover.c
@@ -25,7 +25,7 @@
#include "core/or/or.h"
#include "core/or/protover.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "lib/tls/tortls.h"
#ifndef HAVE_RUST
diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 9e45a3524..dafc6effd 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -79,7 +79,7 @@
#include "feature/rend/rendcommon.h"
#include "feature/nodelist/describe.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "core/or/scheduler.h"
#include "feature/stats/rephist.h"
diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c
index 8ad16af6d..230b51715 100644
--- a/src/feature/client/entrynodes.c
+++ b/src/feature/client/entrynodes.c
@@ -130,13 +130,13 @@
#include "feature/client/transports.h"
#include "feature/control/control.h"
#include "feature/dircommon/directory.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/describe.h"
#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nickname.h"
-#include "feature/nodelist/node_select.h"
#include "feature/nodelist/nodelist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/nodelist/node_select.h"
#include "feature/nodelist/routerset.h"
#include "feature/relay/router.h"
#include "lib/crypt_ops/crypto_rand.h"
diff --git a/src/feature/control/control.c b/src/feature/control/control.c
index d02ecbac8..418ce2e7a 100644
--- a/src/feature/control/control.c
+++ b/src/feature/control/control.c
@@ -65,6 +65,7 @@
#include "feature/dirclient/dirclient.h"
#include "feature/dirclient/dlstatus.h"
#include "feature/dircommon/directory.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/hibernate/hibernate.h"
#include "feature/hs/hs_cache.h"
#include "feature/hs/hs_common.h"
@@ -77,7 +78,6 @@
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerinfo.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
#include "feature/relay/router.h"
#include "feature/relay/routermode.h"
#include "feature/relay/selftest.h"
diff --git a/src/feature/dirauth/bwauth.c b/src/feature/dirauth/bwauth.c
index 90497a3b7..ec23f629c 100644
--- a/src/feature/dirauth/bwauth.c
+++ b/src/feature/dirauth/bwauth.c
@@ -15,7 +15,7 @@
#include "app/config/config.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/routerinfo_st.h"
#include "feature/nodelist/vote_routerstatus_st.h"
diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c
index edb0ad2ae..badb6dc4e 100644
--- a/src/feature/dirauth/dirvote.c
+++ b/src/feature/dirauth/dirvote.c
@@ -17,7 +17,7 @@
#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nodelist.h"
-#include "feature/nodelist/parsecommon.h"
+#include "feature/dirparse/parsecommon.h"
#include "core/or/policies.h"
#include "core/or/protover.h"
#include "core/or/tor_version_st.h"
@@ -27,7 +27,7 @@
#include "feature/nodelist/authcert.h"
#include "feature/nodelist/dirlist.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/fmt_routerstatus.h"
#include "feature/client/entrynodes.h" /* needed for guardfraction methods */
#include "feature/nodelist/torcert.h"
diff --git a/src/feature/dirauth/guardfraction.c b/src/feature/dirauth/guardfraction.c
index 60ba316cf..812cb7df2 100644
--- a/src/feature/dirauth/guardfraction.c
+++ b/src/feature/dirauth/guardfraction.c
@@ -12,7 +12,7 @@
#include "core/or/or.h"
#include "feature/dirauth/guardfraction.h"
#include "feature/nodelist/networkstatus.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/vote_routerstatus_st.h"
diff --git a/src/feature/dirauth/process_descs.c b/src/feature/dirauth/process_descs.c
index 823a1b879..94c456a77 100644
--- a/src/feature/dirauth/process_descs.c
+++ b/src/feature/dirauth/process_descs.c
@@ -26,7 +26,7 @@
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerinfo.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/torcert.h"
#include "feature/relay/router.h"
diff --git a/src/feature/dircache/consdiffmgr.c b/src/feature/dircache/consdiffmgr.c
index 304b64f3b..7dc56f4f1 100644
--- a/src/feature/dircache/consdiffmgr.c
+++ b/src/feature/dircache/consdiffmgr.c
@@ -20,7 +20,7 @@
#include "feature/dircache/consdiffmgr.h"
#include "core/mainloop/cpuworker.h"
#include "feature/nodelist/networkstatus.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "lib/evloop/compat_libevent.h"
#include "lib/evloop/workqueue.h"
#include "lib/compress/compress.h"
diff --git a/src/feature/dircommon/consdiff.c b/src/feature/dircommon/consdiff.c
index 1823dc07f..944ddd552 100644
--- a/src/feature/dircommon/consdiff.c
+++ b/src/feature/dircommon/consdiff.c
@@ -41,7 +41,7 @@
#include "core/or/or.h"
#include "feature/dircommon/consdiff.h"
#include "lib/memarea/memarea.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
static const char* ns_diff_version = "network-status-diff-version 1";
static const char* hash_token = "hash";
diff --git a/src/feature/nodelist/parsecommon.c b/src/feature/dirparse/parsecommon.c
similarity index 99%
rename from src/feature/nodelist/parsecommon.c
rename to src/feature/dirparse/parsecommon.c
index e05657aca..ab815f585 100644
--- a/src/feature/nodelist/parsecommon.c
+++ b/src/feature/dirparse/parsecommon.c
@@ -6,7 +6,7 @@
* \brief Common code to parse and validate various type of descriptors.
**/
-#include "feature/nodelist/parsecommon.h"
+#include "feature/dirparse/parsecommon.h"
#include "lib/log/log.h"
#include "lib/log/util_bug.h"
#include "lib/encoding/binascii.h"
diff --git a/src/feature/nodelist/parsecommon.h b/src/feature/dirparse/parsecommon.h
similarity index 100%
rename from src/feature/nodelist/parsecommon.h
rename to src/feature/dirparse/parsecommon.h
diff --git a/src/feature/nodelist/routerparse.c b/src/feature/dirparse/routerparse.c
similarity index 99%
rename from src/feature/nodelist/routerparse.c
rename to src/feature/dirparse/routerparse.c
index c12f411e8..ea5ac6f00 100644
--- a/src/feature/nodelist/routerparse.c
+++ b/src/feature/dirparse/routerparse.c
@@ -63,16 +63,16 @@
#include "feature/client/entrynodes.h"
#include "feature/dirauth/shared_random.h"
#include "feature/dircommon/voting_schedule.h"
+#include "feature/dirparse/parsecommon.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/hs_common/shared_random_client.h"
#include "feature/nodelist/authcert.h"
#include "feature/nodelist/describe.h"
#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nickname.h"
-#include "feature/nodelist/parsecommon.h"
#include "feature/nodelist/routerinfo.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
#include "feature/nodelist/torcert.h"
#include "feature/relay/router.h"
#include "feature/relay/routerkeys.h"
diff --git a/src/feature/nodelist/routerparse.h b/src/feature/dirparse/routerparse.h
similarity index 100%
rename from src/feature/nodelist/routerparse.h
rename to src/feature/dirparse/routerparse.h
diff --git a/src/feature/hs/hs_descriptor.c b/src/feature/hs/hs_descriptor.c
index b9a0c0ef1..8515314b3 100644
--- a/src/feature/hs/hs_descriptor.c
+++ b/src/feature/hs/hs_descriptor.c
@@ -61,7 +61,7 @@
#include "core/or/circuitbuild.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_util.h"
-#include "feature/nodelist/parsecommon.h"
+#include "feature/dirparse/parsecommon.h"
#include "feature/rend/rendcache.h"
#include "feature/hs/hs_cache.h"
#include "feature/hs/hs_config.h"
diff --git a/src/feature/nodelist/authcert.c b/src/feature/nodelist/authcert.c
index 2624ed5ee..1d2377016 100644
--- a/src/feature/nodelist/authcert.c
+++ b/src/feature/nodelist/authcert.c
@@ -24,17 +24,17 @@
#include "core/or/policies.h"
#include "feature/client/bridges.h"
#include "feature/dirauth/authmode.h"
-#include "feature/dircommon/directory.h"
#include "feature/dirclient/dirclient.h"
#include "feature/dirclient/dlstatus.h"
+#include "feature/dircommon/directory.h"
#include "feature/dircommon/fp_pair.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/authcert.h"
#include "feature/nodelist/dirlist.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/node_select.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
#include "feature/relay/routermode.h"
#include "core/or/connection_st.h"
diff --git a/src/feature/nodelist/microdesc.c b/src/feature/nodelist/microdesc.c
index 96696b603..85bc59812 100644
--- a/src/feature/nodelist/microdesc.c
+++ b/src/feature/nodelist/microdesc.c
@@ -25,7 +25,7 @@
#include "feature/relay/router.h"
#include "feature/nodelist/dirlist.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/microdesc_st.h"
#include "feature/nodelist/networkstatus_st.h"
diff --git a/src/feature/nodelist/networkstatus.c b/src/feature/nodelist/networkstatus.c
index 67b5a1d04..e20d543db 100644
--- a/src/feature/nodelist/networkstatus.c
+++ b/src/feature/nodelist/networkstatus.c
@@ -64,6 +64,7 @@
#include "feature/dirclient/dlstatus.h"
#include "feature/dircommon/directory.h"
#include "feature/dircommon/voting_schedule.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/hibernate/hibernate.h"
#include "feature/nodelist/authcert.h"
#include "feature/nodelist/dirlist.h"
@@ -74,7 +75,6 @@
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerinfo.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
#include "feature/nodelist/torcert.h"
#include "feature/relay/routermode.h"
#include "lib/crypt_ops/crypto_rand.h"
diff --git a/src/feature/nodelist/nodelist.c b/src/feature/nodelist/nodelist.c
index 90ca579b7..29150d931 100644
--- a/src/feature/nodelist/nodelist.c
+++ b/src/feature/nodelist/nodelist.c
@@ -61,7 +61,7 @@
#include "feature/nodelist/node_select.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/routerset.h"
#include "feature/nodelist/torcert.h"
#include "feature/rend/rendservice.h"
diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c
index 20956d8cc..a8c9003e6 100644
--- a/src/feature/nodelist/routerlist.c
+++ b/src/feature/nodelist/routerlist.c
@@ -84,7 +84,7 @@
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerinfo.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/routerset.h"
#include "feature/nodelist/torcert.h"
#include "feature/relay/routermode.h"
diff --git a/src/feature/nodelist/routerset.c b/src/feature/nodelist/routerset.c
index cb07a436d..59d6da97b 100644
--- a/src/feature/nodelist/routerset.c
+++ b/src/feature/nodelist/routerset.c
@@ -30,9 +30,9 @@ n * Copyright (c) 2001-2004, Roger Dingledine.
#include "core/or/or.h"
#include "core/or/policies.h"
#include "feature/client/bridges.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/nickname.h"
#include "feature/nodelist/nodelist.h"
-#include "feature/nodelist/routerparse.h"
#include "feature/nodelist/routerset.h"
#include "lib/geoip/geoip.h"
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c
index fdaadb205..318cb41ec 100644
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@ -21,6 +21,7 @@
#include "feature/dircache/dirserv.h"
#include "feature/dirclient/dirclient.h"
#include "feature/dircommon/directory.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/hibernate/hibernate.h"
#include "feature/keymgt/loadkey.h"
#include "feature/nodelist/authcert.h"
@@ -29,7 +30,6 @@
#include "feature/nodelist/nickname.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
#include "feature/nodelist/torcert.h"
#include "feature/relay/dns.h"
#include "feature/relay/router.h"
diff --git a/src/feature/rend/rendcache.c b/src/feature/rend/rendcache.c
index 7af5063ba..9197a53bd 100644
--- a/src/feature/rend/rendcache.c
+++ b/src/feature/rend/rendcache.c
@@ -12,7 +12,7 @@
#include "app/config/config.h"
#include "feature/stats/rephist.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/rend/rendcommon.h"
#include "core/or/extend_info_st.h"
diff --git a/src/feature/rend/rendcommon.c b/src/feature/rend/rendcommon.c
index b48ba87cb..57d753fe4 100644
--- a/src/feature/rend/rendcommon.c
+++ b/src/feature/rend/rendcommon.c
@@ -30,7 +30,7 @@
#include "feature/hs_common/replaycache.h"
#include "feature/relay/router.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "core/or/cpath_build_state_st.h"
#include "core/or/crypt_path_st.h"
diff --git a/src/feature/rend/rendservice.c b/src/feature/rend/rendservice.c
index 057ca2d0c..bcd123f37 100644
--- a/src/feature/rend/rendservice.c
+++ b/src/feature/rend/rendservice.c
@@ -22,6 +22,7 @@
#include "feature/control/control.h"
#include "feature/dirclient/dirclient.h"
#include "feature/dircommon/directory.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/hs/hs_common.h"
#include "feature/hs/hs_config.h"
#include "feature/hs_common/replaycache.h"
@@ -31,7 +32,6 @@
#include "feature/nodelist/nickname.h"
#include "feature/nodelist/node_select.h"
#include "feature/nodelist/nodelist.h"
-#include "feature/nodelist/routerparse.h"
#include "feature/nodelist/routerset.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendcommon.h"
diff --git a/src/test/fuzz/fuzz_consensus.c b/src/test/fuzz/fuzz_consensus.c
index b170fd33d..c368b58d0 100644
--- a/src/test/fuzz/fuzz_consensus.c
+++ b/src/test/fuzz/fuzz_consensus.c
@@ -2,7 +2,7 @@
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/networkstatus.h"
#include "lib/crypt_ops/crypto_ed25519.h"
#include "feature/nodelist/networkstatus_st.h"
diff --git a/src/test/fuzz/fuzz_descriptor.c b/src/test/fuzz/fuzz_descriptor.c
index 2babdce4b..f7d4a7911 100644
--- a/src/test/fuzz/fuzz_descriptor.c
+++ b/src/test/fuzz/fuzz_descriptor.c
@@ -2,7 +2,7 @@
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/routerlist.h"
#include "feature/nodelist/torcert.h"
#include "feature/keymgt/loadkey.h"
diff --git a/src/test/fuzz/fuzz_extrainfo.c b/src/test/fuzz/fuzz_extrainfo.c
index 6c88f8012..56fd6b759 100644
--- a/src/test/fuzz/fuzz_extrainfo.c
+++ b/src/test/fuzz/fuzz_extrainfo.c
@@ -2,7 +2,7 @@
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/routerlist.h"
#include "feature/relay/routerkeys.h"
#include "test/fuzz/fuzzing.h"
diff --git a/src/test/fuzz/fuzz_hsdescv2.c b/src/test/fuzz/fuzz_hsdescv2.c
index fd5da4163..ebab5c6ce 100644
--- a/src/test/fuzz/fuzz_hsdescv2.c
+++ b/src/test/fuzz/fuzz_hsdescv2.c
@@ -2,7 +2,7 @@
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/rend/rendcommon.h"
#include "lib/crypt_ops/crypto_ed25519.h"
#include "test/fuzz/fuzzing.h"
diff --git a/src/test/fuzz/fuzz_hsdescv3.c b/src/test/fuzz/fuzz_hsdescv3.c
index b332973b3..4d630bf9b 100644
--- a/src/test/fuzz/fuzz_hsdescv3.c
+++ b/src/test/fuzz/fuzz_hsdescv3.c
@@ -8,7 +8,7 @@
#include "trunnel/ed25519_cert.h" /* Trunnel interface. */
#include "lib/crypt_ops/crypto_ed25519.h"
#include "feature/hs/hs_descriptor.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "test/fuzz/fuzzing.h"
diff --git a/src/test/fuzz/fuzz_iptsv2.c b/src/test/fuzz/fuzz_iptsv2.c
index a3082f4d0..6fdfec3c9 100644
--- a/src/test/fuzz/fuzz_iptsv2.c
+++ b/src/test/fuzz/fuzz_iptsv2.c
@@ -2,7 +2,7 @@
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/rend/rendcommon.h"
#include "lib/crypt_ops/crypto_ed25519.h"
diff --git a/src/test/fuzz/fuzz_microdesc.c b/src/test/fuzz/fuzz_microdesc.c
index fa9676372..15e8b004c 100644
--- a/src/test/fuzz/fuzz_microdesc.c
+++ b/src/test/fuzz/fuzz_microdesc.c
@@ -2,7 +2,7 @@
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
#include "core/or/or.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/microdesc.h"
#include "lib/crypt_ops/crypto_ed25519.h"
diff --git a/src/test/fuzz/fuzz_vrs.c b/src/test/fuzz/fuzz_vrs.c
index 8c96851b1..6b22077ae 100644
--- a/src/test/fuzz/fuzz_vrs.c
+++ b/src/test/fuzz/fuzz_vrs.c
@@ -3,7 +3,7 @@
#define ROUTERPARSE_PRIVATE
#define NETWORKSTATUS_PRIVATE
#include "core/or/or.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "lib/memarea/memarea.h"
#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
diff --git a/src/test/test.c b/src/test/test.c
index fff87a2b5..2b2f536e2 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -54,7 +54,7 @@
#include "core/crypto/onion_tap.h"
#include "core/or/policies.h"
#include "feature/stats/rephist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "app/config/statefile.h"
#include "lib/crypt_ops/crypto_curve25519.h"
diff --git a/src/test/test_consdiffmgr.c b/src/test/test_consdiffmgr.c
index 6c0601b50..dc05c351b 100644
--- a/src/test/test_consdiffmgr.c
+++ b/src/test/test_consdiffmgr.c
@@ -11,7 +11,7 @@
#include "core/mainloop/cpuworker.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "feature/nodelist/networkstatus.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "lib/evloop/workqueue.h"
#include "lib/compress/compress.h"
#include "lib/encoding/confline.h"
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index aa1c706b1..23c8c4a1d 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -51,7 +51,7 @@
#include "feature/nodelist/nickname.h"
#include "feature/nodelist/node_select.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/routerset.h"
#include "feature/nodelist/torcert.h"
#include "feature/relay/router.h"
diff --git a/src/test/test_dir_common.h b/src/test/test_dir_common.h
index 1e90228ed..9bcabc7bd 100644
--- a/src/test/test_dir_common.h
+++ b/src/test/test_dir_common.h
@@ -5,7 +5,7 @@
#include "core/or/or.h"
#include "feature/nodelist/networkstatus.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#define TEST_DIR_ROUTER_ID_1 3
#define TEST_DIR_ROUTER_ID_2 5
diff --git a/src/test/test_dir_handle_get.c b/src/test/test_dir_handle_get.c
index 623d9e9b9..7deed61e7 100644
--- a/src/test/test_dir_handle_get.c
+++ b/src/test/test_dir_handle_get.c
@@ -29,7 +29,7 @@
#include "test/test_helpers.h"
#include "feature/nodelist/nodelist.h"
#include "feature/client/entrynodes.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/networkstatus.h"
#include "core/proto/proto_http.h"
#include "lib/geoip/geoip.h"
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index ebe9accf5..295586c69 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -26,7 +26,7 @@
#include "feature/nodelist/networkstatus.h"
#include "core/or/policies.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/routerset.h"
#include "app/config/statefile.h"
diff --git a/src/test/test_guardfraction.c b/src/test/test_guardfraction.c
index 7d4a959bb..c7266be66 100644
--- a/src/test/test_guardfraction.c
+++ b/src/test/test_guardfraction.c
@@ -10,7 +10,7 @@
#include "app/config/config.h"
#include "feature/dirauth/guardfraction.h"
#include "feature/client/entrynodes.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/networkstatus_st.h"
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index 334bde3e7..67686bbee 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -43,7 +43,7 @@
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nodelist.h"
#include "core/or/relay.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/hs/hs_common.h"
#include "feature/hs/hs_config.h"
#include "feature/hs/hs_ident.h"
diff --git a/src/test/test_microdesc.c b/src/test/test_microdesc.c
index ec4779ead..bec8053f6 100644
--- a/src/test/test_microdesc.c
+++ b/src/test/test_microdesc.c
@@ -10,7 +10,7 @@
#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/nodelist/torcert.h"
#include "feature/nodelist/microdesc_st.h"
diff --git a/src/test/test_policy.c b/src/test/test_policy.c
index 6a07e5b1f..5101b57ab 100644
--- a/src/test/test_policy.c
+++ b/src/test/test_policy.c
@@ -5,7 +5,7 @@
#define CONFIG_PRIVATE
#include "app/config/config.h"
#include "feature/relay/router.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#define POLICIES_PRIVATE
#include "core/or/policies.h"
#include "lib/encoding/confline.h"
diff --git a/src/test/test_routerlist.c b/src/test/test_routerlist.c
index 1086b9861..a76f5c37d 100644
--- a/src/test/test_routerlist.c
+++ b/src/test/test_routerlist.c
@@ -33,7 +33,7 @@
#include "feature/nodelist/node_select.h"
#include "feature/nodelist/routerlist.h"
#include "feature/nodelist/routerset.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/dirauth/shared_random.h"
#include "app/config/statefile.h"
diff --git a/src/test/test_routerset.c b/src/test/test_routerset.c
index fede419f0..56abce162 100644
--- a/src/test/test_routerset.c
+++ b/src/test/test_routerset.c
@@ -6,7 +6,7 @@
#include "core/or/or.h"
#include "lib/geoip/geoip.h"
#include "feature/nodelist/routerset.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "core/or/policies.h"
#include "feature/nodelist/nodelist.h"
diff --git a/src/test/test_shared_random.c b/src/test/test_shared_random.c
index 725724aa5..4dc017f33 100644
--- a/src/test/test_shared_random.c
+++ b/src/test/test_shared_random.c
@@ -19,7 +19,7 @@
#include "feature/relay/routerkeys.h"
#include "feature/nodelist/authcert.h"
#include "feature/nodelist/dirlist.h"
-#include "feature/nodelist/routerparse.h"
+#include "feature/dirparse/routerparse.h"
#include "feature/hs_common/shared_random_client.h"
#include "feature/dircommon/voting_schedule.h"
1
0

[tor/master] Extract the version-managing code from routerparse.c
by nickm@torproject.org 12 Oct '18
by nickm@torproject.org 12 Oct '18
12 Oct '18
commit 2f5dc486993b88eb23de7f06043991f08e4d0d73
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sun Sep 30 18:27:23 2018 -0500
Extract the version-managing code from routerparse.c
Leave the versions.h include in routerparse.h for now; I'll remove
it later.
---
src/core/include.am | 2 +
src/core/or/versions.c | 377 +++++++++++++++++++++++++++++++++++++
src/core/or/versions.h | 40 ++++
src/feature/dirparse/routerparse.c | 364 -----------------------------------
src/feature/dirparse/routerparse.h | 25 +--
5 files changed, 421 insertions(+), 387 deletions(-)
diff --git a/src/core/include.am b/src/core/include.am
index 45f4cb5c4..c1f63c751 100644
--- a/src/core/include.am
+++ b/src/core/include.am
@@ -46,6 +46,7 @@ LIBTOR_APP_A_SOURCES = \
src/core/or/scheduler_kist.c \
src/core/or/scheduler_vanilla.c \
src/core/or/status.c \
+ src/core/or/versions.c \
src/core/proto/proto_cell.c \
src/core/proto/proto_control0.c \
src/core/proto/proto_ext_or.c \
@@ -241,6 +242,7 @@ noinst_HEADERS += \
src/core/or/status.h \
src/core/or/tor_version_st.h \
src/core/or/var_cell_st.h \
+ src/core/or/versions.h \
src/core/proto/proto_cell.h \
src/core/proto/proto_control0.h \
src/core/proto/proto_ext_or.h \
diff --git a/src/core/or/versions.c b/src/core/or/versions.c
new file mode 100644
index 000000000..2d2486298
--- /dev/null
+++ b/src/core/or/versions.c
@@ -0,0 +1,377 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file versions.c
+ * \brief Code to manipulate, parse, and compare Tor versions.
+ */
+#include "core/or/or.h"
+
+#include "core/or/versions.h"
+#include "lib/crypt_ops/crypto_util.h"
+
+#include "core/or/tor_version_st.h"
+
+/** Return VS_RECOMMENDED if <b>myversion</b> is contained in
+ * <b>versionlist</b>. Else, return VS_EMPTY if versionlist has no
+ * entries. Else, return VS_OLD if every member of
+ * <b>versionlist</b> is newer than <b>myversion</b>. Else, return
+ * VS_NEW_IN_SERIES if there is at least one member of <b>versionlist</b> in
+ * the same series (major.minor.micro) as <b>myversion</b>, but no such member
+ * is newer than <b>myversion.</b>. Else, return VS_NEW if every member of
+ * <b>versionlist</b> is older than <b>myversion</b>. Else, return
+ * VS_UNRECOMMENDED.
+ *
+ * (versionlist is a comma-separated list of version strings,
+ * optionally prefixed with "Tor". Versions that can't be parsed are
+ * ignored.)
+ */
+version_status_t
+tor_version_is_obsolete(const char *myversion, const char *versionlist)
+{
+ tor_version_t mine, other;
+ int found_newer = 0, found_older = 0, found_newer_in_series = 0,
+ found_any_in_series = 0, r, same;
+ version_status_t ret = VS_UNRECOMMENDED;
+ smartlist_t *version_sl;
+
+ log_debug(LD_CONFIG,"Checking whether version '%s' is in '%s'",
+ myversion, versionlist);
+
+ if (tor_version_parse(myversion, &mine)) {
+ log_err(LD_BUG,"I couldn't parse my own version (%s)", myversion);
+ tor_assert(0);
+ }
+ version_sl = smartlist_new();
+ smartlist_split_string(version_sl, versionlist, ",", SPLIT_SKIP_SPACE, 0);
+
+ if (!strlen(versionlist)) { /* no authorities cared or agreed */
+ ret = VS_EMPTY;
+ goto done;
+ }
+
+ SMARTLIST_FOREACH_BEGIN(version_sl, const char *, cp) {
+ if (!strcmpstart(cp, "Tor "))
+ cp += 4;
+
+ if (tor_version_parse(cp, &other)) {
+ /* Couldn't parse other; it can't be a match. */
+ } else {
+ same = tor_version_same_series(&mine, &other);
+ if (same)
+ found_any_in_series = 1;
+ r = tor_version_compare(&mine, &other);
+ if (r==0) {
+ ret = VS_RECOMMENDED;
+ goto done;
+ } else if (r<0) {
+ found_newer = 1;
+ if (same)
+ found_newer_in_series = 1;
+ } else if (r>0) {
+ found_older = 1;
+ }
+ }
+ } SMARTLIST_FOREACH_END(cp);
+
+ /* We didn't find the listed version. Is it new or old? */
+ if (found_any_in_series && !found_newer_in_series && found_newer) {
+ ret = VS_NEW_IN_SERIES;
+ } else if (found_newer && !found_older) {
+ ret = VS_OLD;
+ } else if (found_older && !found_newer) {
+ ret = VS_NEW;
+ } else {
+ ret = VS_UNRECOMMENDED;
+ }
+
+ done:
+ SMARTLIST_FOREACH(version_sl, char *, version, tor_free(version));
+ smartlist_free(version_sl);
+ return ret;
+}
+
+/** Extract a Tor version from a <b>platform</b> line from a router
+ * descriptor, and place the result in <b>router_version</b>.
+ *
+ * Return 1 on success, -1 on parsing failure, and 0 if the
+ * platform line does not indicate some version of Tor.
+ *
+ * If <b>strict</b> is non-zero, finding any weird version components
+ * (like negative numbers) counts as a parsing failure.
+ */
+int
+tor_version_parse_platform(const char *platform,
+ tor_version_t *router_version,
+ int strict)
+{
+ char tmp[128];
+ char *s, *s2, *start;
+
+ if (strcmpstart(platform,"Tor ")) /* nonstandard Tor; say 0. */
+ return 0;
+
+ start = (char *)eat_whitespace(platform+3);
+ if (!*start) return -1;
+ s = (char *)find_whitespace(start); /* also finds '\0', which is fine */
+ s2 = (char*)eat_whitespace(s);
+ if (!strcmpstart(s2, "(r") || !strcmpstart(s2, "(git-"))
+ s = (char*)find_whitespace(s2);
+
+ if ((size_t)(s-start+1) >= sizeof(tmp)) /* too big, no */
+ return -1;
+ strlcpy(tmp, start, s-start+1);
+
+ if (tor_version_parse(tmp, router_version)<0) {
+ log_info(LD_DIR,"Router version '%s' unparseable.",tmp);
+ return -1;
+ }
+
+ if (strict) {
+ if (router_version->major < 0 ||
+ router_version->minor < 0 ||
+ router_version->micro < 0 ||
+ router_version->patchlevel < 0 ||
+ router_version->svn_revision < 0) {
+ return -1;
+ }
+ }
+
+ return 1;
+}
+
+/** Parse the Tor version of the platform string <b>platform</b>,
+ * and compare it to the version in <b>cutoff</b>. Return 1 if
+ * the router is at least as new as the cutoff, else return 0.
+ */
+int
+tor_version_as_new_as(const char *platform, const char *cutoff)
+{
+ tor_version_t cutoff_version, router_version;
+ int r;
+ tor_assert(platform);
+
+ if (tor_version_parse(cutoff, &cutoff_version)<0) {
+ log_warn(LD_BUG,"cutoff version '%s' unparseable.",cutoff);
+ return 0;
+ }
+
+ r = tor_version_parse_platform(platform, &router_version, 0);
+ if (r == 0) {
+ /* nonstandard Tor; be safe and say yes */
+ return 1;
+ } else if (r < 0) {
+ /* unparseable version; be safe and say yes. */
+ return 1;
+ }
+
+ /* Here's why we don't need to do any special handling for svn revisions:
+ * - If neither has an svn revision, we're fine.
+ * - If the router doesn't have an svn revision, we can't assume that it
+ * is "at least" any svn revision, so we need to return 0.
+ * - If the target version doesn't have an svn revision, any svn revision
+ * (or none at all) is good enough, so return 1.
+ * - If both target and router have an svn revision, we compare them.
+ */
+
+ return tor_version_compare(&router_version, &cutoff_version) >= 0;
+}
+
+/** Parse a tor version from <b>s</b>, and store the result in <b>out</b>.
+ * Return 0 on success, -1 on failure. */
+int
+tor_version_parse(const char *s, tor_version_t *out)
+{
+ char *eos=NULL;
+ const char *cp=NULL;
+ int ok = 1;
+ /* Format is:
+ * "Tor " ? NUM dot NUM [ dot NUM [ ( pre | rc | dot ) NUM ] ] [ - tag ]
+ */
+ tor_assert(s);
+ tor_assert(out);
+
+ memset(out, 0, sizeof(tor_version_t));
+ out->status = VER_RELEASE;
+ if (!strcasecmpstart(s, "Tor "))
+ s += 4;
+
+ cp = s;
+
+#define NUMBER(m) \
+ do { \
+ if (!cp || *cp < '0' || *cp > '9') \
+ return -1; \
+ out->m = (int)tor_parse_uint64(cp, 10, 0, INT32_MAX, &ok, &eos); \
+ if (!ok) \
+ return -1; \
+ if (!eos || eos == cp) \
+ return -1; \
+ cp = eos; \
+ } while (0)
+
+#define DOT() \
+ do { \
+ if (*cp != '.') \
+ return -1; \
+ ++cp; \
+ } while (0)
+
+ NUMBER(major);
+ DOT();
+ NUMBER(minor);
+ if (*cp == 0)
+ return 0;
+ else if (*cp == '-')
+ goto status_tag;
+ DOT();
+ NUMBER(micro);
+
+ /* Get status */
+ if (*cp == 0) {
+ return 0;
+ } else if (*cp == '.') {
+ ++cp;
+ } else if (*cp == '-') {
+ goto status_tag;
+ } else if (0==strncmp(cp, "pre", 3)) {
+ out->status = VER_PRE;
+ cp += 3;
+ } else if (0==strncmp(cp, "rc", 2)) {
+ out->status = VER_RC;
+ cp += 2;
+ } else {
+ return -1;
+ }
+
+ NUMBER(patchlevel);
+
+ status_tag:
+ /* Get status tag. */
+ if (*cp == '-' || *cp == '.')
+ ++cp;
+ eos = (char*) find_whitespace(cp);
+ if (eos-cp >= (int)sizeof(out->status_tag))
+ strlcpy(out->status_tag, cp, sizeof(out->status_tag));
+ else {
+ memcpy(out->status_tag, cp, eos-cp);
+ out->status_tag[eos-cp] = 0;
+ }
+ cp = eat_whitespace(eos);
+
+ if (!strcmpstart(cp, "(r")) {
+ cp += 2;
+ out->svn_revision = (int) strtol(cp,&eos,10);
+ } else if (!strcmpstart(cp, "(git-")) {
+ char *close_paren = strchr(cp, ')');
+ int hexlen;
+ char digest[DIGEST_LEN];
+ if (! close_paren)
+ return -1;
+ cp += 5;
+ if (close_paren-cp > HEX_DIGEST_LEN)
+ return -1;
+ hexlen = (int)(close_paren-cp);
+ memwipe(digest, 0, sizeof(digest));
+ if ( hexlen == 0 || (hexlen % 2) == 1)
+ return -1;
+ if (base16_decode(digest, hexlen/2, cp, hexlen) != hexlen/2)
+ return -1;
+ memcpy(out->git_tag, digest, hexlen/2);
+ out->git_tag_len = hexlen/2;
+ }
+
+ return 0;
+#undef NUMBER
+#undef DOT
+}
+
+/** Compare two tor versions; Return <0 if a < b; 0 if a ==b, >0 if a >
+ * b. */
+int
+tor_version_compare(tor_version_t *a, tor_version_t *b)
+{
+ int i;
+ tor_assert(a);
+ tor_assert(b);
+
+ /* We take this approach to comparison to ensure the same (bogus!) behavior
+ * on all inputs as we would have seen before bug #21278 was fixed. The
+ * only important difference here is that this method doesn't cause
+ * a signed integer underflow.
+ */
+#define CMP(field) do { \
+ unsigned aval = (unsigned) a->field; \
+ unsigned bval = (unsigned) b->field; \
+ int result = (int) (aval - bval); \
+ if (result < 0) \
+ return -1; \
+ else if (result > 0) \
+ return 1; \
+ } while (0)
+
+ CMP(major);
+ CMP(minor);
+ CMP(micro);
+ CMP(status);
+ CMP(patchlevel);
+ if ((i = strcmp(a->status_tag, b->status_tag)))
+ return i;
+ CMP(svn_revision);
+ CMP(git_tag_len);
+ if (a->git_tag_len)
+ return fast_memcmp(a->git_tag, b->git_tag, a->git_tag_len);
+ else
+ return 0;
+
+#undef CMP
+}
+
+/** Return true iff versions <b>a</b> and <b>b</b> belong to the same series.
+ */
+int
+tor_version_same_series(tor_version_t *a, tor_version_t *b)
+{
+ tor_assert(a);
+ tor_assert(b);
+ return ((a->major == b->major) &&
+ (a->minor == b->minor) &&
+ (a->micro == b->micro));
+}
+
+/** Helper: Given pointers to two strings describing tor versions, return -1
+ * if _a precedes _b, 1 if _b precedes _a, and 0 if they are equivalent.
+ * Used to sort a list of versions. */
+static int
+compare_tor_version_str_ptr_(const void **_a, const void **_b)
+{
+ const char *a = *_a, *b = *_b;
+ int ca, cb;
+ tor_version_t va, vb;
+ ca = tor_version_parse(a, &va);
+ cb = tor_version_parse(b, &vb);
+ /* If they both parse, compare them. */
+ if (!ca && !cb)
+ return tor_version_compare(&va,&vb);
+ /* If one parses, it comes first. */
+ if (!ca && cb)
+ return -1;
+ if (ca && !cb)
+ return 1;
+ /* If neither parses, compare strings. Also, the directory server admin
+ ** needs to be smacked upside the head. But Tor is tolerant and gentle. */
+ return strcmp(a,b);
+}
+
+/** Sort a list of string-representations of versions in ascending order. */
+void
+sort_version_list(smartlist_t *versions, int remove_duplicates)
+{
+ smartlist_sort(versions, compare_tor_version_str_ptr_);
+
+ if (remove_duplicates)
+ smartlist_uniq(versions, compare_tor_version_str_ptr_, tor_free_);
+}
diff --git a/src/core/or/versions.h b/src/core/or/versions.h
new file mode 100644
index 000000000..a2353bcae
--- /dev/null
+++ b/src/core/or/versions.h
@@ -0,0 +1,40 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file versions.h
+ * \brief Header file for versions.c.
+ **/
+
+#ifndef TOR_VERSIONS_H
+#define TOR_VERSIONS_H
+
+/** Possible statuses of a version of Tor, given opinions from the directory
+ * servers. */
+typedef enum version_status_t {
+ VS_RECOMMENDED=0, /**< This version is listed as recommended. */
+ VS_OLD=1, /**< This version is older than any recommended version. */
+ VS_NEW=2, /**< This version is newer than any recommended version. */
+ VS_NEW_IN_SERIES=3, /**< This version is newer than any recommended version
+ * in its series, but later recommended versions exist.
+ */
+ VS_UNRECOMMENDED=4, /**< This version is not recommended (general case). */
+ VS_EMPTY=5, /**< The version list was empty; no agreed-on versions. */
+ VS_UNKNOWN, /**< We have no idea. */
+} version_status_t;
+
+version_status_t tor_version_is_obsolete(const char *myversion,
+ const char *versionlist);
+int tor_version_parse_platform(const char *platform,
+ tor_version_t *version_out,
+ int strict);
+int tor_version_as_new_as(const char *platform, const char *cutoff);
+int tor_version_parse(const char *s, tor_version_t *out);
+int tor_version_compare(tor_version_t *a, tor_version_t *b);
+int tor_version_same_series(tor_version_t *a, tor_version_t *b);
+void sort_version_list(smartlist_t *lst, int remove_duplicates);
+
+#endif /* !defined(TOR_VERSIONS_H) */
diff --git a/src/feature/dirparse/routerparse.c b/src/feature/dirparse/routerparse.c
index 83890cdb9..5ff5fdf23 100644
--- a/src/feature/dirparse/routerparse.c
+++ b/src/feature/dirparse/routerparse.c
@@ -108,9 +108,6 @@
#undef log
#include <math.h>
-//#ifdef HAVE_SYS_STAT_H
-//#include <sys/stat.h>
-//#endif
/****************************************************************************/
@@ -586,85 +583,6 @@ router_append_dirobj_signature(char *buf, size_t buf_len, const char *digest,
return 0;
}
-/** Return VS_RECOMMENDED if <b>myversion</b> is contained in
- * <b>versionlist</b>. Else, return VS_EMPTY if versionlist has no
- * entries. Else, return VS_OLD if every member of
- * <b>versionlist</b> is newer than <b>myversion</b>. Else, return
- * VS_NEW_IN_SERIES if there is at least one member of <b>versionlist</b> in
- * the same series (major.minor.micro) as <b>myversion</b>, but no such member
- * is newer than <b>myversion.</b>. Else, return VS_NEW if every member of
- * <b>versionlist</b> is older than <b>myversion</b>. Else, return
- * VS_UNRECOMMENDED.
- *
- * (versionlist is a comma-separated list of version strings,
- * optionally prefixed with "Tor". Versions that can't be parsed are
- * ignored.)
- */
-version_status_t
-tor_version_is_obsolete(const char *myversion, const char *versionlist)
-{
- tor_version_t mine, other;
- int found_newer = 0, found_older = 0, found_newer_in_series = 0,
- found_any_in_series = 0, r, same;
- version_status_t ret = VS_UNRECOMMENDED;
- smartlist_t *version_sl;
-
- log_debug(LD_CONFIG,"Checking whether version '%s' is in '%s'",
- myversion, versionlist);
-
- if (tor_version_parse(myversion, &mine)) {
- log_err(LD_BUG,"I couldn't parse my own version (%s)", myversion);
- tor_assert(0);
- }
- version_sl = smartlist_new();
- smartlist_split_string(version_sl, versionlist, ",", SPLIT_SKIP_SPACE, 0);
-
- if (!strlen(versionlist)) { /* no authorities cared or agreed */
- ret = VS_EMPTY;
- goto done;
- }
-
- SMARTLIST_FOREACH_BEGIN(version_sl, const char *, cp) {
- if (!strcmpstart(cp, "Tor "))
- cp += 4;
-
- if (tor_version_parse(cp, &other)) {
- /* Couldn't parse other; it can't be a match. */
- } else {
- same = tor_version_same_series(&mine, &other);
- if (same)
- found_any_in_series = 1;
- r = tor_version_compare(&mine, &other);
- if (r==0) {
- ret = VS_RECOMMENDED;
- goto done;
- } else if (r<0) {
- found_newer = 1;
- if (same)
- found_newer_in_series = 1;
- } else if (r>0) {
- found_older = 1;
- }
- }
- } SMARTLIST_FOREACH_END(cp);
-
- /* We didn't find the listed version. Is it new or old? */
- if (found_any_in_series && !found_newer_in_series && found_newer) {
- ret = VS_NEW_IN_SERIES;
- } else if (found_newer && !found_older) {
- ret = VS_OLD;
- } else if (found_older && !found_newer) {
- ret = VS_NEW;
- } else {
- ret = VS_UNRECOMMENDED;
- }
-
- done:
- SMARTLIST_FOREACH(version_sl, char *, version, tor_free(version));
- smartlist_free(version_sl);
- return ret;
-}
-
MOCK_IMPL(STATIC int,
signed_digest_equals, (const uint8_t *d1, const uint8_t *d2, size_t len))
{
@@ -4276,288 +4194,6 @@ microdescs_parse_from_string(const char *s, const char *eos,
return result;
}
-/** Extract a Tor version from a <b>platform</b> line from a router
- * descriptor, and place the result in <b>router_version</b>.
- *
- * Return 1 on success, -1 on parsing failure, and 0 if the
- * platform line does not indicate some version of Tor.
- *
- * If <b>strict</b> is non-zero, finding any weird version components
- * (like negative numbers) counts as a parsing failure.
- */
-int
-tor_version_parse_platform(const char *platform,
- tor_version_t *router_version,
- int strict)
-{
- char tmp[128];
- char *s, *s2, *start;
-
- if (strcmpstart(platform,"Tor ")) /* nonstandard Tor; say 0. */
- return 0;
-
- start = (char *)eat_whitespace(platform+3);
- if (!*start) return -1;
- s = (char *)find_whitespace(start); /* also finds '\0', which is fine */
- s2 = (char*)eat_whitespace(s);
- if (!strcmpstart(s2, "(r") || !strcmpstart(s2, "(git-"))
- s = (char*)find_whitespace(s2);
-
- if ((size_t)(s-start+1) >= sizeof(tmp)) /* too big, no */
- return -1;
- strlcpy(tmp, start, s-start+1);
-
- if (tor_version_parse(tmp, router_version)<0) {
- log_info(LD_DIR,"Router version '%s' unparseable.",tmp);
- return -1;
- }
-
- if (strict) {
- if (router_version->major < 0 ||
- router_version->minor < 0 ||
- router_version->micro < 0 ||
- router_version->patchlevel < 0 ||
- router_version->svn_revision < 0) {
- return -1;
- }
- }
-
- return 1;
-}
-
-/** Parse the Tor version of the platform string <b>platform</b>,
- * and compare it to the version in <b>cutoff</b>. Return 1 if
- * the router is at least as new as the cutoff, else return 0.
- */
-int
-tor_version_as_new_as(const char *platform, const char *cutoff)
-{
- tor_version_t cutoff_version, router_version;
- int r;
- tor_assert(platform);
-
- if (tor_version_parse(cutoff, &cutoff_version)<0) {
- log_warn(LD_BUG,"cutoff version '%s' unparseable.",cutoff);
- return 0;
- }
-
- r = tor_version_parse_platform(platform, &router_version, 0);
- if (r == 0) {
- /* nonstandard Tor; be safe and say yes */
- return 1;
- } else if (r < 0) {
- /* unparseable version; be safe and say yes. */
- return 1;
- }
-
- /* Here's why we don't need to do any special handling for svn revisions:
- * - If neither has an svn revision, we're fine.
- * - If the router doesn't have an svn revision, we can't assume that it
- * is "at least" any svn revision, so we need to return 0.
- * - If the target version doesn't have an svn revision, any svn revision
- * (or none at all) is good enough, so return 1.
- * - If both target and router have an svn revision, we compare them.
- */
-
- return tor_version_compare(&router_version, &cutoff_version) >= 0;
-}
-
-/** Parse a tor version from <b>s</b>, and store the result in <b>out</b>.
- * Return 0 on success, -1 on failure. */
-int
-tor_version_parse(const char *s, tor_version_t *out)
-{
- char *eos=NULL;
- const char *cp=NULL;
- int ok = 1;
- /* Format is:
- * "Tor " ? NUM dot NUM [ dot NUM [ ( pre | rc | dot ) NUM ] ] [ - tag ]
- */
- tor_assert(s);
- tor_assert(out);
-
- memset(out, 0, sizeof(tor_version_t));
- out->status = VER_RELEASE;
- if (!strcasecmpstart(s, "Tor "))
- s += 4;
-
- cp = s;
-
-#define NUMBER(m) \
- do { \
- if (!cp || *cp < '0' || *cp > '9') \
- return -1; \
- out->m = (int)tor_parse_uint64(cp, 10, 0, INT32_MAX, &ok, &eos); \
- if (!ok) \
- return -1; \
- if (!eos || eos == cp) \
- return -1; \
- cp = eos; \
- } while (0)
-
-#define DOT() \
- do { \
- if (*cp != '.') \
- return -1; \
- ++cp; \
- } while (0)
-
- NUMBER(major);
- DOT();
- NUMBER(minor);
- if (*cp == 0)
- return 0;
- else if (*cp == '-')
- goto status_tag;
- DOT();
- NUMBER(micro);
-
- /* Get status */
- if (*cp == 0) {
- return 0;
- } else if (*cp == '.') {
- ++cp;
- } else if (*cp == '-') {
- goto status_tag;
- } else if (0==strncmp(cp, "pre", 3)) {
- out->status = VER_PRE;
- cp += 3;
- } else if (0==strncmp(cp, "rc", 2)) {
- out->status = VER_RC;
- cp += 2;
- } else {
- return -1;
- }
-
- NUMBER(patchlevel);
-
- status_tag:
- /* Get status tag. */
- if (*cp == '-' || *cp == '.')
- ++cp;
- eos = (char*) find_whitespace(cp);
- if (eos-cp >= (int)sizeof(out->status_tag))
- strlcpy(out->status_tag, cp, sizeof(out->status_tag));
- else {
- memcpy(out->status_tag, cp, eos-cp);
- out->status_tag[eos-cp] = 0;
- }
- cp = eat_whitespace(eos);
-
- if (!strcmpstart(cp, "(r")) {
- cp += 2;
- out->svn_revision = (int) strtol(cp,&eos,10);
- } else if (!strcmpstart(cp, "(git-")) {
- char *close_paren = strchr(cp, ')');
- int hexlen;
- char digest[DIGEST_LEN];
- if (! close_paren)
- return -1;
- cp += 5;
- if (close_paren-cp > HEX_DIGEST_LEN)
- return -1;
- hexlen = (int)(close_paren-cp);
- memwipe(digest, 0, sizeof(digest));
- if ( hexlen == 0 || (hexlen % 2) == 1)
- return -1;
- if (base16_decode(digest, hexlen/2, cp, hexlen) != hexlen/2)
- return -1;
- memcpy(out->git_tag, digest, hexlen/2);
- out->git_tag_len = hexlen/2;
- }
-
- return 0;
-#undef NUMBER
-#undef DOT
-}
-
-/** Compare two tor versions; Return <0 if a < b; 0 if a ==b, >0 if a >
- * b. */
-int
-tor_version_compare(tor_version_t *a, tor_version_t *b)
-{
- int i;
- tor_assert(a);
- tor_assert(b);
-
- /* We take this approach to comparison to ensure the same (bogus!) behavior
- * on all inputs as we would have seen before bug #21278 was fixed. The
- * only important difference here is that this method doesn't cause
- * a signed integer underflow.
- */
-#define CMP(field) do { \
- unsigned aval = (unsigned) a->field; \
- unsigned bval = (unsigned) b->field; \
- int result = (int) (aval - bval); \
- if (result < 0) \
- return -1; \
- else if (result > 0) \
- return 1; \
- } while (0)
-
- CMP(major);
- CMP(minor);
- CMP(micro);
- CMP(status);
- CMP(patchlevel);
- if ((i = strcmp(a->status_tag, b->status_tag)))
- return i;
- CMP(svn_revision);
- CMP(git_tag_len);
- if (a->git_tag_len)
- return fast_memcmp(a->git_tag, b->git_tag, a->git_tag_len);
- else
- return 0;
-
-#undef CMP
-}
-
-/** Return true iff versions <b>a</b> and <b>b</b> belong to the same series.
- */
-int
-tor_version_same_series(tor_version_t *a, tor_version_t *b)
-{
- tor_assert(a);
- tor_assert(b);
- return ((a->major == b->major) &&
- (a->minor == b->minor) &&
- (a->micro == b->micro));
-}
-
-/** Helper: Given pointers to two strings describing tor versions, return -1
- * if _a precedes _b, 1 if _b precedes _a, and 0 if they are equivalent.
- * Used to sort a list of versions. */
-static int
-compare_tor_version_str_ptr_(const void **_a, const void **_b)
-{
- const char *a = *_a, *b = *_b;
- int ca, cb;
- tor_version_t va, vb;
- ca = tor_version_parse(a, &va);
- cb = tor_version_parse(b, &vb);
- /* If they both parse, compare them. */
- if (!ca && !cb)
- return tor_version_compare(&va,&vb);
- /* If one parses, it comes first. */
- if (!ca && cb)
- return -1;
- if (ca && !cb)
- return 1;
- /* If neither parses, compare strings. Also, the directory server admin
- ** needs to be smacked upside the head. But Tor is tolerant and gentle. */
- return strcmp(a,b);
-}
-
-/** Sort a list of string-representations of versions in ascending order. */
-void
-sort_version_list(smartlist_t *versions, int remove_duplicates)
-{
- smartlist_sort(versions, compare_tor_version_str_ptr_);
-
- if (remove_duplicates)
- smartlist_uniq(versions, compare_tor_version_str_ptr_, tor_free_);
-}
-
/** Parse and validate the ASCII-encoded v2 descriptor in <b>desc</b>,
* write the parsed descriptor to the newly allocated *<b>parsed_out</b>, the
* binary descriptor ID of length DIGEST_LEN to <b>desc_id_out</b>, the
diff --git a/src/feature/dirparse/routerparse.h b/src/feature/dirparse/routerparse.h
index 51d39c617..6f1af4016 100644
--- a/src/feature/dirparse/routerparse.h
+++ b/src/feature/dirparse/routerparse.h
@@ -12,19 +12,7 @@
#ifndef TOR_ROUTERPARSE_H
#define TOR_ROUTERPARSE_H
-/** Possible statuses of a version of Tor, given opinions from the directory
- * servers. */
-typedef enum version_status_t {
- VS_RECOMMENDED=0, /**< This version is listed as recommended. */
- VS_OLD=1, /**< This version is older than any recommended version. */
- VS_NEW=2, /**< This version is newer than any recommended version. */
- VS_NEW_IN_SERIES=3, /**< This version is newer than any recommended version
- * in its series, but later recommended versions exist.
- */
- VS_UNRECOMMENDED=4, /**< This version is not recommended (general case). */
- VS_EMPTY=5, /**< The version list was empty; no agreed-on versions. */
- VS_UNKNOWN, /**< We have no idea. */
-} version_status_t;
+#include "core/or/versions.h"
enum networkstatus_type_t;
@@ -65,16 +53,7 @@ extrainfo_t *extrainfo_parse_entry_from_string(const char *s, const char *end,
int *can_dl_again_out);
MOCK_DECL(addr_policy_t *, router_parse_addr_policy_item_from_string,
(const char *s, int assume_action, int *malformed_list));
-version_status_t tor_version_is_obsolete(const char *myversion,
- const char *versionlist);
-int tor_version_parse_platform(const char *platform,
- tor_version_t *version_out,
- int strict);
-int tor_version_as_new_as(const char *platform, const char *cutoff);
-int tor_version_parse(const char *s, tor_version_t *out);
-int tor_version_compare(tor_version_t *a, tor_version_t *b);
-int tor_version_same_series(tor_version_t *a, tor_version_t *b);
-void sort_version_list(smartlist_t *lst, int remove_duplicates);
+
void assert_addr_policy_ok(smartlist_t *t);
void dump_distinct_digest_count(int severity);
1
0