From thomass at seul.org Wed Jun 1 15:58:12 2005 From: thomass at seul.org (thomass at seul.org) Date: Wed, 1 Jun 2005 11:58:12 -0400 (EDT) Subject: [or-cvs] Add the rest of pages translated to German. Message-ID: <20050601155812.B32491408039@moria.seul.org> Update of /home2/or/cvsroot/website/de In directory moria:/tmp/cvs-serv9530 Modified Files: index.de.html Added Files: developers.de.html overview.de.html people.de.html research.de.html Log Message: Add the rest of pages translated to German. --- NEW FILE: developers.de.html --- Tor: Entwickler

Tor: Entwickler


Bl?ttere durch das CVS Repositorium von Tor: (das muss nicht notwendigerweise funktionieren oder kompilieren)

Lies den F?hrer zum Quellcode von Tor f?r einen ?berblick der verschiedenen Dateien und Komponenten des Systems.

Liste von Sachen, die noch von den Entwicklern erledigt werden m?ssen.

Das Java Anon Proxy (JAP) Projekt hat das Torclientprotokoll in ihren Client implementiert. Mehr dazu folgt sp?ter.

Webmaster - $Id: developers.de.html,v 1.1 2005/06/01 15:58:10 thomass Exp $
Index: index.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/index.de.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- index.de.html 26 May 2005 12:07:10 -0000 1.3 +++ index.de.html 1 Jun 2005 15:58:10 -0000 1.4 @@ -7,7 +7,7 @@ Tor: An anonymous Internet communication system - + --- NEW FILE: overview.de.html --- Tor: Übersicht

Tor: ?bersicht


Tor ist ein Netzwerk virtueller Tunnel, das es Menschen und Gruppen erm?glicht, den Schutz ihrer Privatsph?re und ihre Sicherheit im Internet zu verbessern. Es erm?glicht au?erdem Softwareentwicklern, neue Kommunikationswerkzeuge zu entwickeln, die Privacy bereits eingebaut haben. Tor stellt die Grundlage f?r eine Reihe von Anwendungen zur Verf?gung, die es Organisationen und Individuen erlaubt, Informationen ?ber ?ffentliche Netze auszutauschen, ohne ihre Privatsph?re zu gef?hrden.

Individuen k?nnen Tor verwenden, um andere Webseiten daran zu hindern, den Weg, den sie und ihre Familienmitglieder nehmen, aufzuzeichnen. Weiterhin k?nnen sie es dazu verwenden, um sich zu anderen Seiten oder Instant-Messaging-Services zu verbinden, die von ihrem ISP gesperrt wurden.

Gruppen wie die deutsche Diabetes People empfehlen ihren Mitgliedern Tor f?r ihre Sicherheit und die Absicherung ihrer Privatsph?re. Gruppen wie die Electronic Frontier Foundation (EFF) unterst?tzen die Entwicklung von Tor, um b?rgerliche Freiheitsrechte online aufrecht zu erhalten. Firmen untersuchen Tor daraufhin, ob mit ihm sichere Wettbewerbsanalysen m?glich sind. Weiterhin ?berlegen sie, Tor zu verwenden, um neue und experimentelle Projekte zu testen, ohne ihren Namen mit diesen zu verbinden. Ein Zweig der US-Marine verwendet die Software, um Informationen aus offenen Quellen zu gewinnen. Eines ihrer Teams verwendete Tor, als es neulich im Nahen Osten eingesetzt war.

Die Vielfalt der Tornutzer, ist ein Teil von dem, was Tor so sicher macht. Tor versteckt dich in der Menge der anderen Benutzer des Netzwerks. Damit ist deine Anonymit?t um so st?rker gesch?tzt, je gr??er und differenzierter die Benutzerbasis von Tor ist.

Warum wir Tor brauchen

Die Nutzung von Tor sch?tzt gegen eine ?bliche Form der Internet?berwachung, die als Analyse des Netzverkehrs bekannt ist. Die Analyse kann dazu verwendet werden, Informationen abzuleiten, wer mit wem ?ber ein ?ffentliches Netzwerk kommuniziert. Wenn jemand Quelle und Ziel deines Internetverkehrs kennt, kann er dein Verhalten und deine Vorlieben nachvollziehen. Das kann sich auf deinen Geldbeutel auswirken, indem z.B. eine E-Commerce-Seite ihre Preise vom Herkunftsland und deiner Firma abh?ngig macht. Es kann sogar deinen Arbeitsplatz und k?rperliche Unversehrtheit bedrohen, wenn ?ffentlich wird, wer du bist und wo du wohnst. Wenn du dich beispielsweise im Ausland auf Dienstreise befindest und dich mit dem Computer deines Arbeitgebers verbindest, kannst du ungewollt deine Nationalit?t und Ihren Arbeitgeber jedem gegen?ber offenbaren, der das Netzwerk beobachtet, auch wenn die Verbindung verschl?sselt ist.

Wie funktioniert nun die Analyse des Netzverkehrs? Die Datenpakete haben zwei Teile: die Nutzlast, die die eigentlichen Daten tr?gt und der Kopf, wo verschiedene Informationen zum Routing zu finden sind. Auch wenn du die Nutzlast verschl?sselst, enth?llt diese Art der Analyse noch, was du tust und eventuell auch, was du sagst. Dies geschieht deshalb, da sie sich auf die Kopfdaten fokussiert, die die Quelle, Ziel, Gr??e etc. enthalten.

Ein grundlegendes Problem f?r jemanden, der am Schutz seiner Privatsph?re interessiert ist, ist das der Empf?nger an den Kopfdaten sehen kann, dass du die Daten versandt hast. So k?nnen es auch authorisierte Vermittler, wie ISPs, und manchmal auch unauthorisierte tun. Eine sehr einfache Form der Verkehrsanalyse ist es, irgendwo zwischen dem Sender und Empf?nger zu sitzen und die Kopfdaten zu verfolgen.

Nat?rlich existieren auch m?chtigere Formen der Verkehrsanalyse. Einige Angreifer spionieren in verschiedenen Teilen des Internets und nutzen fortgeschrittene statistische Methoden, um die Kommunikationsmuster von verschiedenen Organisationen und Menschen zu verfolgen. Verschl?sselung hilft nicht gegen diese Angreifer. Denn es verbirgt nur den Inhalt der Kommunikation und nicht die Kopfdaten.

Die L?sung: ein verteiltes, anonymes Netzwerk

Tor hilft dabei, das Risiko sowohl der einfachen als auch der ausgefeilten Verkehrsanalyse zu verringern, indem es deine Transaktion ?ber verschiedene Stellen des Internet verteilt. Damit gibt es keinen einzelnen Punkt gibt, an dem du mit der Kommunikation in Verbindung gebracht werden k?nntest. Die Idee l?sst sich damit vergleichen, eine verwinkelte, schwer zu verfolgende Route zu benutzen, um einen Verfolger abzusch?tteln — und au?erdem regelm??ig Fu?abdr?cke zu verwischen. Anstatt einen direkten Weg vom Ausgangspunkt zum Ziel zu nehmen, verwenden Datenpakete im Tornetzwerk einen zuf?lligen Pfad ?ber mehrere Server. Diese verwischen ihre Spuren und an keiner Stelle kann ein Beobachter sagen, woher ein Datenpaket kam und wohin es unterwegs ist.

Tor circuit step one Tor circuit step two

Um einen privaten Netzwerkpfad mit Tor zu erzeugen, baut die Software des Benutzers oder Clients inkrementell eine Menge an verschl?sselten Verbindungen zu den Servern im Netzwerk auf. Dieser Kreis wird um jeweils einen Schritt erweitert und jeder Server entlang des Wegs wei? nur, von welchem Server er Daten bekam und zu welchem er sie weitergibt. Kein einzelner Server kennt jemals den gesamten Pfad, den ein Datenpaket genommen hat. Der Client handelt f?r jeden Schritt entlang des Pfads einen eigenen Satz von Verschl?sselungsschl?sseln aus und stellt damit sicher, dass kein Server die Verbindungen nachvollziehen kann, w?hrend sie bei ihm vorbeikommen.

Tor circuit step three

Sobald ein Kanal er?ffnet ist, k?nnen unterschiedliche Datenarten ?ber ihn ausgetauscht und unterschiedliche Arten von Anwendungen k?nnen mit einem Tornetzwerk verwendet werden. Da jeder Server nur einen Schritt kennt, kann weder ein Lauscher noch ein kompromittierter Server Verkehrsanalyse verwenden, um die Quelle einer Kommunikation mit ihrem Ziel zu verbinden. Tor funktioniert nur ?ber TCP-Streams und kann mit jeder Anwendung verwendet werden, die SOCKS unterst?tzt.

Aus Effizienzgr?nden verwendet die Tor-Software den selben Kanal f?r alle Verbindungen, die innerhalb etwa einer Minute aufgebaut werden. Sp?tere Anforderungen erhalten einen neuen Kanal, damit niemand Ihre fr?heren Handlungen mit Ihren neuen in Verbindung bringen kann.

Tor circuit step four

Versteckte Dienste

Tor erm?glicht es Benutzern, ihren Aufenthaltsort zu verbergen, w?hrend sie verschiedene Dienste wie z.B. Ver?ffentlichungen im Web oder Instant-Messaging verwenden. Durch die Verwendung von Tor "Rendezvouspunkten" k?nnen andere Tor-Benutzer auf diese versteckten Dienste zugreifen, ohne dabei die Netzwerkidentit?t des Anderen zu kennen. Die Funktionalit?t dieser versteckten Dienste kann es Torbenutzern erm?glichen, eine Webseite einzurichten, auf der Menschen ohne Angst vor Zensur Material ver?ffentlichen k?nnen. Niemand w?re in der Lage festzustellen, wer die Webseite anbietet und niemand, der die Webseite anbietet w?sste, wer auf ihr was ver?ffentlicht.

Anonym bleiben

Tor kann nicht alle Anonymit?tsprobleme l?sen. Es konzentriert sich darauf, den Transport von Daten zu sch?tzen. Du musst protokollspezifische Software verwenden, wenn du nicht m?chtest, dass die von dir besuchten Seiten, Informationen ?ber deine Identit?t erhalten. Beispielsweise kannst du einen Webproxy wie Privoxy verwenden, um Cookies und die Herausgabe von Informationen ?ber Ihren Browsertyp zu blockieren.

Sei clever, wenn du deine Anonymit?t sch?tzen mchtest. Gib weder deinen Namen noch andere Informationen ?ber dich in Formularen an. Sei dir der Tatsache bewusst, dass Tor, wie jedes Anonymisiergsnetzwerk, das schnell genug f?r das Webbrowsing ist, nicht gegen Ende-zu-Ende-Timing-Angriffe sch?tzt: wenn der Angreifer den von Ihrem Computer ausgehenden Verkehr und auch den an Ihrem gew?hlten Ziel ankommenden Verkehr beobachten kann, kann er statistische Analysen verwenden um zu erkennen, dass beide Teil desselben Endes sind.

Die Zukunft von Tor

Heute ein dauerhaftes Anonymisierungsnetzwerk im Internet anzubieten ist eine andauernde Herausforderung. Wir wollen Software, die den Bed?rfnissen der Benutzer entspricht. Wir wollen auch das Netzwerk auf eine Art in Betrieb halten, die so viele Benutzer wie m?glich vertr?gt. Sicherheit und Benutzerfreundlichkeit m?ssen keine Gegens?tze sein: w?hrend Tors Benutzerfreundlichkeit steigt, wird es mehr Benutzer anziehen, die die Zahl der m?glichen Quellen und Ziele f?r jede Kommunikation erh?hen und damit die Sicherheit f?r jeden verbessern. Wir machen Fortschritte, aber wir ben?tigen Ihre Hilfe. Bitte ?berlegen Sie, ob Sie einen Server installieren oder ob Sie freiwillig als Entwickler einen Beitrag leisten m?chten.

Andauernde Trends in Gesetzgebung, Politik und Technologie bedrohen Anonymit?t wie niemals zuvor und sie untergraben unsere M?glichkeiten, frei online zu sprechen und zu lesen. Diese Trends untergraben auch die nationale Sicherheit und kritische Infrastruktur, indem sie die Kommunikation zwischen Individuen, Organisationen, Firmen und Regierungen angreifbarer f?r Spionage machen. Jeder neue Torbenutzer und -server liefert zus?tzliche Verschiedenheit und erh?ht damit Tors F?higkeit, die Kontrolle ?ber Ihre Sicherheit und Ihre Privatsph?re wieder in Ihre H?nde zu legen.

Webmaster - $Id: overview.de.html,v 1.1 2005/06/01 15:58:10 thomass Exp $
--- NEW FILE: people.de.html --- Tor: Menschen

Tor: Menschen


Tor wird vom The Free Haven Project als ein Baustein f?r einen robusten und zensurfreien Datenhafen verwaltet. Es wird Roger Dingledine und Nick Mathewson mit Hilfe von vielen Freiwilligen aus dem Internet entwickelt.

In der ersten Zeit von 2002 bis 2004 wurde Tor durch das Naval Research Lab, vertreten durch Paul Syverson und basierend auf der originalen Idee des Onionrouting entwickelt.

Seit November 2004 wird die Entwicklung durch die Electronic Frontier Foundation unterst?tzt.

Webmaster - $Id: people.de.html,v 1.1 2005/06/01 15:58:10 thomass Exp $
--- NEW FILE: research.de.html --- Tor: Forschung

Tor: Forschung


Lies diese Ver?ffentlichungen (speziell die in den K?sten) um mit anonymen Kommunikationssystemen vertraut zu werden.

Wir brauchen Leute, um das System zu attackieren, und Verteidigungen zu quantifizieren. Schaue dir auch den Abschnitt Sicherheitsaufgaben die Seite Zum Projekte beitragen an.

Webmaster - $Id: research.de.html,v 1.1 2005/06/01 15:58:10 thomass Exp $
From nickm at seul.org Sun Jun 5 14:28:49 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 5 Jun 2005 10:28:49 -0400 (EDT) Subject: [or-cvs] Fix buffer overlow when checking hashed passwords Message-ID: <20050605142849.399A214081C6@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv10878/src/or Modified Files: control.c Log Message: Fix buffer overlow when checking hashed passwords Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- control.c 23 May 2005 02:31:53 -0000 1.83 +++ control.c 5 Jun 2005 14:28:47 -0000 1.84 @@ -481,7 +481,7 @@ } } if (buf) - memcpy(buf, decoded, sizeof(decoded)); + memcpy(buf, decoded, S2K_SPECIFIER_LEN+DIGEST_LEN); return 0; } From phobos at seul.org Thu Jun 9 01:59:50 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 8 Jun 2005 21:59:50 -0400 (EDT) Subject: [or-cvs] modified task - find 10 dirservers Message-ID: <20050609015950.3FEFB140809B@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv20553 Modified Files: TODO Log Message: modified task - find 10 dirservers Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.312 retrieving revision 1.313 diff -u -d -r1.312 -r1.313 --- TODO 9 Jun 2005 01:57:11 -0000 1.312 +++ TODO 9 Jun 2005 01:59:48 -0000 1.313 @@ -39,7 +39,7 @@ - continue decentralizing the directory M have two router descriptor formats - dirservers verify reachability claims - - find 10 dirservers. + - find 10 dirservers. (what are criteria to be a dirserver?) - some back-out mechanism? - dirservers have blacklist of IPs they hate - a way of rolling back approvals to before a timestamp From phobos at seul.org Thu Jun 9 02:14:34 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 8 Jun 2005 22:14:34 -0400 (EDT) Subject: [or-cvs] tor-doc-win32.html: Changed win32 to "MS Windows" so more n... Message-ID: <20050609021434.B0C32140806C@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv20940 Modified Files: tor-doc-osx.html tor-doc-win32.html Log Message: tor-doc-win32.html: Changed win32 to "MS Windows" so more non-technical people will understand it. tor-doc-osx.html: Changed instructions to match screenshots (localhost vs. 127.0.0.1) Index: tor-doc-osx.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-osx.html,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- tor-doc-osx.html 6 Jun 2005 14:54:19 -0000 1.28 +++ tor-doc-osx.html 9 Jun 2005 02:14:32 -0000 1.29 @@ -22,7 +22,7 @@ server" section at tor-doc.html.

-This document was updated May 23 2005. +This document was updated June 08 2005.

The latest beta release of Tor for Macintosh OS X is -

Select and enter localhost and port 8118 for both Web Proxy (HTTP) -and your Secure Web Proxy (HTTPS)

+

Select and enter 127.0.0.1 and port 8118 for both Web Proxy (HTTP) +and your Secure Web Proxy (HTTPS). Leave your Use Passive FTP Mode (PASV) setting as is.

Using privoxy is necessary because browsers Index: tor-doc-win32.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-win32.html,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- tor-doc-win32.html 6 Jun 2005 14:54:19 -0000 1.44 +++ tor-doc-win32.html 9 Jun 2005 02:14:32 -0000 1.45 @@ -2,7 +2,7 @@ -Tor Win32 Install Instructions +Tor MS Windows Install Instructions @@ -11,12 +11,12 @@ -

Running the Tor client on Win32

+

Running the Tor client on MS Windows

Step One: Download and Install Tor

-Note that these are the installation instructions for running a client on Win32. +Note that these are the installation instructions for running a client on MS Windows (2000, XP, Server) If you want to run a server (please do), read the "Configuring a server" section at tor-doc.html.

@@ -24,7 +24,7 @@ This document was updated May 23 2005.

-The latest beta release of Tor for Windows 32 is +The latest beta release of Tor for MS Windows is 0.1.0.8-rc. Download it by clicking the link. You may be able to find experimental versions here, if you're looking for @@ -72,7 +72,7 @@

After installing Tor, you need to configure your applications to use it. The first step is to set up web browsing. Start by installing Privoxy (click on 'recent releases', -then scroll down to the Win32 installer packages). Privoxy is a filtering +then scroll down to the MS Windows installer packages). Privoxy is a filtering web proxy that integrates well with Tor. Once it's installed, it should appear in your system tray as a "P" in a circle, as pictured below:

From arma at seul.org Thu Jun 9 03:57:56 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 8 Jun 2005 23:57:56 -0400 (EDT) Subject: [or-cvs] fix another underflow in keeping stats Message-ID: <20050609035756.3C995140820B@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: buffers.c Log Message: fix another underflow in keeping stats these size_ts are subtle buggers Index: buffers.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/buffers.c,v retrieving revision 1.156 retrieving revision 1.157 diff -u -d -r1.156 -r1.157 --- buffers.c 8 Jun 2005 21:55:02 -0000 1.156 +++ buffers.c 9 Jun 2005 03:57:54 -0000 1.157 @@ -188,7 +188,8 @@ SET_GUARDS(buf->mem, new_capacity); buf->cur = buf->mem+offset; } - buf_total_alloc += (new_capacity - buf->len); + buf_total_alloc += new_capacity; + buf_total_alloc -= buf->len; if (offset + buf->datalen > buf->len) { /* We need to move data now that we are done growing. The buffer @@ -673,7 +674,8 @@ } if (buf->datalen > buf->highwater) buf->highwater = buf->datalen; - log_fn(LOG_DEBUG,"added %d bytes to buf (now %d total).",(int)string_len, (int)buf->datalen); + log_fn(LOG_DEBUG,"added %d bytes to buf (now %d total).", + (int)string_len, (int)buf->datalen); check(); return buf->datalen; } From arma at seul.org Thu Jun 9 04:06:54 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 00:06:54 -0400 (EDT) Subject: [or-cvs] forward-port the 0.1.0.9 changelog Message-ID: <20050609040654.9D858140820B@moria.seul.org> Update of /home2/or/cvsroot/tor In directory moria:/home/arma/work/onion/cvs/tor Modified Files: ChangeLog Log Message: forward-port the 0.1.0.9 changelog Index: ChangeLog =================================================================== RCS file: /home2/or/cvsroot/tor/ChangeLog,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- ChangeLog 23 May 2005 06:59:01 -0000 1.93 +++ ChangeLog 9 Jun 2005 04:06:52 -0000 1.94 @@ -1,252 +1,248 @@ -Changes in version 0.1.0.8-rc - 2005-05-23 - o Bugfixes: - - It turns out that kqueue on OS X 10.3.9 was causing kernel - panics. Disable kqueue on all OS X Tors. - - Fix RPM: remove duplicate line accidentally added to the rpm - spec file. - - Disable threads on openbsd too, since its gethostaddr is not - reentrant either. - - Tolerate libevent 0.8 since it still works, even though it's - ancient. - - Enable building on Red Hat 9.0 again. - - Allow the middle hop of the testing circuit to be running any - version, now that most of them have the bugfix to let them connect - to unknown servers. This will allow reachability testing to work - even when 0.0.9.7-0.0.9.9 become obsolete. - - Handle relay cells with rh.length too large. This prevents - a potential attack that could read arbitrary memory (maybe even - keys) from the exit server's process. - - We screwed up the dirport reachability testing when we don't yet - have a cached version of the directory. Hopefully now fixed. - - Clean up router_load_single_router() (used by the controller), - so it doesn't seg fault on error. - - Fix a minor memory leak when somebody establishes an introduction - point at your Tor server. - - If a socks connection ends because read fails, don't warn that - you're not sending a socks reply back. - - o Features: - - Add HttpProxyAuthenticator config option too, that works like - the HttpsProxyAuthenticator config option. - - Encode hashed controller passwords in hex instead of base64, - to make it easier to write controllers. - +Changes in version 0.1.0.9 (first stable release of 0.1.0.x) + o Fixes on Win32: + - Make NT services work and start on startup on Win32 (based on + patch by Matt Edman). See the FAQ entry for details. + - Make 'platform' string in descriptor more accurate for Win32 + servers, so it's not just "unknown platform". + - REUSEADDR on normal platforms means you can rebind to the port + right after somebody else has let it go. But REUSEADDR on Win32 + means you can bind to the port _even when somebody else already + has it bound_! So, don't do that on Win32. + - Clean up the log messages when starting on Win32 with no config + file. -Changes in version 0.1.0.7-rc - 2005-05-17 - o Bugfixes: - - Fix a bug in the OS X package installer that prevented it from - installing on Tiger. - - Fix a script bug in the OS X package installer that made it - complain during installation. - - Find libevent even if it's hiding in /usr/local/ and your - CFLAGS and LDFLAGS don't tell you to look there. - - Be able to link with libevent as a shared library (the default - after 1.0d), even if it's hiding in /usr/local/lib and even - if you haven't added /usr/local/lib to your /etc/ld.so.conf, - assuming you're running gcc. Otherwise fail and give a useful - error message. - - Fix a bug in the RPM packager: set home directory for _tor to - something more reasonable when first installing. - - Free a minor amount of memory that is still reachable on exit. + o Assert / crash bugs: + - Refuse relay cells that claim to have a length larger than the + maximum allowed. This prevents a potential attack that could read + arbitrary memory (e.g. keys) from an exit server's process. + - If unofficial Tor clients connect and send weird TLS certs, our + Tor server triggers an assert. Stop asserting, and start handling + TLS errors better in other situations too. + - Fix a race condition that can trigger an assert when we have a + pending create cell and an OR connection attempt fails. + o Resource leaks: + - Use pthreads for worker processes rather than forking. This was + forced because when we forked, we ended up wasting a lot of + duplicate ram over time. + - Also switch to foo_r versions of some library calls to allow + reentry and threadsafeness. + - Implement --disable-threads configure option. Disable threads on + netbsd and openbsd by default, because they have no reentrant + resolver functions (!). + - Fix possible bug on threading platforms (e.g. win32) which was + leaking a file descriptor whenever a cpuworker or dnsworker died. + - Fix a minor memory leak when somebody establishes an introduction + point at your Tor server. + - Add ./configure --with-dmalloc option, to track memory leaks. + - And try to free all memory on closing, so we can detect what + we're leaking. -Changes in version 0.1.0.6-rc - 2005-05-14 - o Bugfixes: - - Implement --disable-threads configure option. Disable threads on - netbsd by default, because it appears to have no reentrant resolver - functions. - - Apple's OS X 10.4.0 ships with a broken kqueue. The new libevent - release (1.1) detects and disables kqueue if it's broken. - - Append default exit policy before checking for implicit internal - addresses. Now we don't log a bunch of complaints on startup - when using the default exit policy. - - Some people were putting "Address " in their torrc, and they had - a buggy resolver that resolved " " to 0.0.0.0. Oops. - - If DataDir is ~/.tor, and that expands to /.tor, then default to - LOCALSTATEDIR/tor instead. - - Fix fragmented-message bug in TorControl.py. - - Resolve a minor bug which would prevent unreachable dirports - from getting suppressed in the published descriptor. - - When the controller gave us a new descriptor, we weren't resolving - it immediately, so Tor would think its address was 0.0.0.0 until - we fetched a new directory. - - Fix an uppercase/lowercase case error in suppressing a bogus - libevent warning on some Linuxes. + o Protocol correctness: + - When we've connected to an OR and handshaked but didn't like + the result, we were closing the conn without sending destroy + cells back for pending circuits. Now send those destroys. + - Start sending 'truncated' cells back rather than destroy cells + if the circuit closes in front of you. This means we won't have + to abandon partially built circuits. + - Handle changed router status correctly when dirserver reloads + fingerprint file. We used to be dropping all unverified descriptors + right then. The bug was hidden because we would immediately + fetch a directory from another dirserver, which would include the + descriptors we just dropped. + - Revise tor-spec to add more/better stream end reasons. + - Revise all calls to connection_edge_end to avoid sending 'misc', + and to take errno into account where possible. + - Client now retries when streams end early for 'hibernating' or + 'resource limit' reasons, rather than failing them. + - Try to be more zealous about calling connection_edge_end when + things go bad with edge conns in connection.c. - o Features: - - Begin scrubbing sensitive strings from logs by default. Turn off - the config option SafeLogging if you need to do debugging. - - Switch to a new buffer management algorithm, which tries to avoid - reallocing and copying quite as much. In first tests it looks like - it uses *more* memory on average, but less cpu. + o Robustness improvements: + - Better handling for heterogeneous / unreliable nodes: + - Annotate circuits with whether they aim to contain high uptime + nodes and/or high capacity nodes. When building circuits, choose + appropriate nodes. + - This means that every single node in an intro rend circuit, + not just the last one, will have a minimum uptime. + - New config option LongLivedPorts to indicate application streams + that will want high uptime circuits. + - Servers reset uptime when a dir fetch entirely fails. This + hopefully reflects stability of the server's network connectivity. + - If somebody starts his tor server in Jan 2004 and then fixes his + clock, don't make his published uptime be a year. + - Reset published uptime when we wake up from hibernation. + - Introduce a notion of 'internal' circs, which are chosen without + regard to the exit policy of the last hop. Intro and rendezvous + circs must be internal circs, to avoid leaking information. Resolve + and connect streams can use internal circs if they want. + - New circuit pooling algorithm: keep track of what destination ports + we've used recently (start out assuming we'll want to use 80), and + make sure to have enough circs around to satisfy these ports. Also + make sure to have 2 internal circs around if we've required internal + circs lately (and with high uptime if we've seen that lately too). + - Turn addr_policy_compare from a tristate to a quadstate; this should + help address our "Ah, you allow 1.2.3.4:80. You are a good choice + for google.com" problem. + - When a client asks us for a dir mirror and we don't have one, + launch an attempt to get a fresh one. - First cut at support for "create-fast" cells. Clients can use these when extending to their first hop, since the TLS already provides forward secrecy and authentication. Not enabled on clients yet. - - When dirservers refuse a router descriptor, we now log its - contactinfo, platform, and the poster's IP address. - - Call tor_free_all instead of connections_free_all after forking, to - save memory on systems that need to fork. - - Whine at you if you're a server and you don't set your contactinfo. - - Implement --verify-config command-line option to check if your torrc - is valid without actually launching Tor. - - Rewrite address "serifos.exit" to "externalIP.serifos.exit" - rather than just rejecting it. + o Reachability testing. + - Your Tor server will automatically try to see if its ORPort and + DirPort are reachable from the outside, and it won't upload its + descriptor until it decides at least ORPort is reachable (when + DirPort is not yet found reachable, publish it as zero). + - When building testing circs for ORPort testing, use only + high-bandwidth nodes, so fewer circuits fail. + - Notice when our IP changes, and reset stats/uptime/reachability. + - Authdirservers don't do ORPort reachability detection, since + they're in clique mode, so it will be rare to find a server not + already connected to them. + - Authdirservers now automatically approve nodes running 0.1.0.2-rc + or later. -Changes in version 0.1.0.5-rc - 2005-04-27 - o Bugfixes: - - Stop trying to print a null pointer if an OR conn fails because - we didn't like its cert. - o Features: + o Dirserver fixes: + - Now we allow two unverified servers with the same nickname + but different keys. But if a nickname is verified, only that + nickname+key are allowed. + - If you're an authdirserver connecting to an address:port, + and it's not the OR you were expecting, forget about that + descriptor. If he *was* the one you were expecting, then forget + about all other descriptors for that address:port. + - Allow servers to publish descriptors from 12 hours in the future. + Corollary: only whine about clock skew from the dirserver if + he's a trusted dirserver (since now even verified servers could + have quite wrong clocks). + + o Code efficiency improvements: + - Use libevent. Now we can use faster async cores (like epoll, kpoll, + and /dev/poll), and hopefully work better on Windows too. + - Apple's OS X 10.4.0 ships with a broken kqueue API, and using + kqueue on 10.3.9 causes kernel panics. Don't use kqueue on OS X. + - Find libevent even if it's hiding in /usr/local/ and your + CFLAGS and LDFLAGS don't tell you to look there. + - Be able to link with libevent as a shared library (the default + after 1.0d), even if it's hiding in /usr/local/lib and even + if you haven't added /usr/local/lib to your /etc/ld.so.conf, + assuming you're running gcc. Otherwise fail and give a useful + error message. + - Switch to a new buffer management algorithm, which tries to avoid + reallocing and copying quite as much. In first tests it looks like + it uses *more* memory on average, but less cpu. - Switch our internal buffers implementation to use a ring buffer, to hopefully improve performance for fast servers a lot. - - Add HttpsProxyAuthenticator support (basic auth only), based - on patch from Adam Langley. - - Bump the default BandwidthRate from 1 MB to 2 MB, to accommodate - the fast servers that have been joining lately. - - Give hidden service accesses extra time on the first attempt, - since 60 seconds is often only barely enough. This might improve - robustness more. - Improve performance for dirservers: stop re-parsing the whole directory every time you regenerate it. - - Add more debugging info to help us find the weird dns netbsd - pthreads bug; cleaner debug messages to help track future issues. + - Keep a big splay tree of (circid,orconn)->circuit mappings to make + it much faster to look up a circuit for each relay cell. + - Remove most calls to assert_all_pending_dns_resolves_ok(), + since they're eating our cpu on exit nodes. + - Stop wasting time doing a case insensitive comparison for every + dns name every time we do any lookup. Canonicalize the names to + lowercase when you first see them. + o Hidden services: + - Handle unavailable hidden services better. Handle slow or busy + hidden services better. + - Cannibalize GENERAL circs to be C_REND, C_INTRO, S_INTRO, and S_REND + circ as necessary, if there are any completed ones lying around + when we try to launch one. + - Make hidden services try to establish a rendezvous for 30 seconds + after fetching the descriptor, rather than for n (where n=3) + attempts to build a circuit. + - Adjust maximum skew and age for rendezvous descriptors: let skew + be 48 hours rather than 90 minutes. -Changes in version 0.1.0.4-rc - 2005-04-23 - o Bugfixes: - - If unofficial Tor clients connect and send weird TLS certs, our - Tor server triggers an assert. Stop asserting, and start handling - TLS errors better in other situations too. - - When the controller asks us to tell it about all the debug-level - logs, it turns out we were generating debug-level logs while - telling it about them, which turns into a bad loop. Now keep - track of whether you're sending a debug log to the controller, - and don't log when you are. - - Fix the "postdescriptor" feature of the controller interface: on - non-complete success, only say "done" once. - o Features: - - Clients are now willing to load balance over up to 2mB, not 1mB, - of advertised bandwidth capacity. + o Controller: + - More Tor controller support. See + http://tor.eff.org/doc/control-spec.txt for all the new features, + including signals to emulate unix signals from any platform; + redirectstream; extendcircuit; mapaddress; getinfo; postdescriptor; + closestream; closecircuit; etc. + - Encode hashed controller passwords in hex instead of base64, + to make it easier to write controllers. + - Revise control spec and implementation to allow all log messages to + be sent to controller with their severities intact (suggested by + Matt Edman). Disable debug-level logs while delivering a debug-level + log to the controller, to prevent loop. Update TorControl to handle + new log event types. + + o New config options/defaults: + - Begin scrubbing sensitive strings from logs by default. Turn off + the config option SafeLogging if you need to do debugging. + - New exit policy: accept most low-numbered ports, rather than + rejecting most low-numbered ports. + - Put a note in the torrc about abuse potential with the default + exit policy. + - Add support for CONNECTing through https proxies, with "HttpsProxy" + config option. + - Add HttpProxyAuthenticator and HttpsProxyAuthenticator support + based on patch from Adam Langley (basic auth only). + - Bump the default BandwidthRate from 1 MB to 2 MB, to accommodate + the fast servers that have been joining lately. (Clients are now + willing to load balance over up to 2 MB of advertised bandwidth + capacity too.) + - New config option MaxAdvertisedBandwidth which lets you advertise + a low bandwidthrate (to not attract as many circuits) while still + allowing a higher bandwidthrate in reality. + - Require BandwidthRate to be at least 20kB/s for servers. - Add a NoPublish config option, so you can be a server (e.g. for testing running Tor servers in other Tor networks) without publishing your descriptor to the primary dirservers. + - Add a new AddressMap config directive to rewrite incoming socks + addresses. This lets you, for example, declare an implicit + required exit node for certain sites. + - Add a new TrackHostExits config directive to trigger addressmaps + for certain incoming socks addresses -- for sites that break when + your exit keeps changing (based on patch from Mike Perry). + - Split NewCircuitPeriod option into NewCircuitPeriod (30 secs), + which describes how often we retry making new circuits if current + ones are dirty, and MaxCircuitDirtiness (10 mins), which describes + how long we're willing to make use of an already-dirty circuit. + - Change compiled-in SHUTDOWN_WAIT_LENGTH from a fixed 30 secs to + a config option "ShutdownWaitLength" (when using kill -INT on + servers). + - Fix an edge case in parsing config options: if they say "--" + on the commandline, it's not a config option (thanks weasel). + - New config option DirAllowPrivateAddresses for authdirservers. + Now by default they refuse router descriptors that have non-IP or + private-IP addresses. + - Change DirFetchPeriod/StatusFetchPeriod to have a special "Be + smart" default value: low for servers and high for clients. + - Some people were putting "Address " in their torrc, and they had + a buggy resolver that resolved " " to 0.0.0.0. Oops. + - If DataDir is ~/.tor, and that expands to /.tor, then default to + LOCALSTATEDIR/tor instead. + - Implement --verify-config command-line option to check if your torrc + is valid without actually launching Tor. - -Changes in version 0.1.0.3-rc - 2005-04-08 - o Improvements on 0.1.0.2-rc: - - Client now retries when streams end early for 'hibernating' or - 'resource limit' reasons, rather than failing them. - - More automated handling for dirserver operators: - - Automatically approve nodes running 0.1.0.2-rc or later, - now that the the reachability detection stuff is working. - - Now we allow two unverified servers with the same nickname - but different keys. But if a nickname is verified, only that - nickname+key are allowed. - - If you're an authdirserver connecting to an address:port, - and it's not the OR you were expecting, forget about that - descriptor. If he *was* the one you were expecting, then forget - about all other descriptors for that address:port. - - Allow servers to publish descriptors from 12 hours in the future. - Corollary: only whine about clock skew from the dirserver if - he's a trusted dirserver (since now even verified servers could - have quite wrong clocks). - - Adjust maximum skew and age for rendezvous descriptors: let skew - be 48 hours rather than 90 minutes. - - Efficiency improvements: - - Keep a big splay tree of (circid,orconn)->circuit mappings to make - it much faster to look up a circuit for each relay cell. - - Remove most calls to assert_all_pending_dns_resolves_ok(), - since they're eating our cpu on exit nodes. - - Stop wasting time doing a case insensitive comparison for every - dns name every time we do any lookup. Canonicalize the names to - lowercase and be done with it. - - Start sending 'truncated' cells back rather than destroy cells, - if the circuit closes in front of you. This means we won't have - to abandon partially built circuits. - - Only warn once per nickname from add_nickname_list_to_smartlist + o Logging improvements: + - When dirservers refuse a server descriptor, we now log its + contactinfo, platform, and the poster's IP address. + - Only warn once per nickname from add_nickname_list_to_smartlist() per failure, so an entrynode or exitnode choice that's down won't yell so much. - - Put a note in the torrc about abuse potential with the default - exit policy. - - Revise control spec and implementation to allow all log messages to - be sent to controller with their severities intact (suggested by - Matt Edman). Update TorControl to handle new log event types. - - Provide better explanation messages when controller's POSTDESCRIPTOR - fails. - - Stop putting nodename in the Platform string in server descriptors. - It doesn't actually help, and it is confusing/upsetting some people. - - o Bugfixes on 0.1.0.2-rc: - - We were printing the host mask wrong in exit policies in server - descriptors. This isn't a critical bug though, since we were still - obeying the exit policy internally. - - Fix Tor when compiled with libevent but without pthreads: move - connection_unregister() from _connection_free() to - connection_free(). - - Fix an assert trigger (already fixed in 0.0.9.x): when we have - the rare mysterious case of accepting a conn on 0.0.0.0:0, then - when we look through the connection array, we'll find any of the - cpu/dnsworkers. This is no good. - - o Bugfixes on 0.0.9.x: - - Fix possible bug on threading platforms (e.g. win32) which was - leaking a file descriptor whenever a cpuworker or dnsworker died. - - When using preferred entry or exit nodes, ignore whether the - circuit wants uptime or capacity. They asked for the nodes, they - get the nodes. - - chdir() to your datadirectory at the *end* of the daemonize process, - not the beginning. This was a problem because the first time you - run tor, if your datadir isn't there, and you have runasdaemon set - to 1, it will try to chdir to it before it tries to create it. Oops. - - Handle changed router status correctly when dirserver reloads - fingerprint file. We used to be dropping all unverified descriptors - right then. The bug was hidden because we would immediately - fetch a directory from another dirserver, which would include the - descriptors we just dropped. - When we're connecting to an OR and he's got a different nickname/key than we were expecting, only complain loudly if we're an OP or a dirserver. Complaining loudly to the OR admins just confuses them. - - Tie MAX_DIR_SIZE to MAX_BUF_SIZE, so now directory sizes won't get - artificially capped at 500kB. - - -Changes in version 0.1.0.2-rc - 2005-04-01 - o Bugfixes on 0.1.0.1-rc: - - Fixes on reachability detection: - - Don't check for reachability while hibernating. - - If ORPort is reachable but DirPort isn't, still publish the - descriptor, but zero out DirPort until it's found reachable. - - When building testing circs for ORPort testing, use only - high-bandwidth nodes, so fewer circuits fail. - - Complain about unreachable ORPort separately from unreachable - DirPort, so the user knows what's going on. - - Make sure we only conclude ORPort reachability if we didn't - initiate the conn. Otherwise we could falsely conclude that - we're reachable just because we connected to the guy earlier - and he used that same pipe to extend to us. - - Authdirservers shouldn't do ORPort reachability detection, - since they're in clique mode, so it will be rare to find a - server not already connected to them. - - When building testing circuits, always pick middle hops running - Tor 0.0.9.7, so we avoid the "can't extend to unknown routers" - bug. (This is a kludge; it will go away when 0.0.9.x becomes - obsolete.) - - When we decide we're reachable, actually publish our descriptor - right then. - - Fix bug in redirectstream in the controller. - - Fix the state descriptor strings so logs don't claim edge streams - are in a different state than they actually are. - - Use recent libevent features when possible (this only really affects - win32 and osx right now, because the new libevent with these - features hasn't been released yet). Add code to suppress spurious - libevent log msgs. - - Prevent possible segfault in connection_close_unattached_ap(). - - Fix newlines on torrc in win32. - - Improve error msgs when tor-resolve fails. + - Whine at you if you're a server and you don't set your contactinfo. + - Warn when exit policy implicitly allows local addresses. + - Give a better warning when some other server advertises an + ORPort that is actually an apache running ssl. + - If we get an incredibly skewed timestamp from a dirserver mirror + that isn't a verified OR, don't warn -- it's probably him that's + wrong. + - When a dirserver causes you to give a warn, mention which dirserver + it was. - o Improvements on 0.0.9.x: + o New contrib scripts: + - New experimental script tor/contrib/exitlist: a simple python + script to parse directories and find Tor nodes that exit to listed + addresses/ports. - New experimental script tor/contrib/ExerciseServer.py (needs more work) that uses the controller interface to build circuits and fetch pages over them. This will help us bootstrap servers that @@ -255,166 +251,60 @@ that uses the controller interface to let you choose whole paths via addresses like "...path" - - When we've connected to an OR and handshaked but didn't like - the result, we were closing the conn without sending destroy - cells back for pending circuits. Now send those destroys. - - -Changes in version 0.1.0.1-rc - 2005-03-28 - o New features: - - Add reachability testing. Your Tor server will automatically try - to see if its ORPort and DirPort are reachable from the outside, - and it won't upload its descriptor until it decides they are. - - Handle unavailable hidden services better. Handle slow or busy - hidden services better. - - Add support for CONNECTing through https proxies, with "HttpsProxy" - config option. - - New exit policy: accept most low-numbered ports, rather than - rejecting most low-numbered ports. - - More Tor controller support (still experimental). See - http://tor.eff.org/doc/control-spec.txt for all the new features, - including signals to emulate unix signals from any platform; - redirectstream; extendcircuit; mapaddress; getinfo; postdescriptor; - closestream; closecircuit; etc. - - Make nt services work and start on startup on win32 (based on - patch by Matt Edman). - - Add a new AddressMap config directive to rewrite incoming socks - addresses. This lets you, for example, declare an implicit - required exit node for certain sites. - - Add a new TrackHostExits config directive to trigger addressmaps - for certain incoming socks addresses -- for sites that break when - your exit keeps changing (based on patch from Mike Perry). - - Redo the client-side dns cache so it's just an addressmap too. - - Notice when our IP changes, and reset stats/uptime/reachability. - - When an application is using socks5, give him the whole variety of - potential socks5 responses (connect refused, host unreachable, etc), - rather than just "success" or "failure". - - A more sane version numbering system. See - http://tor.eff.org/cvs/tor/doc/version-spec.txt for details. - - New contributed script "exitlist": a simple python script to - parse directories and find Tor nodes that exit to listed - addresses/ports. - New contributed script "privoxy-tor-toggle" to toggle whether Privoxy uses Tor. Seems to be configured for Debian by default. - - Report HTTP reasons to client when getting a response from directory - servers -- so you can actually know what went wrong. - - New config option MaxAdvertisedBandwidth which lets you advertise - a low bandwidthrate (to not attract as many circuits) while still - allowing a higher bandwidthrate in reality. - o Robustness/stability fixes: - - Make Tor use Niels Provos's libevent instead of its current - poll-but-sometimes-select mess. This will let us use faster async - cores (like epoll, kpoll, and /dev/poll), and hopefully work better - on Windows too. - - pthread support now too. This was forced because when we forked, - we ended up wasting a lot of duplicate ram over time. Also switch - to foo_r versions of some library calls to allow reentry and - threadsafeness. - - Better handling for heterogeneous / unreliable nodes: - - Annotate circuits w/ whether they aim to contain high uptime nodes - and/or high capacity nodes. When building circuits, choose - appropriate nodes. - - This means that every single node in an intro rend circuit, - not just the last one, will have a minimum uptime. - - New config option LongLivedPorts to indicate application streams - that will want high uptime circuits. - - Servers reset uptime when a dir fetch entirely fails. This - hopefully reflects stability of the server's network connectivity. - - If somebody starts his tor server in Jan 2004 and then fixes his - clock, don't make his published uptime be a year. - - Reset published uptime when you wake up from hibernation. - - Introduce a notion of 'internal' circs, which are chosen without - regard to the exit policy of the last hop. Intro and rendezvous - circs must be internal circs, to avoid leaking information. Resolve - and connect streams can use internal circs if they want. - - New circuit pooling algorithm: make sure to have enough circs around - to satisfy any predicted ports, and also make sure to have 2 internal - circs around if we've required internal circs lately (and with high - uptime if we've seen that lately too). - - Split NewCircuitPeriod option into NewCircuitPeriod (30 secs), - which describes how often we retry making new circuits if current - ones are dirty, and MaxCircuitDirtiness (10 mins), which describes - how long we're willing to make use of an already-dirty circuit. - - Cannibalize GENERAL circs to be C_REND, C_INTRO, S_INTRO, and S_REND - circ as necessary, if there are any completed ones lying around - when we try to launch one. - - Make hidden services try to establish a rendezvous for 30 seconds, - rather than for n (where n=3) attempts to build a circuit. - - Change SHUTDOWN_WAIT_LENGTH from a fixed 30 secs to a config option - "ShutdownWaitLength". - - Try to be more zealous about calling connection_edge_end when - things go bad with edge conns in connection.c. - - Revise tor-spec to add more/better stream end reasons. - - Revise all calls to connection_edge_end to avoid sending "misc", - and to take errno into account where possible. - - o Bug fixes: - - Fix a race condition that can trigger an assert, when we have a - pending create cell and an OR connection fails right then. + o Misc bugfixes: + - chdir() to your datadirectory at the *end* of the daemonize process, + not the beginning. This was a problem because the first time you + run tor, if your datadir isn't there, and you have runasdaemon set + to 1, it will try to chdir to it before it tries to create it. Oops. - Fix several double-mark-for-close bugs, e.g. where we were finding a conn for a cell even if that conn is already marked for close. - - Make sequence of log messages when starting on win32 with no config - file more reasonable. - - When choosing an exit node for a new non-internal circ, don't take - into account whether it'll be useful for any pending x.onion - addresses -- it won't. - - Turn addr_policy_compare from a tristate to a quadstate; this should - help address our "Ah, you allow 1.2.3.4:80. You are a good choice - for google.com" problem. - - Make "platform" string in descriptor more accurate for Win32 servers, - so it's not just "unknown platform". - - Fix an edge case in parsing config options (thanks weasel). - If they say "--" on the commandline, it's not an option. - - Reject odd-looking addresses at the client (e.g. addresses that - contain a colon), rather than having the server drop them because - they're malformed. + - Stop most cases of hanging up on a socks connection without sending + the socks reject. + - Fix a bug in the RPM package: set home directory for _tor to + something more reasonable when first installing. + - Stop putting nodename in the Platform string in server descriptors. + It doesn't actually help, and it is confusing/upsetting some people. + - When using preferred entry or exit nodes, ignore whether the + circuit wants uptime or capacity. They asked for the nodes, they + get the nodes. + - Tie MAX_DIR_SIZE to MAX_BUF_SIZE, so now directory sizes won't get + artificially capped at 500kB. + - Cache local dns resolves correctly even when they're .exit + addresses. + - If we're hibernating and we get a SIGINT, exit immediately. - tor-resolve requests were ignoring .exit if there was a working circuit they could use instead. - - REUSEADDR on normal platforms means you can rebind to the port - right after somebody else has let it go. But REUSEADDR on win32 - means to let you bind to the port _even when somebody else - already has it bound_! So, don't do that on Win32. + + o Misc features: + - Rewrite address "serifos.exit" to "externalIP.serifos.exit" + rather than just rejecting it. + - If our clock jumps forward by 100 seconds or more, assume something + has gone wrong with our network and abandon all not-yet-used circs. + - When an application is using socks5, give him the whole variety of + potential socks5 responses (connect refused, host unreachable, etc), + rather than just "success" or "failure". + - A more sane version numbering system. See + http://tor.eff.org/cvs/tor/doc/version-spec.txt for details. - Change version parsing logic: a version is "obsolete" if it is not recommended and (1) there is a newer recommended version in the same series, or (2) there are no recommended versions in the same series, but there are some recommended versions in a newer series. A version is "new" if it is newer than any recommended version in the same series. - - Stop most cases of hanging up on a socks connection without sending - the socks reject. - - o Helpful fixes: - - Require BandwidthRate to be at least 20kB/s for servers. - - When a dirserver causes you to give a warn, mention which dirserver - it was. - - New config option DirAllowPrivateAddresses for authdirservers. - Now by default they refuse router descriptors that have non-IP or - private-IP addresses. + - Report HTTP reasons to client when getting a response from directory + servers -- so you can actually know what went wrong. + - Reject odd-looking addresses at the client (e.g. addresses that + contain a colon), rather than having the server drop them because + they're malformed. - Stop publishing socksport in the directory, since it's not actually meant to be public. For compatibility, publish a 0 there for now. - - Change DirFetchPeriod/StatusFetchPeriod to have a special "Be - smart" value, that is low for servers and high for clients. - - If our clock jumps forward by 100 seconds or more, assume something - has gone wrong with our network and abandon all not-yet-used circs. - - Warn when exit policy implicitly allows local addresses. - - If we get an incredibly skewed timestamp from a dirserver mirror - that isn't a verified OR, don't warn -- it's probably him that's - wrong. - Since we ship our own Privoxy on OS X, tweak it so it doesn't write cookies to disk and doesn't log each web request to disk. (Thanks to Brett Carrington for pointing this out.) - - When a client asks us for a dir mirror and we don't have one, - launch an attempt to get a fresh one. - - If we're hibernating and we get a SIGINT, exit immediately. - - Add --with-dmalloc ./configure option, to track memory leaks. - - And try to free all memory on closing, so we can detect what - we're leaking. - - Cache local dns resolves correctly even when they're .exit - addresses. - - Give a better warning when some other server advertises an - ORPort that is actually an apache running ssl. - Add "opt hibernating 1" to server descriptor to make it clearer whether the server is hibernating. From arma at seul.org Thu Jun 9 04:15:19 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 00:15:19 -0400 (EDT) Subject: [or-cvs] backport the requiring servers to have public IPs Message-ID: <20050609041519.C257C140807A@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/tor-010x/tor/src/or Modified Files: Tag: tor-0_1_0-patches config.c Log Message: backport the requiring servers to have public IPs Index: config.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.353.2.2 retrieving revision 1.353.2.3 diff -u -d -r1.353.2.2 -r1.353.2.3 --- config.c 8 Jun 2005 20:36:13 -0000 1.353.2.2 +++ config.c 9 Jun 2005 04:15:17 -0000 1.353.2.3 @@ -945,8 +945,9 @@ } /** - * Based on address, guess our public IP address and put it - * in addr. + * Based on options-\>Address, guess our public IP address and put it + * in *addr. Return 0 if all is well, or -1 if we can't find a + * suitable public IP address. */ int resolve_my_address(or_options_t *options, uint32_t *addr) @@ -995,12 +996,23 @@ } tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf)); - if (!explicit_ip && is_internal_IP(htonl(in.s_addr))) { - log_fn(LOG_WARN,"Address '%s' resolves to private IP '%s'. " - "Please set the Address config option to be the IP you want to use.", - hostname, tmpbuf); - if (!options->NoPublish) + if (is_internal_IP(htonl(in.s_addr)) && !options->NoPublish) { + /* make sure we're ok with publishing an internal IP */ + if (!options->DirServers) { + /* if they are using the default dirservers, disallow internal IPs always. */ + log_fn(LOG_WARN,"Address '%s' resolves to private IP '%s'. " + "Tor servers that use the default DirServers must have public IP addresses.", + hostname, tmpbuf); return -1; + } + if (!explicit_ip) { + /* even if they've set their own dirservers, require an explicit IP if + * they're using an internal address. */ + log_fn(LOG_WARN,"Address '%s' resolves to private IP '%s'. " + "Please set the Address config option to be the IP you want to use.", + hostname, tmpbuf); + return -1; + } } log_fn(LOG_DEBUG, "Resolved Address to %s.", tmpbuf); From arma at seul.org Thu Jun 9 08:54:44 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 04:54:44 -0400 (EDT) Subject: [or-cvs] pay more attention to the ClientOnly config option Message-ID: <20050609085444.6165F140807A@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: connection.c router.c Log Message: pay more attention to the ClientOnly config option Index: connection.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/connection.c,v retrieving revision 1.374 retrieving revision 1.375 diff -u -d -r1.374 -r1.375 --- connection.c 8 Jun 2005 04:55:06 -0000 1.374 +++ connection.c 9 Jun 2005 08:54:42 -0000 1.375 @@ -824,7 +824,8 @@ int retry_all_listeners(int force) { or_options_t *options = get_options(); - if (retry_listeners(CONN_TYPE_OR_LISTENER, options->ORBindAddress, + if (server_mode(options) && + retry_listeners(CONN_TYPE_OR_LISTENER, options->ORBindAddress, options->ORPort, "0.0.0.0", force)<0) return -1; if (retry_listeners(CONN_TYPE_DIR_LISTENER, options->DirBindAddress, Index: router.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/router.c,v retrieving revision 1.177 retrieving revision 1.178 diff -u -d -r1.177 -r1.178 --- router.c 8 Jun 2005 19:45:17 -0000 1.177 +++ router.c 9 Jun 2005 08:54:42 -0000 1.178 @@ -451,6 +451,7 @@ /** Return true iff we are trying to be a server. */ int server_mode(or_options_t *options) { + if (options->ClientOnly) return 0; return (options->ORPort != 0 || options->ORBindAddress); } From arma at seul.org Thu Jun 9 09:01:44 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 05:01:44 -0400 (EDT) Subject: [or-cvs] document NoPublish Message-ID: <20050609090144.608A6140809E@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: tor.1.in Log Message: document NoPublish mention that ClientOnly is going to become deprecated Index: tor.1.in =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor.1.in,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- tor.1.in 27 May 2005 11:57:52 -0000 1.87 +++ tor.1.in 9 Jun 2005 09:01:42 -0000 1.88 @@ -168,6 +168,9 @@ is to run as a client unless ORPort is configured. (Usually, you don't need to set this; Tor is pretty smart at figuring out whether you are reliable and high-bandwidth enough to be a useful server.) + +This option will likely be deprecated in the future; see the NoPublish +option below. .TP \fBEntryNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP A list of preferred nodes to use for the first hop in the circuit, if possible. @@ -330,6 +333,12 @@ \fBNickname \fR\fIname\fP Set the server's nickname to 'name'. .TP +\fBNoPublish \fR\fB0\fR|\fB1\fR\fP +If you set NoPublish 1, Tor will act as a server if you have an ORPort +defined, but it will not publish its descriptor to the dirservers. This +option is useful if you're testing out your server, or if you're using +alternate dirservers (e.g. for other Tor networks such as Blossom). +.TP \fBNumCPUs \fR\fInum\fP How many processes to use at once for decrypting onionskins. (Default: 1) .TP From arma at seul.org Thu Jun 9 09:03:14 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 05:03:14 -0400 (EDT) Subject: [or-cvs] mention defaults for clientonly and nopublish Message-ID: <20050609090314.413BC140809E@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: tor.1.in Log Message: mention defaults for clientonly and nopublish Index: tor.1.in =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor.1.in,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- tor.1.in 9 Jun 2005 09:01:42 -0000 1.88 +++ tor.1.in 9 Jun 2005 09:03:12 -0000 1.89 @@ -170,7 +170,7 @@ you are reliable and high-bandwidth enough to be a useful server.) This option will likely be deprecated in the future; see the NoPublish -option below. +option below. (Default: 0) .TP \fBEntryNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP A list of preferred nodes to use for the first hop in the circuit, if possible. @@ -338,6 +338,7 @@ defined, but it will not publish its descriptor to the dirservers. This option is useful if you're testing out your server, or if you're using alternate dirservers (e.g. for other Tor networks such as Blossom). +(Default: 0) .TP \fBNumCPUs \fR\fInum\fP How many processes to use at once for decrypting onionskins. (Default: 1) From arma at seul.org Thu Jun 9 09:16:14 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 05:16:14 -0400 (EDT) Subject: [or-cvs] backport ClientOnly fixes Message-ID: <20050609091614.6FB76140811B@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/tor-010x/tor/src/or Modified Files: Tag: tor-0_1_0-patches connection.c router.c Log Message: backport ClientOnly fixes Index: connection.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection.c,v retrieving revision 1.373 retrieving revision 1.373.2.1 diff -u -d -r1.373 -r1.373.2.1 --- connection.c 23 May 2005 05:20:52 -0000 1.373 +++ connection.c 9 Jun 2005 09:16:12 -0000 1.373.2.1 @@ -824,7 +824,8 @@ int retry_all_listeners(int force) { or_options_t *options = get_options(); - if (retry_listeners(CONN_TYPE_OR_LISTENER, options->ORBindAddress, + if (server_mode(options) && + retry_listeners(CONN_TYPE_OR_LISTENER, options->ORBindAddress, options->ORPort, "0.0.0.0", force)<0) return -1; if (retry_listeners(CONN_TYPE_DIR_LISTENER, options->DirBindAddress, Index: router.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/router.c,v retrieving revision 1.176 retrieving revision 1.176.2.1 diff -u -d -r1.176 -r1.176.2.1 --- router.c 27 May 2005 17:43:43 -0000 1.176 +++ router.c 9 Jun 2005 09:16:12 -0000 1.176.2.1 @@ -451,6 +451,7 @@ /** Return true iff we are trying to be a server. */ int server_mode(or_options_t *options) { + if (options->ClientOnly) return 0; return (options->ORPort != 0 || options->ORBindAddress); } From arma at seul.org Thu Jun 9 09:16:27 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 05:16:27 -0400 (EDT) Subject: [or-cvs] backport clientonly/nopublish man page entries Message-ID: <20050609091627.7B4E314081A6@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/tor-010x/tor/doc Modified Files: Tag: tor-0_1_0-patches tor.1.in Log Message: backport clientonly/nopublish man page entries Index: tor.1.in =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor.1.in,v retrieving revision 1.87 retrieving revision 1.87.2.1 diff -u -d -r1.87 -r1.87.2.1 --- tor.1.in 27 May 2005 11:57:52 -0000 1.87 +++ tor.1.in 9 Jun 2005 09:16:25 -0000 1.87.2.1 @@ -168,6 +168,9 @@ is to run as a client unless ORPort is configured. (Usually, you don't need to set this; Tor is pretty smart at figuring out whether you are reliable and high-bandwidth enough to be a useful server.) + +This option will likely be deprecated in the future; see the NoPublish +option below. (Default: 0) .TP \fBEntryNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP A list of preferred nodes to use for the first hop in the circuit, if possible. @@ -330,6 +333,13 @@ \fBNickname \fR\fIname\fP Set the server's nickname to 'name'. .TP +\fBNoPublish \fR\fB0\fR|\fB1\fR\fP +If you set NoPublish 1, Tor will act as a server if you have an ORPort +defined, but it will not publish its descriptor to the dirservers. This +option is useful if you're testing out your server, or if you're using +alternate dirservers (e.g. for other Tor networks such as Blossom). +(Default: 0) +.TP \fBNumCPUs \fR\fInum\fP How many processes to use at once for decrypting onionskins. (Default: 1) .TP From nickm at seul.org Sun Jun 5 14:31:40 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 5 Jun 2005 10:31:40 -0400 (EDT) Subject: [or-cvs] Backport overflow fix to 010 branch Message-ID: <20050605143140.0464314081C6@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv11035/src/or Modified Files: Tag: tor-0_1_0-patches control.c Log Message: Backport overflow fix to 010 branch Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.83 retrieving revision 1.83.2.1 diff -u -d -r1.83 -r1.83.2.1 --- control.c 23 May 2005 02:31:53 -0000 1.83 +++ control.c 5 Jun 2005 14:31:37 -0000 1.83.2.1 @@ -481,7 +481,7 @@ } } if (buf) - memcpy(buf, decoded, sizeof(decoded)); + memcpy(buf, decoded, S2K_SPECIFIER_LEN+DIGEST_LEN); return 0; } From arma at seul.org Thu Jun 9 10:21:57 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 06:21:57 -0400 (EDT) Subject: [or-cvs] when a dirserver gets a mismatched fingerprint, log the exp... Message-ID: <20050609102157.7E88414081A3@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: dirserv.c Log Message: when a dirserver gets a mismatched fingerprint, log the expected fp and the received fp Index: dirserv.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/dirserv.c,v retrieving revision 1.163 retrieving revision 1.164 diff -u -d -r1.163 -r1.164 --- dirserv.c 2 May 2005 22:06:04 -0000 1.163 +++ dirserv.c 9 Jun 2005 10:21:55 -0000 1.164 @@ -186,7 +186,8 @@ log_fn(LOG_DEBUG,"good fingerprint for '%s'",router->nickname); return 1; /* Right fingerprint. */ } else { - log_fn(LOG_WARN,"mismatched fingerprint for '%s'",router->nickname); + log_fn(LOG_WARN,"mismatched fingerprint for '%s': expected '%s' got '%s'", + router->nickname, ent->fingerprint, fp); return -1; /* Wrong fingerprint. */ } } From arma at seul.org Thu Jun 9 10:25:29 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 06:25:29 -0400 (EDT) Subject: [or-cvs] revert to the 0108-rc changelog. alas, it"s time for another Message-ID: <20050609102529.BD79814081A3@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/home/arma/work/onion/tor-010x/tor Modified Files: Tag: tor-0_1_0-patches ChangeLog Log Message: revert to the 0108-rc changelog. alas, it's time for another release candidate first. Index: ChangeLog =================================================================== RCS file: /home/or/cvsroot/tor/ChangeLog,v retrieving revision 1.93.2.2 retrieving revision 1.93.2.3 diff -u -d -r1.93.2.2 -r1.93.2.3 --- ChangeLog 6 Jun 2005 20:17:17 -0000 1.93.2.2 +++ ChangeLog 9 Jun 2005 10:25:27 -0000 1.93.2.3 @@ -1,249 +1,249 @@ -Changes in version 0.1.0.9 (first stable release of 0.1.0.x) - o Fixes on Win32: - - Make NT services work and start on startup on Win32 (based on - patch by Matt Edman). See the FAQ entry for details. - - Make 'platform' string in descriptor more accurate for Win32 - servers, so it's not just "unknown platform". - - REUSEADDR on normal platforms means you can rebind to the port - right after somebody else has let it go. But REUSEADDR on Win32 - means you can bind to the port _even when somebody else already - has it bound_! So, don't do that on Win32. - - Clean up the log messages when starting on Win32 with no config - file. - - Security fix: seed RNG well even when not in Administrator group. - - o Assert / crash bugs: - - Refuse relay cells that claim to have a length larger than the - maximum allowed. This prevents a potential attack that could read - arbitrary memory (e.g. keys) from an exit server's process. - - If unofficial Tor clients connect and send weird TLS certs, our - Tor server triggers an assert. Stop asserting, and start handling - TLS errors better in other situations too. - - Fix a race condition that can trigger an assert when we have a - pending create cell and an OR connection attempt fails. - - o Resource leaks: - - Use pthreads for worker processes rather than forking. This was - forced because when we forked, we ended up wasting a lot of - duplicate ram over time. - - Also switch to foo_r versions of some library calls to allow - reentry and threadsafeness. - - Implement --disable-threads configure option. Disable threads on - netbsd and openbsd by default, because they have no reentrant - resolver functions (!). - - Fix possible bug on threading platforms (e.g. win32) which was - leaking a file descriptor whenever a cpuworker or dnsworker died. +Changes in version 0.1.0.8-rc - 2005-05-23 + o Bugfixes: + - It turns out that kqueue on OS X 10.3.9 was causing kernel + panics. Disable kqueue on all OS X Tors. + - Fix RPM: remove duplicate line accidentally added to the rpm + spec file. + - Disable threads on openbsd too, since its gethostaddr is not + reentrant either. + - Allow the middle hop of the testing circuit to be running any + version, now that most of them have the bugfix to let them connect + to unknown servers. This will allow reachability testing to work + even when 0.0.9.7-0.0.9.9 become obsolete. + - Handle relay cells with rh.length too large. This prevents + a potential attack that could read arbitrary memory (maybe even + keys) from the exit server's process. + - We screwed up the dirport reachability testing when we don't yet + have a cached version of the directory. Hopefully now fixed. + - Clean up router_load_single_router() (used by the controller), + so it doesn't seg fault on error. - Fix a minor memory leak when somebody establishes an introduction point at your Tor server. - - Add ./configure --with-dmalloc option, to track memory leaks. - - And try to free all memory on closing, so we can detect what - we're leaking. + - If a socks connection ends because read fails, don't warn that + you're not sending a socks reply back. - o Protocol correctness: - - When we've connected to an OR and handshaked but didn't like - the result, we were closing the conn without sending destroy - cells back for pending circuits. Now send those destroys. - - Start sending 'truncated' cells back rather than destroy cells - if the circuit closes in front of you. This means we won't have - to abandon partially built circuits. - - Handle changed router status correctly when dirserver reloads - fingerprint file. We used to be dropping all unverified descriptors - right then. The bug was hidden because we would immediately - fetch a directory from another dirserver, which would include the - descriptors we just dropped. - - Revise tor-spec to add more/better stream end reasons. - - Revise all calls to connection_edge_end to avoid sending 'misc', - and to take errno into account where possible. - - Client now retries when streams end early for 'hibernating' or - 'resource limit' reasons, rather than failing them. - - Try to be more zealous about calling connection_edge_end when - things go bad with edge conns in connection.c. + o Features: + - Add HttpProxyAuthenticator config option too, that works like + the HttpsProxyAuthenticator config option. + - Encode hashed controller passwords in hex instead of base64, + to make it easier to write controllers. - o Robustness improvements: - - Better handling for heterogeneous / unreliable nodes: - - Annotate circuits with whether they aim to contain high uptime - nodes and/or high capacity nodes. When building circuits, choose - appropriate nodes. - - This means that every single node in an intro rend circuit, - not just the last one, will have a minimum uptime. - - New config option LongLivedPorts to indicate application streams - that will want high uptime circuits. - - Servers reset uptime when a dir fetch entirely fails. This - hopefully reflects stability of the server's network connectivity. - - If somebody starts his tor server in Jan 2004 and then fixes his - clock, don't make his published uptime be a year. - - Reset published uptime when we wake up from hibernation. - - Introduce a notion of 'internal' circs, which are chosen without - regard to the exit policy of the last hop. Intro and rendezvous - circs must be internal circs, to avoid leaking information. Resolve - and connect streams can use internal circs if they want. - - New circuit pooling algorithm: keep track of what destination ports - we've used recently (start out assuming we'll want to use 80), and - make sure to have enough circs around to satisfy these ports. Also - make sure to have 2 internal circs around if we've required internal - circs lately (and with high uptime if we've seen that lately too). - - Turn addr_policy_compare from a tristate to a quadstate; this should - help address our "Ah, you allow 1.2.3.4:80. You are a good choice - for google.com" problem. - - When a client asks us for a dir mirror and we don't have one, - launch an attempt to get a fresh one. - - First cut at support for "create-fast" cells. Clients can use - these when extending to their first hop, since the TLS already - provides forward secrecy and authentication. Not enabled on - clients yet. - o Reachability testing. - - Your Tor server will automatically try to see if its ORPort and - DirPort are reachable from the outside, and it won't upload its - descriptor until it decides at least ORPort is reachable (when - DirPort is not yet found reachable, publish it as zero). - - When building testing circs for ORPort testing, use only - high-bandwidth nodes, so fewer circuits fail. - - Notice when our IP changes, and reset stats/uptime/reachability. - - Authdirservers don't do ORPort reachability detection, since - they're in clique mode, so it will be rare to find a server not - already connected to them. - - Authdirservers now automatically approve nodes running 0.1.0.2-rc - or later. +Changes in version 0.1.0.7-rc - 2005-05-17 + o Bugfixes: + - Fix a bug in the OS X package installer that prevented it from + installing on Tiger. + - Fix a script bug in the OS X package installer that made it + complain during installation. + - Find libevent even if it's hiding in /usr/local/ and your + CFLAGS and LDFLAGS don't tell you to look there. + - Be able to link with libevent as a shared library (the default + after 1.0d), even if it's hiding in /usr/local/lib and even + if you haven't added /usr/local/lib to your /etc/ld.so.conf, + assuming you're running gcc. Otherwise fail and give a useful + error message. + - Fix a bug in the RPM packager: set home directory for _tor to + something more reasonable when first installing. + - Free a minor amount of memory that is still reachable on exit. - o Dirserver fixes: - - Now we allow two unverified servers with the same nickname - but different keys. But if a nickname is verified, only that - nickname+key are allowed. - - If you're an authdirserver connecting to an address:port, - and it's not the OR you were expecting, forget about that - descriptor. If he *was* the one you were expecting, then forget - about all other descriptors for that address:port. - - Allow servers to publish descriptors from 12 hours in the future. - Corollary: only whine about clock skew from the dirserver if - he's a trusted dirserver (since now even verified servers could - have quite wrong clocks). - o Code efficiency improvements: - - Use libevent. Now we can use faster async cores (like epoll, kpoll, - and /dev/poll), and hopefully work better on Windows too. - - Apple's OS X 10.4.0 ships with a broken kqueue API, and using - kqueue on 10.3.9 causes kernel panics. Don't use kqueue on OS X. - - Find libevent even if it's hiding in /usr/local/ and your - CFLAGS and LDFLAGS don't tell you to look there. - - Be able to link with libevent as a shared library (the default - after 1.0d), even if it's hiding in /usr/local/lib and even - if you haven't added /usr/local/lib to your /etc/ld.so.conf, - assuming you're running gcc. Otherwise fail and give a useful - error message. +Changes in version 0.1.0.6-rc - 2005-05-14 + o Bugfixes: + - Implement --disable-threads configure option. Disable threads on + netbsd by default, because it appears to have no reentrant resolver + functions. + - Apple's OS X 10.4.0 ships with a broken kqueue. The new libevent + release (1.1) detects and disables kqueue if it's broken. + - Append default exit policy before checking for implicit internal + addresses. Now we don't log a bunch of complaints on startup + when using the default exit policy. + - Some people were putting "Address " in their torrc, and they had + a buggy resolver that resolved " " to 0.0.0.0. Oops. + - If DataDir is ~/.tor, and that expands to /.tor, then default to + LOCALSTATEDIR/tor instead. + - Fix fragmented-message bug in TorControl.py. + - Resolve a minor bug which would prevent unreachable dirports + from getting suppressed in the published descriptor. + - When the controller gave us a new descriptor, we weren't resolving + it immediately, so Tor would think its address was 0.0.0.0 until + we fetched a new directory. + - Fix an uppercase/lowercase case error in suppressing a bogus + libevent warning on some Linuxes. + + o Features: + - Begin scrubbing sensitive strings from logs by default. Turn off + the config option SafeLogging if you need to do debugging. - Switch to a new buffer management algorithm, which tries to avoid reallocing and copying quite as much. In first tests it looks like it uses *more* memory on average, but less cpu. + - First cut at support for "create-fast" cells. Clients can use + these when extending to their first hop, since the TLS already + provides forward secrecy and authentication. Not enabled on + clients yet. + - When dirservers refuse a router descriptor, we now log its + contactinfo, platform, and the poster's IP address. + - Call tor_free_all instead of connections_free_all after forking, to + save memory on systems that need to fork. + - Whine at you if you're a server and you don't set your contactinfo. + - Implement --verify-config command-line option to check if your torrc + is valid without actually launching Tor. + - Rewrite address "serifos.exit" to "externalIP.serifos.exit" + rather than just rejecting it. + + +Changes in version 0.1.0.5-rc - 2005-04-27 + o Bugfixes: + - Stop trying to print a null pointer if an OR conn fails because + we didn't like its cert. + o Features: - Switch our internal buffers implementation to use a ring buffer, to hopefully improve performance for fast servers a lot. + - Add HttpsProxyAuthenticator support (basic auth only), based + on patch from Adam Langley. + - Bump the default BandwidthRate from 1 MB to 2 MB, to accommodate + the fast servers that have been joining lately. + - Give hidden service accesses extra time on the first attempt, + since 60 seconds is often only barely enough. This might improve + robustness more. - Improve performance for dirservers: stop re-parsing the whole directory every time you regenerate it. - - Keep a big splay tree of (circid,orconn)->circuit mappings to make - it much faster to look up a circuit for each relay cell. - - Remove most calls to assert_all_pending_dns_resolves_ok(), - since they're eating our cpu on exit nodes. - - Stop wasting time doing a case insensitive comparison for every - dns name every time we do any lookup. Canonicalize the names to - lowercase when you first see them. - - o Hidden services: - - Handle unavailable hidden services better. Handle slow or busy - hidden services better. - - Cannibalize GENERAL circs to be C_REND, C_INTRO, S_INTRO, and S_REND - circ as necessary, if there are any completed ones lying around - when we try to launch one. - - Make hidden services try to establish a rendezvous for 30 seconds - after fetching the descriptor, rather than for n (where n=3) - attempts to build a circuit. - - Adjust maximum skew and age for rendezvous descriptors: let skew - be 48 hours rather than 90 minutes. + - Add more debugging info to help us find the weird dns netbsd + pthreads bug; cleaner debug messages to help track future issues. - o Controller: - - More Tor controller support. See - http://tor.eff.org/doc/control-spec.txt for all the new features, - including signals to emulate unix signals from any platform; - redirectstream; extendcircuit; mapaddress; getinfo; postdescriptor; - closestream; closecircuit; etc. - - Encode hashed controller passwords in hex instead of base64, - to make it easier to write controllers. - - Revise control spec and implementation to allow all log messages to - be sent to controller with their severities intact (suggested by - Matt Edman). Disable debug-level logs while delivering a debug-level - log to the controller, to prevent loop. Update TorControl to handle - new log event types. - o New config options/defaults: - - Begin scrubbing sensitive strings from logs by default. Turn off - the config option SafeLogging if you need to do debugging. - - New exit policy: accept most low-numbered ports, rather than - rejecting most low-numbered ports. - - Put a note in the torrc about abuse potential with the default - exit policy. - - Add support for CONNECTing through https proxies, with "HttpsProxy" - config option. - - Add HttpProxyAuthenticator and HttpsProxyAuthenticator support - based on patch from Adam Langley (basic auth only). - - Bump the default BandwidthRate from 1 MB to 2 MB, to accommodate - the fast servers that have been joining lately. (Clients are now - willing to load balance over up to 2 MB of advertised bandwidth - capacity too.) - - New config option MaxAdvertisedBandwidth which lets you advertise - a low bandwidthrate (to not attract as many circuits) while still - allowing a higher bandwidthrate in reality. - - Require BandwidthRate to be at least 20kB/s for servers. +Changes in version 0.1.0.4-rc - 2005-04-23 + o Bugfixes: + - If unofficial Tor clients connect and send weird TLS certs, our + Tor server triggers an assert. Stop asserting, and start handling + TLS errors better in other situations too. + - When the controller asks us to tell it about all the debug-level + logs, it turns out we were generating debug-level logs while + telling it about them, which turns into a bad loop. Now keep + track of whether you're sending a debug log to the controller, + and don't log when you are. + - Fix the "postdescriptor" feature of the controller interface: on + non-complete success, only say "done" once. + o Features: + - Clients are now willing to load balance over up to 2mB, not 1mB, + of advertised bandwidth capacity. - Add a NoPublish config option, so you can be a server (e.g. for testing running Tor servers in other Tor networks) without publishing your descriptor to the primary dirservers. - - Add a new AddressMap config directive to rewrite incoming socks - addresses. This lets you, for example, declare an implicit - required exit node for certain sites. - - Add a new TrackHostExits config directive to trigger addressmaps - for certain incoming socks addresses -- for sites that break when - your exit keeps changing (based on patch from Mike Perry). - - Split NewCircuitPeriod option into NewCircuitPeriod (30 secs), - which describes how often we retry making new circuits if current - ones are dirty, and MaxCircuitDirtiness (10 mins), which describes - how long we're willing to make use of an already-dirty circuit. - - Change compiled-in SHUTDOWN_WAIT_LENGTH from a fixed 30 secs to - a config option "ShutdownWaitLength" (when using kill -INT on - servers). - - Fix an edge case in parsing config options: if they say "--" - on the commandline, it's not a config option (thanks weasel). - - New config option DirAllowPrivateAddresses for authdirservers. - Now by default they refuse router descriptors that have non-IP or - private-IP addresses. - - Change DirFetchPeriod/StatusFetchPeriod to have a special "Be - smart" default value: low for servers and high for clients. - - Some people were putting "Address " in their torrc, and they had - a buggy resolver that resolved " " to 0.0.0.0. Oops. - - If DataDir is ~/.tor, and that expands to /.tor, then default to - LOCALSTATEDIR/tor instead. - - Implement --verify-config command-line option to check if your torrc - is valid without actually launching Tor. - o Logging improvements: - - When dirservers refuse a server descriptor, we now log its - contactinfo, platform, and the poster's IP address. - - Only warn once per nickname from add_nickname_list_to_smartlist() + +Changes in version 0.1.0.3-rc - 2005-04-08 + o Improvements on 0.1.0.2-rc: + - Client now retries when streams end early for 'hibernating' or + 'resource limit' reasons, rather than failing them. + - More automated handling for dirserver operators: + - Automatically approve nodes running 0.1.0.2-rc or later, + now that the the reachability detection stuff is working. + - Now we allow two unverified servers with the same nickname + but different keys. But if a nickname is verified, only that + nickname+key are allowed. + - If you're an authdirserver connecting to an address:port, + and it's not the OR you were expecting, forget about that + descriptor. If he *was* the one you were expecting, then forget + about all other descriptors for that address:port. + - Allow servers to publish descriptors from 12 hours in the future. + Corollary: only whine about clock skew from the dirserver if + he's a trusted dirserver (since now even verified servers could + have quite wrong clocks). + - Adjust maximum skew and age for rendezvous descriptors: let skew + be 48 hours rather than 90 minutes. + - Efficiency improvements: + - Keep a big splay tree of (circid,orconn)->circuit mappings to make + it much faster to look up a circuit for each relay cell. + - Remove most calls to assert_all_pending_dns_resolves_ok(), + since they're eating our cpu on exit nodes. + - Stop wasting time doing a case insensitive comparison for every + dns name every time we do any lookup. Canonicalize the names to + lowercase and be done with it. + - Start sending 'truncated' cells back rather than destroy cells, + if the circuit closes in front of you. This means we won't have + to abandon partially built circuits. + - Only warn once per nickname from add_nickname_list_to_smartlist per failure, so an entrynode or exitnode choice that's down won't yell so much. + - Put a note in the torrc about abuse potential with the default + exit policy. + - Revise control spec and implementation to allow all log messages to + be sent to controller with their severities intact (suggested by + Matt Edman). Update TorControl to handle new log event types. + - Provide better explanation messages when controller's POSTDESCRIPTOR + fails. + - Stop putting nodename in the Platform string in server descriptors. + It doesn't actually help, and it is confusing/upsetting some people. + + o Bugfixes on 0.1.0.2-rc: + - We were printing the host mask wrong in exit policies in server + descriptors. This isn't a critical bug though, since we were still + obeying the exit policy internally. + - Fix Tor when compiled with libevent but without pthreads: move + connection_unregister() from _connection_free() to + connection_free(). + - Fix an assert trigger (already fixed in 0.0.9.x): when we have + the rare mysterious case of accepting a conn on 0.0.0.0:0, then + when we look through the connection array, we'll find any of the + cpu/dnsworkers. This is no good. + + o Bugfixes on 0.0.9.x: + - Fix possible bug on threading platforms (e.g. win32) which was + leaking a file descriptor whenever a cpuworker or dnsworker died. + - When using preferred entry or exit nodes, ignore whether the + circuit wants uptime or capacity. They asked for the nodes, they + get the nodes. + - chdir() to your datadirectory at the *end* of the daemonize process, + not the beginning. This was a problem because the first time you + run tor, if your datadir isn't there, and you have runasdaemon set + to 1, it will try to chdir to it before it tries to create it. Oops. + - Handle changed router status correctly when dirserver reloads + fingerprint file. We used to be dropping all unverified descriptors + right then. The bug was hidden because we would immediately + fetch a directory from another dirserver, which would include the + descriptors we just dropped. - When we're connecting to an OR and he's got a different nickname/key than we were expecting, only complain loudly if we're an OP or a dirserver. Complaining loudly to the OR admins just confuses them. - - Whine at you if you're a server and you don't set your contactinfo. - - Warn when exit policy implicitly allows local addresses. - - Give a better warning when some other server advertises an - ORPort that is actually an apache running ssl. - - If we get an incredibly skewed timestamp from a dirserver mirror - that isn't a verified OR, don't warn -- it's probably him that's - wrong. - - When a dirserver causes you to give a warn, mention which dirserver - it was. + - Tie MAX_DIR_SIZE to MAX_BUF_SIZE, so now directory sizes won't get + artificially capped at 500kB. - o New contrib scripts: - - New experimental script tor/contrib/exitlist: a simple python - script to parse directories and find Tor nodes that exit to listed - addresses/ports. + +Changes in version 0.1.0.2-rc - 2005-04-01 + o Bugfixes on 0.1.0.1-rc: + - Fixes on reachability detection: + - Don't check for reachability while hibernating. + - If ORPort is reachable but DirPort isn't, still publish the + descriptor, but zero out DirPort until it's found reachable. + - When building testing circs for ORPort testing, use only + high-bandwidth nodes, so fewer circuits fail. + - Complain about unreachable ORPort separately from unreachable + DirPort, so the user knows what's going on. + - Make sure we only conclude ORPort reachability if we didn't + initiate the conn. Otherwise we could falsely conclude that + we're reachable just because we connected to the guy earlier + and he used that same pipe to extend to us. + - Authdirservers shouldn't do ORPort reachability detection, + since they're in clique mode, so it will be rare to find a + server not already connected to them. + - When building testing circuits, always pick middle hops running + Tor 0.0.9.7, so we avoid the "can't extend to unknown routers" + bug. (This is a kludge; it will go away when 0.0.9.x becomes + obsolete.) + - When we decide we're reachable, actually publish our descriptor + right then. + - Fix bug in redirectstream in the controller. + - Fix the state descriptor strings so logs don't claim edge streams + are in a different state than they actually are. + - Use recent libevent features when possible (this only really affects + win32 and osx right now, because the new libevent with these + features hasn't been released yet). Add code to suppress spurious + libevent log msgs. + - Prevent possible segfault in connection_close_unattached_ap(). + - Fix newlines on torrc in win32. + - Improve error msgs when tor-resolve fails. + + o Improvements on 0.0.9.x: - New experimental script tor/contrib/ExerciseServer.py (needs more work) that uses the controller interface to build circuits and fetch pages over them. This will help us bootstrap servers that @@ -252,60 +252,166 @@ that uses the controller interface to let you choose whole paths via addresses like "...path" - - New contributed script "privoxy-tor-toggle" to toggle whether - Privoxy uses Tor. Seems to be configured for Debian by default. + - When we've connected to an OR and handshaked but didn't like + the result, we were closing the conn without sending destroy + cells back for pending circuits. Now send those destroys. - o Misc bugfixes: - - chdir() to your datadirectory at the *end* of the daemonize process, - not the beginning. This was a problem because the first time you - run tor, if your datadir isn't there, and you have runasdaemon set - to 1, it will try to chdir to it before it tries to create it. Oops. - - Fix several double-mark-for-close bugs, e.g. where we were finding - a conn for a cell even if that conn is already marked for close. - - Stop most cases of hanging up on a socks connection without sending - the socks reject. - - Fix a bug in the RPM package: set home directory for _tor to - something more reasonable when first installing. - - Stop putting nodename in the Platform string in server descriptors. - It doesn't actually help, and it is confusing/upsetting some people. - - When using preferred entry or exit nodes, ignore whether the - circuit wants uptime or capacity. They asked for the nodes, they - get the nodes. - - Tie MAX_DIR_SIZE to MAX_BUF_SIZE, so now directory sizes won't get - artificially capped at 500kB. - - Cache local dns resolves correctly even when they're .exit - addresses. - - If we're hibernating and we get a SIGINT, exit immediately. - - tor-resolve requests were ignoring .exit if there was a working circuit - they could use instead. - o Misc features: - - Rewrite address "serifos.exit" to "externalIP.serifos.exit" - rather than just rejecting it. - - If our clock jumps forward by 100 seconds or more, assume something - has gone wrong with our network and abandon all not-yet-used circs. +Changes in version 0.1.0.1-rc - 2005-03-28 + o New features: + - Add reachability testing. Your Tor server will automatically try + to see if its ORPort and DirPort are reachable from the outside, + and it won't upload its descriptor until it decides they are. + - Handle unavailable hidden services better. Handle slow or busy + hidden services better. + - Add support for CONNECTing through https proxies, with "HttpsProxy" + config option. + - New exit policy: accept most low-numbered ports, rather than + rejecting most low-numbered ports. + - More Tor controller support (still experimental). See + http://tor.eff.org/doc/control-spec.txt for all the new features, + including signals to emulate unix signals from any platform; + redirectstream; extendcircuit; mapaddress; getinfo; postdescriptor; + closestream; closecircuit; etc. + - Make nt services work and start on startup on win32 (based on + patch by Matt Edman). + - Add a new AddressMap config directive to rewrite incoming socks + addresses. This lets you, for example, declare an implicit + required exit node for certain sites. + - Add a new TrackHostExits config directive to trigger addressmaps + for certain incoming socks addresses -- for sites that break when + your exit keeps changing (based on patch from Mike Perry). + - Redo the client-side dns cache so it's just an addressmap too. + - Notice when our IP changes, and reset stats/uptime/reachability. - When an application is using socks5, give him the whole variety of potential socks5 responses (connect refused, host unreachable, etc), rather than just "success" or "failure". - A more sane version numbering system. See http://tor.eff.org/cvs/tor/doc/version-spec.txt for details. + - New contributed script "exitlist": a simple python script to + parse directories and find Tor nodes that exit to listed + addresses/ports. + - New contributed script "privoxy-tor-toggle" to toggle whether + Privoxy uses Tor. Seems to be configured for Debian by default. + - Report HTTP reasons to client when getting a response from directory + servers -- so you can actually know what went wrong. + - New config option MaxAdvertisedBandwidth which lets you advertise + a low bandwidthrate (to not attract as many circuits) while still + allowing a higher bandwidthrate in reality. + + o Robustness/stability fixes: + - Make Tor use Niels Provos's libevent instead of its current + poll-but-sometimes-select mess. This will let us use faster async + cores (like epoll, kpoll, and /dev/poll), and hopefully work better + on Windows too. + - pthread support now too. This was forced because when we forked, + we ended up wasting a lot of duplicate ram over time. Also switch + to foo_r versions of some library calls to allow reentry and + threadsafeness. + - Better handling for heterogeneous / unreliable nodes: + - Annotate circuits w/ whether they aim to contain high uptime nodes + and/or high capacity nodes. When building circuits, choose + appropriate nodes. + - This means that every single node in an intro rend circuit, + not just the last one, will have a minimum uptime. + - New config option LongLivedPorts to indicate application streams + that will want high uptime circuits. + - Servers reset uptime when a dir fetch entirely fails. This + hopefully reflects stability of the server's network connectivity. + - If somebody starts his tor server in Jan 2004 and then fixes his + clock, don't make his published uptime be a year. + - Reset published uptime when you wake up from hibernation. + - Introduce a notion of 'internal' circs, which are chosen without + regard to the exit policy of the last hop. Intro and rendezvous + circs must be internal circs, to avoid leaking information. Resolve + and connect streams can use internal circs if they want. + - New circuit pooling algorithm: make sure to have enough circs around + to satisfy any predicted ports, and also make sure to have 2 internal + circs around if we've required internal circs lately (and with high + uptime if we've seen that lately too). + - Split NewCircuitPeriod option into NewCircuitPeriod (30 secs), + which describes how often we retry making new circuits if current + ones are dirty, and MaxCircuitDirtiness (10 mins), which describes + how long we're willing to make use of an already-dirty circuit. + - Cannibalize GENERAL circs to be C_REND, C_INTRO, S_INTRO, and S_REND + circ as necessary, if there are any completed ones lying around + when we try to launch one. + - Make hidden services try to establish a rendezvous for 30 seconds, + rather than for n (where n=3) attempts to build a circuit. + - Change SHUTDOWN_WAIT_LENGTH from a fixed 30 secs to a config option + "ShutdownWaitLength". + - Try to be more zealous about calling connection_edge_end when + things go bad with edge conns in connection.c. + - Revise tor-spec to add more/better stream end reasons. + - Revise all calls to connection_edge_end to avoid sending "misc", + and to take errno into account where possible. + + o Bug fixes: + - Fix a race condition that can trigger an assert, when we have a + pending create cell and an OR connection fails right then. + - Fix several double-mark-for-close bugs, e.g. where we were finding + a conn for a cell even if that conn is already marked for close. + - Make sequence of log messages when starting on win32 with no config + file more reasonable. + - When choosing an exit node for a new non-internal circ, don't take + into account whether it'll be useful for any pending x.onion + addresses -- it won't. + - Turn addr_policy_compare from a tristate to a quadstate; this should + help address our "Ah, you allow 1.2.3.4:80. You are a good choice + for google.com" problem. + - Make "platform" string in descriptor more accurate for Win32 servers, + so it's not just "unknown platform". + - Fix an edge case in parsing config options (thanks weasel). + If they say "--" on the commandline, it's not an option. + - Reject odd-looking addresses at the client (e.g. addresses that + contain a colon), rather than having the server drop them because + they're malformed. + - tor-resolve requests were ignoring .exit if there was a working circuit + they could use instead. + - REUSEADDR on normal platforms means you can rebind to the port + right after somebody else has let it go. But REUSEADDR on win32 + means to let you bind to the port _even when somebody else + already has it bound_! So, don't do that on Win32. - Change version parsing logic: a version is "obsolete" if it is not recommended and (1) there is a newer recommended version in the same series, or (2) there are no recommended versions in the same series, but there are some recommended versions in a newer series. A version is "new" if it is newer than any recommended version in the same series. - - Report HTTP reasons to client when getting a response from directory - servers -- so you can actually know what went wrong. - - Reject odd-looking addresses at the client (e.g. addresses that - contain a colon), rather than having the server drop them because - they're malformed. + - Stop most cases of hanging up on a socks connection without sending + the socks reject. + + o Helpful fixes: + - Require BandwidthRate to be at least 20kB/s for servers. + - When a dirserver causes you to give a warn, mention which dirserver + it was. + - New config option DirAllowPrivateAddresses for authdirservers. + Now by default they refuse router descriptors that have non-IP or + private-IP addresses. - Stop publishing socksport in the directory, since it's not actually meant to be public. For compatibility, publish a 0 there for now. + - Change DirFetchPeriod/StatusFetchPeriod to have a special "Be + smart" value, that is low for servers and high for clients. + - If our clock jumps forward by 100 seconds or more, assume something + has gone wrong with our network and abandon all not-yet-used circs. + - Warn when exit policy implicitly allows local addresses. + - If we get an incredibly skewed timestamp from a dirserver mirror + that isn't a verified OR, don't warn -- it's probably him that's + wrong. - Since we ship our own Privoxy on OS X, tweak it so it doesn't write cookies to disk and doesn't log each web request to disk. (Thanks to Brett Carrington for pointing this out.) + - When a client asks us for a dir mirror and we don't have one, + launch an attempt to get a fresh one. + - If we're hibernating and we get a SIGINT, exit immediately. + - Add --with-dmalloc ./configure option, to track memory leaks. + - And try to free all memory on closing, so we can detect what + we're leaking. + - Cache local dns resolves correctly even when they're .exit + addresses. + - Give a better warning when some other server advertises an + ORPort that is actually an apache running ssl. - Add "opt hibernating 1" to server descriptor to make it clearer whether the server is hibernating. From arma at seul.org Thu Jun 9 10:29:25 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 06:29:25 -0400 (EDT) Subject: [or-cvs] a changelog for 0.1.0.9-rc Message-ID: <20050609102925.3BC9514081A3@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/home/arma/work/onion/tor-010x/tor Modified Files: Tag: tor-0_1_0-patches ChangeLog Log Message: a changelog for 0.1.0.9-rc Index: ChangeLog =================================================================== RCS file: /home/or/cvsroot/tor/ChangeLog,v retrieving revision 1.93.2.3 retrieving revision 1.93.2.4 diff -u -d -r1.93.2.3 -r1.93.2.4 --- ChangeLog 9 Jun 2005 10:25:27 -0000 1.93.2.3 +++ ChangeLog 9 Jun 2005 10:29:22 -0000 1.93.2.4 @@ -1,3 +1,40 @@ +Changes in version 0.1.0.9-rc - 2005-05-09 + o Bugfixes: + - Reset buf->highwater every time buf_shrink() is called, not just on + a successful shrink. This was causing significant memory bloat. + - Fix buffer overflow when checking hashed passwords. + - Security fix: if seeding the RNG on Win32 fails, quit. + - Allow seeding the RNG on Win32 even when you're not running as + Administrator. + - Reenable the part of the code that tries to flush as soon as an + OR outbuf has a full TLS record available. Perhaps this will make + OR outbufs not grow as huge except in rare cases, thus saving lots + of CPU time plus memory. + - Reject malformed .onion addresses rather then passing them on as + normal web requests. + - Adapt patch from Adam Langley: fix possible memory leak in + tor_lookup_hostname(). + - Initialize libevent later in the startup process, so the logs are + already established by the time we start logging libevent warns. + - Use correct errno on win32 if libevent fails. + - Check and warn about known-bad/slow libevent versions. + - Pay more attention to the ClientOnly config option. + - Have torctl.in/tor.sh.in check for location of su binary (needed + on FreeBSD) + - Correct/add man page entries for LongLivedPorts, ExitPolicy, + KeepalivePeriod, ClientOnly, NoPublish, HttpProxy, HttpsProxy, + HttpProxyAuthenticator + - Stop warning about sigpipes in the logs. We're going to + pretend that getting these occassionally is normal and fine. + - Resolve OS X installer bugs: stop claiming to be 0.0.9.2 in certain + installer screens; and don't put stuff into StartupItems unless + the user asks you to. + - Require servers that use the default dirservers to have public IP + addresses. We have too many servers that are configured with private + IPs and their admins never notice the log entries complaining that + their descriptors are being rejected. + + Changes in version 0.1.0.8-rc - 2005-05-23 o Bugfixes: - It turns out that kqueue on OS X 10.3.9 was causing kernel From arma at seul.org Thu Jun 9 10:41:54 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 06:41:54 -0400 (EDT) Subject: [or-cvs] If certain IPs and ports are blocked externally, e.g. by yo... Message-ID: <20050609104154.B5E561408EF4@moria.seul.org> Update of /home/or/cvsroot/tor/src/config In directory moria:/home/arma/work/onion/tor-010x/tor/src/config Modified Files: Tag: tor-0_1_0-patches torrc.sample.in Log Message: ## If certain IPs and ports are blocked externally, e.g. by your firewall, ## you should update your exit policy to reflect this -- otherwise Tor ## users will be told that those destinations are down. Index: torrc.sample.in =================================================================== RCS file: /home/or/cvsroot/tor/src/config/torrc.sample.in,v retrieving revision 1.57.2.1 retrieving revision 1.57.2.2 diff -u -d -r1.57.2.1 -r1.57.2.2 --- torrc.sample.in 6 Jun 2005 16:01:07 -0000 1.57.2.1 +++ torrc.sample.in 9 Jun 2005 10:41:52 -0000 1.57.2.2 @@ -127,6 +127,10 @@ ## Look at http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#Abuse ## for issues you might encounter if you use the default exit policy. ## +## If certain IPs and ports are blocked externally, e.g. by your firewall, +## you should update your exit policy to reflect this -- otherwise Tor +## users will be told that those destinations are down. +## #ExitPolicy accept *:6660-6667,reject *:* # allow irc ports but no more #ExitPolicy accept *:119 # accept nntp as well as default exit policy #ExitPolicy reject *:* # middleman only -- no exits allowed From arma at seul.org Thu Jun 9 10:42:27 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 06:42:27 -0400 (EDT) Subject: [or-cvs] forward-port: Message-ID: <20050609104227.CA67A1408EFB@moria.seul.org> Update of /home2/or/cvsroot/tor/src/config In directory moria:/home/arma/work/onion/cvs/tor/src/config Modified Files: torrc.sample.in Log Message: forward-port: ## If certain IPs and ports are blocked externally, e.g. by your firewall, ## you should update your exit policy to reflect this -- otherwise Tor ## users will be told that those destinations are down. Index: torrc.sample.in =================================================================== RCS file: /home2/or/cvsroot/tor/src/config/torrc.sample.in,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- torrc.sample.in 6 Jun 2005 15:57:53 -0000 1.58 +++ torrc.sample.in 9 Jun 2005 10:42:25 -0000 1.59 @@ -127,6 +127,10 @@ ## Look at http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#Abuse ## for issues you might encounter if you use the default exit policy. ## +## If certain IPs and ports are blocked externally, e.g. by your firewall, +## you should update your exit policy to reflect this -- otherwise Tor +## users will be told that those destinations are down. +## #ExitPolicy accept *:6660-6667,reject *:* # allow irc ports but no more #ExitPolicy accept *:119 # accept nntp as well as default exit policy #ExitPolicy reject *:* # middleman only -- no exits allowed From arma at seul.org Thu Jun 9 11:24:26 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 07:24:26 -0400 (EDT) Subject: [or-cvs] abandon two 010x items Message-ID: <20050609112426.3AE6E1408062@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: TODO Log Message: abandon two 010x items Index: TODO =================================================================== RCS file: /home2/or/cvsroot/tor/doc/TODO,v retrieving revision 1.313 retrieving revision 1.314 diff -u -d -r1.313 -r1.314 --- TODO 9 Jun 2005 01:59:48 -0000 1.313 +++ TODO 9 Jun 2005 11:24:24 -0000 1.314 @@ -19,14 +19,14 @@ (Lucky is trying a patch that should tell us why.) - Fix the remaining flyspray bugs marked for 0.1.0.9 (Only 124 remains.) - - Free remaining unfreed memory (arma will run valgrind) + X Free remaining unfreed memory (arma will run valgrind) (Not for a stable release) o Note libevent/method/platform combos that are unlikely to work. . Memory use on Linux: what's happening? - Is it threading? (Maybe, maybe not) - Is it the buf_shrink bug? (Quite possibly) - instrument the code to figure out where our memory is going. (all platforms?) - - change torrc to point to abuse-faq (once abuse-faq is posted) + X change torrc to point to abuse-faq (once abuse-faq is posted) for 0.1.1.x: - cpu fixes: @@ -399,3 +399,7 @@ - i want more pictures from ren. he wants to describe the tor handshake, i want to talk about hidden services. o switch accountingmax to count total in+out, not either in or out. it's easy to move in this direction (not risky), but hard to back, out if we decide we prefer it the way it already is. hm. - clean up the places where our docs are redundant (or worse, obsolete in one file and correct elsewhere). agl has a start on a global list-of-tor-docs. + +multiple sample torrc files +os x uninstall click-click script + From nickm at seul.org Thu Jun 9 16:46:52 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 12:46:52 -0400 (EDT) Subject: [or-cvs] New whitespace normalization rule: no blank line at EOF. Message-ID: <20050609164652.F15E81408ED5@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/tmp/cvs-serv29993/contrib Modified Files: checkSpace.pl Log Message: New whitespace normalization rule: no blank line at EOF. Index: checkSpace.pl =================================================================== RCS file: /home/or/cvsroot/tor/contrib/checkSpace.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- checkSpace.pl 28 Nov 2004 09:14:05 -0000 1.5 +++ checkSpace.pl 9 Jun 2005 16:46:50 -0000 1.6 @@ -75,5 +75,8 @@ } } } + if ($lastnil) { + print " EOL\@EOF:$fn:$.\n"; + } close(F); } From nickm at seul.org Thu Jun 9 16:46:53 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 12:46:53 -0400 (EDT) Subject: [or-cvs] New whitespace normalization rule: no blank line at EOF. Message-ID: <20050609164653.24AE81408ED5@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv29993/src/common Modified Files: aes.c aes.h container.c crypto.h log.h test.h torint.h tortls.c tortls.h Log Message: New whitespace normalization rule: no blank line at EOF. Index: aes.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/aes.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- aes.c 7 May 2005 05:55:05 -0000 1.18 +++ aes.c 9 Jun 2005 16:46:50 -0000 1.19 @@ -812,4 +812,3 @@ rk[3]; PUTU32(ct + 12, s3); } - Index: aes.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/aes.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- aes.h 7 May 2005 05:55:05 -0000 1.10 +++ aes.h 9 Jun 2005 16:46:50 -0000 1.11 @@ -28,4 +28,3 @@ void aes_adjust_counter(aes_cnt_cipher_t *cipher, long delta); #endif - Index: container.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/container.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- container.c 3 Apr 2005 06:00:00 -0000 1.25 +++ container.c 9 Jun 2005 16:46:50 -0000 1.26 @@ -649,4 +649,3 @@ { return SPLAY_EMPTY(&map->head); } - Index: crypto.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/crypto.h,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- crypto.h 7 May 2005 05:55:05 -0000 1.61 +++ crypto.h 9 Jun 2005 16:46:50 -0000 1.62 @@ -160,4 +160,3 @@ size_t secret_len, const char *s2k_specifier); #endif - Index: log.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/log.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- log.h 5 Apr 2005 22:56:16 -0000 1.44 +++ log.h 9 Jun 2005 16:46:50 -0000 1.45 @@ -99,4 +99,3 @@ # define __LOG_H #endif - Index: test.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/test.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- test.h 3 Apr 2005 05:21:16 -0000 1.20 +++ test.h 9 Jun 2005 16:46:50 -0000 1.21 @@ -136,4 +136,3 @@ } STMT_END #endif - Index: torint.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/torint.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- torint.h 1 Apr 2005 20:15:54 -0000 1.19 +++ torint.h 9 Jun 2005 16:46:50 -0000 1.20 @@ -250,4 +250,3 @@ #define SIZE_T_CEILING (sizeof(char)<<(sizeof(size_t)*8 - 1)) #endif /* __TORINT_H */ - Index: tortls.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/tortls.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- tortls.c 7 May 2005 05:55:05 -0000 1.94 +++ tortls.c 9 Jun 2005 16:46:50 -0000 1.95 @@ -859,4 +859,3 @@ fname, line); tls_log_errors(LOG_WARN, NULL); } - Index: tortls.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/tortls.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- tortls.h 23 Apr 2005 14:26:02 -0000 1.27 +++ tortls.h 9 Jun 2005 16:46:50 -0000 1.28 @@ -51,4 +51,3 @@ void _check_no_tls_errors(const char *fname, int line); #endif - From nickm at seul.org Thu Jun 9 16:46:54 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 12:46:54 -0400 (EDT) Subject: [or-cvs] New whitespace normalization rule: no blank line at EOF. Message-ID: <20050609164654.1C2DE1408F17@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv29993/src/or Modified Files: circuitbuild.c circuitlist.c command.c connection_edge.c connection_or.c cpuworker.c directory.c dns.c hibernate.c main.c relay.c rendclient.c rendcommon.c rendmid.c rendservice.c routerlist.c tor_main.c Log Message: New whitespace normalization rule: no blank line at EOF. Index: circuitbuild.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuitbuild.c,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- circuitbuild.c 17 May 2005 19:46:43 -0000 1.115 +++ circuitbuild.c 9 Jun 2005 16:46:51 -0000 1.116 @@ -1475,4 +1475,3 @@ return 0; } - Index: circuitlist.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuitlist.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- circuitlist.c 3 May 2005 10:04:07 -0000 1.47 +++ circuitlist.c 9 Jun 2005 16:46:51 -0000 1.48 @@ -707,4 +707,3 @@ tor_assert(!c->rend_splice); } } - Index: command.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/command.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- command.c 17 May 2005 17:01:36 -0000 1.88 +++ command.c 9 Jun 2005 16:46:51 -0000 1.89 @@ -335,4 +335,3 @@ } } } - Index: connection_edge.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v retrieving revision 1.328 retrieving revision 1.329 diff -u -d -r1.328 -r1.329 --- connection_edge.c 7 Jun 2005 18:01:46 -0000 1.328 +++ connection_edge.c 9 Jun 2005 16:46:51 -0000 1.329 @@ -1720,4 +1720,3 @@ *s = '.'; return BAD_HOSTNAME; } - Index: connection_or.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_or.c,v retrieving revision 1.175 retrieving revision 1.176 diff -u -d -r1.175 -r1.176 --- connection_or.c 8 Jun 2005 04:55:06 -0000 1.175 +++ connection_or.c 9 Jun 2005 16:46:51 -0000 1.176 @@ -635,4 +635,3 @@ goto loop; /* process the remainder of the buffer */ } - Index: cpuworker.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/cpuworker.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- cpuworker.c 7 May 2005 05:55:06 -0000 1.79 +++ cpuworker.c 9 Jun 2005 16:46:51 -0000 1.80 @@ -430,4 +430,3 @@ } return 0; } - Index: directory.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/directory.c,v retrieving revision 1.230 retrieving revision 1.231 diff -u -d -r1.230 -r1.231 --- directory.c 27 May 2005 17:43:43 -0000 1.230 +++ directory.c 9 Jun 2005 16:46:51 -0000 1.231 @@ -1190,4 +1190,3 @@ conn->state = DIR_CONN_STATE_CLIENT_SENDING; /* start flushing conn */ return 0; } - Index: dns.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/dns.c,v retrieving revision 1.154 retrieving revision 1.155 diff -u -d -r1.154 -r1.155 --- dns.c 7 May 2005 05:55:06 -0000 1.154 +++ dns.c 9 Jun 2005 16:46:51 -0000 1.155 @@ -877,4 +877,3 @@ num_dnsworkers--; } } - Index: hibernate.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/hibernate.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- hibernate.c 2 Apr 2005 22:11:24 -0000 1.51 +++ hibernate.c 9 Jun 2005 16:46:51 -0000 1.52 @@ -832,4 +832,3 @@ } } } - Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.512 retrieving revision 1.513 diff -u -d -r1.512 -r1.513 --- main.c 8 Jun 2005 17:24:58 -0000 1.512 +++ main.c 9 Jun 2005 16:46:51 -0000 1.513 @@ -1624,4 +1624,3 @@ tor_cleanup(); return -1; } - Index: relay.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/relay.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- relay.c 17 May 2005 20:00:24 -0000 1.69 +++ relay.c 9 Jun 2005 16:46:51 -0000 1.70 @@ -1211,4 +1211,3 @@ } } } - Index: rendclient.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendclient.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- rendclient.c 3 May 2005 10:04:08 -0000 1.86 +++ rendclient.c 9 Jun 2005 16:46:51 -0000 1.87 @@ -447,4 +447,3 @@ smartlist_free(sl); return nickname; } - Index: rendcommon.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendcommon.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- rendcommon.c 3 May 2005 10:04:08 -0000 1.47 +++ rendcommon.c 9 Jun 2005 16:46:51 -0000 1.48 @@ -358,4 +358,3 @@ tor_assert(0); } } - Index: rendmid.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendmid.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- rendmid.c 20 May 2005 22:14:33 -0000 1.38 +++ rendmid.c 9 Jun 2005 16:46:51 -0000 1.39 @@ -289,4 +289,3 @@ circuit_mark_for_close(circ); return -1; } - Index: rendservice.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendservice.c,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- rendservice.c 2 May 2005 22:35:18 -0000 1.123 +++ rendservice.c 9 Jun 2005 16:46:51 -0000 1.124 @@ -1028,4 +1028,3 @@ conn->port,serviceid); return -1; } - Index: routerlist.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v retrieving revision 1.235 retrieving revision 1.236 diff -u -d -r1.235 -r1.236 --- routerlist.c 18 May 2005 03:52:07 -0000 1.235 +++ routerlist.c 9 Jun 2005 16:46:51 -0000 1.236 @@ -1459,4 +1459,3 @@ trusted_dir_servers = smartlist_create(); } } - Index: tor_main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/tor_main.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- tor_main.c 1 Apr 2005 20:15:56 -0000 1.8 +++ tor_main.c 9 Jun 2005 16:46:51 -0000 1.9 @@ -18,4 +18,3 @@ { return tor_main(argc, argv); } - From phobos at seul.org Thu Jun 9 17:35:29 2005 From: phobos at seul.org (phobos at seul.org) Date: Thu, 9 Jun 2005 13:35:29 -0400 (EDT) Subject: [or-cvs] TODO: fixed the latest tasks, and added in window"s doc stuff Message-ID: <20050609173529.D56431408095@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv32139 Modified Files: TODO Log Message: TODO: fixed the latest tasks, and added in window's doc stuff Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.314 retrieving revision 1.315 diff -u -d -r1.314 -r1.315 --- TODO 9 Jun 2005 11:24:24 -0000 1.314 +++ TODO 9 Jun 2005 17:35:27 -0000 1.315 @@ -399,7 +399,7 @@ - i want more pictures from ren. he wants to describe the tor handshake, i want to talk about hidden services. o switch accountingmax to count total in+out, not either in or out. it's easy to move in this direction (not risky), but hard to back, out if we decide we prefer it the way it already is. hm. - clean up the places where our docs are redundant (or worse, obsolete in one file and correct elsewhere). agl has a start on a global list-of-tor-docs. - -multiple sample torrc files -os x uninstall click-click script +P - update window's docs to clarify which versions of windows, and why a DOS window, how it's used, for the less technical users + - multiple sample torrc files +P . os x uninstall click-click script From nickm at seul.org Sun Jun 5 14:44:29 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 5 Jun 2005 10:44:29 -0400 (EDT) Subject: [or-cvs] bug 144] Have torctl.in/tor.sh.in check for location of su ... Message-ID: <20050605144429.2327F14081C6@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/tmp/cvs-serv11549/contrib Modified Files: tor.sh.in torctl.in Log Message: [bug 144] Have torctl.in/tor.sh.in check for location of su binary. Index: tor.sh.in =================================================================== RCS file: /home/or/cvsroot/tor/contrib/tor.sh.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- tor.sh.in 19 Nov 2004 08:36:25 -0000 1.8 +++ tor.sh.in 5 Jun 2005 14:44:27 -0000 1.9 @@ -24,6 +24,18 @@ fi RETVAL=0 +if [ -x /bin/su ] ; then + SUPROG=/bin/su +elif [ -x /sbin/su ] ; then + SUPROG=/sbin/su +elif [ -x /usr/bin/su ] ; then + SUPROG=/usr/bin/su +elif [ -x /usr/sbin/su ] ; then + SUPROG=/usr/sbin/su +else + SUPROG=/bin/su +fi + case "$1" in start) @@ -36,7 +48,7 @@ if [ "x$TORUSER" = "x" ]; then $TORBIN -f $TORCONF $TORARGS else - /bin/su -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER + $SUPROG -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER fi RETVAL=$? if [ $RETVAL -eq 0 ]; then Index: torctl.in =================================================================== RCS file: /home/or/cvsroot/tor/contrib/torctl.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- torctl.in 19 Nov 2004 08:36:25 -0000 1.2 +++ torctl.in 5 Jun 2005 14:44:27 -0000 1.3 @@ -54,11 +54,23 @@ TORARGS="$TORARGS --group $TORGROUP" fi +if [ -x /bin/su ] ; then + SUPROG=/bin/su +elif [ -x /sbin/su ] ; then + SUPROG=/sbin/su +elif [ -x /usr/bin/su ] ; then + SUPROG=/usr/bin/su +elif [ -x /usr/sbin/su ] ; then + SUPROG=/usr/sbin/su +else + SUPROG=/bin/su +fi + # the command used to start if [ "x$TORUSER" = "x" ]; then START="$TORBIN -f $TORCONF $TORARGS" else - START="/bin/su -c \\"$TORBIN -f $TORCONF $TORARGS\\" $TORUSER" + START="$SUPROG -c \\"$TORBIN -f $TORCONF $TORARGS\\" $TORUSER" fi # From nickm at seul.org Thu Jun 9 18:43:45 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 14:43:45 -0400 (EDT) Subject: [or-cvs] Add OSX uninstall instructions Message-ID: <20050609184345.D74AC140806D@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv3267/doc Modified Files: tor-doc-osx.html Log Message: Add OSX uninstall instructions Index: tor-doc-osx.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-osx.html,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- tor-doc-osx.html 9 Jun 2005 02:14:32 -0000 1.29 +++ tor-doc-osx.html 9 Jun 2005 18:43:43 -0000 1.30 @@ -150,6 +150,33 @@ them on our bugtracker in the website category. Thanks!

+

How To Uninstall

+ +

The Tor 0.1.0.x series does not come with an uninstaller; this feature + will be added in the 0.1.1.x series. If you want to remove Tor on OSX, + here's how:

+ +

Change your application proxy settings back to their original values. + If you just want to stop using Tor, you can end at this point.

+ +

To stop Tor and Privoxy from running on startup, remove the + /Library/StartupItems/Tor and /Library/StartupItems/Privoxy directories + respectively. If you just want to stop Tor from running, you can end at this + point.

+ +

To erase all remaining Tor and Privoxy files from your computer, delete + the following: +

+

+ From nickm at seul.org Thu Jun 9 18:47:24 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 14:47:24 -0400 (EDT) Subject: [or-cvs] Backport osx documentation tweaks Message-ID: <20050609184724.9BB2E1408090@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv3448/doc Modified Files: Tag: tor-0_1_0-patches tor-doc-osx.html Log Message: Backport osx documentation tweaks Index: tor-doc-osx.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-osx.html,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -u -d -r1.27 -r1.27.2.1 --- tor-doc-osx.html 24 May 2005 22:28:21 -0000 1.27 +++ tor-doc-osx.html 9 Jun 2005 18:47:22 -0000 1.27.2.1 @@ -1,3 +1,4 @@ + @@ -21,7 +22,7 @@ server" section at tor-doc.html.

-This document was updated May 23 2005. +This document was updated June 08 2005.

The latest beta release of Tor for Macintosh OS X is -

Select and enter localhost and port 8118 for both Web Proxy (HTTP) -and your Secure Web Proxy (HTTPS)

+

Select and enter 127.0.0.1 and port 8118 for both Web Proxy (HTTP) +and your Secure Web Proxy (HTTPS). Leave your Use Passive FTP Mode (PASV) setting as is.

Using privoxy is necessary because browsers @@ -149,6 +150,33 @@ them on our bugtracker in the website category. Thanks!

+

How To Uninstall

+ +

The Tor 0.1.0.x series does not come with an uninstaller; this feature + will be added in the 0.1.1.x series. If you want to remove Tor on OSX, + here's how:

+ +

Change your application proxy settings back to their original values. + If you just want to stop using Tor, you can end at this point.

+ +

To stop Tor and Privoxy from running on startup, remove the + /Library/StartupItems/Tor and /Library/StartupItems/Privoxy directories + respectively. If you just want to stop Tor from running, you can end at this + point.

+ +

To erase all remaining Tor and Privoxy files from your computer, delete + the following: +

+

+ From nickm at seul.org Thu Jun 9 19:03:33 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 15:03:33 -0400 (EDT) Subject: [or-cvs] Change end-of-file NLNL convention. It turns out arma I an... Message-ID: <20050609190333.3723E14005D7@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/tmp/cvs-serv4061/contrib Modified Files: checkSpace.pl Log Message: Change end-of-file NLNL convention. It turns out arma I and I agree. Index: checkSpace.pl =================================================================== RCS file: /home/or/cvsroot/tor/contrib/checkSpace.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- checkSpace.pl 9 Jun 2005 16:46:50 -0000 1.6 +++ checkSpace.pl 9 Jun 2005 19:03:31 -0000 1.7 @@ -75,7 +75,7 @@ } } } - if ($lastnil) { + if (! $lastnil) { print " EOL\@EOF:$fn:$.\n"; } close(F); From nickm at seul.org Thu Jun 9 19:03:33 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 15:03:33 -0400 (EDT) Subject: [or-cvs] Change end-of-file NLNL convention. It turns out arma I an... Message-ID: <20050609190333.AF61A14081EC@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv4061/src/common Modified Files: aes.c aes.h compat.c compat.h container.c container.h crypto.c crypto.h log.c log.h test.h torgzip.c torgzip.h torint.h tortls.c tortls.h util.c util.h Log Message: Change end-of-file NLNL convention. It turns out arma I and I agree. Index: aes.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/aes.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- aes.c 9 Jun 2005 16:46:50 -0000 1.19 +++ aes.c 9 Jun 2005 19:03:31 -0000 1.20 @@ -812,3 +812,4 @@ rk[3]; PUTU32(ct + 12, s3); } + Index: aes.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/aes.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- aes.h 9 Jun 2005 16:46:50 -0000 1.11 +++ aes.h 9 Jun 2005 19:03:31 -0000 1.12 @@ -28,3 +28,4 @@ void aes_adjust_counter(aes_cnt_cipher_t *cipher, long delta); #endif + Index: compat.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/compat.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- compat.c 7 Jun 2005 13:45:58 -0000 1.48 +++ compat.c 9 Jun 2005 19:03:31 -0000 1.49 @@ -1031,3 +1031,4 @@ #endif return 0; } + Index: compat.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/compat.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- compat.h 10 May 2005 20:02:52 -0000 1.29 +++ compat.h 9 Jun 2005 19:03:31 -0000 1.30 @@ -239,3 +239,4 @@ #endif #endif + Index: container.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/container.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- container.c 9 Jun 2005 16:46:50 -0000 1.26 +++ container.c 9 Jun 2005 19:03:31 -0000 1.27 @@ -649,3 +649,4 @@ { return SPLAY_EMPTY(&map->head); } + Index: container.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/container.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- container.h 3 Apr 2005 05:52:32 -0000 1.12 +++ container.h 9 Jun 2005 19:03:31 -0000 1.13 @@ -94,3 +94,4 @@ int strmap_iter_done(strmap_iter_t *iter); #endif + Index: crypto.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v retrieving revision 1.138 retrieving revision 1.139 diff -u -d -r1.138 -r1.139 --- crypto.c 6 Jun 2005 20:02:09 -0000 1.138 +++ crypto.c 9 Jun 2005 19:03:31 -0000 1.139 @@ -1675,3 +1675,4 @@ #else static int setup_openssl_threading(void) { return 0; } #endif + Index: crypto.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/crypto.h,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- crypto.h 9 Jun 2005 16:46:50 -0000 1.62 +++ crypto.h 9 Jun 2005 19:03:31 -0000 1.63 @@ -160,3 +160,4 @@ size_t secret_len, const char *s2k_specifier); #endif + Index: log.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/log.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- log.c 8 Jun 2005 17:41:32 -0000 1.94 +++ log.c 9 Jun 2005 19:03:31 -0000 1.95 @@ -537,3 +537,4 @@ void configure_libevent_logging(void) {} void suppress_libevent_log_msg(const char *msg) {} #endif + Index: log.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/log.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- log.h 9 Jun 2005 16:46:50 -0000 1.45 +++ log.h 9 Jun 2005 19:03:31 -0000 1.46 @@ -99,3 +99,4 @@ # define __LOG_H #endif + Index: test.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/test.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- test.h 9 Jun 2005 16:46:50 -0000 1.21 +++ test.h 9 Jun 2005 19:03:31 -0000 1.22 @@ -136,3 +136,4 @@ } STMT_END #endif + Index: torgzip.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/torgzip.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- torgzip.c 7 May 2005 05:55:05 -0000 1.16 +++ torgzip.c 9 Jun 2005 19:03:31 -0000 1.17 @@ -245,3 +245,4 @@ return 0; } } + Index: torgzip.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/torgzip.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- torgzip.h 1 Apr 2005 20:15:54 -0000 1.6 +++ torgzip.h 9 Jun 2005 19:03:31 -0000 1.7 @@ -30,3 +30,4 @@ int detect_compression_method(const char *in, size_t in_len); #endif + Index: torint.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/torint.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- torint.h 9 Jun 2005 16:46:50 -0000 1.20 +++ torint.h 9 Jun 2005 19:03:31 -0000 1.21 @@ -250,3 +250,4 @@ #define SIZE_T_CEILING (sizeof(char)<<(sizeof(size_t)*8 - 1)) #endif /* __TORINT_H */ + Index: tortls.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/tortls.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- tortls.c 9 Jun 2005 16:46:50 -0000 1.95 +++ tortls.c 9 Jun 2005 19:03:31 -0000 1.96 @@ -859,3 +859,4 @@ fname, line); tls_log_errors(LOG_WARN, NULL); } + Index: tortls.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/tortls.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- tortls.h 9 Jun 2005 16:46:50 -0000 1.28 +++ tortls.h 9 Jun 2005 19:03:31 -0000 1.29 @@ -51,3 +51,4 @@ void _check_no_tls_errors(const char *fname, int line); #endif + Index: util.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/util.c,v retrieving revision 1.208 retrieving revision 1.209 diff -u -d -r1.208 -r1.209 --- util.c 6 Apr 2005 19:07:35 -0000 1.208 +++ util.c 9 Jun 2005 19:03:31 -0000 1.209 @@ -1443,3 +1443,4 @@ } #endif } + Index: util.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/util.h,v retrieving revision 1.133 retrieving revision 1.134 diff -u -d -r1.133 -r1.134 --- util.h 26 Apr 2005 18:52:14 -0000 1.133 +++ util.h 9 Jun 2005 19:03:31 -0000 1.134 @@ -142,3 +142,4 @@ void write_pidfile(char *filename); #endif + From nickm at seul.org Thu Jun 9 19:03:35 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 15:03:35 -0400 (EDT) Subject: [or-cvs] Change end-of-file NLNL convention. It turns out arma I an... Message-ID: <20050609190335.2CEEB1408084@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv4061/src/or Modified Files: buffers.c circuitbuild.c circuitlist.c circuituse.c command.c config.c connection.c connection_edge.c connection_or.c control.c cpuworker.c directory.c dirserv.c dns.c hibernate.c main.c onion.c or.h relay.c rendclient.c rendcommon.c rendmid.c rendservice.c rephist.c router.c routerlist.c routerparse.c test.c tor_main.c tree.h Log Message: Change end-of-file NLNL convention. It turns out arma I and I agree. Index: buffers.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/buffers.c,v retrieving revision 1.157 retrieving revision 1.158 diff -u -d -r1.157 -r1.158 --- buffers.c 9 Jun 2005 03:57:54 -0000 1.157 +++ buffers.c 9 Jun 2005 19:03:31 -0000 1.158 @@ -1093,3 +1093,4 @@ } #endif } + Index: circuitbuild.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuitbuild.c,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- circuitbuild.c 9 Jun 2005 16:46:51 -0000 1.116 +++ circuitbuild.c 9 Jun 2005 19:03:31 -0000 1.117 @@ -1475,3 +1475,4 @@ return 0; } + Index: circuitlist.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuitlist.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- circuitlist.c 9 Jun 2005 16:46:51 -0000 1.48 +++ circuitlist.c 9 Jun 2005 19:03:31 -0000 1.49 @@ -707,3 +707,4 @@ tor_assert(!c->rend_splice); } } + Index: circuituse.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuituse.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- circuituse.c 15 May 2005 05:00:24 -0000 1.72 +++ circuituse.c 9 Jun 2005 19:03:31 -0000 1.73 @@ -1140,3 +1140,4 @@ return 0; } } + Index: command.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/command.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- command.c 9 Jun 2005 16:46:51 -0000 1.89 +++ command.c 9 Jun 2005 19:03:31 -0000 1.90 @@ -335,3 +335,4 @@ } } } + Index: config.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.358 retrieving revision 1.359 diff -u -d -r1.358 -r1.359 --- config.c 8 Jun 2005 20:45:29 -0000 1.358 +++ config.c 9 Jun 2005 19:03:31 -0000 1.359 @@ -2785,3 +2785,4 @@ puts(routerlist_c_id); puts(routerparse_c_id); } + Index: connection.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection.c,v retrieving revision 1.375 retrieving revision 1.376 diff -u -d -r1.375 -r1.376 --- connection.c 9 Jun 2005 08:54:42 -0000 1.375 +++ connection.c 9 Jun 2005 19:03:31 -0000 1.376 @@ -1817,3 +1817,4 @@ tor_assert(0); } } + Index: connection_edge.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v retrieving revision 1.329 retrieving revision 1.330 diff -u -d -r1.329 -r1.330 --- connection_edge.c 9 Jun 2005 16:46:51 -0000 1.329 +++ connection_edge.c 9 Jun 2005 19:03:31 -0000 1.330 @@ -1720,3 +1720,4 @@ *s = '.'; return BAD_HOSTNAME; } + Index: connection_or.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_or.c,v retrieving revision 1.176 retrieving revision 1.177 diff -u -d -r1.176 -r1.177 --- connection_or.c 9 Jun 2005 16:46:51 -0000 1.176 +++ connection_or.c 9 Jun 2005 19:03:31 -0000 1.177 @@ -635,3 +635,4 @@ goto loop; /* process the remainder of the buffer */ } + Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- control.c 5 Jun 2005 14:28:47 -0000 1.84 +++ control.c 9 Jun 2005 19:03:31 -0000 1.85 @@ -1303,3 +1303,4 @@ return 0; } + Index: cpuworker.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/cpuworker.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- cpuworker.c 9 Jun 2005 16:46:51 -0000 1.80 +++ cpuworker.c 9 Jun 2005 19:03:31 -0000 1.81 @@ -430,3 +430,4 @@ } return 0; } + Index: directory.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/directory.c,v retrieving revision 1.231 retrieving revision 1.232 diff -u -d -r1.231 -r1.232 --- directory.c 9 Jun 2005 16:46:51 -0000 1.231 +++ directory.c 9 Jun 2005 19:03:31 -0000 1.232 @@ -1190,3 +1190,4 @@ conn->state = DIR_CONN_STATE_CLIENT_SENDING; /* start flushing conn */ return 0; } + Index: dirserv.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v retrieving revision 1.164 retrieving revision 1.165 diff -u -d -r1.164 -r1.165 --- dirserv.c 9 Jun 2005 10:21:55 -0000 1.164 +++ dirserv.c 9 Jun 2005 19:03:31 -0000 1.165 @@ -1043,3 +1043,4 @@ memset(&cached_directory, 0, sizeof(cached_directory)); memset(&cached_runningrouters, 0, sizeof(cached_runningrouters)); } + Index: dns.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/dns.c,v retrieving revision 1.155 retrieving revision 1.156 diff -u -d -r1.155 -r1.156 --- dns.c 9 Jun 2005 16:46:51 -0000 1.155 +++ dns.c 9 Jun 2005 19:03:31 -0000 1.156 @@ -877,3 +877,4 @@ num_dnsworkers--; } } + Index: hibernate.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/hibernate.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- hibernate.c 9 Jun 2005 16:46:51 -0000 1.52 +++ hibernate.c 9 Jun 2005 19:03:31 -0000 1.53 @@ -832,3 +832,4 @@ } } } + Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.513 retrieving revision 1.514 diff -u -d -r1.513 -r1.514 --- main.c 9 Jun 2005 16:46:51 -0000 1.513 +++ main.c 9 Jun 2005 19:03:31 -0000 1.514 @@ -1624,3 +1624,4 @@ tor_cleanup(); return -1; } + Index: onion.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/onion.c,v retrieving revision 1.179 retrieving revision 1.180 diff -u -d -r1.179 -r1.180 --- onion.c 7 May 2005 05:55:06 -0000 1.179 +++ onion.c 9 Jun 2005 19:03:31 -0000 1.180 @@ -404,3 +404,4 @@ ol_list = ol_tail = NULL; ol_length = 0; } + Index: or.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.612 retrieving revision 1.613 diff -u -d -r1.612 -r1.613 --- or.h 8 Jun 2005 19:45:17 -0000 1.612 +++ or.h 9 Jun 2005 19:03:31 -0000 1.613 @@ -1887,3 +1887,4 @@ void assert_addr_policy_ok(addr_policy_t *t); #endif + Index: relay.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/relay.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- relay.c 9 Jun 2005 16:46:51 -0000 1.70 +++ relay.c 9 Jun 2005 19:03:31 -0000 1.71 @@ -1211,3 +1211,4 @@ } } } + Index: rendclient.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendclient.c,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- rendclient.c 9 Jun 2005 16:46:51 -0000 1.87 +++ rendclient.c 9 Jun 2005 19:03:31 -0000 1.88 @@ -447,3 +447,4 @@ smartlist_free(sl); return nickname; } + Index: rendcommon.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendcommon.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- rendcommon.c 9 Jun 2005 16:46:51 -0000 1.48 +++ rendcommon.c 9 Jun 2005 19:03:31 -0000 1.49 @@ -358,3 +358,4 @@ tor_assert(0); } } + Index: rendmid.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendmid.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- rendmid.c 9 Jun 2005 16:46:51 -0000 1.39 +++ rendmid.c 9 Jun 2005 19:03:31 -0000 1.40 @@ -289,3 +289,4 @@ circuit_mark_for_close(circ); return -1; } + Index: rendservice.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendservice.c,v retrieving revision 1.124 retrieving revision 1.125 diff -u -d -r1.124 -r1.125 --- rendservice.c 9 Jun 2005 16:46:51 -0000 1.124 +++ rendservice.c 9 Jun 2005 19:03:31 -0000 1.125 @@ -1028,3 +1028,4 @@ conn->port,serviceid); return -1; } + Index: rephist.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rephist.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- rephist.c 6 Jun 2005 17:03:21 -0000 1.57 +++ rephist.c 9 Jun 2005 19:03:31 -0000 1.58 @@ -758,3 +758,4 @@ tor_free(write_array); predicted_ports_free(); } + Index: router.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/router.c,v retrieving revision 1.178 retrieving revision 1.179 diff -u -d -r1.178 -r1.179 --- router.c 9 Jun 2005 08:54:42 -0000 1.178 +++ router.c 9 Jun 2005 19:03:31 -0000 1.179 @@ -970,3 +970,4 @@ if (desc_routerinfo) routerinfo_free(desc_routerinfo); } + Index: routerlist.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v retrieving revision 1.236 retrieving revision 1.237 diff -u -d -r1.236 -r1.237 --- routerlist.c 9 Jun 2005 16:46:51 -0000 1.236 +++ routerlist.c 9 Jun 2005 19:03:31 -0000 1.237 @@ -1459,3 +1459,4 @@ trusted_dir_servers = smartlist_create(); } } + Index: routerparse.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/routerparse.c,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- routerparse.c 17 May 2005 17:01:36 -0000 1.110 +++ routerparse.c 9 Jun 2005 19:03:31 -0000 1.111 @@ -1631,3 +1631,4 @@ (a->minor == b->minor) && (a->micro == b->micro)); } + Index: test.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/test.c,v retrieving revision 1.179 retrieving revision 1.180 diff -u -d -r1.179 -r1.180 --- test.c 7 Jun 2005 18:01:46 -0000 1.179 +++ test.c 9 Jun 2005 19:03:31 -0000 1.180 @@ -1463,3 +1463,4 @@ else return 0; } + Index: tor_main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/tor_main.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- tor_main.c 9 Jun 2005 16:46:51 -0000 1.9 +++ tor_main.c 9 Jun 2005 19:03:31 -0000 1.10 @@ -18,3 +18,4 @@ { return tor_main(argc, argv); } + Index: tree.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/tree.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tree.h 7 Apr 2004 19:57:39 -0000 1.2 +++ tree.h 9 Jun 2005 19:03:31 -0000 1.3 @@ -675,3 +675,4 @@ (x) = name##_RB_NEXT(head, x)) #endif /* _SYS_TREE_H_ */ + From nickm at seul.org Thu Jun 9 19:53:34 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 15:53:34 -0400 (EDT) Subject: [or-cvs] add solaris to poorly threading platforms Message-ID: <20050609195334.9093A1408060@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/tmp/cvs-serv6618 Modified Files: configure.in Log Message: add solaris to poorly threading platforms Index: configure.in =================================================================== RCS file: /home/or/cvsroot/tor/configure.in,v retrieving revision 1.214 retrieving revision 1.215 diff -u -d -r1.214 -r1.215 --- configure.in 7 Jun 2005 18:21:32 -0000 1.214 +++ configure.in 9 Jun 2005 19:53:32 -0000 1.215 @@ -30,6 +30,11 @@ AC_MSG_NOTICE([You are running OpenBSD or NetBSD; I am assuming that getaddrinfo is not threadsafe here, so I will disable threads.]) enable_threads="no";; + *-*-solaris* ) + # Don't try multithreading on solaris -- cpuworkers seem to lock. + AC_MSG_NOTICE([You are running Solaris; Sometimes threading makes +cpu workers lock up here, so I will disable threads.]) + enable_threads="no";; *) enable_threads="yes";; esac From nickm at seul.org Thu Jun 9 20:20:06 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 16:20:06 -0400 (EDT) Subject: [or-cvs] Backport: add solaris to poorly threading platforms Message-ID: <20050609202006.8DEE8140806A@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/tmp/cvs-serv7722 Modified Files: Tag: tor-0_1_0-patches configure.in Log Message: Backport: add solaris to poorly threading platforms Index: configure.in =================================================================== RCS file: /home/or/cvsroot/tor/configure.in,v retrieving revision 1.212.2.1 retrieving revision 1.212.2.2 diff -u -d -r1.212.2.1 -r1.212.2.2 --- configure.in 7 Jun 2005 18:26:26 -0000 1.212.2.1 +++ configure.in 9 Jun 2005 20:20:04 -0000 1.212.2.2 @@ -30,6 +30,11 @@ AC_MSG_NOTICE([You are running OpenBSD or NetBSD; I am assuming that getaddrinfo is not threadsafe here, so I will disable threads.]) enable_threads="no";; + *-*-solaris* ) + # Don't try multithreading on solaris -- cpuworkers seem to lock. + AC_MSG_NOTICE([You are running Solaris; Sometimes threading makes +cpu workers lock up here, so I will disable threads.]) + enable_threads="no";; *) enable_threads="yes";; esac From nickm at seul.org Thu Jun 9 20:20:38 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 9 Jun 2005 16:20:38 -0400 (EDT) Subject: [or-cvs] Update TODO status Message-ID: <20050609202038.D8A93140806A@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv7810/doc Modified Files: TODO Log Message: Update TODO status Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.315 retrieving revision 1.316 diff -u -d -r1.315 -r1.316 --- TODO 9 Jun 2005 17:35:27 -0000 1.315 +++ TODO 9 Jun 2005 20:20:36 -0000 1.316 @@ -13,12 +13,11 @@ X Abandoned For 0.1.0.x: - - Why do solaris cpuworks go dormant? + o Why do solaris cpuworks go dormant? (Apparently, disabling threads fixes this.) - Why does kevent barf with EINVAL on some freebsd boxes? (Lucky is trying a patch that should tell us why.) - - Fix the remaining flyspray bugs marked for 0.1.0.9 - (Only 124 remains.) + o Fix the remaining flyspray bugs marked for 0.1.0.9 X Free remaining unfreed memory (arma will run valgrind) (Not for a stable release) o Note libevent/method/platform combos that are unlikely to work. From arma at seul.org Thu Jun 9 21:21:14 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 17:21:14 -0400 (EDT) Subject: [or-cvs] a few more entries on the 0109-rc changelog Message-ID: <20050609212114.BB0AD1408059@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/home/arma/work/onion/tor-010x/tor Modified Files: Tag: tor-0_1_0-patches ChangeLog Log Message: a few more entries on the 0109-rc changelog Index: ChangeLog =================================================================== RCS file: /home/or/cvsroot/tor/ChangeLog,v retrieving revision 1.93.2.4 retrieving revision 1.93.2.5 diff -u -d -r1.93.2.4 -r1.93.2.5 --- ChangeLog 9 Jun 2005 10:29:22 -0000 1.93.2.4 +++ ChangeLog 9 Jun 2005 21:21:12 -0000 1.93.2.5 @@ -6,6 +6,8 @@ - Security fix: if seeding the RNG on Win32 fails, quit. - Allow seeding the RNG on Win32 even when you're not running as Administrator. + - Disable threading on Solaris too. Something is wonky with it, + cpuworkers, and reentrant libs. - Reenable the part of the code that tries to flush as soon as an OR outbuf has a full TLS record available. Perhaps this will make OR outbufs not grow as huge except in rare cases, thus saving lots @@ -33,6 +35,8 @@ addresses. We have too many servers that are configured with private IPs and their admins never notice the log entries complaining that their descriptors are being rejected. + - Add OSX uninstall instructions. An actual uninstall script will + come later. Changes in version 0.1.0.8-rc - 2005-05-23 From arma at seul.org Thu Jun 9 21:23:56 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 17:23:56 -0400 (EDT) Subject: [or-cvs] don"t tell people you"re publishing the server descriptor i... Message-ID: <20050609212356.261CC1408069@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: router.c Log Message: don't tell people you're publishing the server descriptor if you're actually not. Index: router.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/router.c,v retrieving revision 1.179 retrieving revision 1.180 diff -u -d -r1.179 -r1.180 --- router.c 9 Jun 2005 19:03:31 -0000 1.179 +++ router.c 9 Jun 2005 21:23:54 -0000 1.180 @@ -414,7 +414,8 @@ void router_orport_found_reachable(void) { if (!can_reach_or_port) { if (!clique_mode(get_options())) - log(LOG_NOTICE,"Your ORPort is reachable from the outside. Excellent. Publishing server descriptor."); + log(LOG_NOTICE,"Your ORPort is reachable from the outside. Excellent.%s", + get_options()->NoPublish ? "" : " Publishing server descriptor."); can_reach_or_port = 1; consider_publishable_server(time(NULL), 1); } From nickm at seul.org Sun Jun 5 14:44:46 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 5 Jun 2005 10:44:46 -0400 (EDT) Subject: [or-cvs] backport: [bug 144] Have torctl.in/tor.sh.in check for loca... Message-ID: <20050605144446.0A1BB14081C6@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/tmp/cvs-serv11643/contrib Modified Files: Tag: tor-0_1_0-patches tor.sh.in torctl.in Log Message: backport: [bug 144] Have torctl.in/tor.sh.in check for location of su binary. Index: tor.sh.in =================================================================== RCS file: /home/or/cvsroot/tor/contrib/tor.sh.in,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -u -d -r1.8 -r1.8.4.1 --- tor.sh.in 19 Nov 2004 08:36:25 -0000 1.8 +++ tor.sh.in 5 Jun 2005 14:44:43 -0000 1.8.4.1 @@ -24,6 +24,18 @@ fi RETVAL=0 +if [ -x /bin/su ] ; then + SUPROG=/bin/su +elif [ -x /sbin/su ] ; then + SUPROG=/sbin/su +elif [ -x /usr/bin/su ] ; then + SUPROG=/usr/bin/su +elif [ -x /usr/sbin/su ] ; then + SUPROG=/usr/sbin/su +else + SUPROG=/bin/su +fi + case "$1" in start) @@ -36,7 +48,7 @@ if [ "x$TORUSER" = "x" ]; then $TORBIN -f $TORCONF $TORARGS else - /bin/su -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER + $SUPROG -c "$TORBIN -f $TORCONF $TORARGS" $TORUSER fi RETVAL=$? if [ $RETVAL -eq 0 ]; then Index: torctl.in =================================================================== RCS file: /home/or/cvsroot/tor/contrib/torctl.in,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -u -d -r1.2 -r1.2.4.1 --- torctl.in 19 Nov 2004 08:36:25 -0000 1.2 +++ torctl.in 5 Jun 2005 14:44:43 -0000 1.2.4.1 @@ -54,11 +54,23 @@ TORARGS="$TORARGS --group $TORGROUP" fi +if [ -x /bin/su ] ; then + SUPROG=/bin/su +elif [ -x /sbin/su ] ; then + SUPROG=/sbin/su +elif [ -x /usr/bin/su ] ; then + SUPROG=/usr/bin/su +elif [ -x /usr/sbin/su ] ; then + SUPROG=/usr/sbin/su +else + SUPROG=/bin/su +fi + # the command used to start if [ "x$TORUSER" = "x" ]; then START="$TORBIN -f $TORCONF $TORARGS" else - START="/bin/su -c \\"$TORBIN -f $TORCONF $TORARGS\\" $TORUSER" + START="$SUPROG -c \\"$TORBIN -f $TORCONF $TORARGS\\" $TORUSER" fi # From arma at seul.org Thu Jun 9 21:26:48 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 17:26:48 -0400 (EDT) Subject: [or-cvs] backport: don"t tell people you"re publishing the server de... Message-ID: <20050609212648.D44B7140806D@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/tor-010x/tor/src/or Modified Files: Tag: tor-0_1_0-patches router.c Log Message: backport: don't tell people you're publishing the server descriptor if you're actually not. Index: router.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/router.c,v retrieving revision 1.176.2.1 retrieving revision 1.176.2.2 diff -u -d -r1.176.2.1 -r1.176.2.2 --- router.c 9 Jun 2005 09:16:12 -0000 1.176.2.1 +++ router.c 9 Jun 2005 21:26:46 -0000 1.176.2.2 @@ -414,7 +414,8 @@ void router_orport_found_reachable(void) { if (!can_reach_or_port) { if (!clique_mode(get_options())) - log(LOG_NOTICE,"Your ORPort is reachable from the outside. Excellent. Publishing server descriptor."); + log(LOG_NOTICE,"Your ORPort is reachable from the outside. Excellent.%s", + get_options()->NoPublish ? "" : " Publishing server descriptor."); can_reach_or_port = 1; consider_publishable_server(time(NULL), 1); } From arma at seul.org Thu Jun 9 22:04:56 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 18:04:56 -0400 (EDT) Subject: [or-cvs] add the eff donate button Message-ID: <20050609220456.2442C1408080@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: contribute.html index.html stylesheet.css Log Message: add the eff donate button Index: contribute.html =================================================================== RCS file: /home2/or/cvsroot/website/contribute.html,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- contribute.html 28 May 2005 11:36:31 -0000 1.53 +++ contribute.html 9 Jun 2005 22:04:54 -0000 1.54 @@ -57,7 +57,7 @@
  • Tell your friends! Get them to run servers. Get them to run hidden services. Get them to tell their friends.
  • What else needs to be documented? What is mis-documented?
  • -
  • Go take a look at the Electronic +
  • Consider joining the Electronic Frontier Foundation. More EFF donations means more freedom in the world, including more Tor development.
  • Index: index.html =================================================================== RCS file: /home2/or/cvsroot/website/index.html,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- index.html 23 May 2005 16:24:47 -0000 1.55 +++ index.html 9 Jun 2005 22:04:54 -0000 1.56 @@ -43,8 +43,12 @@
    - +How Tor Works +
    +Support Tor by giving to EFF +
    + @@ -140,7 +144,7 @@ -Tor development is supported by EFF Index: stylesheet.css =================================================================== RCS file: /home2/or/cvsroot/website/stylesheet.css,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- stylesheet.css 8 Jun 2005 02:27:01 -0000 1.16 +++ stylesheet.css 9 Jun 2005 22:04:54 -0000 1.17 @@ -198,3 +198,29 @@ width: 24px; } +.donatebutton { + width: auto; + text-align: center; +} + +.donatebutton a { + margin: 10px 0 0 0; + font-weight: bold; + display: block; + padding: 6px; + background-color: #00802B; + border-top: 1px solid #00A838; + border-left: 1px solid #00A838; + border-bottom: 1px solid #00591E; + border-right: 1px solid #00591E; + color: #FFFFFF; +} + +.donatebutton a:hover { + color: orange; +} + +.donatebutton a:active { + color: orange; +} + From arma at seul.org Thu Jun 9 22:09:34 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 18:09:34 -0400 (EDT) Subject: [or-cvs] add the onr logo Message-ID: <20050609220934.E735A1408080@moria.seul.org> Update of /home2/or/cvsroot/website/images In directory moria:/home/arma/work/onion/cvs/website/images Added Files: onr-logo.jpg Log Message: add the onr logo --- NEW FILE: onr-logo.jpg --- (This appears to be a binary file; contents omitted.) From arma at seul.org Thu Jun 9 22:10:09 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 18:10:09 -0400 (EDT) Subject: [or-cvs] link the onr logo too Message-ID: <20050609221009.03AD71408080@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: index.html Log Message: link the onr logo too Index: index.html =================================================================== RCS file: /home2/or/cvsroot/website/index.html,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- index.html 9 Jun 2005 22:04:54 -0000 1.56 +++ index.html 9 Jun 2005 22:10:06 -0000 1.57 @@ -146,6 +146,8 @@ Tor development is supported by EFF +
    From arma at seul.org Thu Jun 9 22:13:22 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 18:13:22 -0400 (EDT) Subject: [or-cvs] use the correct pretty picture Message-ID: <20050609221322.422CF1408020@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: index.html Log Message: use the correct pretty picture Index: index.html =================================================================== RCS file: /home2/or/cvsroot/website/index.html,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- index.html 9 Jun 2005 22:10:06 -0000 1.57 +++ index.html 9 Jun 2005 22:13:20 -0000 1.58 @@ -44,7 +44,7 @@
    How Tor Works +src="images/how_tor_works_thumb.png" alt="How Tor Works">
    Support Tor by giving to EFF
    From arma at seul.org Thu Jun 9 22:24:52 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 18:24:52 -0400 (EDT) Subject: [or-cvs] clean up mailing list mentions Message-ID: <20050609222452.F110F140841B@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: documentation.html Log Message: clean up mailing list mentions Index: documentation.html =================================================================== RCS file: /home2/or/cvsroot/website/documentation.html,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- documentation.html 8 Jun 2005 05:55:00 -0000 1.34 +++ documentation.html 9 Jun 2005 22:24:50 -0000 1.35 @@ -123,11 +123,11 @@
  • The or-announce mailing list is a low volume list for announcements of new releases.
  • -
  • The or-dev mailing -list is for posting by developers only and is where we send -notifications of prereleases and release candidates.
  • The or-talk mailing -list is where a lot of the discussion happens.
  • +list is where a lot of the discussion happens, and is where we +send notifications of prereleases and release candidates. +
  • The or-dev mailing +list is for posting by developers only, and is very low traffic.
  • There's also a list for cvs commits.
  • From arma at seul.org Thu Jun 9 22:26:02 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 18:26:02 -0400 (EDT) Subject: [or-cvs] swap out diabetes people reference, put in indymedia Message-ID: <20050609222602.DBA921408277@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: overview.html Log Message: swap out diabetes people reference, put in indymedia Index: overview.html =================================================================== RCS file: /home2/or/cvsroot/website/overview.html,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- overview.html 19 May 2005 13:29:33 -0000 1.33 +++ overview.html 9 Jun 2005 22:26:00 -0000 1.34 @@ -61,7 +61,7 @@

    -Groups such as the German "Diabetes People" organization recommend Tor +Groups such as Indymedia recommend Tor for safeguarding their members' online privacy and security. Activist groups like the Electronic Frontier Foundation (EFF) are supporting Tor's development as a mechanism for maintaining civil liberties online. From arma at seul.org Thu Jun 9 23:48:47 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 19:48:47 -0400 (EDT) Subject: [or-cvs] bump 010x branch to 0.1.0.9-rc Message-ID: <20050609234847.B282C1408EBB@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/home/arma/work/onion/tor-010x/tor Modified Files: Tag: tor-0_1_0-patches configure.in Log Message: bump 010x branch to 0.1.0.9-rc Index: configure.in =================================================================== RCS file: /home/or/cvsroot/tor/configure.in,v retrieving revision 1.212.2.2 retrieving revision 1.212.2.3 diff -u -d -r1.212.2.2 -r1.212.2.3 --- configure.in 9 Jun 2005 20:20:04 -0000 1.212.2.2 +++ configure.in 9 Jun 2005 23:48:45 -0000 1.212.2.3 @@ -4,7 +4,7 @@ dnl See LICENSE for licensing information AC_INIT -AM_INIT_AUTOMAKE(tor, 0.1.0.8-rc) +AM_INIT_AUTOMAKE(tor, 0.1.0.9-rc) AM_CONFIG_HEADER(orconfig.h) AC_CANONICAL_HOST From arma at seul.org Thu Jun 9 23:48:48 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 19:48:48 -0400 (EDT) Subject: [or-cvs] bump 010x branch to 0.1.0.9-rc Message-ID: <20050609234848.F018A1408EB0@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/home/arma/work/onion/tor-010x/tor/contrib Modified Files: Tag: tor-0_1_0-patches tor.nsi Log Message: bump 010x branch to 0.1.0.9-rc Index: tor.nsi =================================================================== RCS file: /home/or/cvsroot/tor/contrib/tor.nsi,v retrieving revision 1.41 retrieving revision 1.41.2.1 diff -u -d -r1.41 -r1.41.2.1 --- tor.nsi 23 May 2005 05:47:21 -0000 1.41 +++ tor.nsi 9 Jun 2005 23:48:46 -0000 1.41.2.1 @@ -31,7 +31,7 @@ !include "MUI.nsh" -!define VERSION "0.1.0.8-rc" +!define VERSION "0.1.0.9-rc" !define INSTALLER "tor-${VERSION}-win32.exe" !define WEBSITE "http://tor.eff.org/" From arma at seul.org Thu Jun 9 23:48:49 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 19:48:49 -0400 (EDT) Subject: [or-cvs] bump 010x branch to 0.1.0.9-rc Message-ID: <20050609234849.D60361408ED0@moria.seul.org> Update of /home/or/cvsroot/tor/src/win32 In directory moria:/home/arma/work/onion/tor-010x/tor/src/win32 Modified Files: Tag: tor-0_1_0-patches orconfig.h Log Message: bump 010x branch to 0.1.0.9-rc Index: orconfig.h =================================================================== RCS file: /home/or/cvsroot/tor/src/win32/orconfig.h,v retrieving revision 1.60 retrieving revision 1.60.2.1 diff -u -d -r1.60 -r1.60.2.1 --- orconfig.h 23 May 2005 05:47:21 -0000 1.60 +++ orconfig.h 9 Jun 2005 23:48:47 -0000 1.60.2.1 @@ -215,4 +215,4 @@ #define HAVE_EVENT_H /* Version number of package */ -#define VERSION "0.1.0.8-rc" +#define VERSION "0.1.0.9-rc" From thomass at seul.org Mon Jun 6 14:54:21 2005 From: thomass at seul.org (thomass at seul.org) Date: Mon, 6 Jun 2005 10:54:21 -0400 (EDT) Subject: [or-cvs] tor-doc*.html is now valid HTML 4.01 Transitional Message-ID: <20050606145421.D34E51408205@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv1836 Modified Files: tor-doc.html tor-doc-osx.html tor-doc-win32.html Log Message: tor-doc*.html is now valid HTML 4.01 Transitional Index: tor-doc.html =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor-doc.html,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- tor-doc.html 24 May 2005 22:28:21 -0000 1.79 +++ tor-doc.html 6 Jun 2005 14:54:19 -0000 1.80 @@ -1,3 +1,4 @@ + Tor Documentation @@ -120,7 +121,7 @@ attacks. -

    Other things to note: +

    Other things to note:

    -

    You can read more about setting up Tor as a server below.

    @@ -311,10 +311,9 @@ href="http://archives.seul.org/or/talk/">or-talk (higher volume), where new development releases are announced. -

    Here's where Tor puts its files on many common platforms:

    - +
    Index: tor-doc-osx.html =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor-doc-osx.html,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- tor-doc-osx.html 24 May 2005 22:28:21 -0000 1.27 +++ tor-doc-osx.html 6 Jun 2005 14:54:19 -0000 1.28 @@ -1,3 +1,4 @@ + Index: tor-doc-win32.html =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor-doc-win32.html,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- tor-doc-win32.html 28 May 2005 11:21:30 -0000 1.43 +++ tor-doc-win32.html 6 Jun 2005 14:54:19 -0000 1.44 @@ -1,3 +1,5 @@ + + Tor Win32 Install Instructions From arma at seul.org Thu Jun 9 23:58:06 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 9 Jun 2005 19:58:06 -0400 (EDT) Subject: [or-cvs] link to 0.1.0.9-rc Message-ID: <20050609235806.6AE0E140802E@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: download.html Log Message: link to 0.1.0.9-rc Index: download.html =================================================================== RCS file: /home2/or/cvsroot/website/download.html,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- download.html 8 Jun 2005 23:19:42 -0000 1.101 +++ download.html 9 Jun 2005 23:58:04 -0000 1.102 @@ -46,34 +46,34 @@ under the 3-clause BSD license.

    You can get the latest release from the download -directory. The latest development release is 0.1.0.8-rc, and the +directory. The latest development release is 0.1.0.9-rc, and the latest stable release is 0.0.9.9. Tor should run on Linux, BSD, OS X, Win32, Solaris, and more.

    General instructions for installing and configuring Tor are here. +href="cvs/tor/doc/tor-doc.html#installing">here. This FAQ +entry explains how to verify package signatures.

    See the developers page for instructions From c at seul.org Fri Jun 10 19:36:26 2005 From: c at seul.org (c at seul.org) Date: Fri, 10 Jun 2005 15:36:26 -0400 (EDT) Subject: [or-cvs] Helpful or-talk post for people wanting to use Tor only wit... Message-ID: <20050610193626.277BF14080BD@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/tmp/cvs-serv25717 Added Files: proxy-some-domains Log Message: Helpful or-talk post for people wanting to use Tor only with some domains. --- NEW FILE: proxy-some-domains --- (This appears to be a binary file; contents omitted.) From thomass at seul.org Fri Jun 10 21:12:32 2005 From: thomass at seul.org (thomass at seul.org) Date: Fri, 10 Jun 2005 17:12:32 -0400 (EDT) Subject: [or-cvs] German translation update Message-ID: <20050610211232.B0C7914080BD@moria.seul.org> Update of /home2/or/cvsroot/website/de In directory moria:/tmp/cvs-serv29550/de Modified Files: contribute.de.html developers.de.html documentation.de.html download.de.html howitworks.de.html index.de.html overview.de.html users.de.html Log Message: German translation update Index: contribute.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/contribute.de.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- contribute.de.html 30 May 2005 10:54:16 -0000 1.2 +++ contribute.de.html 10 Jun 2005 21:12:30 -0000 1.3 @@ -1,4 +1,4 @@ - + @@ -7,9 +7,9 @@ Tor: Zum Projekt beitragen - - + + @@ -64,8 +64,8 @@ betreiben. Bringe sie dazu selbst versteckte Services zu betreiben. Bringe sie dazu, es ihren Freunden weiterzuerz?hlen.

  • Was muss noch dokumentiert werden? Was ist falsch dokumentiert?
  • -
  • Schaue auf die Webseite der Electronic -Frontier Foundation. Mehr Spenden an die EFF bedeutet mehr Freiheit in der +
  • ?berlege dir, der Electronic +Frontier Foundation beizutreten. Mehr Spenden an die EFF bedeutet mehr Freiheit in der Welt, eingeschlossen die Entwicklung von Tor
  • Index: developers.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/developers.de.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- developers.de.html 1 Jun 2005 15:58:10 -0000 1.1 +++ developers.de.html 10 Jun 2005 21:12:30 -0000 1.2 @@ -49,7 +49,7 @@

    Bl?ttere durch das CVS Repositorium von Tor: (das muss nicht notwendigerweise funktionieren oder kompilieren)

    - + - -
    UnixWindowsMac OS X
    Configuration /etc/torrc
    or /usr/local/etc/torrc
    UnixWindowsMac OS X
    Configuration /etc/torrc
    or /usr/local/etc/torrc
    \Application Data\username\tor\torrc
    or - \Application Data\tor\torrc
    \username\Application Data\tor\torrc
    or \Application Data\tor\torrc
    /Library/Tor/torrc
    Fingerprint /var/lib/tor/fingerprint or /usr/local/var/lib/tor/fingerprint\Application Data\username\tor\fingerprint + \username\Application Data\tor\fingerprint or \Application Data\tor\fingerprint /Library/Tor/var/lib/tor/fingerprint
    Logs /var/log/tor or /usr/local/var/log/tor\Application Data\username\tor\log + \username\Application Data\tor\torrc or \Application Data\tor\log /var/log/tor
    From weasel at seul.org Wed Jun 15 14:34:46 2005 From: weasel at seul.org (Peter Palfrader) Date: Wed, 15 Jun 2005 10:34:46 -0400 (EDT) Subject: [or-cvs] Changelog for a 0.1.0.10 debian prerelease Message-ID: <20050615143446.AD9DC14081FA@moria.seul.org> Update of /home/or/cvsroot/tor/debian In directory moria:/tmp/cvs-serv28735 Modified Files: Tag: tor-0_1_0-patches changelog Log Message: Changelog for a 0.1.0.10 debian prerelease Index: changelog =================================================================== RCS file: /home/or/cvsroot/tor/debian/changelog,v retrieving revision 1.120.2.3 retrieving revision 1.120.2.4 diff -u -d -r1.120.2.3 -r1.120.2.4 --- changelog 10 Jun 2005 16:08:13 -0000 1.120.2.3 +++ changelog 15 Jun 2005 14:34:44 -0000 1.120.2.4 @@ -1,6 +1,6 @@ -tor (0.1.0.9-rc-1) UNRELEASED; urgency=low +tor (0.1.0.10-0.pre.1) UNRELEASED; urgency=low - * New development version. + * New upstream version. * Add a watch file. * Forward port 03_tor_manpage_in_section_8. * Forward port 06_add_compile_time_defaults. @@ -17,7 +17,7 @@ * Don't fail in the init script when we cannot raise the ulimit. Instead just warn a bit (closes: #312882). - -- Peter Palfrader Fri, 10 Jun 2005 18:08:44 +0200 + -- Peter Palfrader Wed, 15 Jun 2005 16:38:06 +0200 tor (0.0.9.9-1) unstable; urgency=low From nickm at seul.org Wed Jun 15 15:18:24 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 15 Jun 2005 11:18:24 -0400 (EDT) Subject: [or-cvs] minor cleanups Message-ID: <20050615151824.C141F14081CF@moria.seul.org> Update of /home/or/cvsroot/control/python In directory moria:/tmp/cvs-serv30221 Modified Files: TorCtl.py TorExample.py Log Message: minor cleanups Index: TorCtl.py =================================================================== RCS file: /home/or/cvsroot/control/python/TorCtl.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorCtl.py 4 Jun 2005 02:42:56 -0000 1.1 +++ TorCtl.py 15 Jun 2005 15:18:22 -0000 1.2 @@ -18,7 +18,7 @@ __all__ = [ "MSG_TYPE", "EVENT_TYPE", "CIRC_STATUS", "STREAM_STATUS", - "OR_CONN_STATUS", "SIGNAL", "ERR_STATUS", + "OR_CONN_STATUS", "SIGNAL", "ERR_CODES", "TorCtlError", "ProtocolError", "ErrorReply", "Connection", "EventHandler", "DebugEventHandler", "parseHostAndPort" ] Index: TorExample.py =================================================================== RCS file: /home/or/cvsroot/control/python/TorExample.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorExample.py 4 Jun 2005 02:42:56 -0000 1.1 +++ TorExample.py 15 Jun 2005 15:18:22 -0000 1.2 @@ -57,7 +57,7 @@ def run_get_info(): conn = getConnection() - opts = conn.get_option(sys.argv[1:]) + opts = conn.get_info(sys.argv[1:]) for k in sys.argv[1:]: print "KEY:",k print "VALUE:",opts.get(k) @@ -65,7 +65,7 @@ def run_listen(): m = { "circ": "CIRCSTATUS", "stream": "STREAMSTATUS", - "orconn", "ORCONNSTATUS", + "orconn": "ORCONNSTATUS", "bw": "BANDWIDTH", "newdesc": "NEWDESC", "info": "INFO_MSG", @@ -106,3 +106,7 @@ conn = getConnection() conn.close() #XXXX + +if __name__ == '__main__': + run() + From nickm at seul.org Wed Jun 15 18:19:45 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 15 Jun 2005 14:19:45 -0400 (EDT) Subject: [or-cvs] Make OSX init script check for missing argument in a way th... Message-ID: <20050615181945.7566714080DA@moria.seul.org> Update of /home/or/cvsroot/tor/contrib/osx In directory moria:/tmp/cvs-serv10150/contrib/osx Modified Files: Tor Log Message: Make OSX init script check for missing argument in a way that works Index: Tor =================================================================== RCS file: /home/or/cvsroot/tor/contrib/osx/Tor,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Tor 23 May 2005 04:33:08 -0000 1.8 +++ Tor 15 Jun 2005 18:19:42 -0000 1.9 @@ -56,7 +56,7 @@ RestartService () { StopService; StartService; } -if [ "x$1" = x ]; then +if [ "$#" = 0 ]; then echo "Syntax: tor {start|stop}" exit 1 fi From nickm at seul.org Wed Jun 15 18:20:16 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 15 Jun 2005 14:20:16 -0400 (EDT) Subject: [or-cvs] backport: Make OSX init script check for missing argument i... Message-ID: <20050615182016.5631B14080DA@moria.seul.org> Update of /home/or/cvsroot/tor/contrib/osx In directory moria:/tmp/cvs-serv10224/contrib/osx Modified Files: Tag: tor-0_1_0-patches Tor Log Message: backport: Make OSX init script check for missing argument in a way that works Index: Tor =================================================================== RCS file: /home/or/cvsroot/tor/contrib/osx/Tor,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -d -r1.8 -r1.8.2.1 --- Tor 23 May 2005 04:33:08 -0000 1.8 +++ Tor 15 Jun 2005 18:20:14 -0000 1.8.2.1 @@ -56,7 +56,7 @@ RestartService () { StopService; StartService; } -if [ "x$1" = x ]; then +if [ "$#" = 0 ]; then echo "Syntax: tor {start|stop}" exit 1 fi From nickm at seul.org Wed Jun 15 18:34:48 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 15 Jun 2005 14:34:48 -0400 (EDT) Subject: [or-cvs] Remove code that has been #if-0ed for a long time. Message-ID: <20050615183448.3E75014081A1@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv10977/src/common Modified Files: crypto.c Log Message: Remove code that has been #if-0ed for a long time. Index: crypto.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v retrieving revision 1.140 retrieving revision 1.141 diff -u -d -r1.140 -r1.141 --- crypto.c 11 Jun 2005 05:31:15 -0000 1.140 +++ crypto.c 15 Jun 2005 18:34:46 -0000 1.141 @@ -1237,22 +1237,6 @@ tor_assert(p); tor_assert(g); -#if 0 - /* This is from draft-ietf-ipsec-ike-modp-groups-05.txt. It's a safe - prime, and supposedly it equals: - 2^1536 - 2^1472 - 1 + 2^64 * { [2^1406 pi] + 741804 } - */ - r = BN_hex2bn(&p, - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" - "670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF"); -#endif - /* This is from rfc2409, section 6.2. It's a safe prime, and supposedly it equals: 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }. From nickm at seul.org Wed Jun 15 18:34:48 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 15 Jun 2005 14:34:48 -0400 (EDT) Subject: [or-cvs] Remove code that has been #if-0ed for a long time. Message-ID: <20050615183448.B578614081FE@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv10977/src/or Modified Files: circuitbuild.c config.c connection.c connection_edge.c dirserv.c or.h rephist.c routerparse.c Log Message: Remove code that has been #if-0ed for a long time. Index: circuitbuild.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuitbuild.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -d -r1.119 -r1.120 --- circuitbuild.c 11 Jun 2005 21:17:38 -0000 1.119 +++ circuitbuild.c 15 Jun 2005 18:34:46 -0000 1.120 @@ -900,12 +900,6 @@ return -1; } #endif -#if 0 - for (routelen = 3; ; routelen++) { /* 3, increment until coinflip says we're done */ - if (crypto_pseudo_rand_int(255) >= cw*255) /* don't extend */ - break; - } -#endif log_fn(LOG_DEBUG,"Chosen route length %d (%d routers available).",routelen, smartlist_len(routers)); Index: config.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.363 retrieving revision 1.364 diff -u -d -r1.363 -r1.364 --- config.c 13 Jun 2005 00:35:19 -0000 1.363 +++ config.c 15 Jun 2005 18:34:46 -0000 1.364 @@ -285,9 +285,6 @@ or_options_t *options = get_options(); static int libevent_initialized = 0; - /* XXXX009 We once had a reason to separate start_daemon and finish_daemon: - * It let us have the parent process stick around until we were sure Tor - * was started. Should we make start_daemon get called earlier? -NM */ if (options->RunAsDaemon) { start_daemon(); } @@ -396,18 +393,6 @@ return -1; } -#if 0 - { - char *smin, *smax; - smin = config_dump_options(options, 1); - smax = config_dump_options(options, 0); - log_fn(LOG_DEBUG, "These are our options:\n%s",smax); - log_fn(LOG_DEBUG, "We changed these options:\n%s",smin); - tor_free(smin); - tor_free(smax); - } -#endif - /* Since our options changed, we might need to regenerate and upload our * server descriptor. (We could probably be more clever about only calling * this when something significant changed.) @@ -1502,11 +1487,6 @@ log(LOG_WARN,"BandwidthBurst must be at least equal to BandwidthRate."); result = -1; } -#if 0 - if (2*options->BandwidthRate > options->BandwidthBurst) { - log(LOG_NOTICE,"You have chosen a BandwidthBurst less than twice BandwidthRate. Please consider setting your BandwidthBurst higher (at least %d), to provide better service to the Tor network.", (int)(2*options->BandwidthRate)); - } -#endif if (options->_MonthlyAccountingStart) { if (options->AccountingStart) { @@ -2437,12 +2417,6 @@ log_fn(LOG_ERR, "DataDirectory is too long."); return -1; } -#if 0 - if (check_private_dir(options->DataDirectory, CPD_CHECK != 0)) { - log_fn(LOG_WARN, "Can't create directory %s", options->DataDirectory); - return -1; - } -#endif return 0; } Index: connection.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection.c,v retrieving revision 1.378 retrieving revision 1.379 diff -u -d -r1.378 -r1.379 --- connection.c 11 Jun 2005 18:52:11 -0000 1.378 +++ connection.c 15 Jun 2005 18:34:46 -0000 1.379 @@ -1792,13 +1792,6 @@ assert_buf_ok(conn->outbuf); } -#if 0 /* computers often go back in time; no way to know */ - tor_assert(!now || conn->timestamp_lastread <= now); - tor_assert(!now || conn->timestamp_lastwritten <= now); - tor_assert(conn->timestamp_created <= conn->timestamp_lastread); - tor_assert(conn->timestamp_created <= conn->timestamp_lastwritten); -#endif - /* XXX Fix this; no longer so.*/ #if 0 if (conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR) Index: connection_edge.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v retrieving revision 1.331 retrieving revision 1.332 diff -u -d -r1.331 -r1.332 --- connection_edge.c 11 Jun 2005 18:52:11 -0000 1.331 +++ connection_edge.c 15 Jun 2005 18:34:46 -0000 1.332 @@ -810,6 +810,7 @@ #if 0 { + /* Try to catch possible bugs */ addressmap_entry_t *ent; ent = strmap_get(addressmap, *addrp); tor_assert(ent); Index: dirserv.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v retrieving revision 1.167 retrieving revision 1.168 diff -u -d -r1.167 -r1.168 --- dirserv.c 11 Jun 2005 18:52:11 -0000 1.167 +++ dirserv.c 15 Jun 2005 18:34:46 -0000 1.168 @@ -211,22 +211,6 @@ return NULL; } -#if 0 -/** Return true iff any router named nickname with digest - * is in the verified fingerprint list. */ -static int -router_nickname_is_approved(const char *nickname, const char *digest) -{ - const char *n; - - n = dirserv_get_nickname_by_digest(digest); - if (n && !strcasecmp(n,nickname)) - return 1; - else - return 0; -} -#endif - /** Clear the current fingerprint list. */ void dirserv_free_fingerprint_list() Index: or.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.615 retrieving revision 1.616 diff -u -d -r1.615 -r1.616 --- or.h 11 Jun 2005 06:07:22 -0000 1.615 +++ or.h 15 Jun 2005 18:34:46 -0000 1.616 @@ -251,10 +251,6 @@ /** State for an exit connection: waiting to be removed. */ #define EXIT_CONN_STATE_RESOLVEFAILED 4 #define _EXIT_CONN_STATE_MAX 4 -#if 0 -#define EXIT_CONN_STATE_CLOSE 3 /* flushing the buffer, then will close */ -#define EXIT_CONN_STATE_CLOSE_WAIT 4 /* have sent a destroy, awaiting a confirmation */ -#endif /* the AP state values must be disjoint from the EXIT state values */ #define _AP_CONN_STATE_MIN 5 Index: rephist.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rephist.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- rephist.c 11 Jun 2005 18:52:11 -0000 1.59 +++ rephist.c 15 Jun 2005 18:34:46 -0000 1.60 @@ -378,44 +378,6 @@ } } -#if 0 -void -write_rep_history(const char *filename) -{ - FILE *f = NULL; - char *tmpfile; - int completed = 0; - or_history_t *or_history; - link_history_t *link_history; - strmap_iter_t *lhist_it; - strmap_iter_t *orhist_it; - void *or_history_p, *link_history_p; - const char *name1; - - tmpfile = tor_malloc(strlen(filename)+5); - tor_snprintf(tmpfile, strlen(filename)+5, "%s_tmp", filename); - - f = fopen(tmpfile, "w"); - if (!f) goto done; - for (orhist_it = strmap_iter_init(history_map); !strmap_iter_done(orhist_it); - orhist_it = strmap_iter_next(history_map,orhist_it)) { - strmap_iter_get(orhist_it, &name1, &or_history_p); - or_history = (or_history_t*) or_history_p; - fprintf(f, "link %s connected:u%ld failed:%uld uptime:%uld", - name1, or_history->since1, - } - - done: - if (f) - fclose(f); - if (completed) - replace_file(filename, tmpfile); - else - unlink(tmpfile); - tor_free(tmpfile); -} -#endif - #define NUM_SECS_ROLLING_MEASURE 10 #define NUM_SECS_BW_SUM_IS_VALID (24*60*60) /* one day */ #define NUM_SECS_BW_SUM_INTERVAL (15*60) Index: routerparse.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/routerparse.c,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- routerparse.c 11 Jun 2005 18:52:11 -0000 1.113 +++ routerparse.c 15 Jun 2005 18:34:46 -0000 1.114 @@ -1389,27 +1389,6 @@ done_tokenizing: -#if 0 - for (i = 0; token_table[i].t ; ++i) { - if (token_table[i].v == tok->tp) { - fputs(token_table[i].t, stdout); - break; - i = -1; - } - } - if (i) { - if (tok->tp == _UNRECOGNIZED) fputs("UNRECOGNIZED", stdout); - if (tok->tp == _ERR) fputs("ERR",stdout); - if (tok->tp == _EOF) fputs("EOF",stdout); - if (tok->tp == _NIL) fputs("_NIL",stdout); - } - for (i = 0; i < tok->n_args; ++i) { - fprintf(stdout," \"%s\"", tok->args[i]); - } - if (tok->error) { fprintf(stdout," *%s*", tok->error); } - fputs("\n",stdout); -#endif - return tok; #undef RET_ERR } From nickm at seul.org Mon Jun 6 20:02:35 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 6 Jun 2005 16:02:35 -0400 (EDT) Subject: [or-cvs] When RNG seeding fails, die. Backport candidate Message-ID: <20050606200235.C39131408213@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv13364/src/or Modified Files: main.c Log Message: When RNG seeding fails, die. Backport candidate Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.506 retrieving revision 1.507 diff -u -d -r1.506 -r1.507 --- main.c 6 Jun 2005 17:03:21 -0000 1.506 +++ main.c 6 Jun 2005 20:02:33 -0000 1.507 @@ -1230,7 +1230,10 @@ handle_signals(1); crypto_global_init(); - crypto_seed_rng(); + if (crypto_seed_rng()) { + log_fn(LOG_ERR, "Unable to seed random number generator. Exiting."); + return -1; + } return 0; } From arma at seul.org Wed Jun 15 18:36:05 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 15 Jun 2005 14:36:05 -0400 (EDT) Subject: [or-cvs] people are so literal when they"re following directions Message-ID: <20050615183605.6100A14081A1@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: tor-doc.html Log Message: people are so literal when they're following directions Index: tor-doc.html =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor-doc.html,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- tor-doc.html 15 Jun 2005 11:39:44 -0000 1.83 +++ tor-doc.html 15 Jun 2005 18:36:03 -0000 1.84 @@ -285,9 +285,11 @@ initscripts or startup scripts. If it logs any warnings, address them. (By default Tor logs to stdout, but some packages log to /var/log/tor/ instead. You can edit your torrc to configure log locations.) -
  • 4. Register your server. Send mail to 4. Once you are convinced it's working, Register your server. +Send mail to tor-ops at freehaven.net with your -server's nickname in the subject line and include the +server's nickname and the phrase "Tor server" in the subject line and +include the following information in the message:
    • Your server's nickname.
    • From weasel at seul.org Wed Jun 15 18:46:01 2005 From: weasel at seul.org (Peter Palfrader) Date: Wed, 15 Jun 2005 14:46:01 -0400 (EDT) Subject: [or-cvs] Let"s challenge our server ops a bit. Everybody likes chal... Message-ID: <20050615184601.9439014080DA@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv11589 Modified Files: tor-doc.html Log Message: Let's challenge our server ops a bit. Everybody likes challenges. Index: tor-doc.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc.html,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- tor-doc.html 15 Jun 2005 18:36:03 -0000 1.84 +++ tor-doc.html 15 Jun 2005 18:45:59 -0000 1.85 @@ -287,8 +287,8 @@ instead. You can edit your torrc to configure log locations.)
    • 4. Once you are convinced it's working, Register your server. Send mail to tor-ops at freehaven.net with your -server's nickname and the phrase "Tor server" in the subject line and +href="mailto:tor-ops at freehaven.net">tor-ops at freehaven.net with a +subject of '[New Server] <your server's nickname>' and include the following information in the message:
        From arma at seul.org Thu Jun 16 20:32:42 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 16 Jun 2005 16:32:42 -0400 (EDT) Subject: [or-cvs] a few minor cleanups to HACKING Message-ID: <20050616203242.5E44D14080BB@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: HACKING Log Message: a few minor cleanups to HACKING Index: HACKING =================================================================== RCS file: /home2/or/cvsroot/tor/doc/HACKING,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- HACKING 11 Jun 2005 06:07:43 -0000 1.15 +++ HACKING 16 Jun 2005 20:32:40 -0000 1.16 @@ -66,8 +66,8 @@ 1. Begin every file that should be documented with /** * \file filename.c - * \brief Short desccription of the file - */ + * \brief Short desccription of the file. + **/ (Doxygen will recognize any comment beginning with /** as special.) @@ -106,7 +106,7 @@ $ doxygen -g To generate a file called 'Doxyfile'. Edit that file and run 'doxygen' to - generate the aPI documentation. + generate the API documentation. 6. See the Doxygen manual for more information; this summary just scratches the surface. From arma at seul.org Thu Jun 16 20:33:05 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 16 Jun 2005 16:33:05 -0400 (EDT) Subject: [or-cvs] tor-spec patch from adam langley Message-ID: <20050616203305.577BE14080BB@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: tor-spec.txt Log Message: tor-spec patch from adam langley Index: tor-spec.txt =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor-spec.txt,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- tor-spec.txt 20 May 2005 12:43:55 -0000 1.86 +++ tor-spec.txt 16 Jun 2005 20:33:03 -0000 1.87 @@ -31,8 +31,9 @@ Unless otherwise specified, all symmetric ciphers are AES in counter mode, with an IV of all 0 bytes. Asymmetric ciphers are either RSA - with 1024-bit keys and exponents of 65537, or DH with the safe prime - from rfc2409, section 6.2, whose hex representation is: + with 1024-bit keys and exponents of 65537, or DH where the generator + is 2 and the modulus is the safe prime from rfc2409, section 6.2, + whose hex representation is: "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" @@ -43,7 +44,7 @@ All "hashes" are 20-byte SHA1 cryptographic digests. When we refer to "the hash of a public key", we mean the SHA1 hash of the - ASN.1 encoding of an RSA public key (as specified in PKCS.1). + DER encoding of an ASN.1 RSA public key (as specified in PKCS.1). 1. System overview @@ -71,9 +72,9 @@ least 128 bits, and digests of at least 160 bits. An OP or OR always sends a two-certificate chain, consisting of a - self-signed certificate containing the OR's identity key, and a second - certificate using a short-term connection key. The commonName of the - second certificate is the OR's nickname, and the commonName of the first + certificate using a short-term connection key and a second, self- + signed certificate containing the OR's identity key. The commonName of the + first certificate is the OR's nickname, and the commonName of the second certificate is the OR's nickname, followed by a space and the string "". @@ -164,13 +165,14 @@ The payload for a CREATE cell is an 'onion skin', which consists of the first step of the DH handshake data (also known as g^x). - The data is encrypted to Bob's PK as follows: Suppose Bob's PK is - L octets long. If the data to be encrypted is shorter than L-42, - then it is encrypted directly (with OAEP padding). If the data is at - least as long as L-42, then a randomly generated 16-byte symmetric - key is prepended to the data, after which the first L-16-42 bytes - of the data are encrypted with Bob's PK; and the rest of the data is - encrypted with the symmetric key. + The data is encrypted to Bob's PK as follows: Suppose Bob's PK + modulus is L octets long. If the data to be encrypted is shorter + than L-42, then it is encrypted directly (with OAEP padding: see + ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1.pdf). If the + data is at least as long as L-42, then a randomly generated 16-byte + symmetric key is prepended to the data, after which the first L-16-42 + bytes of the data are encrypted with Bob's PK; and the rest of the + data is encrypted with the symmetric key. So in this case, the onion skin on the wire looks like: RSA-encrypted: @@ -265,7 +267,7 @@ router's exit policy does not exclude all pending streams that need a circuit. - 2. Choose a chain of (N-1) chain of N onion routers + 2. Choose a chain of (N-1) onion routers (R_1...R_N-1) to constitute the path, such that no router appears in the path twice. From arma at seul.org Thu Jun 16 20:49:20 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 16 Jun 2005 16:49:20 -0400 (EDT) Subject: [or-cvs] bump to 0.0.9.10 Message-ID: <20050616204920.3883814081B8@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/home/arma/work/onion/00910/tor Modified Files: Tag: tor-0_0_9-patches configure.in Log Message: bump to 0.0.9.10 Index: configure.in =================================================================== RCS file: /home/or/cvsroot/tor/configure.in,v retrieving revision 1.156.2.11 retrieving revision 1.156.2.12 diff -u -d -r1.156.2.11 -r1.156.2.12 --- configure.in 23 Apr 2005 18:23:34 -0000 1.156.2.11 +++ configure.in 16 Jun 2005 20:49:18 -0000 1.156.2.12 @@ -1,6 +1,6 @@ AC_INIT -AM_INIT_AUTOMAKE(tor, 0.0.9.9) +AM_INIT_AUTOMAKE(tor, 0.0.9.10) AM_CONFIG_HEADER(orconfig.h) AC_CANONICAL_HOST From arma at seul.org Thu Jun 16 20:49:23 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 16 Jun 2005 16:49:23 -0400 (EDT) Subject: [or-cvs] bump to 0.0.9.10 Message-ID: <20050616204923.3D9871408266@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/home/arma/work/onion/00910/tor/contrib Modified Files: Tag: tor-0_0_9-patches tor.nsi Log Message: bump to 0.0.9.10 Index: tor.nsi =================================================================== RCS file: /home/or/cvsroot/tor/contrib/tor.nsi,v retrieving revision 1.23.2.9 retrieving revision 1.23.2.10 diff -u -d -r1.23.2.9 -r1.23.2.10 --- tor.nsi 23 Apr 2005 18:23:38 -0000 1.23.2.9 +++ tor.nsi 16 Jun 2005 20:49:21 -0000 1.23.2.10 @@ -31,7 +31,7 @@ !include "MUI.nsh" -!define VERSION "0.0.9.9" +!define VERSION "0.0.9.10" !define INSTALLER "tor-${VERSION}-win32.exe" !define WEBSITE "http://freehaven.net/tor/" From arma at seul.org Thu Jun 16 20:50:36 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 16 Jun 2005 16:50:36 -0400 (EDT) Subject: [or-cvs] patch the rh.length bug Message-ID: <20050616205036.50AC914081B8@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/00910/tor/src/or Modified Files: Tag: tor-0_0_9-patches relay.c Log Message: patch the rh.length bug Index: relay.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/relay.c,v retrieving revision 1.32.2.4 retrieving revision 1.32.2.5 diff -u -d -r1.32.2.4 -r1.32.2.5 --- relay.c 24 Mar 2005 21:30:33 -0000 1.32.2.4 +++ relay.c 16 Jun 2005 20:50:34 -0000 1.32.2.5 @@ -660,6 +660,11 @@ num_seen++; log_fn(LOG_DEBUG,"Now seen %d relay cells here.", num_seen); + if (rh.length > RELAY_PAYLOAD_SIZE) { + log_fn(LOG_WARN, "Relay cell length field too long. Closing circuit."); + return -1; + } + /* either conn is NULL, in which case we've got a control cell, or else * conn points to the recognized stream. */ From arma at seul.org Thu Jun 16 20:50:40 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 16 Jun 2005 16:50:40 -0400 (EDT) Subject: [or-cvs] bump to 0.0.9.10 Message-ID: <20050616205040.0735D1408266@moria.seul.org> Update of /home/or/cvsroot/tor/src/win32 In directory moria:/home/arma/work/onion/00910/tor/src/win32 Modified Files: Tag: tor-0_0_9-patches orconfig.h Log Message: bump to 0.0.9.10 Index: orconfig.h =================================================================== RCS file: /home/or/cvsroot/tor/src/win32/orconfig.h,v retrieving revision 1.40.2.8 retrieving revision 1.40.2.9 diff -u -d -r1.40.2.8 -r1.40.2.9 --- orconfig.h 23 Apr 2005 18:23:40 -0000 1.40.2.8 +++ orconfig.h 16 Jun 2005 20:50:37 -0000 1.40.2.9 @@ -199,4 +199,4 @@ #define UNALIGNED_INT_ACCESS_OK /* Version number of package */ -#define VERSION "0.0.9.9" +#define VERSION "0.0.9.10" From weasel at seul.org Thu Jun 16 20:54:28 2005 From: weasel at seul.org (Peter Palfrader) Date: Thu, 16 Jun 2005 16:54:28 -0400 (EDT) Subject: [or-cvs] A debian changelog for 0.0.9.10 Message-ID: <20050616205428.B8A4914081B8@moria.seul.org> Update of /home/or/cvsroot/tor/debian In directory moria:/tmp/cvs-serv20931 Modified Files: Tag: debian_branch_0_0_9 changelog Log Message: A debian changelog for 0.0.9.10 Index: changelog =================================================================== RCS file: /home/or/cvsroot/tor/debian/changelog,v retrieving revision 1.87.2.7 retrieving revision 1.87.2.8 diff -u -d -r1.87.2.7 -r1.87.2.8 --- changelog 23 Apr 2005 22:00:50 -0000 1.87.2.7 +++ changelog 16 Jun 2005 20:54:26 -0000 1.87.2.8 @@ -1,3 +1,13 @@ +tor (0.0.9.10-1) unstable; urgency=high + + * While we're waiting for a newer libevent to enter sid, make another + upload of the 0.0.9.x tree: + - Refuse relay cells that claim to have a length larger than the + maximum allowed. This prevents a potential attack that could read + arbitrary memory (e.g. keys) from an exit server's process. + + -- Peter Palfrader Thu, 16 Jun 2005 22:56:11 +0200 + tor (0.0.9.9-1) unstable; urgency=low * New upstream version. From arma at seul.org Thu Jun 16 21:09:29 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 16 Jun 2005 17:09:29 -0400 (EDT) Subject: [or-cvs] changelog entry for 0.0.9.10 Message-ID: <20050616210929.AC72E1408266@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/home/arma/work/onion/00910/tor Modified Files: Tag: tor-0_0_9-patches ChangeLog Log Message: changelog entry for 0.0.9.10 Index: ChangeLog =================================================================== RCS file: /home/or/cvsroot/tor/ChangeLog,v retrieving revision 1.64.2.18 retrieving revision 1.64.2.19 diff -u -d -r1.64.2.18 -r1.64.2.19 --- ChangeLog 23 Apr 2005 18:23:34 -0000 1.64.2.18 +++ ChangeLog 16 Jun 2005 21:09:27 -0000 1.64.2.19 @@ -1,3 +1,10 @@ +Changes in version 0.0.9.10 - 2005-06-16 + o Bugfixes on 0.0.9.x (backported from 0.1.0.10): + - Refuse relay cells that claim to have a length larger than the + maximum allowed. This prevents a potential attack that could read + arbitrary memory (e.g. keys) from an exit server's process. + + Changes in version 0.0.9.9 - 2005-04-23 o Bugfixes on 0.0.9.x: - If unofficial Tor clients connect and send weird TLS certs, our From nickm at seul.org Mon Jun 6 20:06:12 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 6 Jun 2005 16:06:12 -0400 (EDT) Subject: [or-cvs] Fix win32 compilation: backport candidate Message-ID: <20050606200612.7B3F71408213@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv13599/src/or Modified Files: main.c Log Message: Fix win32 compilation: backport candidate Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.507 retrieving revision 1.508 diff -u -d -r1.507 -r1.508 --- main.c 6 Jun 2005 20:02:33 -0000 1.507 +++ main.c 6 Jun 2005 20:06:10 -0000 1.508 @@ -943,7 +943,7 @@ if (loop_result < 0) { int e = errno; /* let the program survive things like ^z */ - if (e != EINTR && e != EINPROGRESS) { + if (e != EINTR && !ERRNO_IS_EINPROGRESS(e)) { #ifdef HAVE_EVENT_GET_METHOD log_fn(LOG_ERR,"libevent poll with %s failed: %s [%d]", event_get_method(), tor_socket_strerror(e), e); @@ -953,7 +953,7 @@ #endif return -1; } else { - if (e == EINPROGRESS) + if (ERRNO_IS_EINPROGRESS(e)) log_fn(LOG_WARN,"libevent poll returned EINPROGRESS? Please report."); log_fn(LOG_DEBUG,"event poll interrupted."); /* You can't trust the results of this poll(). Go back to the From nickm at seul.org Fri Jun 17 18:49:06 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 14:49:06 -0400 (EDT) Subject: [or-cvs] First (and fragmentary) draft of revised controller protocol. Message-ID: <20050617184906.B560D14080A8@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv4148/doc Modified Files: control-spec.txt Added Files: control-spec-v0.txt Log Message: First (and fragmentary) draft of revised controller protocol. --- NEW FILE: control-spec-v0.txt --- $Id: control-spec-v0.txt,v 1.1 2005/06/17 18:49:04 nickm Exp $ TC: A Tor control protocol (Version 0) -1. Deprecation THIS PROTOCOL IS DEPRECATED. It is still documented here because it is the only Tor control protocol supported in the Tor implementation right now. 0. Scope This document describes an implementation-specific protocol that is used for other programs (such as frontend user-interfaces) to communicate with a locally running Tor process. It is not part of the Tor onion routing protocol. We're trying to be pretty extensible here, but not infinitely forward-compatible. 1. Protocol outline TC is a bidirectional message-based protocol. It assumes an underlying stream for communication between a controlling process (the "client") and a Tor process (the "server"). The stream may be implemented via TCP, TLS-over-TCP, a Unix-domain socket, or so on, but it must provide reliable in-order delivery. For security, the stream should not be accessible by untrusted parties. In TC, the client and server send typed variable-length messages to each other over the underlying stream. By default, all messages from the server are in response to messages from the client. Some client requests, however, will cause the server to send messages to the client indefinitely far into the future. Servers respond to messages in the order they're received. 2. Message format The messages take the following format: Length [2 octets; big-endian] Type [2 octets; big-endian] Body [Length octets] Upon encountering a recognized Type, implementations behave as described in section 3 below. If the type is not recognized, servers respond with an "ERROR" message (code UNRECOGNIZED; see 3.1 below), and clients simply ignore the message. 2.1. Types and encodings All numbers are given in big-endian (network) order. OR identities are given in hexadecimal, in the same format as identity key fingerprints, but without spaces; see tor-spec.txt for more information. 3. Message types Message types are drawn from the following ranges: 0x0000-0xEFFF : Reserved for use by official versions of this spec. 0xF000-0xFFFF : Unallocated; usable by unofficial extensions. 3.1. ERROR (Type 0x0000) Sent in response to a message that could not be processed as requested. The body of the message begins with a 2-byte error code. The following values are defined: 0x0000 Unspecified error [] 0x0001 Internal error [Something went wrong inside Tor, so that the client's request couldn't be fulfilled.] 0x0002 Unrecognized message type [The client sent a message type we don't understand.] 0x0003 Syntax error [The client sent a message body in a format we can't parse.] 0x0004 Unrecognized configuration key [The client tried to get or set a configuration option we don't recognize.] 0x0005 Invalid configuration value [The client tried to set a configuration option to an incorrect, ill-formed, or impossible value.] 0x0006 Unrecognized byte code [The client tried to set a byte code (in the body) that we don't recognize.] 0x0007 Unauthorized. [The client tried to send a command that requires authorization, but it hasn't sent a valid AUTHENTICATE message.] 0x0008 Failed authentication attempt [The client sent a well-formed authorization message.] 0x0009 Resource exhausted [The server didn't have enough of a given resource to fulfill a given request.] 0x000A No such stream 0x000B No such circuit 0x000C No such OR The rest of the body should be a human-readable description of the error. In general, new error codes should only be added when they don't fall under one of the existing error codes. 3.2. DONE (Type 0x0001) Sent from server to client in response to a request that was successfully completed, with no more information needed. The body is usually empty but may contain a message. 3.3. SETCONF (Type 0x0002) Change the value of a configuration variable. The body contains a list of newline-terminated key-value configuration lines. An individual key-value configuration line consists of the key, followed by a space, followed by the value. The server behaves as though it had just read the key-value pair in its configuration file. The server responds with a DONE message on success, or an ERROR message on failure. When a configuration options takes multiple values, or when multiple configuration keys form a context-sensitive group (see below), then setting _any_ of the options in a SETCONF command is taken to reset all of the others. For example, if two ORBindAddress values are configured, and a SETCONF command arrives containing a single ORBindAddress value, the new command's value replaces the two old values. To _remove_ all settings for a given option entirely (and go back to its default value), send a single line containing the key and no value. 3.4. GETCONF (Type 0x0003) Request the value of a configuration variable. The body contains one or more NL-terminated strings for configuration keys. The server replies with a CONFVALUE message. If an option appears multiple times in the configuration, all of its key-value pairs are returned in order. Some options are context-sensitive, and depend on other options with different keywords. These cannot be fetched directly. Currently there is only one such option: clients should use the "HiddenServiceOptions" virtual keyword to get all HiddenServiceDir, HiddenServicePort, HiddenServiceNodes, and HiddenServiceExcludeNodes option settings. 3.5. CONFVALUE (Type 0x0004) Sent in response to a GETCONF message; contains a list of "Key Value\n" (A non-whitespace keyword, a single space, a non-NL value, a NL) strings. 3.6. SETEVENTS (Type 0x0005) Request the server to inform the client about interesting events. The body contains a list of 2-byte event codes (see "event" below). Any events *not* listed in the SETEVENTS body are turned off; thus, sending SETEVENTS with an empty body turns off all event reporting. The server responds with a DONE message on success, and an ERROR message if one of the event codes isn't recognized. (On error, the list of active event codes isn't changed.) 3.7. EVENT (Type 0x0006) Sent from the server to the client when an event has occurred and the client has requested that kind of event. The body contains a 2-byte event code followed by additional event-dependent information. Event codes are: 0x0001 -- Circuit status changed Status [1 octet] 0x00 Launched - circuit ID assigned to new circuit 0x01 Built - all hops finished, can now accept streams 0x02 Extended - one more hop has been completed 0x03 Failed - circuit closed (was not built) 0x04 Closed - circuit closed (was built) Circuit ID [4 octets] (Must be unique to Tor process/time) Path [NUL-terminated comma-separated string] (For extended/failed, is the portion of the path that is built) 0x0002 -- Stream status changed Status [1 octet] (Sent connect=0,sent resolve=1,succeeded=2,failed=3, closed=4, new connection=5, new resolve request=6, stream detached from circuit and still retriable=7) Stream ID [4 octets] (Must be unique to Tor process/time) Target (NUL-terminated address-port string] 0x0003 -- OR Connection status changed Status [1 octet] (Launched=0,connected=1,failed=2,closed=3) OR nickname/identity [NUL-terminated] 0x0004 -- Bandwidth used in the last second Bytes read [4 octets] Bytes written [4 octets] 0x0005 -- Notice/warning/error occurred Message [NUL-terminated] 0x0006 -- New descriptors available OR List [NUL-terminated, comma-delimited list of OR identity] 0x0007 -- Debug message occurred 0x0008 -- Info message occurred 0x0009 -- Notice message occurred 0x000A -- Warning message occurred 0x000B -- Error message occurred Message [NUL-terminated] 3.8. AUTHENTICATE (Type 0x0007) Sent from the client to the server. Contains a 'magic cookie' to prove that client is really allowed to control this Tor process. The server responds with DONE or ERROR. The format of the 'cookie' is implementation-dependent; see 4.1 below for information on how the standard Tor implementation handles it. 3.9. SAVECONF (Type 0x0008) Sent from the client to the server. Instructs the server to write out its config options into its torrc. Server returns DONE if successful, or ERROR if it can't write the file or some other error occurs. 3.10. SIGNAL (Type 0x0009) Sent from the client to the server. The body contains one byte that indicates the action the client wishes the server to take. 1 (0x01) -- Reload: reload config items, refetch directory. 2 (0x02) -- Controlled shutdown: if server is an OP, exit immediately. If it's an OR, close listeners and exit after 30 seconds. 10 (0x0A) -- Dump stats: log information about open connections and circuits. 12 (0x0C) -- Debug: switch all open logs to loglevel debug. 15 (0x0F) -- Immediate shutdown: clean up and exit now. The server responds with DONE if the signal is recognized (or simply closes the socket if it was asked to close immediately), else ERROR. 3.11. MAPADDRESS (Type 0x000A) Sent from the client to the server. The body contains a sequence of address mappings, each consisting of the address to be mapped, a single space, the replacement address, and a NL character. Addresses may be IPv4 addresses, IPv6 addresses, or hostnames. The client sends this message to the server in order to tell it that future SOCKS requests for connections to the original address should be replaced with connections to the specified replacement address. If the addresses are well-formed, and the server is able to fulfill the request, the server replies with a single DONE message containing the source and destination addresses. If request is malformed, the server replies with a syntax error message. The server can't fulfill the request, it replies with an internal ERROR message. The client may decline to provide a body for the original address, and instead send a special null address ("0.0.0.0" for IPv4, "::0" for IPv6, or "." for hostname), signifying that the server should choose the original address itself, and return that address in the DONE message. The server should ensure that it returns an element of address space that is unlikely to be in actual use. If there is already an address mapped to the destination address, the server may reuse that mapping. If the original address is already mapped to a different address, the old mapping is removed. If the original address and the destination address are the same, the server removes any mapping in place for the original address. {Note: This feature is designed to be used to help Tor-ify applications that need to use SOCKS4 or hostname-less SOCKS5. There are three approaches to doing this: 1. Somehow make them use SOCKS4a or SOCKS5-with-hostnames instead. 2. Use tor-resolve (or another interface to Tor's resolve-over-SOCKS feature) to resolve the hostname remotely. This doesn't work with special addresses like x.onion or x.y.exit. 3. Use MAPADDRESS to map an IP address to the desired hostname, and then arrange to fool the application into thinking that the hostname has resolved to that IP. This functionality is designed to help implement the 3rd approach.} [XXXX When, if ever, can mappings expire? Should they expire?] [XXXX What addresses, if any, are safe to use?] 3.12 GETINFO (Type 0x000B) Sent from the client to the server. The message body is as for GETCONF: one or more NL-terminated strings. The server replies with an INFOVALUE message. Unlike GETCONF, this message is used for data that are not stored in the Tor configuration file, but instead. Recognized key and their values include: "version" -- The version of the server's software, including the name of the software. (example: "Tor 0.0.9.4") "desc/id/" or "desc/name/" -- the latest server descriptor for a given OR, NUL-terminated. If no such OR is known, the corresponding value is an empty string. "network-status" -- a space-separated list of all known OR identities. This is in the same format as the router-status line in directories; see tor-spec.txt for details. "addr-mappings/all" "addr-mappings/config" "addr-mappings/cache" "addr-mappings/control" -- a NL-terminated list of address mappings, each in the form of "from-address" SP "to-address". The 'config' key returns those address mappings set in the configuration; the 'cache' key returns the mappings in the client-side DNS cache; the 'control' key returns the mappings set via the control interface; the 'all' target returns the mappings set through any mechanism. 3.13 INFOVALUE (Type 0x000C) Sent from the server to the client in response to a GETINFO message. Contains one or more items of the format: Key [(NUL-terminated string)] Value [(NUL-terminated string)] The keys match those given in the GETINFO message. 3.14 EXTENDCIRCUIT (Type 0x000D) Sent from the client to the server. The message body contains two fields: Circuit ID [4 octets] Path [NUL-terminated, comma-delimited string of OR nickname/identity] This request takes one of two forms: either the Circuit ID is zero, in which case it is a request for the server to build a new circuit according to the specified path, or the Circuit ID is nonzero, in which case it is a request for the server to extend an existing circuit with that ID according to the specified path. If the request is successful, the server sends a DONE message containing a message body consisting of the four-octet Circuit ID of the newly created circuit. 3.15 ATTACHSTREAM (Type 0x000E) Sent from the client to the server. The message body contains two fields: Stream ID [4 octets] Circuit ID [4 octets] This message informs the server that the specified stream should be associated with the specified circuit. Each stream may be associated with at most one circuit, and multiple streams may share the same circuit. Streams can only be attached to completed circuits (that is, circuits that have sent a circuit status 'built' event). If the circuit ID is 0, responsibility for attaching the given stream is returned to Tor. {Implementation note: By default, Tor automatically attaches streams to circuits itself, unless the configuration variable "__LeaveStreamsUnattached" is set to "1". Attempting to attach streams via TC when "__LeaveStreamsUnattached" is false may cause a race between Tor and the controller, as both attempt to attach streams to circuits.} 3.16 POSTDESCRIPTOR (Type 0x000F) Sent from the client to the server. The message body contains one field: Descriptor [NUL-terminated string] This message informs the server about a new descriptor. The descriptor, when parsed, must contain a number of well-specified fields, including fields for its nickname and identity. If there is an error in parsing the descriptor, the server must send an appropriate error message. If the descriptor is well-formed but the server chooses not to add it, it must reply with a DONE message whose body explains why the server was not added. 3.17 FRAGMENTHEADER (Type 0x0010) Sent in either direction. Used to encapsulate messages longer than 65535 bytes in length. Underlying type [2 bytes] Total Length [4 bytes] Data [Rest of message] A FRAGMENTHEADER message MUST be followed immediately by a number of FRAGMENT messages, such that lengths of the "Data" fields of the FRAGMENTHEADER and FRAGMENT messages add to the "Total Length" field of the FRAGMENTHEADER message. Implementations MUST NOT fragment messages of length less than 65536 bytes. Implementations MUST be able to process fragmented messages that not optimally packed. 3.18 FRAGMENT (Type 0x0011) Data [Entire message] See FRAGMENTHEADER for more information 3.19 REDIRECTSTREAM (Type 0x0012) Sent from the client to the server. The message body contains two fields: Stream ID [4 octets] Address [variable-length, NUL-terminated.] Tells the server to change the exit address on the specified stream. No remapping is performed on the new provided address. To be sure that the modified address will be used, this event must be sent after a new stream event is received, and before attaching this stream to a circuit. 3.20 CLOSESTREAM (Type 0x0013) Sent from the client to the server. The message body contains three fields: Stream ID [4 octets] Reason [1 octet] Flags [1 octet] Tells the server to close the specified stream. The reason should be one of the Tor RELAY_END reasons given in tor-spec.txt. Flags is not used currently. Tor may hold the stream open for a while to flush any data that is pending. 3.21 CLOSECIRCUIT (Type 0x0014) Sent from the client to the server. The message body contains two fields: Circuit ID [4 octets] Flags [1 octet] Tells the server to close the specified circuit. If the LSB of the flags field is nonzero, do not close the circuit unless it is unused. 4. Implementation notes 4.1. Authentication By default, the current Tor implementation trusts all local users. If the 'CookieAuthentication' option is true, Tor writes a "magic cookie" file named "control_auth_cookie" into its data directory. To authenticate, the controller must send the contents of this file. If the 'HashedControlPassword' option is set, it must contain the salted hash of a secret password. The salted hash is computed according to the S2K algorithm in RFC 2440 (OpenPGP), and prefixed with the s2k specifier. This is then encoded in hexadecimal, prefixed by the indicator sequence "16:". Thus, for example, the password 'foo' could encode to: 16:660537E3E1CD49996044A3BF558097A981F539FEA2F9DA662B4626C1C2 ++++++++++++++++**^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ salt hashed value indicator You can generate the salt of a password by calling 'tor --hash-password ' or by using the example code in the Python and Java controller libraries. To authenticate under this scheme, the controller sends Tor the original secret that was used to generate the password. 4.2. Don't let the buffer get too big. If you ask for lots of events, and 16MB of them queue up on the buffer, the Tor process will close the socket. Index: control-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/control-spec.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- control-spec.txt 5 Jun 2005 14:10:48 -0000 1.37 +++ control-spec.txt 17 Jun 2005 18:49:04 -0000 1.38 @@ -1,148 +1,146 @@ $Id$ - TC: A Tor control protocol - -0. Scope - -This document describes an implementation-specific protocol that is used -for other programs (such as frontend user-interfaces) to communicate -with a locally running Tor process. It is not part of the Tor onion -routing protocol. - -We're trying to be pretty extensible here, but not infinitely -forward-compatible. - -1. Protocol outline - -TC is a bidirectional message-based protocol. It assumes an underlying -stream for communication between a controlling process (the "client") and -a Tor process (the "server"). The stream may be implemented via TCP, -TLS-over-TCP, a Unix-domain socket, or so on, but it must provide -reliable in-order delivery. For security, the stream should not be -accessible by untrusted parties. + TC: A Tor control protocol (Version 1) -In TC, the client and server send typed variable-length messages to each -other over the underlying stream. By default, all messages from the server -are in response to messages from the client. Some client requests, however, -will cause the server to send messages to the client indefinitely far into -the future. +0 Scope -Servers respond to messages in the order they're received. + This document describes an implementation-specific protocol that is used + for other programs (such as frontend user-interfaces) to communicate with a + locally running Tor process. It is not part of the Tor onion routing + protocol. -2. Message format + This protocol replaces version 0 of TC, which is now deprecated. For + reference, TC is described in "control-spec-v0.txt". Implementors are + recommended to avoid using TC directly, but instead to use a library that + can easily be updated to use the newer protocol. -The messages take the following format: +1 Protocol outline - Length [2 octets; big-endian] - Type [2 octets; big-endian] - Body [Length octets] + TC is a bidirectional message-based protocol. It assumes an underlying + stream for communication between a controlling process (the "client" or + "controller") and a Tor process (the "server" or "tor process"). The + stream may be implemented via TCP, TLS-over-TCP, a Unix-domain socket, or + so on, but it must provide reliable in-order delivery. For security, the + stream should not be accessible by untrusted parties. -Upon encountering a recognized Type, implementations behave as described in -section 3 below. If the type is not recognized, servers respond with an -"ERROR" message (code UNRECOGNIZED; see 3.1 below), and clients simply ignore -the message. + In TC, the client and server send typed messages to each other over the + underlying stream. The client sends "commands" and the server sends + "replies". -2.1. Types and encodings + By default, all messages from the server are in response to messages from + the client. Some client requests, however, will cause the server to send + messages to the client indefinitely far into the future. Such + "asynchronous" replies are marked to such. - All numbers are given in big-endian (network) order. + Servers respond to messages in the order messages are received. - OR identities are given in hexadecimal, in the same format as identity key - fingerprints, but without spaces; see tor-spec.txt for more information. +2 Message format -3. Message types +2.1 Description format. - Message types are drawn from the following ranges: + The message formates listed below use ABNF as described in RFC2234. + The protocol itself is loosely based on SMTP (see RFC 2821). - 0x0000-0xEFFF : Reserved for use by official versions of this spec. - 0xF000-0xFFFF : Unallocated; usable by unofficial extensions. + We use the following nonterminals from RFC2822: atom, qcontent -3.1. ERROR (Type 0x0000) + We define the following general-use nonterminals: - Sent in response to a message that could not be processed as requested. + String = DQUOTE *qcontent DQUOTE - The body of the message begins with a 2-byte error code. The following - values are defined: + There are explicitly no limits on line length. All 8-bit characters are + permitted unless explicitly disallowed. - 0x0000 Unspecified error - [] +2.2 Commands from controller to Tor. - 0x0001 Internal error - [Something went wrong inside Tor, so that the client's - request couldn't be fulfilled.] + Command = Keyword Arguments CRLF / "+" Keyword Arguments CRLF Data + Keyword = 1*ALPHA + Arguments = *(SP / VCHAR) - 0x0002 Unrecognized message type - [The client sent a message type we don't understand.] + Specific commands and their arguments are described below in section 3. - 0x0003 Syntax error - [The client sent a message body in a format we can't parse.] +2.3 Replies from Tor to the controller - 0x0004 Unrecognized configuration key - [The client tried to get or set a configuration option we don't - recognize.] + Reply = *(MidReplyLine / DataReplyLine) EndReplyLine - 0x0005 Invalid configuration value - [The client tried to set a configuration option to an - incorrect, ill-formed, or impossible value.] + MidReplyLine = "-" ReplyLine + DataReplyLine = "+" ReplyLine Data + EndReplyLine = SP ReplyLine + ReplyLine = StatusCode [ SP ReplyText ] CRLF + ReplyText = XXXX + StatusCode = XXXX - 0x0006 Unrecognized byte code - [The client tried to set a byte code (in the body) that - we don't recognize.] + Specific replies are mentioned below in section 3, and described more fully + in section 4. - 0x0007 Unauthorized. - [The client tried to send a command that requires - authorization, but it hasn't sent a valid AUTHENTICATE - message.] +2.4 General-use tokens - 0x0008 Failed authentication attempt - [The client sent a well-formed authorization message.] + ; Identifiers for servers. + ServerID = Nickname / Fingerprint + Nickname = 1*NicknameChar + NicknameChar = "a"-"z" / "A"-"Z" / "0" - "9" + Fingerprint = "$" 40*HEXDIG - 0x0009 Resource exhausted - [The server didn't have enough of a given resource to - fulfill a given request.] + ; Unique identifiers for streams or circuits. Currently, Tor only + ; uses digits, but this may change + StreamID = 1*16 IDChar + CircuitID = 1*16 IDChar + IDChar = ALPHA / DIGIT - 0x000A No such stream + Address = ip4-address / ip6-address / hostname (XXXX Define these) - 0x000B No such circuit - 0x000C No such OR + ; A "Data" section is a sequence of octets concluded by the terminating + ; sequence CRLF "." CRLF. The terminating sequence may not appear in the + ; body of the data. Leading periods on lines in the data are escaped with + ; an additional leading period as in RFC2821 section 4.5.2 + Data = *DataLine "." CRLF + DataLine = CRLF / "." 1*LineItem CRLF/ NonDotItem *LineItem CRLF + LineItem = NonCR / 1*CR NonCRLF + NonDotItem = NonDotCR / 1*CR NonCRLF - The rest of the body should be a human-readable description of the error. +3 Commands - In general, new error codes should only be added when they don't fall under - one of the existing error codes. + All commands and other keywords are case-insensitive. -3.2. DONE (Type 0x0001) +3.1 SETCONF - Sent from server to client in response to a request that was successfully - completed, with no more information needed. The body is usually empty but - may contain a message. + Change the value of one or more configuration variables. The syntax is: -3.3. SETCONF (Type 0x0002) + "SETCONF" 1*(SP keyword ["=" String]) CRLF - Change the value of a configuration variable. The body contains a list of - newline-terminated key-value configuration lines. An individual key-value - configuration line consists of the key, followed by a space, followed by - the value. The server behaves as though it had just read the key-value pair - in its configuration file. + Tor behaves as though it had just read each of the key-value pairs + from its configuration file. Keywords with no corresponding values have + their configuration values reset to their defaults. SETCONF is + all-or-nothing: if there is an error in any of the configuration settings, + Tor sets none of them. - The server responds with a DONE message on success, or an ERROR message on - failure. + Tor responds with a "250 configuration values set" reply on success. + Tor responds with a "513 syntax error in configuration values" reply on + syntax error, or a "553 impossible configuration setting" reply on a + semantic error. When a configuration options takes multiple values, or when multiple - configuration keys form a context-sensitive group (see below), then + configuration keys form a context-sensitive group (see GETCONF below), then setting _any_ of the options in a SETCONF command is taken to reset all of - the others. For example, if two ORBindAddress values are configured, - and a SETCONF command arrives containing a single ORBindAddress value, the - new command's value replaces the two old values. + the others. For example, if two ORBindAddress values are configured, and a + SETCONF command arrives containing a single ORBindAddress value, the new + command's value replaces the two old values. To _remove_ all settings for a given option entirely (and go back to its default value), send a single line containing the key and no value. -3.4. GETCONF (Type 0x0003) +3.2 GETCONF - Request the value of a configuration variable. The body contains one or - more NL-terminated strings for configuration keys. The server replies - with a CONFVALUE message. + Request the value of a configuration variable. The syntax is: + + "GETCONF" 1*(SP keyword) CRLF + + If all of the listed keywords exist in the Tor configuration, Tor replies + with a series of reply lines of the form: + 250 keyword=value + + If some of the listed keywords can't be found, Tor replies with a + "552 unknown configuration keyword" message. If an option appears multiple times in the configuration, all of its key-value pairs are returned in order. @@ -153,136 +151,93 @@ virtual keyword to get all HiddenServiceDir, HiddenServicePort, HiddenServiceNodes, and HiddenServiceExcludeNodes option settings. -3.5. CONFVALUE (Type 0x0004) - - Sent in response to a GETCONF message; contains a list of "Key Value\n" - (A non-whitespace keyword, a single space, a non-NL value, a NL) - strings. - -3.6. SETEVENTS (Type 0x0005) - - Request the server to inform the client about interesting events. - The body contains a list of 2-byte event codes (see "event" below). - Any events *not* listed in the SETEVENTS body are turned off; thus, sending - SETEVENTS with an empty body turns off all event reporting. - - The server responds with a DONE message on success, and an ERROR message - if one of the event codes isn't recognized. (On error, the list of active - event codes isn't changed.) - -3.7. EVENT (Type 0x0006) - - Sent from the server to the client when an event has occurred and the - client has requested that kind of event. The body contains a 2-byte - event code followed by additional event-dependent information. Event - codes are: - 0x0001 -- Circuit status changed - - Status [1 octet] - 0x00 Launched - circuit ID assigned to new circuit - 0x01 Built - all hops finished, can now accept streams - 0x02 Extended - one more hop has been completed - 0x03 Failed - circuit closed (was not built) - 0x04 Closed - circuit closed (was built) - Circuit ID [4 octets] - (Must be unique to Tor process/time) - Path [NUL-terminated comma-separated string] - (For extended/failed, is the portion of the path that is - built) - - 0x0002 -- Stream status changed - - Status [1 octet] - (Sent connect=0,sent resolve=1,succeeded=2,failed=3, - closed=4, new connection=5, new resolve request=6, - stream detached from circuit and still retriable=7) - Stream ID [4 octets] - (Must be unique to Tor process/time) - Target (NUL-terminated address-port string] - - 0x0003 -- OR Connection status changed +3.3 SETEVENTS - Status [1 octet] - (Launched=0,connected=1,failed=2,closed=3) - OR nickname/identity [NUL-terminated] + Request the server to inform the client about interesting events. The + syntax is: - 0x0004 -- Bandwidth used in the last second + "SETEVENTS" *(SP EventCode) CRLF - Bytes read [4 octets] - Bytes written [4 octets] + EventCode = "CIRC" / "STREAM" / "ORCONN" / "BW" / "DEBUG" / + "INFO" / "NOTICE" / "WARN" / "ERR" / "NEWDESC" - 0x0005 -- Notice/warning/error occurred + Any events *not* listed in the SETEVENTS line are turned off; thus, sending + SETEVENTS with an empty body turns off all event reporting. - Message [NUL-terminated] + The server responds with a "250 OK" reply on success, and a "552 + Unrecognized event" reply if one of the event codes isn't recognized. (On + error, the list of active event codes isn't changed.) - +3.4 AUTHENTICATE - 0x0006 -- New descriptors available + Sent from the client to the server. The syntax is: + "AUTHENTICATE" SP 1*HEXDIG / QuotedString CRLF - OR List [NUL-terminated, comma-delimited list of - OR identity] + The server responds with "250 OK" on success or "515 Bad authentication" if + the authentication cookie is incorrect. - 0x0007 -- Debug message occurred - 0x0008 -- Info message occurred - 0x0009 -- Notice message occurred - 0x000A -- Warning message occurred - 0x000B -- Error message occurred + The format of the 'cookie' is implementation-dependent; see 5.1 below for + information on how the standard Tor implementation handles it. - Message [NUL-terminated] + If Tor requires authentication and the controller has not yet sent an + AUTHENTICATE message, Tor sends a "514 authentication required" reply to + any other kind of message. +3.5 SAVECONF -3.8. AUTHENTICATE (Type 0x0007) + Sent from the client to the server. The syntax is: + "SAVECONF" CRLF - Sent from the client to the server. Contains a 'magic cookie' to prove - that client is really allowed to control this Tor process. The server - responds with DONE or ERROR. + Instructs the server to write out its config options into its torrc. Server + returns "250 OK" if successful, or " if it can't write the file or some + other error occurs. - The format of the 'cookie' is implementation-dependent; see 4.1 below for - information on how the standard Tor implementation handles it. +3.6 SIGNAL -3.9. SAVECONF (Type 0x0008) + Sent from the client to the server. The syntax is: - Sent from the client to the server. Instructs the server to write out - its config options into its torrc. Server returns DONE if successful, or - ERROR if it can't write the file or some other error occurs. + "SIGNAL" SP Signal CRLF -3.10. SIGNAL (Type 0x0009) + Signal = "RELOAD" / "SHUTDOWN" / "DUMP" / "DEBUG" / "TERM" - Sent from the client to the server. The body contains one byte that - indicates the action the client wishes the server to take. + The meaning of the signals are: - 1 (0x01) -- Reload: reload config items, refetch directory. - 2 (0x02) -- Controlled shutdown: if server is an OP, exit immediately. + RELOAD -- Reload: reload config items, refetch directory. (as for HUP) + SHUTDOWN -- Controlled shutdown: if server is an OP, exit immediately. If it's an OR, close listeners and exit after 30 seconds. - 10 (0x0A) -- Dump stats: log information about open connections and - circuits. - 12 (0x0C) -- Debug: switch all open logs to loglevel debug. - 15 (0x0F) -- Immediate shutdown: clean up and exit now. + (as for INT) + DUMP -- Dump stats: log information about open connections and + circuits. (as for USR1) + DEBUG -- Debug: switch all open logs to loglevel debug. (as for USR2) + TERM -- Immediate shutdown: clean up and exit now. (as for TERM) - The server responds with DONE if the signal is recognized (or simply - closes the socket if it was asked to close immediately), else ERROR. + The server responds with "250 OK" if the signal is recognized (or simply + closes the socket if it was asked to close immediately), or "552 + Unrecognized signal" if the signal is unrecognized. -3.11. MAPADDRESS (Type 0x000A) +3.7 MAPADDRESS - Sent from the client to the server. The body contains a sequence of - address mappings, each consisting of the address to be mapped, a single - space, the replacement address, and a NL character. + Sent from the client to the server. The syntax is: - Addresses may be IPv4 addresses, IPv6 addresses, or hostnames. + "MAPADDRESS" 1*(Address "=" Address SP) CRLF - The client sends this message to the server in order to tell it that future - SOCKS requests for connections to the original address should be replaced - with connections to the specified replacement address. If the addresses - are well-formed, and the server is able to fulfill the request, the server - replies with a single DONE message containing the source and destination - addresses. If request is malformed, the server replies with a syntax error - message. The server can't fulfill the request, it replies with an internal - ERROR message. + The first address in each pair is an "original" address; the second is a + "replacement" address. The client sends this message to the server in + order to tell it that future SOCKS requests for connections to the original + address should be replaced with connections to the specified replacement + address. If the addresses are well-formed, and the server is able to + fulfill the request, the server replies with a 250 message: + 250-OldAddress1=NewAddress1 + 250 OldAddress2=NewAddress2 + + containing the source and destination addresses. If request is malformed, + the server replies with "512 syntax error in command argument". If the server + can't fulfill the request, it replies with "451 resource exhausted." The client may decline to provide a body for the original address, and instead send a special null address ("0.0.0.0" for IPv4, "::0" for IPv6, or "." for hostname), signifying that the server should choose the original - address itself, and return that address in the DONE message. The server + address itself, and return that address in the reply. The server should ensure that it returns an element of address space that is unlikely to be in actual use. If there is already an address mapped to the destination address, the server may reuse that mapping. @@ -292,6 +247,11 @@ are the same, the server removes any mapping in place for the original address. + Example: + C: MAPADDRESS 0.0.0.0=tor.eff.org 1.2.3.4=tor.freehaven.net + S: 250-127.192.10.10=tor.eff.org + S: 250 1.2.3.4=tor.freehaven.net + {Note: This feature is designed to be used to help Tor-ify applications that need to use SOCKS4 or hostname-less SOCKS5. There are three approaches to doing this: @@ -305,17 +265,23 @@ This functionality is designed to help implement the 3rd approach.} [XXXX When, if ever, can mappings expire? Should they expire?] - [XXXX What addresses, if any, are safe to use?] -3.12 GETINFO (Type 0x000B) +3.8 GETINFO - Sent from the client to the server. The message body is as for GETCONF: + Sent from the client to the server. The syntax is as for GETCONF: + "GETINFO" 1*(SP keyword) CRLF one or more NL-terminated strings. The server replies with an INFOVALUE message. - Unlike GETCONF, this message is used for data that are not stored in the - Tor configuration file, but instead. - + Unlike GETCONF, this message is used for data that are not stored in the Tor + configuration file, and that may be longer than a single line. On success, + one ReplyLine is sent for each requested value, followed by a final 250 OK + ReplyLine. If a value fits on a single line, the format is: + 250-keyword=value + If avalue must be split over multiple lines, the format is: + 250+keyword= + value + . Recognized key and their values include: "version" -- The version of the server's software, including the name @@ -332,28 +298,38 @@ "addr-mappings/all" "addr-mappings/config" "addr-mappings/cache" - "addr-mappings/control" -- a NL-terminated list of address mappings, each - in the form of "from-address" SP "to-address". The 'config' key + "addr-mappings/control" -- a space-separated list of address mappings, each + in the form of "from-address=to-address". The 'config' key returns those address mappings set in the configuration; the 'cache' key returns the mappings in the client-side DNS cache; the 'control' key returns the mappings set via the control interface; the 'all' target returns the mappings set through any mechanism. -3.13 INFOVALUE (Type 0x000C) + "circuit-status" + A series of lines as for a circuit status event. Each line is of the form: + CircuitID SP CircStatus SP Path CRLF - Sent from the server to the client in response to a GETINFO message. - Contains one or more items of the format: + "stream-status" + A series of lines as for a stream status event. Each is of the form: + StreamID SP StreamStatus SP Target CRLF - Key [(NUL-terminated string)] - Value [(NUL-terminated string)] + "orconn-status" + A series of lines as for a OR connection status event. Each is of the + form: + ServerID SP ORStatus CRLF - The keys match those given in the GETINFO message. + Examples: + C: GETINFO version desc/name/moria1 + S: 250+desc/name/moria= + S: [Descriptor for moria] + S: . + S: 250-version=Tor 0.1.1.0-alpha-cvs + S: 250 OK -3.14 EXTENDCIRCUIT (Type 0x000D) +3.9 EXTENDCIRCUIT - Sent from the client to the server. The message body contains two fields: - Circuit ID [4 octets] - Path [NUL-terminated, comma-delimited string of OR nickname/identity] + Sent from the client to the server. The format is: + "EXTENDCIRCUIT" SP CircuitID SP SeverID *("," ServerID) CRLF This request takes one of two forms: either the Circuit ID is zero, in which case it is a request for the server to build a new circuit according @@ -361,15 +337,14 @@ request for the server to extend an existing circuit with that ID according to the specified path. - If the request is successful, the server sends a DONE message containing + If the request is successful, the server sends a "250 OK" message containing a message body consisting of the four-octet Circuit ID of the newly created circuit. -3.15 ATTACHSTREAM (Type 0x000E) +3.10 ATTACHSTREAM - Sent from the client to the server. The message body contains two fields: - Stream ID [4 octets] - Circuit ID [4 octets] + Sent from the client to the server. The syntax is: + "ATTACHSTREAM" SP StreamID SP CircuitID CRLF This message informs the server that the specified stream should be associated with the specified circuit. Each stream may be associated with @@ -380,16 +355,20 @@ If the circuit ID is 0, responsibility for attaching the given stream is returned to Tor. + Tor responds with "250 OK" if it can attach the stream, 552 if the circuit + or stream didn't exist, or 551 if the stream couldn't be attached for + another reason. + {Implementation note: By default, Tor automatically attaches streams to circuits itself, unless the configuration variable "__LeaveStreamsUnattached" is set to "1". Attempting to attach streams via TC when "__LeaveStreamsUnattached" is false may cause a race between Tor and the controller, as both attempt to attach streams to circuits.} -3.16 POSTDESCRIPTOR (Type 0x000F) +3.11 POSTDESCRIPTOR - Sent from the client to the server. The message body contains one field: - Descriptor [NUL-terminated string] + Sent from the client to the server. The syntax is: + "+POSTDESCRIPTOR" CRLF Descriptor CRLF "." CRLF This message informs the server about a new descriptor. @@ -398,72 +377,198 @@ If there is an error in parsing the descriptor, the server must send an appropriate error message. If the descriptor is well-formed but the server - chooses not to add it, it must reply with a DONE message whose body + chooses not to add it, it must reply with a 251 message whose body explains why the server was not added. -3.17 FRAGMENTHEADER (Type 0x0010) +3.12 REDIRECTSTREAM - Sent in either direction. Used to encapsulate messages longer than 65535 - bytes in length. + Sent from the client to the server. The syntax is: + "REDIRECTSTREAM" SP StreamID SP Address CRLF - Underlying type [2 bytes] - Total Length [4 bytes] - Data [Rest of message] + Tells the server to change the exit address on the specified stream. No + remapping is performed on the new provided address. - A FRAGMENTHEADER message MUST be followed immediately by a number of - FRAGMENT messages, such that lengths of the "Data" fields of the - FRAGMENTHEADER and FRAGMENT messages add to the "Total Length" field of the - FRAGMENTHEADER message. + To be sure that the modified address will be used, this event must be sent + after a new stream event is received, and before attaching this stream to + a circuit. - Implementations MUST NOT fragment messages of length less than 65536 bytes. - Implementations MUST be able to process fragmented messages that not - optimally packed. + Tor replies with "250 OK" on success. -3.18 FRAGMENT (Type 0x0011) +3.13 CLOSESTREAM - Data [Entire message] + Sent from the client to the server. The syntax is: - See FRAGMENTHEADER for more information + "CLOSESTREAM" SP StreamID SP Reason *(SP Flag) CRLF -3.19 REDIRECTSTREAM (Type 0x0012) + Tells the server to close the specified stream. The reason should be one + of the Tor RELAY_END reasons given in tor-spec.txt, as a decimal. Flags is + not used currently; Tor servers SHOULD ignore unrecognized flags. Tor may + hold the stream open for a while to flush any data that is pending. - Sent from the client to the server. The message body contains two fields: - Stream ID [4 octets] - Address [variable-length, NUL-terminated.] +3.14 CLOSECIRCUIT - Tells the server to change the exit address on the specified stream. No - remapping is performed on the new provided address. + The syntax is: + CLOSECIRCUIT SP CircuitID *(SP Flag) CRLF + Flag = "IfUnused" - To be sure that the modified address will be used, this event must be sent - after a new stream event is received, and before attaching this stream to - a circuit. + Tells the server to close the specified circuit. If "IfUnused" is + provided, do not close the circuit unless it is unused. -3.20 CLOSESTREAM (Type 0x0013) + Other flags may be defined in the future; Tor SHOULD ignore unrecognized + flags. - Sent from the client to the server. The message body contains three - fields: - Stream ID [4 octets] - Reason [1 octet] - Flags [1 octet] +4 Replies - Tells the server to close the specified stream. The reason should be - one of the Tor RELAY_END reasons given in tor-spec.txt. Flags is not - used currently. Tor may hold the stream open for a while to flush - any data that is pending. + Reply codes follow the same 3-character format as used by SMTP, with the + first character defining a status, the second character defining a + subsystem, and the third designates fine-grained information. -3.21 CLOSECIRCUIT (Type 0x0014) + The TC protocol currently uses the following first characters: - Sent from the client to the server. The message body contains two - fields: - Circuit ID [4 octets] - Flags [1 octet] + 2yz Positive Completion Reply + The command was successful; a new request can be started. - Tells the server to close the specified circuit. If the LSB of the flags - field is nonzero, do not close the circuit unless it is unused. + 4yz Temporary Negative Completion reply + The command was unsuccessful but might be reattempted later. -4. Implementation notes + 5yz Permanent Negative Completion Reply + The command was unsuccessful; the client should not try exactly + that sequence of commands again. -4.1. Authentication + 6yz Asynchronous Reply + Sent out-of-order in response to an earlier SETEVENTS command. + + The following second characters are used: + + x0z Syntax + Sent in response to ill-formed or nonsensical commands. + + x1z Protocol + Refers to operations of the Tor Control protocol. + + x2z Tor + Refers to actual operations of Tor system. + + The following codes are defined: + + 250 OK + 251 Operation was unnecessary + [Tor has declined to perform the operation, but no harm was done.] + + 451 Resource exhausted + + 500 Syntax error: protocol + + 510 Unrecognized command + 511 Unimplemented command + 512 Syntax error in command argument + 513 Unrecognized command argument + 514 Authentication required + 515 Bad authentication + + 550 Unspecified Tor error + + 551 Internal error + [Something went wrong inside Tor, so that the client's + request couldn't be fulfilled.] + + 552 Unrecognized entity + [A configuration key, a stream ID, circuit ID, event, + mentioned in the command did not actually exist.] + + 553 Invalid configuration value + [The client tried to set a configuration option to an + incorrect, ill-formed, or impossible value.] + + 650 Asynchronous event notification + +4.1 Anynchronous events + + These replies can be sent after a corresponding SETEVENTS command has been + received. They will not be interleaved with other Reply elements, but they + can appear between a command and its corresponding reply. For example, + this sequence is possible: + + C: SETEVENTS CIRC + S: 250 OK + C: GETCONFIG SOCKSPORT ORPORT + S: 650 CIRC 1000 EXTENDED moria1,moria2 + S: 250-SOCKSPORT=9050 + S: 250 ORPORT=0 + + But this sequence is disallowed: + C: SETEVENTS CIRC + S: 250 OK + C: GETCONFIG SOCKSPORT ORPORT + S: 250-SOCKSPORT=9050 + S: 650 CIRC 1000 EXTENDED moria1,moria2 + S: 250 ORPORT=0 + +4.1.1 Circuit status changed + + The syntax is: + + "650" SP "CIRC" SP CircuitID SP CircStatus SP Path + + CircStatus = + "LAUNCHED" / ; circuit ID assigned to new circuit + "BUILT" / ; all hops finished, can now accept streams + "EXTENDED" / ; one more hop has been completed + "FAILED" / ; circuit closed (was not built) + "CLOSED" ; circuit closed (was built) + + Path = ServerID *("," ServerID) + +4.1.2. Stream status changed + + The syntax is: + + "650" SP "STREAM" SP StreamID SP StreamStatus SP Target + + StreamStatus = + "NEW" / ; New request to connect + "NEWRESOLVE" / ; New request to resolve an address + "SENTCONNECT" / ; Sent a connect cell along a circuit + "SENTRESOLVE" / ; Sent a resolve cell along a circuit + "SUCCEEDED" / ; Received a successful reply; stream established + "FAILED" / ; Stream failed and not retriable. + "CLOSED" / ; Stream closed + "DETACHED" ; Stream detached from circuit; still retriable + + Target = Address ":" Port + + +4.1.3 OR Connection status changed + + The syntax is: + "650" SP "ORCONN" SP ServerID SP ORStatus + + ORStatus = "LAUNCHED" / "CONNECTED" / "FAILED" / "CLOSED" + +4.1.3 Bandwidth used in the last second + + The syntax is: + "650" SP "BW" SP BytesRead SP BytesWritten + BytesRead = 1*DIGIT + BytesWritten = 1*DIGIT + +4.1.4 Log message + + The syntax is: + "650" SP Severity SP ReplyText + or + "650+" Severity CRLF Data + + Severity = "DEBUG" / "INFO" / "NOTICE" / "WARN"/ "ERR" + +4.1.5 New descriptors available + + Syntax: + "650" SP "NEWDESC" 1*(SP ServerID) + +5. Implementation notes + +5.1. Authentication By default, the current Tor implementation trusts all local users. @@ -486,8 +591,14 @@ To authenticate under this scheme, the controller sends Tor the original secret that was used to generate the password. -4.2. Don't let the buffer get too big. +5.2. Don't let the buffer get too big. If you ask for lots of events, and 16MB of them queue up on the buffer, the Tor process will close the socket. +5.3. Backward compatibility + + For backward compatibility with the "version 0" control protocol, Tor checks + whether the third byte the first command is zero. If it is, Tor + assumes that version 0 is in use. This feature is deprecated, and will be + removed in the 0.1.2.x Tor development series. From nickm at seul.org Fri Jun 17 18:49:57 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 14:49:57 -0400 (EDT) Subject: [or-cvs] Start implementing framework for revised control spec. Message-ID: <20050617184957.5237C140806B@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv4325/src/or Modified Files: buffers.c connection.c control.c or.h Log Message: Start implementing framework for revised control spec. Index: buffers.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/buffers.c,v retrieving revision 1.162 retrieving revision 1.163 diff -u -d -r1.162 -r1.163 --- buffers.c 11 Jun 2005 21:17:38 -0000 1.162 +++ buffers.c 17 Jun 2005 18:49:54 -0000 1.163 @@ -108,10 +108,22 @@ /** If the pointer cp has passed beyond the end of the buffer, wrap it * around. */ static INLINE char * -_wrap_ptr(buf_t *buf, char *cp) { +_wrap_ptr(buf_t *buf, char *cp) +{ return (cp >= buf->mem + buf->len) ? (cp - buf->len) : cp; } +/** Return the offset of cp within the buffer. */ +static INLINE int +_buf_offset(buf_t *buf, char *cp) +{ + if (cp >= buf->cur) + return cp - buf->cur; + else + /* return (cp - buf->mem) + buf->mem+buf->len - buf->cur */ + return cp + buf->len - buf->cur; +} + /** If the range of *len bytes starting at at wraps around the * end of the buffer, then set *len to the number of bytes starting * at at, and set *more_len to the number of bytes starting @@ -1099,7 +1111,7 @@ #define CONTROL_CMD_FRAGMENTHEADER 0x0010 #define CONTROL_CMD_FRAGMENT 0x0011 -/** If there is a complete control message waiting on buf, then store +/** If there is a complete version 0control message waiting on buf, then store * its contents into *type_out, store its body's length into * *len_out, allocate and store a string for its body into * *body_out, and return 1. (body_out will always be NUL-terminated, @@ -1107,11 +1119,11 @@ * * If there is not a complete control message waiting, return 0. * - * Return -1 on error. + * Return -1 on error; return -2 on "seems to be control protocol v1." */ int -fetch_from_buf_control(buf_t *buf, uint32_t *len_out, uint16_t *type_out, - char **body_out) +fetch_from_buf_control0(buf_t *buf, uint32_t *len_out, uint16_t *type_out, + char **body_out, int check_for_v1) { uint32_t msglen; uint16_t type; @@ -1128,10 +1140,13 @@ peek_from_buf(tmp, 4, buf); msglen = ntohs(get_uint16(tmp)); + type = ntohs(get_uint16(tmp+2)); + if (type > 255 && check_for_v1) + return -2; + if (buf->datalen < 4 + (unsigned)msglen) return 0; - type = ntohs(get_uint16(tmp+2)); *len_out = msglen; *type_out = type; buf_remove_from_front(buf, 4); @@ -1145,6 +1160,57 @@ return 1; } +/** DOCDOC */ +static char * +find_char_on_buf(buf_t *buf, char *start, size_t len, char c) +{ + size_t len_rest; + char *cp; + _split_range(buf, start, &len, &len_rest); + cp = memchr(buf->cur, c, len); + if (cp || !len_rest) + return cp; + return memchr(buf->mem, c, len_rest); +} + +static char * +find_crlf_on_buf(buf_t *buf, char *cp) +{ + char *next; + while (1) { + size_t remaining = buf->datalen - _buf_offset(buf,cp); + cp = find_char_on_buf(buf, cp, remaining, '\r'); + if (!cp) + return NULL; + next = _wrap_ptr(buf, cp+1); + if (next == _buf_end(buf)) + return NULL; + if (*next == '\n') + return cp; + cp = next; + } +} + +/* DOCDOC : 0 means 'need to read more'. means done, -1 means "grow buffer." */ +int +fetch_from_buf_line(buf_t *buf, char *data_out, size_t *data_len) +{ + char *eol; + size_t sz; + /* Look for a CRLF. */ + if (!(eol = find_crlf_on_buf(buf, buf->cur))) + return 0; + sz = _buf_offset(buf, eol); + if (sz+2 > *data_len) { + *data_len = sz+2; + return -1; + } + fetch_from_buf(data_out, sz+2, buf); + *data_len = sz+2; + return 1; +} + + /** Log an error and exit if buf is corrupted. */ void assert_buf_ok(buf_t *buf) Index: connection.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection.c,v retrieving revision 1.379 retrieving revision 1.380 diff -u -d -r1.379 -r1.380 --- connection.c 15 Jun 2005 18:34:46 -0000 1.379 +++ connection.c 17 Jun 2005 18:49:55 -0000 1.380 @@ -120,8 +120,12 @@ break; case CONN_TYPE_CONTROL: switch (state) { - case CONTROL_CONN_STATE_OPEN: return "open"; - case CONTROL_CONN_STATE_NEEDAUTH: return "waiting for authentication"; + case CONTROL_CONN_STATE_OPEN_V0: return "open (protocol v0)"; + case CONTROL_CONN_STATE_OPEN_V1: return "open (protocol v1)"; + case CONTROL_CONN_STATE_NEEDAUTH_V0: + return "waiting for authentication (protocol unknown)"; + case CONTROL_CONN_STATE_NEEDAUTH_V1: + return "waiting for authentication (protocol v1)"; } break; } @@ -667,7 +671,7 @@ conn->state = DIR_CONN_STATE_SERVER_COMMAND_WAIT; break; case CONN_TYPE_CONTROL: - conn->state = CONTROL_CONN_STATE_NEEDAUTH; + conn->state = CONTROL_CONN_STATE_NEEDAUTH_V0; break; } return 0; @@ -1578,7 +1582,9 @@ if ((conn->type == CONN_TYPE_OR && conn->state == OR_CONN_STATE_OPEN) || (conn->type == CONN_TYPE_AP && conn->state == AP_CONN_STATE_OPEN) || (conn->type == CONN_TYPE_EXIT && conn->state == EXIT_CONN_STATE_OPEN) || - (conn->type == CONN_TYPE_CONTROL && conn->state ==CONTROL_CONN_STATE_OPEN)) + (conn->type == CONN_TYPE_CONTROL && + (conn->state == CONTROL_CONN_STATE_OPEN_V0 || + conn->state == CONTROL_CONN_STATE_OPEN_V1))) return 1; return 0; Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- control.c 11 Jun 2005 18:59:24 -0000 1.88 +++ control.c 17 Jun 2005 18:49:55 -0000 1.89 @@ -10,47 +10,38 @@ #include "or.h" -/* Protocol outline: a bidirectional stream, over which each side - * sends a series of messages. Each message has a two-byte length field, - * a two-byte typecode, and a variable-length body whose length is - * given in the length field. - * - * By default, the server only sends messages in response to client messages. - * Every client message gets a message in response. The client may, however, - * _request_ that other messages be delivered asynchronously. - * - * - * Every message type is either client-only or server-only, and every - * server message type is either synchronous-only (only occurs in - * response to a client request) or asynchronous-only (never is an - * answer to a client request. - * - * See control-spec.txt for full details. +#define STATE_IS_OPEN(s) ((s) == CONTROL_CONN_STATE_OPEN_V0 || \ + (s) == CONTROL_CONN_STATE_OPEN_V1) +#define STATE_IS_V0(s) ((s) == CONTROL_CONN_STATE_NEEDAUTH_V0 || \ + (s) == CONTROL_CONN_STATE_OPEN_V0) + +/* + * See control-spec.txt and control-spec-v0.txt for full details on protocol(s). */ /* Recognized message type codes. */ -#define CONTROL_CMD_ERROR 0x0000 -#define CONTROL_CMD_DONE 0x0001 -#define CONTROL_CMD_SETCONF 0x0002 -#define CONTROL_CMD_GETCONF 0x0003 -#define CONTROL_CMD_CONFVALUE 0x0004 -#define CONTROL_CMD_SETEVENTS 0x0005 -#define CONTROL_CMD_EVENT 0x0006 -#define CONTROL_CMD_AUTHENTICATE 0x0007 -#define CONTROL_CMD_SAVECONF 0x0008 -#define CONTROL_CMD_SIGNAL 0x0009 -#define CONTROL_CMD_MAPADDRESS 0x000A -#define CONTROL_CMD_GETINFO 0x000B -#define CONTROL_CMD_INFOVALUE 0x000C -#define CONTROL_CMD_EXTENDCIRCUIT 0x000D -#define CONTROL_CMD_ATTACHSTREAM 0x000E -#define CONTROL_CMD_POSTDESCRIPTOR 0x000F -#define CONTROL_CMD_FRAGMENTHEADER 0x0010 -#define CONTROL_CMD_FRAGMENT 0x0011 -#define CONTROL_CMD_REDIRECTSTREAM 0x0012 -#define CONTROL_CMD_CLOSESTREAM 0x0013 -#define CONTROL_CMD_CLOSECIRCUIT 0x0014 -#define _CONTROL_CMD_MAX_RECOGNIZED 0x0014 +#define CONTROL0_CMD_ERROR 0x0000 +#define CONTROL0_CMD_DONE 0x0001 +#define CONTROL0_CMD_SETCONF 0x0002 +#define CONTROL0_CMD_GETCONF 0x0003 +#define CONTROL0_CMD_CONFVALUE 0x0004 +#define CONTROL0_CMD_SETEVENTS 0x0005 +#define CONTROL0_CMD_EVENT 0x0006 +#define CONTROL0_CMD_AUTHENTICATE 0x0007 +#define CONTROL0_CMD_SAVECONF 0x0008 +#define CONTROL0_CMD_SIGNAL 0x0009 +#define CONTROL0_CMD_MAPADDRESS 0x000A +#define CONTROL0_CMD_GETINFO 0x000B +#define CONTROL0_CMD_INFOVALUE 0x000C +#define CONTROL0_CMD_EXTENDCIRCUIT 0x000D +#define CONTROL0_CMD_ATTACHSTREAM 0x000E +#define CONTROL0_CMD_POSTDESCRIPTOR 0x000F +#define CONTROL0_CMD_FRAGMENTHEADER 0x0010 +#define CONTROL0_CMD_FRAGMENT 0x0011 +#define CONTROL0_CMD_REDIRECTSTREAM 0x0012 +#define CONTROL0_CMD_CLOSESTREAM 0x0013 +#define CONTROL0_CMD_CLOSECIRCUIT 0x0014 +#define _CONTROL0_CMD_MAX_RECOGNIZED 0x0014 /* Recognized error codes. */ #define ERR_UNSPECIFIED 0x0000 @@ -84,7 +75,7 @@ /** Array mapping from message type codes to human-readable message * type names. */ -static const char * CONTROL_COMMANDS[_CONTROL_CMD_MAX_RECOGNIZED+1] = { +static const char * CONTROL0_COMMANDS[_CONTROL0_CMD_MAX_RECOGNIZED+1] = { "error", "done", "setconf", @@ -127,13 +118,13 @@ static char authentication_cookie[AUTHENTICATION_COOKIE_LEN]; static void update_global_event_mask(void); -static void send_control_message(connection_t *conn, uint16_t type, +static void send_control0_message(connection_t *conn, uint16_t type, uint32_t len, const char *body); static void send_control_done(connection_t *conn); static void send_control_done2(connection_t *conn, const char *msg, size_t len); -static void send_control_error(connection_t *conn, uint16_t error, +static void send_control0_error(connection_t *conn, uint16_t error, const char *message); -static void send_control_event(uint16_t event, uint32_t len, const char *body); +static void send_control0_event(uint16_t event, uint32_t len, const char *body); static int handle_control_setconf(connection_t *conn, uint32_t len, char *body); static int handle_control_getconf(connection_t *conn, uint32_t len, @@ -168,7 +159,7 @@ static INLINE const char * control_cmd_to_string(uint16_t cmd) { - return (cmd<=_CONTROL_CMD_MAX_RECOGNIZED) ? CONTROL_COMMANDS[cmd] : "Unknown"; + return (cmd<=_CONTROL0_CMD_MAX_RECOGNIZED) ? CONTROL0_COMMANDS[cmd] : "Unknown"; } static INLINE int @@ -209,7 +200,7 @@ get_connection_array(&conns, &n_conns); for (i = 0; i < n_conns; ++i) { if (conns[i]->type == CONN_TYPE_CONTROL && - conns[i]->state == CONTROL_CONN_STATE_OPEN) { + STATE_IS_OPEN(conns[i]->state)) { global_event_mask |= conns[i]->event_mask; } } @@ -247,16 +238,45 @@ control_event_logmsg); } +static INLINE void +connection_write_str_to_buf(const char *s, connection_t *conn) +{ + size_t len = strlen(s); + connection_write_to_buf(s, len, conn); +} + + +static void +connection_printf_to_buf(connection_t *conn, const char *format, ...) +{ + va_list ap; + char buf[1024]; + int r; + size_t len; + va_start(ap,format); + r = tor_snprintf(buf, sizeof(buf), format, ap); + va_end(ap); + len = strlen(buf); + if (memcmp("\r\n\0", buf+len-2, 3)) { + buf[1023] = '\0'; + buf[1022] = '\n'; + buf[1021] = '\r'; + } + connection_write_to_buf(buf, len, conn); +} + + /** Send a message of type type containing len bytes * from body along the control connection conn */ static void -send_control_message(connection_t *conn, uint16_t type, uint32_t len, +send_control0_message(connection_t *conn, uint16_t type, uint32_t len, const char *body) { char buf[10]; tor_assert(conn); + tor_assert(STATE_IS_V0(conn->state)); tor_assert(len || !body); - tor_assert(type <= _CONTROL_CMD_MAX_RECOGNIZED); + tor_assert(type <= _CONTROL0_CMD_MAX_RECOGNIZED); if (len < 65536) { set_uint16(buf, htons(len)); set_uint16(buf+2, htons(type)); @@ -265,7 +285,7 @@ connection_write_to_buf(body, len, conn); } else { set_uint16(buf, htons(65535)); - set_uint16(buf+2, htons(CONTROL_CMD_FRAGMENTHEADER)); + set_uint16(buf+2, htons(CONTROL0_CMD_FRAGMENTHEADER)); set_uint16(buf+4, htons(type)); set_uint32(buf+6, htonl(len)); connection_write_to_buf(buf, 10, conn); @@ -275,7 +295,7 @@ while (len) { size_t chunklen = (len<65535)?len:65535; set_uint16(buf, htons((uint16_t)chunklen)); - set_uint16(buf+2, htons(CONTROL_CMD_FRAGMENT)); + set_uint16(buf+2, htons(CONTROL0_CMD_FRAGMENT)); connection_write_to_buf(buf, 4, conn); connection_write_to_buf(body, chunklen, conn); len -= chunklen; @@ -288,7 +308,11 @@ static void send_control_done(connection_t *conn) { - send_control_message(conn, CONTROL_CMD_DONE, 0, NULL); + if (STATE_IS_V0(conn->state)) { + send_control0_message(conn, CONTROL0_CMD_DONE, 0, NULL); + } else { + connection_write_str_to_buf("250 OK\r\n", conn); + } } /** DOCDOC */ @@ -297,13 +321,13 @@ { if (len==0) len = strlen(msg); - send_control_message(conn, CONTROL_CMD_DONE, len, msg); + send_control0_message(conn, CONTROL0_CMD_DONE, len, msg); } /** Send an error message with error code error and body * message down the connection conn */ static void -send_control_error(connection_t *conn, uint16_t error, const char *message) +send_control0_error(connection_t *conn, uint16_t error, const char *message) { char buf[256]; size_t len; @@ -311,14 +335,14 @@ len = strlen(message); tor_assert(len < (256-2)); memcpy(buf+2, message, len); - send_control_message(conn, CONTROL_CMD_ERROR, (uint16_t)(len+2), buf); + send_control0_message(conn, CONTROL0_CMD_ERROR, (uint16_t)(len+2), buf); } /** Send an 'event' message of event type event, containing * len bytes in body to every control connection that * is interested in it. */ static void -send_control_event(uint16_t event, uint32_t len, const char *body) +send_control0_event(uint16_t event, uint32_t len, const char *body) { connection_t **conns; int n_conns, i; @@ -335,9 +359,9 @@ get_connection_array(&conns, &n_conns); for (i = 0; i < n_conns; ++i) { if (conns[i]->type == CONN_TYPE_CONTROL && - conns[i]->state == CONTROL_CONN_STATE_OPEN && + conns[i]->state == CONTROL_CONN_STATE_OPEN_V0 && conns[i]->event_mask & (1< _EVENT_MAX) { - send_control_error(conn, ERR_UNRECOGNIZED_EVENT_CODE, + send_control0_error(conn, ERR_UNRECOGNIZED_EVENT_CODE, "Unrecognized event code"); return 0; } @@ -525,12 +549,15 @@ } err: - send_control_error(conn, ERR_REJECTED_AUTHENTICATION,"Authentication failed"); + send_control0_error(conn, ERR_REJECTED_AUTHENTICATION,"Authentication failed"); return 0; ok: log_fn(LOG_INFO, "Authenticated control connection (%d)", conn->s); send_control_done(conn); - conn->state = CONTROL_CONN_STATE_OPEN; + if (STATE_IS_V0(conn->state)) + conn->state = CONTROL_CONN_STATE_OPEN_V0; + else + conn->state = CONTROL_CONN_STATE_OPEN_V1; return 0; } @@ -540,7 +567,7 @@ const char *body) { if (save_current_config()<0) { - send_control_error(conn, ERR_INTERNAL, + send_control0_error(conn, ERR_INTERNAL, "Unable to write configuration to disk."); } else { send_control_done(conn); @@ -554,10 +581,10 @@ const char *body) { if (len != 1) { - send_control_error(conn, ERR_SYNTAX, + send_control0_error(conn, ERR_SYNTAX, "Body of SIGNAL command too long or too short."); } else if (control_signal_act((uint8_t)body[0]) < 0) { - send_control_error(conn, ERR_SYNTAX, "Unrecognized signal number."); + send_control0_error(conn, ERR_SYNTAX, "Unrecognized signal number."); } else { send_control_done(conn); } @@ -689,10 +716,10 @@ SMARTLIST_FOREACH(questions, const char *, q, { if (handle_getinfo_helper(q, &ans) < 0) { - send_control_error(conn, ERR_INTERNAL, body); + send_control0_error(conn, ERR_INTERNAL, body); goto done; } if (!ans) { - send_control_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY, body); + send_control0_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY, body); goto done; } smartlist_add(answers, tor_strdup(q)); @@ -701,7 +728,7 @@ msg = smartlist_join_strings2(answers, "\0", 1, 1, &msg_len); tor_assert(msg_len > 0); /* it will at least be terminated */ - send_control_message(conn, CONTROL_CMD_INFOVALUE, + send_control0_message(conn, CONTROL0_CMD_INFOVALUE, msg_len, msg); done: @@ -724,7 +751,7 @@ circuit_t *circ; char reply[4]; if (len<5) { - send_control_error(conn, ERR_SYNTAX, "extendcircuit message too short"); + send_control0_error(conn, ERR_SYNTAX, "extendcircuit message too short"); return 0; } @@ -735,13 +762,13 @@ { routerinfo_t *r = router_get_by_nickname(n); if (!r) { - send_control_error(conn, ERR_NO_ROUTER, n); + send_control0_error(conn, ERR_NO_ROUTER, n); goto done; } smartlist_add(routers, r); }); if (!smartlist_len(routers)) { - send_control_error(conn, ERR_SYNTAX, "No router names provided"); + send_control0_error(conn, ERR_SYNTAX, "No router names provided"); goto done; } @@ -752,7 +779,7 @@ } else { circ = circuit_get_by_global_id(circ_id); if (!circ) { - send_control_error(conn, ERR_NO_CIRC, + send_control0_error(conn, ERR_NO_CIRC, "No circuit found with given ID"); goto done; } @@ -769,7 +796,7 @@ if (!circ_id) { if (circuit_handle_first_hop(circ) < 0) { circuit_mark_for_close(circ); - send_control_error(conn, ERR_INTERNAL, "couldn't start circuit"); + send_control0_error(conn, ERR_INTERNAL, "couldn't start circuit"); goto done; } } else { @@ -778,7 +805,7 @@ if (circuit_send_next_onion_skin(circ) < 0) { log_fn(LOG_INFO,"send_next_onion_skin failed; circuit marked for closing."); circuit_mark_for_close(circ); - send_control_error(conn, ERR_INTERNAL, "couldn't send onion skin"); + send_control0_error(conn, ERR_INTERNAL, "couldn't send onion skin"); goto done; } } @@ -804,7 +831,7 @@ circuit_t *circ; if (len < 8) { - send_control_error(conn, ERR_SYNTAX, "attachstream message too short"); + send_control0_error(conn, ERR_SYNTAX, "attachstream message too short"); return 0; } @@ -812,12 +839,12 @@ circ_id = ntohl(get_uint32(body+4)); if (!(ap_conn = connection_get_by_global_id(conn_id))) { - send_control_error(conn, ERR_NO_STREAM, + send_control0_error(conn, ERR_NO_STREAM, "No connection found with given ID"); return 0; } if (ap_conn->state != AP_CONN_STATE_CONTROLLER_WAIT) { - send_control_error(conn, ERR_NO_STREAM, + send_control0_error(conn, ERR_NO_STREAM, "Connection was not managed by controller."); return 0; } @@ -831,15 +858,15 @@ } if (!(circ = circuit_get_by_global_id(circ_id))) { - send_control_error(conn, ERR_NO_CIRC, "No circuit found with given ID"); + send_control0_error(conn, ERR_NO_CIRC, "No circuit found with given ID"); return 0; } if (circ->state != CIRCUIT_STATE_OPEN) { - send_control_error(conn, ERR_INTERNAL, "Refuse to attach stream to non-open circ."); + send_control0_error(conn, ERR_INTERNAL, "Refuse to attach stream to non-open circ."); return 0; } if (connection_ap_handshake_attach_chosen_circuit(ap_conn, circ) != 1) { - send_control_error(conn, ERR_INTERNAL, "Unable to attach stream."); + send_control0_error(conn, ERR_INTERNAL, "Unable to attach stream."); return 0; } send_control_done(conn); @@ -854,7 +881,7 @@ const char *msg=NULL; switch (router_load_single_router(body, &msg)) { case -1: - send_control_error(conn,ERR_SYNTAX,msg?msg: "Could not parse descriptor"); + send_control0_error(conn,ERR_SYNTAX,msg?msg: "Could not parse descriptor"); break; case 0: send_control_done2(conn,msg?msg: "Descriptor not added",0); @@ -875,7 +902,7 @@ connection_t *ap_conn; uint32_t conn_id; if (len < 6) { - send_control_error(conn, ERR_SYNTAX, "redirectstream message too short"); + send_control0_error(conn, ERR_SYNTAX, "redirectstream message too short"); return 0; } conn_id = ntohl(get_uint32(body)); @@ -883,7 +910,7 @@ if (!(ap_conn = connection_get_by_global_id(conn_id)) || ap_conn->state != CONN_TYPE_AP || !ap_conn->socks_request) { - send_control_error(conn, ERR_NO_STREAM, + send_control0_error(conn, ERR_NO_STREAM, "No AP connection found with given ID"); return 0; } @@ -904,7 +931,7 @@ uint8_t reason; if (len < 6) { - send_control_error(conn, ERR_SYNTAX, "closestream message too short"); + send_control0_error(conn, ERR_SYNTAX, "closestream message too short"); return 0; } @@ -914,7 +941,7 @@ if (!(ap_conn = connection_get_by_global_id(conn_id)) || ap_conn->state != CONN_TYPE_AP || !ap_conn->socks_request) { - send_control_error(conn, ERR_NO_STREAM, + send_control0_error(conn, ERR_NO_STREAM, "No AP connection found with given ID"); return 0; } @@ -933,14 +960,14 @@ int safe; if (len < 5) { - send_control_error(conn, ERR_SYNTAX, "closecircuit message too short"); + send_control0_error(conn, ERR_SYNTAX, "closecircuit message too short"); return 0; } circ_id = ntohl(get_uint32(body)); safe = (*(uint8_t*)(body+4)) & 1; if (!(circ = circuit_get_by_global_id(circ_id))) { - send_control_error(conn, ERR_NO_CIRC, + send_control0_error(conn, ERR_NO_CIRC, "No circuit found with given ID"); return 0; } @@ -958,13 +985,13 @@ handle_control_fragments(connection_t *conn, uint16_t command_type, uint32_t body_len, char *body) { - if (command_type == CONTROL_CMD_FRAGMENTHEADER) { + if (command_type == CONTROL0_CMD_FRAGMENTHEADER) { if (conn->incoming_cmd) { log_fn(LOG_WARN, "Dropping incomplete fragmented command"); tor_free(conn->incoming_cmd); } if (body_len < 6) { - send_control_error(conn, ERR_SYNTAX, "FRAGMENTHEADER too short."); + send_control0_error(conn, ERR_SYNTAX, "FRAGMENTHEADER too short."); return 0; } conn->incoming_cmd_type = ntohs(get_uint16(body)); @@ -973,9 +1000,9 @@ conn->incoming_cmd = tor_malloc(conn->incoming_cmd_len); body += 6; body_len -= 6; - } else if (command_type == CONTROL_CMD_FRAGMENT) { + } else if (command_type == CONTROL0_CMD_FRAGMENT) { if (!conn->incoming_cmd) { - send_control_error(conn, ERR_SYNTAX, "Out-of-place FRAGMENT"); + send_control0_error(conn, ERR_SYNTAX, "Out-of-place FRAGMENT"); return 0; } } else { @@ -984,7 +1011,7 @@ if (conn->incoming_cmd_cur_len + body_len > conn->incoming_cmd_len) { tor_free(conn->incoming_cmd); - send_control_error(conn, ERR_SYNTAX, + send_control0_error(conn, ERR_SYNTAX, "Fragmented data exceeds declared length"); return 0; } @@ -1009,27 +1036,150 @@ int connection_control_reached_eof(connection_t *conn) { + tor_assert(conn); + tor_assert(conn->type == CONN_TYPE_CONTROL); + log_fn(LOG_INFO,"Control connection reached EOF. Closing."); connection_mark_for_close(conn); return 0; } -/** Called when conn has received more bytes on its inbuf. - */ -int -connection_control_process_inbuf(connection_t *conn) +static int +connection_control_process_inbuf_v1(connection_t *conn) { - uint32_t body_len; - uint16_t command_type; - char *body; + size_t data_len, cmd_len; tor_assert(conn); tor_assert(conn->type == CONN_TYPE_CONTROL); + tor_assert(conn->state == CONTROL_CONN_STATE_OPEN_V1 || + conn->state == CONTROL_CONN_STATE_NEEDAUTH_V1); + + if (!conn->incoming_cmd) { + conn->incoming_cmd = tor_malloc(1024); + conn->incoming_cmd_len = 1024; + conn->incoming_cmd_cur_len = 0; + } + + again: + while (1) { + size_t last_idx; + int r; + while (1) { + data_len = conn->incoming_cmd_len - conn->incoming_cmd_cur_len; + r = fetch_from_buf_line(conn->inbuf, + conn->incoming_cmd+conn->incoming_cmd_cur_len, + &data_len); + if (r == 0) + /* Line not all here yet. Wait. */ + return 0; + else if (r == -1) { + while (conn->incoming_cmd_len < data_len) + conn->incoming_cmd_len *= 2; + conn->incoming_cmd = tor_realloc(conn->incoming_cmd, conn->incoming_cmd_len); + } + } while (r != 1); + + tor_assert(data_len); + + last_idx = conn->incoming_cmd_cur_len; + conn->incoming_cmd_cur_len += data_len; + + /* We have appended a line to incoming_cmd. Is the command done? */ + if (last_idx == 0 && *conn->incoming_cmd != '+') + /* One line command, didn't start with '+'. */ + break; + if (last_idx+3 == conn->incoming_cmd_cur_len && + !memcmp(conn->incoming_cmd + last_idx, ".\r\n", 3)) + /* Just appended ".\r\n"; we're done. */ + break; + /* Otherwise, read another line. */ + } + data_len = conn->incoming_cmd_cur_len; + /* Okay, we now have a command sitting on conn->incoming_cmd. See if we + * recognize it. + */ + while (cmd_len < data_len && !isspace(conn->incoming_cmd[cmd_len])) + ++cmd_len; + + if (conn->state == CONTROL_CONN_STATE_NEEDAUTH_V1 && + strncasecmp(conn->incoming_cmd, "AUTHENTICATE", cmd_len)) { + connection_write_str_to_buf("514 Authentication required.\r\n", conn); + conn->incoming_cmd_cur_len = 0; + goto again; + } + + if (!strncasecmp(conn->incoming_cmd, "SETCONF", cmd_len)) { + if (handle_control_setconf(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "GETCONF", cmd_len)) { + if (handle_control_getconf(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "SETEVENTS", cmd_len)) { + if (handle_control_setevents(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "AUTENTICATE", cmd_len)) { + if (handle_control_authenticate(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "SAVECONF", cmd_len)) { + if (handle_control_saveconf(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "SIGNAL", cmd_len)) { + if (handle_control_signal(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "MAPADDRESS", cmd_len)) { + if (handle_control_mapaddress(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "GETINFO", cmd_len)) { + if (handle_control_getinfo(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "EXTENDCIRCUIT", cmd_len)) { + if (handle_control_extendcircuit(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "ATTACHSTREAM", cmd_len)) { + if (handle_control_attachstream(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "+POSTDESCRIPTOR", cmd_len)) { + if (handle_control_postdescriptor(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "REDIRECTSTREAM", cmd_len)) { + if (handle_control_redirectstream(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "CLOSESTREAM", cmd_len)) { + if (handle_control_closestream(conn, 0, NULL)) + return -1; + } else if (!strncasecmp(conn->incoming_cmd, "CLOSECIRCUIT", cmd_len)) { + if (handle_control_closecircuit(conn, 0, NULL)) + return -1; + } else { + conn->incoming_cmd[cmd_len] = '\0'; + connection_printf_to_buf(conn, "510 Unrecognizd command \"%s\"\r\n", + conn->incoming_cmd); + } + + conn->incoming_cmd_cur_len = 0; + goto again; + +} + + +static int +connection_control_process_inbuf_v0(connection_t *conn) +{ + uint32_t body_len; + uint16_t command_type; + char *body; again: /* Try to suck a control message from the buffer. */ - switch (fetch_from_buf_control(conn->inbuf, &body_len, &command_type, &body)) + switch (fetch_from_buf_control0(conn->inbuf, &body_len, &command_type, &body, + conn->state == CONTROL_CONN_STATE_NEEDAUTH_V0)) { + case -2: + tor_free(body); + log_fn(LOG_INFO, "Detected v1 contol protocol on connection (fd %d)", + conn->s); + conn->state = CONTROL_CONN_STATE_NEEDAUTH_V1; + return connection_control_process_inbuf_v1(conn); case -1: tor_free(body); log_fn(LOG_WARN, "Error in control command. Failing."); @@ -1046,17 +1196,17 @@ /* We got a command. If we need authentication, only authentication * commands will be considered. */ - if (conn->state == CONTROL_CONN_STATE_NEEDAUTH && - command_type != CONTROL_CMD_AUTHENTICATE) { + if (conn->state == CONTROL_CONN_STATE_NEEDAUTH_V0 && + command_type != CONTROL0_CMD_AUTHENTICATE) { log_fn(LOG_WARN, "Rejecting '%s' command; authentication needed.", control_cmd_to_string(command_type)); - send_control_error(conn, ERR_UNAUTHORIZED, "Authentication required"); + send_control0_error(conn, ERR_UNAUTHORIZED, "Authentication required"); tor_free(body); goto again; } - if (command_type == CONTROL_CMD_FRAGMENTHEADER || - command_type == CONTROL_CMD_FRAGMENT) { + if (command_type == CONTROL0_CMD_FRAGMENTHEADER || + command_type == CONTROL0_CMD_FRAGMENT) { if (handle_control_fragments(conn, command_type, body_len, body)) return -1; tor_free(body); @@ -1075,80 +1225,80 @@ /* Okay, we're willing to process the command. */ switch (command_type) { - case CONTROL_CMD_SETCONF: + case CONTROL0_CMD_SETCONF: if (handle_control_setconf(conn, body_len, body)) return -1; break; - case CONTROL_CMD_GETCONF: + case CONTROL0_CMD_GETCONF: if (handle_control_getconf(conn, body_len, body)) return -1; break; - case CONTROL_CMD_SETEVENTS: + case CONTROL0_CMD_SETEVENTS: if (handle_control_setevents(conn, body_len, body)) return -1; break; - case CONTROL_CMD_AUTHENTICATE: + case CONTROL0_CMD_AUTHENTICATE: if (handle_control_authenticate(conn, body_len, body)) return -1; break; - case CONTROL_CMD_SAVECONF: + case CONTROL0_CMD_SAVECONF: if (handle_control_saveconf(conn, body_len, body)) return -1; break; - case CONTROL_CMD_SIGNAL: + case CONTROL0_CMD_SIGNAL: if (handle_control_signal(conn, body_len, body)) return -1; break; - case CONTROL_CMD_MAPADDRESS: + case CONTROL0_CMD_MAPADDRESS: if (handle_control_mapaddress(conn, body_len, body)) return -1; break; - case CONTROL_CMD_GETINFO: + case CONTROL0_CMD_GETINFO: if (handle_control_getinfo(conn, body_len, body)) return -1; break; - case CONTROL_CMD_EXTENDCIRCUIT: + case CONTROL0_CMD_EXTENDCIRCUIT: if (handle_control_extendcircuit(conn, body_len, body)) return -1; break; - case CONTROL_CMD_ATTACHSTREAM: + case CONTROL0_CMD_ATTACHSTREAM: if (handle_control_attachstream(conn, body_len, body)) return -1; break; - case CONTROL_CMD_POSTDESCRIPTOR: + case CONTROL0_CMD_POSTDESCRIPTOR: if (handle_control_postdescriptor(conn, body_len, body)) return -1; break; - case CONTROL_CMD_REDIRECTSTREAM: + case CONTROL0_CMD_REDIRECTSTREAM: if (handle_control_redirectstream(conn, body_len, body)) return -1; break; - case CONTROL_CMD_CLOSESTREAM: + case CONTROL0_CMD_CLOSESTREAM: if (handle_control_closestream(conn, body_len, body)) return -1; break; - case CONTROL_CMD_CLOSECIRCUIT: + case CONTROL0_CMD_CLOSECIRCUIT: if (handle_control_closecircuit(conn, body_len, body)) return -1; break; - case CONTROL_CMD_ERROR: - case CONTROL_CMD_DONE: - case CONTROL_CMD_CONFVALUE: - case CONTROL_CMD_EVENT: - case CONTROL_CMD_INFOVALUE: + case CONTROL0_CMD_ERROR: + case CONTROL0_CMD_DONE: + case CONTROL0_CMD_CONFVALUE: + case CONTROL0_CMD_EVENT: + case CONTROL0_CMD_INFOVALUE: log_fn(LOG_WARN, "Received client-only '%s' command; ignoring.", control_cmd_to_string(command_type)); - send_control_error(conn, ERR_UNRECOGNIZED_TYPE, + send_control0_error(conn, ERR_UNRECOGNIZED_TYPE, "Command type only valid from server to tor client"); break; - case CONTROL_CMD_FRAGMENTHEADER: - case CONTROL_CMD_FRAGMENT: + case CONTROL0_CMD_FRAGMENTHEADER: + case CONTROL0_CMD_FRAGMENT: log_fn(LOG_WARN, "Recieved command fragment out of order; ignoring."); - send_control_error(conn, ERR_SYNTAX, "Bad fragmentation on command."); + send_control0_error(conn, ERR_SYNTAX, "Bad fragmentation on command."); default: log_fn(LOG_WARN, "Received unrecognized command type %d; ignoring.", (int)command_type); - send_control_error(conn, ERR_UNRECOGNIZED_TYPE, + send_control0_error(conn, ERR_UNRECOGNIZED_TYPE, "Unrecognized command type"); break; } @@ -1156,6 +1306,20 @@ goto again; /* There might be more data. */ } +/** Called when conn has received more bytes on its inbuf. + */ +int +connection_control_process_inbuf(connection_t *conn) +{ + tor_assert(conn); + tor_assert(conn->type == CONN_TYPE_CONTROL); + + if (STATE_IS_V0(conn->state)) + return connection_control_process_inbuf_v0(conn); + else + return connection_control_process_inbuf_v1(conn); +} + /** Something has happened to circuit circ: tell any interested * control connections. */ int @@ -1175,7 +1339,7 @@ set_uint32(msg+1, htonl(circ->global_identifier)); strlcpy(msg+5,path,path_len+1); - send_control_event(EVENT_CIRCUIT_STATUS, (uint32_t)(path_len+6), msg); + send_control0_event(EVENT_CIRCUIT_STATUS, (uint32_t)(path_len+6), msg); tor_free(path); tor_free(msg); return 0; @@ -1207,7 +1371,7 @@ set_uint32(msg+1, htonl(conn->global_identifier)); strlcpy(msg+5, buf, len+1); - send_control_event(EVENT_STREAM_STATUS, (uint32_t)(5+len+1), msg); + send_control0_event(EVENT_STREAM_STATUS, (uint32_t)(5+len+1), msg); tor_free(msg); return 0; } @@ -1228,7 +1392,7 @@ buf[0] = (uint8_t)tp; strlcpy(buf+1,conn->nickname,sizeof(buf)-1); len = strlen(buf+1); - send_control_event(EVENT_OR_CONN_STATUS, (uint32_t)(len+1), buf); + send_control0_event(EVENT_OR_CONN_STATUS, (uint32_t)(len+1), buf); return 0; } @@ -1244,7 +1408,7 @@ set_uint32(buf, htonl(n_read)); set_uint32(buf+4, htonl(n_written)); - send_control_event(EVENT_BANDWIDTH_USED, 8, buf); + send_control0_event(EVENT_BANDWIDTH_USED, 8, buf); return 0; } @@ -1270,9 +1434,9 @@ size_t len = strlen(msg); sending_logmsg = 1; if (event) - send_control_event(event, (uint32_t)(len+1), msg); + send_control0_event(event, (uint32_t)(len+1), msg); if (oldlog) - send_control_event(EVENT_LOG_OBSOLETE, (uint32_t)(len+1), msg); + send_control0_event(EVENT_LOG_OBSOLETE, (uint32_t)(len+1), msg); sending_logmsg = 0; } } @@ -1298,7 +1462,7 @@ smartlist_add(identities, tor_strdup(buf)); }); msg = smartlist_join_strings(identities, ",", 1, &len); - send_control_event(EVENT_NEW_DESC, len+1, msg); + send_control0_event(EVENT_NEW_DESC, len+1, msg); SMARTLIST_FOREACH(identities, char *, cp, tor_free(cp)); smartlist_free(identities); Index: or.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.616 retrieving revision 1.617 diff -u -d -r1.616 -r1.617 --- or.h 15 Jun 2005 18:34:46 -0000 1.616 +++ or.h 17 Jun 2005 18:49:55 -0000 1.617 @@ -286,9 +286,11 @@ #define _DIR_CONN_STATE_MAX 5 #define _CONTROL_CONN_STATE_MIN 1 -#define CONTROL_CONN_STATE_OPEN 1 -#define CONTROL_CONN_STATE_NEEDAUTH 2 -#define _CONTROL_CONN_STATE_MAX 2 +#define CONTROL_CONN_STATE_OPEN_V0 1 +#define CONTROL_CONN_STATE_OPEN_V1 2 +#define CONTROL_CONN_STATE_NEEDAUTH_V0 3 +#define CONTROL_CONN_STATE_NEEDAUTH_V1 4 +#define _CONTROL_CONN_STATE_MAX 4 #define _DIR_PURPOSE_MIN 1 /** Purpose for connection to directory server: download a directory. */ @@ -655,10 +657,12 @@ /* Used only by control connections */ uint32_t event_mask; - uint16_t incoming_cmd_type; uint32_t incoming_cmd_len; uint32_t incoming_cmd_cur_len; char *incoming_cmd; + + /* Used only by control v0 connections */ + uint16_t incoming_cmd_type; }; typedef struct connection_t connection_t; @@ -1181,8 +1185,9 @@ char **headers_out, size_t max_headerlen, char **body_out, size_t *body_used, size_t max_bodylen); int fetch_from_buf_socks(buf_t *buf, socks_request_t *req); -int fetch_from_buf_control(buf_t *buf, uint32_t *len_out, uint16_t *type_out, - char **body_out); +int fetch_from_buf_control0(buf_t *buf, uint32_t *len_out, uint16_t *type_out, + char **body_out, int check_for_v1); +int fetch_from_buf_line(buf_t *buf, char *data_out, size_t *data_len); void assert_buf_ok(buf_t *buf); From nickm at seul.org Fri Jun 17 18:54:08 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 14:54:08 -0400 (EDT) Subject: [or-cvs] Update some item status Message-ID: <20050617185408.2976C140806B@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv4499/doc Modified Files: TODO Log Message: Update some item status Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.323 retrieving revision 1.324 diff -u -d -r1.323 -r1.324 --- TODO 13 Jun 2005 00:35:19 -0000 1.323 +++ TODO 17 Jun 2005 18:54:06 -0000 1.324 @@ -53,6 +53,16 @@ simple to trigger. for 0.1.1.x: +N . Controller improvements + . new controller protocol + . Specify + . Implement + - controller should have an event to learn about new addressmappings, + e.g. when we learn a hostname to IP mapping ? + - make sure err-level log events get flushed to the controller + immediately, since tor will exit right after. + - add new getinfo options to enumerate things we only find out about + currently via events. - switch accountingmax to count total in+out, not either in or out. it's easy to move in this direction (not risky), but hard to back, out if we decide we prefer it the way it already is. hm. @@ -65,16 +75,11 @@ - Handle rendezvousing with unverified nodes. - Specify: Stick rendezvous point's key in INTRODUCE cell. Bob should _always_ use key from INTRODUCE cell. + - Change to new rendezvous introduction cell format. (It's currently #if + 0'd out). Unless we already did that. - Implement. - - make sure err-level log events get flushed to the controller - immediately, since tor will exit right after. - it looks like tor_assert writes to stderr. what happens if stderr was closed and is now something else? uh. - - new controller protocol - - Specify - - Implement - - controller should have an event to learn about new addressmappings, - e.g. when we learn a hostname to IP mapping ? - christian grothoff's attack of infinite-length circuit. the solution is to have a separate 'extend-data' cell type which is used for the first N data cells, and only From nickm at seul.org Fri Jun 17 20:37:23 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 16:37:23 -0400 (EDT) Subject: [or-cvs] Implement all the easy bits of the new control protocol Message-ID: <20050617203723.B89851408108@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv7831/src/or Modified Files: buffers.c control.c main.c Log Message: Implement all the easy bits of the new control protocol Index: buffers.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/buffers.c,v retrieving revision 1.163 retrieving revision 1.164 diff -u -d -r1.163 -r1.164 --- buffers.c 17 Jun 2005 18:49:54 -0000 1.163 +++ buffers.c 17 Jun 2005 20:37:21 -0000 1.164 @@ -1198,19 +1198,20 @@ char *eol; size_t sz; /* Look for a CRLF. */ - if (!(eol = find_crlf_on_buf(buf, buf->cur))) + if (!(eol = find_crlf_on_buf(buf, buf->cur))) { return 0; + } sz = _buf_offset(buf, eol); - if (sz+2 > *data_len) { - *data_len = sz+2; + if (sz+3 > *data_len) { + *data_len = sz+3; return -1; } fetch_from_buf(data_out, sz+2, buf); + data_out[sz+2] = '\0'; *data_len = sz+2; return 1; } - /** Log an error and exit if buf is corrupted. */ void assert_buf_ok(buf_t *buf) Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- control.c 17 Jun 2005 18:49:55 -0000 1.89 +++ control.c 17 Jun 2005 20:37:21 -0000 1.90 @@ -102,11 +102,15 @@ * has interest in without having to walk over the global connection * list to find out. **/ -static uint32_t global_event_mask = 0; +static uint32_t global_event_mask0 = 0; +static uint32_t global_event_mask1 = 0; /** Macro: true if any control connection is interested in events of type * e. */ -#define EVENT_IS_INTERESTING(e) (global_event_mask & (1<<(e))) +#define EVENT_IS_INTERESTING0(e) (global_event_mask0 & (1<<(e))) +#define EVENT_IS_INTERESTING1(e) (global_event_mask1 & (1<<(e))) +#define EVENT_IS_INTERESTING(e) \ + ((global_event_mask0|global_event_mask1) & (1<<(e))) /** If we're using cookie-type authentication, how long should our cookies be? */ @@ -117,6 +121,8 @@ static int authentication_cookie_is_set = 0; static char authentication_cookie[AUTHENTICATION_COOKIE_LEN]; +static void connection_printf_to_buf(connection_t *conn, const char *format, ...) + CHECK_PRINTF(2,3); static void update_global_event_mask(void); static void send_control0_message(connection_t *conn, uint16_t type, uint32_t len, const char *body); @@ -125,6 +131,8 @@ static void send_control0_error(connection_t *conn, uint16_t error, const char *message); static void send_control0_event(uint16_t event, uint32_t len, const char *body); +static void send_control1_event(uint16_t event, const char *format, ...) + CHECK_PRINTF(2,3); static int handle_control_setconf(connection_t *conn, uint32_t len, char *body); static int handle_control_getconf(connection_t *conn, uint32_t len, @@ -196,12 +204,16 @@ { connection_t **conns; int n_conns, i; - global_event_mask = 0; + global_event_mask0 = 0; + global_event_mask1 = 0; get_connection_array(&conns, &n_conns); for (i = 0; i < n_conns; ++i) { if (conns[i]->type == CONN_TYPE_CONTROL && STATE_IS_OPEN(conns[i]->state)) { - global_event_mask |= conns[i]->event_mask; + if (STATE_IS_V0(conns[i]->state)) + global_event_mask0 |= conns[i]->event_mask; + else + global_event_mask1 |= conns[i]->event_mask; } } @@ -246,6 +258,7 @@ } + static void connection_printf_to_buf(connection_t *conn, const char *format, ...) { @@ -254,7 +267,7 @@ int r; size_t len; va_start(ap,format); - r = tor_snprintf(buf, sizeof(buf), format, ap); + r = tor_vsnprintf(buf, sizeof(buf), format, ap); va_end(ap); len = strlen(buf); if (memcmp("\r\n\0", buf+len-2, 3)) { @@ -265,6 +278,28 @@ connection_write_to_buf(buf, len, conn); } +#if 0 +static void +connection_write_reply_lines_to_buf(connection_t *conn, + const char *code, smartlist_t *lines) +{ + int i, len; + + tor_assert(strlen(code) == 3); + len = smartlist_len(lines); + if (!len) + return; + + for (i=0; i < len-1; ++i) { + connection_write_to_buf(code, 3, conn); + connection_write_to_buf("-", 1, conn); + connection_write_str_to_buf(smartlist_get(lines, i), conn); + } + connection_write_to_buf(code, 3, conn); + connection_write_to_buf(" ", 1, conn); + connection_write_str_to_buf(smartlist_get(lines, len-1), conn); +} +#endif /** Send a message of type type containing len bytes * from body along the control connection conn */ @@ -371,11 +406,47 @@ tor_free(buf); } +static void +send_control1_event(uint16_t event, const char *format, ...) +{ + connection_t **conns; + int n_conns, i, r; + char buf[1024]; /* XXXX Length */ + va_list ap; + size_t len; + + va_start(ap, format); + r = tor_vsnprintf(buf, sizeof(buf), format, ap); + va_end(ap); + + len = strlen(buf); + if (memcmp("\r\n\0", buf+len-2, 3)) { + buf[1023] = '\0'; + buf[1022] = '\n'; + buf[1021] = '\r'; + } + + tor_assert(event >= _EVENT_MIN && event <= _EVENT_MAX); + + get_connection_array(&conns, &n_conns); + for (i = 0; i < n_conns; ++i) { + if (conns[i]->type == CONN_TYPE_CONTROL && + conns[i]->state == CONTROL_CONN_STATE_OPEN_V1 && + conns[i]->event_mask & (1<state); questions = smartlist_create(); - smartlist_split_string(questions, body, "\n", - SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + if (v0) { + smartlist_split_string(questions, body, "\n", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + } else { + smartlist_split_string(questions, body, " ", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + } answers = smartlist_create(); - SMARTLIST_FOREACH(questions, const char *, q, + unrecognized = smartlist_create(); + SMARTLIST_FOREACH(questions, char *, q, { - int recognized = config_option_is_recognized(q); - if (!recognized) { - send_control0_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY, q); - goto done; + if (!config_option_is_recognized(q)) { + if (v0) { + send_control0_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY, q); + goto done; + } else { + smartlist_add(unrecognized, q); + } } else { struct config_line_t *answer = config_get_assigned_option(options,q); while (answer) { struct config_line_t *next; - size_t alen = strlen(answer->key)+strlen(answer->value)+3; + size_t alen = strlen(answer->key)+strlen(answer->value)+8; char *astr = tor_malloc(alen); - tor_snprintf(astr, alen, "%s %s\n", answer->key, answer->value); + if (v0) + tor_snprintf(astr, alen, "%s %s\n", answer->key, answer->value); + else + tor_snprintf(astr, alen, "250-%s=%s\r\n", answer->key, answer->value); smartlist_add(answers, astr); next = answer->next; @@ -446,15 +531,37 @@ } }); - msg = smartlist_join_strings(answers, "", 0, &msg_len); - send_control0_message(conn, CONTROL0_CMD_CONFVALUE, - (uint16_t)msg_len, msg_len?msg:NULL); + if (v0) { + msg = smartlist_join_strings(answers, "", 0, &msg_len); + send_control0_message(conn, CONTROL0_CMD_CONFVALUE, + (uint16_t)msg_len, msg_len?msg:NULL); + } else { + int i,len; + if ((len = smartlist_len(unrecognized))) { + for (i=0; i < len-1; ++i) + connection_printf_to_buf(conn, + "552-Unrecognized configuration key \"%s\"\r\n", + (char*)smartlist_get(unrecognized, i)); + connection_printf_to_buf(conn, + "552 Unrecognized configuration key \"%s\"\r\n", + (char*)smartlist_get(unrecognized, len-1)); + } else if ((len = smartlist_len(answers))) { + char *tmp = smartlist_get(answers, len-1); + tor_assert(strlen(tmp)>4); + tmp[3] = ' '; + msg = smartlist_join_strings(answers, "", 0, &msg_len); + connection_write_to_buf(msg, msg_len, conn); + } else { + connection_write_str_to_buf("250 OK\r\n", conn); + } + } done: if (answers) SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp)); if (questions) SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp)); smartlist_free(answers); smartlist_free(questions); + smartlist_free(unrecognized); tor_free(msg); return 0; @@ -467,22 +574,61 @@ { uint16_t event_code; uint32_t event_mask = 0; - if (len % 2) { - send_control0_error(conn, ERR_SYNTAX, - "Odd number of bytes in setevents message"); - return 0; - } - for (; len; len -= 2, body += 2) { - event_code = ntohs(get_uint16(body)); - if (event_code < _EVENT_MIN || event_code > _EVENT_MAX) { - send_control0_error(conn, ERR_UNRECOGNIZED_EVENT_CODE, - "Unrecognized event code"); + if (STATE_IS_V0(conn->state)) { + if (len % 2) { + send_control0_error(conn, ERR_SYNTAX, + "Odd number of bytes in setevents message"); return 0; } - event_mask |= (1 << event_code); - } + for (; len; len -= 2, body += 2) { + event_code = ntohs(get_uint16(body)); + if (event_code < _EVENT_MIN || event_code > _EVENT_MAX) { + send_control0_error(conn, ERR_UNRECOGNIZED_EVENT_CODE, + "Unrecognized event code"); + return 0; + } + event_mask |= (1 << event_code); + } + } else { + smartlist_t *events = smartlist_create(); + smartlist_split_string(events, body, " ", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + SMARTLIST_FOREACH(events, const char *, ev, + { + if (!strcasecmp(ev, "CIRC")) + event_code = EVENT_CIRCUIT_STATUS; + else if (!strcasecmp(ev, "STREAM")) + event_code = EVENT_STREAM_STATUS; + else if (!strcasecmp(ev, "ORCONN")) + event_code = EVENT_OR_CONN_STATUS; + else if (!strcasecmp(ev, "BW")) + event_code = EVENT_BANDWIDTH_USED; + else if (!strcasecmp(ev, "DEBUG")) + continue; /* Don't do debug messages */ + else if (!strcasecmp(ev, "INFO")) + event_code = EVENT_INFO_MSG; + else if (!strcasecmp(ev, "NOTICE")) + event_code = EVENT_NOTICE_MSG; + else if (!strcasecmp(ev, "WARN")) + event_code = EVENT_WARN_MSG; + else if (!strcasecmp(ev, "ERR")) + event_code = EVENT_ERR_MSG; + else if (!strcasecmp(ev, "NEWDESC")) + event_code = EVENT_NEW_DESC; + else { + connection_printf_to_buf(conn, "552 Unrecognized event \"%s\"\r\n", + ev); + SMARTLIST_FOREACH(events, char *, e, tor_free(e)); + smartlist_free(events); + return 0; + } + event_mask |= (1 << event_code); + }); + SMARTLIST_FOREACH(events, char *, e, tor_free(e)); + smartlist_free(events); + } conn->event_mask = event_mask; update_global_event_mask(); @@ -522,6 +668,7 @@ static int handle_control_authenticate(connection_t *conn, uint32_t len, const char *body) { + /* XXXX V1 */ or_options_t *options = get_options(); if (options->CookieAuthentication) { if (len == AUTHENTICATION_COOKIE_LEN && @@ -540,16 +687,16 @@ goto ok; goto err; } else { - if (len == 0) { - /* if Tor doesn't demand any stronger authentication, then - * the controller can get in with a blank auth line. */ - goto ok; - } - goto err; + /* if Tor doesn't demand any stronger authentication, then + * the controller can get in with anything. */ + goto ok; } err: - send_control0_error(conn, ERR_REJECTED_AUTHENTICATION,"Authentication failed"); + if (STATE_IS_V0(conn->state)) + send_control0_error(conn,ERR_REJECTED_AUTHENTICATION,"Authentication failed"); + else + connection_write_str_to_buf("515 Authentication failed\r\n", conn); return 0; ok: log_fn(LOG_INFO, "Authenticated control connection (%d)", conn->s); @@ -567,8 +714,12 @@ const char *body) { if (save_current_config()<0) { - send_control0_error(conn, ERR_INTERNAL, - "Unable to write configuration to disk."); + if (STATE_IS_V0(conn->state)) + send_control0_error(conn, ERR_INTERNAL, + "Unable to write configuration to disk."); + else + connection_write_str_to_buf("551 Unable to write configuration to disk.", + conn); } else { send_control_done(conn); } @@ -580,11 +731,47 @@ handle_control_signal(connection_t *conn, uint32_t len, const char *body) { - if (len != 1) { - send_control0_error(conn, ERR_SYNTAX, - "Body of SIGNAL command too long or too short."); - } else if (control_signal_act((uint8_t)body[0]) < 0) { - send_control0_error(conn, ERR_SYNTAX, "Unrecognized signal number."); + int sig; + if (STATE_IS_V0(conn->state)) { + if (len != 1) { + send_control0_error(conn, ERR_SYNTAX, + "Body of SIGNAL command too long or too short."); + return 0; + } else { + sig = (uint8_t)body[0]; + } + } else { + int n = 0; + char *s; + while (body[n] && ! TOR_ISSPACE(body[n])) + ++n; + s = tor_strndup(body, n); + if (!strcasecmp(s, "RELOAD") || !strcasecmp(s, "HUP")) + sig = SIGHUP; + else if (!strcasecmp(s, "SHUTDOWN") || !strcasecmp(s, "INT")) + sig = SIGINT; + else if (!strcasecmp(s, "DUMP") || !strcasecmp(s, "USR1")) + sig = SIGUSR1; + else if (!strcasecmp(s, "DEBUG") || !strcasecmp(s, "USR2")) + sig = SIGUSR2; + else if (!strcasecmp(s, "HALT") || !strcasecmp(s, "TERM")) + sig = SIGTERM; + else { + connection_printf_to_buf(conn, "552 Unrecognized signal code \"%s\"\r\n", + body); + sig = -1; + } + tor_free(s); + if (sig<0) + return 0; + } + + if (control_signal_act(sig) < 0) { + if (STATE_IS_V0(conn->state)) + send_control0_error(conn, ERR_SYNTAX, "Unrecognized signal number."); + else + connection_write_str_to_buf("551 Internal error acting on signal\r\n", + conn); } else { send_control_done(conn); } @@ -595,6 +782,7 @@ static int handle_control_mapaddress(connection_t *conn, uint32_t len, const char *body) { + /* XXXX V1 */ smartlist_t *elts; smartlist_t *lines; smartlist_t *reply; @@ -704,6 +892,7 @@ static int handle_control_getinfo(connection_t *conn, uint32_t len, const char *body) { + /* XXXX V1 */ smartlist_t *questions = NULL; smartlist_t *answers = NULL; char *msg = NULL, *ans; @@ -746,6 +935,7 @@ handle_control_extendcircuit(connection_t *conn, uint32_t len, const char *body) { + /* XXXX V1 */ smartlist_t *router_nicknames, *routers; uint32_t circ_id; circuit_t *circ; @@ -825,6 +1015,7 @@ handle_control_attachstream(connection_t *conn, uint32_t len, const char *body) { + /* XXXX V1 */ uint32_t conn_id; uint32_t circ_id; connection_t *ap_conn; @@ -878,6 +1069,7 @@ handle_control_postdescriptor(connection_t *conn, uint32_t len, const char *body) { + /* XXXX V1 */ const char *msg=NULL; switch (router_load_single_router(body, &msg)) { case -1: @@ -899,6 +1091,7 @@ handle_control_redirectstream(connection_t *conn, uint32_t len, const char *body) { + /* XXXX V1 */ connection_t *ap_conn; uint32_t conn_id; if (len < 6) { @@ -926,6 +1119,7 @@ handle_control_closestream(connection_t *conn, uint32_t len, const char *body) { + /* XXXX V1 */ uint32_t conn_id; connection_t *ap_conn; uint8_t reason; @@ -955,6 +1149,7 @@ handle_control_closecircuit(connection_t *conn, uint32_t len, const char *body) { + /* XXXX V1 */ uint32_t circ_id; circuit_t *circ; int safe; @@ -1048,6 +1243,7 @@ connection_control_process_inbuf_v1(connection_t *conn) { size_t data_len, cmd_len; + char *args; tor_assert(conn); tor_assert(conn->type == CONN_TYPE_CONTROL); @@ -1064,7 +1260,7 @@ while (1) { size_t last_idx; int r; - while (1) { + do { data_len = conn->incoming_cmd_len - conn->incoming_cmd_cur_len; r = fetch_from_buf_line(conn->inbuf, conn->incoming_cmd+conn->incoming_cmd_cur_len, @@ -1073,7 +1269,7 @@ /* Line not all here yet. Wait. */ return 0; else if (r == -1) { - while (conn->incoming_cmd_len < data_len) + while (conn->incoming_cmd_len < data_len+conn->incoming_cmd_cur_len) conn->incoming_cmd_len *= 2; conn->incoming_cmd = tor_realloc(conn->incoming_cmd, conn->incoming_cmd_len); } @@ -1098,70 +1294,84 @@ /* Okay, we now have a command sitting on conn->incoming_cmd. See if we * recognize it. */ + cmd_len = 0; while (cmd_len < data_len && !isspace(conn->incoming_cmd[cmd_len])) ++cmd_len; + /* + log_fn(LOG_NOTICE, "READ A COMMAND FROM THE BUFFER: <%s> [%d]", + conn->incoming_cmd, (int)cmd_len); + */ + data_len -= cmd_len; + conn->incoming_cmd[cmd_len]='\0'; + args = conn->incoming_cmd+cmd_len+1; + while (*args == ' ' || *args == '\t') { + ++args; + --data_len; + } + /* + log_fn(LOG_NOTICE, "COMMAND IS: <%s>", conn->incoming_cmd); + log_fn(LOG_NOTICE, "ARGS ARE: <%s>", args); + */ + if (conn->state == CONTROL_CONN_STATE_NEEDAUTH_V1 && - strncasecmp(conn->incoming_cmd, "AUTHENTICATE", cmd_len)) { + strcasecmp(conn->incoming_cmd, "AUTHENTICATE")) { connection_write_str_to_buf("514 Authentication required.\r\n", conn); conn->incoming_cmd_cur_len = 0; goto again; } - if (!strncasecmp(conn->incoming_cmd, "SETCONF", cmd_len)) { - if (handle_control_setconf(conn, 0, NULL)) + if (!strcasecmp(conn->incoming_cmd, "SETCONF")) { + if (handle_control_setconf(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "GETCONF", cmd_len)) { - if (handle_control_getconf(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "GETCONF")) { + if (handle_control_getconf(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "SETEVENTS", cmd_len)) { - if (handle_control_setevents(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "SETEVENTS")) { + if (handle_control_setevents(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "AUTENTICATE", cmd_len)) { - if (handle_control_authenticate(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "AUTHENTICATE")) { + if (handle_control_authenticate(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "SAVECONF", cmd_len)) { - if (handle_control_saveconf(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "SAVECONF")) { + if (handle_control_saveconf(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "SIGNAL", cmd_len)) { - if (handle_control_signal(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "SIGNAL")) { + if (handle_control_signal(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "MAPADDRESS", cmd_len)) { - if (handle_control_mapaddress(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "MAPADDRESS")) { + if (handle_control_mapaddress(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "GETINFO", cmd_len)) { - if (handle_control_getinfo(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "GETINFO")) { + if (handle_control_getinfo(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "EXTENDCIRCUIT", cmd_len)) { - if (handle_control_extendcircuit(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "EXTENDCIRCUIT")) { + if (handle_control_extendcircuit(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "ATTACHSTREAM", cmd_len)) { - if (handle_control_attachstream(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "ATTACHSTREAM")) { + if (handle_control_attachstream(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "+POSTDESCRIPTOR", cmd_len)) { - if (handle_control_postdescriptor(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "+POSTDESCRIPTOR")) { + if (handle_control_postdescriptor(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "REDIRECTSTREAM", cmd_len)) { - if (handle_control_redirectstream(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "REDIRECTSTREAM")) { + if (handle_control_redirectstream(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "CLOSESTREAM", cmd_len)) { - if (handle_control_closestream(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "CLOSESTREAM")) { + if (handle_control_closestream(conn, data_len, args)) return -1; - } else if (!strncasecmp(conn->incoming_cmd, "CLOSECIRCUIT", cmd_len)) { - if (handle_control_closecircuit(conn, 0, NULL)) + } else if (!strcasecmp(conn->incoming_cmd, "CLOSECIRCUIT")) { + if (handle_control_closecircuit(conn, data_len, args)) return -1; } else { - conn->incoming_cmd[cmd_len] = '\0'; - connection_printf_to_buf(conn, "510 Unrecognizd command \"%s\"\r\n", + connection_printf_to_buf(conn, "510 Unrecognized command \"%s\"\r\n", conn->incoming_cmd); } conn->incoming_cmd_cur_len = 0; goto again; - } - static int connection_control_process_inbuf_v0(connection_t *conn) { @@ -1326,22 +1536,42 @@ control_event_circuit_status(circuit_t *circ, circuit_status_event_t tp) { char *path, *msg; - size_t path_len; if (!EVENT_IS_INTERESTING(EVENT_CIRCUIT_STATUS)) return 0; tor_assert(circ); tor_assert(CIRCUIT_IS_ORIGIN(circ)); path = circuit_list_path(circ,0); - path_len = strlen(path); - msg = tor_malloc(1+4+path_len+1); /* event, circid, path, NUL. */ - msg[0] = (uint8_t) tp; - set_uint32(msg+1, htonl(circ->global_identifier)); - strlcpy(msg+5,path,path_len+1); + if (EVENT_IS_INTERESTING0(EVENT_CIRCUIT_STATUS)) { + size_t path_len = strlen(path); + msg = tor_malloc(1+4+path_len+1); /* event, circid, path, NUL. */ + msg[0] = (uint8_t) tp; + set_uint32(msg+1, htonl(circ->global_identifier)); + strlcpy(msg+5,path,path_len+1); - send_control0_event(EVENT_CIRCUIT_STATUS, (uint32_t)(path_len+6), msg); + send_control0_event(EVENT_CIRCUIT_STATUS, (uint32_t)(path_len+6), msg); + tor_free(msg); + } + if (EVENT_IS_INTERESTING1(EVENT_CIRCUIT_STATUS)) { + const char *status; + switch (tp) + { + case CIRC_EVENT_LAUNCHED: status = "LAUNCHED"; break; + case CIRC_EVENT_BUILT: status = "BUILT"; break; + case CIRC_EVENT_EXTENDED: status = "EXTENDED"; break; + case CIRC_EVENT_FAILED: status = "FAILED"; break; + case CIRC_EVENT_CLOSED: status = "CLOSED"; break; + default: + log_fn(LOG_WARN, "Unrecognized status code %d", (int)tp); + return 0; + } + send_control1_event(EVENT_CIRCUIT_STATUS, + "650 CIRC %lu %s %s\r\n", + (unsigned long)circ->global_identifier, + status, path); + } tor_free(path); - tor_free(msg); + return 0; } @@ -1364,15 +1594,38 @@ tor_snprintf(buf, sizeof(buf), "%s%s:%d", conn->socks_request->address, conn->chosen_exit_name ? buf2 : "", - conn->socks_request->port), - len = strlen(buf); - msg = tor_malloc(5+len+1); - msg[0] = (uint8_t) tp; - set_uint32(msg+1, htonl(conn->global_identifier)); - strlcpy(msg+5, buf, len+1); + conn->socks_request->port); + if (EVENT_IS_INTERESTING0(EVENT_STREAM_STATUS)) { + len = strlen(buf); + msg = tor_malloc(5+len+1); + msg[0] = (uint8_t) tp; + set_uint32(msg+1, htonl(conn->global_identifier)); + strlcpy(msg+5, buf, len+1); - send_control0_event(EVENT_STREAM_STATUS, (uint32_t)(5+len+1), msg); - tor_free(msg); + send_control0_event(EVENT_STREAM_STATUS, (uint32_t)(5+len+1), msg); + tor_free(msg); + } + if (EVENT_IS_INTERESTING0(EVENT_STREAM_STATUS)) { + const char *status; + switch (tp) + { + case STREAM_EVENT_SENT_CONNECT: status = "SENTCONNECT"; break; + case STREAM_EVENT_SENT_RESOLVE: status = "SENTRESOLVE"; break; + case STREAM_EVENT_SUCCEEDED: status = "SUCCEEDED"; break; + case STREAM_EVENT_FAILED: status = "FAILED"; break; + case STREAM_EVENT_CLOSED: status = "CLOSED"; break; + case STREAM_EVENT_NEW: status = "NEW"; break; + case STREAM_EVENT_NEW_RESOLVE: status = "NEWRESOLVE"; break; + case STREAM_EVENT_FAILED_RETRIABLE: status = "DETACHED"; break; + default: + log_fn(LOG_WARN, "Unrecognized status code %d", (int)tp); + return 0; + } + send_control1_event(EVENT_STREAM_STATUS, + "650 STREAM %lu %s %s\r\n", + (unsigned long)conn->global_identifier, + status, buf); + } return 0; } @@ -1389,10 +1642,28 @@ if (!EVENT_IS_INTERESTING(EVENT_OR_CONN_STATUS)) return 0; - buf[0] = (uint8_t)tp; - strlcpy(buf+1,conn->nickname,sizeof(buf)-1); - len = strlen(buf+1); - send_control0_event(EVENT_OR_CONN_STATUS, (uint32_t)(len+1), buf); + if (EVENT_IS_INTERESTING0(EVENT_OR_CONN_STATUS)) { + buf[0] = (uint8_t)tp; + strlcpy(buf+1,conn->nickname,sizeof(buf)-1); + len = strlen(buf+1); + send_control0_event(EVENT_OR_CONN_STATUS, (uint32_t)(len+1), buf); + } + if (EVENT_IS_INTERESTING1(EVENT_OR_CONN_STATUS)) { + const char *status; + switch (tp) + { + case OR_CONN_EVENT_LAUNCHED: status = "LAUNCHED"; break; + case OR_CONN_EVENT_CONNECTED: status = "CONNECTED"; break; + case OR_CONN_EVENT_FAILED: status = "FAILED"; break; + case OR_CONN_EVENT_CLOSED: status = "CLOSED"; break; + default: + log_fn(LOG_WARN, "Unrecognized status code %d", (int)tp); + return 0; + } + send_control1_event(EVENT_OR_CONN_STATUS, + "650 ORCONN %s %s\r\n", + conn->nickname, status); + } return 0; } @@ -1403,12 +1674,17 @@ { char buf[8]; - if (!EVENT_IS_INTERESTING(EVENT_BANDWIDTH_USED)) - return 0; - - set_uint32(buf, htonl(n_read)); - set_uint32(buf+4, htonl(n_written)); - send_control0_event(EVENT_BANDWIDTH_USED, 8, buf); + if (EVENT_IS_INTERESTING0(EVENT_BANDWIDTH_USED)) { + set_uint32(buf, htonl(n_read)); + set_uint32(buf+4, htonl(n_written)); + send_control0_event(EVENT_BANDWIDTH_USED, 8, buf); + } + if (EVENT_IS_INTERESTING1(EVENT_BANDWIDTH_USED)) { + send_control1_event(EVENT_BANDWIDTH_USED, + "650 BW %lu %lu\r\n", + (unsigned long)n_read, + (unsigned long)n_written); + } return 0; } @@ -1417,6 +1693,7 @@ void control_event_logmsg(int severity, const char *msg) { + /* XXXX V1 */ static int sending_logmsg=0; int oldlog, event; @@ -1461,12 +1738,19 @@ base16_encode(buf,sizeof(buf),r->identity_digest,DIGEST_LEN); smartlist_add(identities, tor_strdup(buf)); }); - msg = smartlist_join_strings(identities, ",", 1, &len); - send_control0_event(EVENT_NEW_DESC, len+1, msg); - + if (EVENT_IS_INTERESTING0(EVENT_NEW_DESC)) { + msg = smartlist_join_strings(identities, ",", 0, &len); + send_control0_event(EVENT_NEW_DESC, len+1, msg); + tor_free(msg); + } + if (EVENT_IS_INTERESTING1(EVENT_NEW_DESC)) { + msg = smartlist_join_strings(identities, " ", 0, &len); + send_control1_event(EVENT_NEW_DESC, "650 NEWDESC %s\r\n", msg); + tor_free(msg); + } SMARTLIST_FOREACH(identities, char *, cp, tor_free(cp)); smartlist_free(identities); - tor_free(msg); + return 0; } Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.517 retrieving revision 1.518 diff -u -d -r1.517 -r1.518 --- main.c 13 Jun 2005 00:35:19 -0000 1.517 +++ main.c 17 Jun 2005 20:37:21 -0000 1.518 @@ -16,7 +16,9 @@ #include #endif -/* These signals are defined to help control_signal_act work. */ +/* These signals are defined to help control_signal_act work. + * XXXX Move into or.h or compat.h + */ #ifndef SIGHUP #define SIGHUP 1 #endif From thomass at seul.org Fri Jun 17 21:54:18 2005 From: thomass at seul.org (thomass at seul.org) Date: Fri, 17 Jun 2005 17:54:18 -0400 (EDT) Subject: [or-cvs] Lets try relative font sizes Message-ID: <20050617215418.165C91408032@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv10660 Modified Files: stylesheet.css Log Message: Lets try relative font sizes Index: stylesheet.css =================================================================== RCS file: /home2/or/cvsroot/website/stylesheet.css,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- stylesheet.css 9 Jun 2005 22:04:54 -0000 1.17 +++ stylesheet.css 17 Jun 2005 21:54:16 -0000 1.18 @@ -2,7 +2,7 @@ background-color: #FFFFFF; margin-top: 0px; font-family: Arial, Helvetica, sans-serif; - font-size: 10pt; + font-size: 1em; font-style: normal; color: #000000; padding-top: 0px; @@ -65,7 +65,7 @@ } div.bottom { - font-size: 8px; + font-size: 0.8em; margin-top: 2cm; margin-left: 1em; margin-right: 1em; @@ -87,7 +87,7 @@ a.current { color: #FF7F00; font-weight: bold; - font-size: 11px; + font-size: 1em; } /* The main column (left text) */ @@ -95,19 +95,19 @@ div.main-column { padding: 0 0 10px 10px; text-indent: 0pt; - font-size: 10pt; + font-size: 1em; text-align: left; } /* formatting styles */ h1 { - font-size: 12pt; + font-size: 1.5em; margin-bottom: 0.5em; } h2 { - font-size: 12pt; + font-size: 1.2em1.2em1.2em1.2em1.2em1.2em1.2em1.2em1.2em1.2em1.2em; margin-bottom: 0em; font-weight: bold; margin-top: 0; @@ -120,17 +120,17 @@ a:link { color: blue; - font-size: 10pt; + font-size: 1em; } a:visited { color: purple; - font-size: 10pt; + font-size: 1em; } a.anchor:link { - font-size: 12pt; + font-size: 1em; color: black; font-weight: bold; text-decoration: none; @@ -144,7 +144,7 @@ } a.anchor { - font-size: 12pt; + font-size: 1em; color: black; font-weight: bold; text-decoration: none; @@ -155,7 +155,7 @@ } a.smalllink { - font-size: 8px; + font-size: 0.8em; } table.banner { @@ -177,19 +177,19 @@ padding-bottom: 10px; color: white; font-weight: bold; - font-size: 11px; + font-size: 1em; } td.banner-middle a:link, td.banner-middle a:visited { color: white; font-weight: bold; - font-size: 11px; + font-size: 1em; } td.banner-middle a:hover { color: #FF7F00; font-weight: bold; - font-size: 11px; + font-size: 1em; } td.banner-right { From thomass at seul.org Fri Jun 17 22:04:54 2005 From: thomass at seul.org (thomass at seul.org) Date: Fri, 17 Jun 2005 18:04:54 -0400 (EDT) Subject: [or-cvs] Fix vim madness Message-ID: <20050617220454.2EC651408032@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv10981 Modified Files: stylesheet.css Log Message: Fix vim madness Index: stylesheet.css =================================================================== RCS file: /home2/or/cvsroot/website/stylesheet.css,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- stylesheet.css 17 Jun 2005 21:54:16 -0000 1.18 +++ stylesheet.css 17 Jun 2005 22:04:52 -0000 1.19 @@ -107,7 +107,7 @@ } h2 { - font-size: 1.2em1.2em1.2em1.2em1.2em1.2em1.2em1.2em1.2em1.2em1.2em; + font-size: 1.2em; margin-bottom: 0em; font-weight: bold; margin-top: 0; From arma at seul.org Sat Jun 18 01:34:30 2005 From: arma at seul.org (arma at seul.org) Date: Fri, 17 Jun 2005 21:34:30 -0400 (EDT) Subject: [or-cvs] some fixes and questions on the control spec Message-ID: <20050618013430.49BC914080DA@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: control-spec.txt Log Message: some fixes and questions on the control spec Index: control-spec.txt =================================================================== RCS file: /home2/or/cvsroot/tor/doc/control-spec.txt,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- control-spec.txt 17 Jun 2005 18:49:04 -0000 1.38 +++ control-spec.txt 18 Jun 2005 01:34:28 -0000 1.39 @@ -17,10 +17,10 @@ 1 Protocol outline TC is a bidirectional message-based protocol. It assumes an underlying - stream for communication between a controlling process (the "client" or - "controller") and a Tor process (the "server" or "tor process"). The - stream may be implemented via TCP, TLS-over-TCP, a Unix-domain socket, or - so on, but it must provide reliable in-order delivery. For security, the + stream for communication between a controlling process (the "client" + or "controller") and a Tor process (or "server"). The stream may be + implemented via TCP, TLS-over-TCP, a Unix-domain socket, or so on, + but it must provide reliable in-order delivery. For security, the stream should not be accessible by untrusted parties. In TC, the client and server send typed messages to each other over the @@ -30,15 +30,15 @@ By default, all messages from the server are in response to messages from the client. Some client requests, however, will cause the server to send messages to the client indefinitely far into the future. Such - "asynchronous" replies are marked to such. + "asynchronous" replies are marked as such. Servers respond to messages in the order messages are received. 2 Message format -2.1 Description format. +2.1 Description format - The message formates listed below use ABNF as described in RFC2234. + The message formats listed below use ABNF as described in RFC2234. The protocol itself is loosely based on SMTP (see RFC 2821). We use the following nonterminals from RFC2822: atom, qcontent @@ -50,7 +50,7 @@ There are explicitly no limits on line length. All 8-bit characters are permitted unless explicitly disallowed. -2.2 Commands from controller to Tor. +2.2 Commands from controller to Tor Command = Keyword Arguments CRLF / "+" Keyword Arguments CRLF Data Keyword = 1*ALPHA @@ -77,6 +77,7 @@ ; Identifiers for servers. ServerID = Nickname / Fingerprint Nickname = 1*NicknameChar +[XXX perhaps this should be 1*19 NicknameChar ? -RD] NicknameChar = "a"-"z" / "A"-"Z" / "0" - "9" Fingerprint = "$" 40*HEXDIG @@ -119,7 +120,7 @@ syntax error, or a "553 impossible configuration setting" reply on a semantic error. - When a configuration options takes multiple values, or when multiple + When a configuration option takes multiple values, or when multiple configuration keys form a context-sensitive group (see GETCONF below), then setting _any_ of the options in a SETCONF command is taken to reset all of the others. For example, if two ORBindAddress values are configured, and a @@ -161,6 +162,9 @@ EventCode = "CIRC" / "STREAM" / "ORCONN" / "BW" / "DEBUG" / "INFO" / "NOTICE" / "WARN" / "ERR" / "NEWDESC" +[XXX We should have an "ADDRESSMAP" event to hear when we learn +about dns resolves, etc, so the controller can keep synced. -RD] + Any events *not* listed in the SETEVENTS line are turned off; thus, sending SETEVENTS with an empty body turns off all event reporting. @@ -189,8 +193,8 @@ "SAVECONF" CRLF Instructs the server to write out its config options into its torrc. Server - returns "250 OK" if successful, or " if it can't write the file or some - other error occurs. + returns "250 OK" if successful, or "551 Unable to write configuration + to disk" if it can't write the file or some other error occurs. 3.6 SIGNAL @@ -202,14 +206,14 @@ The meaning of the signals are: - RELOAD -- Reload: reload config items, refetch directory. (as for HUP) + RELOAD -- Reload: reload config items, refetch directory. (like HUP) SHUTDOWN -- Controlled shutdown: if server is an OP, exit immediately. If it's an OR, close listeners and exit after 30 seconds. - (as for INT) + (like INT) DUMP -- Dump stats: log information about open connections and - circuits. (as for USR1) - DEBUG -- Debug: switch all open logs to loglevel debug. (as for USR2) - TERM -- Immediate shutdown: clean up and exit now. (as for TERM) + circuits. (like USR1) + DEBUG -- Debug: switch all open logs to loglevel debug. (like USR2) + TERM -- Immediate shutdown: clean up and exit now. (like TERM) The server responds with "250 OK" if the signal is recognized (or simply closes the socket if it was asked to close immediately), or "552 @@ -264,7 +268,10 @@ has resolved to that IP. This functionality is designed to help implement the 3rd approach.} - [XXXX When, if ever, can mappings expire? Should they expire?] + Mappings set by the controller last until the Tor process exits: + they never expire. If the controller wants the mapping to last only + a certain time, then it must explicitly un-map the address when that + time has elapsed. 3.8 GETINFO @@ -314,7 +321,7 @@ StreamID SP StreamStatus SP Target CRLF "orconn-status" - A series of lines as for a OR connection status event. Each is of the + A series of lines as for an OR connection status event. Each is of the form: ServerID SP ORStatus CRLF @@ -329,7 +336,7 @@ 3.9 EXTENDCIRCUIT Sent from the client to the server. The format is: - "EXTENDCIRCUIT" SP CircuitID SP SeverID *("," ServerID) CRLF + "EXTENDCIRCUIT" SP CircuitID SP ServerID *("," ServerID) CRLF This request takes one of two forms: either the Circuit ID is zero, in which case it is a request for the server to build a new circuit according @@ -338,8 +345,10 @@ to the specified path. If the request is successful, the server sends a "250 OK" message containing - a message body consisting of the four-octet Circuit ID of the newly created - circuit. + a message body consisting of the four-octet Circuit ID of the (maybe + newly created) circuit. + +[XXX four-octet? that sounds binary to me, yes? -RD] 3.10 ATTACHSTREAM @@ -350,7 +359,8 @@ associated with the specified circuit. Each stream may be associated with at most one circuit, and multiple streams may share the same circuit. Streams can only be attached to completed circuits (that is, circuits that - have sent a circuit status 'built' event). + have sent a circuit status 'built' event or are listed as built in a + GETINFO circuit-status request). If the circuit ID is 0, responsibility for attaching the given stream is returned to Tor. @@ -376,7 +386,9 @@ fields, including fields for its nickname and identity. If there is an error in parsing the descriptor, the server must send an - appropriate error message. If the descriptor is well-formed but the server + appropriate error message. +[XXX let's specify the status code here too -RD] + If the descriptor is well-formed but the server chooses not to add it, it must reply with a 251 message whose body explains why the server was not added. @@ -421,7 +433,7 @@ Reply codes follow the same 3-character format as used by SMTP, with the first character defining a status, the second character defining a - subsystem, and the third designates fine-grained information. + subsystem, and the third designating fine-grained information. The TC protocol currently uses the following first characters: @@ -446,7 +458,7 @@ x1z Protocol Refers to operations of the Tor Control protocol. - x2z Tor + x5z Tor Refers to actual operations of Tor system. The following codes are defined: @@ -482,7 +494,7 @@ 650 Asynchronous event notification -4.1 Anynchronous events +4.1 Asynchronous events These replies can be sent after a corresponding SETEVENTS command has been received. They will not be interleaved with other Reply elements, but they @@ -602,3 +614,4 @@ whether the third byte the first command is zero. If it is, Tor assumes that version 0 is in use. This feature is deprecated, and will be removed in the 0.1.2.x Tor development series. + From nickm at seul.org Sat Jun 18 01:49:05 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 21:49:05 -0400 (EDT) Subject: [or-cvs] Address points by arma and points not by arma in new contro... Message-ID: <20050618014905.22A941408110@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv18829/doc Modified Files: control-spec.txt Log Message: Address points by arma and points not by arma in new control-spec.txt Index: control-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/control-spec.txt,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- control-spec.txt 18 Jun 2005 01:34:28 -0000 1.39 +++ control-spec.txt 18 Jun 2005 01:49:03 -0000 1.40 @@ -76,8 +76,7 @@ ; Identifiers for servers. ServerID = Nickname / Fingerprint - Nickname = 1*NicknameChar -[XXX perhaps this should be 1*19 NicknameChar ? -RD] + Nickname = 1*19 NicknameChar NicknameChar = "a"-"z" / "A"-"Z" / "0" - "9" Fingerprint = "$" 40*HEXDIG @@ -202,7 +201,8 @@ "SIGNAL" SP Signal CRLF - Signal = "RELOAD" / "SHUTDOWN" / "DUMP" / "DEBUG" / "TERM" + Signal = "RELOAD" / "SHUTDOWN" / "DUMP" / "DEBUG" / "HALT" / + "HUP" / "INT" / "USR1" / "USR2" / "TERM" The meaning of the signals are: @@ -213,7 +213,7 @@ DUMP -- Dump stats: log information about open connections and circuits. (like USR1) DEBUG -- Debug: switch all open logs to loglevel debug. (like USR2) - TERM -- Immediate shutdown: clean up and exit now. (like TERM) + HALT -- Immediate shutdown: clean up and exit now. (like TERM) The server responds with "250 OK" if the signal is recognized (or simply closes the socket if it was asked to close immediately), or "552 @@ -344,11 +344,9 @@ request for the server to extend an existing circuit with that ID according to the specified path. - If the request is successful, the server sends a "250 OK" message containing - a message body consisting of the four-octet Circuit ID of the (maybe - newly created) circuit. - -[XXX four-octet? that sounds binary to me, yes? -RD] + If the request is successful, the server sends a "250 OK" message + containing a message body consisting of the Circuit ID of the (maybe newly + created) circuit. 3.10 ATTACHSTREAM @@ -359,7 +357,7 @@ associated with the specified circuit. Each stream may be associated with at most one circuit, and multiple streams may share the same circuit. Streams can only be attached to completed circuits (that is, circuits that - have sent a circuit status 'built' event or are listed as built in a + have sent a circuit status 'BUILT' event or are listed as built in a GETINFO circuit-status request). If the circuit ID is 0, responsibility for attaching the given stream is @@ -385,12 +383,11 @@ The descriptor, when parsed, must contain a number of well-specified fields, including fields for its nickname and identity. - If there is an error in parsing the descriptor, the server must send an - appropriate error message. -[XXX let's specify the status code here too -RD] - If the descriptor is well-formed but the server - chooses not to add it, it must reply with a 251 message whose body - explains why the server was not added. + If there is an error in parsing the descriptor, the server must send a "554 + Invalid descriptor" reply. If the descriptor is well-formed but the server + chooses not to add it, it must reply with a 251 message whose body explains + why the server was not added. If the descriptor is added, Tor replies with + "250 OK". 3.12 REDIRECTSTREAM @@ -492,8 +489,13 @@ [The client tried to set a configuration option to an incorrect, ill-formed, or impossible value.] + 554 Invalid descriptor + 650 Asynchronous event notification + Unless specified to have specific contents, the human-readable messages + in error replies should not be relied upon to match those in this document. + 4.1 Asynchronous events These replies can be sent after a corresponding SETEVENTS command has been From nickm at seul.org Sat Jun 18 02:17:13 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 22:17:13 -0400 (EDT) Subject: [or-cvs] Add a tor_memmem function Message-ID: <20050618021713.DC990140841B@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv19901/src/common Modified Files: compat.c compat.h Log Message: Add a tor_memmem function Index: compat.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/compat.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- compat.c 12 Jun 2005 04:33:26 -0000 1.52 +++ compat.c 18 Jun 2005 02:17:11 -0000 1.53 @@ -13,7 +13,9 @@ * the platform. **/ -/* This is required on rh7 to make strptime not complain. */ +/* This is required on rh7 to make strptime not complain. + * We also need it to make memmem get defined (where available) + */ #define _GNU_SOURCE #include "orconfig.h" @@ -134,6 +136,38 @@ return r; } +/** Given hlen bytes at haystack and nlen bytes at + * needle, return a pointer to the first occurence of the needle + * within the haystack, or NULL if there is no such occurrence. + * + * Requires that nlen be greater than zero. + */ +const void * +tor_memmem(const void *haystack, size_t hlen, const void *needle, size_t nlen) +{ +#if defined(HAVE_MEMMEM) && (!defined(__GNUC__) || __GNUC__ >= 2) + tor_assert(nlen); + return memmem(haystack, hlen, needle, nlen); +#else + /* This isn't as fast as the GLIBC implementation, but it doesn't need to be. */ + const void *p, *end; + char first; + tor_assert(nlen); + + p = haystack; + end = haystack + hlen; + first = *(const char*)needle; + while ((p = memchr(p, first, end-p))) { + if (end-p >= nlen) + return NULL; + if (!memcmp(p, needle, nlen)) + return p; + ++p; + } + return NULL; +#endif +} + /** Take a filename and return a pointer to its final element. This * function is called on __FILE__ to fix a MSVC nit where __FILE__ * contains the full path to the file. This is bad, because it Index: compat.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/compat.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- compat.h 9 Jun 2005 19:03:31 -0000 1.30 +++ compat.h 18 Jun 2005 02:17:11 -0000 1.31 @@ -87,6 +87,9 @@ CHECK_PRINTF(3,4); int tor_vsnprintf(char *str, size_t size, const char *format, va_list args); +const void *tor_memmem(const void *haystack, size_t hlen, const void *needle, + size_t nlen); + #define TOR_ISAPLHA(c) isalpha((int)(unsigned char)(c)) #define TOR_ISALNUM(c) isalnum((int)(unsigned char)(c)) #define TOR_ISSPACE(c) isspace((int)(unsigned char)(c)) From nickm at seul.org Sat Jun 18 02:17:13 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 22:17:13 -0400 (EDT) Subject: [or-cvs] Add a tor_memmem function Message-ID: <20050618021713.CF304140825F@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/tmp/cvs-serv19901 Modified Files: configure.in Log Message: Add a tor_memmem function Index: configure.in =================================================================== RCS file: /home/or/cvsroot/tor/configure.in,v retrieving revision 1.215 retrieving revision 1.216 diff -u -d -r1.215 -r1.216 --- configure.in 9 Jun 2005 19:53:32 -0000 1.215 +++ configure.in 18 Jun 2005 02:17:11 -0000 1.216 @@ -297,12 +297,11 @@ AC_CHECK_HEADERS(stdint.h sys/types.h inttypes.h sys/param.h sys/wait.h sys/limits.h netinet/in.h arpa/inet.h machine/limits.h syslog.h sys/time.h sys/resource.h pthread.h stddef.h inttypes.h) -AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit setrlimit strlcat strlcpy strtoull getpwnam ftello pthread_create getaddrinfo localtime_r gmtime_r event_get_version event_get_method event_set_log_callback) +AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit setrlimit strlcat strlcpy strtoull getpwnam ftello pthread_create getaddrinfo localtime_r gmtime_r event_get_version event_get_method event_set_log_callback memmem) AC_FUNC_FSEEKO AC_CHECK_MEMBERS([struct timeval.tv_sec]) - dnl In case we aren't given a working stdint.h, we'll need to grow our own. dnl Watch out. From nickm at seul.org Mon Jun 6 20:10:04 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 6 Jun 2005 16:10:04 -0400 (EDT) Subject: [or-cvs] Backport bugfix for 151 and other windows fix. Message-ID: <20050606201004.3B1C8140825C@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv13830/src/or Modified Files: Tag: tor-0_1_0-patches main.c Log Message: Backport bugfix for 151 and other windows fix. Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.505 retrieving revision 1.505.2.1 diff -u -d -r1.505 -r1.505.2.1 --- main.c 27 May 2005 17:43:43 -0000 1.505 +++ main.c 6 Jun 2005 20:10:02 -0000 1.505.2.1 @@ -943,7 +943,7 @@ if (loop_result < 0) { int e = errno; /* let the program survive things like ^z */ - if (e != EINTR && e != EINPROGRESS) { + if (e != EINTR && !ERRNO_IS_EINPROGRESS(e)) { #ifdef HAVE_EVENT_GET_METHOD log_fn(LOG_ERR,"libevent poll with %s failed: %s [%d]", event_get_method(), tor_socket_strerror(e), e); @@ -953,7 +953,7 @@ #endif return -1; } else { - if (e == EINPROGRESS) + if (ERRNO_IS_EINPROGRESS(e)) log_fn(LOG_WARN,"libevent poll returned EINPROGRESS? Please report."); log_fn(LOG_DEBUG,"event poll interrupted."); /* You can't trust the results of this poll(). Go back to the @@ -1221,7 +1221,10 @@ handle_signals(1); crypto_global_init(); - crypto_seed_rng(); + if (crypto_seed_rng()) { + log_fn(LOG_ERR, "Unable to seed random number generator. Exiting."); + return -1; + } return 0; } From arma at seul.org Sat Jun 18 02:23:13 2005 From: arma at seul.org (arma at seul.org) Date: Fri, 17 Jun 2005 22:23:13 -0400 (EDT) Subject: [or-cvs] fix typo Message-ID: <20050618022313.5921914080D5@moria.seul.org> Update of /home2/or/cvsroot/tor/src/common In directory moria:/home/arma/work/onion/cvs/tor/src/common Modified Files: compat.c Log Message: fix typo Index: compat.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/common/compat.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- compat.c 18 Jun 2005 02:17:11 -0000 1.53 +++ compat.c 18 Jun 2005 02:23:11 -0000 1.54 @@ -137,7 +137,7 @@ } /** Given hlen bytes at haystack and nlen bytes at - * needle, return a pointer to the first occurence of the needle + * needle, return a pointer to the first occurrence of the needle * within the haystack, or NULL if there is no such occurrence. * * Requires that nlen be greater than zero. From nickm at seul.org Sat Jun 18 02:39:27 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 22:39:27 -0400 (EDT) Subject: [or-cvs] Implement even more control functionality Message-ID: <20050618023927.A1BAE1408108@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv21202/src/or Modified Files: control.c Log Message: Implement even more control functionality Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- control.c 17 Jun 2005 20:37:21 -0000 1.90 +++ control.c 18 Jun 2005 02:39:25 -0000 1.91 @@ -257,6 +257,116 @@ connection_write_to_buf(s, len, conn); } +static size_t +write_escaped_data(const char *data, size_t len, int translate_newlines, + char **out) +{ + size_t sz_out = len+8; + char *outp; + const char *end; + int i; + int start_of_line; + for (i=0; itype != CONN_TYPE_AP) + return NULL; + return conn; +} + /** Called when we receive a SETCONF message: parse the body and try * to update our configuration. Reply with a DONE or ERROR message. */ static int @@ -892,39 +1028,86 @@ static int handle_control_getinfo(connection_t *conn, uint32_t len, const char *body) { - /* XXXX V1 */ smartlist_t *questions = NULL; smartlist_t *answers = NULL; + smartlist_t *unrecognized = NULL; char *msg = NULL, *ans; size_t msg_len; + int v0 = STATE_IS_V0(conn->state); questions = smartlist_create(); - smartlist_split_string(questions, body, "\n", - SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + if (v0) + smartlist_split_string(questions, body, "\n", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + else + smartlist_split_string(questions, body, " ", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); answers = smartlist_create(); + unrecognized = smartlist_create(); SMARTLIST_FOREACH(questions, const char *, q, { if (handle_getinfo_helper(q, &ans) < 0) { - send_control0_error(conn, ERR_INTERNAL, body); - goto done; - } if (!ans) { - send_control0_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY, body); + if (v0) + send_control0_error(conn, ERR_INTERNAL, body); + else + connection_write_str_to_buf("551 Internal error\r\n", conn); goto done; } - smartlist_add(answers, tor_strdup(q)); - smartlist_add(answers, ans); + if (!ans) { + if (v0) { + send_control0_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY, body); + goto done; + } else + smartlist_add(unrecognized, (char*)q); + } else { + smartlist_add(answers, tor_strdup(q)); + smartlist_add(answers, ans); + } }); + if (smartlist_len(unrecognized)) { + int i; + tor_assert(!v0); + for (i=0; i < len-1; ++i) + connection_printf_to_buf(conn, + "552-Unrecognized configuration key \"%s\"\r\n", + (char*)smartlist_get(unrecognized, i)); + connection_printf_to_buf(conn, + "552 Unrecognized configuration key \"%s\"\r\n", + (char*)smartlist_get(unrecognized, len-1)); + goto done; + } - msg = smartlist_join_strings2(answers, "\0", 1, 1, &msg_len); - tor_assert(msg_len > 0); /* it will at least be terminated */ - send_control0_message(conn, CONTROL0_CMD_INFOVALUE, - msg_len, msg); + if (v0) { + msg = smartlist_join_strings2(answers, "\0", 1, 1, &msg_len); + tor_assert(msg_len > 0); /* it will at least be terminated */ + send_control0_message(conn, CONTROL0_CMD_INFOVALUE, + msg_len, msg); + } else if (smartlist_len(answers)) { + int i; + for (i = 0; i < smartlist_len(answers); i += 2) { + char *k = smartlist_get(answers, i); + char *v = smartlist_get(answers, i+1); + /*XXXX Not an adequate test! XXXX011 */ + if (!strchr(v, '\n') && !strchr(v, '\r')) { + connection_printf_to_buf(conn, "250-%s=%s\r\n", k, v); + } else { + char *esc = NULL; + size_t len; + len = write_escaped_data(v, strlen(v), 1, &esc); + connection_printf_to_buf(conn, "250+%s=", k); + connection_write_to_buf(esc, len, conn); + tor_free(esc); + } + } + connection_write_str_to_buf("250 OK\r\n", conn); + } done: if (answers) SMARTLIST_FOREACH(answers, char *, cp, tor_free(cp)); if (questions) SMARTLIST_FOREACH(questions, char *, cp, tor_free(cp)); smartlist_free(answers); smartlist_free(questions); + smartlist_free(unrecognized); tor_free(msg); return 0; @@ -1069,14 +1252,31 @@ handle_control_postdescriptor(connection_t *conn, uint32_t len, const char *body) { - /* XXXX V1 */ + char *desc; + int v0 = STATE_IS_V0(conn->state); + if (v0) + desc = (char*)body; + else { + const char *cp = memchr(body, '\n', len); + tor_assert(cp); + read_escaped_data(cp, len-(cp-body), 1, &desc); + } + const char *msg=NULL; - switch (router_load_single_router(body, &msg)) { + switch (router_load_single_router(desc, &msg)) { case -1: - send_control0_error(conn,ERR_SYNTAX,msg?msg: "Could not parse descriptor"); + if (!msg) msg = "Could not parse descriptor"; + if (v0) + send_control0_error(conn,ERR_SYNTAX,msg); + else + connection_printf_to_buf(conn, "554 %s\r\n", msg); break; case 0: - send_control_done2(conn,msg?msg: "Descriptor not added",0); + if (!msg) msg = "Descriptor not added"; + if (v0) + send_control_done2(conn,msg,0); + else + connection_printf_to_buf(conn, "251 %s\r\n",msg); break; case 1: send_control_done(conn); @@ -1091,25 +1291,48 @@ handle_control_redirectstream(connection_t *conn, uint32_t len, const char *body) { - /* XXXX V1 */ - connection_t *ap_conn; + connection_t *ap_conn = NULL; uint32_t conn_id; - if (len < 6) { - send_control0_error(conn, ERR_SYNTAX, "redirectstream message too short"); - return 0; - } - conn_id = ntohl(get_uint32(body)); + char *new_addr = NULL; + if (STATE_IS_V0(conn->state)) { + if (len < 6) { + send_control0_error(conn, ERR_SYNTAX, "redirectstream message too short"); + return 0; + } + conn_id = ntohl(get_uint32(body)); - if (!(ap_conn = connection_get_by_global_id(conn_id)) - || ap_conn->state != CONN_TYPE_AP - || !ap_conn->socks_request) { - send_control0_error(conn, ERR_NO_STREAM, - "No AP connection found with given ID"); - return 0; + if (!(ap_conn = connection_get_by_global_id(conn_id)) + || ap_conn->state != CONN_TYPE_AP + || !ap_conn->socks_request) { + send_control0_error(conn, ERR_NO_STREAM, + "No AP connection found with given ID"); + return 0; + } + new_addr = tor_strdup(body+4); + } else { + smartlist_t *args; + args = smartlist_create(); + smartlist_split_string(args, body, " ", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + if (smartlist_len(args)<2) + connection_printf_to_buf(conn,"512 Missing argument to REDIRECTSTREAM\r\n"); + else if (!(ap_conn = get_stream(smartlist_get(args, 0))) + || !ap_conn->socks_request) { + connection_printf_to_buf(conn, "552 Unknown stream \"%s\"\r\n", + (char*)smartlist_get(args, 0)); + } else { + new_addr = tor_strdup(smartlist_get(args, 1)); + } + + SMARTLIST_FOREACH(args, char *, cp, tor_free(cp)); + smartlist_free(args); + if (!new_addr) + return 0; } - strlcpy(ap_conn->socks_request->address, body+4, - sizeof(ap_conn->socks_request->address)); + strlcpy(ap_conn->socks_request->address, new_addr, + sizeof(ap_conn->socks_request->address)); + tor_free(new_addr); send_control_done(conn); return 0; } @@ -1119,26 +1342,52 @@ handle_control_closestream(connection_t *conn, uint32_t len, const char *body) { - /* XXXX V1 */ - uint32_t conn_id; - connection_t *ap_conn; - uint8_t reason; + connection_t *ap_conn=NULL; + uint8_t reason=0; - if (len < 6) { - send_control0_error(conn, ERR_SYNTAX, "closestream message too short"); - return 0; - } + if (STATE_IS_V0(conn->state)) { + uint32_t conn_id; + if (len < 6) { + send_control0_error(conn, ERR_SYNTAX, "closestream message too short"); + return 0; + } - conn_id = ntohl(get_uint32(body)); - reason = *(uint8_t*)(body+4); + conn_id = ntohl(get_uint32(body)); + reason = *(uint8_t*)(body+4); - if (!(ap_conn = connection_get_by_global_id(conn_id)) - || ap_conn->state != CONN_TYPE_AP - || !ap_conn->socks_request) { - send_control0_error(conn, ERR_NO_STREAM, - "No AP connection found with given ID"); - return 0; + if (!(ap_conn = connection_get_by_global_id(conn_id)) + || ap_conn->state != CONN_TYPE_AP + || !ap_conn->socks_request) { + send_control0_error(conn, ERR_NO_STREAM, + "No AP connection found with given ID"); + return 0; + } + } else { + smartlist_t *args; + int ok; + args = smartlist_create(); + smartlist_split_string(args, body, " ", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + if (smartlist_len(args)<2) + connection_printf_to_buf(conn, "512 Missing argument to CLOSECIRCUIT\r\n"); + else if (!(ap_conn = get_stream(smartlist_get(args, 0)))) + connection_printf_to_buf(conn, "552 Unknown stream \"%s\"\r\n", + (char*)smartlist_get(args, 0)); + else { + reason = (uint8_t) tor_parse_ulong(smartlist_get(args,1), 10, 0, 255, + &ok, NULL); + if (!ok) { + connection_printf_to_buf(conn, "552 Unrecognized reason \"%s\"\r\n", + (char*)smartlist_get(args, 1)); + ap_conn = NULL; + } + } + SMARTLIST_FOREACH(args, char *, cp, tor_free(cp)); + smartlist_free(args); + if (!ap_conn) + return 0; } + connection_mark_unattached_ap(ap_conn, reason); send_control_done(conn); return 0; @@ -1149,22 +1398,47 @@ handle_control_closecircuit(connection_t *conn, uint32_t len, const char *body) { - /* XXXX V1 */ - uint32_t circ_id; - circuit_t *circ; - int safe; + circuit_t *circ = NULL; + int safe = 0; - if (len < 5) { - send_control0_error(conn, ERR_SYNTAX, "closecircuit message too short"); - return 0; - } - circ_id = ntohl(get_uint32(body)); - safe = (*(uint8_t*)(body+4)) & 1; + if (STATE_IS_V0(conn->state)) { + uint32_t circ_id; + if (len < 5) { + send_control0_error(conn, ERR_SYNTAX, "closecircuit message too short"); + return 0; + } + circ_id = ntohl(get_uint32(body)); + safe = (*(uint8_t*)(body+4)) & 1; - if (!(circ = circuit_get_by_global_id(circ_id))) { - send_control0_error(conn, ERR_NO_CIRC, - "No circuit found with given ID"); - return 0; + if (!(circ = circuit_get_by_global_id(circ_id))) { + send_control0_error(conn, ERR_NO_CIRC, + "No circuit found with given ID"); + return 0; + } + } else { + smartlist_t *args; + args = smartlist_create(); + smartlist_split_string(args, body, " ", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + if (smartlist_len(args)<1) + connection_printf_to_buf(conn, "512 Missing argument to CLOSECIRCUIT\r\n"); + else if (!(circ=get_circ(smartlist_get(args, 0)))) + connection_printf_to_buf(conn, "552 Unknown circuit \"%s\"\r\n", + (char*)smartlist_get(args, 0)); + else { + int i; + for (i=1; i < smartlist_len(args); ++i) { + if (!strcasecmp(smartlist_get(args, i), "IfUnused")) + safe = 1; + else + log_fn(LOG_INFO, "Skipping unknown option %s", + (char*)smartlist_get(args,i)); + } + } + SMARTLIST_FOREACH(args, char *, cp, tor_free(cp)); + smartlist_free(args); + if (!circ) + return 0; } if (!safe || !circ->p_streams) { @@ -1693,18 +1967,17 @@ void control_event_logmsg(int severity, const char *msg) { - /* XXXX V1 */ static int sending_logmsg=0; int oldlog, event; if (sending_logmsg) return; - oldlog = EVENT_IS_INTERESTING(EVENT_LOG_OBSOLETE) && + oldlog = EVENT_IS_INTERESTING0(EVENT_LOG_OBSOLETE) && (severity == LOG_NOTICE || severity == LOG_WARN || severity == LOG_ERR); event = log_severity_to_event(severity); - if (event<0 || !EVENT_IS_INTERESTING(event)) + if (event<0 || !EVENT_IS_INTERESTING0(event)) event = 0; if (oldlog || event) { @@ -1716,6 +1989,28 @@ send_control0_event(EVENT_LOG_OBSOLETE, (uint32_t)(len+1), msg); sending_logmsg = 0; } + + event = log_severity_to_event(severity); + if (event >= 0 && EVENT_IS_INTERESTING1(event)) { + char *b = NULL; + const char *s; + if (strchr(msg, '\n')) { + char *cp; + b = tor_strdup(msg); + for (cp = b; *cp; ++cp) + if (*cp == '\r' || *cp == '\n') + *cp = ' '; + } + switch(severity) { + case LOG_INFO: s = "INFO"; break; + case LOG_NOTICE: s = "NOTICE"; break; + case LOG_WARN: s = "WARN"; break; + case LOG_ERR: s = "ERR"; break; + default: s = "UnknownLogSeverity"; break; + } + send_control1_event(event, "650 %s %s\r\n", s, b?b:msg); + tor_free(b); + } } /** Called whenever we receive new router descriptors: tell any From nickm at seul.org Sat Jun 18 03:09:45 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 23:09:45 -0400 (EDT) Subject: [or-cvs] Implement EXTENDCIRCUIT and ATTACHCIRCUIT. Only SETCONFIG a... Message-ID: <20050618030945.A0D771408110@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv22734/src/or Modified Files: control.c Log Message: Implement EXTENDCIRCUIT and ATTACHCIRCUIT. Only SETCONFIG and AUTHENTICATE remain. Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- control.c 18 Jun 2005 02:39:25 -0000 1.91 +++ control.c 18 Jun 2005 03:09:43 -0000 1.92 @@ -1118,58 +1118,90 @@ handle_control_extendcircuit(connection_t *conn, uint32_t len, const char *body) { - /* XXXX V1 */ - smartlist_t *router_nicknames, *routers; + smartlist_t *router_nicknames=NULL, *routers=NULL; uint32_t circ_id; - circuit_t *circ; + circuit_t *circ = NULL; + int zero_circ, v0; char reply[4]; - if (len<5) { - send_control0_error(conn, ERR_SYNTAX, "extendcircuit message too short"); - return 0; - } + v0 = STATE_IS_V0(conn->state); router_nicknames = smartlist_create(); - routers = smartlist_create(); - smartlist_split_string(router_nicknames, body+4, ",", 0, 0); - SMARTLIST_FOREACH(router_nicknames, const char *, n, - { - routerinfo_t *r = router_get_by_nickname(n); - if (!r) { - send_control0_error(conn, ERR_NO_ROUTER, n); + + if (v0) { + if (len<5) { + send_control0_error(conn, ERR_SYNTAX, "extendcircuit message too short"); + goto done; + } + smartlist_split_string(router_nicknames, body+4, ",", 0, 0); + circ_id = ntohl(get_uint32(body)); + if (!circ_id) { + /* start a new circuit */ + zero_circ = 1; + } else { + circ = circuit_get_by_global_id(circ_id); + zero_circ = 0; + if (!circ) { + send_control0_error(conn, ERR_NO_CIRC, + "No circuit found with given ID"); goto done; } - smartlist_add(routers, r); - }); - if (!smartlist_len(routers)) { - send_control0_error(conn, ERR_SYNTAX, "No router names provided"); - goto done; + } + } else { + smartlist_t *args; + args = smartlist_create(); + smartlist_split_string(args, body, " ", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + if (smartlist_len(args)<2) + connection_printf_to_buf(conn,"512 Missing argument to ATTACHSTREAM\r\n"); + + smartlist_split_string(router_nicknames, smartlist_get(args,0), ",", 0, 0); + zero_circ = !strcmp("0", (char*)smartlist_get(args,1)); + if (!zero_circ && !(circ = get_circ(smartlist_get(args,1)))) { + connection_printf_to_buf(conn, "552 Unknown circuit \"%s\"\r\n", + (char*)smartlist_get(args, 1)); + } + + SMARTLIST_FOREACH(args, char *, cp, tor_free(cp)); + smartlist_free(args); + if (!zero_circ && !circ) + return 0; } - circ_id = ntohl(get_uint32(body)); - if (!circ_id) { - /* start a new circuit */ - circ = circuit_init(CIRCUIT_PURPOSE_C_GENERAL, 0, 0, 0); - } else { - circ = circuit_get_by_global_id(circ_id); - if (!circ) { - send_control0_error(conn, ERR_NO_CIRC, - "No circuit found with given ID"); + routers = smartlist_create(); + SMARTLIST_FOREACH(router_nicknames, const char *, n, + { + routerinfo_t *r = router_get_by_nickname(n); + if (!r) { + if (v0) + send_control0_error(conn, ERR_NO_ROUTER, n); + else + connection_printf_to_buf(conn, "552 No such router \"%s\"\r\n", n); goto done; } + smartlist_add(routers, r); + }); + if (!smartlist_len(routers)) { + if (v0) + send_control0_error(conn, ERR_SYNTAX, "No router names provided"); + else + connection_write_str_to_buf("512 No router names provided\r\n", conn); + goto done; } /* now circ refers to something that is ready to be extended */ - SMARTLIST_FOREACH(routers, routerinfo_t *, r, - { - circuit_append_new_exit(circ, r); - }); + { + circuit_append_new_exit(circ, r); + }); /* now that we've populated the cpath, start extending */ - if (!circ_id) { + if (zero_circ) { if (circuit_handle_first_hop(circ) < 0) { circuit_mark_for_close(circ); - send_control0_error(conn, ERR_INTERNAL, "couldn't start circuit"); + if (v0) + send_control0_error(conn, ERR_INTERNAL, "couldn't start circuit"); + else + connection_write_str_to_buf("551 Couldn't start circuit\r\n", conn); goto done; } } else { @@ -1178,14 +1210,22 @@ if (circuit_send_next_onion_skin(circ) < 0) { log_fn(LOG_INFO,"send_next_onion_skin failed; circuit marked for closing."); circuit_mark_for_close(circ); - send_control0_error(conn, ERR_INTERNAL, "couldn't send onion skin"); + if (v0) + send_control0_error(conn, ERR_INTERNAL, "couldn't send onion skin"); + else + connection_write_str_to_buf("551 Couldn't send onion skinr\n", conn); goto done; } } } - set_uint32(reply, htonl(circ->global_identifier)); - send_control_done2(conn, reply, sizeof(reply)); + if (v0) { + set_uint32(reply, htonl(circ->global_identifier)); + send_control_done2(conn, reply, sizeof(reply)); + } else { + connection_printf_to_buf(conn, "250 EXTENDED %lu\r\n", + (unsigned long)circ->global_identifier); + } done: SMARTLIST_FOREACH(router_nicknames, char *, n, tor_free(n)); smartlist_free(router_nicknames); @@ -1196,51 +1236,90 @@ /** DOCDOC */ static int handle_control_attachstream(connection_t *conn, uint32_t len, - const char *body) + const char *body) { - /* XXXX V1 */ - uint32_t conn_id; - uint32_t circ_id; - connection_t *ap_conn; - circuit_t *circ; + connection_t *ap_conn = NULL; + circuit_t *circ = NULL; + int zero_circ; - if (len < 8) { - send_control0_error(conn, ERR_SYNTAX, "attachstream message too short"); - return 0; - } + if (STATE_IS_V0(conn->state)) { + uint32_t conn_id; + uint32_t circ_id; + if (len < 8) { + send_control0_error(conn, ERR_SYNTAX, "attachstream message too short"); + return 0; + } - conn_id = ntohl(get_uint32(body)); - circ_id = ntohl(get_uint32(body+4)); + conn_id = ntohl(get_uint32(body)); + circ_id = ntohl(get_uint32(body+4)); + zero_circ = circ_id == 0; - if (!(ap_conn = connection_get_by_global_id(conn_id))) { - send_control0_error(conn, ERR_NO_STREAM, - "No connection found with given ID"); - return 0; + if (!(ap_conn = connection_get_by_global_id(conn_id))) { + send_control0_error(conn, ERR_NO_STREAM, + "No connection found with given ID"); + return 0; + } + if (circ_id && !(circ = circuit_get_by_global_id(circ_id))) { + send_control0_error(conn, ERR_NO_CIRC, "No circuit found with given ID"); + return 0; + } + } else { + smartlist_t *args; + args = smartlist_create(); + smartlist_split_string(args, body, " ", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + if (smartlist_len(args)<2) + connection_printf_to_buf(conn,"512 Missing argument to ATTACHSTREAM\r\n"); + + zero_circ = !strcmp("0", (char*)smartlist_get(args,1)); + + if (!(ap_conn = get_stream(smartlist_get(args, 0)))) { + connection_printf_to_buf(conn, "552 Unknown stream \"%s\"\r\n", + (char*)smartlist_get(args, 0)); + } else if (!zero_circ && !(circ = get_circ(smartlist_get(args, 1)))) { + connection_printf_to_buf(conn, "552 Unknown circuit \"%s\"\r\n", + (char*)smartlist_get(args, 1)); + } + SMARTLIST_FOREACH(args, char *, cp, tor_free(cp)); + smartlist_free(args); + if (!ap_conn || (!zero_circ && !circ)) + return 0; } + + if (ap_conn->state != AP_CONN_STATE_CONTROLLER_WAIT) { - send_control0_error(conn, ERR_NO_STREAM, - "Connection was not managed by controller."); + if (STATE_IS_V0(conn->state)) { + send_control0_error(conn, ERR_NO_STREAM, + "Connection is not managed by controller."); + } else { + connection_write_str_to_buf( + "555 Connection is not managed by controller.\r\n", + conn); + } return 0; } - if (!circ_id) { + if (zero_circ) { ap_conn->state = AP_CONN_STATE_CIRCUIT_WAIT; if (connection_ap_handshake_attach_circuit(ap_conn)<0) connection_mark_unattached_ap(ap_conn, END_STREAM_REASON_CANT_ATTACH); send_control_done(conn); return 0; } - - if (!(circ = circuit_get_by_global_id(circ_id))) { - send_control0_error(conn, ERR_NO_CIRC, "No circuit found with given ID"); - return 0; - } if (circ->state != CIRCUIT_STATE_OPEN) { - send_control0_error(conn, ERR_INTERNAL, "Refuse to attach stream to non-open circ."); + if (STATE_IS_V0(conn->state)) + send_control0_error(conn, ERR_INTERNAL, "Refuse to attach stream to non-open circ."); + else + connection_write_str_to_buf( + "551 Can't attach stream to non-open circuit\r\n", + conn); return 0; } if (connection_ap_handshake_attach_chosen_circuit(ap_conn, circ) != 1) { - send_control0_error(conn, ERR_INTERNAL, "Unable to attach stream."); + if (STATE_IS_V0(conn->state)) + send_control0_error(conn, ERR_INTERNAL, "Unable to attach stream."); + else + connection_write_str_to_buf("551 Unable to attach stream\r\n", conn); return 0; } send_control_done(conn); @@ -1283,6 +1362,8 @@ break; } + if (!v0) + tor_free(desc); return 0; } From nickm at seul.org Sat Jun 18 03:50:10 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 17 Jun 2005 23:50:10 -0400 (EDT) Subject: [or-cvs] The new protocol is implemented. Except for the pesky stri... Message-ID: <20050618035010.142EF1408061@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv24130/src/or Modified Files: control.c Log Message: The new protocol is implemented. Except for the pesky string unquoting business. And the cleanups. And the docs. And the testing. And the debugging. And the new features. Hm, I think it is time to sleep. Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- control.c 18 Jun 2005 03:09:43 -0000 1.92 +++ control.c 18 Jun 2005 03:50:08 -0000 1.93 @@ -368,6 +368,13 @@ return outp - *out; } +static const char * +get_escaped_string(const char *start, char **out, size_t *out_len) +{ + /* XXXX V1 */ + return NULL; +} + static void connection_printf_to_buf(connection_t *conn, const char *format, ...) @@ -582,23 +589,71 @@ static int handle_control_setconf(connection_t *conn, uint32_t len, char *body) { - /* XXXX V1 */ int r; struct config_line_t *lines=NULL; + int v0 = STATE_IS_V0(conn->state); - if (config_get_lines(body, &lines) < 0) { - log_fn(LOG_WARN,"Controller gave us config lines we can't parse."); - send_control0_error(conn, ERR_SYNTAX, "Couldn't parse configuration"); - return 0; + if (!v0) { + char *config = tor_malloc(len+1); + char *outp = config; + while (*body) { + char *eq = body; + while (!TOR_ISSPACE(*eq) && *eq != '=') + ++eq; + memcpy(outp, body, eq-body); + outp += (eq-body); + body = eq+1; + if (*eq == '=') { + if (*body != '\"') { + while (!TOR_ISSPACE(*body)) + *outp++ = *body++; + } else { + char *val; + size_t val_len; + body = (char*)get_escaped_string(body, &val, &val_len); + if (!body) { + connection_write_str_to_buf("551 Couldn't parse string\r\n", conn); + tor_free(config); + return 0; + } + memcpy(outp, val, val_len); + outp += val_len; + } + } + while (TOR_ISSPACE(*body)) + ++body; + *outp++ = '\n'; + } + *outp = '\0'; + + if (config_get_lines(config, &lines) < 0) { + log_fn(LOG_WARN,"Controller gave us config lines we can't parse."); + connection_write_str_to_buf("551 Couldn't parse configuration\r\n", conn); + tor_free(config); + return 0; + } + tor_free(config); + } else { + if (config_get_lines(body, &lines) < 0) { + log_fn(LOG_WARN,"Controller gave us config lines we can't parse."); + send_control0_error(conn, ERR_SYNTAX, "Couldn't parse configuration"); + return 0; + } } if ((r=config_trial_assign(lines, 1)) < 0) { log_fn(LOG_WARN,"Controller gave us config lines that didn't validate."); if (r==-1) { - send_control0_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY, - "Unrecognized option"); + if (v0) + send_control0_error(conn, ERR_UNRECOGNIZED_CONFIG_KEY, + "Unrecognized option"); + else + connection_write_str_to_buf("552 Unrecognzied option\r\n", conn); } else { - send_control0_error(conn, ERR_INVALID_CONFIG_VALUE,"Invalid option value"); + if (v0) + send_control0_error(conn,ERR_INVALID_CONFIG_VALUE,"Invalid option value"); + else + connection_write_str_to_buf("552 Invalid option value\r\n", conn); } config_free_lines(lines); return 0; @@ -804,11 +859,37 @@ static int handle_control_authenticate(connection_t *conn, uint32_t len, const char *body) { - /* XXXX V1 */ or_options_t *options = get_options(); + char *password; + size_t password_len; + if (STATE_IS_V0(conn->state)) { + password = (char*)body; + password_len = len; + } else { + if (TOR_ISXDIGIT(body[0])) { + int i = 0; + while (TOR_ISXDIGIT(body[i])) + ++i; + password = tor_malloc(i/2 + 1); + if (base16_decode(password, i/2+1, body, i)<0) { + connection_write_str_to_buf("551 Invalid hexadecimal encoding\r\n", conn); + tor_free(password); + return 0; + } + password_len = i/2; + } else if (TOR_ISSPACE(body[0])) { + password = tor_strdup(""); + password_len = 0; + } else { + if (!get_escaped_string(body, &password, &password_len)) { + connection_write_str_to_buf("551 Invalid quoted string\r\n", conn); + return 0; + } + } + } if (options->CookieAuthentication) { if (len == AUTHENTICATION_COOKIE_LEN && - !memcmp(authentication_cookie, body, len)) { + !memcmp(authentication_cookie, password, password_len)) { goto ok; } } else if (options->HashedControlPassword) { @@ -818,7 +899,7 @@ log_fn(LOG_WARN,"Couldn't decode HashedControlPassword: invalid base64"); goto err; } - secret_to_key(received,DIGEST_LEN,body,len,expected); + secret_to_key(received,DIGEST_LEN,password,password_len,expected); if (!memcmp(expected+S2K_SPECIFIER_LEN, received, DIGEST_LEN)) goto ok; goto err; @@ -831,16 +912,20 @@ err: if (STATE_IS_V0(conn->state)) send_control0_error(conn,ERR_REJECTED_AUTHENTICATION,"Authentication failed"); - else + else { + tor_free(password); connection_write_str_to_buf("515 Authentication failed\r\n", conn); + } return 0; ok: log_fn(LOG_INFO, "Authenticated control connection (%d)", conn->s); send_control_done(conn); if (STATE_IS_V0(conn->state)) conn->state = CONTROL_CONN_STATE_OPEN_V0; - else + else { conn->state = CONTROL_CONN_STATE_OPEN_V1; + tor_free(password); + } return 0; } From arma at seul.org Sat Jun 18 19:46:50 2005 From: arma at seul.org (arma at seul.org) Date: Sat, 18 Jun 2005 15:46:50 -0400 (EDT) Subject: [or-cvs] fix a seg fault in "tor --hash-password foo" Message-ID: <20050618194650.857A4140807F@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/tor-010x/tor/src/or Modified Files: Tag: tor-0_1_0-patches main.c Log Message: fix a seg fault in "tor --hash-password foo" Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.505.2.3 retrieving revision 1.505.2.4 diff -u -d -r1.505.2.3 -r1.505.2.4 --- main.c 13 Jun 2005 00:48:39 -0000 1.505.2.3 +++ main.c 18 Jun 2005 19:46:48 -0000 1.505.2.4 @@ -1238,7 +1238,8 @@ /* XXX really, this should get moved to do_main_loop */ } - handle_signals(1); + if (get_options()->command == CMD_RUN_TOR) + handle_signals(1); crypto_global_init(); if (crypto_seed_rng()) { From arma at seul.org Sun Jun 19 08:35:18 2005 From: arma at seul.org (arma at seul.org) Date: Sun, 19 Jun 2005 04:35:18 -0400 (EDT) Subject: [or-cvs] fix stray funny-character Message-ID: <20050619083518.95D3914080D8@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: relay.c Log Message: fix stray funny-character Index: relay.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/relay.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- relay.c 11 Jun 2005 18:52:11 -0000 1.72 +++ relay.c 19 Jun 2005 08:35:16 -0000 1.73 @@ -127,7 +127,7 @@ * - Crypt it (encrypt APward, decrypt at AP, decrypt exitward). * - Check if recognized (if exitward). * - If recognized and the digest checks out, then find if there's - * a conn that the cell is intended for, and deliver it to? + * a conn that the cell is intended for, and deliver it to * connection_edge. * - Else connection_or_write_cell_to_buf to the conn on the other * side of the circuit. From arma at seul.org Sun Jun 19 08:35:48 2005 From: arma at seul.org (arma at seul.org) Date: Sun, 19 Jun 2005 04:35:48 -0400 (EDT) Subject: [or-cvs] forward-port the --hash-password bug, plus other nearby fixes Message-ID: <20050619083548.7099014080D8@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: main.c Log Message: forward-port the --hash-password bug, plus other nearby fixes Index: main.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.518 retrieving revision 1.519 diff -u -d -r1.518 -r1.519 --- main.c 17 Jun 2005 20:37:21 -0000 1.518 +++ main.c 19 Jun 2005 08:35:46 -0000 1.519 @@ -963,6 +963,13 @@ { int loop_result; + /* only spawn dns handlers if we're a router */ + if (server_mode(get_options())) { + dns_init(); /* initialize the dns resolve tree, and spawn workers */ + } + + handle_signals(1); + /* load the private keys, if we're supposed to have them, and set up the * TLS context. */ if (! identity_key_is_set()) { @@ -1313,14 +1320,6 @@ log_fn(LOG_WARN,"You are running Tor as root. You don't need to, and you probably shouldn't."); #endif - /* only spawn dns handlers if we're a router */ - if (server_mode(get_options()) && get_options()->command == CMD_RUN_TOR) { - dns_init(); /* initialize the dns resolve tree, and spawn workers */ - /* XXX really, this should get moved to do_main_loop */ - } - - handle_signals(1); - crypto_global_init(); if (crypto_seed_rng()) { log_fn(LOG_ERR, "Unable to seed random number generator. Exiting."); From nickm at seul.org Sun Jun 19 20:40:43 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 19 Jun 2005 16:40:43 -0400 (EDT) Subject: [or-cvs] Implement all the rest of the new controller protocol, debu... Message-ID: <20050619204043.CC07D1408087@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv5238/doc Modified Files: control-spec.txt TODO Log Message: Implement all the rest of the new controller protocol, debug a little, add some new features, add ADDRMAP events. Index: control-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/control-spec.txt,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- control-spec.txt 18 Jun 2005 01:49:03 -0000 1.40 +++ control-spec.txt 19 Jun 2005 20:40:41 -0000 1.41 @@ -159,7 +159,7 @@ "SETEVENTS" *(SP EventCode) CRLF EventCode = "CIRC" / "STREAM" / "ORCONN" / "BW" / "DEBUG" / - "INFO" / "NOTICE" / "WARN" / "ERR" / "NEWDESC" + "INFO" / "NOTICE" / "WARN" / "ERR" / "NEWDESC" / "ADDRMAP" [XXX We should have an "ADDRESSMAP" event to hear when we learn about dns resolves, etc, so the controller can keep synced. -RD] @@ -318,7 +318,7 @@ "stream-status" A series of lines as for a stream status event. Each is of the form: - StreamID SP StreamStatus SP Target CRLF + StreamID SP StreamStatus SP CircID SP Target CRLF "orconn-status" A series of lines as for an OR connection status event. Each is of the @@ -344,9 +344,9 @@ request for the server to extend an existing circuit with that ID according to the specified path. - If the request is successful, the server sends a "250 OK" message - containing a message body consisting of the Circuit ID of the (maybe newly - created) circuit. + If the request is successful, the server sends a reply containing a message + body consisting of the Circuit ID of the (maybe newly created) circuit. + The syntax is "250" SP "EXTENDED" SP CircuitID CRLF. 3.10 ATTACHSTREAM @@ -491,6 +491,8 @@ 554 Invalid descriptor + 555 Unmanaged entity + 650 Asynchronous event notification Unless specified to have specific contents, the human-readable messages @@ -537,20 +539,22 @@ The syntax is: - "650" SP "STREAM" SP StreamID SP StreamStatus SP Target + "650" SP "STREAM" SP StreamID SP StreamStatus SP CircID SP Target SP StreamStatus = "NEW" / ; New request to connect "NEWRESOLVE" / ; New request to resolve an address "SENTCONNECT" / ; Sent a connect cell along a circuit "SENTRESOLVE" / ; Sent a resolve cell along a circuit - "SUCCEEDED" / ; Received a successful reply; stream established + "SUCCEEDED" / ; Received a reply; stream established "FAILED" / ; Stream failed and not retriable. "CLOSED" / ; Stream closed - "DETACHED" ; Stream detached from circuit; still retriable + "DETACHED" ; Detached from circuit; still retriable. Target = Address ":" Port + The circuit ID designates which circuit this stream is attached to. If + the stream is unattached, the circuit ID "0" is given. 4.1.3 OR Connection status changed @@ -580,6 +584,12 @@ Syntax: "650" SP "NEWDESC" 1*(SP ServerID) +4.1.6 New Address mapping + + Syntax: + "650" SP "ADDRMAP" SP Address SP Address SP Expiry + Expiry = DQOUTE ISOTime DQUOTE / "NEVER" + 5. Implementation notes 5.1. Authentication Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.324 retrieving revision 1.325 diff -u -d -r1.324 -r1.325 --- TODO 17 Jun 2005 18:54:06 -0000 1.324 +++ TODO 19 Jun 2005 20:40:41 -0000 1.325 @@ -54,15 +54,19 @@ for 0.1.1.x: N . Controller improvements - . new controller protocol - . Specify - . Implement - - controller should have an event to learn about new addressmappings, + o new controller protocol + o Specify + o Implement + . Test, debug + o add new getinfo options to enumerate things we only find out about + currently via events. + o controller should have an event to learn about new addressmappings, e.g. when we learn a hostname to IP mapping ? - - make sure err-level log events get flushed to the controller + . make sure err-level log events get flushed to the controller immediately, since tor will exit right after. - - add new getinfo options to enumerate things we only find out about - currently via events. + o Implement + - Test, debug + - Switch example controllers to use new protocol - switch accountingmax to count total in+out, not either in or out. it's easy to move in this direction (not risky), but hard to back, out if we decide we prefer it the way it already is. hm. From nickm at seul.org Sun Jun 19 20:40:43 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 19 Jun 2005 16:40:43 -0400 (EDT) Subject: [or-cvs] Implement all the rest of the new controller protocol, debu... Message-ID: <20050619204043.D348714081A4@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv5238/src/or Modified Files: circuitlist.c connection_edge.c control.c or.h Log Message: Implement all the rest of the new controller protocol, debug a little, add some new features, add ADDRMAP events. Index: circuitlist.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuitlist.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- circuitlist.c 11 Jun 2005 18:52:11 -0000 1.50 +++ circuitlist.c 19 Jun 2005 20:40:41 -0000 1.51 @@ -154,6 +154,13 @@ } } +/** DOCDOC **/ +circuit_t * +_circuit_get_global_list(void) +{ + return global_circuitlist; +} + /** Function to make circ-\>state human-readable */ const char * circuit_state_to_string(int state) { Index: connection_edge.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v retrieving revision 1.332 retrieving revision 1.333 diff -u -d -r1.332 -r1.333 --- connection_edge.c 15 Jun 2005 18:34:46 -0000 1.332 +++ connection_edge.c 19 Jun 2005 20:40:41 -0000 1.333 @@ -513,6 +513,7 @@ } } +/* DOCDOC */ static void addressmap_ent_remove(const char *addr, addressmap_entry_t *ent) { @@ -637,6 +638,7 @@ log_fn(LOG_INFO, "Addressmap: (re)mapped '%s' to '%s'", safe_str(address), safe_str(ent->new_address)); + control_event_address_mapped(address, ent->new_address, expires); } /** An attempt to resolve address failed at some OR. Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- control.c 18 Jun 2005 03:50:08 -0000 1.93 +++ control.c 19 Jun 2005 20:40:41 -0000 1.94 @@ -71,7 +71,8 @@ #define EVENT_NOTICE_MSG 0x0009 #define EVENT_WARN_MSG 0x000A #define EVENT_ERR_MSG 0x000B -#define _EVENT_MAX 0x000B +#define EVENT_ADDRMAP 0x000C +#define _EVENT_MAX 0x000C /** Array mapping from message type codes to human-readable message * type names. */ @@ -161,6 +162,7 @@ const char *body); static int handle_control_closecircuit(connection_t *conn, uint32_t len, const char *body); +static int write_stream_target_to_buf(connection_t *conn, char *buf, size_t len); /** Given a possibly invalid message type code cmd, return a * human-readable string equivalent. */ @@ -250,6 +252,7 @@ control_event_logmsg); } +/* DOCDOC */ static INLINE void connection_write_str_to_buf(const char *s, connection_t *conn) { @@ -257,6 +260,7 @@ connection_write_to_buf(s, len, conn); } +/* DOCDOC ; test */ static size_t write_escaped_data(const char *data, size_t len, int translate_newlines, char **out) @@ -288,50 +292,17 @@ } *outp++ = *data++; } - *outp++ = '\r'; - *outp++ = '\n'; + if (outp < *out+2 || memcmp(outp-2, "\r\n", 2)) { + *outp++ = '\r'; + *outp++ = '\n'; + } *outp++ = '.'; *outp++ = '\r'; *outp++ = '\n'; return outp - *out; } -#if 0 -static void -connection_write_escaped_data_to_buf(const char *data, size_t len, - int translate_newlines, - connection_t *conn) -{ - const char *next; - - while (len) { - if (*data == '.') - connection_write_to_buf(".", 1, conn); - - if (translate_newlines) - next = tor_memmem(data, len, "\r\n", 2); - else - next = tor_memmem(data, len, "\r\n.", 3); - - if (next) { - if (translate_newlines) { - connection_write_to_buf(data, next-data, conn); - connection_write_to_buf("\n", 1, conn); - len -= (next-data+2); - } else { - connection_write_to_buf(data, next-data+2, conn); - len -= (next-data+2); - } - data = next + 2; - } else { - connection_write_to_buf(data, len, conn); - break; - } - } - connection_write_to_buf(".\r\n", 3, conn); -} -#endif - +/* DOCDOC ; test */ static size_t read_escaped_data(const char *data, size_t len, int translate_newlines, char **out) @@ -368,14 +339,54 @@ return outp - *out; } +/** DOCDOC; test **/ static const char * -get_escaped_string(const char *start, char **out, size_t *out_len) +get_escaped_string(const char *start, size_t in_len_max, + char **out, size_t *out_len) { - /* XXXX V1 */ - return NULL; -} + const char *cp, *end; + char *outp; + size_t len=0; + + if (*start != '\"') + return NULL; + + cp = start+1; + end = start+in_len_max; + + /* Calculate length. */ + while (1) { + if (cp >= end) + return NULL; + else if (*cp == '\\') { + if (++cp == end) + return NULL; /* Can't escape EOS. */ + ++cp; + ++len; + } else if (*cp == '\"') { + break; + } else { + ++cp; + ++len; + } + } + end = cp; + outp = *out = tor_malloc(len+1); + *out_len = len; + + cp = start+1; + while (cp < end) { + if (*cp == '\\') + ++cp; + *outp++ = *cp++; + } + *outp = '\0'; + tor_assert((outp - *out) == *out_len); + return end+1; +} +/* DOCDOC */ static void connection_printf_to_buf(connection_t *conn, const char *format, ...) { @@ -395,29 +406,6 @@ connection_write_to_buf(buf, len, conn); } -#if 0 -static void -connection_write_reply_lines_to_buf(connection_t *conn, - const char *code, smartlist_t *lines) -{ - int i, len; - - tor_assert(strlen(code) == 3); - len = smartlist_len(lines); - if (!len) - return; - - for (i=0; i < len-1; ++i) { - connection_write_to_buf(code, 3, conn); - connection_write_to_buf("-", 1, conn); - connection_write_str_to_buf(smartlist_get(lines, i), conn); - } - connection_write_to_buf(code, 3, conn); - connection_write_to_buf(" ", 1, conn); - connection_write_str_to_buf(smartlist_get(lines, len-1), conn); -} -#endif - /** Send a message of type type containing len bytes * from body along the control connection conn */ static void @@ -514,15 +502,15 @@ conns[i]->state == CONTROL_CONN_STATE_OPEN_V0 && conns[i]->event_mask & (1<state == CONTROL_CONN_STATE_OPEN_V1 && conns[i]->event_mask & (1<state); if (!v0) { @@ -602,6 +590,7 @@ ++eq; memcpy(outp, body, eq-body); outp += (eq-body); + *outp++ = ' '; body = eq+1; if (*eq == '=') { if (*body != '\"') { @@ -610,7 +599,8 @@ } else { char *val; size_t val_len; - body = (char*)get_escaped_string(body, &val, &val_len); + body = (char*)get_escaped_string(body, (len - (body-start)), + &val, &val_len); if (!body) { connection_write_str_to_buf("551 Couldn't parse string\r\n", conn); tor_free(config); @@ -618,6 +608,7 @@ } memcpy(outp, val, val_len); outp += val_len; + tor_free(val); } } while (TOR_ISSPACE(*body)) @@ -702,6 +693,7 @@ } } else { struct config_line_t *answer = config_get_assigned_option(options,q); + /* XXXX handle non-set options in V1 at least*/ while (answer) { struct config_line_t *next; @@ -808,6 +800,8 @@ event_code = EVENT_ERR_MSG; else if (!strcasecmp(ev, "NEWDESC")) event_code = EVENT_NEW_DESC; + else if (!strcasecmp(ev, "ADDRMAP")) + event_code = EVENT_ADDRMAP; else { connection_printf_to_buf(conn, "552 Unrecognized event \"%s\"\r\n", ev); @@ -881,7 +875,7 @@ password = tor_strdup(""); password_len = 0; } else { - if (!get_escaped_string(body, &password, &password_len)) { + if (!get_escaped_string(body, len, &password, &password_len)) { connection_write_str_to_buf("551 Invalid quoted string\r\n", conn); return 0; } @@ -1003,21 +997,29 @@ static int handle_control_mapaddress(connection_t *conn, uint32_t len, const char *body) { - /* XXXX V1 */ smartlist_t *elts; smartlist_t *lines; smartlist_t *reply; char *r; size_t sz; + int v0 = STATE_IS_V0(conn->state); lines = smartlist_create(); elts = smartlist_create(); reply = smartlist_create(); - smartlist_split_string(lines, body, "\n", - SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + if (v0) + smartlist_split_string(lines, body, "\n", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + else + smartlist_split_string(lines, body, " ", + SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); + /* XXXX Make errors conformant. */ SMARTLIST_FOREACH(lines, char *, line, { tor_strlower(line); - smartlist_split_string(elts, line, " ", 0, 2); + if (v0) + smartlist_split_string(elts, line, " ", 0, 2); + else + smartlist_split_string(elts, line, "=", 0, 2); if (smartlist_len(elts) == 2) { const char *from = smartlist_get(elts,0); const char *to = smartlist_get(elts,1); @@ -1027,21 +1029,31 @@ log_fn(LOG_WARN,"Skipping invalid argument '%s' in MapAddress msg",to); } else if (!strcmp(from, ".") || !strcmp(from, "0.0.0.0")) { const char *addr = addressmap_register_virtual_address( - strcmp(from,".") ? RESOLVED_TYPE_HOSTNAME : RESOLVED_TYPE_IPV4, + !strcmp(from,".") ? RESOLVED_TYPE_HOSTNAME : RESOLVED_TYPE_IPV4, tor_strdup(to)); if (!addr) { log_fn(LOG_WARN, "Unable to allocate address for '%s' in MapAddress msg", safe_str(line)); } else { - size_t anslen = strlen(addr)+strlen(to)+2; + size_t anslen = strlen(addr)+strlen(to)+8; char *ans = tor_malloc(anslen); - tor_snprintf(ans, anslen, "%s %s", addr, to); + if (v0) + tor_snprintf(ans, anslen, "%s %s", addr, to); + else + tor_snprintf(ans, anslen, "250-%s=%s", addr, to); smartlist_add(reply, ans); } } else { addressmap_register(from, tor_strdup(to), 1); - smartlist_add(reply, tor_strdup(line)); + if (v0) + smartlist_add(reply, tor_strdup(line)); + else { + size_t anslen = strlen(line)+8; + char *ans = tor_malloc(anslen); + tor_snprintf(ans, anslen, "250-%s", line); + smartlist_add(reply, ans); + } } } else { log_fn(LOG_WARN, "Skipping MapAddress line with wrong number of items."); @@ -1053,8 +1065,15 @@ smartlist_free(lines); smartlist_free(elts); - r = smartlist_join_strings(reply, "\n", 1, &sz); - send_control_done2(conn,r,sz); + if (v0) { + r = smartlist_join_strings(reply, "\n", 1, &sz); + send_control_done2(conn,r,sz); + } else { + if (smartlist_len(reply)) + ((char*)smartlist_get(reply,smartlist_len(reply)-1))[3] = ' '; + r = smartlist_join_strings(reply, "\r\n", 1, &sz); + connection_write_to_buf(r, sz, conn); + } SMARTLIST_FOREACH(reply, char *, cp, tor_free(cp)); smartlist_free(reply); @@ -1086,6 +1105,106 @@ list_server_status(routerlist->routers, answer) < 0) { return -1; } + } else if (!strcmp(question, "circuit-status")) { + circuit_t *circ; + smartlist_t *status = smartlist_create(); + for (circ = _circuit_get_global_list(); circ; circ = circ->next) { + char *s, *path; + size_t slen; + const char *state; + if (! CIRCUIT_IS_ORIGIN(circ) || circ->marked_for_close) + continue; + path = circuit_list_path(circ,0); + if (circ->state == CIRCUIT_STATE_OPEN) + state = "BUILT"; + else if (strlen(path)) + state = "EXTENDED"; + else + state = "LAUNCHED"; + + slen = strlen(path)+strlen(state)+20; + s = tor_malloc(slen+1); + tor_snprintf(s, slen, "%lu %s %s", (unsigned long)circ->global_identifier, + state, path); + smartlist_add(status, s); + tor_free(path); + } + *answer = smartlist_join_strings(status, "\r\n", 1, NULL); + SMARTLIST_FOREACH(status, char *, cp, tor_free(cp)); + smartlist_free(status); + } else if (!strcmp(question, "stream-status")) { + connection_t **conns; + int n_conns, i; + char buf[256]; + smartlist_t *status = smartlist_create(); + get_connection_array(&conns, &n_conns); + for (i=0; i < n_conns; ++i) { + const char *state; + char *s; + size_t slen; + circuit_t *circ; + if (conns[i]->type != CONN_TYPE_AP || + conns[i]->marked_for_close || + conns[i]->state == AP_CONN_STATE_SOCKS_WAIT) + continue; + switch (conns[i]->state) + { + case AP_CONN_STATE_CONTROLLER_WAIT: + case AP_CONN_STATE_CIRCUIT_WAIT: + if (conns[i]->socks_request && + conns[i]->socks_request->command == SOCKS_COMMAND_RESOLVE) + state = "NEWRESOLVE"; + else + state = "NEW"; + break; + case AP_CONN_STATE_RENDDESC_WAIT: + case AP_CONN_STATE_CONNECT_WAIT: + state = "SENTCONNECT"; break; + case AP_CONN_STATE_RESOLVE_WAIT: + state = "SENTRESOLVE"; break; + case AP_CONN_STATE_OPEN: + state = "SUCCEEDED"; break; + default: + log_fn(LOG_WARN, "Asked for stream in unknown state %d", + conns[i]->state); + continue; + } + circ = circuit_get_by_edge_conn(conns[i]); + write_stream_target_to_buf(conns[i], buf, sizeof(buf)); + slen = strlen(buf)+strlen(state)+32; + s = tor_malloc(slen+1); + tor_snprintf(s, slen, "%lu %s %lu %s", + (unsigned long) conns[i]->global_identifier,state, + circ?(unsigned long)circ->global_identifier : 0ul, + buf); + smartlist_add(status, s); + } + *answer = smartlist_join_strings(status, "\r\n", 1, NULL); + SMARTLIST_FOREACH(status, char *, cp, tor_free(cp)); + smartlist_free(status); + } else if (!strcmp(question, "orconn-status")) { + connection_t **conns; + int n_conns, i; + smartlist_t *status = smartlist_create(); + get_connection_array(&conns, &n_conns); + for (i=0; i < n_conns; ++i) { + const char *state; + char *s; + size_t slen; + if (conns[i]->type != CONN_TYPE_OR || conns[i]->marked_for_close) + continue; + if (conns[i]->state == OR_CONN_STATE_OPEN) + state = "CONNECTED"; + else + state = "LAUNCHED"; + slen = strlen(conns[i]->nickname)+strlen(state)+2; + s = tor_malloc(slen+1); + tor_snprintf(s, slen, "%s %s",conns[i]->nickname,state); + smartlist_add(status, s); + } + *answer = smartlist_join_strings(status, "\r\n", 1, NULL); + SMARTLIST_FOREACH(status, char *, cp, tor_free(cp)); + smartlist_free(status); } else if (!strcmpstart(question, "addr-mappings/")) { time_t min_e, max_e; smartlist_t *mappings; @@ -1152,13 +1271,13 @@ if (smartlist_len(unrecognized)) { int i; tor_assert(!v0); - for (i=0; i < len-1; ++i) + for (i=0; i < smartlist_len(unrecognized)-1; ++i) connection_printf_to_buf(conn, - "552-Unrecognized configuration key \"%s\"\r\n", + "552-Unrecognized key \"%s\"\r\n", (char*)smartlist_get(unrecognized, i)); connection_printf_to_buf(conn, - "552 Unrecognized configuration key \"%s\"\r\n", - (char*)smartlist_get(unrecognized, len-1)); + "552 Unrecognized key \"%s\"\r\n", + (char*)smartlist_get(unrecognized, i)); goto done; } @@ -1174,12 +1293,14 @@ char *v = smartlist_get(answers, i+1); /*XXXX Not an adequate test! XXXX011 */ if (!strchr(v, '\n') && !strchr(v, '\r')) { - connection_printf_to_buf(conn, "250-%s=%s\r\n", k, v); + connection_printf_to_buf(conn, "250-%s=", k); + connection_write_str_to_buf(v, conn); + connection_write_str_to_buf("\r\n", conn); } else { char *esc = NULL; size_t len; len = write_escaped_data(v, strlen(v), 1, &esc); - connection_printf_to_buf(conn, "250+%s=", k); + connection_printf_to_buf(conn, "250+%s=\r\n", k); connection_write_to_buf(esc, len, conn); tor_free(esc); } @@ -1371,7 +1492,6 @@ return 0; } - if (ap_conn->state != AP_CONN_STATE_CONTROLLER_WAIT) { if (STATE_IS_V0(conn->state)) { send_control0_error(conn, ERR_NO_STREAM, @@ -1679,6 +1799,7 @@ return 0; } +/* DOCDOC */ static int connection_control_process_inbuf_v1(connection_t *conn) { @@ -1812,6 +1933,7 @@ goto again; } +/* DOCDOC */ static int connection_control_process_inbuf_v0(connection_t *conn) { @@ -2015,6 +2137,22 @@ return 0; } +/** DOCDOC */ +static int +write_stream_target_to_buf(connection_t *conn, char *buf, size_t len) +{ + char buf2[256]; + if (conn->chosen_exit_name) + if (tor_snprintf(buf2, sizeof(buf2), ".%s.exit", conn->chosen_exit_name)<0) + return -1; + if (tor_snprintf(buf, len, "%s%s:%d", + conn->socks_request->address, + conn->chosen_exit_name ? buf2 : "", + conn->socks_request->port)<0) + return -1; + return 0; +} + /** Something has happened to the stream associated with AP connection * conn: tell any interested control connections. */ int @@ -2022,19 +2160,14 @@ { char *msg; size_t len; - char buf[256], buf2[256]; + char buf[256]; tor_assert(conn->type == CONN_TYPE_AP); tor_assert(conn->socks_request); if (!EVENT_IS_INTERESTING(EVENT_STREAM_STATUS)) return 0; - if (conn->chosen_exit_name) - tor_snprintf(buf2, sizeof(buf2), ".%s.exit", conn->chosen_exit_name); - tor_snprintf(buf, sizeof(buf), "%s%s:%d", - conn->socks_request->address, - conn->chosen_exit_name ? buf2 : "", - conn->socks_request->port); + write_stream_target_to_buf(conn, buf, sizeof(buf)); if (EVENT_IS_INTERESTING0(EVENT_STREAM_STATUS)) { len = strlen(buf); msg = tor_malloc(5+len+1); @@ -2047,6 +2180,7 @@ } if (EVENT_IS_INTERESTING0(EVENT_STREAM_STATUS)) { const char *status; + circuit_t *circ; switch (tp) { case STREAM_EVENT_SENT_CONNECT: status = "SENTCONNECT"; break; @@ -2061,10 +2195,12 @@ log_fn(LOG_WARN, "Unrecognized status code %d", (int)tp); return 0; } + circ = circuit_get_by_edge_conn(conn); send_control1_event(EVENT_STREAM_STATUS, - "650 STREAM %lu %s %s\r\n", - (unsigned long)conn->global_identifier, - status, buf); + "650 STREAM %lu %s %lu %s\r\n", + (unsigned long)conn->global_identifier, status, + circ?(unsigned long)circ->global_identifier : 0ul, + buf); } return 0; } @@ -2167,7 +2303,7 @@ if (*cp == '\r' || *cp == '\n') *cp = ' '; } - switch(severity) { + switch (severity) { case LOG_INFO: s = "INFO"; break; case LOG_NOTICE: s = "NOTICE"; break; case LOG_WARN: s = "WARN"; break; @@ -2215,6 +2351,25 @@ return 0; } +/** DOCDOC */ +int +control_event_address_mapped(const char *from, const char *to, time_t expires) +{ + if (!EVENT_IS_INTERESTING1(EVENT_ADDRMAP)) + return 0; + + if (expires < 3) + send_control1_event(EVENT_ADDRMAP, "650 ADDRMAP %s %s NEVER\r\n", from, to); + else { + char buf[ISO_TIME_LEN+1]; + format_local_iso_time(buf,expires); + send_control1_event(EVENT_ADDRMAP, "650 ADDRMAP %s %s \"%s\"\r\n", + from, to, buf); + } + + return 0; +} + /** Choose a random authentication cookie and write it to disk. * Anybody who can read the cookie from disk will be considered * authorized to use the control connection. */ Index: or.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.617 retrieving revision 1.618 diff -u -d -r1.617 -r1.618 --- or.h 17 Jun 2005 18:49:55 -0000 1.617 +++ or.h 19 Jun 2005 20:40:41 -0000 1.618 @@ -1219,6 +1219,7 @@ /********************************* circuitlist.c ***********************/ +circuit_t * _circuit_get_global_list(void); const char *circuit_state_to_string(int state); enum which_conn_changed_t { P_CONN_CHANGED=1, N_CONN_CHANGED=0 }; void circuit_set_circid_orconn(circuit_t *circ, uint16_t id, @@ -1478,6 +1479,7 @@ int control_event_bandwidth_used(uint32_t n_read, uint32_t n_written); void control_event_logmsg(int severity, const char *msg); int control_event_descriptors_changed(smartlist_t *routers); +int control_event_address_mapped(const char *from, const char *to,time_t expires); int init_cookie_authentication(int enabled); int decode_hashed_password(char *buf, const char *hashed); From nickm at seul.org Sun Jun 19 22:38:33 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 19 Jun 2005 18:38:33 -0400 (EDT) Subject: [or-cvs] Add python interface to new controller protocol; split old ... Message-ID: <20050619223833.93ACE1408092@moria.seul.org> Update of /home/or/cvsroot/control/python In directory moria:/tmp/cvs-serv9506/python Modified Files: TorCtl.py Added Files: TorCtl0.py TorCtl1.py Log Message: Add python interface to new controller protocol; split old protocol into separate module Index: TorCtl.py =================================================================== RCS file: /home/or/cvsroot/control/python/TorCtl.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TorCtl.py 15 Jun 2005 15:18:22 -0000 1.2 +++ TorCtl.py 19 Jun 2005 22:38:31 -0000 1.3 @@ -7,129 +7,8 @@ TorCtl -- Library to control Tor processes. See TorCtlDemo.py for example use. """ -import binascii -import os -import sha -import socket -import struct -import sys -import threading -import Queue - -__all__ = [ - "MSG_TYPE", "EVENT_TYPE", "CIRC_STATUS", "STREAM_STATUS", - "OR_CONN_STATUS", "SIGNAL", "ERR_CODES", - "TorCtlError", "ProtocolError", "ErrorReply", "Connection", "EventHandler", - "DebugEventHandler", "parseHostAndPort" - ] - -class _Enum: - # Helper: define an ordered dense name-to-number 1-1 mapping. - def __init__(self, start, names): - self.nameOf = {} - idx = start - for name in names: - setattr(self,name,idx) - self.nameOf[idx] = name - idx += 1 - -class _Enum2: - # Helper: define an ordered sparse name-to-number 1-1 mapping. - def __init__(self, **args): - self.__dict__.update(args) - self.nameOf = {} - for k,v in args.items(): - self.nameOf[v] = k - -# Message types that client or server can send. -MSG_TYPE = _Enum(0x0000, - ["ERROR", - "DONE", - "SETCONF", - "GETCONF", - "CONFVALUE", - "SETEVENTS", - "EVENT", - "AUTH", - "SAVECONF", - "SIGNAL", - "MAPADDRESS", - "GETINFO", - "INFOVALUE", - "EXTENDCIRCUIT", - "ATTACHSTREAM", - "POSTDESCRIPTOR", - "FRAGMENTHEADER", - "FRAGMENT", - "REDIRECTSTREAM", - "CLOSESTREAM", - "CLOSECIRCUIT", - ]) - -# Make sure that the enumeration code is working. -assert MSG_TYPE.SAVECONF == 0x0008 -assert MSG_TYPE.CLOSECIRCUIT == 0x0014 - -# Types of "EVENT" message. -EVENT_TYPE = _Enum(0x0001, - ["CIRCSTATUS", - "STREAMSTATUS", - "ORCONNSTATUS", - "BANDWIDTH", - "OBSOLETE_LOG", - "NEWDESC", - "DEBUG_MSG", - "INFO_MSG", - "NOTICE_MSG", - "WARN_MSG", - "ERR_MSG", - ]) - -assert EVENT_TYPE.ERR_MSG == 0x000B -assert EVENT_TYPE.OBSOLETE_LOG == 0x0005 - -# Status codes for "CIRCSTATUS" events. -CIRC_STATUS = _Enum(0x00, - ["LAUNCHED", - "BUILT", - "EXTENDED", - "FAILED", - "CLOSED"]) - -# Status codes for "STREAMSTATUS" events -STREAM_STATUS = _Enum(0x00, - ["SENT_CONNECT", - "SENT_RESOLVE", - "SUCCEEDED", - "FAILED", - "CLOSED", - "NEW_CONNECT", - "NEW_RESOLVE", - "DETACHED"]) - -# Status codes for "ORCONNSTATUS" events -OR_CONN_STATUS = _Enum(0x00, - ["LAUNCHED","CONNECTED","FAILED","CLOSED"]) - -# Signal codes for "SIGNAL" events. -SIGNAL = _Enum2(HUP=0x01,INT=0x02,USR1=0x0A,USR2=0x0C,TERM=0x0F) - -# Error codes for "ERROR" events. -ERR_CODES = { - 0x0000 : "Unspecified error", - 0x0001 : "Internal error", - 0x0002 : "Unrecognized message type", - 0x0003 : "Syntax error", - 0x0004 : "Unrecognized configuration key", - 0x0005 : "Invalid configuration value", - 0x0006 : "Unrecognized byte code", - 0x0007 : "Unauthorized", - 0x0008 : "Failed authentication attempt", - 0x0009 : "Resource exhausted", - 0x000A : "No such stream", - 0x000B : "No such circuit", - 0x000C : "No such OR" -} +import TorCtl0 +import TorCtl1 class TorCtlError(Exception): "Generic error raised by TorControl code." @@ -143,392 +22,42 @@ "Raised when Tor controller returns an error" pass -def parseHostAndPort(h): - """Given a string of the form 'address:port' or 'address' or - 'port' or '', return a two-tuple of (address, port) - """ - host, port = "localhost", 9100 - if ":" in h: - i = h.index(":") - host = h[:i] - try: - port = int(h[i+1:]) - except ValueError: - print "Bad hostname %r"%h - sys.exit(1) - elif h: - try: - port = int(h) - except ValueError: - host = h - - return host, port - -def _unpack_singleton_msg(msg): - """Helper: unpack a single packet. Return (None, minLength, body-so-far) - on incomplete packet or (type,body,rest) on somplete packet - """ - if len(msg) < 4: - return None, 4, msg - length,type = struct.unpack("!HH",msg) - if len(msg) >= 4+length: - return type,msg[4:4+length],msg[4+length:] - else: - return None,4+length,msg - -def _minLengthToPack(bytes): - """Return the minimum number of bytes needed to pack the message 'smg'""" - whole,left = divmod(bytes,65535) - if left: - return whole*(65535+4)+4+left - else: - return whole*(65535+4) - -def _unpack_msg(msg): - "returns as for _unpack_singleton_msg" - tp,body,rest = _unpack_singleton_msg(msg) - if tp != MSG_TYPE.FRAGMENTHEADER: - return tp, body, rest - - if len(body) < 6: - raise ProtocolError("FRAGMENTHEADER message too short") - - realType,realLength = struct.unpack("!HL", body[:6]) - - # Okay; could the message _possibly_ be here? - minLength = _minLengthToPack(realLength+6) - if len(msg) < minLength: - return None, minLength, msg - - # Okay; optimistically try to build up the msg. - soFar = [ body[6:] ] - lenSoFarLen = len(body)-6 - while len(rest)>=4 and lenSoFar < realLength: - ln, tp = struct.unpack("!HH", rest[:4]) - if tp != MSG_TYPE.FRAGMENT: - raise ProtocolError("Missing FRAGMENT message") - soFar.append(rest[4:4+ln]) - lenSoFar += ln - if 4+ln > len(rest): - rest = "" - leftInPacket = 4+ln-len(rest) - else: - rest = rest[4+ln:] - leftInPacket=0 - - if lenSoFar == realLength: - return realType, "".join(soFar), rest - elif lenSoFar > realLength: - raise ProtocolError("Bad fragmentation: message longer than declared") - else: - inOtherPackets = realLength-lenSoFar-leftInPacket - minLength = _minLengthToPack(inOtherPackets) - return None, len(msg)+leftInPacket+inOtherPackets, msg - -def _receive_singleton_msg(s): - """Read a single packet from the socket s. - """ - body = "" - header = s.recv(4) - length,type = struct.unpack("!HH",header) - if length: - while length > len(body): - body += s.recv(length-len(body)) - return length,type,body - -def _receive_message(s): - """Read a single message (possibly multi-packet) from the socket s.""" - length, tp, body = _receive_singleton_msg(s) - if tp != MSG_TYPE.FRAGMENTHEADER: - return length, tp, body - if length < 6: - raise ProtocolError("FRAGMENTHEADER message too short") - realType,realLength = struct.unpack("!HL", body[:6]) - data = [ body[6:] ] - soFar = len(data[0]) - while 1: - length, tp, body = _receive_singleton_msg(s) - if tp != MSG_TYPE.FRAGMENT: - raise ProtocolError("Missing FRAGMENT message") - soFar += length - data.append(body) - if soFar == realLength: - return realLength, realType, "".join(data) - elif soFar > realLength: - raise ProtocolError("FRAGMENT message too long!") - -def pack_message(type, body=""): - """Given a message type and optional message body, generate a set of - packets to send. - """ - length = len(body) - if length < 65536: - reqheader = struct.pack("!HH", length, type) - return "%s%s"%(reqheader,body) - - fragheader = struct.pack("!HHHL", - 65535, MSG_TYPE.FRAGMENTHEADER, type, length) - msgs = [ fragheader, body[:65535-6] ] - body = body[65535-6:] - while body: - if len(body) > 65535: - fl = 65535 - else: - fl = len(body) - fragheader = struct.pack("!HH", MSG_TYPE.FRAGMENT, fl) - msgs.append(fragheader) - msgs.append(body[:fl]) - body = body[fl:] - - return "".join(msgs) - -def _parseKV(body,sep=" ",term="\n"): - """Helper: parse a key/value list of the form [key sep value term]* . - Return a list of (k,v).""" - res = [] - for line in body.split(term): - if not line: continue - k, v = line.split(sep,1) - res.append((k,v)) - return res - -def _unterminate(s): - """Strip trailing NUL characters from s.""" - if s[-1] == '\0': - return s[:-1] - else: - return s - -class Connection: - """A Connection represents a connection to the Tor process.""" - def __init__(self, sock): - """Create a Connection to communicate with the Tor process over the - socket 'sock'. - """ - self._s = sock - self._handler = None - self._sendLock = threading.RLock() - self._queue = Queue.Queue() - self._thread = None - - def setEventHandler(self, handler): - """Cause future events from the Tor process to be sent to 'handler'. - """ - self._handler = handler - - def launchThread(self, daemon=1): - """Launch a background thread to handle messages from the Tor process.""" - assert self._thread is None - t = threading.Thread(target=self._loop) - if daemon: - t.setDaemon(daemon) - t.start() - self._thread = t - return t - - def _send(self, type, body=""): - """Helper: Deliver a command of type 'type' and body 'body' to Tor. - """ - self._s.sendall(pack_message(type, body)) - - def _loop(self): - """Main subthread loop: Read commands from Tor, and handle them either - as events or as responses to other commands. - """ - while 1: - try: - length, tp, body = _receive_message(self._s) - except OSError: - if self._queue.get(timeout=0) != "CLOSE": - raise - if tp == MSG_TYPE.EVENT: - if self._handler is not None: - self._handler.handle(body) - else: - cb = self._queue.get() - cb(tp, body) - - def _sendAndRecv(self, tp, msg="", expectedTypes=(MSG_TYPE.DONE,)): - """Helper: Send a command of type 'tp' and body 'msg' to Tor, - and wait for a command in response. If the response type is - in expectedTypes, return a (tp,body) tuple. If it is an error, - raise ErrorReply. Otherwise, raise ProtocolError. - """ - # This condition will get notified when we've got a result... - condition = threading.Condition() - # Here's where the result goes... - result = [] - - def cb(tp,body,condition=condition,result=result): - condition.acquire() - try: - result.append((tp, body)) - condition.notify() - finally: - condition.release() - - # Sends a message to Tor... - self._sendLock.acquire() - try: - self._queue.put(cb) - self._send(tp, msg) - finally: - self._sendLock.release() - - # Now wait till the answer is in... - condition.acquire() - try: - while not result: - condition.wait() - finally: - condition.release() - - # ...And handle the answer appropriately. - assert len(result) == 1 - tp, msg = result[0] - if tp in expectedTypes: - return tp, msg - elif tp == MSG_TYPE.ERROR: - if len(msg)<2: - raise ProtocolError("(Truncated error message)") - errCode, = struct.unpack("!H", msg[:2]) - raise ErrorReply((errCode, - ERR_CODES.get(errCode,"[unrecognized]"), - msg[2:])) - else: - raise ProtocolError("Unexpectd message type 0x%04x"%tp) - - def close(self): - """Shut down this controller connection""" - self._sendLock.acquire() - try: - self._queue.put("CLOSE") - self._s.close() - finally: - self._sendLock.release() - - def authenticate(self, secret=""): - """Send an authenticating secret to Tor. You'll need to call this - method before Tor can start. - """ - self._sendAndRecv(MSG_TYPE.AUTH,secret) - - def get_option(self,name): - """Return the value of the configuration option named 'name'. - """ - if not isinstance(name, str): - name = "".join(["%s\n"%s for s in name]) - tp,body = self._sendAndRecv(MSG_TYPE.GETCONF,name,[MSG_TYPE.CONFVALUE]) - return _parseKV(body) - - def set_option(self,key,value): - """Set the value of the configuration option 'key' to the value 'value'. - """ - self.set_options([key, value]) - - def set_options(self,kvlist): - """Given a list of [(key,value)] pairs, set them as configuration - options. - """ - msg = "".join(["%s %s\n" for k,v in kvlist]) - self._sendAndRecv(MSG_TYPE.SETCONF,msg) - - def get_info(self,name): - """Return the value of the internal information field named 'named'. - """ - if not isinstance(name, str): - name = "".join(["%s\n"%s for s in name]) - tp, body = self._sendAndRecv(MSG_TYPE.GETINFO,name,[MSG_TYPE.INFOVALUE]) - kvs = body.split("\0") - d = {} - for i in xrange(0,len(kvs)-1,2): - d[kvs[i]] = kvs[i+1] - return d - - def set_events(self,events): - """Change the list of events that the event handler is interested - in to those in 'events', which is a list of EVENT_TYPE members. - """ - self._sendAndRecv(MSG_TYPE.SETEVENTS, - "".join([struct.pack("!H", event) for event in events])) - - def save_conf(self): - """Flush all configuration changes to disk. - """ - self._sendAndRecv(s,MSG_TYPE.SAVECONF) - - def send_signal(self, sig): - """Send the signal 'sig' to the Tor process; 'sig' must be a member of - SIGNAL. - """ - self._sendAndRecv(MSG_TYPE.SIGNAL,struct.pack("B",sig)) - - def map_address(self, kvList): - """Given a list of (old-address,new-address), have Tor redirect - streams from old-address to new-address. Old-address can be in a - special "dont-care" form of "0.0.0.0" or ".". - """ - msg = [ "%s %s\n"%(k,v) for k,v in kvList ] - tp, body = self._sendAndRecv(MSG_TYPE.MAPADDRESS,"".join(msg)) - return _parseKV(body) - - def extend_circuit(self, circid, hops): - """Tell Tor to extend the circuit identified by 'circid' through the - servers named in the list "hops". - """ - msg = struct.pack("!L",circid) + ",".join(hops) + "\0" - tp, body = self._sendAndRecv(MSG_TYPE.EXTENDCIRCUIT,msg) - if len(body) != 4: - raise ProtocolError("Extendcircuit reply too short or long") - return struct.unpack("!L",body)[0] - - def redirect_stream(self, streamid, newtarget): - """Tell Tor to change the target address of the stream identified by - 'streamid' from its old value to 'newtarget'.""" - msg = struct.pack("!L",streamid) + newtarget + "\0" - self._sendAndRecv(MSG_TYPE.REDIRECTSTREAM,msg) - - def attach_stream(self, streamid, circid): - """Tell Tor To attach stream 'streamid' to circuit 'circid'.""" - msg = struct.pack("!LL",streamid, circid) - self._sendAndRecv(MSG_TYPE.ATTACHSTREAM,msg) - - def close_stream(self, streamid, reason=0, flags=0): - """Close the stream 'streamid'. """ - msg = struct.pack("!LBB",streamid,reason,flags) - self._sendAndRecv(MSG_TYPE.CLOSESTREAM,msg) - - def close_circuit(self, circid, flags=0): - """Close the circuit 'circid'.""" - msg = struct.pack("!LB",circid,flags) - self._sendAndRecv(MSG_TYPE.CLOSECIRCUIT,msg) - - def post_descriptor(self, descriptor): - """Tell Tor about a new descriptor in 'descriptor'.""" - self._sendAndRecv(MSG_TYPE.POSTDESCRIPTOR,descriptor) - class EventHandler: """An 'EventHandler' wraps callbacks for the events Tor can return.""" def __init__(self): """Create a new EventHandler.""" - self._map = { + from TorCtl0 import EVENT_TYPE + self._map0 = { EVENT_TYPE.CIRCSTATUS : self.circStatus, EVENT_TYPE.STREAMSTATUS : self.streamStatus, EVENT_TYPE.ORCONNSTATUS : self.orConnStatus, - EVENT_TYPE.BANDWIDTH : self.circStatus, + EVENT_TYPE.BANDWIDTH : self.bandwidth, EVENT_TYPE.NEWDESC : self.newDesc, EVENT_TYPE.INFO_MSG : self.msg, EVENT_TYPE.NOTICE_MSG : self.msg, EVENT_TYPE.WARN_MSG : self.msg, EVENT_TYPE.ERR_MSG : self.msg, } + self._map1 = { + "CIRC" : self.circStatus, + "STREAM" : self.streamStatus, + "ORCONN" : self.orConnStatus, + "BW" : self.bandwidth, + "DEBUG" : self.msg, + "INFO" : self.msg, + "NOTICE" : self.msg, + "WARN" : self.msg, + "ERR" : self.msg, + "NEWDESC" : self.newDesc, + "ADDRMAP" : self.addressMapped + }, - def handle(self, evbody): + def handle0(self, evbody): """Dispatcher: called from Connection when an event is received.""" - evtype, args = self.decode(evbody) - self._map.get(evtype, self.unknownEvent)(evtype, *args) + evtype, args = self.decode0(evbody) + self._map0.get(evtype, self.unknownEvent)(evtype, *args) - def decode(self, body): + def decode0(self, body): """Unpack an event message into a type/arguments-tuple tuple.""" if len(body)<2: raise ProtocolError("EVENT body too short.") @@ -568,6 +97,66 @@ return evtype, args + def handle1(self, evbody): + """Dispatcher: called from Connection when an event is received.""" + evtype, args = self.decode1(evbody) + self._map1.get(evtype, self.unknownEvent)(evtype, *args) + + def decode1(self, body): + """Unpack an event message into a type/arguments-tuple tuple.""" + if " " in body: + evtype,body = body.split(" ",1) + else: + evtype,body = body,"" + evtype = evtype.upper() + if evtype == "CIRC": + m = re.match(r"(\S+)\s+(\S+)(\s\S+)?", body) + if not m: + raise ProtocolError("CIRC event misformatted.") + status,ident,path = m.groups() + if path: + path = path.strip().split(",") + else: + path = [] + args = status, ident, path + elif evtype == "STREAM": + m = re.match(r"(\S+)\s+(\S+)\s+(\S+)\s+(\S+)", body) + if not m: + raise ProtocolError("STREAM event misformatted.") + ident,status,circ,target = m.groups() + args = status, ident, target, circ + elif evtype == "ORCONN": + m = re.match(r"(\S+)\s+(\S+)", body) + if not m: + raise ProtocolError("ORCONN event misformatted.") + target, status = m.groups() + args = status, target + elif evtype == "BW": + m = re.match(r"(\d+)\s+(\d+)", body) + if not m: + raise ProtocolError("BANDWIDTH event misformatted.") + read, written = map(long, m.groups()) + args = read, written + elif evtype in ("DEBUG", "INFO", "NOTICE", "WARN", "ERR"): + args = evtype, body + elif evtype == "NEWDESC": + args = ((" ".split(body)),) + elif evtype == "ADDRMAP": + m = re.match(r'(\S+)\s+(\S+)\s+(\"[^"]+\"|\w+)') + if not m: + raise ProtocolError("BANDWIDTH event misformatted.") + fromaddr, toaddr, when = m.groups() + if when.upper() == "NEVER": + when = None + else: + when = time.localtime( + time.strptime(when[1:-1], "%Y-%m-%d %H:%M:%S")) + args = fromaddr, toaddr, when + else: + args = (body,) + + return evtype, args + def circStatus(self, status, circID, path): """Called when a circuit status changes if listening to CIRCSTATUS events. 'status' is a member of CIRC_STATUS; circID is a numeric @@ -576,7 +165,7 @@ """ raise NotImplemented - def streamStatus(self, status, circID, target): + def streamStatus(self, status, circID, target, circID="0"): """Called when a stream status changes if listening to STREAMSTATUS events. 'status' is a member of STREAM_STATUS; streamID is a numeric stream ID, and 'target' is the destination of the stream. @@ -607,16 +196,30 @@ to INFO_MSG, NOTICE_MSG, WARN_MSG, or ERR_MSG events.""" raise NotImplemented -class DebugEventHandler(EventHandler): - """Trivial event handler: dumps all events to stdout.""" - def __init__(self, out=None): - if out is None: - out = sys.stdout - self._out = out + def addressMapped(self, fromAddr, toAddr, expiry=None): + """DOCDOC""" + raise NotImplemented - def handle(self, body): - evtype, args = self.decode(body) - print >>self._out,EVENT_TYPE.nameOf[evtype],args +def parseHostAndPort(h): + """Given a string of the form 'address:port' or 'address' or + 'port' or '', return a two-tuple of (address, port) + """ + host, port = "localhost", 9100 + if ":" in h: + i = h.index(":") + host = h[:i] + try: + port = int(h[i+1:]) + except ValueError: + print "Bad hostname %r"%h + sys.exit(1) + elif h: + try: + port = int(h) + except ValueError: + host = h + + return host, port def secret_to_key(secret, s2k_specifier): c = ord(s2k_specifier[8]) --- NEW FILE: TorCtl0.py --- #!/usr/bin/python # TorCtl.py -- Python module to interface with Tor Control interface. # Copyright 2005 Nick Mathewson -- See LICENSE for licensing information. #$Id: TorCtl0.py,v 1.1 2005/06/19 22:38:31 nickm Exp $ """ TorCtl0 -- Library to control Tor processes. See TorCtlDemo.py for example use. """ import binascii import os import sha import socket import struct import sys import threading import Queue __all__ = [ "MSG_TYPE", "EVENT_TYPE", "CIRC_STATUS", "STREAM_STATUS", "OR_CONN_STATUS", "SIGNAL", "ERR_CODES", "TorCtlError", "ProtocolError", "ErrorReply", "Connection", "EventHandler", "DebugEventHandler", "parseHostAndPort" ] class _Enum: # Helper: define an ordered dense name-to-number 1-1 mapping. def __init__(self, start, names): self.nameOf = {} idx = start for name in names: setattr(self,name,idx) self.nameOf[idx] = name idx += 1 class _Enum2: # Helper: define an ordered sparse name-to-number 1-1 mapping. def __init__(self, **args): self.__dict__.update(args) self.nameOf = {} for k,v in args.items(): self.nameOf[v] = k # Message types that client or server can send. MSG_TYPE = _Enum(0x0000, ["ERROR", "DONE", "SETCONF", "GETCONF", "CONFVALUE", "SETEVENTS", "EVENT", "AUTH", "SAVECONF", "SIGNAL", "MAPADDRESS", "GETINFO", "INFOVALUE", "EXTENDCIRCUIT", "ATTACHSTREAM", "POSTDESCRIPTOR", "FRAGMENTHEADER", "FRAGMENT", "REDIRECTSTREAM", "CLOSESTREAM", "CLOSECIRCUIT", ]) # Make sure that the enumeration code is working. assert MSG_TYPE.SAVECONF == 0x0008 assert MSG_TYPE.CLOSECIRCUIT == 0x0014 # Types of "EVENT" message. EVENT_TYPE = _Enum(0x0001, ["CIRCSTATUS", "STREAMSTATUS", "ORCONNSTATUS", "BANDWIDTH", "OBSOLETE_LOG", "NEWDESC", "DEBUG_MSG", "INFO_MSG", "NOTICE_MSG", "WARN_MSG", "ERR_MSG", ]) assert EVENT_TYPE.ERR_MSG == 0x000B assert EVENT_TYPE.OBSOLETE_LOG == 0x0005 # Status codes for "CIRCSTATUS" events. CIRC_STATUS = _Enum(0x00, ["LAUNCHED", "BUILT", "EXTENDED", "FAILED", "CLOSED"]) # Status codes for "STREAMSTATUS" events STREAM_STATUS = _Enum(0x00, ["SENT_CONNECT", "SENT_RESOLVE", "SUCCEEDED", "FAILED", "CLOSED", "NEW_CONNECT", "NEW_RESOLVE", "DETACHED"]) # Status codes for "ORCONNSTATUS" events OR_CONN_STATUS = _Enum(0x00, ["LAUNCHED","CONNECTED","FAILED","CLOSED"]) # Signal codes for "SIGNAL" events. SIGNAL = _Enum2(HUP=0x01,INT=0x02,USR1=0x0A,USR2=0x0C,TERM=0x0F) # Error codes for "ERROR" events. ERR_CODES = { 0x0000 : "Unspecified error", 0x0001 : "Internal error", 0x0002 : "Unrecognized message type", 0x0003 : "Syntax error", 0x0004 : "Unrecognized configuration key", 0x0005 : "Invalid configuration value", 0x0006 : "Unrecognized byte code", 0x0007 : "Unauthorized", 0x0008 : "Failed authentication attempt", 0x0009 : "Resource exhausted", 0x000A : "No such stream", 0x000B : "No such circuit", 0x000C : "No such OR" } def _unpack_singleton_msg(msg): """Helper: unpack a single packet. Return (None, minLength, body-so-far) on incomplete packet or (type,body,rest) on somplete packet """ if len(msg) < 4: return None, 4, msg length,type = struct.unpack("!HH",msg) if len(msg) >= 4+length: return type,msg[4:4+length],msg[4+length:] else: return None,4+length,msg def _minLengthToPack(bytes): """Return the minimum number of bytes needed to pack the message 'smg'""" whole,left = divmod(bytes,65535) if left: return whole*(65535+4)+4+left else: return whole*(65535+4) def _unpack_msg(msg): "returns as for _unpack_singleton_msg" tp,body,rest = _unpack_singleton_msg(msg) if tp != MSG_TYPE.FRAGMENTHEADER: return tp, body, rest if len(body) < 6: raise ProtocolError("FRAGMENTHEADER message too short") realType,realLength = struct.unpack("!HL", body[:6]) # Okay; could the message _possibly_ be here? minLength = _minLengthToPack(realLength+6) if len(msg) < minLength: return None, minLength, msg # Okay; optimistically try to build up the msg. soFar = [ body[6:] ] lenSoFarLen = len(body)-6 while len(rest)>=4 and lenSoFar < realLength: ln, tp = struct.unpack("!HH", rest[:4]) if tp != MSG_TYPE.FRAGMENT: raise ProtocolError("Missing FRAGMENT message") soFar.append(rest[4:4+ln]) lenSoFar += ln if 4+ln > len(rest): rest = "" leftInPacket = 4+ln-len(rest) else: rest = rest[4+ln:] leftInPacket=0 if lenSoFar == realLength: return realType, "".join(soFar), rest elif lenSoFar > realLength: raise ProtocolError("Bad fragmentation: message longer than declared") else: inOtherPackets = realLength-lenSoFar-leftInPacket minLength = _minLengthToPack(inOtherPackets) return None, len(msg)+leftInPacket+inOtherPackets, msg def _receive_singleton_msg(s): """Read a single packet from the socket s. """ body = "" header = s.recv(4) length,type = struct.unpack("!HH",header) if length: while length > len(body): body += s.recv(length-len(body)) return length,type,body def _receive_message(s): """Read a single message (possibly multi-packet) from the socket s.""" length, tp, body = _receive_singleton_msg(s) if tp != MSG_TYPE.FRAGMENTHEADER: return length, tp, body if length < 6: raise ProtocolError("FRAGMENTHEADER message too short") realType,realLength = struct.unpack("!HL", body[:6]) data = [ body[6:] ] soFar = len(data[0]) while 1: length, tp, body = _receive_singleton_msg(s) if tp != MSG_TYPE.FRAGMENT: raise ProtocolError("Missing FRAGMENT message") soFar += length data.append(body) if soFar == realLength: return realLength, realType, "".join(data) elif soFar > realLength: raise ProtocolError("FRAGMENT message too long!") def pack_message(type, body=""): """Given a message type and optional message body, generate a set of packets to send. """ length = len(body) if length < 65536: reqheader = struct.pack("!HH", length, type) return "%s%s"%(reqheader,body) fragheader = struct.pack("!HHHL", 65535, MSG_TYPE.FRAGMENTHEADER, type, length) msgs = [ fragheader, body[:65535-6] ] body = body[65535-6:] while body: if len(body) > 65535: fl = 65535 else: fl = len(body) fragheader = struct.pack("!HH", MSG_TYPE.FRAGMENT, fl) msgs.append(fragheader) msgs.append(body[:fl]) body = body[fl:] return "".join(msgs) def _parseKV(body,sep=" ",term="\n"): """Helper: parse a key/value list of the form [key sep value term]* . Return a list of (k,v).""" res = [] for line in body.split(term): if not line: continue k, v = line.split(sep,1) res.append((k,v)) return res def _unterminate(s): """Strip trailing NUL characters from s.""" if s[-1] == '\0': return s[:-1] else: return s class Connection: """A Connection represents a connection to the Tor process.""" def __init__(self, sock): """Create a Connection to communicate with the Tor process over the socket 'sock'. """ self._s = sock self._handler = None self._sendLock = threading.RLock() self._queue = Queue.Queue() self._thread = None def setEventHandler(self, handler): """Cause future events from the Tor process to be sent to 'handler'. """ self._handler = handler def launchThread(self, daemon=1): """Launch a background thread to handle messages from the Tor process.""" assert self._thread is None t = threading.Thread(target=self._loop) if daemon: t.setDaemon(daemon) t.start() self._thread = t return t def _send(self, type, body=""): """Helper: Deliver a command of type 'type' and body 'body' to Tor. """ self._s.sendall(pack_message(type, body)) def _loop(self): """Main subthread loop: Read commands from Tor, and handle them either as events or as responses to other commands. """ while 1: try: length, tp, body = _receive_message(self._s) except OSError: if self._queue.get(timeout=0) != "CLOSE": raise if tp == MSG_TYPE.EVENT: if self._handler is not None: self._handler.handle0(body) else: cb = self._queue.get() cb(tp, body) def _sendAndRecv(self, tp, msg="", expectedTypes=(MSG_TYPE.DONE,)): """Helper: Send a command of type 'tp' and body 'msg' to Tor, and wait for a command in response. If the response type is in expectedTypes, return a (tp,body) tuple. If it is an error, raise ErrorReply. Otherwise, raise ProtocolError. """ # This condition will get notified when we've got a result... condition = threading.Condition() # Here's where the result goes... result = [] def cb(tp,body,condition=condition,result=result): condition.acquire() try: result.append((tp, body)) condition.notify() finally: condition.release() # Sends a message to Tor... self._sendLock.acquire() try: self._queue.put(cb) self._send(tp, msg) finally: self._sendLock.release() # Now wait till the answer is in... condition.acquire() try: while not result: condition.wait() finally: condition.release() # ...And handle the answer appropriately. assert len(result) == 1 tp, msg = result[0] if tp in expectedTypes: return tp, msg elif tp == MSG_TYPE.ERROR: if len(msg)<2: raise ProtocolError("(Truncated error message)") errCode, = struct.unpack("!H", msg[:2]) raise ErrorReply((errCode, ERR_CODES.get(errCode,"[unrecognized]"), msg[2:])) else: raise ProtocolError("Unexpectd message type 0x%04x"%tp) def close(self): """Shut down this controller connection""" self._sendLock.acquire() try: self._queue.put("CLOSE") self._s.close() finally: self._sendLock.release() def authenticate(self, secret=""): """Send an authenticating secret to Tor. You'll need to call this method before Tor can start. """ self._sendAndRecv(MSG_TYPE.AUTH,secret) def get_option(self,name): """Return the value of the configuration option named 'name'. """ if not isinstance(name, str): name = "".join(["%s\n"%s for s in name]) tp,body = self._sendAndRecv(MSG_TYPE.GETCONF,name,[MSG_TYPE.CONFVALUE]) return _parseKV(body) def set_option(self,key,value): """Set the value of the configuration option 'key' to the value 'value'. """ self.set_options([key, value]) def set_options(self,kvlist): """Given a list of (key,value) pairs, set them as configuration options. """ msg = "".join(["%s %s\n" for k,v in kvlist]) self._sendAndRecv(MSG_TYPE.SETCONF,msg) def get_info(self,name): """Return the value of the internal information field named 'named'. """ if not isinstance(name, str): name = "".join(["%s\n"%s for s in name]) tp, body = self._sendAndRecv(MSG_TYPE.GETINFO,name,[MSG_TYPE.INFOVALUE]) kvs = body.split("\0") d = {} for i in xrange(0,len(kvs)-1,2): d[kvs[i]] = kvs[i+1] return d def set_events(self,events): """Change the list of events that the event handler is interested in to those in 'events', which is a list of EVENT_TYPE members or corresponding strings. """ self._sendAndRecv(MSG_TYPE.SETEVENTS, "".join([struct.pack("!H", event) for event in events])) def save_conf(self): """Flush all configuration changes to disk. """ self._sendAndRecv(MSG_TYPE.SAVECONF) def send_signal(self, sig): """Send the signal 'sig' to the Tor process; 'sig' must be a member of SIGNAL. """ self._sendAndRecv(MSG_TYPE.SIGNAL,struct.pack("B",sig)) def map_address(self, kvList): """Given a list of (old-address,new-address), have Tor redirect streams from old-address to new-address. Old-address can be in a special "dont-care" form of "0.0.0.0" or ".". """ msg = [ "%s %s\n"%(k,v) for k,v in kvList ] tp, body = self._sendAndRecv(MSG_TYPE.MAPADDRESS,"".join(msg)) return _parseKV(body) def extend_circuit(self, circid, hops): """Tell Tor to extend the circuit identified by 'circid' through the servers named in the list "hops". """ msg = struct.pack("!L",circid) + ",".join(hops) + "\0" tp, body = self._sendAndRecv(MSG_TYPE.EXTENDCIRCUIT,msg) if len(body) != 4: raise ProtocolError("Extendcircuit reply too short or long") return struct.unpack("!L",body)[0] def redirect_stream(self, streamid, newtarget): """Tell Tor to change the target address of the stream identified by 'streamid' from its old value to 'newtarget'.""" msg = struct.pack("!L",streamid) + newtarget + "\0" self._sendAndRecv(MSG_TYPE.REDIRECTSTREAM,msg) def attach_stream(self, streamid, circid): """Tell Tor To attach stream 'streamid' to circuit 'circid'.""" msg = struct.pack("!LL",streamid, circid) self._sendAndRecv(MSG_TYPE.ATTACHSTREAM,msg) def close_stream(self, streamid, reason=0, flags=()): """Close the stream 'streamid'. """ msg = struct.pack("!LBB",streamid,reason,flags) self._sendAndRecv(MSG_TYPE.CLOSESTREAM,msg) def close_circuit(self, circid, flags=()): """Close the circuit 'circid'.""" if "IFUNUSED" in flags: flags=1 else: flags=0 msg = struct.pack("!LB",circid,flags) self._sendAndRecv(MSG_TYPE.CLOSECIRCUIT,msg) def post_descriptor(self, descriptor): """Tell Tor about a new descriptor in 'descriptor'.""" self._sendAndRecv(MSG_TYPE.POSTDESCRIPTOR,descriptor) class DebugEventHandler(EventHandler): """Trivial event handler: dumps all events to stdout.""" def __init__(self, out=None): if out is None: out = sys.stdout self._out = out def handle(self, body): evtype, args = self.decode(body) print >>self._out,EVENT_TYPE.nameOf[evtype],args --- NEW FILE: TorCtl1.py --- #!/usr/bin/python # TorCtl.py -- Python module to interface with Tor Control interface. # Copyright 2005 Nick Mathewson -- See LICENSE for licensing information. #$Id: TorCtl1.py,v 1.1 2005/06/19 22:38:31 nickm Exp $ import binascii import os import re import socket import sys import threading import types import Queue def _quote(s): return re.sub(r'([\r\n\\\"])', r'\\\1', s) def _escape_dots(s, translate_nl=1): if translate_ln: lines = re.split(r"\r?\n", s) else: lines = s.split("\r\n") if lines and not lines[-1]: del lines[-1] for i in xrange(len(lines)): if lines[i].startswith("."): lines[i] = "."+lines[i] lines.append(".\r\n") return "\r\n".join(lines) def _unescape_dots(s, translate_nl=1): lines = s.split("\r\n") for i in xrange(len(lines)): if lines[i].startswith("."): lines[i] = lines[i][1:] if lines and lines[-1]: lines.append("") if translate_nl: return "\n".join(lines) else: return "\r\n".join(lines) def _parseKV(body,sep=" ",term="\n"): """Helper: parse a key/value list of the form [key sep value term]* . Return a list of (k,v).""" res = [] for line in body.split(term): if not line: continue k, v = line.split(sep,1) res.append((k,v)) return res def _read_reply(f,debugFile=None): lines = [] while 1: line = f.readline().strip() if debugFile: debugFile.write(" %s\n" % line) if len(line)<4: raise ProtocolError("Badly formatted reply line: Too short") code = line[:3] tp = line[3] s = line[3:] if s == "-": lines.append((tp, s, None)) elif s == " ": lines.append((tp, s, None)) return lines elif s != "+": raise ProtocolError("Badly formatted reply line: unknown type %r", s) else: more = [] while 1: line = f.readline() if debugFile: debugFile.write(" %s" % line) if line in (".\r\n", ".\n"): break more.append(line) lines.append((tp, s, _unescape_dots("".join(more))) class Connection: """A Connection represents a connection to the Tor process.""" def __init__(self, sock, file=None): """Create a Connection to communicate with the Tor process over the socket 'sock'. """ if file: self._s = file else: assert sock self._s = sock.makefile("r+b"); self._debugFile = None self._handler = None self._sendLock = threading.RLock() self._queue = Queue.Queue() self._thread = None def debug(self, f): """DOCDOC""" self._debugFile = f def setEventHandler(self, handler): """Cause future events from the Tor process to be sent to 'handler'. """ self._handler = handler def launchThread(self, daemon=1): """Launch a background thread to handle messages from the Tor process.""" assert self._thread is None t = threading.Thread(target=self._loop) if daemon: t.setDaemon(daemon) t.start() self._thread = t return t def close(self): """Shut down this controller connection""" self._sendLock.acquire() try: self._queue.put("CLOSE") self._s.close() finally: self._sendLock.release() def _loop(self): """Main subthread loop: Read commands from Tor, and handle them either as events or as responses to other commands. """ while 1: try: lines = _read_reply(self._s,self._debugFile) except OSError: if self._queue.get(timeout=0) != "CLOSE": raise assert lines if lines[0][0][0] == "6": if self._handler is not None: self._handler.handle1(body) else: cb = self._queue.get() cb(lines) def _sendAndRecv(self, msg="", expectedTypes=("250",)): """Helper: Send a command 'msg' to Tor, and wait for a command in response. If the response type is in expectedTypes, return a list of (tp,body,extra) tuples. If it is an error, raise ErrorReply. Otherwise, raise ProtocolError. """ # This condition will get notified when we've got a result... condition = threading.Condition() # Here's where the result goes... result = [] def cb(lines,condition=condition,result=result): condition.acquire() try: result.append((lines)) condition.notify() finally: condition.release() if type(msg) == types.ListType: msg = "".join(msg) assert msg.endswith("\r\n") # Sends a message to Tor... self._sendLock.acquire() try: self._queue.put(cb) if self._debugFile: self._debugFile.write(">>> %s" % msg) self._s.write(msg) finally: self._sendLock.release() # Now wait till the answer is in... condition.acquire() try: while not result: condition.wait() finally: condition.release() # ...And handle the answer appropriately. assert len(result) == 1 lines = result[0] for tp, msg, _ in lines: if tp[0] in '45': raise ErrorReply("%s %s"%(tp, msg)) if tp not in expectedTypes: raise ProtocolError("Unexpectd message type %r"%tp) return lines def authenticate(self, secret=""): """Send an authenticating secret to Tor. You'll need to call this method before Tor can start. """ hexstr = binascii.b2a_hex(MSG_TYPE.AUTH,secret) self._sendAndRecv("AUTHENTICATE %s\r\n"%hexstr) def get_option(self, name): """Return the value of the configuration option named 'name'. DOCDOC """ if not isinstance(name, str): name = " ".join(name) lines = self._sendAndRecv("GETCONF %s\r\n" % name) for _,line,_ in lines: try: key, val = line.split("=", 1) r.append((key,val)) except ValueError: r.append((line, None)) return r def set_option(self, key, value): """Set the value of the configuration option 'key' to the value 'value'. """ self.set_options([key, value]) def set_options(self, kvlist): """Given a list of (key,value) pairs, set them as configuration options. """ if not kvlist: return msg = " ".join(["%s=%s"%(k,_quote(v)) for k,v in kvlist]) self._sendAndRecv("SETCONF %s\r\n"%msg) def get_info(self, name): """Return the value of the internal information field named 'named'. DOCDOC """ if not isinstance(name, str): name = " ".join(name) lines = self._sendAndRecv("GETINFO %s\r\n"%name) d = {} for _,msg,more in lines: if msg == "OK": break try: k,rest = msg.split("=",1) except ValueError: raise ProtocolError("Bad info line %r",msg) if more: d[k] = more else: d[k] = rest return d def set_events(self, events): """Change the list of events that the event handler is interested in to those in 'events', which is a list of event names. Recognized event names are listed in section 3.3 of the control-spec """ evs = [] # Translate options supported by old interface. for e in events: if e == 0x0001 or e == "CIRCSTATUS": e = "CIRC" elif e == 0x0002 or e == "STREAMSTATUS": e = "STREAM" elif e == 0x0003 or e == "ORCONNSTATUS": e = "ORCONN" elif e == 0x0004 or e == "BANDWIDTH": e = "BW" elif e == 0x0005 or e == "OBSOLETE_LOG": coneinue elif e == 0x0006 or e == "NEWDESC": e = "NEWDESC" elif e == 0x0007 or e == "DEBUG_MSG": continue elif e == 0x0008 or e == "INFO_MSG": e = "INFO" elif e == 0x0008 or e == "NOTICE_MSG": e = "NOTICE" elif e == 0x0008 or e == "WARN_MSG": e = "WARN" elif e == 0x0008 or e == "ERR_MSG": e = "ERR" evs.append(e) self._sendAndRecv("SETEVENTS %s"\r\n," ".join(evs)) def save_conf(self): """Flush all configuration changes to disk. """ self._sendAndRecv("SAVECONF\r\n") def send_signal(self, sig): """Send the signal 'sig' to the Tor process; The allowed values for 'sig' are listed in section 3.6 of control-spec. """ sig = { 0x01 : "HUP", 0x02 : "INT", 0x0A : "USR1", 0x0C : "USR2", 0x0F : "TERM" }.get(sig,sig) seld._sendAndRecv("SIGNAL %s\r\n"%sig) def map_address(self, kvList): if not kvList: return m = " ".join([ "%s=%s" for k,v in kvList]) lines = self._sendAndRecv("MAPADDRESS %s\r\n"%m) r = [] for _,line,_ in lines: try: key, val = line.split("=", 1) except ValueError: raise ProtocolError("Bad address line %r",v) r.append((key,val)) return r def extend_circuit(self, circid, hops): """Tell Tor to extend the circuit identified by 'circid' through the servers named in the list 'hops'. """ if circid is None: circid = "0" lines = self._sendAndRecv("EXTENDCIRCUIT %s %s\r\n" %(circid, ",".join(hops))) tp,msg,_ = lines[0] m = re.match(r'EXTENDED (\S*)', msg) if not m: raise ProtocolError("Bad extended line %r",msg) return m.group(1) def redirect_stream(self, streamid, newtarget): """DOCDOC""" self._sendAndRecv("REDIRECTSTREAM %s %s\r\n"%(streamid, newtarget)) def attach_stream(self, streamid, circid): """DOCDOC""" self._sendAndRecv("REDIRECTSTREAM %s %s\r\n"%(streamid, circid)) def close_stream(self, streamid, reason=0, flags=()): """DOCDOC""" self._sendAndRecv("CLOSESTREAM %s %s %s\r\n" %(streamid, reason, "".join(flags))) def close_circuit(self, circid, reason=0, flags=()): """DOCDOC""" self._sendAndRecv("CLOSECIRCUIT %s %s %s\r\n" %(circid, reason, "".join(flags))) def post_descriptor(self, desc): self._sendAndRecv("+POSTDESCRIPTOR\r\n%s"%_escape_dots(desc)) From nickm at seul.org Mon Jun 6 20:10:04 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 6 Jun 2005 16:10:04 -0400 (EDT) Subject: [or-cvs] Backport bugfix for 151 and other windows fix. Message-ID: <20050606201004.2A2FA1408257@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv13830/src/common Modified Files: Tag: tor-0_1_0-patches crypto.c Log Message: Backport bugfix for 151 and other windows fix. Index: crypto.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v retrieving revision 1.137 retrieving revision 1.137.2.1 diff -u -d -r1.137 -r1.137.2.1 --- crypto.c 7 May 2005 05:55:05 -0000 1.137 +++ crypto.c 6 Jun 2005 20:10:02 -0000 1.137.2.1 @@ -1425,25 +1425,19 @@ char buf[DIGEST_LEN+1]; if (!provider_set) { - if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET)) { + if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { if (GetLastError() != NTE_BAD_KEYSET) { log_fn(LOG_ERR,"Can't get CryptoAPI provider [1]"); return -1; } - /* Yes, we need to try it twice. */ - if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, - CRYPT_MACHINE_KEYSET | CRYPT_NEWKEYSET)) { - log_fn(LOG_ERR,"Can't get CryptoAPI provider [2], error code: %x", GetLastError()); - return -1; - } } provider_set = 1; } - if (!CryptGenRandom(provider, DIGEST_LEN, buf)) { + if (!CryptGenRandom(provider, sizeof(buf), buf)) { log_fn(LOG_ERR,"Can't get entropy from CryptoAPI."); return -1; } - RAND_seed(buf, DIGEST_LEN); + RAND_seed(buf, sizeof(buf)); /* And add the current screen state to the entropy pool for * good measure. */ RAND_screen(); @@ -1460,13 +1454,13 @@ fd = open(filenames[i], O_RDONLY, 0); if (fd<0) continue; log_fn(LOG_INFO, "Seeding RNG from %s", filenames[i]); - n = read(fd, buf, DIGEST_LEN); + n = read_all(fd, buf, sizeof(buf), 0); close(fd); - if (n != DIGEST_LEN) { + if (n != sizeof(buf)) { log_fn(LOG_WARN, "Error reading from entropy source"); return -1; } - RAND_seed(buf, DIGEST_LEN); + RAND_seed(buf, sizeof(buf)); return 0; } From nickm at seul.org Sun Jun 19 22:38:38 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 19 Jun 2005 18:38:38 -0400 (EDT) Subject: [or-cvs] Add feature to handle unset (default) configuration options... Message-ID: <20050619223838.1891A140811E@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv9501/src/or Modified Files: control.c Log Message: Add feature to handle unset (default) configuration options in GETCONF control messages Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- control.c 19 Jun 2005 20:40:41 -0000 1.94 +++ control.c 19 Jun 2005 22:38:36 -0000 1.95 @@ -693,7 +693,12 @@ } } else { struct config_line_t *answer = config_get_assigned_option(options,q); - /* XXXX handle non-set options in V1 at least*/ + if (!v0 && !answer) { + size_t alen = strlen(q)+8; + char *astr = tor_malloc(alen); + tor_snprintf(astr, alen, "250-%s\r\n", q); + smartlist_add(answers, astr); + } while (answer) { struct config_line_t *next; From nickm at seul.org Sun Jun 19 22:38:38 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 19 Jun 2005 18:38:38 -0400 (EDT) Subject: [or-cvs] Add feature to handle unset (default) configuration options... Message-ID: <20050619223838.2D98014081C0@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/tmp/cvs-serv9501/contrib Modified Files: TorControl.py Log Message: Add feature to handle unset (default) configuration options in GETCONF control messages Index: TorControl.py =================================================================== RCS file: /home/or/cvsroot/tor/contrib/TorControl.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- TorControl.py 14 May 2005 00:39:34 -0000 1.10 +++ TorControl.py 19 Jun 2005 22:38:36 -0000 1.11 @@ -433,7 +433,7 @@ (".", "abacinator.onion")])` print `extend_circuit(s,0,["moria1"])` print '========' - print `extend_circuit(s,0,[""])` + #print `extend_circuit(s,0,[""])` print '========' #send_signal(s,1) #save_conf(s) From nickm at seul.org Sun Jun 19 22:39:16 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 19 Jun 2005 18:39:16 -0400 (EDT) Subject: [or-cvs] update TODO Message-ID: <20050619223916.B9BDB14080B4@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv9760/doc Modified Files: TODO Log Message: update TODO Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.325 retrieving revision 1.326 diff -u -d -r1.325 -r1.326 --- TODO 19 Jun 2005 20:40:41 -0000 1.325 +++ TODO 19 Jun 2005 22:39:14 -0000 1.326 @@ -66,7 +66,12 @@ immediately, since tor will exit right after. o Implement - Test, debug - - Switch example controllers to use new protocol + . Switch example controllers to use new protocol + . Python + o Implement main controller interface + - Glue code + - Testing + - Java - switch accountingmax to count total in+out, not either in or out. it's easy to move in this direction (not risky), but hard to back, out if we decide we prefer it the way it already is. hm. From nickm at seul.org Sun Jun 19 23:22:36 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 19 Jun 2005 19:22:36 -0400 (EDT) Subject: [or-cvs] note GETCONF default feature in spec Message-ID: <20050619232236.CC61314080BD@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv11588/doc Modified Files: control-spec.txt Log Message: note GETCONF default feature in spec Index: control-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/control-spec.txt,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- control-spec.txt 19 Jun 2005 20:40:41 -0000 1.41 +++ control-spec.txt 19 Jun 2005 23:22:34 -0000 1.42 @@ -138,6 +138,9 @@ If all of the listed keywords exist in the Tor configuration, Tor replies with a series of reply lines of the form: 250 keyword=value + If any option is set to a 'default' value semantically different from an + empty string, Tor may reply with a reply line of the form: + 250 keyword If some of the listed keywords can't be found, Tor replies with a "552 unknown configuration keyword" message. @@ -520,6 +523,15 @@ S: 650 CIRC 1000 EXTENDED moria1,moria2 S: 250 ORPORT=0 + Clients SHOULD tolerate more arguments in an asynchonous reply than + expected, and SHOULD tolerate more lines in an asynchronous reply than + expected. For instance, a client that expects a CIRC message like: + 650 CIRC 1000 EXTENDED moria1,moria2 + should tolerate: + 650+CIRC 1000 EXTENDED moria1,moria2 0xBEEF + 650-EXTRAMAGIC=99 + 650 ANONYMITY=high + 4.1.1 Circuit status changed The syntax is: From nickm at seul.org Mon Jun 20 00:08:49 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 19 Jun 2005 20:08:49 -0400 (EDT) Subject: [or-cvs] Come up with a rendezvous INTRODUCE1 format that actually w... Message-ID: <20050620000849.62117140808A@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv12742/doc Modified Files: rend-spec.txt Log Message: Come up with a rendezvous INTRODUCE1 format that actually works for unknown rendezvous points. This will take some doing to implement Index: rend-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/rend-spec.txt,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- rend-spec.txt 18 Jan 2005 00:10:00 -0000 1.25 +++ rend-spec.txt 20 Jun 2005 00:08:47 -0000 1.26 @@ -251,9 +251,17 @@ RP Rendezvous point's nickname [20 octets] RC Rendezvous cookie [20 octets] g^x Diffie-Hellman data, part 1 [128 octets] - OR + OR VER Version byte: set to 1. [1 octet] - RP [42 octets] + RP Rendezvous point nick or ID [42 octets] + RC Rendezvous cookie [20 octets] + g^x Diffie-Hellman data, part 1 [128 octets] + OR + VER Version byte: set to 2. [1 octet] + IP Rendezvous point's address [4 octets] + PORT Rendezvous point's OR port [2 octets] + ID Rendezvous point identity ID [20 octets] + KEY Rendezvous point onion key [128 octets] RC Rendezvous cookie [20 octets] g^x Diffie-Hellman data, part 1 [128 octets] @@ -261,13 +269,14 @@ and must contain EITHER a nickname, or an identity key digest, encoded in hex, and prefixed with a '$'. - Implementations must accept both variants, but should only generate the - first so long as Tor 0.0.7 is in use. + Implementations must accept all variants, but should only generate the + first so long as any version of Tor before 0.1.1 is still in use. + Implementations should never generate the second version. The hybrid encryption to Bob's PK works just like the hybrid encryption in CREATE cells (see main spec). Thus the payload of the RELAY_INTRODUCE1 cell on the wire will contain 20+42+16+20+20+128=246 - bytes. + bytes. [XXXX not really] 1.9. Introduction: From the Introduction Point to Bob's OP From nickm at seul.org Mon Jun 20 00:10:33 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 19 Jun 2005 20:10:33 -0400 (EDT) Subject: [or-cvs] Be more clear about fixing unknown rendezvous points. (ow) Message-ID: <20050620001033.BB4F3140808A@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv12908/doc Modified Files: TODO Log Message: Be more clear about fixing unknown rendezvous points. (ow) Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.326 retrieving revision 1.327 diff -u -d -r1.326 -r1.327 --- TODO 19 Jun 2005 22:39:14 -0000 1.326 +++ TODO 20 Jun 2005 00:10:31 -0000 1.327 @@ -66,6 +66,7 @@ immediately, since tor will exit right after. o Implement - Test, debug + - Allow EXTENDCIRCUIT to unknown server. . Switch example controllers to use new protocol . Python o Implement main controller interface @@ -81,12 +82,13 @@ first place.) Also, we should audit all users of get_pending_bytes().) - Make it harder to circumvent bandwidth caps: look at number of bytes sent across sockets, not number sent inside TLS stream. - - Handle rendezvousing with unverified nodes. - - Specify: Stick rendezvous point's key in INTRODUCE cell. - Bob should _always_ use key from INTRODUCE cell. - - Change to new rendezvous introduction cell format. (It's currently #if - 0'd out). Unless we already did that. - - Implement. +N - Handle rendezvousing with unverified nodes. + o Specify: Stick rendezvous point's address and port in INTRODUCE cell. + - Handle new format. + - Parse and generate new format (#if0 out the logic to generate it.) + - Support to extend circuit/target circuit to a chosen combination of + addr/port/ID/onionkey + - Verify that new code works. - it looks like tor_assert writes to stderr. what happens if stderr was closed and is now something else? uh. - christian grothoff's attack of infinite-length circuit. From nickm at seul.org Mon Jun 20 09:38:31 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 20 Jun 2005 05:38:31 -0400 (EDT) Subject: [or-cvs] Appease verbose GCC warnings. Message-ID: <20050620093831.DA904140805E@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv1269/src/or Modified Files: control.c main.c Log Message: Appease verbose GCC warnings. Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- control.c 19 Jun 2005 22:38:36 -0000 1.95 +++ control.c 20 Jun 2005 09:38:29 -0000 1.96 @@ -1543,6 +1543,8 @@ { char *desc; int v0 = STATE_IS_V0(conn->state); + const char *msg=NULL; + if (v0) desc = (char*)body; else { @@ -1551,7 +1553,6 @@ read_escaped_data(cp, len-(cp-body), 1, &desc); } - const char *msg=NULL; switch (router_load_single_router(desc, &msg)) { case -1: if (!msg) msg = "Could not parse descriptor"; Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.519 retrieving revision 1.520 diff -u -d -r1.519 -r1.520 --- main.c 19 Jun 2005 08:35:46 -0000 1.519 +++ main.c 20 Jun 2005 09:38:29 -0000 1.520 @@ -893,7 +893,7 @@ /** Called when a possibly ignorable libevent error occurs; ensures that we * don't get into an infinite loop by ignoring too many errors from * libevent. */ -int +static int got_libevent_error(void) { if (++n_libevent_errors > 8) { From nickm at seul.org Mon Jun 20 18:56:36 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 20 Jun 2005 14:56:36 -0400 (EDT) Subject: [or-cvs] Load hardware acceleration options when/where available. C... Message-ID: <20050620185636.E8BD71408072@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv22033/doc Modified Files: TODO tor.1.in Log Message: Load hardware acceleration options when/where available. Can anybody test this? Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.327 retrieving revision 1.328 diff -u -d -r1.327 -r1.328 --- TODO 20 Jun 2005 00:10:31 -0000 1.327 +++ TODO 20 Jun 2005 18:56:34 -0000 1.328 @@ -107,7 +107,8 @@ prefix. - cpu fixes: - see if we should make use of truncate to retry - - hardware accelerator support + o hardware accelerator support (configure engines.) + - hardware accelerator support (use instead of aes.c when reasonable) r - kill dns workers more slowly - continue decentralizing the directory - Specify and design all of the below before implementing any. Index: tor.1.in =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor.1.in,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- tor.1.in 11 Jun 2005 12:23:11 -0000 1.90 +++ tor.1.in 20 Jun 2005 18:56:34 -0000 1.91 @@ -154,6 +154,10 @@ .TP \fBUser \fR\fIUID\fP On startup, setuid to this user. +.TP +\fBHardwareAccel \fR\fI0|1\fP +If non-zero, try to use crypto hardware acceleration when +available. (Default: 1. ) .SH CLIENT OPTIONS .PP From nickm at seul.org Mon Jun 20 18:56:37 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 20 Jun 2005 14:56:37 -0400 (EDT) Subject: [or-cvs] Load hardware acceleration options when/where available. C... Message-ID: <20050620185637.232CE140810E@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv22033/src/common Modified Files: crypto.c crypto.h tortls.c Log Message: Load hardware acceleration options when/where available. Can anybody test this? Index: crypto.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v retrieving revision 1.141 retrieving revision 1.142 diff -u -d -r1.141 -r1.142 --- crypto.c 15 Jun 2005 18:34:46 -0000 1.141 +++ crypto.c 20 Jun 2005 18:56:34 -0000 1.142 @@ -22,6 +22,7 @@ #include +#include #include #include #include @@ -159,14 +160,46 @@ } } +static void +log_engine(const char *fn, ENGINE *e) +{ + if (e) { + const char *name, *id; + name = ENGINE_get_name(e); + id = ENGINE_get_id(e); + log(LOG_NOTICE, "Using OpenSSL engine %s [%s] for %s", + name?name:"?", id?id:"?", fn); + } else { + log(LOG_INFO, "Using default implementation for %s", fn); + } +} + /** Initialize the crypto library. Return 0 on success, -1 on failure. */ -int crypto_global_init() +int +crypto_global_init(int useAccel) { if (!_crypto_global_initialized) { - ERR_load_crypto_strings(); - _crypto_global_initialized = 1; - setup_openssl_threading(); + ERR_load_crypto_strings(); + OpenSSL_add_all_algorithms(); + _crypto_global_initialized = 1; + setup_openssl_threading(); + if (useAccel) { + if (useAccel < 0) + log_fn(LOG_WARN, "Initializing OpenSSL via tor_tls_init()."); + log_fn(LOG_INFO, "Initializing OpenSSL engine support."); + ENGINE_load_builtin_engines(); + if (!ENGINE_register_all_complete()) + return -1; + + /* XXXX make sure this isn't leaking. */ + log_engine("RSA", ENGINE_get_default_RSA()); + log_engine("DH", ENGINE_get_default_DH()); + log_engine("RAND", ENGINE_get_default_RAND()); + log_engine("SHA1", ENGINE_get_digest_engine(NID_sha1)); + log_engine("3DES", ENGINE_get_cipher_engine(NID_des_ede3_ecb)); + log_engine("AES", ENGINE_get_cipher_engine(NID_aes_128_ecb)); + } } return 0; } @@ -176,6 +209,7 @@ int crypto_global_cleanup() { ERR_free_strings(); + ENGINE_cleanup(); #ifdef TOR_IS_MULTITHREADED if (_n_openssl_mutexes) { int n = _n_openssl_mutexes; Index: crypto.h =================================================================== RCS file: /home/or/cvsroot/tor/src/common/crypto.h,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- crypto.h 11 Jun 2005 05:31:15 -0000 1.64 +++ crypto.h 20 Jun 2005 18:56:34 -0000 1.65 @@ -48,7 +48,7 @@ typedef struct crypto_dh_env_t crypto_dh_env_t; /* global state */ -int crypto_global_init(void); +int crypto_global_init(int hardwareAccel); int crypto_global_cleanup(void); /* environment setup */ Index: tortls.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/tortls.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- tortls.c 11 Jun 2005 05:31:15 -0000 1.97 +++ tortls.c 20 Jun 2005 18:56:34 -0000 1.98 @@ -148,12 +148,11 @@ /** Initialize OpenSSL, unless it has already been initialized. */ static void -tor_tls_init(void) { +tor_tls_init() { if (!tls_library_is_initialized) { SSL_library_init(); SSL_load_error_strings(); - crypto_global_init(); - OpenSSL_add_all_algorithms(); + crypto_global_init(-1); tls_library_is_initialized = 1; } } From nickm at seul.org Mon Jun 20 18:56:37 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 20 Jun 2005 14:56:37 -0400 (EDT) Subject: [or-cvs] Load hardware acceleration options when/where available. C... Message-ID: <20050620185637.D080414081EA@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv22033/src/or Modified Files: config.c main.c or.h Log Message: Load hardware acceleration options when/where available. Can anybody test this? Index: config.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.364 retrieving revision 1.365 diff -u -d -r1.364 -r1.365 --- config.c 15 Jun 2005 18:34:46 -0000 1.364 +++ config.c 20 Jun 2005 18:56:34 -0000 1.365 @@ -135,6 +135,7 @@ VAR("HttpProxyAuthenticator",STRING, HttpProxyAuthenticator,NULL), VAR("HttpsProxy", STRING, HttpsProxy, NULL), VAR("HttpsProxyAuthenticator",STRING,HttpsProxyAuthenticator,NULL), + VAR("HardwareAccel", BOOL, HardwareAccel, "1"), VAR("HiddenServiceOptions",LINELIST_V, RendConfigLines, NULL), VAR("HiddenServiceDir", LINELIST_S, RendConfigLines, NULL), VAR("HiddenServicePort", LINELIST_S, RendConfigLines, NULL), @@ -1662,6 +1663,11 @@ return -1; } + if (old->HardwareAccel != new_val->HardwareAccel) { + log_fn(LOG_WARN,"During reload, changing HardwareAccel is not allowed. Failing."); + return -1; + } + return 0; } Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.520 retrieving revision 1.521 diff -u -d -r1.520 -r1.521 --- main.c 20 Jun 2005 09:38:29 -0000 1.520 +++ main.c 20 Jun 2005 18:56:35 -0000 1.521 @@ -1320,7 +1320,7 @@ log_fn(LOG_WARN,"You are running Tor as root. You don't need to, and you probably shouldn't."); #endif - crypto_global_init(); + crypto_global_init(get_options()->HardwareAccel); if (crypto_seed_rng()) { log_fn(LOG_ERR, "Unable to seed random number generator. Exiting."); return -1; Index: or.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.618 retrieving revision 1.619 diff -u -d -r1.618 -r1.619 --- or.h 19 Jun 2005 20:40:41 -0000 1.618 +++ or.h 20 Jun 2005 18:56:35 -0000 1.619 @@ -1137,6 +1137,8 @@ * long do we wait before exiting? */ int SafeLogging; /**< Boolean: are we allowed to log sensitive strings * such as addresses (0), or do we scrub them first (1)? */ + int HardwareAccel; /**< Boolean: Should we enable OpenSSL hardware + * acceleration where available? */ } or_options_t; #define MAX_SOCKS_REPLY_LEN 1024 From nickm at seul.org Mon Jun 6 20:17:19 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 6 Jun 2005 16:17:19 -0400 (EDT) Subject: [or-cvs] Note recent crypto bugfix. Message-ID: <20050606201719.7D603140824F@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/tmp/cvs-serv14160 Modified Files: Tag: tor-0_1_0-patches ChangeLog Log Message: Note recent crypto bugfix. Index: ChangeLog =================================================================== RCS file: /home/or/cvsroot/tor/ChangeLog,v retrieving revision 1.93.2.1 retrieving revision 1.93.2.2 diff -u -d -r1.93.2.1 -r1.93.2.2 --- ChangeLog 6 Jun 2005 16:14:45 -0000 1.93.2.1 +++ ChangeLog 6 Jun 2005 20:17:17 -0000 1.93.2.2 @@ -10,6 +10,7 @@ has it bound_! So, don't do that on Win32. - Clean up the log messages when starting on Win32 with no config file. + - Security fix: seed RNG well even when not in Administrator group. o Assert / crash bugs: - Refuse relay cells that claim to have a length larger than the From arma at seul.org Mon Jun 20 20:12:13 2005 From: arma at seul.org (arma at seul.org) Date: Mon, 20 Jun 2005 16:12:13 -0400 (EDT) Subject: [or-cvs] add kevin"s email address to the eff legal faq Message-ID: <20050620201213.6331B14080A9@moria.seul.org> Update of /home2/or/cvsroot/website/eff In directory moria:/home/arma/work/onion/cvs/website/eff Modified Files: tor-legal-faq.html Log Message: add kevin's email address to the eff legal faq Index: tor-legal-faq.html =================================================================== RCS file: /home2/or/cvsroot/website/eff/tor-legal-faq.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- tor-legal-faq.html 23 May 2005 16:31:21 -0000 1.13 +++ tor-legal-faq.html 20 Jun 2005 20:12:11 -0000 1.14 @@ -105,7 +105,8 @@ assessing the situation and will try to locate qualified legal counsel when necessary. Inquiries to EFF for the purpose of securing legal representation or referrals should be directed to staff attorney Kevin -Bankston (US +1 (415) 436-9333 x 126). Such inquiries will be kept +Bankston (bankston at eff.org or US +1 (415) 436-9333 x 126). Such +inquiries will be kept confidential subject to the limits of the attorney/client privilege. Note that although EFF cannot practice law outside of the U.S., it will still try to assist non-U.S. server operators in finding local @@ -143,7 +144,8 @@ U.S., such gag orders do not prevent you from talking to a lawyer, including calling a lawyer to find representation. Inquiries to EFF for the purpose of securing legal representation should be directed to staff -attorney Kevin Bankston (US +1 (415) 436-9333 x126). Such inquiries +attorney Kevin Bankston (bankston at eff.org or US +1 (415) 436-9333 +x126). Such inquiries will be kept confidential subject to the limits of the attorney/client privilege.

        From arma at seul.org Mon Jun 20 23:04:15 2005 From: arma at seul.org (arma at seul.org) Date: Mon, 20 Jun 2005 19:04:15 -0400 (EDT) Subject: [or-cvs] overall cleanup and streamlining and doccing Message-ID: <20050620230415.BF91314080AB@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv32486 Modified Files: buffers.c connection_or.c directory.c dirserv.c or.h routerlist.c Log Message: overall cleanup and streamlining and doccing also fix a DoS avenue on dirservers Index: buffers.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/buffers.c,v retrieving revision 1.164 retrieving revision 1.165 diff -u -d -r1.164 -r1.165 --- buffers.c 17 Jun 2005 20:37:21 -0000 1.164 +++ buffers.c 20 Jun 2005 23:04:13 -0000 1.165 @@ -263,34 +263,6 @@ return 0; } -#if 0 -/** If the buffer is at least 2*MIN_GREEDY_SHRINK_SIZE bytes in capacity, - * and if the buffer is less than 1/8 full, shrink the buffer until - * one of the above no longer holds. (We shrink the buffer by - * dividing by powers of 2.) - */ -static INLINE void -buf_shrink_if_underfull(buf_t *buf) { - size_t new_len; - /* If the buffer is at least 1/8 full, or if shrinking the buffer would - * put it under MIN_GREEDY_SHRINK_SIZE, don't do it. */ - if (buf->datalen >= (buf->len>>3) || buf->len < MIN_GREEDY_SHRINK_SIZE*2) - return; - /* Shrink new_len by powers of 2 until: datalen is at least 1/4 of - * new_len, OR shrinking new_len more would put it under - * MIN_GREEDY_SHRINK_SIZE. - */ - new_len = (buf->len>>1); - while (buf->datalen < (new_len>>3) && new_len > MIN_GREEDY_SHRINK_SIZE*2) - new_len >>= 1; - log_fn(LOG_DEBUG,"Shrinking buffer from %d to %d bytes.", - (int)buf->len, (int)new_len); - buf_resize(buf, new_len); -} -#else -#define buf_shrink_if_underfull(buf) do {} while (0) -#endif - /** Resize buf so it won't hold extra memory that we haven't been * using lately (that is, since the last time we called buf_shrink). * Try to shrink the buf until it is the largest factor of two that @@ -326,7 +298,6 @@ } else { buf->cur = buf->mem; } - buf_shrink_if_underfull(buf); check(); } Index: connection_or.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/connection_or.c,v retrieving revision 1.178 retrieving revision 1.179 diff -u -d -r1.178 -r1.179 --- connection_or.c 11 Jun 2005 18:52:11 -0000 1.178 +++ connection_or.c 20 Jun 2005 23:04:13 -0000 1.179 @@ -430,7 +430,13 @@ static char ZERO_DIGEST[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -/** DOCDOC */ +/** Return 1 if we initiated this connection, or 0 if it started + * out as an incoming connection. + * + * This is implemented for now by checking to see if + * conn-\>identity_digest is set or not. Perhaps we should add a flag + * one day so we're clearer. + */ int connection_or_nonopen_was_started_here(connection_t *conn) { @@ -443,42 +449,35 @@ return 1; } -/** The tls handshake is finished. - * - * Make sure we are happy with the person we just handshaked with: - * If it's an OP (that is, it has no certificate), make sure I'm an OR. - * If it's an OR (it has a certificate), make sure it has a recognized - * nickname, and its cert is signed by the identity key of that nickname. - * If I initiated the connection, make sure it's the right guy; and if - * he initiated the connection, make sure he's not already connected. +/** Conn just completed its handshake. Return 0 if all is well, and + * return -1 if he is lying, broken, or otherwise something is wrong. * - * If he initiated the conn, also initialize conn from the information - * in router. + * Make sure he sent a correctly formed certificate. If it has a + * recognized (approved) nickname, make sure his identity key matches + * to it. If I initiated the connection, make sure it's the right guy. * - * If either of us is an OP, set bandwidth to the default OP bandwidth. + * If we return 0, write a hash of the identity key into digest_rcvd, + * which must have DIGEST_LEN space in it. (If we return -1 this + * buffer is undefined.) * - * If all is successful and he's an OR, then call circuit_n_conn_done() - * to handle events that have been pending on the tls handshake - * completion, and set the directory to be dirty (only matters if I'm - * an authdirserver). + * As side effects, + * 1) Set conn->circ_id_type according to tor-spec.txt + * 2) If we're an authdirserver and we initiated the connection: drop all + * descriptors that claim to be on that IP/port but that aren't + * this guy; and note that this guy is reachable. */ -static int -connection_tls_finish_handshake(connection_t *conn) -{ +int +connection_or_check_valid_handshake(connection_t *conn, char *digest_rcvd) { routerinfo_t *router; - char nickname[MAX_NICKNAME_LEN+1]; - connection_t *c; crypto_pk_env_t *identity_rcvd=NULL; - char digest_rcvd[DIGEST_LEN]; + char nickname[MAX_NICKNAME_LEN+1]; or_options_t *options = get_options(); int severity = (authdir_mode(options) || !server_mode(options)) ? LOG_WARN : LOG_INFO; - log_fn(LOG_DEBUG,"tls handshake done. verifying."); check_no_tls_errors(); if (! tor_tls_peer_has_cert(conn->tls)) { log_fn(LOG_INFO,"Peer didn't send a cert! Closing."); - /* XXX we should handle this case rather than just closing. */ return -1; } check_no_tls_errors(); @@ -497,13 +496,6 @@ return -1; } check_no_tls_errors(); -#if 0 - if (tor_tls_check_lifetime(conn->tls, LOOSE_CERT_ALLOW_SKEW)<0) { - log_fn(LOG_WARN,"Other side '%s' (%s:%d) has a very highly skewed clock, or an expired certificate. Closing.", - nickname, conn->address, conn->port); - return -1; - } -#endif log_fn(LOG_DEBUG,"The router's cert is valid."); crypto_pk_get_digest(identity_rcvd, digest_rcvd); @@ -523,25 +515,9 @@ nickname, conn->address, conn->port); return -1; } -#if 0 - if (router_get_by_digest(digest_rcvd)) { - /* This is a known router; don't cut it slack with its clock skew. */ - if (tor_tls_check_lifetime(conn->tls, TIGHT_CERT_ALLOW_SKEW)<0) { - log_fn(LOG_WARN,"Router '%s' (%s:%d) has a skewed clock, or an expired certificate; or else our clock is skewed. Closing.", - nickname, conn->address, conn->port); - return -1; - } - } -#endif if (connection_or_nonopen_was_started_here(conn)) { - if (authdir_mode(options)) { - /* We initiated this connection to address:port. Drop all routers - * with the same address:port and a different key or nickname. - */ - dirserv_orconn_tls_done(conn->address, conn->port, - digest_rcvd, nickname); - } + int as_advertised = 1; if (conn->nickname[0] == '$') { /* I was aiming for a particular digest. Did I get it? */ char d[HEX_DIGEST_LEN+1]; @@ -551,7 +527,7 @@ "Identity key not as expected for router at %s:%d: wanted %s but got %s", conn->address, conn->port, conn->nickname, d); control_event_or_conn_status(conn, OR_CONN_EVENT_FAILED); - return -1; + as_advertised = 0; } } else if (strcasecmp(conn->nickname, nickname)) { /* I was aiming for a nickname. Did I get it? */ @@ -559,17 +535,54 @@ "Other side (%s:%d) is '%s', but we tried to connect to '%s'", conn->address, conn->port, nickname, conn->nickname); control_event_or_conn_status(conn, OR_CONN_EVENT_FAILED); - return -1; + as_advertised = 0; } - } else { + if (authdir_mode(options)) { + /* We initiated this connection to address:port. Drop all routers + * with the same address:port and a different key or nickname. + */ + dirserv_orconn_tls_done(conn->address, conn->port, + digest_rcvd, nickname, as_advertised); + } + if (!as_advertised) + return -1; + } + return 0; +} + +/** The tls handshake is finished. + * + * Make sure we are happy with the person we just handshaked with. + * + * If he initiated the connection, make sure he's not already connected, + * then initialize conn from the information in router. + * + * If I'm not a server, set bandwidth to the default OP bandwidth. + * + * If all is successful, call circuit_n_conn_done() to handle events + * that have been pending on the tls handshake completion. Also set the + * directory to be dirty (only matters if I'm an authdirserver). + */ +static int +connection_tls_finish_handshake(connection_t *conn) +{ + char digest_rcvd[DIGEST_LEN]; + + log_fn(LOG_DEBUG,"tls handshake done. verifying."); + if (connection_or_check_valid_handshake(conn, digest_rcvd) < 0) + return -1; + + if (!connection_or_nonopen_was_started_here(conn)) { + connection_t *c; if ((c=connection_get_by_identity_digest(digest_rcvd, CONN_TYPE_OR))) { - log_fn(LOG_INFO,"Router '%s' is already connected on fd %d. Dropping fd %d.", nickname, c->s, conn->s); + log_fn(LOG_INFO,"Router '%s' is already connected on fd %d. Dropping fd %d.", + c->nickname, c->s, conn->s); return -1; } connection_or_init_conn_from_address(conn,conn->addr,conn->port,digest_rcvd); } - if (!server_mode(options)) { /* If I'm an OP... */ + if (!server_mode(get_options())) { /* If I'm an OP... */ conn->receiver_bucket = conn->bandwidth = DEFAULT_BANDWIDTH_OP; } Index: directory.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/directory.c,v retrieving revision 1.234 retrieving revision 1.235 diff -u -d -r1.234 -r1.235 --- directory.c 11 Jun 2005 18:52:11 -0000 1.234 +++ directory.c 20 Jun 2005 23:04:13 -0000 1.235 @@ -54,14 +54,6 @@ static addr_policy_t *dir_policy = NULL; -#if 0 /* commented out for now, since for now what clients send is - different from what servers want to receive */ -/** URL for publishing rendezvous descriptors. */ -char rend_publish_string[] = "/tor/rendezvous/publish"; -/** Prefix for downloading rendezvous descriptors. */ -char rend_fetch_url[] = "/tor/rendezvous/"; -#endif - #define ALLOW_DIRECTORY_TIME_SKEW 30*60 /* 30 minutes */ /********* END VARIABLES ************/ Index: dirserv.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/dirserv.c,v retrieving revision 1.168 retrieving revision 1.169 diff -u -d -r1.168 -r1.169 --- dirserv.c 15 Jun 2005 18:34:46 -0000 1.168 +++ dirserv.c 20 Jun 2005 23:04:13 -0000 1.169 @@ -819,20 +819,6 @@ return -1; } -#if 0 - /* Now read the directory we just made in order to update our own - * router lists. This does more signature checking than is strictly - * necessary, but safe is better than sorry. */ - new_directory = tor_strdup(the_directory); - /* use a new copy of the dir, since get_dir_from_string scribbles on it */ - if (router_load_routerlist_from_directory(new_directory, - get_identity_key(), 1, 0)) { - log_fn(LOG_ERR, "We just generated a directory we can't parse. Dying."); - tor_cleanup(); - exit(0); - } - tor_free(new_directory); -#endif the_directory_is_dirty = 0; /* Save the directory to disk so we re-load it quickly on startup. @@ -962,12 +948,16 @@ * nickname_rcvd. When this happens, it's clear that any other * descriptors for that address/port combination must be unusable: * delete them if they are not verified. + * + * Also, if as_advertised is 1, then inform the reachability checker + * that we could get to this guy. */ void dirserv_orconn_tls_done(const char *address, uint16_t or_port, const char *digest_rcvd, - const char *nickname_rcvd) + const char *nickname_rcvd, + int as_advertised) //XXXRD { int i; tor_assert(address); Index: or.h =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.619 retrieving revision 1.620 diff -u -d -r1.619 -r1.620 --- or.h 20 Jun 2005 18:56:35 -0000 1.619 +++ or.h 20 Jun 2005 23:04:13 -0000 1.620 @@ -1540,7 +1540,8 @@ void dirserv_orconn_tls_done(const char *address, uint16_t or_port, const char *digest_rcvd, - const char *nickname); + const char *nickname, + int as_advertised); void dirserv_free_all(void); /********************************* dns.c ***************************/ @@ -1818,20 +1819,18 @@ int router_reload_router_list(void); void router_get_trusted_dir_servers(smartlist_t **outp); -routerinfo_t *router_pick_directory_server(int requireothers, +routerinfo_t *router_pick_directory_server(int requireother, int fascistfirewall, int for_running_routers, int retry_if_no_servers); -trusted_dir_server_t *router_pick_trusteddirserver(int requireothers, +trusted_dir_server_t *router_pick_trusteddirserver(int requireother, int fascistfirewall, int retry_if_no_servers); int all_trusted_directory_servers_down(void); struct smartlist_t; void routerlist_add_family(struct smartlist_t *sl, routerinfo_t *router); void add_nickname_list_to_smartlist(struct smartlist_t *sl, const char *list, int warn_if_down); -int router_nickname_is_in_list(routerinfo_t *router, const char *list); routerinfo_t *routerlist_find_my_routerinfo(void); -int router_nickname_matches(routerinfo_t *router, const char *nickname); int exit_policy_implicitly_allows_local_networks(addr_policy_t *policy, int warn); @@ -1848,7 +1847,6 @@ struct smartlist_t *excludedsmartlist, int need_uptime, int need_bandwidth, int allow_unverified, int strict); -routerinfo_t *router_get_by_addr_port(uint32_t addr, uint16_t port); routerinfo_t *router_get_by_nickname(const char *nickname); routerinfo_t *router_get_by_hexdigest(const char *hexdigest); routerinfo_t *router_get_by_digest(const char *digest); @@ -1874,8 +1872,6 @@ int router_exit_policy_rejects_all(routerinfo_t *router); void running_routers_free(running_routers_t *rr); void routerlist_set_runningrouters(routerlist_t *list, running_routers_t *rr); -void routerlist_update_from_runningrouters(routerlist_t *list, - running_routers_t *rr); int routers_update_status_from_entry(smartlist_t *routers, time_t list_time, const char *s); Index: routerlist.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v retrieving revision 1.239 retrieving revision 1.240 diff -u -d -r1.239 -r1.240 --- routerlist.c 11 Jun 2005 18:52:11 -0000 1.239 +++ routerlist.c 20 Jun 2005 23:04:13 -0000 1.240 @@ -20,11 +20,13 @@ /* static function prototypes */ static routerinfo_t * -router_pick_directory_server_impl(int requireothers, int fascistfirewall, +router_pick_directory_server_impl(int requireother, int fascistfirewall, int for_runningrouters); static trusted_dir_server_t * router_pick_trusteddirserver_impl(int requireother, int fascistfirewall); static void mark_all_trusteddirservers_up(void); +static int router_nickname_is_in_list(routerinfo_t *router, const char *list); +static int router_nickname_matches(routerinfo_t *router, const char *nickname); static int router_resolve(routerinfo_t *router); static int router_resolve_routerlist(routerlist_t *dir); @@ -34,7 +36,7 @@ * Functions to manage and access our list of known routers. (Note: * dirservers maintain a separate, independent list of known router * descriptors.) - *****/ + ****/ /** Global list of all of the routers that we, as an OR or OP, know about. */ static routerlist_t *routerlist = NULL; @@ -42,8 +44,7 @@ extern int has_fetched_directory; /**< from main.c */ /** - * Reload the original list of trusted dirservers, and the most recent - * cached directory (if present). + * Reload the most recent cached directory (if present). */ int router_reload_router_list(void) @@ -88,14 +89,16 @@ } /** Try to find a running dirserver. If there are no running dirservers - * in our routerlist, set all the authoritative ones as running again, - * and pick one. If there are no dirservers at all in our routerlist, - * reload the routerlist and try one last time. If for_runningrouters is + * in our routerlist and retry_if_no_servers is non-zero, + * set all the authoritative ones as running again, and pick one; + * if there are then no dirservers at all in our routerlist, + * reload the routerlist and try one last time. If for_runningrouters is * true, then only pick a dirserver that can answer runningrouters queries * (that is, a trusted dirserver, or one running 0.0.9rc5-cvs or later). + * Other args are as in router_pick_directory_server_impl(). */ routerinfo_t * -router_pick_directory_server(int requireothers, +router_pick_directory_server(int requireother, int fascistfirewall, int for_runningrouters, int retry_if_no_servers) @@ -105,7 +108,7 @@ if (!routerlist) return NULL; - choice = router_pick_directory_server_impl(requireothers, fascistfirewall, + choice = router_pick_directory_server_impl(requireother, fascistfirewall, for_runningrouters); if (choice || !retry_if_no_servers) return choice; @@ -114,7 +117,7 @@ /* mark all authdirservers as up again */ mark_all_trusteddirservers_up(); /* try again */ - choice = router_pick_directory_server_impl(requireothers, fascistfirewall, + choice = router_pick_directory_server_impl(requireother, fascistfirewall, for_runningrouters); if (choice) return choice; @@ -126,47 +129,43 @@ return NULL; } /* give it one last try */ - choice = router_pick_directory_server_impl(requireothers, 0, + choice = router_pick_directory_server_impl(requireother, 0, for_runningrouters); return choice; } -/** DOCDOC */ +/** Try to find a running trusted dirserver. If there are no running + * trusted dirservers and retry_if_no_servers is non-zero, + * set them all as running again, and try again. + * Other args are as in router_pick_trusteddirserver_impl(). + */ trusted_dir_server_t * -router_pick_trusteddirserver(int requireothers, +router_pick_trusteddirserver(int requireother, int fascistfirewall, int retry_if_no_servers) { trusted_dir_server_t *choice; - choice = router_pick_trusteddirserver_impl(requireothers, fascistfirewall); + choice = router_pick_trusteddirserver_impl(requireother, fascistfirewall); if (choice || !retry_if_no_servers) return choice; log_fn(LOG_INFO,"No trusted dirservers are reachable. Trying them all again."); - /* mark all authdirservers as up again */ mark_all_trusteddirservers_up(); - /* try again */ - choice = router_pick_trusteddirserver_impl(requireothers, fascistfirewall); - if (choice) - return choice; - - log_fn(LOG_WARN,"Still no dirservers %s. Reloading and trying again.", - get_options()->FascistFirewall ? "reachable" : "known"); - has_fetched_directory=0; /* reset it */ - if (router_reload_router_list()) { - return NULL; - } - /* give it one last try */ - choice = router_pick_trusteddirserver_impl(requireothers, 0); - return choice; + return router_pick_trusteddirserver_impl(requireother, fascistfirewall); } -/** Pick a random running router from our routerlist. If requireauth, - * it has to be a trusted server. If requireothers, it cannot be us. +/** Pick a random running verified directory server/mirror from our + * routerlist. + * If fascistfirewall and we're not using a proxy, + * make sure the port we pick is allowed by options-\>firewallports. + * If requireother, it cannot be us. + * If for_runningrouters, make sure we pick a dirserver that + * can answer queries for running-routers (this option will become obsolete + * once 0.0.9-rc5 is dead). */ static routerinfo_t * -router_pick_directory_server_impl(int requireothers, int fascistfirewall, +router_pick_directory_server_impl(int requireother, int fascistfirewall, int for_runningrouters) { int i; @@ -185,7 +184,7 @@ router = smartlist_get(routerlist->routers, i); if (!router->is_running || !router->dir_port || !router->is_verified) continue; - if (requireothers && router_is_me(router)) + if (requireother && router_is_me(router)) continue; if (fascistfirewall) { if (!smartlist_string_num_isin(get_options()->FirewallPorts, router->dir_port)) @@ -204,7 +203,11 @@ return router; } -/** DOCDOC */ +/** Choose randomly from among the trusted dirservers that are up. + * If fascistfirewall and we're not using a proxy, + * make sure the port we pick is allowed by options-\>firewallports. + * If requireother, it cannot be us. + */ static trusted_dir_server_t * router_pick_trusteddirserver_impl(int requireother, int fascistfirewall) { @@ -238,7 +241,7 @@ return ds; } -/** Go through and mark the auth dirservers as up */ +/** Go through and mark the authoritative dirservers as up. */ static void mark_all_trusteddirservers_up(void) { @@ -270,6 +273,7 @@ } /** Add all the family of router to the smartlist sl. + * This is used to make sure we don't pick siblings in a single path. */ void routerlist_add_family(smartlist_t *sl, routerinfo_t *router) @@ -295,6 +299,7 @@ }); }); + /* If the user declared any families locally, honor those too. */ for (cl = get_options()->NodeFamilies; cl; cl = cl->next) { if (router_nickname_is_in_list(router, cl->value)) { add_nickname_list_to_smartlist(sl, cl->value, 0); @@ -302,8 +307,8 @@ } } -/** List of string for nicknames we've warned about and haven't yet succeeded. - */ +/** List of strings for nicknames we've already warned about and that are + * still unknown / unavailable. */ static smartlist_t *warned_nicknames = NULL; /** Given a comma-and-whitespace separated list of nicknames, see which @@ -362,7 +367,7 @@ /** Return 1 iff any member of the comma-separated list list is an * acceptable nickname or hexdigest for router. Else return 0. */ -int +static int router_nickname_is_in_list(routerinfo_t *router, const char *list) { smartlist_t *nickname_list; @@ -409,7 +414,8 @@ } } -/** DOCDOC */ +/** Look through the routerlist until we find a router that has my key. + Return it. */ routerinfo_t * routerlist_find_my_routerinfo(void) { @@ -427,7 +433,11 @@ return NULL; } -/** DOCDOC */ +/** Return 1 if router is not suitable for these parameters, else 0. + * If need_uptime is non-zero, we require a minimum uptime. + * If need_capacity is non-zero, we require a minimum advertised + * bandwidth. + */ int router_is_unreliable(routerinfo_t *router, int need_uptime, int need_capacity) { @@ -438,7 +448,7 @@ return 0; } -/** DOCDOC */ +/** Remove from routerlist sl all routers who have a low uptime. */ static void routerlist_sl_remove_unreliable_routers(smartlist_t *sl) { @@ -455,7 +465,11 @@ } } -/** DOCDOC */ +#define MAX_BELIEVABLE_BANDWIDTH 2000000 /* 2 MB/sec */ + +/** Choose a random element of router list sl, weighted by + * the advertised bandwidth of each router. + */ routerinfo_t * routerlist_sl_choose_by_bandwidth(smartlist_t *sl) { @@ -465,41 +479,40 @@ uint32_t this_bw, tmp, total_bw=0, rand_bw; uint32_t *p; + /* First count the total bandwidth weight, and make a smartlist + * of each value. */ bandwidths = smartlist_create(); for (i = 0; i < smartlist_len(sl); ++i) { router = smartlist_get(sl, i); this_bw = (router->bandwidthcapacity < router->bandwidthrate) ? router->bandwidthcapacity : router->bandwidthrate; - if (this_bw > 2000000) - this_bw = 2000000; /* if they claim something huge, don't believe it */ + /* if they claim something huge, don't believe it */ + if (this_bw > MAX_BELIEVABLE_BANDWIDTH) + this_bw = MAX_BELIEVABLE_BANDWIDTH; p = tor_malloc(sizeof(uint32_t)); *p = this_bw; smartlist_add(bandwidths, p); total_bw += this_bw; -// log_fn(LOG_INFO,"Recording bw %d for node %s.", this_bw, router->nickname); } if (!total_bw) { SMARTLIST_FOREACH(bandwidths, uint32_t*, p, tor_free(p)); smartlist_free(bandwidths); return smartlist_choose(sl); } + /* Second, choose a random value from the bandwidth weights. */ rand_bw = crypto_pseudo_rand_int(total_bw); -// log_fn(LOG_INFO,"Total bw %d. Randomly chose %d.", total_bw, rand_bw); + /* Last, count through sl until we get to the element we picked */ tmp = 0; for (i=0; ; i++) { tor_assert(i < smartlist_len(sl)); p = smartlist_get(bandwidths, i); tmp += *p; - router = smartlist_get(sl, i); -// log_fn(LOG_INFO,"Considering %s. tmp = %d.", router->nickname, tmp); if (tmp >= rand_bw) break; } SMARTLIST_FOREACH(bandwidths, uint32_t*, p, tor_free(p)); smartlist_free(bandwidths); - router = smartlist_get(sl, i); -// log_fn(LOG_INFO,"Picked %s.", router->nickname); - return router; + return (routerinfo_t *)smartlist_get(sl, i); } /** Return a random running router from the routerlist. If any node @@ -508,6 +521,10 @@ * excludedsmartlist, even if they are the only nodes * available. If strict is true, never pick any node besides * those in preferred. + * If need_uptime is non-zero, don't return a router with less + * than a minimum uptime. + * If need_capacity is non-zero, weight your choice by the + * advertised capacity of each router. */ routerinfo_t * router_choose_random_node(const char *preferred, @@ -529,13 +546,6 @@ smartlist_subtract(sl,excludednodes); if (excludedsmartlist) smartlist_subtract(sl,excludedsmartlist); -#if 0 - if (need_uptime) - routerlist_sl_remove_unreliable_routers(sl); - if (need_capacity) - choice = routerlist_sl_choose_by_bandwidth(sl); - else -#endif choice = smartlist_choose(sl); smartlist_free(sl); if (!choice && !strict) { @@ -561,26 +571,6 @@ return choice; } -/** Return the router in our routerlist whose address is addr and - * whose OR port is port. Return NULL if no such router is known. - */ -routerinfo_t * -router_get_by_addr_port(uint32_t addr, uint16_t port) -{ - int i; - routerinfo_t *router; - - if (!routerlist) - return NULL; - - for (i=0;irouters);i++) { - router = smartlist_get(routerlist->routers, i); - if ((router->addr == addr) && (router->or_port == port)) - return router; - } - return NULL; -} - /** Return true iff the digest of router's identity key, * encoded in hexadecimal, matches hexdigest (which is * optionally prefixed with a single dollar sign). Return false if @@ -596,21 +586,19 @@ if (strlen(hexdigest) != HEX_DIGEST_LEN || base16_decode(digest, DIGEST_LEN, hexdigest, HEX_DIGEST_LEN)<0) return 0; - else - return (!memcmp(digest, router->identity_digest, DIGEST_LEN)); + return (!memcmp(digest, router->identity_digest, DIGEST_LEN)); } -/* Return true if router's nickname matches nickname +/** Return true if router's nickname matches nickname * (case-insensitive), or if router's identity key digest * matches a hexadecimal value stored in nickname. Return - * false otherwise.*/ -int + * false otherwise. */ +static int router_nickname_matches(routerinfo_t *router, const char *nickname) { if (nickname[0]!='$' && !strcasecmp(router->nickname, nickname)) return 1; - else - return router_hex_digest_matches(router, nickname); + return router_hex_digest_matches(router, nickname); } /** Return the router in our routerlist whose (case-insensitive) @@ -687,10 +675,7 @@ routerinfo_t *router; tor_assert(digest); - if (server_mode(get_options()) && - (router = router_get_my_routerinfo()) && - !memcmp(digest, router->identity_digest, DIGEST_LEN)) - return router; + if (!routerlist) return NULL; for (i=0;irouters);i++) { @@ -842,7 +827,9 @@ * will either be inserted into the routerlist or freed. Returns 0 if the * router was added; -1 if it was not. * - * DOCDOC msg + * If we're returning -1 and msg is not NULL, then assign to + * *msg a static string describing the reason for refusing the + * routerinfo. */ static int router_add_to_routerlist(routerinfo_t *router, const char **msg) @@ -864,7 +851,7 @@ if (router->published_on > r->published_on) { log_fn(LOG_DEBUG, "Replacing entry for router '%s/%s' [%s]", router->nickname, r->nickname, hex_str(id_digest,DIGEST_LEN)); - /* Remember whether we trust this router as a dirserver. */ +//XXXRD /* Remember whether we trust this router as a dirserver. */ /* If the address hasn't changed; no need to re-resolve. */ if (!strcasecmp(r->address, router->address)) router->addr = r->addr; @@ -903,7 +890,7 @@ log_fn(LOG_DEBUG, "Skipping unverified entry for verified router '%s'", router->nickname); routerinfo_free(router); - if (msg) *msg = "Already have verified router with different key and same nickname"; + if (msg) *msg = "Already have verified router with same nickname and different key"; return -1; } } @@ -920,6 +907,7 @@ * (This function is just like dirserv_remove_old_servers. One day we should * merge them.) */ +//XXXRD void routerlist_remove_old_routers(int age) { @@ -942,10 +930,14 @@ } /* - * Code to parse a single router descriptors and insert it into the - * directory. Return -1 if the descriptor was ill-formed; 0 if the + * Code to parse a single router descriptor and insert it into the + * routerlist. Return -1 if the descriptor was ill-formed; 0 if the * descriptor was well-formed but could not be added; and 1 if the * descriptor was added. + * + * If we don't add it and msg is not NULL, then assign to + * *msg a static string describing the reason for refusing the + * descriptor. */ int router_load_single_router(const char *s, const char **msg) @@ -965,7 +957,7 @@ return 0; } if (router_resolve(ri)<0) { - log_fn(LOG_WARN, "Couldn't resolve router address; dropping."); + log_fn(LOG_WARN, "Couldn't resolve router address '%s'; dropping.", ri->address); *msg = "Couldn't resolve router address."; routerinfo_free(ri); return 0; @@ -978,8 +970,7 @@ } if (router_add_to_routerlist(ri, msg)<0) { log_fn(LOG_WARN, "Couldn't add router to list; dropping."); - *msg = "Couldn't add router to list."; - /* ri is already freed */ + /* we've already assigned to *msg now, and ri is already freed */ return 0; } else { smartlist_t *changed = smartlist_create(); @@ -993,8 +984,9 @@ } /** Add to the current routerlist each router stored in the - * signed directory s. If pkey is provided, check the signature against - * pkey; else check against the pkey of the signing directory server. + * signed directory s. If pkey is provided, check the signature + * against pkey; else check against the pkey of the signing directory + * server. * * If dir_is_recent is non-zero, then examine the * Recommended-versions line and take appropriate action. @@ -1016,6 +1008,8 @@ return -1; } if (routerlist) { + /* Merge the new_list into routerlist, then free new_list. Also + * keep a list of changed descriptors to inform controllers. */ smartlist_t *changed = smartlist_create(); SMARTLIST_FOREACH(new_list->routers, routerinfo_t *, r, { @@ -1041,6 +1035,7 @@ if (get_options()->AuthoritativeDir) { /* Learn about the descriptors in the directory. */ dirserv_load_from_directory_string(s); +//XXXRD } return 0; } @@ -1049,14 +1044,24 @@ static int router_resolve(routerinfo_t *router) { - if (tor_lookup_hostname(router->address, &router->addr) != 0 - || !router->addr) { - log_fn(LOG_WARN,"Could not resolve address for router '%s' at %s", - router->nickname, router->address); - return -1; + if (authdir_mode(get_options())) { + /* don't let authdirservers do resolves; this is an easy DoS avenue */ + struct in_addr iaddr; + if (!tor_inet_aton(router->address, &iaddr)) { /* not an IP */ + log_fn(LOG_WARN,"Refusing to resolve non-IP address '%s' for router '%s'", + router->address, router->nickname); + return -1; + } + memcpy((void *)router->addr, &iaddr.s_addr, 4); + } else { + if (tor_lookup_hostname(router->address, &router->addr) != 0 + || !router->addr) { + log_fn(LOG_WARN,"Could not resolve address '%s' for router '%s'", + router->address, router->nickname); + return -1; + } } router->addr = ntohl(router->addr); /* get it back into host order */ - return 0; } @@ -1085,8 +1090,8 @@ } else if (r->addr) { /* already resolved. */ } else if (router_resolve(r)) { - log_fn(LOG_WARN, "Couldn't resolve router '%s' at '%s'; not using", - r->nickname, r->address); + log_fn(LOG_WARN, "Couldn't resolve address '%s' for router '%s'; not using", + r->address, r->nickname); remove = 1; } if (remove) { @@ -1126,7 +1131,6 @@ addr_policy_t *tmpe; for (tmpe=policy; tmpe; tmpe=tmpe->next) { -// log_fn(LOG_DEBUG,"Considering exit policy %s", tmpe->string); maybe = 0; if (!addr) { /* Address is unknown. */ @@ -1160,10 +1164,6 @@ maybe_accept = 1; } if (match) { -// struct in_addr in; -// in.s_addr = htonl(addr); -// log_fn(LOG_DEBUG,"Address %s:%d matches policy '%s'", -// inet_ntoa(in), port, tmpe->string); if (tmpe->policy_type == ADDR_POLICY_ACCEPT) { /* If we already hit a clause that might trigger a 'reject', than we * can't be sure of this certain 'accept'.*/ @@ -1308,23 +1308,9 @@ tor_free(rr); } -/** We've just got a running routers list in rr; update the - * status of the routers in list, and cache rr */ -void -routerlist_set_runningrouters(routerlist_t *list, running_routers_t *rr) -{ - routerlist_update_from_runningrouters(list,rr); - if (list->running_routers != rr) { - running_routers_free(list->running_routers); - list->running_routers = rr; - } -} - /** Update the running/not-running status of every router in list, based * on the contents of rr. */ -/* Note: this function is not yet used, since nobody publishes just - * running-router lists yet. */ -void +static void routerlist_update_from_runningrouters(routerlist_t *list, running_routers_t *rr) { @@ -1349,6 +1335,18 @@ list->running_routers_updated_on = rr->published_on; } +/** We've just got a running routers list in rr; update the + * status of the routers in list, and cache rr */ +void +routerlist_set_runningrouters(routerlist_t *list, running_routers_t *rr) +{ + routerlist_update_from_runningrouters(list,rr); + if (list->running_routers != rr) { + running_routers_free(list->running_routers); + list->running_routers = rr; + } +} + /** Update the is_running and is_verified fields of the router router, * based in its status in the list of strings stored in running_list. * All entries in running_list follow one of these formats: From arma at seul.org Tue Jun 21 01:00:44 2005 From: arma at seul.org (arma at seul.org) Date: Mon, 20 Jun 2005 21:00:44 -0400 (EDT) Subject: [or-cvs] more cleanups before i go wild Message-ID: <20050621010044.4D2E9140805F@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv3785 Modified Files: dirserv.c Log Message: more cleanups before i go wild Index: dirserv.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/dirserv.c,v retrieving revision 1.169 retrieving revision 1.170 diff -u -d -r1.169 -r1.170 --- dirserv.c 20 Jun 2005 23:04:13 -0000 1.169 +++ dirserv.c 21 Jun 2005 01:00:42 -0000 1.170 @@ -21,10 +21,10 @@ static int the_directory_is_dirty = 1; static int runningrouters_is_dirty = 1; -static void directory_remove_unrecognized(void); +static void directory_remove_invalid(void); static int dirserv_regenerate_directory(void); /* Should be static; exposed for testing */ -void add_fingerprint_to_dir(const char *nickname, const char *fp); +int add_fingerprint_to_dir(const char *nickname, const char *fp, smartlist_t *list); /************** Fingerprint handling code ************/ @@ -38,33 +38,36 @@ static smartlist_t *fingerprint_list = NULL; /** Add the fingerprint fp for the nickname nickname to - * the global list of recognized identity key fingerprints. + * the smartlist of fingerprint_entry_t's list. Return 0 if it's + * new, or 1 if we replaced the old value. */ -void /* Should be static; exposed for testing */ -add_fingerprint_to_dir(const char *nickname, const char *fp) +int /* Should be static; exposed for testing */ +add_fingerprint_to_dir(const char *nickname, const char *fp, smartlist_t *list) { int i; fingerprint_entry_t *ent; - if (!fingerprint_list) - fingerprint_list = smartlist_create(); + tor_assert(nickname); + tor_assert(fp); + tor_assert(list); - for (i = 0; i < smartlist_len(fingerprint_list); ++i) { - ent = smartlist_get(fingerprint_list, i); + for (i = 0; i < smartlist_len(list); ++i) { + ent = smartlist_get(list, i); if (!strcasecmp(ent->nickname,nickname)) { tor_free(ent->fingerprint); ent->fingerprint = tor_strdup(fp); - return; + return 1; } } ent = tor_malloc(sizeof(fingerprint_entry_t)); ent->nickname = tor_strdup(nickname); ent->fingerprint = tor_strdup(fp); tor_strstrip(ent->fingerprint, " "); - smartlist_add(fingerprint_list, ent); + smartlist_add(list, ent); + return 0; } -/** Add the nickname and fingerprint for this OR to the recognized list. - */ +/** Add the nickname and fingerprint for this OR to the + * global list of recognized identity key fingerprints. */ int dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk) { @@ -73,7 +76,9 @@ log_fn(LOG_ERR, "Error computing fingerprint"); return -1; } - add_fingerprint_to_dir(nickname, fp); + if (!fingerprint_list) + fingerprint_list = smartlist_create(); + add_fingerprint_to_dir(nickname, fp, fingerprint_list); return 0; } @@ -89,8 +94,7 @@ char *cf; char *nickname, *fingerprint; smartlist_t *fingerprint_list_new; - int i, result; - fingerprint_entry_t *ent; + int result; struct config_line_t *front=NULL, *list; cf = read_file_to_str(fname, 0); @@ -127,27 +131,15 @@ DEFAULT_CLIENT_NICKNAME); continue; } - for (i = 0; i < smartlist_len(fingerprint_list_new); ++i) { - ent = smartlist_get(fingerprint_list_new, i); - if (0==strcasecmp(ent->nickname, nickname)) { - log(LOG_NOTICE, "Duplicate nickname '%s'. Skipping.",nickname); - break; /* out of the for. the 'if' below means skip to the next line. */ - } - } - if (i == smartlist_len(fingerprint_list_new)) { /* not a duplicate */ - ent = tor_malloc(sizeof(fingerprint_entry_t)); - ent->nickname = tor_strdup(nickname); - ent->fingerprint = tor_strdup(fingerprint); - tor_strstrip(ent->fingerprint, " "); - smartlist_add(fingerprint_list_new, ent); - } + if (add_fingerprint_to_dir(nickname, fingerprint, fingerprint_list_new) != 0) + log(LOG_NOTICE, "Duplicate nickname '%s'.", nickname); } config_free_lines(front); dirserv_free_fingerprint_list(); fingerprint_list = fingerprint_list_new; /* Delete any routers whose fingerprints we no longer recognize */ - directory_remove_unrecognized(); + directory_remove_invalid(); return 0; } @@ -418,12 +410,12 @@ return verified; } -/** Remove all descriptors whose nicknames or fingerprints we don't - * recognize. (Descriptors that used to be good can become - * unrecognized when we reload the fingerprint list.) +/** Remove all descriptors whose nicknames or fingerprints no longer + * are allowed by our fingerprint list. (Descriptors that used to be + * good can become bad when we reload the fingerprint list.) */ static void -directory_remove_unrecognized(void) +directory_remove_invalid(void) { int i; int r; @@ -522,11 +514,6 @@ /* List of entries in a router-status style: An optional !, then an optional * equals-suffixed nickname, then a dollar-prefixed hexdigest. */ smartlist_t *rs_entries; - /* XXXX Really, we should merge descriptor_list into routerlist. But - * this is potentially tricky, since the semantics of the two lists - * are not quite the same. In any case, it's not for the 0.1.0.x - * series. - */ int authdir_mode = get_options()->AuthoritativeDir; tor_assert(router_status_out); From nickm at seul.org Tue Jun 21 01:07:34 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 20 Jun 2005 21:07:34 -0400 (EDT) Subject: [or-cvs] Appease the hungry God of GCC: it hates K&R style unspecifi... Message-ID: <20050621010734.C8F8B140805F@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv4191/src/common Modified Files: tortls.c Log Message: Appease the hungry God of GCC: it hates K&R style unspecified args! Index: tortls.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/tortls.c,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- tortls.c 20 Jun 2005 18:56:34 -0000 1.98 +++ tortls.c 21 Jun 2005 01:07:32 -0000 1.99 @@ -148,7 +148,8 @@ /** Initialize OpenSSL, unless it has already been initialized. */ static void -tor_tls_init() { +tor_tls_init(void) +{ if (!tls_library_is_initialized) { SSL_library_init(); SSL_load_error_strings(); From nickm at seul.org Tue Jun 21 01:08:03 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 20 Jun 2005 21:08:03 -0400 (EDT) Subject: [or-cvs] Appease the hungry god of GCC: it wants functions to be sta... Message-ID: <20050621010803.B0630140806A@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv4292/src/or Modified Files: connection_or.c Log Message: Appease the hungry god of GCC: it wants functions to be static or prototyped! Index: connection_or.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_or.c,v retrieving revision 1.179 retrieving revision 1.180 diff -u -d -r1.179 -r1.180 --- connection_or.c 20 Jun 2005 23:04:13 -0000 1.179 +++ connection_or.c 21 Jun 2005 01:08:01 -0000 1.180 @@ -466,8 +466,9 @@ * descriptors that claim to be on that IP/port but that aren't * this guy; and note that this guy is reachable. */ -int -connection_or_check_valid_handshake(connection_t *conn, char *digest_rcvd) { +static int +connection_or_check_valid_handshake(connection_t *conn, char *digest_rcvd) +{ routerinfo_t *router; crypto_pk_env_t *identity_rcvd=NULL; char nickname[MAX_NICKNAME_LEN+1]; From phobos at seul.org Tue Jun 21 02:03:24 2005 From: phobos at seul.org (phobos at seul.org) Date: Mon, 20 Jun 2005 22:03:24 -0400 (EDT) Subject: [or-cvs] added in some TCP statements to make it clearer that tor is... Message-ID: <20050621020324.1719D1408049@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv6028 Modified Files: index.html Log Message: added in some TCP statements to make it clearer that tor is tcp only at this time. Flyspray bug 66 Index: index.html =================================================================== RCS file: /home/or/cvsroot/website/index.html,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- index.html 9 Jun 2005 22:13:20 -0000 1.58 +++ index.html 21 Jun 2005 02:03:22 -0000 1.59 @@ -68,7 +68,7 @@

        -Your traffic is safer when you use Tor, because communications +Your TCP/IP traffic is safer when you use Tor, because communications are bounced around a distributed network of servers, called onion routers. Instead of taking a direct route from source to destination, data packets on the Tor network take a @@ -99,7 +99,7 @@

        -Tor aims to make traffic analysis more difficult by preventing +Tor aims to make TCP/IP traffic analysis more difficult by preventing eavesdroppers from finding out where your communications are going online, and by letting you decide whether to identify yourself when you communicate. From phobos at seul.org Tue Jun 21 02:09:24 2005 From: phobos at seul.org (phobos at seul.org) Date: Mon, 20 Jun 2005 22:09:24 -0400 (EDT) Subject: [or-cvs] Removed TCP/IP statements bceause they were confusing. We ... Message-ID: <20050621020924.D26EC140805B@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv6214 Modified Files: index.html Log Message: Removed TCP/IP statements bceause they were confusing. We still need to convey that tor is tcp-only to the general populace. Index: index.html =================================================================== RCS file: /home/or/cvsroot/website/index.html,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- index.html 21 Jun 2005 02:03:22 -0000 1.59 +++ index.html 21 Jun 2005 02:09:22 -0000 1.60 @@ -68,7 +68,7 @@

        -Your TCP/IP traffic is safer when you use Tor, because communications +Your traffic is safer when you use Tor, because communications are bounced around a distributed network of servers, called onion routers. Instead of taking a direct route from source to destination, data packets on the Tor network take a @@ -99,7 +99,7 @@

        -Tor aims to make TCP/IP traffic analysis more difficult by preventing +Tor aims to make traffic analysis more difficult by preventing eavesdroppers from finding out where your communications are going online, and by letting you decide whether to identify yourself when you communicate. From phobos at seul.org Tue Jun 21 02:24:27 2005 From: phobos at seul.org (phobos at seul.org) Date: Mon, 20 Jun 2005 22:24:27 -0400 (EDT) Subject: [or-cvs] Added a further explanation about how Tor works with applic... Message-ID: <20050621022427.96D1D140804C@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv6777 Modified Files: index.html Log Message: Added a further explanation about how Tor works with applications that use the TCP protocol; in addition to web browsing, irc, ssh. Index: index.html =================================================================== RCS file: /home/or/cvsroot/website/index.html,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- index.html 21 Jun 2005 02:09:22 -0000 1.60 +++ index.html 21 Jun 2005 02:24:25 -0000 1.61 @@ -62,7 +62,7 @@ Tor is a toolset for a wide range of organizations and people that want to improve their safety and security on the Internet. Using Tor can help you anonymize web browsing and publishing, instant messaging, IRC, SSH, -and more. Tor also provides a platform on which software developers can +and other applications that use the TCP protocol. Tor also provides a platform on which software developers can build new applications with built-in anonymity, safety, and privacy features.

        From arma at seul.org Tue Jun 21 19:31:59 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 21 Jun 2005 15:31:59 -0400 (EDT) Subject: [or-cvs] remove the "funded by" part of the frontpage, since we alre... Message-ID: <20050621193159.1C39D1408054@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: index.html people.html Log Message: remove the "funded by" part of the frontpage, since we already have the logos there. Index: index.html =================================================================== RCS file: /home2/or/cvsroot/website/index.html,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- index.html 21 Jun 2005 02:24:25 -0000 1.61 +++ index.html 21 Jun 2005 19:31:56 -0000 1.62 @@ -128,15 +128,6 @@

        -Currently, Tor development is supported by the Electronic Frontier Foundation. -Tor was initially designed and developed as part of the U.S. Naval Research -Laboratory's Onion Routing -program with support from ONR -and DARPA. -

        - -

        The or-announce mailing list is a low volume list for announcements of new releases. You can read the archives or subscribe. Index: people.html =================================================================== RCS file: /home2/or/cvsroot/website/people.html,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- people.html 16 May 2005 07:35:41 -0000 1.19 +++ people.html 21 Jun 2005 19:31:56 -0000 1.20 @@ -50,7 +50,10 @@ many volunteers around the Internet.

        Tor's first few years (2002-2004) were sponsored by the Naval Research Lab, working with Naval Research Lab +with support from ONR +and DARPA, +working with Paul Syverson and based on the original onion routing idea developed there.

        From arma at seul.org Tue Jun 21 20:08:04 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 21 Jun 2005 16:08:04 -0400 (EDT) Subject: [or-cvs] update version in tor-doc Message-ID: <20050621200804.D2D7114005DC@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: tor-doc.html Log Message: update version in tor-doc point people to tor-doc-win32 and tor-doc-osx Index: tor-doc.html =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor-doc.html,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- tor-doc.html 15 Jun 2005 18:45:59 -0000 1.85 +++ tor-doc.html 21 Jun 2005 20:08:02 -0000 1.86 @@ -159,7 +159,7 @@ have contributed packages for Debian, Gentoo, and *BSD. See the download page for pointers and details.

        If you got Tor from a tarball, unpack it: tar xzf -tor-0.0.9.9.tar.gz; cd tor-0.0.9.9. Run ./configure, then +tor-0.1.0.10.tar.gz; cd tor-0.1.0.10. Run ./configure, then make, and then make install (as root if necessary). Then you can launch tor from the command-line by running tor. Otherwise, if you got it prepackaged, these steps are already done @@ -176,6 +176,11 @@ default configuration file, and most people won't need to change any of the settings.

        +

        See the Windows instructions or the +OS X instructions if you're using those. +The below are generic instructions for Linux, BSD, Solaris, etc. +

        +

        After installing Tor, you should install privoxy, which is a filtering web @@ -185,7 +190,7 @@ forward-socks4a / localhost:9050 .
        (don't forget the dot) to privoxy's config file (you can just add it to the top). Then change your browser to http proxy at localhost port 8118. -(In Mozilla, this is in Edit|Preferences|Advanced|Proxies.) +(In Firefox on Linux, this is in Edit|Preferences|Advanced|Proxies.) You should also set your SSL proxy to the same thing, to hide your SSL traffic. Using privoxy is necessary because Update of /home2/or/cvsroot/tor In directory moria:/home/arma/work/onion/cvs/tor Modified Files: configure.in Log Message: bump cvs to 0.1.1.0-alpha-cvs Index: configure.in =================================================================== RCS file: /home2/or/cvsroot/tor/configure.in,v retrieving revision 1.212 retrieving revision 1.213 diff -u -d -r1.212 -r1.213 --- configure.in 23 May 2005 06:47:38 -0000 1.212 +++ configure.in 6 Jun 2005 20:27:32 -0000 1.213 @@ -4,7 +4,7 @@ dnl See LICENSE for licensing information AC_INIT -AM_INIT_AUTOMAKE(tor, 0.1.0.8-rc) +AM_INIT_AUTOMAKE(tor, 0.1.1.0-alpha-cvs) AM_CONFIG_HEADER(orconfig.h) AC_CANONICAL_HOST From arma at seul.org Tue Jun 21 20:18:22 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 21 Jun 2005 16:18:22 -0400 (EDT) Subject: [or-cvs] remove CLIENTS file, since it has been replaced with Message-ID: <20050621201822.54CB51408068@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: Makefile.am Removed Files: CLIENTS Log Message: remove CLIENTS file, since it has been replaced with http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#SOCKSAndDNS --- CLIENTS DELETED --- Index: Makefile.am =================================================================== RCS file: /home2/or/cvsroot/tor/doc/Makefile.am,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.am 19 Mar 2005 05:07:19 -0000 1.10 +++ Makefile.am 21 Jun 2005 20:18:20 -0000 1.11 @@ -1,4 +1,4 @@ -EXTRA_DIST = tor-spec.txt CLIENTS FAQ HACKING rend-spec.txt control-spec.txt tor-doc.html tor-doc.css tor-resolve.1 version-spec.txt +EXTRA_DIST = tor-spec.txt FAQ HACKING rend-spec.txt control-spec.txt tor-doc.html tor-doc.css tor-resolve.1 version-spec.txt man_MANS = tor.1 tor-resolve.1 From phobos at seul.org Tue Jun 21 20:56:16 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 21 Jun 2005 16:56:16 -0400 (EDT) Subject: [or-cvs] Directory /home/or/cvsroot/website/it added to the repository Message-ID: <20050621205616.CA538140805A@moria.seul.org> Update of /home/or/cvsroot/website/it In directory moria:/tmp/cvs-serv15069/it Log Message: Directory /home/or/cvsroot/website/it added to the repository --- NEW FILE: - New directory --- From thomass at seul.org Tue Jun 21 21:12:19 2005 From: thomass at seul.org (thomass at seul.org) Date: Tue, 21 Jun 2005 17:12:19 -0400 (EDT) Subject: [or-cvs] German update Message-ID: <20050621211219.674351408049@moria.seul.org> Update of /home2/or/cvsroot/website/de In directory moria:/tmp/cvs-serv15756/de Modified Files: index.de.html Log Message: German update Index: index.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/index.de.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index.de.html 10 Jun 2005 21:12:30 -0000 1.5 +++ index.de.html 21 Jun 2005 21:12:17 -0000 1.6 @@ -1,4 +1,4 @@ - + @@ -59,15 +59,15 @@

        Tor: Ein anonymes Kommunikationssystem ?ber das Internet

        -

        -Tor ist ein ein Werkzeug f?r eine Vielzahl von Organisationen und Menschen, die -ihren Schutz und ihre Sicherheit im Internet verbessern wollen. Nutzen von Tor -hilft dir, das Browsen und Ver?ffentlichen im Web, Instantmessaging, IRC, SSH -und mehr zu anonymisieren. Weiterhin bietet Tor eine Plattform, auf der -Softwareentwickler neue Anwendungen schaffen k?nnen, die zu -Anonymit?t, Sicherheit und zum Schutz der Privatsph?re beitragen.

        +

        Tor ist ein ein Werkzeug f?r eine Vielzahl von Organisationen und Menschen, +die ihren Schutz und ihre Sicherheit im Internet verbessern wollen. Die Nutzung +von Tor hilft dir, das Browsen und Ver?ffentlichen im Web, Instantmessaging, +IRC, SSH und anderen Anwendungen, die TCP nutzen, zu anonymisieren. Weiterhin +bietet Tor eine Plattform, auf der Softwareentwickler neue Anwendungen schaffen +k?nnen, die zu Anonymit?t, Sicherheit und zum Schutz der Privatsph?re +beitragen.

        -

        Dein Datenverkehr ist sicherer, wenn du Tor nutzt, denn die Kommunikation +

        Dein TCP/IP-Datenverkehr ist sicherer, wenn du Tor nutzt, denn die Kommunikation wird durch ein verteiltes Netzwerk von Servern, die Onionrouter genannt werden, geschickt. Anstatt den direkten Weg von der Quelle zum Ziel zu nehmen, folgen die Datenpakete im @@ -99,7 +99,7 @@

        -Tor zielt darauf ab, die Analyse des Netzverkehrs zu erschweren. Dies passiert +Tor zielt darauf ab, die Analyse des TCP/IP-Netzverkehrs zu erschweren. Dies passiert dadurch, dass man es Lauschern erschwert, herauszufinden, wo deine Kommunikation online stattfindet. Weiterhin l?sst man dich entscheiden, ob du dich selbst identifizieren m?chtest oder nicht. From thomass at seul.org Tue Jun 21 21:23:24 2005 From: thomass at seul.org (thomass at seul.org) Date: Tue, 21 Jun 2005 17:23:24 -0400 (EDT) Subject: [or-cvs] More german updates Message-ID: <20050621212324.F31531408049@moria.seul.org> Update of /home2/or/cvsroot/website/de In directory moria:/tmp/cvs-serv16108 Modified Files: index.de.html people.de.html Log Message: More german updates Index: index.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/index.de.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- index.de.html 21 Jun 2005 21:12:17 -0000 1.6 +++ index.de.html 21 Jun 2005 21:23:22 -0000 1.7 @@ -130,17 +130,6 @@

        -Derzeit wird die Entwicklung von Tor von der Electronic Frontier Foundation gef?rdert. Der -urspr?ngliche Entwurf und Entwicklung war ein Teil des U.S. Naval Research -Laboratory's Onion Routing Programms -mit Unterst?tzung der ONR und -DARPA. -

        - -

        Die Mailingliste or-announce ist eine Liste mit niedriger Mailaufkommen, wo neue Versionen bekannt gegeben werden. Du kannst die Archive lesen oder dich Index: people.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/people.de.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- people.de.html 1 Jun 2005 15:58:10 -0000 1.1 +++ people.de.html 21 Jun 2005 21:23:22 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -53,10 +53,12 @@ vielen Freiwilligen aus dem Internet entwickelt.

        In der ersten Zeit von 2002 bis 2004 wurde Tor durch das Naval Research Lab, vertreten durch -Paul Syverson und basierend auf -der originalen Idee des Onionrouting entwickelt.

        + href="http://www.nrl.navy.mil/">Naval Research Lab mit Unterst?tzung der +ONR und der DARPA, vertreten durch Paul Syverson und basierend auf der +originalen Idee des Onionrouting +entwickelt.

        Seit November 2004 wird die Entwicklung durch die Electronic Frontier Foundation From nickm at seul.org Tue Jun 21 21:49:32 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 21 Jun 2005 17:49:32 -0400 (EDT) Subject: [or-cvs] Refactor java tor control library to split out v0 protocol Message-ID: <20050621214932.A968114081A9@moria.seul.org> Update of /home/or/cvsroot/control/java/net/freehaven/tor/control In directory moria:/tmp/cvs-serv17111/net/freehaven/tor/control Modified Files: Bytes.java EventHandler.java TorControlConnection.java Added Files: TorControlConnection0.java Log Message: Refactor java tor control library to split out v0 protocol Index: Bytes.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/Bytes.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Bytes.java 4 Jun 2005 02:42:55 -0000 1.1 +++ Bytes.java 21 Jun 2005 21:49:30 -0000 1.2 @@ -38,6 +38,10 @@ ((ba[pos+3]&0xff)); } + public static String getU32S(byte[] ba, int pos) { + return String.valueOf( ((long)getU32(ba,pos))&0xffffffffL ); + } + /** Return the two-byte value starting at index 'pos' within 'ba' */ public static int getU16(byte[] ba, int pos) { return Index: EventHandler.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/EventHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- EventHandler.java 4 Jun 2005 02:42:55 -0000 1.1 +++ EventHandler.java 21 Jun 2005 21:49:30 -0000 1.2 @@ -10,22 +10,21 @@ * @see TorControlConnection#listenForEvents */ public interface EventHandler { - /** * Invoked when a circuit's status has changed. * See TorControlCommands.CIRC_STATUS_* for possible status codes. */ - public void circuitStatus(int status, int circID, String path); + public void circuitStatus(String status, String circID, String path); /** * Invoked when a stream's status has changed. * See TorControlCommands.STREAM_STATUS_* for possible status codes. */ - public void streamStatus(int status, int streamID, String target); + public void streamStatus(String status, String streamID, String target); /** * Invoked when the status of a connection to an OR has changed. * See TorControlCommands.OR_CONN_STATUS_* for possible status codes. */ - public void orConnStatus(int status, String orName); + public void orConnStatus(String status, String orName); /** * Invoked once per second with the number of bytes read an written in * the last secone. @@ -39,4 +38,4 @@ * Invoked when Tor logs a message. */ public void message(int type, String msg); -} \ No newline at end of file +} Index: TorControlConnection.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlConnection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorControlConnection.java 4 Jun 2005 02:42:55 -0000 1.1 +++ TorControlConnection.java 21 Jun 2005 21:49:30 -0000 1.2 @@ -13,16 +13,15 @@ import java.util.Map; /** A connection to a running Tor process. */ -public class TorControlConnection implements TorControlCommands { - protected java.io.DataOutputStream outStream; - protected java.io.DataInputStream inStream; +public abstract class TorControlConnection// implements TorControlCommands { +{ protected EventHandler handler; protected LinkedList waiters; static class Waiter { - Cmd response; - public synchronized Cmd getResponse() { + Object response; + public synchronized Object getResponse() { try { while (response == null) { wait(); @@ -32,104 +31,16 @@ } return response; } - public synchronized void setResponse(Cmd response) { + public synchronized void setResponse(Object response) { this.response = response; notifyAll(); } } - static class Cmd { - public int type; - public byte[] body; - - Cmd(int t, byte[] b) { type = t; body = b; } - Cmd(int t, int l) { type = t; body = new byte[l]; }; - } - - /** Create a new TorControlConnection to communicate with Tor over - * a given socket. After calling this constructor, it is typical to - * call launchThread and authenticate. */ - public TorControlConnection(java.net.Socket connection) throws IOException { - this(connection.getInputStream(), connection.getOutputStream()); - } - - /** Create a new TorControlConnection to communicate with Tor over - * an arbitrary pair of data streams. - */ - public TorControlConnection(java.io.InputStream i, java.io.OutputStream o) - throws IOException { - this.outStream = new java.io.DataOutputStream(o); - this.inStream = new java.io.DataInputStream(i); + protected TorControlConnection() { this.waiters = new LinkedList(); } - /** helper: sends a single (unfragmentable) command to Tor */ - protected final void sendCommand0(int type, byte[] cmd) - throws IOException { - int length = cmd == null ? 0 : cmd.length; - outStream.writeShort((short)length); - outStream.writeShort(type); - if (cmd != null) - outStream.write(cmd); - } - - /** helper: sends a single (possibly fragmented) command to Tor */ - protected void sendCommand(short type, byte[] cmd) throws IOException { - synchronized(this.outStream) { - if (cmd == null || cmd.length <= 65535) { - sendCommand0(type, cmd); - return; - } - int length = cmd.length; - outStream.writeShort(65535); - outStream.writeShort(CMD_FRAGMENTHEADER); - outStream.writeShort(type); - outStream.writeInt(length); - outStream.write(cmd, 0, 65535); - for (int pos=65535; pos < length; pos += 65535) { - int flen = length-pos < 65535 ? length-pos : 65535; - outStream.writeShort(flen); - outStream.writeShort(CMD_FRAGMENT); - this.outStream.write(cmd, pos, flen); - } - } - } - - /** helper: read a possibly fragmented command from Tor */ - protected final Cmd readCommand0() throws IOException { - int len = this.inStream.readUnsignedShort(); - int cmd = this.inStream.readUnsignedShort(); - byte[] result = new byte[len]; - this.inStream.readFully(result); - return new Cmd(cmd, result); - } - - /** Read a command from Tor, defragmenting as necessary */ - protected Cmd readCommand() throws IOException { - synchronized (inStream) { - Cmd c = readCommand0(); - if (c.type != CMD_FRAGMENT && c.type != CMD_FRAGMENTHEADER) - return c; - - if (c.type == CMD_FRAGMENT) - throw new TorControlSyntaxError("Fragment without header"); - - int realType = Bytes.getU16(c.body, 0); - int realLen = Bytes.getU32(c.body, 2); - - Cmd out = new Cmd(realType, realLen); - System.arraycopy(c.body, 6, out.body, 0, c.body.length-6); - int pos = c.body.length-6; - while (pos < realLen) { - c = readCommand0(); - if (c.type != CMD_FRAGMENT) - throw new TorControlSyntaxError("Incomplete fragmented message"); - System.arraycopy(c.body, 0, out.body, pos, c.body.length); - pos += c.body.length; - } - return out; - } - } /** Set the EventHandler object that will be notified of any * events Tor delivers to this connection. To make Tor send us @@ -159,123 +70,8 @@ return th; } - /** helper: implement the main background loop. */ - protected void react() throws IOException { - while (true) { - Cmd c = readCommand(); - if (c.type == CMD_EVENT) - handleEvent(c); - else { - Waiter w; - synchronized (waiters) { - w = (Waiter) waiters.removeFirst(); - } - w.setResponse(c); - } - } - } - - /** helper: Send a command and wait for the next reponse type command - * to be received (in order) */ - protected synchronized Cmd _sendAndWaitForResponse(short type, byte[] cmd) - throws IOException { - Waiter w = new Waiter(); - synchronized (waiters) { - sendCommand(type, cmd); - waiters.addLast(w); - } - return w.getResponse(); - } - - /** Send a message to Tor, and wait for a respose. - * - * @throw TorControlError if Tor tells us about an error - * @throw TorControlSyntaxError if the response type wasn't exType1...4 - **/ - protected Cmd sendAndWaitForResponse(short type, byte[] cmd, - short exType1, short exType2, short exType3, short exType4) - throws IOException { - - Cmd c = _sendAndWaitForResponse(type, cmd); - if (c.type == CMD_ERROR) - throw new TorControlError(Bytes.getU16(c.body, 0), - Bytes.getNulTerminatedStr(c.body, 2)); - if (c.type == exType1 || c.type == exType2 || c.type == exType3 || - c.type == exType4) - return c; - - throw new TorControlSyntaxError("Unexpected reply type: "+c.type); - } - - protected Cmd sendAndWaitForResponse(short type, byte[] cmd) - throws IOException { - return sendAndWaitForResponse(type, cmd, CMD_DONE, CMD_DONE, CMD_DONE, CMD_DONE); - } - - - protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1) - throws IOException { - return sendAndWaitForResponse(type, cmd, exType1, exType1, exType1, - exType1); - } - - protected Cmd sendAndWaitForResponse(short type, byte[] cmd, - short exType1, short exType2) - throws IOException { - return sendAndWaitForResponse(type, cmd, exType1, exType2, exType2, - exType2); - } - - - protected Cmd sendAndWaitForResponse(short type, byte[] cmd, - short exType1, short exType2, short exType3) - throws IOException { - return sendAndWaitForResponse(type, cmd, exType1, exType2, exType3, - exType3); - } - - /** Helper: decode a CMD_EVENT command and dispatch it to our - * EventHandler (if any). */ - protected void handleEvent(Cmd c) { - if (handler == null) - return; - int type = Bytes.getU16(c.body, 0); + protected abstract void react() throws IOException; - switch (type) { - case EVENT_CIRCSTATUS: - handler.circuitStatus(c.body[2], - (int)Bytes.getU32(c.body, 3), - Bytes.getNulTerminatedStr(c.body, 7)); - break; - case EVENT_STREAMSTATUS: - handler.streamStatus(c.body[2], - (int)Bytes.getU32(c.body, 3), - Bytes.getNulTerminatedStr(c.body, 7)); - break; - case EVENT_ORCONNSTATUS: - handler.orConnStatus(c.body[2], - Bytes.getNulTerminatedStr(c.body, 3)); - break; - case EVENT_BANDWIDTH: - handler.bandwidthUsed(Bytes.getU32(c.body, 2), - Bytes.getU32(c.body, 6)); - break; - case EVENT_NEWDESCRIPTOR: - List lst = new ArrayList(); - Bytes.splitStr(lst, c.body, 2, (byte)','); - handler.newDescriptors(lst); - break; - case EVENT_MSG_DEBUG: - case EVENT_MSG_INFO: - case EVENT_MSG_NOTICE: - case EVENT_MSG_WARN: - case EVENT_MSG_ERROR: - handler.message(type, Bytes.getNulTerminatedStr(c.body, 2)); - break; - default: - throw new TorControlSyntaxError("Unrecognized event type."); - } - } /** Change the value of the configuration option 'key' to 'val'. */ @@ -285,17 +81,6 @@ setConf(lst); } - /** Change the values of the configuration options stored in - * 'kvList'. (The format is "key value"). */ - public void setConf(Collection kvList) throws IOException { - StringBuffer b = new StringBuffer(); - for (Iterator it = kvList.iterator(); it.hasNext(); ) { - String kv = (String) it.next(); - b.append(kv).append("\n"); - } - sendAndWaitForResponse(CMD_SETCONF, b.toString().getBytes()); - } - /** Change the values of the configuration options stored in kvMap. */ public void setConf(Map kvMap) throws IOException { List lst = new ArrayList(); @@ -306,6 +91,10 @@ setConf(lst); } + /** Change the values of the configuration options stored in + * 'kvList'. (The format is "key value"). */ + public abstract void setConf(Collection kvList) throws IOException; + /** Return the value of the configuration option 'key' */ public String getConf(String key) throws IOException { List lst = new ArrayList(); @@ -315,82 +104,26 @@ } /** Return a key-value map for the configuration options in 'keys' */ - public Map getConf(Collection keys) throws IOException { - StringBuffer s = new StringBuffer(); - for (Iterator it = keys.iterator(); it.hasNext(); ) { - String key = (String) it.next(); - s.append(key).append("\n"); - } - Cmd c = sendAndWaitForResponse(CMD_GETCONF, s.toString().getBytes(), - CMD_CONFVALUE); - List lines = new ArrayList(); - Bytes.splitStr(lines, c.body, 0, (byte)'\n'); - Map result = new HashMap(); - for (Iterator it = lines.iterator(); it.hasNext(); ) { - String kv = (String) it.next(); - int idx = kv.indexOf(' '); - result.put(kv.substring(0, idx), - kv.substring(idx+1)); - } - return result; - } + public abstract Map getConf(Collection keys) throws IOException; /** Tell Tor to begin sending us events of the types listed in 'events'. * Elements must be one of the EVENT_* values from TorControlCommands */ - public void setEvents(List events) throws IOException { - byte[] ba = new byte[events.size() * 2]; - int i; - Iterator it; - for(i=0, it = events.iterator(); it.hasNext(); i += 2) { - short event = ((Number)it.next()).shortValue(); - Bytes.setU16(ba, i, event); - } - sendAndWaitForResponse(CMD_SETEVENTS, ba); - System.out.println("OK"); - } + public abstract void setEvents(List events) throws IOException; /** Send Tor an authentication sequence 'auth' */ // XXXX more info about how to set this up securely. - public void authenticate(byte[] auth) throws IOException { - if (auth == null) - auth = new byte[0]; - sendAndWaitForResponse(CMD_AUTH, auth); - } + public abstract void authenticate(byte[] auth) throws IOException; /** Tell Tor to save the value of its configuration to disk. */ - public void saveConf() throws IOException { - sendAndWaitForResponse(CMD_SAVECONF, new byte[0]); - } + public abstract void saveConf() throws IOException; /** Send a signal to the Tor process. */ - public void signal(int signal) throws IOException { - if (signal != SIGNAL_HUP && signal != SIGNAL_INT && - signal != SIGNAL_USR1 && signal != SIGNAL_USR2 && - signal != SIGNAL_TERM) - throw new Error("Unrecognized value for signal()"); - byte[] ba = { (byte)signal }; - sendAndWaitForResponse(CMD_SIGNAL, ba); - } + public abstract void signal(String signal) throws IOException; /** Tell Tor to replace incoming addresses with those as listed in 'kvLines'. */ - public Map mapAddresses(Collection kvLines) throws IOException { - StringBuffer sb = new StringBuffer(); - for (Iterator it = kvLines.iterator(); it.hasNext(); ) { - sb.append((String)it.next()).append("\n"); - } - Cmd c = sendAndWaitForResponse(CMD_MAPADDRESS, sb.toString().getBytes()); - Map result = new HashMap(); - List lst = new ArrayList(); - Bytes.splitStr(lst, c.body, 0, (byte)'\n'); - for (Iterator it = lst.iterator(); it.hasNext(); ) { - String kv = (String) it.next(); - int idx = kv.indexOf(' '); - result.put(kv.substring(0, idx), - kv.substring(idx+1)); - } - return result; - } + public abstract Map mapAddresses(Collection kvLines) throws IOException; + public Map mapAddresses(Map addresses) throws IOException { List kvList = new ArrayList(); for (Iterator it = addresses.entrySet().iterator(); it.hasNext(); ) { @@ -399,6 +132,7 @@ } return mapAddresses(kvList); } + public String mapAddress(String fromAddr, String toAddr) throws IOException { List lst = new ArrayList(); lst.add(fromAddr+" "+toAddr+"\n"); @@ -407,26 +141,7 @@ } /** Look up the information values listed in keys. */ - public Map getInfo(Collection keys) throws IOException { - StringBuffer sb = new StringBuffer(); - for (Iterator it = keys.iterator(); it.hasNext(); ) { - sb.append(((String)it.next())+"\n"); - } - Cmd c = sendAndWaitForResponse(CMD_GETINFO, sb.toString().getBytes(), - CMD_INFOVALUE); - Map m = new HashMap(); - List lst = new ArrayList(); - Bytes.splitStr(lst, c.body, 0, (byte)0); - if ((lst.size() % 2) != 0) - throw new TorControlSyntaxError( - "Odd number of substrings from GETINFO"); - for (Iterator it = lst.iterator(); it.hasNext(); ) { - Object k = it.next(); - Object v = it.next(); - m.put(k, v); - } - return m; - } + public abstract Map getInfo(Collection keys) throws IOException; /** Return the value of the information field 'key' */ public String getInfo(String key) throws IOException { @@ -440,62 +155,29 @@ * Tell Tor to extend the circuit identified by 'circID' through the * servers named in the list 'path'. */ - public int extendCircuit(int circID, String path) throws IOException { - byte[] p = path.getBytes(); - byte[] ba = new byte[p.length+4]; - Bytes.setU32(ba, 0, circID); - System.arraycopy(p, 0, ba, 4, p.length); - Cmd c = sendAndWaitForResponse(CMD_EXTENDCIRCUIT, ba); - return Bytes.getU32(c.body, 0); - } + public abstract int extendCircuit(String circID, String path) throws IOException; /** * Tell Tor to attach the stream identified by 'streamID' to the circuit * identified by 'circID'. */ - public void attachStream(int streamID, int circID) throws IOException { - byte[] ba = new byte[8]; - Bytes.setU32(ba, 0, streamID); - Bytes.setU32(ba, 4, circID); - sendAndWaitForResponse(CMD_ATTACHSTREAM, ba); - } + public abstract void attachStream(String streamID, String circID) throws IOException; /** Tell Tor about the server descriptor in 'desc' */ - public String postDescriptor(byte[] desc) throws IOException { - return new String( - sendAndWaitForResponse(CMD_POSTDESCRIPTOR, desc).body); - } + public abstract String postDescriptor(String desc) throws IOException; /** Tell Tor to change the target of the stream identified by 'streamID' * to 'address'. */ - public void redirectStream(int streamID, String address) throws IOException { - byte[] addr = address.getBytes(); - byte[] ba = new byte[addr.length+4]; - Bytes.setU32(ba, 0, streamID); - System.arraycopy(addr, 0, ba, 4, addr.length); - sendAndWaitForResponse(CMD_REDIRECTSTREAM, ba); - } + public abstract void redirectStream(String streamID, String address) throws IOException; /** Tell Tor to close the stream identified by 'streamID'. */ - public void closeStream(int streamID, byte reason, byte flags) - throws IOException { - byte[] ba = new byte[6]; - Bytes.setU32(ba, 0, streamID); - ba[4] = reason; - ba[5] = flags; - sendAndWaitForResponse(CMD_CLOSESTREAM, ba); - } + public abstract void closeStream(String streamID, byte reason, byte flags) + throws IOException; /** Tell Tor to close the circuit identified by 'streamID'. */ - public void closeCircuit(int circID, byte flags) throws IOException { - byte[] ba = new byte[5]; - Bytes.setU32(ba, 0, circID); - ba[4] = flags; - sendAndWaitForResponse(CMD_CLOSECIRCUIT, ba); - } - + public abstract void closeCircuit(String circID, byte flags) throws IOException; -} \ No newline at end of file +} --- NEW FILE: TorControlConnection0.java --- // $Id: TorControlConnection0.java,v 1.1 2005/06/21 21:49:30 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; /** DOCDOC */ public class TorControlConnection0 extends TorControlConnection implements TorControlCommands { protected java.io.DataOutputStream outStream; protected java.io.DataInputStream inStream; static class Cmd { public int type; public byte[] body; Cmd(int t, byte[] b) { type = t; body = b; } Cmd(int t, int l) { type = t; body = new byte[l]; }; } /** Create a new TorControlConnection to communicate with Tor over * a given socket. After calling this constructor, it is typical to * call launchThread and authenticate. */ public TorControlConnection0(java.net.Socket connection) throws IOException { this(connection.getInputStream(), connection.getOutputStream()); } /** Create a new TorControlConnection to communicate with Tor over * an arbitrary pair of data streams. */ public TorControlConnection0(java.io.InputStream i, java.io.OutputStream o) throws IOException { this.outStream = new java.io.DataOutputStream(o); this.inStream = new java.io.DataInputStream(i); this.waiters = new LinkedList(); } /** helper: sends a single (unfragmentable) command to Tor */ protected final void sendCommand0(int type, byte[] cmd) throws IOException { int length = cmd == null ? 0 : cmd.length; outStream.writeShort((short)length); outStream.writeShort(type); if (cmd != null) outStream.write(cmd); } /** helper: sends a single (possibly fragmented) command to Tor */ protected void sendCommand(short type, byte[] cmd) throws IOException { synchronized(this.outStream) { if (cmd == null || cmd.length <= 65535) { sendCommand0(type, cmd); return; } int length = cmd.length; outStream.writeShort(65535); outStream.writeShort(CMD_FRAGMENTHEADER); outStream.writeShort(type); outStream.writeInt(length); outStream.write(cmd, 0, 65535); for (int pos=65535; pos < length; pos += 65535) { int flen = length-pos < 65535 ? length-pos : 65535; outStream.writeShort(flen); outStream.writeShort(CMD_FRAGMENT); this.outStream.write(cmd, pos, flen); } } } /** helper: read a possibly fragmented command from Tor */ protected final Cmd readCommand0() throws IOException { int len = this.inStream.readUnsignedShort(); int cmd = this.inStream.readUnsignedShort(); byte[] result = new byte[len]; this.inStream.readFully(result); return new Cmd(cmd, result); } /** Read a command from Tor, defragmenting as necessary */ protected Cmd readCommand() throws IOException { synchronized (inStream) { Cmd c = readCommand0(); if (c.type != CMD_FRAGMENT && c.type != CMD_FRAGMENTHEADER) return c; if (c.type == CMD_FRAGMENT) throw new TorControlSyntaxError("Fragment without header"); int realType = Bytes.getU16(c.body, 0); int realLen = Bytes.getU32(c.body, 2); Cmd out = new Cmd(realType, realLen); System.arraycopy(c.body, 6, out.body, 0, c.body.length-6); int pos = c.body.length-6; while (pos < realLen) { c = readCommand0(); if (c.type != CMD_FRAGMENT) throw new TorControlSyntaxError("Incomplete fragmented message"); System.arraycopy(c.body, 0, out.body, pos, c.body.length); pos += c.body.length; } return out; } } /** helper: implement the main background loop. */ protected void react() throws IOException { while (true) { Cmd c = readCommand(); if (c.type == CMD_EVENT) handleEvent(c); else { Waiter w; synchronized (waiters) { w = (Waiter) waiters.removeFirst(); } w.setResponse(c); } } } /** helper: Send a command and wait for the next reponse type command * to be received (in order) */ protected synchronized Cmd _sendAndWaitForResponse(short type, byte[] cmd) throws IOException { Waiter w = new Waiter(); synchronized (waiters) { sendCommand(type, cmd); waiters.addLast(w); } return (Cmd) w.getResponse(); } /** Send a message to Tor, and wait for a respose. * * @throw TorControlError if Tor tells us about an error * @throw TorControlSyntaxError if the response type wasn't exType1...4 **/ protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1, short exType2, short exType3, short exType4) throws IOException { Cmd c = _sendAndWaitForResponse(type, cmd); if (c.type == CMD_ERROR) throw new TorControlError(Bytes.getU16(c.body, 0), Bytes.getNulTerminatedStr(c.body, 2)); if (c.type == exType1 || c.type == exType2 || c.type == exType3 || c.type == exType4) return c; throw new TorControlSyntaxError("Unexpected reply type: "+c.type); } protected Cmd sendAndWaitForResponse(short type, byte[] cmd) throws IOException { return sendAndWaitForResponse(type, cmd, CMD_DONE, CMD_DONE, CMD_DONE, CMD_DONE); } protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1) throws IOException { return sendAndWaitForResponse(type, cmd, exType1, exType1, exType1, exType1); } protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1, short exType2) throws IOException { return sendAndWaitForResponse(type, cmd, exType1, exType2, exType2, exType2); } protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1, short exType2, short exType3) throws IOException { return sendAndWaitForResponse(type, cmd, exType1, exType2, exType3, exType3); } /** Helper: decode a CMD_EVENT command and dispatch it to our * EventHandler (if any). */ protected void handleEvent(Cmd c) { if (handler == null) return; int type = Bytes.getU16(c.body, 0); switch (type) { case EVENT_CIRCSTATUS: handler.circuitStatus(CIRC_STATUS_NAMES[c.body[2]], Bytes.getU32S(c.body, 3), Bytes.getNulTerminatedStr(c.body, 7)); break; case EVENT_STREAMSTATUS: handler.streamStatus(STREAM_STATUS_NAMES[c.body[2]], Bytes.getU32S(c.body, 3), Bytes.getNulTerminatedStr(c.body, 7)); break; case EVENT_ORCONNSTATUS: handler.orConnStatus(OR_CONN_STATUS_NAMES[c.body[2]], Bytes.getNulTerminatedStr(c.body, 3)); break; case EVENT_BANDWIDTH: handler.bandwidthUsed(Bytes.getU32(c.body, 2), Bytes.getU32(c.body, 6)); break; case EVENT_NEWDESCRIPTOR: List lst = new ArrayList(); Bytes.splitStr(lst, c.body, 2, (byte)','); handler.newDescriptors(lst); break; case EVENT_MSG_DEBUG: case EVENT_MSG_INFO: case EVENT_MSG_NOTICE: case EVENT_MSG_WARN: case EVENT_MSG_ERROR: handler.message(type, Bytes.getNulTerminatedStr(c.body, 2)); break; default: throw new TorControlSyntaxError("Unrecognized event type."); } } /** Change the values of the configuration options stored in * 'kvList'. (The format is "key value"). */ public void setConf(Collection kvList) throws IOException { StringBuffer b = new StringBuffer(); for (Iterator it = kvList.iterator(); it.hasNext(); ) { String kv = (String) it.next(); b.append(kv).append("\n"); } sendAndWaitForResponse(CMD_SETCONF, b.toString().getBytes()); } public Map getConf(Collection keys) throws IOException { StringBuffer s = new StringBuffer(); for (Iterator it = keys.iterator(); it.hasNext(); ) { String key = (String) it.next(); s.append(key).append("\n"); } Cmd c = sendAndWaitForResponse(CMD_GETCONF, s.toString().getBytes(), CMD_CONFVALUE); List lines = new ArrayList(); Bytes.splitStr(lines, c.body, 0, (byte)'\n'); Map result = new HashMap(); for (Iterator it = lines.iterator(); it.hasNext(); ) { String kv = (String) it.next(); int idx = kv.indexOf(' '); result.put(kv.substring(0, idx), kv.substring(idx+1)); } return result; } public void setEvents(List events) throws IOException { byte[] ba = new byte[events.size() * 2]; int i; Iterator it; for(i=0, it = events.iterator(); it.hasNext(); i += 2) { short event = ((Number)it.next()).shortValue(); Bytes.setU16(ba, i, event); } sendAndWaitForResponse(CMD_SETEVENTS, ba); System.out.println("OK"); } public void authenticate(byte[] auth) throws IOException { if (auth == null) auth = new byte[0]; sendAndWaitForResponse(CMD_AUTH, auth); } public void saveConf() throws IOException { sendAndWaitForResponse(CMD_SAVECONF, new byte[0]); } public void signal(String signal) throws IOException { int sig; signal = signal.toUpperCase(); if (signal.equals("HUP") || signal.equals("RELOAD")) sig = SIGNAL_HUP; else if (signal.equals("INT") || signal.equals("SHUTDOWN")) sig = SIGNAL_HUP; else if (signal.equals("USR1") || signal.equals("DUMP")) sig = SIGNAL_HUP; else if (signal.equals("USR2") || signal.equals("DEBUG")) sig = SIGNAL_HUP; else if (signal.equals("TERM") || signal.equals("HALT")) sig = SIGNAL_HUP; else throw new Error("Unrecognized value for signal()"); byte[] ba = { (byte)sig }; sendAndWaitForResponse(CMD_SIGNAL, ba); } public Map mapAddresses(Collection kvLines) throws IOException { StringBuffer sb = new StringBuffer(); for (Iterator it = kvLines.iterator(); it.hasNext(); ) { sb.append((String)it.next()).append("\n"); } Cmd c = sendAndWaitForResponse(CMD_MAPADDRESS, sb.toString().getBytes()); Map result = new HashMap(); List lst = new ArrayList(); Bytes.splitStr(lst, c.body, 0, (byte)'\n'); for (Iterator it = lst.iterator(); it.hasNext(); ) { String kv = (String) it.next(); int idx = kv.indexOf(' '); result.put(kv.substring(0, idx), kv.substring(idx+1)); } return result; } public Map getInfo(Collection keys) throws IOException { StringBuffer sb = new StringBuffer(); for (Iterator it = keys.iterator(); it.hasNext(); ) { sb.append(((String)it.next())+"\n"); } Cmd c = sendAndWaitForResponse(CMD_GETINFO, sb.toString().getBytes(), CMD_INFOVALUE); Map m = new HashMap(); List lst = new ArrayList(); Bytes.splitStr(lst, c.body, 0, (byte)0); if ((lst.size() % 2) != 0) throw new TorControlSyntaxError( "Odd number of substrings from GETINFO"); for (Iterator it = lst.iterator(); it.hasNext(); ) { Object k = it.next(); Object v = it.next(); m.put(k, v); } return m; } public int extendCircuit(String circID, String path) throws IOException { byte[] p = path.getBytes(); byte[] ba = new byte[p.length+4]; Bytes.setU32(ba, 0, (int)Long.parseLong(circID)); System.arraycopy(p, 0, ba, 4, p.length); Cmd c = sendAndWaitForResponse(CMD_EXTENDCIRCUIT, ba); return Bytes.getU32(c.body, 0); } public void attachStream(String streamID, String circID) throws IOException { byte[] ba = new byte[8]; Bytes.setU32(ba, 0, (int)Long.parseLong(streamID)); Bytes.setU32(ba, 4, (int)Long.parseLong(circID)); sendAndWaitForResponse(CMD_ATTACHSTREAM, ba); } /** Tell Tor about the server descriptor in 'desc' */ public String postDescriptor(String desc) throws IOException { return new String( sendAndWaitForResponse(CMD_POSTDESCRIPTOR, desc.getBytes()).body); } /** Tell Tor to change the target of the stream identified by 'streamID' * to 'address'. */ public void redirectStream(String streamID, String address) throws IOException { byte[] addr = address.getBytes(); byte[] ba = new byte[addr.length+4]; Bytes.setU32(ba, 0, (int)Long.parseLong(streamID)); System.arraycopy(addr, 0, ba, 4, addr.length); sendAndWaitForResponse(CMD_REDIRECTSTREAM, ba); } /** Tell Tor to close the stream identified by 'streamID'. */ public void closeStream(String streamID, byte reason, byte flags) throws IOException { byte[] ba = new byte[6]; Bytes.setU32(ba, 0, (int)Long.parseLong(streamID)); ba[4] = reason; ba[5] = flags; sendAndWaitForResponse(CMD_CLOSESTREAM, ba); } /** Tell Tor to close the circuit identified by 'streamID'. */ public void closeCircuit(String circID, byte flags) throws IOException { byte[] ba = new byte[5]; Bytes.setU32(ba, 0, (int)Long.parseLong(circID)); ba[4] = flags; sendAndWaitForResponse(CMD_CLOSECIRCUIT, ba); } } From nickm at seul.org Tue Jun 21 21:52:20 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 21 Jun 2005 17:52:20 -0400 (EDT) Subject: [or-cvs] Backport MAPADDRESS v0 control fix Message-ID: <20050621215220.2060F14081A9@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv17371/src/or Modified Files: Tag: tor-0_1_0-patches control.c Log Message: Backport MAPADDRESS v0 control fix Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.83.2.1 retrieving revision 1.83.2.2 diff -u -d -r1.83.2.1 -r1.83.2.2 --- control.c 5 Jun 2005 14:31:37 -0000 1.83.2.1 +++ control.c 21 Jun 2005 21:52:17 -0000 1.83.2.2 @@ -582,7 +582,7 @@ log_fn(LOG_WARN,"Skipping invalid argument '%s' in MapAddress msg",to); } else if (!strcmp(from, ".") || !strcmp(from, "0.0.0.0")) { const char *addr = addressmap_register_virtual_address( - strcmp(from,".") ? RESOLVED_TYPE_HOSTNAME : RESOLVED_TYPE_IPV4, + !strcmp(from,".") ? RESOLVED_TYPE_HOSTNAME : RESOLVED_TYPE_IPV4, tor_strdup(to)); if (!addr) { log_fn(LOG_WARN, From nickm at seul.org Tue Jun 21 21:52:53 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 21 Jun 2005 17:52:53 -0400 (EDT) Subject: [or-cvs] Remove generated file from 0.1.0 CVS Message-ID: <20050621215253.CD76214081A9@moria.seul.org> Update of /home/or/cvsroot/tor/contrib/osx In directory moria:/tmp/cvs-serv17476/contrib/osx Removed Files: Tag: tor-0_1_0-patches TorStartupDesc.plist Log Message: Remove generated file from 0.1.0 CVS --- TorStartupDesc.plist DELETED --- From arma at seul.org Tue Jun 21 22:10:16 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 21 Jun 2005 18:10:16 -0400 (EDT) Subject: [or-cvs] fix links from index.de page Message-ID: <20050621221016.2B46114081A9@moria.seul.org> Update of /home2/or/cvsroot/website/de In directory moria:/home/arma/work/onion/cvs/website/de Modified Files: index.de.html Log Message: fix links from index.de page Index: index.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/index.de.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- index.de.html 21 Jun 2005 21:23:22 -0000 1.7 +++ index.de.html 21 Jun 2005 22:10:14 -0000 1.8 @@ -42,11 +42,11 @@

      Schaue mal im #tor IRC-Kanal auf -irc.oftc.net vorbei oder +irc.oftc.net vorbei oder schreibe eine E-Mail an tor-volunteer at freehaven.net, wenn du helfen m?chtest!

      Index: developers.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/developers.de.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- developers.de.html 10 Jun 2005 21:12:30 -0000 1.2 +++ developers.de.html 21 Jun 2005 22:10:54 -0000 1.3 @@ -49,7 +49,7 @@

      Bl?ttere durch das CVS Repositorium von Tor: (das muss nicht notwendigerweise funktionieren oder kompilieren)

      -

      Das Handbuch zur letzten stabilen +

      Das Handbuch zur letzten stabilen Version bietet detaillierte Anweisungen, wie Tor zu installieren und zu nutzen ist. Es schliesst die Konfigurationsoptionen f?r Client und Server mit ein.
      Wenn du die CVS-Version betreibst, gibt es auch ein Handbuch. + href="tor-manual-cvs.html">Handbuch.

      Wirf einen Blick auf die Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: developers.html Log Message: put our 0.1.1.x roadmap up for all to see and stop linking to HACKING Index: developers.html =================================================================== RCS file: /home2/or/cvsroot/website/developers.html,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- developers.html 25 May 2005 02:45:58 -0000 1.25 +++ developers.html 21 Jun 2005 23:47:56 -0000 1.26 @@ -59,10 +59,25 @@

    -

    -Read the Guide to Tor's source code for an -overview of the various files and components of the system. -

    +

    Here's the current roadmap for the 0.1.1.x release:

    +
      +
    • Reduce CPU load on servers.
    • +
    • Continue decentralizing the directory. +
        +
      • Gather more permanent dirservers and put their keys into the code.
      • +
      • Need to solve what 'verified' means: it means the nickname is + registered, but otherwise we treat servers the same.
      • +
      • A way for clients to partition the set of servers in a safe way: + so they don't have to learn all of them but so they're not easily + partitionable. Write it down, but probably not do it yet.
      • +
    • +
    • Helper nodes (at least preliminary).
    • +
    • Enclaves (at least preliminary).
    • +
    • Launch the GUI contest.
    • +
    • Something, anything, for sys tray on Windows.
    • +
    • Get on some websites: indymedia.org. others?
    • +
    • Research: scalability, keep thinking about end-to-end attacks.
    • +

    The list of stuff the developers know they need to do. From arma at seul.org Mon Jun 6 20:27:36 2005 From: arma at seul.org (arma at seul.org) Date: Mon, 6 Jun 2005 16:27:36 -0400 (EDT) Subject: [or-cvs] bump cvs to 0.1.1.0-alpha-cvs Message-ID: <20050606202736.BE699140824E@moria.seul.org> Update of /home2/or/cvsroot/tor/contrib In directory moria:/home/arma/work/onion/cvs/tor/contrib Modified Files: tor.nsi Log Message: bump cvs to 0.1.1.0-alpha-cvs Index: tor.nsi =================================================================== RCS file: /home2/or/cvsroot/tor/contrib/tor.nsi,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- tor.nsi 23 May 2005 05:47:21 -0000 1.41 +++ tor.nsi 6 Jun 2005 20:27:34 -0000 1.42 @@ -31,7 +31,7 @@ !include "MUI.nsh" -!define VERSION "0.1.0.8-rc" +!define VERSION "0.1.1.0-alpha-cvs" !define INSTALLER "tor-${VERSION}-win32.exe" !define WEBSITE "http://tor.eff.org/" From arma at seul.org Wed Jun 22 00:45:09 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 21 Jun 2005 20:45:09 -0400 (EDT) Subject: [or-cvs] mention antinat on users.html Message-ID: <20050622004509.55A001408EC3@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: users.html Log Message: mention antinat on users.html Index: users.html =================================================================== RCS file: /home2/or/cvsroot/website/users.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- users.html 8 Jun 2005 05:13:36 -0000 1.21 +++ users.html 22 Jun 2005 00:45:07 -0000 1.22 @@ -82,6 +82,7 @@ Here's a brief list of programs you might want to use in association with Tor:

    +Antinat: seems to be a socks client library (and server, but you'd only want the client side) that supports socks4a.
    Connect: adds proxy support to SSH. (Win32, Linux, BSD, OS X)
    Dsocks: SOCKS client wrapper with enough support to use the built-in OpenSSH or Tor local SOCKS proxy. (BSD)
    Freecap: redirects traffic to a SOCKS server. graphical. (Win32)
    From arma at seul.org Wed Jun 22 21:59:13 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 22 Jun 2005 17:59:13 -0400 (EDT) Subject: [or-cvs] make the log message less scary when all the dirservers are Message-ID: <20050622215913.D222314080CE@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: directory.c Log Message: make the log message less scary when all the dirservers are temporarily unreachable Index: directory.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/directory.c,v retrieving revision 1.235 retrieving revision 1.236 diff -u -d -r1.235 -r1.236 --- directory.c 20 Jun 2005 23:04:13 -0000 1.235 +++ directory.c 22 Jun 2005 21:59:11 -0000 1.236 @@ -196,7 +196,7 @@ else if (ds) directory_initiate_command_trusted_dir(ds, purpose, priv, resource, NULL, 0); else { - log_fn(LOG_NOTICE,"No running dirservers known. Not trying. (purpose %d)", + log_fn(LOG_NOTICE,"No running dirservers known. Will try again later. (purpose %d)", purpose); if (directconn) { /* remember we tried them all and failed. */ From thomass at seul.org Thu Jun 23 00:15:16 2005 From: thomass at seul.org (thomass at seul.org) Date: Wed, 22 Jun 2005 20:15:16 -0400 (EDT) Subject: [or-cvs] German updates Message-ID: <20050623001516.0F0B014081E1@moria.seul.org> Update of /home2/or/cvsroot/website/de In directory moria:/tmp/cvs-serv9252 Modified Files: developers.de.html users.de.html Log Message: German updates Index: developers.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/developers.de.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- developers.de.html 21 Jun 2005 22:10:54 -0000 1.3 +++ developers.de.html 23 Jun 2005 00:15:13 -0000 1.4 @@ -1,4 +1,4 @@ - + @@ -66,9 +66,27 @@

  • -

    Lies den F?hrer zum Quellcode von -Tor f?r einen ?berblick der verschiedenen Dateien und Komponenten -des Systems.

    +

    Hier ist die aktuelle Roadmap f?r die Version 0.1.1.x:

    +
      +
    • CPU-Last auf den Servern reduzieren.
    • +
    • Das Verzeichnis weiter dezentralisieren: +
        +
      • Mehr permanente Verzeichnisserver sammeln und ihre Schl?ssel in den Code + packen.
      • +
      • Es muss gekl?rt werden, was 'verified' bedeutet: Es bedeutet, dass der + Nickname registriert ist.
      • +
      • Eine Methode f?r Clients, die Anzahl der Server in einer sicheren Weise + zu partitionieren: So m?ssen sie nicht alle lernen und sind nicht so leicht + partitionierbar. Idee aufschreiben, aber wahrscheinlich noch nicht + umsetzen.
      • +
    • +
    • Helferknoten (zumindest vorl?ufig).
    • +
    • Enklaven (zumindest vorl?ufig).
    • +
    • Einen GUI-Wettbewerb ins Leben rufen.
    • +
    • Irgendwas f?r den Systray in Windows.
    • +
    • Webseiten, die auf Tor verweisen: indymedia.org. andere?
    • +
    • Forschung: Skalierbarkeit, an Ende-zu-Ende-Attacken denken.
    • +

    Liste von Sachen, die noch von den Index: users.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/users.de.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- users.de.html 10 Jun 2005 21:12:30 -0000 1.2 +++ users.de.html 23 Jun 2005 00:15:13 -0000 1.3 @@ -1,4 +1,4 @@ - + @@ -96,6 +96,9 @@ Hier ist eine kurze Liste von Programmen, die du vielleicht in Verbindung mit Tor nutzen m?chtest:

    +Antinat: scheint eine +SOCKS-Bibliothek f?r Clients (auch f?r Server, doch du brauchst nur den Client) +zu sein, die SOCK4A unterst?tzt
    Connect: f?gt SSH (Win32, Linux, BSD, OS X) Proxyunterst?tzung hinzu.
    Dsocks: ein SOCKS Clientwrapper From thomass at seul.org Thu Jun 23 00:18:21 2005 From: thomass at seul.org (thomass at seul.org) Date: Wed, 22 Jun 2005 20:18:21 -0400 (EDT) Subject: [or-cvs] tor-manual-cvs.html update Message-ID: <20050623001821.42E6214081EF@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv9393 Modified Files: tor-manual-cvs.html Log Message: tor-manual-cvs.html update Index: tor-manual-cvs.html =================================================================== RCS file: /home2/or/cvsroot/website/tor-manual-cvs.html,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- tor-manual-cvs.html 11 Jun 2005 12:24:20 -0000 1.11 +++ tor-manual-cvs.html 23 Jun 2005 00:18:19 -0000 1.12 @@ -148,6 +148,9 @@ minutes for clients, 15 minutes for servers)

    User UID
    On startup, setuid to this user. +
    HardwareAccel 0|1
    +If non-zero, try to use crypto hardware acceleration when +available. (Default: 1. )

      @@ -534,6 +537,6 @@ This document was created by man2html, using the manual pages.
    -Time: 12:23:16 GMT, June 11, 2005 +Time: 00:17:30 GMT, June 23, 2005 From arma at seul.org Thu Jun 23 07:57:45 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 23 Jun 2005 03:57:45 -0400 (EDT) Subject: [or-cvs] we were printing the number of idle dns workers incorrectly. Message-ID: <20050623075745.C31D014081F8@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: dns.c Log Message: we were printing the number of idle dns workers incorrectly. Index: dns.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/dns.c,v retrieving revision 1.158 retrieving revision 1.159 diff -u -d -r1.158 -r1.159 --- dns.c 11 Jun 2005 18:52:11 -0000 1.158 +++ dns.c 23 Jun 2005 07:57:43 -0000 1.159 @@ -913,7 +913,7 @@ while (num_dnsworkers > num_dnsworkers_busy+MAX_IDLE_DNSWORKERS) { /* too many idle? */ /* cull excess workers */ log_fn(LOG_NOTICE,"%d of %d dnsworkers are idle. Killing one.", - num_dnsworkers-num_dnsworkers_needed, num_dnsworkers); + num_dnsworkers-num_dnsworkers_busy, num_dnsworkers); dnsconn = connection_get_by_type_state(CONN_TYPE_DNSWORKER, DNSWORKER_STATE_IDLE); tor_assert(dnsconn); connection_mark_for_close(dnsconn); From arma at seul.org Thu Jun 23 18:59:41 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 23 Jun 2005 14:59:41 -0400 (EDT) Subject: [or-cvs] start listing the freebsd package again Message-ID: <20050623185941.0A6961408F8C@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: download.html Log Message: start listing the freebsd package again Index: download.html =================================================================== RCS file: /home2/or/cvsroot/website/download.html,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- download.html 13 Jun 2005 02:34:53 -0000 1.108 +++ download.html 23 Jun 2005 18:59:38 -0000 1.109 @@ -154,8 +154,7 @@ A guide to chrooting is available in the Wiki.


    -

    FreeBSD: -ports are obsolete, please install from source. +

    FreeBSD: portinstall -s security/tor

    OpenBSD: cd /usr/ports/net/tor && make && make install (guide to chrooting)

    From nickm at seul.org Thu Jun 23 21:22:06 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 23 Jun 2005 17:22:06 -0400 (EDT) Subject: [or-cvs] Implement (modulo bugs) v1 control protocol in java Message-ID: <20050623212206.67C8E14080B0@moria.seul.org> Update of /home/or/cvsroot/control/java/net/freehaven/tor/control In directory moria:/tmp/cvs-serv28436/java/net/freehaven/tor/control Modified Files: Bytes.java EventHandler.java PasswordDigest.java TorControlConnection.java TorControlConnection0.java TorControlError.java Added Files: TorControlConnection1.java Log Message: Implement (modulo bugs) v1 control protocol in java Index: Bytes.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/Bytes.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Bytes.java 21 Jun 2005 21:49:30 -0000 1.2 +++ Bytes.java 23 Jun 2005 21:22:04 -0000 1.3 @@ -3,7 +3,9 @@ // See LICENSE file for copying information package net.freehaven.tor.control; +import java.util.ArrayList; import java.util.List; +import java.util.StringTokenizer; /** * Static class to do bytewise structure manipulation in Java. @@ -79,5 +81,33 @@ } } + /** + * Read bytes from 'ba' starting at 'pos', dividing them into strings + * along the character in 'split' and writing them into 'lst' + */ + public static List splitStr(List lst, String str) { + if (lst == null) + lst = new ArrayList(); + StringTokenizer st = new StringTokenizer(str); + while (st.hasMoreTokens()) + lst.add(st.nextToken()); + return lst; + } + + private static final char[] NYBBLES = { + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' + }; + + public static final String hex(byte[] ba) { + StringBuffer buf = new StringBuffer(); + for (int i = 0; i < ba.length; ++i) { + int b = ((int)ba[i]) & 0xff; + buf.append(NYBBLES[b >> 4]); + buf.append(NYBBLES[b&0x0f]); + } + return buf.toString(); + } + private Bytes() {}; } Index: EventHandler.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/EventHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- EventHandler.java 21 Jun 2005 21:49:30 -0000 1.2 +++ EventHandler.java 23 Jun 2005 21:22:04 -0000 1.3 @@ -37,5 +37,11 @@ /** * Invoked when Tor logs a message. */ - public void message(int type, String msg); + public void message(String severity, String msg); + /** + * Invoked in an unspecified handler. + */ + public void unrecognized(String type, String msg); + } + Index: PasswordDigest.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/PasswordDigest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PasswordDigest.java 4 Jun 2005 02:42:55 -0000 1.1 +++ PasswordDigest.java 23 Jun 2005 21:22:04 -0000 1.2 @@ -97,13 +97,7 @@ /** Return a hexadecimal encoding of a byte array. */ // XXX There must be a better way to do this in Java. private static final String encodeBytes(byte[] ba) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < ba.length; ++i) { - int b = ((int)ba[i]) & 0xff; - buf.append(NYBBLES[b >> 4]); - buf.append(NYBBLES[b&0x0f]); - } - return buf.toString(); + return Bytes.hex(ba); } } \ No newline at end of file Index: TorControlConnection.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlConnection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TorControlConnection.java 21 Jun 2005 21:49:30 -0000 1.2 +++ TorControlConnection.java 23 Jun 2005 21:22:04 -0000 1.3 @@ -41,7 +41,6 @@ this.waiters = new LinkedList(); } - /** Set the EventHandler object that will be notified of any * events Tor delivers to this connection. To make Tor send us * events, call listenForEvents(). */ @@ -155,7 +154,7 @@ * Tell Tor to extend the circuit identified by 'circID' through the * servers named in the list 'path'. */ - public abstract int extendCircuit(String circID, String path) throws IOException; + public abstract String extendCircuit(String circID, String path) throws IOException; /** * Tell Tor to attach the stream identified by 'streamID' to the circuit @@ -173,11 +172,11 @@ /** Tell Tor to close the stream identified by 'streamID'. */ - public abstract void closeStream(String streamID, byte reason, byte flags) + public abstract void closeStream(String streamID, byte reason) throws IOException; /** Tell Tor to close the circuit identified by 'streamID'. */ - public abstract void closeCircuit(String circID, byte flags) throws IOException; + public abstract void closeCircuit(String circID, boolean ifUnused) throws IOException; } Index: TorControlConnection0.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlConnection0.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorControlConnection0.java 21 Jun 2005 21:49:30 -0000 1.1 +++ TorControlConnection0.java 23 Jun 2005 21:22:04 -0000 1.2 @@ -27,8 +27,6 @@ Cmd(int t, int l) { type = t; body = new byte[l]; }; } - - /** Create a new TorControlConnection to communicate with Tor over * a given socket. After calling this constructor, it is typical to * call launchThread and authenticate. */ @@ -222,11 +220,19 @@ handler.newDescriptors(lst); break; case EVENT_MSG_DEBUG: + handler.message("DEBUG", Bytes.getNulTerminatedStr(c.body, 2)); + break; case EVENT_MSG_INFO: + handler.message("INFO", Bytes.getNulTerminatedStr(c.body, 2)); + break; case EVENT_MSG_NOTICE: + handler.message("NOTICE", Bytes.getNulTerminatedStr(c.body, 2)); + break; case EVENT_MSG_WARN: + handler.message("WARN", Bytes.getNulTerminatedStr(c.body, 2)); + break; case EVENT_MSG_ERROR: - handler.message(type, Bytes.getNulTerminatedStr(c.body, 2)); + handler.message("ERR", Bytes.getNulTerminatedStr(c.body, 2)); break; default: throw new TorControlSyntaxError("Unrecognized event type."); @@ -345,13 +351,13 @@ return m; } - public int extendCircuit(String circID, String path) throws IOException { + public String extendCircuit(String circID, String path) throws IOException { byte[] p = path.getBytes(); byte[] ba = new byte[p.length+4]; Bytes.setU32(ba, 0, (int)Long.parseLong(circID)); System.arraycopy(p, 0, ba, 4, p.length); Cmd c = sendAndWaitForResponse(CMD_EXTENDCIRCUIT, ba); - return Bytes.getU32(c.body, 0); + return Integer.toString(Bytes.getU32(c.body, 0)); } public void attachStream(String streamID, String circID) @@ -381,21 +387,21 @@ /** Tell Tor to close the stream identified by 'streamID'. */ - public void closeStream(String streamID, byte reason, byte flags) + public void closeStream(String streamID, byte reason) throws IOException { byte[] ba = new byte[6]; Bytes.setU32(ba, 0, (int)Long.parseLong(streamID)); ba[4] = reason; - ba[5] = flags; + ba[5] = (byte)0; sendAndWaitForResponse(CMD_CLOSESTREAM, ba); } /** Tell Tor to close the circuit identified by 'streamID'. */ - public void closeCircuit(String circID, byte flags) throws IOException { + public void closeCircuit(String circID, boolean ifUnused) throws IOException { byte[] ba = new byte[5]; Bytes.setU32(ba, 0, (int)Long.parseLong(circID)); - ba[4] = flags; + ba[4] = (byte)(ifUnused? 1 : 0); sendAndWaitForResponse(CMD_CLOSECIRCUIT, ba); } --- NEW FILE: TorControlConnection1.java --- // $Id: TorControlConnection1.java,v 1.1 2005/06/23 21:22:04 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.StringTokenizer; /** DOCDOC */ public class TorControlConnection1 extends TorControlConnection implements TorControlCommands { protected java.io.BufferedReader input; protected java.io.Writer output; static class ReplyLine { public String status; public String msg; public String rest; ReplyLine(String status, String msg, String rest) { this.status = status; this.msg = msg; this.rest = rest; } } /** Create a new TorControlConnection to communicate with Tor over * a given socket. After calling this constructor, it is typical to * call launchThread and authenticate. */ public TorControlConnection1(java.net.Socket connection) throws IOException { this(connection.getInputStream(), connection.getOutputStream()); } /** Create a new TorControlConnection to communicate with Tor over * an arbitrary pair of data streams. */ public TorControlConnection1(java.io.InputStream i, java.io.OutputStream o) throws IOException { this(new java.io.InputStreamReader(i), new java.io.OutputStreamWriter(o)); } public TorControlConnection1(java.io.Reader i, java.io.Writer o) throws IOException { this.output = o; if (i instanceof java.io.BufferedReader) this.input = (java.io.BufferedReader) i; else this.input = new java.io.BufferedReader(i); this.waiters = new LinkedList(); } protected final void writeEscaped(String s) throws IOException { StringTokenizer st = new StringTokenizer(s, "\n"); while (st.hasMoreTokens()) { String line = st.nextToken(); if (line.startsWith(".")) output.write("."); output.write(line); if (line.endsWith("\r")) output.write("\n"); else output.write("\r\n"); } output.write(".\r\n"); } protected static final String quote(String s) { StringBuffer sb = new StringBuffer("\""); for (int i = 0; i < s.length(); ++i) { char c = s.charAt(i); switch (c) { case '\r': case '\n': case '\\': case '\"': sb.append('\\'); } sb.append(c); } sb.append('\"'); return sb.toString(); } protected final ArrayList readReply() throws IOException { ArrayList reply = new ArrayList(); char c; do { String line = input.readLine(); if (line.length() < 4) throw new TorControlSyntaxError("Line too short"); String status = line.substring(0,3); c = line.charAt(3); String msg = line.substring(4); String rest = null; if (c == '+') { StringBuffer data = new StringBuffer(); while (true) { line = input.readLine(); if (line.equals(".")) break; else if (line.startsWith(".")) line = line.substring(1); data.append(line).append('\n'); } rest = data.toString(); } reply.add(new ReplyLine(status, msg, rest)); } while (c != ' '); return reply; } /** helper: implement the main background loop. */ protected void react() throws IOException { while (true) { ArrayList lst = readReply(); if (((ReplyLine)lst.get(0)).status.startsWith("6")) handleEvent(lst); else { Waiter w; synchronized (waiters) { w = (Waiter) waiters.removeFirst(); } w.setResponse(lst); } } } protected synchronized ArrayList sendAndWaitForResponse(String s,String rest) throws IOException { Waiter w = new Waiter(); synchronized (waiters) { output.write(s); if (rest != null) writeEscaped(rest); waiters.addLast(w); } ArrayList lst = (ArrayList) w.getResponse(); for (Iterator i = lst.iterator(); i.hasNext(); ) { ReplyLine c = (ReplyLine) i.next(); if (! c.status.startsWith("2")) throw new TorControlError("Error reply: "+c.msg); } return lst; } /** Helper: decode a CMD_EVENT command and dispatch it to our * EventHandler (if any). */ protected void handleEvent(ArrayList events) { if (handler == null) return; for (Iterator i = events.iterator(); i.hasNext(); ) { ReplyLine line = (ReplyLine) i.next(); int idx = line.msg.indexOf(' '); String tp = line.msg.substring(0, idx).toUpperCase(); String rest = line.msg.substring(idx+1); if (tp.equals("CIRC")) { List lst = Bytes.splitStr(null, rest); handler.circuitStatus((String)lst.get(1), (String)lst.get(0), (String)lst.get(2)); } else if (tp.equals("STREAM")) { List lst = Bytes.splitStr(null, rest); handler.streamStatus((String)lst.get(1), (String)lst.get(0), (String)lst.get(3)); // XXXX circID. } else if (tp.equals("ORCONN")) { List lst = Bytes.splitStr(null, rest); handler.orConnStatus((String)lst.get(1), (String)lst.get(0)); } else if (tp.equals("BW")) { List lst = Bytes.splitStr(null, rest); handler.bandwidthUsed(Integer.parseInt((String)lst.get(0)), Integer.parseInt((String)lst.get(1))); } else if (tp.equals("NEWDESC")) { List lst = Bytes.splitStr(null, rest); handler.newDescriptors(lst); } else if (tp.equals("DEBUG") || tp.equals("INFO") || tp.equals("NOTICE") || tp.equals("WARN") || tp.equals("ERR")) { handler.message(tp, rest); } else { handler.unrecognized(tp, rest); } } } /** Change the values of the configuration options stored in * 'kvList'. (The format is "key value"). */ public void setConf(Collection kvList) throws IOException { if (kvList.size() == 0) return; StringBuffer b = new StringBuffer("SETCONF"); for (Iterator it = kvList.iterator(); it.hasNext(); ) { String kv = (String) it.next(); int i = kv.indexOf(' '); if (i == -1) b.append(" ").append(kv); b.append(" ").append(kv.substring(0,i)).append("=") .append(quote(kv.substring(i+1))); } b.append("\r\n"); sendAndWaitForResponse(b.toString(), null); } public Map getConf(Collection keys) throws IOException { StringBuffer sb = new StringBuffer("GETCONF"); for (Iterator it = keys.iterator(); it.hasNext(); ) { String key = (String) it.next(); sb.append(" ").append(key); } sb.append("\r\n"); ArrayList lst = sendAndWaitForResponse(sb.toString(), null); Map result = new HashMap(); for (Iterator it = lst.iterator(); it.hasNext(); ) { String kv = (String) it.next(); int idx = kv.indexOf('='); result.put(kv.substring(0, idx), kv.substring(idx+1)); } return result; } public void setEvents(List events) throws IOException { StringBuffer sb = new StringBuffer("SETEVENTS"); for (Iterator it = events.iterator(); it.hasNext(); ) { String event = (String) it.next(); sb.append(" ").append(event); } sb.append("\r\n"); sendAndWaitForResponse(sb.toString(), null); } public void authenticate(byte[] auth) throws IOException { String cmd = "AUTHENTICATE " + Bytes.hex(auth) + "\r\n"; sendAndWaitForResponse(cmd, null); } public void saveConf() throws IOException { sendAndWaitForResponse("SAVECONF\r\n", null); } public void signal(String signal) throws IOException { String cmd = "AUTHENTICATE " + signal + "\r\n"; sendAndWaitForResponse(cmd, null); } public Map mapAddresses(Collection kvLines) throws IOException { StringBuffer sb = new StringBuffer("MAPADDRESS"); for (Iterator it = kvLines.iterator(); it.hasNext(); ) { String kv = (String) it.next(); int i = kv.indexOf(' '); sb.append(" ").append(kv.substring(0,i)).append("=") .append(quote(kv.substring(i+1))); } sb.append("\r\n"); ArrayList lst = sendAndWaitForResponse(sb.toString(), null); Map result = new HashMap(); for (Iterator it = lst.iterator(); it.hasNext(); ) { String kv = ((ReplyLine) it.next()).msg; int idx = kv.indexOf('='); result.put(kv.substring(0, idx), kv.substring(idx+1)); } return result; } public Map getInfo(Collection keys) throws IOException { StringBuffer sb = new StringBuffer("GETINFO"); for (Iterator it = keys.iterator(); it.hasNext(); ) { sb.append(" ").append((String)it.next()); } sb.append("\r\n"); ArrayList lst = sendAndWaitForResponse(sb.toString(), null); Map m = new HashMap(); for (Iterator it = lst.iterator(); it.hasNext(); ) { ReplyLine line = (ReplyLine) it.next(); int idx = line.msg.indexOf('='); if (idx<0) break; String k = line.msg.substring(0,idx); Object v; if (line.rest != null) { v = line.rest; } else { v = line.msg.substring(idx+1); } m.put(k, v); } return m; } public String extendCircuit(String circID, String path) throws IOException { ArrayList lst = sendAndWaitForResponse( "EXTENDCIRCUIT "+circID+" "+path+"\r\n", null); return ((ReplyLine)lst.get(0)).msg; } public void attachStream(String streamID, String circID) throws IOException { sendAndWaitForResponse("ATTACHSTREAM "+streamID+" "+circID+"\r\n", null); } /** Tell Tor about the server descriptor in 'desc' */ public String postDescriptor(String desc) throws IOException { ArrayList lst = sendAndWaitForResponse("+POSTDESCRIPTOR\r\n", desc); return ((ReplyLine)lst.get(0)).msg; } /** Tell Tor to change the target of the stream identified by 'streamID' * to 'address'. */ public void redirectStream(String streamID, String address) throws IOException { sendAndWaitForResponse("REDIRECTSTREAM "+streamID+" "+address+"\r\n", null); } /** Tell Tor to close the stream identified by 'streamID'. */ public void closeStream(String streamID, byte reason) throws IOException { sendAndWaitForResponse("CLOSESTREAM "+streamID+" "+reason+"\r\n",null); } /** Tell Tor to close the circuit identified by 'streamID'. */ public void closeCircuit(String circID, boolean ifUnused) throws IOException { sendAndWaitForResponse("CLOSECIRCUIT "+circID+ (ifUnused?" IFUNUSED":"")+"\r\n", null); } } Index: TorControlError.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlError.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorControlError.java 4 Jun 2005 02:42:55 -0000 1.1 +++ TorControlError.java 23 Jun 2005 21:22:04 -0000 1.2 @@ -12,11 +12,16 @@ super(s); errorType = type; } + public TorControlError(String s) { + this(-1, s); + } public int getErrorType() { return errorType; } public String getErrorMsg() { try { + if (errorType == -1) + return null; return TorControlCommands.ERROR_MSGS[errorType]; } catch (ArrayIndexOutOfBoundsException ex) { return "Unrecongized error #"+errorType; From nickm at seul.org Thu Jun 23 21:36:08 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 23 Jun 2005 17:36:08 -0400 (EDT) Subject: [or-cvs] Fix some-but-not-all compile errors in demo code Message-ID: <20050623213608.627D1140803D@moria.seul.org> Update of /home/or/cvsroot/control/java/net/freehaven/tor/control/examples In directory moria:/tmp/cvs-serv28887/net/freehaven/tor/control/examples Modified Files: DebuggingEventHandler.java Main.java Log Message: Fix some-but-not-all compile errors in demo code Index: DebuggingEventHandler.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/examples/DebuggingEventHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DebuggingEventHandler.java 4 Jun 2005 02:42:55 -0000 1.1 +++ DebuggingEventHandler.java 23 Jun 2005 21:36:06 -0000 1.2 @@ -3,11 +3,11 @@ // See LICENSE file for copying information package net.freehaven.tor.control.examples; -import net.freehaven.tor.control.*; import java.io.PrintWriter; import java.util.Iterator; +import net.freehaven.tor.control.EventHandler; -public class DebuggingEventHandler implements EventHandler, TorControlCommands { +public class DebuggingEventHandler implements EventHandler { protected PrintWriter out; @@ -15,17 +15,14 @@ out = p; } - public void circuitStatus(int status, int circID, String path) { - out.println("Circuit "+Integer.toHexString(circID)+" is now "+ - CIRC_STATUS_NAMES[status]+" (path="+path+")"); + public void circuitStatus(String status, String circID, String path) { + out.println("Circuit "+circID+" is now "+status+" (path="+path+")"); } - public void streamStatus(int status, int streamID, String target) { - out.println("Stream "+Integer.toHexString(streamID)+" is now "+ - STREAM_STATUS_NAMES[status]+" (target="+target+")"); + public void streamStatus(String status, String streamID, String target) { + out.println("Stream "+streamID+" is now "+status+" (target="+target+")"); } - public void orConnStatus(int status, String orName) { - out.println("OR connection to "+orName+" is now "+ - OR_CONN_STATUS_NAMES[status]); + public void orConnStatus(String status, String orName) { + out.println("OR connection to "+orName+" is now "+status); } public void bandwidthUsed(long read, long written) { out.println("Bandwidth usage: "+read+" bytes read; "+ @@ -36,18 +33,12 @@ for (Iterator i = orList.iterator(); i.hasNext(); ) out.println(" "+i.next()); } - public void message(int type, String msg) { - String tp; - switch (type) { - case EVENT_MSG_INFO: tp = "info"; break; - case EVENT_MSG_NOTICE: tp = "notice"; break; - case EVENT_MSG_WARN: tp = "warn"; break; - case EVENT_MSG_ERROR: tp = "error"; break; - default: - throw new Error("EventHandler.message() called with bad type: "+ - type); - } - out.println("["+tp+"] "+msg.trim()); + public void message(String type, String msg) { + out.println("["+type+"] "+msg.trim()); + } + + public void unrecognized(String type, String msg) { + out.println("unrecognized event ["+type+"] "+msg.trim()); } } \ No newline at end of file Index: Main.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/examples/Main.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Main.java 4 Jun 2005 02:42:55 -0000 1.1 +++ Main.java 23 Jun 2005 21:36:06 -0000 1.2 @@ -137,22 +137,8 @@ public static void signal(String[] args) throws IOException { // Usage signal [reload|shutdown|dump|debug|halt] - TorControlConnection conn = getConnection(args); - byte sig; - if (args[1].equals("reload")) - sig = SIGNAL_HUP; - else if (args[1].equals("shutdown")) - sig = SIGNAL_INT; - else if (args[1].equals("dump")) - sig = SIGNAL_USR1; - else if (args[1].equals("debug")) - sig = SIGNAL_USR2; - else if (args[1].equals("halt")) - sig = SIGNAL_TERM; - else { - System.err.println("Unrecognized signal: "+args[1]); - return; - } conn.signal(sig); + TorControlConnection conn = getConnection(args, false); + conn.signal(args[1].toUpperCase()); } public static void authDemo(String[] args) throws IOException { From phobos at seul.org Fri Jun 24 01:48:00 2005 From: phobos at seul.org (phobos at seul.org) Date: Thu, 23 Jun 2005 21:48:00 -0400 (EDT) Subject: [or-cvs] Created the directory, forgot to add the files. :) Message-ID: <20050624014800.41AD61408FB1@moria.seul.org> Update of /home/or/cvsroot/website/it In directory moria:/tmp/cvs-serv8667 Added Files: contribute.it.html developers.it.html documentation.it.html download.it.html faq.it.html howitworks.it.html index.it.html people.it.html research.it.html users.it.html Log Message: Created the directory, forgot to add the files. :) --- NEW FILE: contribute.it.html --- Tor: Contribuisci

    Tor: Contribuisci


    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Necessità presenti:

    • Utenti come te per testare Tor, e permettere agli sviluppatori di malfunzionamenti o nuovi modi di .
    • Ti invitiamo a creare un server per contribuire alla crescita della rete Tor.
    • Uno speciale bisogno di programmatori Windows per il debug della piattaforma Windows.
    • Avvia un Tor hidden service e mettici dei contenuti interessanti all'interno..
    • Informa i tuoi amici! Invitali a installare servers. Invitali a offrire hidden service. Invitali a passar parola ai loro amici.
    • Cosa va documentato? Che cosa è mal documentato?
    • Ti invitiamo a far parte dell'Electronic Frontier Foundation. Maggior numero di donazioni a EFF equivalgono a un maggior grado di libertà nel mondo e incluso un ulteriore sviluppo della rete Tor.

    We also have many project-lets: short-term or self-contained tasks that would be really helpful for somebody to tackle so we can keep focusing on Tor.

    Writing project-lets:

    • Does somebody want to help maintain this website, or help with documentation, or help with managing our TODO and handling bug reports?
    • We may have too much documentation. It's spread out too far and duplicates itself in places. Can you help us consolidate?
    • Please help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
    • Sistemare le FAQ Wiki, e se conosci la risposta di qualche "FAQ senza risposta" non esitare a rispondere.

    Packaging project-lets:

    • We're always looking for better Windows installers. Specifically, it would be great if somebody were to extend our NSIS-based windows installer to include FreeCap and Privoxy.
    • Our OS X installer can't be uninstalled. Are there non-sucky OS X packagers that have uninstall capabilities? This is becoming an increasing bother.

    Organizational and application testing project-lets:

    • We've got a list of potentially useful programs you might run with Tor here. We also have the Torify howto. Can somebody try them out, simplify the explanations, expand them where they need it, document them better, and make them all-around more useful?

    Programmer and developer project-lets:

    • We need somebody to code up a GUI or other controller program, to do configuration, etc. See our control specification for details, and the rudimentary demonstration Python control script. No, we don't know what the interface should look like. You can use any license you want, but we'd recommend 3-clause BSD or maybe GPL; and we can only help out if your license conforms to the DFSG.
    • Periodically people running servers tells us they want to have one BandwidthRate during some part of the day, and a different BandwidthRate at other parts of the day. Rather than coding this inside Tor, we should have a little script that speaks via the Tor Controller Interface, and does a setconf to change the bandwidth rate. Perhaps it would run out of cron, or perhaps it would sleep until appropriate times and then do its tweak (that's probably more portable). Can somebody write one for us and we'll put it inside tor/contrib/?
    • Does somebody want to do up a patch so we can be an NT service? Or so we can go in the system tray?
    • A good (portable, fast, clean, BSD-free) asynchronous DNS library would be really handy, so we don't have to keep forking DNS worker threads to do gethostbyname.
    • Can somebody take a look at Martin's Squid and Tor page, and update it to reflect Tor's RedirectExit config option?
    • See the TODO and HACKING files in the Tor distribution for more ideas.

    Security project-lets: We need people to attack the implementation and clean it up, and also to attack the design and experiment with defenses.

    • We need somebody to fuzz Tor. Are there good libraries out there for what we want? What are the first steps? Win fame by getting credit when we put out a new release because of you!
    • Website volume fingerprinting attacks (Back et al, Hintz). Defenses include a large cell size, defensive dropping, etc. How well does each approach work?
    • The end-to-end traffic confirmation attack. We need to study long-range dummies more, along with traffic shaping. How much traffic of what sort of distribution is needed before the adversary is confident he has won?
    • It's not that hard to DoS Tor servers or dirservers. Are puzzles the right answer? What other practical approaches are there?
    • What sensitive info squeaks by privoxy? Are other html scrubbers better?

    Designer project-lets:

    • Server CPU load is high because clients keep asking to make new circuits, which uses public key crypto. Possible defenses include: using helper nodes (fixed entry nodes); rate limiting the number of create cells handled per second; having clients retry failed extensions a few times; implementing ssl sessions; and using hardware crypto when available.
    • We fear we might not work very well when servers have asymmetric bandwidth. Because Tor has separate TCP connections between each hop, if the incoming bytes are arriving just fine and the outgoing bytes are all getting dropped on the floor, the TCP push-back mechanisms don't really transmit this information back to the incoming streams. Perhaps Tor should detect when it's dropping a lot of outgoing packets, and rate-limit incoming streams to regulate this itself? We need somebody who's good with networks to simulate this and help design solutions.
    • Right now the hidden service descriptors are being stored on the dirservers, but any reliable distributed storage system would do (for example, a DHT that allows authenticated updates). Can somebody figure out our best options and decide if they're good enough?
    • How hard is it to patch bind or a DNS proxy to redirect requests to Tor via our tor-resolve socks extension? What about to convert UDP DNS requests to TCP requests and send them through Tor?
    • Tor provides anonymous connections, but if you want to keep multiple pseudonyms in practice (say, in case you frequently go to two websites and if anybody knew about both of them they would conclude it's you), we don't support that well yet. We should find a good approach and interface for handling pseudonymous profiles in Tor. See this post and followup for details.

    Drop by the #tor IRC channel at irc.oftc.net or email tor-volunteer at freehaven.net if you want to help out!

    Webmaster - $Id: contribute.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    --- NEW FILE: developers.it.html --- Tor: Developers

    Tor: Developers


    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Browse the Tor CVS repository: (which may not necessarily work or even compile)

    • Regularly updated cvs sandbox
    • ViewCVS
    • anonymous pserver access (password is guest):
      • Make a new empty directory and cd into it.
      • cvs -d :pserver:guest at cvs.seul.org:/home/or/cvsroot login
      • cvs -d :pserver:guest at cvs.seul.org:/home/or/cvsroot co tor
      • cd tor; ./autogen.sh; make; make install if you like.
      • (use -r tor-0_0_9 or equivalent to fetch a particular version.)
      • (To check out the maintenance branch, use -r tor-0_0_9-patches)

    Read the Guide to Tor's source code for an overview of the various files and components of the system.

    The list of stuff the developers know they need to do.

    The Java Anon Proxy (JAP) project has implemented the Tor client protocol in their client. More on that coming soon.

    Webmaster - $Id: developers.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    --- NEW FILE: documentation.it.html --- Tor: Documentazione

    Indice Contenuti


    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/


    Running Tor

    Design Documents

    Il design document (pubblicato su Usenix Security 2004) espone i nostri obiettivi e un'analisi della sicurezza sul design di Tor:

    Our follow-up paper on challenges in low-latency anonymity (still in draft form) details more recent experiences and directions: PDF version.

    Le specifiche offrono agli sviluppatori le informazioni necessarie per realizzare versioni compatibili con Tor:

    Il manuale dell'ultima release stabile offre informazioni dettagliate su come installare e usare Tor, incluse le configurazioni e le opzioni per client e server.
    Se intendi utilizzare la versione del CVS il manuale è disponibile qui.

    Look at the slides from the 21C3 talk, and listen to the audio from the talk.

    Vari HOWTO Docs

    Informazioni dalle Mailing List

    • La or-announce mailing list è a basso volume di traffico, la utilizziamo per annunciare le nuove release.
    • La or-talk mailing list, dove nascono la maggior parte delle discussioni, e dove si annunciano i rilasci di prerelease o release candidates.
    • La or-dev mailing list viene usata dagli sviluppatori , ed è a volume di traffico ridotto.
    • Esiste anche una lista per il cvs commits.
    Webmaster - $Id: documentation.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    --- NEW FILE: download.it.html --- Tor: Download

    Tor: Pacchetti e sorgenti


    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Tor viene distribuito come Free Software sotto le 3-clausole della licenza BSD.

    L'ultima release la trovi disponibile per il download directory. L'ultima release stablie è la 0.1.0.10. Tor gira su Linux, BSD, OS X, Windows, Solaris, e altri ancora.

    Le istruzioni generali per installare e configurare Tor le trovi qui. Questa FAQ entry spiega come verificare l'autenticità del pacchetto che scaricate.

    Consulta la pagina degli sviluppatori che contengono le istruzione per prelevare Tor dal CVS.

    Qui trovi le vecchie release.


    I Pacchetti Debian sono stati aggiunti al set di pacchetti della unstable (sid) e della testing (etch) Debian package. Se stai usando la stable (sarge) o la oldstable (woody), devi prima aggiungere queste linee al tuo /etc/apt/sources.list:

    • per sarge (stable):

      deb http://mirror.noreply.org/pub/tor sarge main
      deb-src http://mirror.noreply.org/pub/tor sarge main

    • o per woody (oldstable):

      deb http://mirror.noreply.org/pub/tor woody main
      deb-src http://mirror.noreply.org/pub/tor woody main

    Per installare il pacchetto, usa i seguenti comandi:

    $ apt-get update
    $ apt-get install tor

    I Pacchetti per la versione Tor di sviluppo sono tuttavia disponibili. Per installarli, iaggiungi le seguenti righe a /etc/apt/sources.list:

    • Per la sid

      deb http://mirror.noreply.org/pub/tor experimental main
      deb-src http://mirror.noreply.org/pub/tor experimental main

    • o per la sarge (stable)

      deb http://mirror.noreply.org/pub/tor experimental-sarge main
      deb-src http://mirror.noreply.org/pub/tor experimental-sarge main

    • e nel caso tu stia ancora in woody (oldstable) aggiungi queste righe:

      deb http://mirror.noreply.org/pub/tor experimental-woody main
      deb-src http://mirror.noreply.org/pub/tor experimental-woody main

    Quindi dai questa sequenza di comandi:

    $ apt-get update
    $ apt-get install -t experimental tor

    o semplicemente

    $ apt-get update
    $ apt-get install tor

    dipende da quali righe hai aggiunto.

    I Paccchetti per architetture diverse dalla i386 possono essere compilati dai sorgenti abbastanza facilmente. Prendetevela con weasel se manca la documentazione a riguardo.

    Puoi rovare una guida per il chroot di Tor sul Wiki.


    FreeBSD: La versione dei ports è obsoleta, installa da sorgente.

    OpenBSD: cd /usr/ports/net/tor && make && make install (guida al chroot)

    NetBSD: cd /usr/pkgsrc/net/tor && make install

    Gentoo: emerge tor (guida)

    Altri pacchetti per altre piattaforme sembra esistano. Se qualcune ne sa qualcosa in più ci comunichi i links.


    Mirrors

    Se hai un mirror segnalalo via mail a tor-webmaster at freehaven.net e vi aggiungeremo all lista dei mirror.

    Swedish Linux Society (ftp | http)
    Meulie.net (http)


    Releases Stabili

    2005-06-12: Tor 0.1.0.10 features cleanup on Windows, including making NT services work; many performance improvements, including libevent to use poll/epoll/kqueue when available, and pthreads and better buffer management to avoid so much memory bloat; better performance and reliability for hidden services; automated self-reachability testing by servers; http and https proxy support for clients; and much more support for the Tor controller protocol.

    2005-04-23: Tor 0.0.9.9 has a fix for an assert trigger that happens when servers get weird TLS certs from clients.

    2005-04-07: Tor 0.0.9.8 has a workaround for a rare bug (reported by Alex de Joode) that makes servers stop processing new circuits.

    2005-04-01: Tor 0.0.9.7 fixes another server race crash bug, and also fixes a bug where we would refuse to extend to an unknown server.

    2005-03-24: Tor 0.0.9.6 fixes yet more server stability problems.

    2005-02-22: Tor 0.0.9.5 fixes an assert race at exit nodes when resolve requests fail, and cleans up a few other bugs.

    2005-02-03: Tor 0.0.9.4 fixes a server bug that took down most of the network. It also makes us more robust to running out of file descriptors.

    2005-01-21: Tor 0.0.9.3 improves cpu usage, works better when the network was offline and you try to use Tor, and makes hidden services less unbearable.

    2005-01-04: Tor 0.0.9.2 fixes many more bugs.

    2004-12-16: Tor 0.0.9.1 fixes a few minor bugs in 0.0.9.

    2004-12-12: Tor 0.0.9 adds a win32 installer, better circuit building algorithms, bandwidth accounting and hibernation, more efficient directory fetching, and support for a separate Tor GUI controller program (once somebody writes one).


    Per maggiori dettagli ti consigliamo di leggere il ChangeLog.

    Webmaster - $Id: download.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    --- NEW FILE: faq.it.html --- Tor: FAQs

    Tor: FAQs


    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Il Tor Wiki delle FAQ Tecniche è editabile dagli utenti, questo significa che chiunque può integrarne i contenuti. Vi invitiamo utenti e sostenitori di Tor a consultarlo e migliorarlo, con domande, risposte e altro. Noi provvederemo alla supervisione di Wiki ma non ne siamo responsabili per i contenuti.

    Le FAQ Legali sono state scritte da avvocati di EFF. Questo documento presenta alcuni risvolti legali che sono nati con il progetto Tor.

    Le FAQ su abusi per Operatori dei Server Tor sono una raccolta di quesiti e problemi che si possono incontrare quando si gestisce un server Tor.

    Webmaster - $Id: faq.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    --- NEW FILE: howitworks.it.html --- Tor: Come funziona

    Tor: Come Funziona


    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Panoramica di base su Tor: cosa offre Tor, il suo valore, come funziona.

    Installare, configurare, e running Tor.

    Il design document (pubblicato su Usenix Security 2004) espone i nostri obiettivi e un'analisi della sicurezza sul design di Tor:

    Il nostro follow-up paper su challenges in low-latency anonymity (ancora in forma di bozza) i più recenti risultati e sviluppi: versione PDF.

    Le specifiche mirano a dare agli sviluppatori le informazioni necessarie per creare versioni compatibili con Tor:

    Consulta le slides dalla conferenza 21C3, e ascolta l'audio della stessa.

    Webmaster - $Id: howitworks.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    --- NEW FILE: index.it.html --- Tor: Un Sistema anonimo di comunicazione Internet

    Tor: Un Sistema anonimo di comunicazione in Internet

    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Tor è un toolset utile a tutte quelle organizzazioni e persone che vogliono migliorare il grado di protezione e sicurezza in Internet. Tor viene usato per rendere anonima la navigazione e la pubblicazione su internet, l'instant messaging, IRC, SSH e altro ancora. Tor offre anche una piattaforma con la quale gli sviluppatori di software possono costruire nuove applicazioni con caratteristiche di anonimato, protezione, sicurezza insite in Tor.

    Il vostro traffico è più al sicuro se utilizzate Tor, perchè le comunicazioni vengono gestite da una rete distribuita di server chiamata onion routers. I pacchetti, anzichè transitare direttamente dal mittente al destinatario, nella rete Tor seguono un percorso random attraverso i server, che nascondono le vostre traccie, cosicchè nessun osservatore su ogni singolo punto può sapere da dove provengono e dove sono direttti i dati. Questo rende complicato per tutti i partecipanti alla comunicazione sapere chi e dove siete. La tecnologia Tor offre agli utenti Internet protezione contro l'analisi del loro traffico, una forma di sorveglianza in rete che minaccia l'anonimato, la privacy, le attività di business, le relazioni personali e state security.

    L'analisi del traffico è ormai prassi comune per Aziende, Governi e Individui che voglio tenere traccia delle persone, e di cosa fanno in Internet. Al posto di preoccuparsi del contenuto delle vostre comuinicazioni, l'analisi del traffico traccia dove e quando i tuoi dati vanno e anche il volume del traffico generato. Per esempio, le Agenzie di online advertising come Fastclick and Doubleclick sfruttano l'aanalisi del traffico per registrare quali pagine hai visitato per costruire un profilo dei tuoi interessi. Una casa farmaceutica può usare l'analisi del traffico per monitorare quando un competitor visita il suo sito e tracciare le pagine a cui è interessato. IBM offre un indice ricercabile di brevetti e può tenere traccia delle interrogazioni che la tua Azienda ha richiesto. Un "ficcanaso" può utilizzare l'analisi del traffico per capire se ti trovi in un certo Internet cafe.

    Tor mira a complicare queste analisi prevenendo che origliatori indesiderati possano scoprire da dove originano le vostre comunicazioni, e lasciando a voi decidere se identificarvi quando comunicate.

    La sicurezza di Tor accresce proporzionalmente al numero degli utilizzatori e delle persone che volontariamente attrezzano un server tor. Se decidi di installarlo puoi trovare aiuto. Per approfondimenti su Tor.

    Uno degli scopi del progetto Tor è di offrire un pubblico spazio di test dove sperimentare la struttura, e scoprire come si può migliorare la privacy quando si è online. Apprezziamo le ricerche sulla sicurezza di Tor e sui sistemi di anonimato correlati, per conoscere qualsiasi vulnerabilità possiate riscontrare.

    Tor è un tassello importante per accrescere la protezione, la privacy e l'anonimato, ma non è la soluzione. Ricordatevi che si tratta di codice in sviluppo e non è una buona idea affidarsi alla rete Tor se avete il bisogno di alto grado di anonimato.

    Al momento lo sviluppo di Tor è supportato dall' Electronic Frontier Foundation. Inizialmente Tor fu ideato e sviluppato dai Laboratori U.S. Naval Research sotto il nome di Onion Routing con il supporto di ONR e DARPA.

    La lista or-announce è a basso traffico, viene utilizzata per annunciare le nuove versioni. E' possibire consultarla o iscriversi.

    EFF supporta lo sviluppo di Tor ONR supporta lo sviluppo di Tor
    Webmaster - $Id: index.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    --- NEW FILE: people.it.html --- Tor: Persone

    Tor: Persone


    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Tor è gestito da The Free Haven Project as a building block for a robust censorship-resistant data haven. Viene sviluppato da Roger Dingledine e Nick Mathewson, con l'aiuto di tanti volontari sparsi in Internet.

    Nei primi anni di vita (2002-2004) Tor ha ricevuto il supporto dal Naval Research Lab, con il lavoro di Paul Syverson e basandosi sull'originale progetto di onion routing da questi sviluppato.

    Dal November 2004, lo sviluppo di Tor ha ricevuto supporto dall' Electronic Frontier Foundation.

    Webmaster - $Id: people.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    --- NEW FILE: research.it.html --- Tor: Ricerca

    Tor: Ricerca


    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Leggi questi idocumenti (in particolare quelli nei riquadri) to get up to speed on anonymous communication systems.

    Abbiamo bisogno di persone che attacchino il sistema, quantify defenses, etc. See the "security project-lets" section of the contribute page.

    Webmaster - $Id: research.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    --- NEW FILE: users.it.html --- Tor: Utenti

    Tor: Utenti


    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    We have an IRC discussion channel for users and operators. Go to #tor on irc.oftc.net.

    We have a bugtracker. If you have a bug, especially a crash bug, read our how to report a Tor bug FAQ wiki entry first and then go to the bugtracker and tell us as much information about it as you can. (If your bug is with Privoxy, your browser, or some other application, please don't put it in our bugtracker.)

    Check out weasel's graph of the number of Tor servers over time. To learn more details of the current Tor nodes, look at Geoff Goodell's list of Tor exit nodes by country. You can also fetch the latest dynamically generated directory directly. (Your Tor client fetches this automatically, so loading it yourself is just for novelty.)

    The hidden wiki has a list of some hidden services and other things. You need Tor and a proxy like Privoxy to access it.

    See the Tor wiki for other user-contributed documentation, etc.


    Here's a brief list of programs you might want to use in association with Tor:

    Connect: adds proxy support to SSH. (Win32, Linux, BSD, OS X)
    Dsocks: SOCKS client wrapper with enough support to use the built-in OpenSSH or Tor local SOCKS proxy. (BSD)
    Freecap: redirects traffic to a SOCKS server. graphical. (Win32)
    Kernel socks bouncer: redirects certain streams into Tor. Doesn't deal with DNS. Linux 2.6 only.
    Privoxy: an http proxy that speaks socks4a. Also does html/cookie scrubbing. (Win32, Linux, BSD, OS X)
    Proxychains: proxifier, supports user-defined list of proxies. (Linux, BSD, Solaris)
    Socat: multipurpose relay. (Linux, BSD, OS X)
    Sockscap: redirects traffic to a SOCKS server. graphical. (Win32)
    Switchproxy: Mozilla extension to help you manage your proxy settings. (Firefox, Mozilla, Thunderbird)
    Tor-resolve: turns hostnames into IPs privately via Tor, shipped with the Tor package. (Win32, Linux, BSD, OS X)
    Torcap: similar to sockscap and freecap. has different strengths/weaknesses. (Win32)
    TorControl: a basic Tor controller with GUI. You'll need to set 'ControlPort 9051' in your torrc.
    Transocks: Transparent proxy to redirect traffic through a SOCKS proxy. Uses iptables. (Linux)
    Transproxy: Transparent proxy for HTTP requests with ipfw, ipnet, ipfwadm, ipchains or iptables . (FreeBSD, Linux).
    Tsocks: a program that intercepts connect() system calls and redirects them through Tor. (Linux, BSD)*

    Files marked with a * don't deal with DNS leaks,
    Webmaster - $Id: users.it.html,v 1.1 2005/06/24 01:47:57 phobos Exp $
    From phobos at seul.org Fri Jun 24 14:16:12 2005 From: phobos at seul.org (phobos at seul.org) Date: Fri, 24 Jun 2005 10:16:12 -0400 (EDT) Subject: [or-cvs] Directory /home/or/cvsroot/website/br added to the repository Message-ID: <20050624141612.A34AE1408247@moria.seul.org> Update of /home/or/cvsroot/website/br In directory moria:/tmp/cvs-serv1624/br Log Message: Directory /home/or/cvsroot/website/br added to the repository --- NEW FILE: - New directory --- From arma at seul.org Mon Jun 6 20:27:38 2005 From: arma at seul.org (arma at seul.org) Date: Mon, 6 Jun 2005 16:27:38 -0400 (EDT) Subject: [or-cvs] bump cvs to 0.1.1.0-alpha-cvs Message-ID: <20050606202738.A3CF4140824F@moria.seul.org> Update of /home2/or/cvsroot/tor/src/win32 In directory moria:/home/arma/work/onion/cvs/tor/src/win32 Modified Files: orconfig.h Log Message: bump cvs to 0.1.1.0-alpha-cvs Index: orconfig.h =================================================================== RCS file: /home2/or/cvsroot/tor/src/win32/orconfig.h,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- orconfig.h 23 May 2005 05:47:21 -0000 1.60 +++ orconfig.h 6 Jun 2005 20:27:36 -0000 1.61 @@ -215,4 +215,4 @@ #define HAVE_EVENT_H /* Version number of package */ -#define VERSION "0.1.0.8-rc" +#define VERSION "0.1.1.0-alpha-cvs" From phobos at seul.org Fri Jun 24 14:17:35 2005 From: phobos at seul.org (phobos at seul.org) Date: Fri, 24 Jun 2005 10:17:35 -0400 (EDT) Subject: [or-cvs] Added Brazilian/Portugese translation of tor-doc-win32 to s... Message-ID: <20050624141735.C47B31408247@moria.seul.org> Update of /home/or/cvsroot/website/br In directory moria:/tmp/cvs-serv1743/br Added Files: tor-doc-win32.br.html Log Message: Added Brazilian/Portugese translation of tor-doc-win32 to site in br/ dir. --- NEW FILE: tor-doc-win32.br.html --- (This appears to be a binary file; contents omitted.) From nickm at seul.org Fri Jun 24 18:03:29 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 24 Jun 2005 14:03:29 -0400 (EDT) Subject: [or-cvs] Finish making new (v1) controller logic and multiplexing lo... Message-ID: <20050624180329.EE6BB1408254@moria.seul.org> Update of /home/or/cvsroot/control/java/net/freehaven/tor/control In directory moria:/tmp/cvs-serv21811/java/net/freehaven/tor/control Modified Files: Bytes.java PasswordDigest.java TorControlCommands.java TorControlConnection.java TorControlConnection0.java TorControlConnection1.java TorControlError.java TorControlSyntaxError.java Log Message: Finish making new (v1) controller logic and multiplexing logic work in Python and Java controllers. Try out example code a bit. Index: Bytes.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/Bytes.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Bytes.java 23 Jun 2005 21:22:04 -0000 1.3 +++ Bytes.java 24 Jun 2005 18:03:27 -0000 1.4 @@ -111,3 +111,4 @@ private Bytes() {}; } + Index: PasswordDigest.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/PasswordDigest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- PasswordDigest.java 23 Jun 2005 21:22:04 -0000 1.2 +++ PasswordDigest.java 24 Jun 2005 18:03:27 -0000 1.3 @@ -56,7 +56,6 @@ return hashedKey; } - /** Parameter used by RFC2440's s2k algorithm. */ private static final int EXPBIAS = 6; @@ -100,4 +99,5 @@ return Bytes.hex(ba); } -} \ No newline at end of file +} + Index: TorControlCommands.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlCommands.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorControlCommands.java 4 Jun 2005 02:42:55 -0000 1.1 +++ TorControlCommands.java 24 Jun 2005 18:03:27 -0000 1.2 @@ -130,4 +130,5 @@ "No such OR", }; -} \ No newline at end of file +} + Index: TorControlConnection.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlConnection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TorControlConnection.java 23 Jun 2005 21:22:04 -0000 1.3 +++ TorControlConnection.java 24 Jun 2005 18:03:27 -0000 1.4 @@ -37,6 +37,41 @@ } } + protected static int detectVersion(java.io.InputStream input, + java.io.OutputStream output) + throws IOException + { + java.io.DataInputStream dInput = new java.io.DataInputStream(input); + byte out[] = { 0, 0, 13, 10 }; + output.write(out); + + int len = dInput.readUnsignedShort(); + int tp = dInput.readUnsignedShort(); + if (tp == 0) { + byte err[] = new byte[len]; + dInput.readFully(err); + return 0; + } else if ((len & 0xff00) != 0x0a00 && + (len & 0x00ff) != 0x000a && + (tp & 0xff00) != 0x0a00 && + (tp & 0x00ff) != 0x000a) { + while (input.read() != '\n') + ; + } + return 1; + } + + public static TorControlConnection getConnection(java.net.Socket sock) + throws IOException + { + int version = detectVersion(sock.getInputStream(), + sock.getOutputStream()); + if (version == 0) + return new TorControlConnection0(sock); + else + return new TorControlConnection1(sock); + } + protected TorControlConnection() { this.waiters = new LinkedList(); } @@ -71,7 +106,6 @@ protected abstract void react() throws IOException; - /** Change the value of the configuration option 'key' to 'val'. */ public void setConf(String key, String value) throws IOException { @@ -180,3 +214,4 @@ public abstract void closeCircuit(String circID, boolean ifUnused) throws IOException; } + Index: TorControlConnection0.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlConnection0.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TorControlConnection0.java 23 Jun 2005 21:22:04 -0000 1.2 +++ TorControlConnection0.java 24 Jun 2005 18:03:27 -0000 1.3 @@ -166,7 +166,6 @@ return sendAndWaitForResponse(type, cmd, CMD_DONE, CMD_DONE, CMD_DONE, CMD_DONE); } - protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1) throws IOException { return sendAndWaitForResponse(type, cmd, exType1, exType1, exType1, @@ -180,7 +179,6 @@ exType2); } - protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1, short exType2, short exType3) throws IOException { @@ -250,7 +248,6 @@ sendAndWaitForResponse(CMD_SETCONF, b.toString().getBytes()); } - public Map getConf(Collection keys) throws IOException { StringBuffer s = new StringBuffer(); for (Iterator it = keys.iterator(); it.hasNext(); ) { @@ -360,7 +357,7 @@ return Integer.toString(Bytes.getU32(c.body, 0)); } - public void attachStream(String streamID, String circID) + public void attachStream(String streamID, String circID) throws IOException { byte[] ba = new byte[8]; Bytes.setU32(ba, 0, (int)Long.parseLong(streamID)); @@ -406,3 +403,4 @@ } } + Index: TorControlConnection1.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlConnection1.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorControlConnection1.java 23 Jun 2005 21:22:04 -0000 1.1 +++ TorControlConnection1.java 24 Jun 2005 18:03:27 -0000 1.2 @@ -120,7 +120,6 @@ return reply; } - /** helper: implement the main background loop. */ protected void react() throws IOException { while (true) { @@ -142,6 +141,7 @@ Waiter w = new Waiter(); synchronized (waiters) { output.write(s); + output.flush(); if (rest != null) writeEscaped(rest); waiters.addLast(w); @@ -227,7 +227,7 @@ ArrayList lst = sendAndWaitForResponse(sb.toString(), null); Map result = new HashMap(); for (Iterator it = lst.iterator(); it.hasNext(); ) { - String kv = (String) it.next(); + String kv = ((ReplyLine) it.next()).msg; int idx = kv.indexOf('='); result.put(kv.substring(0, idx), kv.substring(idx+1)); @@ -344,3 +344,4 @@ } } + Index: TorControlError.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlError.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TorControlError.java 23 Jun 2005 21:22:04 -0000 1.2 +++ TorControlError.java 24 Jun 2005 18:03:27 -0000 1.3 @@ -27,4 +27,5 @@ return "Unrecongized error #"+errorType; } } -} \ No newline at end of file +} + Index: TorControlSyntaxError.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlSyntaxError.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorControlSyntaxError.java 4 Jun 2005 02:42:55 -0000 1.1 +++ TorControlSyntaxError.java 24 Jun 2005 18:03:27 -0000 1.2 @@ -5,4 +5,5 @@ */ public class TorControlSyntaxError extends RuntimeException { public TorControlSyntaxError(String s) { super(s); } -} \ No newline at end of file +} + From nickm at seul.org Fri Jun 24 18:03:29 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 24 Jun 2005 14:03:29 -0400 (EDT) Subject: [or-cvs] Finish making new (v1) controller logic and multiplexing lo... Message-ID: <20050624180329.E4BF61408246@moria.seul.org> Update of /home/or/cvsroot/control/java/net/freehaven/tor/control/examples In directory moria:/tmp/cvs-serv21811/java/net/freehaven/tor/control/examples Modified Files: DebuggingEventHandler.java Main.java Log Message: Finish making new (v1) controller logic and multiplexing logic work in Python and Java controllers. Try out example code a bit. Index: DebuggingEventHandler.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/examples/DebuggingEventHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DebuggingEventHandler.java 23 Jun 2005 21:36:06 -0000 1.2 +++ DebuggingEventHandler.java 24 Jun 2005 18:03:27 -0000 1.3 @@ -41,4 +41,5 @@ out.println("unrecognized event ["+type+"] "+msg.trim()); } -} \ No newline at end of file +} + Index: Main.java =================================================================== RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/examples/Main.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Main.java 23 Jun 2005 21:36:06 -0000 1.2 +++ Main.java 24 Jun 2005 18:03:27 -0000 1.3 @@ -49,8 +49,8 @@ private static TorControlConnection getConnection(String[] args, boolean daemon) throws IOException { - TorControlConnection conn = - new TorControlConnection(new java.net.Socket("127.0.0.1", 9100)); + TorControlConnection conn = TorControlConnection.getConnection( + new java.net.Socket("127.0.0.1", 9100)); Thread th = conn.launchThread(daemon); conn.authenticate(new byte[0]); return conn; @@ -84,18 +84,20 @@ // Usage: get-config key key key TorControlConnection conn = getConnection(args); Map m = conn.getConf(Arrays.asList(args).subList(1,args.length)); - for (int i = 1; i < args.length; ++i) { - System.out.println("KEY: "+args[i]); - System.out.println("VAL: "+m.get(args[i])); + for (Iterator i = m.entrySet().iterator(); i.hasNext(); ) { + Map.Entry e = (Map.Entry) i.next(); + System.out.println("KEY: "+e.getKey()); + System.out.println("VAL: "+e.getValue()); } } public static void getInfo(String[] args) throws IOException { TorControlConnection conn = getConnection(args); Map m = conn.getInfo(Arrays.asList(args).subList(1,args.length)); - for (int i = 1; i < args.length; ++i) { - System.out.println("KEY: "+args[i]); - System.out.println("VAL: "+m.get(args[i])); + for (Iterator i = m.entrySet().iterator(); i.hasNext(); ) { + Map.Entry e = (Map.Entry) i.next(); + System.out.println("KEY: "+e.getKey()); + System.out.println("VAL: "+e.getValue()); } } @@ -145,16 +147,17 @@ PasswordDigest pwd = PasswordDigest.generateDigest(); java.net.Socket s = new java.net.Socket("127.0.0.1", 9100); - TorControlConnection conn = new TorControlConnection(s); + TorControlConnection conn = TorControlConnection.getConnection(s); conn.launchThread(true); conn.authenticate(new byte[0]); conn.setConf("HashedControlPassword", pwd.getHashedPassword()); - conn = - new TorControlConnection(new java.net.Socket("127.0.0.1", 9100)); + conn = TorControlConnection.getConnection( + new java.net.Socket("127.0.0.1", 9100)); conn.launchThread(true); conn.authenticate(pwd.getSecret()); } -} \ No newline at end of file +} + From nickm at seul.org Fri Jun 24 18:03:30 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 24 Jun 2005 14:03:30 -0400 (EDT) Subject: [or-cvs] Finish making new (v1) controller logic and multiplexing lo... Message-ID: <20050624180330.15A1C140826D@moria.seul.org> Update of /home/or/cvsroot/control/python In directory moria:/tmp/cvs-serv21811/python Modified Files: TorCtl.py TorCtl0.py TorCtl1.py TorExample.py Log Message: Finish making new (v1) controller logic and multiplexing logic work in Python and Java controllers. Try out example code a bit. Index: TorCtl.py =================================================================== RCS file: /home/or/cvsroot/control/python/TorCtl.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TorCtl.py 19 Jun 2005 22:38:31 -0000 1.3 +++ TorCtl.py 24 Jun 2005 18:03:27 -0000 1.4 @@ -7,8 +7,8 @@ TorCtl -- Library to control Tor processes. See TorCtlDemo.py for example use. """ -import TorCtl0 -import TorCtl1 +import struct +import sys class TorCtlError(Exception): "Generic error raised by TorControl code." @@ -97,10 +97,11 @@ return evtype, args - def handle1(self, evbody): + def handle1(self, lines): """Dispatcher: called from Connection when an event is received.""" - evtype, args = self.decode1(evbody) - self._map1.get(evtype, self.unknownEvent)(evtype, *args) + for code, msg, data in lines: + evtype, args = self.decode1(msg) + self._map1.get(evtype, self.unknownEvent)(evtype, *args) def decode1(self, body): """Unpack an event message into a type/arguments-tuple tuple.""" @@ -165,7 +166,7 @@ """ raise NotImplemented - def streamStatus(self, status, circID, target, circID="0"): + def streamStatus(self, status, streamID, target, circID="0"): """Called when a stream status changes if listening to STREAMSTATUS events. 'status' is a member of STREAM_STATUS; streamID is a numeric stream ID, and 'target' is the destination of the stream. @@ -200,6 +201,35 @@ """DOCDOC""" raise NotImplemented +class DebugEventHandler(EventHandler): + """Trivial event handler: dumps all events to stdout.""" + def __init__(self, out=None): + if out is None: + out = sys.stdout + self._out = out + + def handle0(self, body): + evtype, args = self.decode0(body) + print >>self._out,EVENT_TYPE.nameOf[evtype],args + + def handle1(self, lines): + for code, msg, data in lines: + print >>self._out, msg + +def detectVersion(s): + s.sendall("\x00\x00\r\n") + m = s.recv(4) + v0len, v0type = struct.unpack("!HH", m) + if v0type == '\x00\x00': + s.recv(v0len) + return 0 + if '\n' not in m: + while 1: + c = s.recv(1) + if c == '\n': + break + return 1 + def parseHostAndPort(h): """Given a string of the form 'address:port' or 'address' or 'port' or '', return a two-tuple of (address, port) @@ -221,6 +251,15 @@ return host, port +def get_connection(sock): + v = detectVersion(sock) + if v == 0: + import TorCtl0 + return TorCtl0.Connection(sock) + else: + import TorCtl1 + return TorCtl1.Connection(sock) + def secret_to_key(secret, s2k_specifier): c = ord(s2k_specifier[8]) EXPBIAS = 6 Index: TorCtl0.py =================================================================== RCS file: /home/or/cvsroot/control/python/TorCtl0.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorCtl0.py 19 Jun 2005 22:38:31 -0000 1.1 +++ TorCtl0.py 24 Jun 2005 18:03:27 -0000 1.2 @@ -20,7 +20,6 @@ "MSG_TYPE", "EVENT_TYPE", "CIRC_STATUS", "STREAM_STATUS", "OR_CONN_STATUS", "SIGNAL", "ERR_CODES", "TorCtlError", "ProtocolError", "ErrorReply", "Connection", "EventHandler", - "DebugEventHandler", "parseHostAndPort" ] class _Enum: @@ -429,6 +428,16 @@ """Send the signal 'sig' to the Tor process; 'sig' must be a member of SIGNAL. """ + try: + sig = sig.upper() + except AttributeError: + pass + sig = { "HUP" : 0x01, "RELOAD" : 0x01, + "INT" : 0x02, "SHUTDOWN" : 0x02, + "DUMP" : 0x0A, "USR1" : 0x0A, + "USR2" : 0x0C, "DEBUG" : 0x0C, + "TERM" : 0x0F, "HALT" : 0x0F + }.get(sig,sig) self._sendAndRecv(MSG_TYPE.SIGNAL,struct.pack("B",sig)) def map_address(self, kvList): @@ -479,13 +488,3 @@ """Tell Tor about a new descriptor in 'descriptor'.""" self._sendAndRecv(MSG_TYPE.POSTDESCRIPTOR,descriptor) -class DebugEventHandler(EventHandler): - """Trivial event handler: dumps all events to stdout.""" - def __init__(self, out=None): - if out is None: - out = sys.stdout - self._out = out - - def handle(self, body): - evtype, args = self.decode(body) - print >>self._out,EVENT_TYPE.nameOf[evtype],args Index: TorCtl1.py =================================================================== RCS file: /home/or/cvsroot/control/python/TorCtl1.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TorCtl1.py 19 Jun 2005 22:38:31 -0000 1.1 +++ TorCtl1.py 24 Jun 2005 18:03:27 -0000 1.2 @@ -11,6 +11,7 @@ import threading import types import Queue +import TorCtl def _quote(s): return re.sub(r'([\r\n\\\"])', r'\\\1', s) @@ -43,17 +44,6 @@ else: return "\r\n".join(lines) -def _parseKV(body,sep=" ",term="\n"): - """Helper: parse a key/value list of the form [key sep value term]* . - Return a list of (k,v).""" - res = [] - for line in body.split(term): - if not line: continue - k, v = line.split(sep,1) - res.append((k,v)) - return res - - def _read_reply(f,debugFile=None): lines = [] while 1: @@ -61,18 +51,17 @@ if debugFile: debugFile.write(" %s\n" % line) if len(line)<4: - raise ProtocolError("Badly formatted reply line: Too short") + raise TorCtl.ProtocolError("Badly formatted reply line: Too short") code = line[:3] tp = line[3] - s = line[3:] - if s == "-": - lines.append((tp, s, None)) - elif s == " ": - lines.append((tp, s, None)) + s = line[4:] + if tp == "-": + lines.append((code, s, None)) + elif tp == " ": + lines.append((code, s, None)) return lines - elif s != "+": - raise ProtocolError("Badly formatted reply line: unknown type %r", - s) + elif tp != "+": + raise TorCtl.ProtocolError("Badly formatted reply line: unknown type %r"%tp) else: more = [] while 1: @@ -82,10 +71,10 @@ if line in (".\r\n", ".\n"): break more.append(line) - lines.append((tp, s, _unescape_dots("".join(more))) + lines.append((code, s, _unescape_dots("".join(more)))) class Connection: - """A Connection represents a connection to the Tor process.""" + """A Connection represents a connection to the Tor process.""" def __init__(self, sock, file=None): """Create a Connection to communicate with the Tor process over the socket 'sock'. @@ -142,7 +131,7 @@ assert lines if lines[0][0][0] == "6": if self._handler is not None: - self._handler.handle1(body) + self._handler.handle1(lines) else: cb = self._queue.get() cb(lines) @@ -151,7 +140,7 @@ """Helper: Send a command 'msg' to Tor, and wait for a command in response. If the response type is in expectedTypes, return a list of (tp,body,extra) tuples. If it is an - error, raise ErrorReply. Otherwise, raise ProtocolError. + error, raise ErrorReply. Otherwise, raise TorCtl.ProtocolError. """ # This condition will get notified when we've got a result... condition = threading.Condition() @@ -178,6 +167,7 @@ if self._debugFile: self._debugFile.write(">>> %s" % msg) self._s.write(msg) + self._s.flush() finally: self._sendLock.release() @@ -194,9 +184,9 @@ lines = result[0] for tp, msg, _ in lines: if tp[0] in '45': - raise ErrorReply("%s %s"%(tp, msg)) + raise TorCtl.ErrorReply("%s %s"%(tp, msg)) if tp not in expectedTypes: - raise ProtocolError("Unexpectd message type %r"%tp) + raise TorCtl.ProtocolError("Unexpectd message type %r"%tp) return lines @@ -204,7 +194,7 @@ """Send an authenticating secret to Tor. You'll need to call this method before Tor can start. """ - hexstr = binascii.b2a_hex(MSG_TYPE.AUTH,secret) + hexstr = binascii.b2a_hex(secret) self._sendAndRecv("AUTHENTICATE %s\r\n"%hexstr) def get_option(self, name): @@ -215,6 +205,7 @@ name = " ".join(name) lines = self._sendAndRecv("GETCONF %s\r\n" % name) + r = [] for _,line,_ in lines: try: key, val = line.split("=", 1) @@ -252,7 +243,7 @@ try: k,rest = msg.split("=",1) except ValueError: - raise ProtocolError("Bad info line %r",msg) + raise TorCtl.ProtocolError("Bad info line %r",msg) if more: d[k] = more else: @@ -292,7 +283,7 @@ e = "ERR" evs.append(e) - self._sendAndRecv("SETEVENTS %s"\r\n," ".join(evs)) + self._sendAndRecv("SETEVENTS %s\r\n" % " ".join(evs)) def save_conf(self): """Flush all configuration changes to disk. @@ -308,7 +299,7 @@ 0x0A : "USR1", 0x0C : "USR2", 0x0F : "TERM" }.get(sig,sig) - seld._sendAndRecv("SIGNAL %s\r\n"%sig) + self._sendAndRecv("SIGNAL %s\r\n"%sig) def map_address(self, kvList): if not kvList: @@ -320,7 +311,7 @@ try: key, val = line.split("=", 1) except ValueError: - raise ProtocolError("Bad address line %r",v) + raise TorCtl.ProtocolError("Bad address line %r",v) r.append((key,val)) return r @@ -335,7 +326,7 @@ tp,msg,_ = lines[0] m = re.match(r'EXTENDED (\S*)', msg) if not m: - raise ProtocolError("Bad extended line %r",msg) + raise TorCtl.ProtocolError("Bad extended line %r",msg) return m.group(1) def redirect_stream(self, streamid, newtarget): @@ -359,4 +350,3 @@ def post_descriptor(self, desc): self._sendAndRecv("+POSTDESCRIPTOR\r\n%s"%_escape_dots(desc)) - Index: TorExample.py =================================================================== RCS file: /home/or/cvsroot/control/python/TorExample.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TorExample.py 15 Jun 2005 15:18:22 -0000 1.2 +++ TorExample.py 24 Jun 2005 18:03:27 -0000 1.3 @@ -8,18 +8,25 @@ from TorCtl import * def getConnection(daemon=1): - if sys.argv[1] == '--host': - hostport = sys.argv[2] - del sys.argv[1:3] - elif sys.argv[1].startswith("--host="): - hostport = sys.argv[1][7:] - del sys.argv[1] - else: - hostport = "localhost:9100" + hostport = "localhost:9100" + verbose = 0 + while sys.argv[1][0] == '-': + if sys.argv[1] == '--host': + hostport = sys.argv[2] + del sys.argv[1:3] + elif sys.argv[1].startswith("--host="): + hostport = sys.argv[1][7:] + del sys.argv[1] + elif sys.argv[1] in ('-v', '--verbose'): + verbose = 1 + del sys.argv[1] + host,port = parseHostAndPort(hostport) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host,port)) - conn = Connection(s) + conn = get_connection(s) + if verbose and hasattr(conn, "debug"): + conn.debug(sys.stdout) th = conn.launchThread(daemon) conn.authenticate("") return conn @@ -32,6 +39,7 @@ fn = globals().get("run_"+cmd) if fn is None: print "Unrecognized command:",cmd + return fn() def run_set_config(): @@ -51,9 +59,9 @@ def run_get_config(): conn = getConnection() opts = conn.get_option(sys.argv[1:]) - for k in sys.argv[1:]: + for k,v in opts: print "KEY:",k - print "VALUE:",opts.get(k) + print "VALUE:",v def run_get_info(): conn = getConnection() @@ -63,44 +71,17 @@ print "VALUE:",opts.get(k) def run_listen(): - m = { "circ": "CIRCSTATUS", - "stream": "STREAMSTATUS", - "orconn": "ORCONNSTATUS", - "bw": "BANDWIDTH", - "newdesc": "NEWDESC", - "info": "INFO_MSG", - "notice": "NOTICE_MSG", - "warn": "WARN_MSG", - "error": "ERR_MSG", - } conn = getConnection(daemon=0) events = [] - for kw in sys.argv[1:]: - try: - events.append(EVENT_TYPE.get(m[kw])) - except KeyError: - print "Unrecognized event %r; recognized events are: %s"%( - kw, ", ".join(m.keys())) - if not events: - return - conn.setEventHandler(DebugEventHandler()) - conn.listenForEvents(events) + conn.set_events(sys.argv[1:]) def run_signal(): conn = getConnection() - m = { 'reload': "HUP", 'shutdown': "INT", 'dump': "USR1", - 'debug': "USR2", 'halt': 'TERM' } if len(sys.argv)<2: print "Syntax: signal [signal]" return - try: - sig = SIGNAL.get(m[sys.argv[1]]) - except KeyError: - print "Unrecognized signal %r. Options are %s"%( - sys.argv[1], ", ".join(m.keys())) - - conn.signal(sig) + conn.send_signal(sys.argv[1]) def run_authdemo(): conn = getConnection() From nickm at seul.org Fri Jun 24 18:04:02 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 24 Jun 2005 14:04:02 -0400 (EDT) Subject: [or-cvs] Describe how to detect v0 or v1 protocol Message-ID: <20050624180402.A1FF91408254@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv22266/doc Modified Files: control-spec.txt Log Message: Describe how to detect v0 or v1 protocol Index: control-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/control-spec.txt,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- control-spec.txt 19 Jun 2005 23:22:34 -0000 1.42 +++ control-spec.txt 24 Jun 2005 18:04:00 -0000 1.43 @@ -635,7 +635,11 @@ 5.3. Backward compatibility For backward compatibility with the "version 0" control protocol, Tor checks - whether the third byte the first command is zero. If it is, Tor + whether the third octet the first command is zero. If it is, Tor assumes that version 0 is in use. This feature is deprecated, and will be removed in the 0.1.2.x Tor development series. + In order to detect which version of the protocol is supported controllers + should send the sequence [00 00 0D 0A]. This is a valid and unrecognized + command in both protocol versions, and implementations can detect which + error they have received. From nickm at seul.org Fri Jun 24 18:05:45 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 24 Jun 2005 14:05:45 -0400 (EDT) Subject: [or-cvs] Mark old TorControl.py script as heavily deprecated Message-ID: <20050624180545.776501408246@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/tmp/cvs-serv22509/contrib Modified Files: TorControl.py Log Message: Mark old TorControl.py script as heavily deprecated Index: TorControl.py =================================================================== RCS file: /home/or/cvsroot/tor/contrib/TorControl.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- TorControl.py 19 Jun 2005 22:38:36 -0000 1.11 +++ TorControl.py 24 Jun 2005 18:05:43 -0000 1.12 @@ -3,6 +3,14 @@ # Copyright 2005 Nick Mathewson -- See LICENSE for licensing information. #$Id$ +# THIS MODULE IS OBSOLETE! +# +# There is a "TorCtl.py" module in the "control" directory in Tor CVS; +# this new module supports the new ('version 1') Tor controller protocol +# and has a far nicer and more object-oriented design than this module does. +# +# No further support will be done on this module. + import socket import struct import sys @@ -361,7 +369,6 @@ send_message(s,MSG_TYPE.POSTDESCRIPTOR,descriptor) tp,body = receive_reply(s,[MSG_TYPE.DONE]) - def _unterminate(s): if s[-1] == '\0': return s[:-1] @@ -438,7 +445,6 @@ #send_signal(s,1) #save_conf(s) - #set_option(s,"1") #set_option(s,"bandwidthburstbytes 100000") #set_option(s,"runasdaemon 1") From nickm at seul.org Fri Jun 24 23:42:17 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 24 Jun 2005 19:42:17 -0400 (EDT) Subject: [or-cvs] It is not the end of the world when a router descriptor has... Message-ID: <20050624234217.AF27F14080A0@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv6386/doc Modified Files: tor-spec.txt Log Message: It is not the end of the world when a router descriptor has an unrecognized kwd Index: tor-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-spec.txt,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- tor-spec.txt 16 Jun 2005 20:33:03 -0000 1.87 +++ tor-spec.txt 24 Jun 2005 23:42:15 -0000 1.88 @@ -852,9 +852,14 @@ and signed with the directory server's signing key. If software encounters an unrecognized keyword in a single router descriptor, -it should reject only that router descriptor, and continue using the -others. If it encounters an unrecognized keyword in the directory header, -it should reject the entire directory. +it MUST reject only that router descriptor, and continue using the +others. Because this mechanism is used to add 'critical' extensions to +future versions of the router descriptor format, implementation should treat +it as a normal occurrence and not, for example, report it to the user as an +error. [Versions of Tor prior to 0.1.1 did this.] + +If software encounters an unrecognized keyword in the directory header, +it SHOULD reject the entire directory. 7.4. Network-status descriptor From nickm at seul.org Fri Jun 24 23:42:17 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 24 Jun 2005 19:42:17 -0400 (EDT) Subject: [or-cvs] It is not the end of the world when a router descriptor has... Message-ID: <20050624234217.A550D140807B@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv6386/src/or Modified Files: routerparse.c Log Message: It is not the end of the world when a router descriptor has an unrecognized kwd Index: routerparse.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/routerparse.c,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- routerparse.c 15 Jun 2005 18:34:46 -0000 1.114 +++ routerparse.c 24 Jun 2005 23:42:15 -0000 1.115 @@ -853,7 +853,7 @@ goto err; } if ((tok = find_first_by_keyword(tokens, _UNRECOGNIZED))) { - log_fn(LOG_WARN, "Unrecognized keyword '%s'; skipping descriptor.", + log_fn(LOG_INFO, "Unrecognized critical keyword '%s'; skipping descriptor. (It may be from another version of Tor.)", tok->args[0]); goto err; } From nickm at seul.org Fri Jun 24 23:44:15 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 24 Jun 2005 19:44:15 -0400 (EDT) Subject: [or-cvs] Directories are unordered. Message-ID: <20050624234415.8E85B140809F@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv6566/doc Modified Files: tor-spec.txt Log Message: Directories are unordered. Index: tor-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-spec.txt,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- tor-spec.txt 24 Jun 2005 23:42:15 -0000 1.88 +++ tor-spec.txt 24 Jun 2005 23:44:13 -0000 1.89 @@ -845,7 +845,6 @@ "directory-signature" nickname-of-dirserver NL Signature -Note: The router descriptor for the directory server MUST appear first. The signature is computed by computing the SHA-1 hash of the directory, from the characters "signed-directory", through the newline after "directory-signature". This digest is then padded with PKCS.1, From arma at seul.org Sat Jun 25 06:27:51 2005 From: arma at seul.org (arma at seul.org) Date: Sat, 25 Jun 2005 02:27:51 -0400 (EDT) Subject: [or-cvs] add clearer disclaimer to the dmca template response Message-ID: <20050625062751.8315E14080B0@moria.seul.org> Update of /home2/or/cvsroot/website/eff In directory moria:/home/arma/work/onion/cvs/website/eff Modified Files: tor-dmca-response.html Log Message: add clearer disclaimer to the dmca template response Index: tor-dmca-response.html =================================================================== RCS file: /home2/or/cvsroot/website/eff/tor-dmca-response.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tor-dmca-response.html 23 May 2005 16:31:21 -0000 1.3 +++ tor-dmca-response.html 25 Jun 2005 06:27:49 -0000 1.4 @@ -57,6 +57,13 @@ much legal explanation, feel free to invite the ISP to contact EFF for a fuller discussion.

    +

    This template letter is for informational purposes only and does not +constitute legal advice. Whether and how you should respond when you or +your ISP has received a DMCA notice will turn on the particular facts +of your situation. This template is intended as a starting point. Before +sending any response to your ISP, you may want to seek the advice of an +attorney licensed to practice in your jurisdiction.

    +

    Also, if you received this document from anywhere besides http://tor.eff.org/eff/tor-dmca-response.html, it may be out of date. Follow the link to get the latest version.

    From arma at seul.org Mon Jun 6 20:30:28 2005 From: arma at seul.org (arma at seul.org) Date: Mon, 6 Jun 2005 16:30:28 -0400 (EDT) Subject: [or-cvs] blow away obsolete stuff Message-ID: <20050606203028.0E32314081FE@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: HACKING Log Message: blow away obsolete stuff Index: HACKING =================================================================== RCS file: /home2/or/cvsroot/tor/doc/HACKING,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- HACKING 17 May 2005 01:38:25 -0000 1.13 +++ HACKING 6 Jun 2005 20:30:25 -0000 1.14 @@ -574,67 +574,7 @@ Streams are multiplexed over circuits. Cells. Some connections, specifically OR and OP connections, speak - "cells". This means that data over that connection is bundled into 256 - byte packets (8 bytes of header and 248 bytes of payload). Each cell has + "cells". This means that data over that connection is bundled into 512 + byte packets (14 bytes of header and 498 bytes of payload). Each cell has a type, or "command", which indicates what it's for. -Robustness features. - -[XXX no longer up to date] - Bandwidth throttling. Each cell-speaking connection has a maximum - bandwidth it can use, as specified in the routers.or file. Bandwidth - throttling can occur on both the sender side and the receiving side. If - the LinkPadding option is on, the sending side sends cells at regularly - spaced intervals (e.g., a connection with a bandwidth of 25600B/s would - queue a cell every 10ms). The receiving side protects against misbehaving - servers that send cells more frequently, by using a simple token bucket: - - Each connection has a token bucket with a specified capacity. Tokens are - added to the bucket each second (when the bucket is full, new tokens - are discarded.) Each token represents permission to receive one byte - from the network --- to receive a byte, the connection must remove a - token from the bucket. Thus if the bucket is empty, that connection must - wait until more tokens arrive. The number of tokens we add enforces a - longterm average rate of incoming bytes, yet we still permit short-term - bursts above the allowed bandwidth. Currently bucket sizes are set to - ten seconds worth of traffic. - - The bandwidth throttling uses TCP to push back when we stop reading. - We extend it with token buckets to allow more flexibility for traffic - bursts. - - Data congestion control. Even with the above bandwidth throttling, - we still need to worry about congestion, either accidental or intentional. - If a lot of people make circuits into same node, and they all come out - through the same connection, then that connection may become saturated - (be unable to send out data cells as quickly as it wants to). An adversary - can make a 'put' request through the onion routing network to a webserver - he owns, and then refuse to read any of the bytes at the webserver end - of the circuit. These bottlenecks can propagate back through the entire - network, mucking up everything. - - (See the tor-spec.txt document for details of how congestion control - works.) - - In practice, all the nodes in the circuit maintain a receive window - close to maximum except the exit node, which stays around 0, periodically - receiving a sendme and reading more data cells from the webserver. - In this way we can use pretty much all of the available bandwidth for - data, but gracefully back off when faced with multiple circuits (a new - sendme arrives only after some cells have traversed the entire network), - stalled network connections, or attacks. - - We don't need to reimplement full tcp windows, with sequence numbers, - the ability to drop cells when we're full etc, because the tcp streams - already guarantee in-order delivery of each cell. Rather than trying - to build some sort of tcp-on-tcp scheme, we implement this minimal data - congestion control; so far it's enough. - - Router twins. In many cases when we ask for a router with a given - address and port, we really mean a router who knows a given key. Router - twins are two or more routers that share the same private key. We thus - give routers extra flexibility in choosing the next hop in the circuit: if - some of the twins are down or slow, it can choose the more available ones. - - Currently the code tries for the primary router first, and if it's down, - chooses the first available twin. From phobos at seul.org Sun Jun 26 05:03:19 2005 From: phobos at seul.org (phobos at seul.org) Date: Sun, 26 Jun 2005 01:03:19 -0400 (EDT) Subject: [or-cvs] Added instructions for commenting out the "logfile logfile"... Message-ID: <20050626050319.8540F1408249@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv31379 Modified Files: tor-doc-win32.html Log Message: Added instructions for commenting out the "logfile logfile" and "jarfile jarfile" in the privoxy config. Index: tor-doc-win32.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-win32.html,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- tor-doc-win32.html 14 Jun 2005 21:49:45 -0000 1.48 +++ tor-doc-win32.html 26 Jun 2005 05:03:16 -0000 1.49 @@ -96,6 +96,14 @@ the file. Be sure to save.

    +

    Privoxy keeps a log file of everything passed through it. In +order to stop this you will need to comment out the line
    +logfile logfile
    +and the line
    +jarfile jarfile
    +Be sure to save. +

    + privoxy points to tor From arma at seul.org Sun Jun 26 05:03:23 2005 From: arma at seul.org (arma at seul.org) Date: Sun, 26 Jun 2005 01:03:23 -0400 (EDT) Subject: [or-cvs] note a bug in our tor_socketpair implementation Message-ID: <20050626050323.CE4A41408249@moria.seul.org> Update of /home2/or/cvsroot/tor/src/common In directory moria:/home/arma/work/onion/cvs/tor/src/common Modified Files: compat.c Log Message: note a bug in our tor_socketpair implementation can somebody fix this or create a flyspray entry for it? Index: compat.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/common/compat.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- compat.c 18 Jun 2005 02:23:11 -0000 1.54 +++ compat.c 26 Jun 2005 05:03:21 -0000 1.55 @@ -291,6 +291,10 @@ * stack is down). And even if it succeeds, the socket pair will not * be able to read while localhost is down later (the socket pair may * even close, depending on OS-specific timeouts). + * + * XXX Bug: this function assumes errno is how you report errors, but + * that isn't the case for Windows, which is where it's most likely + * to be called. **/ int tor_socketpair(int family, int type, int protocol, int fd[2]) From phobos at seul.org Sun Jun 26 05:08:13 2005 From: phobos at seul.org (phobos at seul.org) Date: Sun, 26 Jun 2005 01:08:13 -0400 (EDT) Subject: [or-cvs] Correct logfile names because Windows is apparently differe... Message-ID: <20050626050813.E2A82140803B@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv31777 Modified Files: tor-doc-win32.html Log Message: Correct logfile names because Windows is apparently different than any other os. Index: tor-doc-win32.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-win32.html,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- tor-doc-win32.html 26 Jun 2005 05:03:16 -0000 1.49 +++ tor-doc-win32.html 26 Jun 2005 05:08:11 -0000 1.50 @@ -98,9 +98,9 @@

    Privoxy keeps a log file of everything passed through it. In order to stop this you will need to comment out the line
    -logfile logfile
    +logfile privoxy.log
    and the line
    -jarfile jarfile
    +jarfile jar.log
    Be sure to save.

    From phobos at seul.org Sun Jun 26 05:21:19 2005 From: phobos at seul.org (phobos at seul.org) Date: Sun, 26 Jun 2005 01:21:19 -0400 (EDT) Subject: [or-cvs] Updated doc to explain how to comment out the lines. Message-ID: <20050626052119.5ECCF1408249@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv32027 Modified Files: tor-doc-win32.html Log Message: Updated doc to explain how to comment out the lines. Index: tor-doc-win32.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-win32.html,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- tor-doc-win32.html 26 Jun 2005 05:08:11 -0000 1.50 +++ tor-doc-win32.html 26 Jun 2005 05:21:17 -0000 1.51 @@ -22,7 +22,7 @@ tor-doc.html.

    -This document was updated June 14 2005. +This document was updated $Date$.

    The latest beta release of Tor for MS Windows is @@ -97,7 +97,7 @@

    Privoxy keeps a log file of everything passed through it. In -order to stop this you will need to comment out the line
    +order to stop this you will need to comment out (insert a # before) the line
    logfile privoxy.log
    and the line
    jarfile jar.log
    @@ -173,5 +173,6 @@

    If you have suggestions for improving this document, please send them to us. Thanks!

    +

    $Id$

    From phobos at seul.org Sun Jun 26 05:25:31 2005 From: phobos at seul.org (phobos at seul.org) Date: Sun, 26 Jun 2005 01:25:31 -0400 (EDT) Subject: [or-cvs] updated document date line to make it automated. Message-ID: <20050626052531.047E7140811D@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv32288 Modified Files: tor-doc-osx.html Log Message: updated document date line to make it automated. Index: tor-doc-osx.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-osx.html,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- tor-doc-osx.html 14 Jun 2005 21:49:45 -0000 1.32 +++ tor-doc-osx.html 26 Jun 2005 05:25:28 -0000 1.33 @@ -22,7 +22,7 @@ server" section at tor-doc.html.

    -This document was updated June 14 2005. +This document was updated $Date$.

    The latest beta release of Tor for Macintosh OS X is

    +

    $Id$

    + From arma at seul.org Sun Jun 26 08:42:43 2005 From: arma at seul.org (arma at seul.org) Date: Sun, 26 Jun 2005 04:42:43 -0400 (EDT) Subject: [or-cvs] tyranix moved the socat instructions to the main wiki, so y... Message-ID: <20050626084243.EA9CB1408216@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: tor-doc.html Log Message: tyranix moved the socat instructions to the main wiki, so you don't need privoxy working in order to read them. Index: tor-doc.html =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor-doc.html,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- tor-doc.html 21 Jun 2005 20:08:02 -0000 1.86 +++ tor-doc.html 26 Jun 2005 08:42:41 -0000 1.87 @@ -239,8 +239,9 @@ to dynamically replace the system calls in your program to route through Tor. If you want to use SOCKS 4A, consider using
    socat (specific instructions -are on this hidden -service url).

    +are in the +Tor Wiki).

    (Windows doesn't have tsocks; see the bottom of the Win32 instructions for alternatives.) From arma at seul.org Sun Jun 26 08:57:27 2005 From: arma at seul.org (arma at seul.org) Date: Sun, 26 Jun 2005 04:57:27 -0400 (EDT) Subject: [or-cvs] wave rubber chicken over man page Message-ID: <20050626085727.7303E140821D@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: tor.1.in Log Message: wave rubber chicken over man page tyranix says this makes the html output look better Index: tor.1.in =================================================================== RCS file: /home2/or/cvsroot/tor/doc/tor.1.in,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- tor.1.in 20 Jun 2005 18:56:34 -0000 1.91 +++ tor.1.in 26 Jun 2005 08:57:25 -0000 1.92 @@ -20,20 +20,25 @@ .SH OPTIONS \fB-h, -help\fP Display a short help message and exit. +.LP .TP \fB-f \fR\fIFILE\fP FILE contains further "option value" pairs. (Default: @CONFDIR@/torrc) +.LP .TP Other options can be specified either on the command-line (\fI--option value\fR), or in the configuration file (\fIoption value\fR). Options are case-insensitive. +.LP .TP \fBBandwidthRate \fR\fIN\fR \fBbytes\fR|\fBKB\fR|\fBMB\fR|\fBGB\fR|\fBTB\fP A token bucket limits the average incoming bandwidth on this node to the specified number of bytes per second. (Default: 2 MB) +.LP .TP \fBBandwidthBurst \fR\fIN\fR \fBbytes\fR|\fBKB\fR|\fBMB\fR|\fBGB\fR|\fBTB\fP Limit the maximum token bucket size (also known as the burst) to the given number of bytes. (Default: 5 MB) +.LP .TP \fBMaxAdvertisedBandwidth \fR\fIN\fR \fBbytes\fR|\fBKB\fR|\fBMB\fR|\fBGB\fR|\fBTB\fP If set, we will not advertise more than this amount of bandwidth for our @@ -41,6 +46,7 @@ who ask to build circuits through them (since this is proportional to advertised bandwidth rate) can thus reduce the CPU demands on their server without impacting network performance. +.LP .TP \fBControlPort \fR\fIPort\fP If set, Tor will accept connections from the same machine (localhost only) on @@ -49,12 +55,14 @@ specify one of \fBHashedControlPassword\fP or \fBCookieAuthentication\fP, setting this option will cause Tor to allow any process on the local host to control it. +.LP .TP \fBHashedControlPassword \fR\fIhashed_password\fP Don't allow any connections on the control port except when the other process knows the password whose one-way hash is \fIhashed_password\fP. You can compute the hash of a password by running "tor --hash-password \fIpassword\fP". +.LP .TP \fBCookieAuthentication \fR\fB0\fR|\fB1\fP If this option is set to 1, don't allow any connections on the control port @@ -62,15 +70,18 @@ "control_auth_cookie", which Tor will create in its data directory. This authentication methods should only be used on systems with good filesystem security. (Default: 0) +.LP .TP \fBDataDirectory \fR\fIDIR\fP Store working data in DIR (Default: @LOCALSTATEDIR@/lib/tor) +.LP .TP \fBDirFetchPeriod \fR\fIN\fR \fBseconds\fR|\fBminutes\fR|\fBhours\fR|\fBdays\fR|\fBweeks\fP Every time the specified period elapses, Tor downloads a directory. A directory contains a signed list of all known servers as well as their current liveness status. A value of "0 seconds" tells Tor to choose an appropriate default. (Default: 1 hour for clients, 20 minutes for servers) +.LP .TP \fBDirServer \fR\fIaddress:port fingerprint\fP Use a nonstandard authoritative directory server at the provided @@ -78,20 +89,24 @@ be repeated many times, for multiple authoritative directory servers. If no \fBdirserver\fP line is given, Tor will use the default directory servers: moria1, moria2, and tor26. +.LP .TP \fBGroup \fR\fIGID\fP On startup, setgid to this user. +.LP .TP \fBHttpProxy\fR \fIhost\fR[:\fIport\fR]\fP Tor will make all its directory requests through this host:port (or host:80 if port is not specified), rather than connecting directly to any directory servers. +.LP .TP \fBHttpProxyAuthenticator\fR \fIusername:password\fP If defined, Tor will use this username:password for Basic Http proxy authentication, as in RFC 2617. This is currently the only form of Http proxy authentication that Tor supports; feel free to submit a patch if you want it to support others. +.LP .TP \fBHttpsProxy\fR \fIhost\fR[:\fIport\fR]\fP Tor will make all its OR (SSL) connections through this host:port @@ -99,18 +114,21 @@ connecting directly to servers. You may want to set \fBFascistFirewall\fR to restrict the set of ports you might try to connect to, if your Https proxy only allows connecting to certain ports. +.LP .TP \fBHttpsProxyAuthenticator\fR \fIusername:password\fP If defined, Tor will use this username:password for Basic Https proxy authentication, as in RFC 2617. This is currently the only form of Https proxy authentication that Tor supports; feel free to submit a patch if you want it to support others. +.LP .TP \fBKeepalivePeriod \fR\fINUM\fP To keep firewalls from expiring connections, send a padding keepalive cell every NUM seconds on open connections that are in use. If the connection has no open circuits, it will instead be closed after NUM seconds of idleness. (Default: 5 minutes) +.LP .TP \fBLog \fR\fIminSeverity\fR[-\fImaxSeverity\fR] \fBstderr\fR|\fBstdout\fR|\fBsyslog\fR\fP Send all messages between \fIminSeverity\fR and \fImaxSeverity\fR to @@ -119,41 +137,50 @@ severity levels are debug, info, notice, warn, and err. If only one severity level is given, all messages of that level or higher will be sent to the listed destination. +.LP .TP \fBLog \fR\fIminSeverity\fR[-\fImaxSeverity\fR] \fBfile\fR \fIFILENAME\fP As above, but send log messages to the listed filename. The "Log" option may appear more than once in a configuration file. Messages are sent to all the logs that match their severity level. +.LP .TP \fBMaxConn \fR\fINUM\fP Maximum number of simultaneous sockets allowed. You probably don't need to adjust this. (Default: 1024) +.LP .TP \fBOutboundBindAddress \fR\fIIP\fP Make all outbound connections originate from the IP address specified. This is only useful when you have multiple network interfaces, and you want all of Tor's outgoing connections to use a single one. +.LP .TP \fBPIDFile \fR\fIFILE\fP On startup, write our PID to FILE. On clean shutdown, remove FILE. +.LP .TP \fBRunAsDaemon \fR\fB0\fR|\fB1\fR\fP If 1, Tor forks and daemonizes to the background. (Default: 0) +.LP .TP \fBSafeLogging \fR\fB0\fR|\fB1\fP If 1, Tor replaces potentially sensitive strings in the logs (e.g. addresses) with the string [scrubbed]. This way logs can still be useful, but they don't leave behind personally identifying information about what sites a user might have visited. (Default: 1) +.LP .TP \fBStatusFetchPeriod \fR\fIN\fR \fBseconds\fR|\fBminutes\fR|\fBhours\fR|\fBdays\fR|\fBweeks\fP Every time the specified period elapses, Tor downloads signed status information about the current state of known servers. A value of "0 seconds" tells Tor to choose an appropriate default. (Default: 30 minutes for clients, 15 minutes for servers) +.LP .TP \fBUser \fR\fIUID\fP On startup, setuid to this user. +.LP .TP \fBHardwareAccel \fR\fI0|1\fP If non-zero, try to use crypto hardware acceleration when @@ -162,10 +189,12 @@ .SH CLIENT OPTIONS .PP The following options are useful only for clients (that is, if \fBSOCKSPort\fP is non-zero): +.LP .TP \fBAllowUnverifiedNodes\fR \fBentry\fR|\fBexit\fR|\fBmiddle\fR|\fBintroduction\fR|\fBrendezvous\fR|...\fP Where on our circuits should we allow Tor servers that the directory servers haven't authenticated as "verified"? (Default: middle,rendezvous) +.LP .TP \fBClientOnly \fR\fB0\fR|\fB1\fR\fP If set to 1, Tor will under no circumstances run as a server. The default @@ -175,33 +204,41 @@ This option will likely be deprecated in the future; see the NoPublish option below. (Default: 0) +.LP .TP \fBEntryNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP A list of preferred nodes to use for the first hop in the circuit, if possible. +.LP .TP \fBExitNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP A list of preferred nodes to use for the last hop in the circuit, if possible. +.LP .TP \fBExcludeNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP A list of nodes to never use when building a circuit. +.LP .TP \fBStrictExitNodes \fR\fB0\fR|\fB1\fR\fP If 1, Tor will never use any nodes besides those listed in "exitnodes" for the last hop of a circuit. +.LP .TP \fBStrictEntryNodes \fR\fB0\fR|\fB1\fR\fP If 1, Tor will never use any nodes besides those listed in "entrynodes" for the first hop of a circuit. +.LP .TP \fBFascistFirewall \fR\fB0\fR|\fB1\fR\fP If 1, Tor will only create outgoing connections to ORs running on ports that your firewall allows (defaults to 80 and 443; see \fBFirewallPorts\fR). This will allow you to run Tor as a client behind a firewall with restrictive policies, but will not allow you to run as a server behind such a firewall. +.LP .TP \fBFirewallPorts \fR\fIPORTS\fP A list of ports that your firewall allows you to connect to. Only used when \fBFascistFirewall\fR is set. (Default: 80, 443) +.LP .TP \fBLongLivedPorts \fR\fIPORTS\fP A list of ports for services that tend to have long-running connections @@ -209,25 +246,30 @@ ports will contain only high-uptime nodes, to reduce the chance that a node will go down before the stream is finished. (Default: 21, 22, 706, 1863, 5050, 5190, 5222, 5223, 6667, 8300, 8888) +.LP .TP \fBMapAddress\fR \fIaddress\fR \fInewaddress\fR When a request for address arrives to Tor, it will rewrite it to newaddress before processing it. For example, if you always want connections to www.indymedia.org to exit via \fItorserver\fR (where \fItorserver\fR is the nickname of the server), use "MapAddress www.indymedia.org www.indymedia.org.torserver.exit". +.LP .TP \fBNewCircuitPeriod \fR\fINUM\fP Every NUM seconds consider whether to build a new circuit. (Default: 30 seconds) +.LP .TP \fBMaxCircuitDirtiness \fR\fINUM\fP Feel free to reuse a circuit that was first used at most NUM seconds ago, but never attach a new stream to a circuit that is too old. (Default: 10 minutes) +.LP .TP \fBNodeFamily \fR\fInickname\fR,\fInickname\fR,\fI...\fP The named Tor servers constitute a "family" of similar or co-administered servers, so never use any two of them in the same circuit. Defining a NodeFamily is only needed when a server doesn't list the family itself (with MyFamily). This option can be used multiple times. +.LP .TP .\" \fBPathlenCoinWeight \fR\fI0.0-1.0\fP .\" Paths are 3 hops plus a geometric distribution centered around this coinweight. @@ -235,24 +277,29 @@ .\" .TP \fBRendNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP A list of preferred nodes to use for the rendezvous point, if possible. +.LP .TP \fBRendExcludeNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP A list of nodes to never use when choosing a rendezvous point. +.LP .TP \fBSOCKSPort \fR\fIPORT\fP Advertise this port to listen for connections from SOCKS-speaking applications. Set this to 0 if you don't want to allow application connections. (Default: 9050) +.LP .TP \fBSOCKSBindAddress \fR\fIIP\fR[:\fIPORT\fR]\fP Bind to this address to listen for connections from SOCKS-speaking applications. (Default: 127.0.0.1) You can also specify a port (e.g. 192.168.0.1:9100). This directive can be specified multiple times to bind to multiple addresses/ports. +.LP .TP \fBSOCKSPolicy \fR\fIpolicy\fR,\fIpolicy\fR,\fI...\fP Set an entrance policy for this server, to limit who can connect to the SOCKS ports. The policies have the same form as exit policies below. +.LP .TP \fBTrackHostExits \fR\fIhost\fR,\fI.domain\fR,\fI...\fR\fP For each value in the comma separated list, Tor will track recent connections @@ -265,6 +312,7 @@ making it more clear that a given history is associated with a single user. However, most people who would wish to observe this will observe it through cookies or other protocol-specific means anyhow. +.LP .TP \fBTrackHostExitsExpire \fR\fINUM\fP Since exit servers go up and down, it is desirable to expire the association @@ -274,13 +322,16 @@ .SH SERVER OPTIONS .PP The following options are useful only for servers (that is, if \fBORPort\fP is non-zero): +.LP .TP \fBAddress \fR\fIaddress\fP The IP or fqdn of this server (e.g. moria.mit.edu). You can leave this unset, and Tor will guess your IP. +.LP .TP \fBContactInfo \fR\fIemail_address\fP Administrative contact information for server. +.LP .TP \fBExitPolicy \fR\fIpolicy\fR,\fIpolicy\fR,\fI...\fP Set an exit policy for this server. Each policy is of the form @@ -323,9 +374,11 @@ .IP "accept *:*" .RE .PD +.LP .TP \fBMaxOnionsPending \fR\fINUM\fP If you have more than this number of onionskins queued for decrypt, reject new ones. (Default: 100) +.LP .TP \fBMyFamily \fR\fInickname\fR,\fInickname\fR,\fI...\fP Declare that this Tor server is controlled or administered by a group @@ -333,9 +386,11 @@ When two servers both declare that they are in the same 'family', Tor clients will not use them in the same circuit. (Each server only needs to list the other servers in its family; it doesn't need to list itself, but it won't hurt.) +.LP .TP \fBNickname \fR\fIname\fP Set the server's nickname to 'name'. +.LP .TP \fBNoPublish \fR\fB0\fR|\fB1\fR\fP If you set NoPublish 1, Tor will act as a server if you have an ORPort @@ -343,17 +398,21 @@ option is useful if you're testing out your server, or if you're using alternate dirservers (e.g. for other Tor networks such as Blossom). (Default: 0) +.LP .TP \fBNumCPUs \fR\fInum\fP How many processes to use at once for decrypting onionskins. (Default: 1) +.LP .TP \fBORPort \fR\fIPORT\fP Advertise this port to listen for connections from Tor clients and servers. +.LP .TP \fBORBindAddress \fR\fIIP\fR[:\fIPORT\fR]\fP Bind to this IP address to listen for connections from Tor clients and servers. If you specify a port, bind to this port rather than the one specified in ORPort. (Default: 0.0.0.0) +.LP .TP \fBRedirectExit \fR\fIpattern target\fP Whenever an outgoing connection tries to connect to one of a given set @@ -366,17 +425,20 @@ redirection is to be performed on a given set of addresses by using the special target string "pass", which prevents subsequent rules from being considered. +.LP .TP \fBShutdownWaitLength\fR\fINUM\fP When we get a SIGINT and we're a server, we begin shutting down: we close listeners and start refusing new circuits. After \fBNUM\fP seconds, we exit. If we get a second SIGINT, we exit immediately. (Default: 30 seconds) +.LP .TP \fBDirPostPeriod \fR\fIN\fR \fBseconds\fR|\fBminutes\fR|\fBhours\fR|\fBdays\fR|\fBweeks\fP Every time the specified period elapses, Tor uploads its server descriptors to the directory servers. This information is also uploaded whenever it changes. (Default: 20 minutes) +.LP .TP \fBAccountingMax \fR\fIN\fR \fBbytes\fR|\fBKB\fR|\fBMB\fR|\fBGB\fR|\fBTB\fP Never send more than the specified number of bytes in a given @@ -392,6 +454,7 @@ provides users with a collection of fast servers that are up some of the time, which is more useful than a set of slow servers that are always "available". +.LP .TP \fBAccountingStart \fR\fBday\fR|\fBweek\fR|\fBmonth\fR [\fIday\fR] \fIHH:MM\fR\fP Specify how long accounting periods last. If \fBmonth\fP is given, @@ -408,6 +471,7 @@ .SH DIRECTORY SERVER OPTIONS .PP The following options are useful only for directory servers (that is, if \fBDirPort\fP is non-zero): +.LP .TP \fBAuthoritativeDirectory \fR\fB0\fR|\fB1\fR\fP When this option is set to 1, Tor operates as an authoritative @@ -416,17 +480,21 @@ Unless the clients already have you listed as a trusted directory, you probably do not want to set this option. Please coordinate with the other admins at tor-ops at freehaven.net if you think you should be a directory. +.LP .TP \fBDirPort \fR\fIPORT\fP Advertise the directory service on this port. +.LP .TP \fBDirBindAddress \fR\fIIP\fR[:\fIPORT\fR]\fP Bind the directory service to this address. If you specify a port, bind to this port rather than the one specified in DirPort. (Default: 0.0.0.0) +.LP .TP \fBDirPolicy \fR\fIpolicy\fR,\fIpolicy\fR,\fI...\fP Set an entrance policy for this server, to limit who can connect to the directory ports. The policies have the same form as exit policies above. +.LP .TP \fBRecommendedVersions \fR\fISTRING\fP STRING is a command-separated list of Tor versions currently believed @@ -434,11 +502,13 @@ pull down the directory learn whether they need to upgrade. This option can appear multiple times: the values from multiple lines are spliced together. +.LP .TP \fBDirAllowPrivateAddresses \fR\fB0\fR|\fB1\fR\fP If set to 1, Tor will accept router descriptors with arbitrary "Address" elements. Otherwise, if the address is not an IP or is a private IP, it will reject the router descriptor. Defaults to 0. +.LP .TP \fBRunTesting \fR\fB0\fR|\fB1\fR\fP If set to 1, Tor tries to build circuits through all of the servers it @@ -449,11 +519,13 @@ .SH HIDDEN SERVICE OPTIONS .PP The following options are used to configure a hidden service. +.LP .TP \fBHiddenServiceDir \fR\fIDIRECTORY\fP Store data files for a hidden service in DIRECTORY. Every hidden service must have a separate directory. You may use this option multiple times to specify multiple services. +.LP .TP \fBHiddenServicePort \fR\fIVIRTPORT \fR[\fITARGET\fR]\fP Configure a virtual port VIRTPORT for a hidden service. You may use this @@ -461,15 +533,18 @@ hiddenservicedir. By default, this option maps the virtual port to the same port on 127.0.0.1. You may override the target port, address, or both by specifying a target of addr, port, or addr:port. +.LP .TP \fBHiddenServiceNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP If possible, use the specified nodes as introduction points for the hidden service. If this is left unset, Tor will be smart and pick some reasonable ones; most people can leave this unset. +.LP .TP \fBHiddenServiceExcludeNodes \fR\fInickname\fR,\fInickname\fR,\fI...\fP Do not use the specified nodes as introduction points for the hidden service. In normal use there is no reason to set this. +.LP .TP \fBRendPostPeriod \fR\fIN\fR \fBseconds\fR|\fBminutes\fR|\fBhours\fR|\fBdays\fR|\fBweeks\fP Every time the specified period elapses, Tor uploads any rendezvous @@ -481,42 +556,52 @@ .SH SIGNALS Tor catches the following signals: +.LP .TP \fBSIGTERM\fR Tor will catch this, clean up and sync to disk if necessary, and exit. +.LP .TP \fBSIGINT\fR Tor clients behave as with SIGTERM; but Tor servers will do a controlled slow shutdown, closing listeners and waiting 30 seconds before exiting. (The delay can be configured with the ShutdownWaitLength config option.) +.LP .TP \fBSIGHUP\fR The signal instructs Tor to reload its configuration (including closing and reopening logs), fetch a new directory, and kill and restart its helper processes if applicable. +.LP .TP \fBSIGUSR1\fR Log statistics about current connections, past connections, and throughput. +.LP .TP \fBSIGUSR2\fR Switch all logs to loglevel debug. You can go back to the old loglevels by sending a SIGHUP. +.LP .TP \fBSIGCHLD\fR Tor receives this signal when one of its helper processes has exited, so it can clean up. +.LP .TP \fBSIGPIPE\fR Tor catches this signal and ignores it. +.LP .TP \fBSIGXFSZ\fR If this signal exists on your platform, Tor catches and ignores it. .SH FILES +.LP .TP .I @CONFDIR@/torrc The configuration file, which contains "option value" pairs. +.LP .TP .I @LOCALSTATEDIR@/lib/tor/ The tor process stores keys and other data here. From arma at seul.org Sun Jun 26 08:59:03 2005 From: arma at seul.org (arma at seul.org) Date: Sun, 26 Jun 2005 04:59:03 -0400 (EDT) Subject: [or-cvs] make the comment next to RunAsDaemon mention that it is a n... Message-ID: <20050626085903.881EA140821D@moria.seul.org> Update of /home2/or/cvsroot/tor/src/config In directory moria:/home/arma/work/onion/cvs/tor/src/config Modified Files: torrc.sample.in Log Message: make the comment next to RunAsDaemon mention that it is a noop on win32 Index: torrc.sample.in =================================================================== RCS file: /home2/or/cvsroot/tor/src/config/torrc.sample.in,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- torrc.sample.in 9 Jun 2005 10:42:25 -0000 1.59 +++ torrc.sample.in 26 Jun 2005 08:59:01 -0000 1.60 @@ -45,7 +45,8 @@ #Log debug stderr ## Uncomment this to start the process in the background... or use -## --runasdaemon 1 on the command line. +## --runasdaemon 1 on the command line. This is ignored on Windows; +## see the FAQ entry if you want Tor to run as an NT service. #RunAsDaemon 1 ## Tor only trusts directories signed with one of these keys, and From phobos at seul.org Sun Jun 26 13:53:23 2005 From: phobos at seul.org (phobos at seul.org) Date: Sun, 26 Jun 2005 09:53:23 -0400 (EDT) Subject: [or-cvs] updated screenshots, added 2 for privoxy logfile and jarfile. Message-ID: <20050626135323.458311408108@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv17084 Modified Files: tor-doc-win32.html Log Message: updated screenshots, added 2 for privoxy logfile and jarfile. Screenshots courtesy of memeticist. Index: tor-doc-win32.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-win32.html,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- tor-doc-win32.html 26 Jun 2005 05:21:17 -0000 1.51 +++ tor-doc-win32.html 26 Jun 2005 13:53:21 -0000 1.52 @@ -43,7 +43,7 @@

    tor installer splash page +src="http://tor.eff.org/img/screenshot-win32-installer-splash.png" />

    By default, Tor is not configured to run at startup. @@ -53,7 +53,7 @@

    select components to install +src="http://tor.eff.org/img/screenshot-win32-installer-components.png" />

    Once the installer is finished, it will run Tor in a window so you can see its logs and errors. (You can minimize this window, but do @@ -61,7 +61,7 @@

    tor window screenshot +src="http://tor.eff.org/img/screenshot-win32-dos-window.png" />

    Tor comes configured as a client by default. It uses a built-in default configuration file, and most people won't need to change any of @@ -87,7 +87,7 @@

    editing privoxy config +src="http://tor.eff.org/img/screenshot-win32-privoxy-config.png" />

    Add the line
    forward-socks4a / localhost:9050 .
    @@ -96,16 +96,23 @@ the file. Be sure to save.

    +privoxy points to tor +

    Privoxy keeps a log file of everything passed through it. In -order to stop this you will need to comment out (insert a # before) the line
    +order to stop this you will need to comment out two lines by inserting a +# before the line. The two lines are:
    logfile privoxy.log
    and the line
    jarfile jar.log
    Be sure to save.

    -privoxy points to tor +comment out logfile + +comment out jarfile

    Step Three: Configure your applications to use Tor

    From phobos at seul.org Sun Jun 26 13:54:21 2005 From: phobos at seul.org (phobos at seul.org) Date: Sun, 26 Jun 2005 09:54:21 -0400 (EDT) Subject: [or-cvs] Added new screenshots for 0.1.0.10. Message-ID: <20050626135421.1A77E1408108@moria.seul.org> Update of /home/or/cvsroot/website/img In directory moria:/tmp/cvs-serv17204 Added Files: screenshot-win32-dos-window.png screenshot-win32-installer-components.png screenshot-win32-installer-splash.png screenshot-win32-privoxy-config.png screenshot-win32-privoxy-edit-2.png screenshot-win32-privoxy-edit-3.png screenshot-win32-privoxy-edit.png Log Message: Added new screenshots for 0.1.0.10. --- NEW FILE: screenshot-win32-dos-window.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: screenshot-win32-installer-components.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: screenshot-win32-installer-splash.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: screenshot-win32-privoxy-config.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: screenshot-win32-privoxy-edit-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: screenshot-win32-privoxy-edit-3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: screenshot-win32-privoxy-edit.png --- (This appears to be a binary file; contents omitted.) From nickm at seul.org Sat Jun 4 02:42:58 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 3 Jun 2005 22:42:58 -0400 (EDT) Subject: [or-cvs] Oops. I guess I would probably get more comments about thi... Message-ID: <20050604024258.8185F14081B9@moria.seul.org> Update of /home/or/cvsroot/control In directory moria:/tmp/cvs-serv6608 Added Files: LICENSE TODO Log Message: Oops. I guess I would probably get more comments about this clever controller API/demo stuff if I actually committed it to CVS. Here then. --- NEW FILE: LICENSE --- =============================================================================== The Tor controller demonstration code is distributed under this license: Copyright (c) 2005, Nick Mathewson, Roger Dingledine Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the names of the copyright owners nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- NEW FILE: TODO --- $Id: TODO,v 1.1 2005/06/04 02:42:55 nickm Exp $ - The inline documentation generally needs lots more work. Some of it implicitly assumes that the user has read "control-spec.txt". - We need a makefile to package this all with a plausible control-spec.txt - We need some overview documents to explain how to use the code. Telling people to read net/freehaven/tor/control/examples/Main.java or TorExample.py doesn't cut it. - We need to explain step-by-step how to achieve all of the things we want people to do on the contest, especially how to launch Tor securely. From nickm at seul.org Mon Jun 6 21:33:43 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 6 Jun 2005 17:33:43 -0400 (EDT) Subject: [or-cvs] Make 0.1.0.x bugfix for bug 151 more conservative. Message-ID: <20050606213343.C34BD140805A@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv2442/src/common Modified Files: Tag: tor-0_1_0-patches crypto.c Log Message: Make 0.1.0.x bugfix for bug 151 more conservative. Index: crypto.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v retrieving revision 1.137.2.1 retrieving revision 1.137.2.2 diff -u -d -r1.137.2.1 -r1.137.2.2 --- crypto.c 6 Jun 2005 20:10:02 -0000 1.137.2.1 +++ crypto.c 6 Jun 2005 21:33:41 -0000 1.137.2.2 @@ -1433,11 +1433,11 @@ } provider_set = 1; } - if (!CryptGenRandom(provider, sizeof(buf), buf)) { + if (!CryptGenRandom(provider, DIGEST_LEN, buf)) { log_fn(LOG_ERR,"Can't get entropy from CryptoAPI."); return -1; } - RAND_seed(buf, sizeof(buf)); + RAND_seed(buf, DIGEST_LEN); /* And add the current screen state to the entropy pool for * good measure. */ RAND_screen(); @@ -1454,13 +1454,13 @@ fd = open(filenames[i], O_RDONLY, 0); if (fd<0) continue; log_fn(LOG_INFO, "Seeding RNG from %s", filenames[i]); - n = read_all(fd, buf, sizeof(buf), 0); + n = read(fd, buf, DIGEST_LEN); close(fd); - if (n != sizeof(buf)) { + if (n != DIGEST_LEN) { log_fn(LOG_WARN, "Error reading from entropy source"); return -1; } - RAND_seed(buf, sizeof(buf)); + RAND_seed(buf, DIGEST_LEN); return 0; } From phobos at seul.org Sun Jun 26 13:56:06 2005 From: phobos at seul.org (phobos at seul.org) Date: Sun, 26 Jun 2005 09:56:06 -0400 (EDT) Subject: [or-cvs] Fixed some formatting. Message-ID: <20050626135606.44F321408269@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv17446 Modified Files: tor-doc-win32.html Log Message: Fixed some formatting. Index: tor-doc-win32.html =================================================================== RCS file: /home/or/cvsroot/tor/doc/tor-doc-win32.html,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- tor-doc-win32.html 26 Jun 2005 13:53:21 -0000 1.52 +++ tor-doc-win32.html 26 Jun 2005 13:56:04 -0000 1.53 @@ -111,6 +111,8 @@ comment out logfile +
    + comment out jarfile From thomass at seul.org Sun Jun 26 22:39:11 2005 From: thomass at seul.org (thomass at seul.org) Date: Sun, 26 Jun 2005 18:39:11 -0400 (EDT) Subject: [or-cvs] tor-manual-cvs.html: post rubber chicken update Message-ID: <20050626223911.639D5140809B@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv4954 Modified Files: tor-manual-cvs.html Log Message: tor-manual-cvs.html: post rubber chicken update Index: tor-manual-cvs.html =================================================================== RCS file: /home2/or/cvsroot/website/tor-manual-cvs.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- tor-manual-cvs.html 23 Jun 2005 00:18:19 -0000 1.12 +++ tor-manual-cvs.html 26 Jun 2005 22:39:08 -0000 1.13 @@ -39,23 +39,45 @@ -h, -help Display a short help message and exit. +

    +

    -f FILE
    FILE contains further "option value" pairs. (Default: @CONFDIR@/torrc) +
    +

    + +

    Other options can be specified either on the command-line (--option
    value), or in the configuration file (option value). Options are case-insensitive. +
    +

    + +

    BandwidthRate N bytes|KB|MB|GB|TB
    A token bucket limits the average incoming bandwidth on this node to the specified number of bytes per second. (Default: 2 MB) +
    +

    + +

    BandwidthBurst N bytes|KB|MB|GB|TB
    Limit the maximum token bucket size (also known as the burst) to the given number of bytes. (Default: 5 MB) +
    +

    + +

    MaxAdvertisedBandwidth N bytes|KB|MB|GB|TB
    If set, we will not advertise more than this amount of bandwidth for our BandwidthRate. Server operators who want to reduce the number of clients who ask to build circuits through them (since this is proportional to advertised bandwidth rate) can thus reduce the CPU demands on their server without impacting network performance. +
    +

    + +

    ControlPort Port
    If set, Tor will accept connections from the same machine (localhost only) on this port, and allow those connections to control the Tor process using the @@ -63,57 +85,105 @@ specify one of HashedControlPassword or CookieAuthentication, setting this option will cause Tor to allow any process on the local host to control it. +
    +

    + +

    HashedControlPassword hashed_password
    Don't allow any connections on the control port except when the other process knows the password whose one-way hash is hashed_password. You can compute the hash of a password by running "tor --hash-password password". +
    +

    + +

    CookieAuthentication 0|1
    If this option is set to 1, don't allow any connections on the control port except when the connecting process knows the contents of a file named "control_auth_cookie", which Tor will create in its data directory. This authentication methods should only be used on systems with good filesystem security. (Default: 0) +
    +

    + +

    DataDirectory DIR
    Store working data in DIR (Default: @LOCALSTATEDIR@/lib/tor) +
    +

    + +

    DirFetchPeriod N seconds|minutes|hours|days|weeks
    Every time the specified period elapses, Tor downloads a directory. A directory contains a signed list of all known servers as well as their current liveness status. A value of "0 seconds" tells Tor to choose an appropriate default. (Default: 1 hour for clients, 20 minutes for servers) +
    +

    + +

    DirServer address:port fingerprint
    Use a nonstandard authoritative directory server at the provided address and port, with the specified key fingerprint. This option can be repeated many times, for multiple authoritative directory servers. If no dirserver line is given, Tor will use the default directory servers: moria1, moria2, and tor26. +
    +

    + +

    Group GID
    On startup, setgid to this user. +
    +

    + +

    HttpProxy host[:port]
    Tor will make all its directory requests through this host:port (or host:80 if port is not specified), rather than connecting directly to any directory servers. +
    +

    + +

    HttpProxyAuthenticator username:password
    If defined, Tor will use this username:password for Basic Http proxy authentication, as in RFC 2617. This is currently the only form of Http proxy authentication that Tor supports; feel free to submit a patch if you want it to support others. +
    +

    + +

    HttpsProxy host[:port]
    Tor will make all its OR (SSL) connections through this host:port (or host:443 if port is not specified), via HTTP CONNECT rather than connecting directly to servers. You may want to set FascistFirewall to restrict the set of ports you might try to connect to, if your Https proxy only allows connecting to certain ports. +
    +

    + +

    HttpsProxyAuthenticator username:password
    If defined, Tor will use this username:password for Basic Https proxy authentication, as in RFC 2617. This is currently the only form of Https proxy authentication that Tor supports; feel free to submit a patch if you want it to support others. +
    +

    + +

    KeepalivePeriod NUM
    To keep firewalls from expiring connections, send a padding keepalive cell every NUM seconds on open connections that are in use. If the connection has no open circuits, it will instead be closed after NUM seconds of idleness. (Default: 5 minutes) +
    +

    + +

    Log minSeverity[-maxSeverity] stderr|stdout|syslog
    Send all messages between minSeverity and maxSeverity to the standard output stream, the standard error stream, or to the system @@ -121,33 +191,69 @@ severity levels are debug, info, notice, warn, and err. If only one severity level is given, all messages of that level or higher will be sent to the listed destination. +
    +

    + +

    Log minSeverity[-maxSeverity] file FILENAME
    As above, but send log messages to the listed filename. The "Log" option may appear more than once in a configuration file. Messages are sent to all the logs that match their severity level. +
    +

    + +

    MaxConn NUM
    Maximum number of simultaneous sockets allowed. You probably don't need to adjust this. (Default: 1024) +
    +

    + +

    OutboundBindAddress IP
    Make all outbound connections originate from the IP address specified. This is only useful when you have multiple network interfaces, and you want all of Tor's outgoing connections to use a single one. +
    +

    + +

    PIDFile FILE
    On startup, write our PID to FILE. On clean shutdown, remove FILE. +
    +

    + +

    RunAsDaemon 0|1
    If 1, Tor forks and daemonizes to the background. (Default: 0) +
    +

    + +

    SafeLogging 0|1
    If 1, Tor replaces potentially sensitive strings in the logs (e.g. addresses) with the string [scrubbed]. This way logs can still be useful, but they don't leave behind personally identifying information about what sites a user might have visited. (Default: 1) +
    +

    + +

    StatusFetchPeriod N seconds|minutes|hours|days|weeks
    Every time the specified period elapses, Tor downloads signed status information about the current state of known servers. A value of "0 seconds" tells Tor to choose an appropriate default. (Default: 30 minutes for clients, 15 minutes for servers) +
    +

    + +

    User UID
    On startup, setuid to this user. +
    +

    + +

    HardwareAccel 0|1
    If non-zero, try to use crypto hardware acceleration when available. (Default: 1. ) @@ -159,10 +265,16 @@

    The following options are useful only for clients (that is, if SOCKSPort is non-zero): +

    +

    AllowUnverifiedNodes entry|exit|middle|introduction|rendezvous|...
    Where on our circuits should we allow Tor servers that the directory servers haven't authenticated as "verified"? (Default: middle,rendezvous) +
    +

    + +

    ClientOnly 0|1
    If set to 1, Tor will under no circumstances run as a server. The default is to run as a client unless ORPort is configured. (Usually, @@ -171,68 +283,135 @@

    This option will likely be deprecated in the future; see the NoPublish option below. (Default: 0) +

    +

    + +

    EntryNodes nickname,nickname,...
    A list of preferred nodes to use for the first hop in the circuit, if possible. +
    +

    + +

    ExitNodes nickname,nickname,...
    A list of preferred nodes to use for the last hop in the circuit, if possible. +
    +

    + +

    ExcludeNodes nickname,nickname,...
    A list of nodes to never use when building a circuit. +
    +

    + +

    StrictExitNodes 0|1
    If 1, Tor will never use any nodes besides those listed in "exitnodes" for the last hop of a circuit. +
    +

    + +

    StrictEntryNodes 0|1
    If 1, Tor will never use any nodes besides those listed in "entrynodes" for the first hop of a circuit. +
    +

    + +

    FascistFirewall 0|1
    If 1, Tor will only create outgoing connections to ORs running on ports that your firewall allows (defaults to 80 and 443; see FirewallPorts). This will allow you to run Tor as a client behind a firewall with restrictive policies, but will not allow you to run as a server behind such a firewall. +
    +

    + +

    FirewallPorts PORTS
    A list of ports that your firewall allows you to connect to. Only used when FascistFirewall is set. (Default: 80, 443) +
    +

    + +

    LongLivedPorts PORTS
    A list of ports for services that tend to have long-running connections (e.g. chat and interactive shells). Circuits for streams that use these ports will contain only high-uptime nodes, to reduce the chance that a node will go down before the stream is finished. (Default: 21, 22, 706, 1863, 5050, 5190, 5222, 5223, 6667, 8300, 8888) +
    +

    + +

    MapAddress address newaddress
    When a request for address arrives to Tor, it will rewrite it to newaddress before processing it. For example, if you always want connections to www.indymedia.org to exit via torserver (where torserver is the nickname of the server), use "MapAddress www.indymedia.org www.indymedia.org.torserver.exit". +
    +

    + +

    NewCircuitPeriod NUM
    Every NUM seconds consider whether to build a new circuit. (Default: 30 seconds) +
    +

    + +

    MaxCircuitDirtiness NUM
    Feel free to reuse a circuit that was first used at most NUM seconds ago, but never attach a new stream to a circuit that is too old. (Default: 10 minutes) +
    +

    + +

    NodeFamily nickname,nickname,...
    The named Tor servers constitute a "family" of similar or co-administered servers, so never use any two of them in the same circuit. Defining a NodeFamily is only needed when a server doesn't list the family itself (with MyFamily). This option can be used multiple times. -
    -
    - - +
    +

    -RendNodes nickname,nickname,... +

    +
    RendNodes nickname,nickname,...
    A list of preferred nodes to use for the rendezvous point, if possible. +
    +

    + +

    RendExcludeNodes nickname,nickname,...
    A list of nodes to never use when choosing a rendezvous point. +
    +

    + +

    SOCKSPort PORT
    Advertise this port to listen for connections from SOCKS-speaking applications. Set this to 0 if you don't want to allow application connections. (Default: 9050) +
    +

    + +

    SOCKSBindAddress IP[:PORT]
    Bind to this address to listen for connections from SOCKS-speaking applications. (Default: 127.0.0.1) You can also specify a port (e.g. 192.168.0.1:9100). This directive can be specified multiple times to bind to multiple addresses/ports. +
    +

    + +

    SOCKSPolicy policy,policy,...
    Set an entrance policy for this server, to limit who can connect to the SOCKS ports. The policies have the same form as exit policies below. +
    +

    + +

    TrackHostExits host,.domain,...
    For each value in the comma separated list, Tor will track recent connections to hosts that match this value and attempt to @@ -244,6 +423,10 @@ making it more clear that a given history is associated with a single user. However, most people who would wish to observe this will observe it through cookies or other protocol-specific means anyhow. +
    +

    + +

    TrackHostExitsExpire NUM
    Since exit servers go up and down, it is desirable to expire the association between host and exit server after NUM seconds of inactivity. The default @@ -256,12 +439,22 @@

    The following options are useful only for servers (that is, if ORPort is non-zero): +

    +

    Address address
    The IP or fqdn of this server (e.g. moria.mit.edu). You can leave this unset, and Tor will guess your IP. +
    +

    + +

    ContactInfo email_address
    Administrative contact information for server. +
    +

    + +

    ExitPolicy policy,policy,...
    Set an exit policy for this server. Each policy is of the form "accept|reject ADDR[/MASK][:PORT]". @@ -306,30 +499,62 @@
    +
    +

    + +

    MaxOnionsPending NUM
    If you have more than this number of onionskins queued for decrypt, reject new ones. (Default: 100) +
    +

    + +

    MyFamily nickname,nickname,...
    Declare that this Tor server is controlled or administered by a group or organization identical or similar to that of the other named servers. When two servers both declare that they are in the same 'family', Tor clients will not use them in the same circuit. (Each server only needs to list the other servers in its family; it doesn't need to list itself, but it won't hurt.) +
    +

    + +

    Nickname name
    Set the server's nickname to 'name'. +
    +

    + +

    NoPublish 0|1
    If you set NoPublish 1, Tor will act as a server if you have an ORPort defined, but it will not publish its descriptor to the dirservers. This option is useful if you're testing out your server, or if you're using alternate dirservers (e.g. for other Tor networks such as Blossom). (Default: 0) +
    +

    + +

    NumCPUs num
    How many processes to use at once for decrypting onionskins. (Default: 1) +
    +

    + +

    ORPort PORT
    Advertise this port to listen for connections from Tor clients and servers. +
    +

    + +

    ORBindAddress IP[:PORT]
    Bind to this IP address to listen for connections from Tor clients and servers. If you specify a port, bind to this port rather than the one specified in ORPort. (Default: 0.0.0.0) +
    +

    + +

    RedirectExit pattern target
    Whenever an outgoing connection tries to connect to one of a given set of addresses, connect to target (an address:port pair) instead. @@ -341,15 +566,27 @@ redirection is to be performed on a given set of addresses by using the special target string "pass", which prevents subsequent rules from being considered. +
    +

    + +

    ShutdownWaitLengthNUM
    When we get a SIGINT and we're a server, we begin shutting down: we close listeners and start refusing new circuits. After NUM seconds, we exit. If we get a second SIGINT, we exit immediately. (Default: 30 seconds) +
    +

    + +

    DirPostPeriod N seconds|minutes|hours|days|weeks
    Every time the specified period elapses, Tor uploads its server descriptors to the directory servers. This information is also uploaded whenever it changes. (Default: 20 minutes) +
    +

    + +

    AccountingMax N bytes|KB|MB|GB|TB
    Never send more than the specified number of bytes in a given accounting period, or receive more than that number in the period. @@ -364,6 +601,10 @@ provides users with a collection of fast servers that are up some of the time, which is more useful than a set of slow servers that are always "available". +
    +

    + +

    AccountingStart day|week|month [day] HH:MM
    Specify how long accounting periods last. If month is given, each accounting period runs from the time HH:MM on the @@ -383,6 +624,8 @@

    The following options are useful only for directory servers (that is, if DirPort is non-zero): +

    +

    AuthoritativeDirectory 0|1
    When this option is set to 1, Tor operates as an authoritative @@ -391,24 +634,48 @@ Unless the clients already have you listed as a trusted directory, you probably do not want to set this option. Please coordinate with the other admins at tor-ops at freehaven.net if you think you should be a directory. +
    +

    + +

    DirPort PORT
    Advertise the directory service on this port. +
    +

    + +

    DirBindAddress IP[:PORT]
    Bind the directory service to this address. If you specify a port, bind to this port rather than the one specified in DirPort. (Default: 0.0.0.0) +
    +

    + +

    DirPolicy policy,policy,...
    Set an entrance policy for this server, to limit who can connect to the directory ports. The policies have the same form as exit policies above. +
    +

    + +

    RecommendedVersions STRING
    STRING is a command-separated list of Tor versions currently believed to be safe. The list is included in each directory, and nodes which pull down the directory learn whether they need to upgrade. This option can appear multiple times: the values from multiple lines are spliced together. +
    +

    + +

    DirAllowPrivateAddresses 0|1
    If set to 1, Tor will accept router descriptors with arbitrary "Address" elements. Otherwise, if the address is not an IP or is a private IP, it will reject the router descriptor. Defaults to 0. +
    +

    + +

    RunTesting 0|1
    If set to 1, Tor tries to build circuits through all of the servers it knows about, so it can tell which are up and which are down. This @@ -422,24 +689,42 @@

    The following options are used to configure a hidden service. +

    +

    HiddenServiceDir DIRECTORY
    Store data files for a hidden service in DIRECTORY. Every hidden service must have a separate directory. You may use this option multiple times to specify multiple services. +
    +

    + +

    HiddenServicePort VIRTPORT [TARGET]
    Configure a virtual port VIRTPORT for a hidden service. You may use this option multiple times; each time applies to the service using the most recent hiddenservicedir. By default, this option maps the virtual port to the same port on 127.0.0.1. You may override the target port, address, or both by specifying a target of addr, port, or addr:port. +
    +

    + +

    HiddenServiceNodes nickname,nickname,...
    If possible, use the specified nodes as introduction points for the hidden service. If this is left unset, Tor will be smart and pick some reasonable ones; most people can leave this unset. +
    +

    + +

    HiddenServiceExcludeNodes nickname,nickname,...
    Do not use the specified nodes as introduction points for the hidden service. In normal use there is no reason to set this. +
    +

    + +

    RendPostPeriod N seconds|minutes|hours|days|weeks
    Every time the specified period elapses, Tor uploads any rendezvous service descriptors to the directory servers. This information is also @@ -453,28 +738,58 @@

    SIGNALS

    Tor catches the following signals: +

    +

    SIGTERM
    Tor will catch this, clean up and sync to disk if necessary, and exit. +
    +

    + +

    SIGINT
    Tor clients behave as with SIGTERM; but Tor servers will do a controlled slow shutdown, closing listeners and waiting 30 seconds before exiting. (The delay can be configured with the ShutdownWaitLength config option.) +
    +

    + +

    SIGHUP
    The signal instructs Tor to reload its configuration (including closing and reopening logs), fetch a new directory, and kill and restart its helper processes if applicable. +
    +

    + +

    SIGUSR1
    Log statistics about current connections, past connections, and throughput. +
    +

    + +

    SIGUSR2
    Switch all logs to loglevel debug. You can go back to the old loglevels by sending a SIGHUP. +
    +

    + +

    SIGCHLD
    Tor receives this signal when one of its helper processes has exited, so it can clean up. +
    +

    + +

    SIGPIPE
    Tor catches this signal and ignores it. +
    +

    + +

    SIGXFSZ
    If this signal exists on your platform, Tor catches and ignores it.

    @@ -482,11 +797,17 @@  

    FILES

    +

    +

    @CONFDIR@/torrc
    The configuration file, which contains "option value" pairs. +
    +

    + +

    @LOCALSTATEDIR@/lib/tor/
    @@ -537,6 +858,6 @@ This document was created by man2html, using the manual pages.
    -Time: 00:17:30 GMT, June 23, 2005 +Time: 22:36:14 GMT, June 26, 2005 From nickm at seul.org Mon Jun 27 18:35:01 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 14:35:01 -0400 (EDT) Subject: [or-cvs] Specify versioned service descriptors including full info o... Message-ID: <20050627183501.9FC101408112@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv19492/doc Modified Files: rend-spec.txt Log Message: Specify versioned service descriptors including full info on intro points. Arma -- does this look sane? Index: rend-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/rend-spec.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- rend-spec.txt 20 Jun 2005 00:08:47 -0000 1.26 +++ rend-spec.txt 27 Jun 2005 18:34:59 -0000 1.27 @@ -110,7 +110,25 @@ The first time the OP provides an advertised service, it generates a public/private keypair (stored locally). Periodically, the OP - generates a service descriptor, containing: + generates a pair of service descriptors, one "V1" and one "V0". + + The "V1" descriptor contains: + + V Version byte: set to 1 [1 octet] + KL Key length [2 octets] + PK Bob's public key [KL octets] + TS A timestamp [4 octets] + PROTO Protocol version: bitmask [2 octets] + NI Number of introduction points [2 octets] + For each introduction point: (as in INTRODUCE2 cells) + IP Rendezvous point's address [4 octets] + PORT Rendezvous point's OR port [2 octets] + ID Rendezvous point identity ID [20 octets] + KLEN Length of onion key [2 octets] + KEY Rendezvous point onion key [KLEN octets] + SIG Signature of above fields [variable] + + The "V0" descriptor contains: KL Key length [2 octets] PK Bob's public key [KL octets] @@ -131,6 +149,9 @@ to do that if he previously advertised some introduction points, and now he doesn't have any. -RD] + [Once Tor 0.1.0.x is obsolete, we can stop generating or using V0 + descriptors. -NM] + 1.3. Bob's OP establishes his introduction points. The OP establishes a new introduction circuit to each introduction @@ -159,23 +180,26 @@ currently associated with PK. On success, the OR sends Bob a RELAY_INTRO_ESTABLISHED cell with an empty payload. -1.4. Bob's OP advertises his service descriptor +1.4. Bob's OP advertises his service descriptor(s) Bob's OP opens a stream to each directory server's directory port via Tor. - (He may re-use old circuits for this.) - Over this stream, Bob's OP makes an HTTP 'POST' request, to the URL - '/tor/rendezvous/publish' (relative to the directory server's root), - containing as its body Bob's service descriptor. Upon receiving a - descriptor, the directory server checks the signature, and discards the - descriptor if the signature does not match the enclosed public key. Next, - the directory server checks the timestamp. If the timestamp is more than - 24 hours in the past or more than 1 hour in the future, or the directory - server already has a newer descriptor with the same public key, the server - discards the descriptor. Otherwise, the server discards any older - descriptors with the same public key, and associates the new descriptor - with the public key. The directory server remembers this descriptor for - at least 24 hours after its timestamp. At least every 24 hours, Bob's OP - uploads a fresh descriptor. + (He may re-use old circuits for this.) Over this stream, Bob's OP makes + an HTTP 'POST' request, to a URL relative to the directory server's root, + containing as its body Bob's service descriptor. + + For "V1" descriptors, the URL is /tor/rendezvous1/publish + For "V0" descriptors, the URL is /tor/rendezvous/publish + + Upon receiving a descriptor, the directory server checks the signature, + and discards the descriptor if the signature does not match the enclosed + public key. Next, the directory server checks the timestamp. If the + timestamp is more than 24 hours in the past or more than 1 hour in the + future, or the directory server already has a newer descriptor with the + same public key, the server discards the descriptor. Otherwise, the + server discards any older descriptors with the same public key, and + associates the new descriptor with the public key. The directory server + remembers this descriptor for at least 24 hours after its timestamp. At + least every 24 hours, Bob's OP uploads a fresh descriptor. 1.5. Alice receives a y.onion address @@ -197,12 +221,16 @@ 1.6. Alice's OP retrieves a service descriptor - Alice opens a stream to a directory server via Tor, and makes an - HTTP GET request for the document '/tor/rendezvous/', where - ' is replaced with the encoding of Bob's public key as described - above. (She may re-use old circuits for this.) The directory replies - with a 404 HTTP response if it does not recognize , and otherwise - returns Bob's most recently uploaded service descriptor. + Alice opens a stream to a directory server via Tor, and makes an HTTP GET + request for the document '/tor/rendezvous/' or '/tor/rendezvous1/', + where ' is replaced with the encoding of Bob's public key as described + above. (She may re-use old circuits for this.) The directory replies with + a 404 HTTP response if it does not recognize , and otherwise returns + Bob's most recently uploaded service descriptor of the appropriate + version. + + (Alice should try to fetch the V1 descriptor first, and only try to fetch + a V0 descriptor if it is not available.) If Alice's OP receives a 404 response, it tries the other directory servers, and only fails the lookup if none recognizes the public key hash. @@ -261,7 +289,8 @@ IP Rendezvous point's address [4 octets] PORT Rendezvous point's OR port [2 octets] ID Rendezvous point identity ID [20 octets] - KEY Rendezvous point onion key [128 octets] + KLEN Length of onion key [2 octets] + KEY Rendezvous point onion key [KLEN octets] RC Rendezvous cookie [20 octets] g^x Diffie-Hellman data, part 1 [128 octets] @@ -269,9 +298,11 @@ and must contain EITHER a nickname, or an identity key digest, encoded in hex, and prefixed with a '$'. - Implementations must accept all variants, but should only generate the - first so long as any version of Tor before 0.1.1 is still in use. - Implementations should never generate the second version. + Implementations SHOULD accept all variants, and list the variants they + accept in their V1 descriptor. Implementations should only generate the + variants listed in the service's V1 descriptor; if no V1 descriptor is + available, only the first variant should be generated. No version should + generate the second variant (version byte=1). The hybrid encryption to Bob's PK works just like the hybrid encryption in CREATE cells (see main spec). Thus the payload of the From nickm at seul.org Mon Jun 27 18:35:12 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 14:35:12 -0400 (EDT) Subject: [or-cvs] Bump CVS version to 0.1.1.1-alpha Message-ID: <20050627183512.E7BAB14081BF@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/tmp/cvs-serv19562/contrib Modified Files: tor.nsi Log Message: Bump CVS version to 0.1.1.1-alpha Index: tor.nsi =================================================================== RCS file: /home/or/cvsroot/tor/contrib/tor.nsi,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- tor.nsi 6 Jun 2005 20:27:34 -0000 1.42 +++ tor.nsi 27 Jun 2005 18:35:10 -0000 1.43 @@ -31,7 +31,7 @@ !include "MUI.nsh" -!define VERSION "0.1.1.0-alpha-cvs" +!define VERSION "0.1.1.1-alpha" !define INSTALLER "tor-${VERSION}-win32.exe" !define WEBSITE "http://tor.eff.org/" From nickm at seul.org Mon Jun 27 18:35:12 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 14:35:12 -0400 (EDT) Subject: [or-cvs] Bump CVS version to 0.1.1.1-alpha Message-ID: <20050627183512.E8F621408EAA@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/tmp/cvs-serv19562 Modified Files: configure.in Log Message: Bump CVS version to 0.1.1.1-alpha Index: configure.in =================================================================== RCS file: /home/or/cvsroot/tor/configure.in,v retrieving revision 1.216 retrieving revision 1.217 diff -u -d -r1.216 -r1.217 --- configure.in 18 Jun 2005 02:17:11 -0000 1.216 +++ configure.in 27 Jun 2005 18:35:10 -0000 1.217 @@ -4,7 +4,7 @@ dnl See LICENSE for licensing information AC_INIT -AM_INIT_AUTOMAKE(tor, 0.1.1.0-alpha-cvs) +AM_INIT_AUTOMAKE(tor, 0.1.1.1-alpha) AM_CONFIG_HEADER(orconfig.h) AC_CANONICAL_HOST From nickm at seul.org Mon Jun 27 18:35:13 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 14:35:13 -0400 (EDT) Subject: [or-cvs] Bump CVS version to 0.1.1.1-alpha Message-ID: <20050627183513.0D9AB1408EC7@moria.seul.org> Update of /home/or/cvsroot/tor/src/win32 In directory moria:/tmp/cvs-serv19562/src/win32 Modified Files: orconfig.h Log Message: Bump CVS version to 0.1.1.1-alpha Index: orconfig.h =================================================================== RCS file: /home/or/cvsroot/tor/src/win32/orconfig.h,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- orconfig.h 6 Jun 2005 20:27:36 -0000 1.61 +++ orconfig.h 27 Jun 2005 18:35:10 -0000 1.62 @@ -215,4 +215,4 @@ #define HAVE_EVENT_H /* Version number of package */ -#define VERSION "0.1.1.0-alpha-cvs" +#define VERSION "0.1.1.1-alpha" From nickm at seul.org Mon Jun 27 20:43:10 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 16:43:10 -0400 (EDT) Subject: [or-cvs] Make the two rendezvous service descriptor formats distingu... Message-ID: <20050627204310.1DD0A1408114@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv26337/doc Modified Files: rend-spec.txt Log Message: Make the two rendezvous service descriptor formats distinguishable to simplify the directory interactions a bit. Index: rend-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/rend-spec.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- rend-spec.txt 27 Jun 2005 18:34:59 -0000 1.27 +++ rend-spec.txt 27 Jun 2005 20:43:07 -0000 1.28 @@ -114,11 +114,12 @@ The "V1" descriptor contains: + V Format byte: set to 255 [1 octet] V Version byte: set to 1 [1 octet] KL Key length [2 octets] PK Bob's public key [KL octets] TS A timestamp [4 octets] - PROTO Protocol version: bitmask [2 octets] + PROTO Protocol versions: bitmask [2 octets] NI Number of introduction points [2 octets] For each introduction point: (as in INTRODUCE2 cells) IP Rendezvous point's address [4 octets] @@ -184,11 +185,8 @@ Bob's OP opens a stream to each directory server's directory port via Tor. (He may re-use old circuits for this.) Over this stream, Bob's OP makes - an HTTP 'POST' request, to a URL relative to the directory server's root, - containing as its body Bob's service descriptor. - - For "V1" descriptors, the URL is /tor/rendezvous1/publish - For "V0" descriptors, the URL is /tor/rendezvous/publish + an HTTP 'POST' request, to a URL "/tor/rendezvous/publish" relative to the + directory server's root, containing as its body Bob's service descriptor. Upon receiving a descriptor, the directory server checks the signature, and discards the descriptor if the signature does not match the enclosed @@ -226,11 +224,10 @@ where ' is replaced with the encoding of Bob's public key as described above. (She may re-use old circuits for this.) The directory replies with a 404 HTTP response if it does not recognize , and otherwise returns - Bob's most recently uploaded service descriptor of the appropriate - version. - - (Alice should try to fetch the V1 descriptor first, and only try to fetch - a V0 descriptor if it is not available.) + Bob's most recently uploaded service descriptor. (If Alice requests + 'rendezvous1', the directory server provides a V1 descriptor or a V0 + descriptor if no V1 descriptor is available. If Alice requests + 'rendezvous', the directory server returns a V0 descriptor.) If Alice's OP receives a 404 response, it tries the other directory servers, and only fails the lookup if none recognizes the public key hash. From nickm at seul.org Mon Jun 27 22:25:11 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 18:25:11 -0400 (EDT) Subject: [or-cvs] Fix unit tests that used old signature for add_fingerprint_... Message-ID: <20050627222511.799C61408EE2@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv1017/src/or Modified Files: test.c dirserv.c Log Message: Fix unit tests that used old signature for add_fingerprint_to_dir Index: test.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/test.c,v retrieving revision 1.182 retrieving revision 1.183 diff -u -d -r1.182 -r1.183 --- test.c 11 Jun 2005 18:52:11 -0000 1.182 +++ test.c 27 Jun 2005 22:25:09 -0000 1.183 @@ -29,7 +29,8 @@ int have_failed = 0; /* These functions are file-local, but are exposed so we can test. */ -void add_fingerprint_to_dir(const char *nickname, const char *fp); +void add_fingerprint_to_dir(const char *nickname, const char *fp, + smartlist_t *list); void get_platform_str(char *platform, size_t len); int is_obsolete_version(const char *myversion, const char *start); @@ -1245,10 +1246,14 @@ #endif /* Okay, now for the directories. */ - crypto_pk_get_fingerprint(pk2, buf, 1); - add_fingerprint_to_dir("Magri", buf); - crypto_pk_get_fingerprint(pk1, buf, 1); - add_fingerprint_to_dir("Fred", buf); + { + extern smartlist_t *fingerprint_list; + fingerprint_list = smartlist_create(); + crypto_pk_get_fingerprint(pk2, buf, 1); + add_fingerprint_to_dir("Magri", buf, fingerprint_list); + crypto_pk_get_fingerprint(pk1, buf, 1); + add_fingerprint_to_dir("Fred", buf, fingerprint_list); + } /* Make sure routers aren't too far in the past any more. */ r1.published_on = time(NULL); r2.published_on = time(NULL)-3*60*60; Index: dirserv.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v retrieving revision 1.170 retrieving revision 1.171 diff -u -d -r1.170 -r1.171 --- dirserv.c 21 Jun 2005 01:00:42 -0000 1.170 +++ dirserv.c 27 Jun 2005 22:25:09 -0000 1.171 @@ -35,7 +35,8 @@ /** List of nickname-\>identity fingerprint mappings for all the routers * that we recognize. Used to prevent Sybil attacks. */ -static smartlist_t *fingerprint_list = NULL; +/* Should be static; exposed for testing */ +smartlist_t *fingerprint_list = NULL; /** Add the fingerprint fp for the nickname nickname to * the smartlist of fingerprint_entry_t's list. Return 0 if it's From nickm at seul.org Mon Jun 27 23:35:06 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 19:35:06 -0400 (EDT) Subject: [or-cvs] Compile on win32 Message-ID: <20050627233506.2A61E1408EDF@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv3669/src/common Modified Files: compat.c Log Message: Compile on win32 Index: compat.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/compat.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- compat.c 26 Jun 2005 05:03:21 -0000 1.55 +++ compat.c 27 Jun 2005 23:35:04 -0000 1.56 @@ -143,14 +143,16 @@ * Requires that nlen be greater than zero. */ const void * -tor_memmem(const void *haystack, size_t hlen, const void *needle, size_t nlen) +tor_memmem(const void *_haystack, size_t hlen, const void *_needle, size_t nlen) { #if defined(HAVE_MEMMEM) && (!defined(__GNUC__) || __GNUC__ >= 2) tor_assert(nlen); return memmem(haystack, hlen, needle, nlen); #else /* This isn't as fast as the GLIBC implementation, but it doesn't need to be. */ - const void *p, *end; + const char *p, *end; + const char *haystack = (const char*)_haystack; + const char *needle = (const char*)_needle; char first; tor_assert(nlen); From nickm at seul.org Mon Jun 27 23:35:06 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 19:35:06 -0400 (EDT) Subject: [or-cvs] Compile on win32 Message-ID: <20050627233506.B9CCD1408EE2@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv3669/src/or Modified Files: control.c main.c or.h Log Message: Compile on win32 Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- control.c 20 Jun 2005 09:38:29 -0000 1.96 +++ control.c 27 Jun 2005 23:35:04 -0000 1.97 @@ -270,7 +270,7 @@ const char *end; int i; int start_of_line; - for (i=0; i #endif -/* These signals are defined to help control_signal_act work. - * XXXX Move into or.h or compat.h - */ -#ifndef SIGHUP -#define SIGHUP 1 -#endif -#ifndef SIGINT -#define SIGINT 2 -#endif -#ifndef SIGUSR1 -#define SIGUSR1 10 -#endif -#ifndef SIGUSR2 -#define SIGUSR2 12 -#endif -#ifndef SIGTERM -#define SIGTERM 15 -#endif - /********* PROTOTYPES **********/ static void dumpmemusage(int severity); Index: or.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.620 retrieving revision 1.621 diff -u -d -r1.620 -r1.621 --- or.h 20 Jun 2005 23:04:13 -0000 1.620 +++ or.h 27 Jun 2005 23:35:04 -0000 1.621 @@ -139,6 +139,25 @@ #include "../common/util.h" #include "../common/torgzip.h" +/* These signals are defined to help control_signal_act work. + * XXXX Move into compat.h ? + */ +#ifndef SIGHUP +#define SIGHUP 1 +#endif +#ifndef SIGINT +#define SIGINT 2 +#endif +#ifndef SIGUSR1 +#define SIGUSR1 10 +#endif +#ifndef SIGUSR2 +#define SIGUSR2 12 +#endif +#ifndef SIGTERM +#define SIGTERM 15 +#endif + #if (SIZEOF_CELL_T != 0) /* On Irix, stdlib.h defines a cell_t type, so we need to make sure * that our stuff always calls cell_t something different. */ From phobos at seul.org Tue Jun 7 01:46:33 2005 From: phobos at seul.org (phobos at seul.org) Date: Mon, 6 Jun 2005 21:46:33 -0400 (EDT) Subject: [or-cvs] Renamed to faq-abuse, set it up like the other faq pages. Message-ID: <20050607014633.1047914081A6@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv11807 Added Files: faq-abuse.html Removed Files: abuse.html Log Message: Renamed to faq-abuse, set it up like the other faq pages. --- abuse.html DELETED --- --- NEW FILE: faq-abuse.html --- Legal FAQ for Tor Server Operators

    Abuse FAQ for Tor Server Operators


    Doesn't Tor enable criminals to do bad things?

    Criminals can already do bad things. Since they're willing to break laws, they already have lots of options available that provide _better_ privacy than Tor provides. They can steal cell phones, use them, and throw them in a ditch; they can crack into computers in Korea or Brazil and use them to launch abusive activities; they can spread viruses that take control of literally millions of Windows machines around the world.

    Tor aims to provide protection for ordinary people who want to follow the law. Only criminals have privacy right now; we need to fix that.

    Isn't it just a tradeoff: accepting the bad uses for the good ones?

    No, we don't think that's how it works in the case of Tor.

    There are lots of ways to get anonymity on the net, some legal and some illegal. As we explained above, many of the illegal approaches can provide stronger anonymity than Tor can provide, because they can control literally millions of computers via spyware, viruses, and other techniques.

    Criminals and other bad people have the motivation to learn how to get good anonymity, and many have the motivation to pay well to achieve it. Being able to steal and reuse the identities of innocent victims (identify theft) makes it even easier. Normal people, on the other hand, don't typically have the time or money to spend figuring out how to get privacy online. This is the worst of all possible worlds.

    So yes, criminals could in theory use Tor, but they already have better options, and it seems unlikely that taking Tor away from the world will stop them from doing their bad things. At the same time, Tor and other privacy measures can *fight* identity theft, physical crimes like stalking, and so on.

    What about distributed denial of service attacks?

    Distributed denial of service attacks typically rely on having a group of thousands of computers all sending floods of traffic to a victim. Since the goal is to overpower the bandwidth of the victim, they typically send UDP packets since those don't require handshakes or coordination.

    But because Tor only transports correctly-formed TCP streams, not all IP packets, you cannot send UDP packets over Tor. (You can't do specialized forms of this attack like SYN flooding either.) So ordinary DDoS attacks are not possible over Tor. Tor also doesn't allow bandwidth amplification attacks against external sites: you need to send in a byte for every byte which the Tor network will send to your destination. So in general, attackers who control enough bandwidth to launch an effective DDoS attack can do it just fine without Tor.

    And if this argument doesn't convince you, go try Tor and see how much aggregate throughput you can eke out of it, then come back to us if you're still worried. :)

    What about spammers?

    The default Tor exit policy rejects all outgoing port 25 (SMTP) traffic. So sending spam mail through Tor isn't going to work. It's possible that some server operators will enable port 25 on their particular exit node, in which case only that computer will allow outgoing mails; but that individual could just set up an open mail relay too, independent of Tor.

    So far, no Tor server has enabled outgoing port 25 in his exit policy.

    In short, Tor isn't useful for spammers.

    How do Tor exit policies work?

    Each Tor server has an exit policy that specifies what sort of outbound connections are allowed or refused from that server. The exit policies are propagated to the client via the directory, so clients will automatically avoid picking exit nodes that would refuse to exit to their intended destination.

    This way each server can decide the services he wants to allow connections to, based on abuse potential and his own situation.

    Does Tor get much abuse?

    Not much, in the grand scheme of things. We've been running the network since October 2003, and it's only generated a handful of complaints. Of course, like all privacy-oriented networks on the net, we attract our share of jerks. Tor's exit policies help separate the role of "willing to donate resources to the network" from the role of "willing to deal with exit abuse complaints", so we hope our network is more sustainable than past attempts at anonymity networks.

    Since Tor has [WWW] many good uses as well, we feel that we're doing pretty well at striking a balance currently.

    So what should I expect if I run a server?

    If you run a Tor server that allows exit connections (such as the default exit policy), it's probably safe to say that you will eventually hear from somebody. Abuse complaints can come in a variety of forms. The main ones so far have taken the following form:

    • Somebody connects to hotmail, and sends a criminal mail somewhere. The FBI sends you a polite email, you explain that you run a Tor server, and they say 'oh well' and leave you alone. [Port 80]

    • Somebody tries to get you shut down by using Tor to connect to google groups and posting spam to usenet, and then sending an angry mail to your ISP about how you're destroying the world. [Port 80]

    • Somebody connects to an irc network and makes a nuisance of himself. Your ISP gets polite mail about how your computer has been compromised; and/or your computer gets ddosed. [Port 6667]

    • Somebody uses Tor to download a Vin Diesel movie, and your ISP gets a DMCA takedown notice. According to our lawyers (and this convinced the Harvard general counsel), your ISP can totally ignore this notice with no liability problems. See [WWW] http://tor.eff.org/eff/tor-dmca-response.html. [Arbitrary ports]

    You might also find that your Tor server's IP is blocked from accessing some Internet sites/services. This might happen regardless of your exit policy, because some groups don't seem to know or care that Tor has exit policies. (If you have a spare IP not used for other activities, you might consider running your Tor server on it.) For example,

    • Wikipedia is currently blocking many Tor server IPs from writing (reading still works), because they haven't figured out internally how to deal with the fact that they want to provide open access but they also have no ways to control abuse to their website. We're working with them to resolve this.

    • It seems that SORBS is putting some Tor server IPs on their email blacklist as well. They do this because they passively detect whether your server connects to certain IRC networks, and they conclude from this that your server is capable of spamming. We're working with them to teach them that not all software works this way. Until then, we recommend you avoid them, and teach your friends (if they use them) to avoid them too.

    Tor is banned from the IRC network I want to use.

    Sometimes jerks make use of Tor to troll IRC channels. This abuse results in IP-specific temporary bans ("klines" in IRC lingo), as the network operators try to keep the troll off of their network.

    This response underscores a fundamental flaw in IRC's security model: they assume that IP addresses equate to humans, and by banning the IP address they can ban the human. In reality this is not the case -- many such trolls routinely make use of the literally millions of open proxies and compromised computers around the Internet. The IRC networks are fighting a losing battle of trying to block all these nodes, and an entire cottage industry of blacklists and counter-trolls has sprung up based on this flawed security model (not unlike the antivirus industry). The Tor network is just a drop in the bucket here.

    On the other hand, from the viewpoint of IRC server operators, security is not an all-or-nothing thing. By responding quickly to trolls or any other social attack, it may be possible to make the attack scenario less attractive to the attacker. And most individual IP addresses do equate to individual humans, on any given IRC network at any given time. The exceptions include NAT gateways which may be allocated access as special cases. While it's a losing battle to try to stop the use of open proxies, it's not generally a losing battle to keep klining a single ill-behaved IRC user until that user gets bored and goes away.

    But the real answer is to implement application-level auth systems, to let in well-behaving users and keep out badly-behaving users. This needs to be based on some property of the human (such as a password he knows), not some property of the way his packets are transported.

    Of course, not all IRC networks are trying to ban Tor nodes. After all, quite a few people use Tor to IRC in privacy in order to carry on legitimate communications without tying them to their real-world identity. Each IRC network needs to decide for itself if blocking a few more of the millions of IPs that bad people can use is worth losing the contributions from the well-behaved Tor users.

    If you're being blocked, have a discussion with the network operators and explain the issues to them. They may not be aware of the existence of Tor at all, or they may not be aware that the hostnames they're klining are Tor exit nodes. If you explain the problem, and they conclude that Tor ought to be blocked, you may want to consider moving to a network that is more open to free speech. Maybe inviting them to #tor on irc.oftc.net helps them show that we are not all evil people.

    Finally, if you become aware of an IRC network which seems to be blocking Tor, or a single Tor exit node, please put that information on ../BlockingIrc so that others can share. At least one IRC network consults that page to unblock exit nodes which have been blocked inadvertently.

    Your nodes are banned from the mail server I want to use.

    Even though [WWW] Tor isn't useful for spamming, some over-zealous blacklisters seem to think that all open networks like Tor should be boycotted. They don't understand how Tor works (e.g. that it has exit policies), and don't seem to care to understand it. If your server administrators decide to make use of these blacklists to refuse incoming mail, you should have a conversation with them and explain how Tor works.

    I want to ban the Tor network from my service.

    First, ask yourself if there's a way to do application-level decisions to separate the legitimate users from the jerks. For example, you might have certain areas of the site, or certain privileges like posting, available only to people who are registered. You could set up this distinction only for certain IP addresses such as Tor exit nodes. This way you can have multi-tiered access and not have to ban everything.

    Second, consider that thousands of people use Tor every day to protect against data-gathering corporations like Doubleclick while going about their normal activities. Some Tor users may be legitimately connecting to your service right now to carry on normal activities. You need to decide whether banning the Tor network is worth losing the contributions of these users, as well as potential future such users.

    Lastly, please remember that Tor servers have individual exit policies. Many Tor servers do not allow exiting connections at all. Many of those that do, probably already disallow connections to your service. When you go about banning nodes, you should parse the exit policies and only block the ones that allow these connections; and you should keep in mind that exit policies can change (as well as the overall list of nodes in the network).

    If you really want to do this, there is a python script to parse the Tor directory [WWW] here.

    I have legal questions about Tor abuse.

    We're only the developers. We can answer technical questions, but we're not the ones to talk to about legal questions or concerns.

    Please take a look at the [WWW] Tor Legal FAQ, and contact EFF directly if you have any further questions.

    From nickm at seul.org Mon Jun 27 23:40:19 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 19:40:19 -0400 (EDT) Subject: [or-cvs] Fix libc compilation Message-ID: <20050627234019.2651914081E0@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv4214/src/common Modified Files: compat.c Log Message: Fix libc compilation Index: compat.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/compat.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- compat.c 27 Jun 2005 23:35:04 -0000 1.56 +++ compat.c 27 Jun 2005 23:40:17 -0000 1.57 @@ -147,7 +147,7 @@ { #if defined(HAVE_MEMMEM) && (!defined(__GNUC__) || __GNUC__ >= 2) tor_assert(nlen); - return memmem(haystack, hlen, needle, nlen); + return memmem(_haystack, hlen, _needle, nlen); #else /* This isn't as fast as the GLIBC implementation, but it doesn't need to be. */ const char *p, *end; From nickm at seul.org Mon Jun 27 23:41:05 2005 From: nickm at seul.org (Nick Mathewson) Date: Mon, 27 Jun 2005 19:41:05 -0400 (EDT) Subject: [or-cvs] Note that authentication arguments are optional Message-ID: <20050627234105.4DBCB1408412@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv4332/doc Modified Files: control-spec.txt Log Message: Note that authentication arguments are optional Index: control-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/control-spec.txt,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- control-spec.txt 24 Jun 2005 18:04:00 -0000 1.43 +++ control-spec.txt 27 Jun 2005 23:41:03 -0000 1.44 @@ -177,7 +177,7 @@ 3.4 AUTHENTICATE Sent from the client to the server. The syntax is: - "AUTHENTICATE" SP 1*HEXDIG / QuotedString CRLF + "AUTHENTICATE" [ SP 1*HEXDIG / QuotedString ] CRLF The server responds with "250 OK" on success or "515 Bad authentication" if the authentication cookie is incorrect. From arma at seul.org Tue Jun 28 01:53:00 2005 From: arma at seul.org (arma at seul.org) Date: Mon, 27 Jun 2005 21:53:00 -0400 (EDT) Subject: [or-cvs] clean up some more comments Message-ID: <20050628015300.4874E14080C1@moria.seul.org> Update of /home2/or/cvsroot/tor/src/tools In directory moria:/home/arma/work/onion/cvs/tor/src/tools Modified Files: tor-resolve.c Log Message: clean up some more comments Index: tor-resolve.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/tools/tor-resolve.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- tor-resolve.c 11 Jun 2005 18:52:12 -0000 1.18 +++ tor-resolve.c 28 Jun 2005 01:52:58 -0000 1.19 @@ -44,9 +44,9 @@ do { log_fn(LOG_ERR, "Error while %s: %s", act, \ tor_socket_strerror(tor_socket_errno(_s))); } while (0) -/** Set *out to a newly allocated SOCKS4a resolve request with - * username and hostname as provided. Return the number of bytes in - * the request. */ +/** Set *out to a newly allocated SOCKS4a resolve request with + * username and hostname as provided. Return the number + * of bytes in the request. */ static int build_socks4a_resolve_request(char **out, const char *username, @@ -69,8 +69,9 @@ return len; } -/** Given a len-byte SOCKS4a response in response, set *addr_out to the - * address it contains (in host order). Return 0 on success, -1 on error. +/** Given a len-byte SOCKS4a response in response, set + * *addr_out to the address it contains (in host order). + * Return 0 on success, -1 on error. */ static int parse_socks4a_resolve_response(const char *response, size_t len, @@ -104,7 +105,7 @@ /** Send a resolve request for hostname to the Tor listening on * sockshost:socksport. Store the resulting IPv4 - * address (in host order) into result_addr. + * address (in host order) into *result_addr. */ static int do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport, @@ -247,3 +248,4 @@ printf("%s\n", buf); return 0; } + From arma at seul.org Tue Jun 28 01:53:17 2005 From: arma at seul.org (arma at seul.org) Date: Mon, 27 Jun 2005 21:53:17 -0400 (EDT) Subject: [or-cvs] whitespace fix Message-ID: <20050628015317.C5B1214080C1@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: dns.c Log Message: whitespace fix Index: dns.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/dns.c,v retrieving revision 1.159 retrieving revision 1.160 diff -u -d -r1.159 -r1.160 --- dns.c 23 Jun 2005 07:57:43 -0000 1.159 +++ dns.c 28 Jun 2005 01:53:15 -0000 1.160 @@ -910,7 +910,8 @@ num_dnsworkers++; } - while (num_dnsworkers > num_dnsworkers_busy+MAX_IDLE_DNSWORKERS) { /* too many idle? */ + while (num_dnsworkers > num_dnsworkers_busy+MAX_IDLE_DNSWORKERS) { + /* too many idle? */ /* cull excess workers */ log_fn(LOG_NOTICE,"%d of %d dnsworkers are idle. Killing one.", num_dnsworkers-num_dnsworkers_busy, num_dnsworkers); From arma at seul.org Tue Jun 28 20:03:58 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 28 Jun 2005 16:03:58 -0400 (EDT) Subject: [or-cvs] script from greg to make symlinks for translated pages Message-ID: <20050628200358.BBBFC140809E@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Added Files: gensym.sh Log Message: script from greg to make symlinks for translated pages --- NEW FILE: gensym.sh --- #!/bin/sh BASE="/var/www/fhaven/htdocs" cd $BASE || exit 1 DIR="de it" for i in $DIR; do for j in `ls -1 $i`; do ln -s $i/$j . done done From phobos at seul.org Tue Jun 28 21:44:36 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 28 Jun 2005 17:44:36 -0400 (EDT) Subject: [or-cvs] Updated it html docs. Message-ID: <20050628214436.4BE4E14081EB@moria.seul.org> Update of /home/or/cvsroot/website/it In directory moria:/tmp/cvs-serv5030/it Modified Files: contribute.it.html developers.it.html documentation.it.html download.it.html faq.it.html howitworks.it.html index.it.html people.it.html research.it.html users.it.html Log Message: Updated it html docs. Index: contribute.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/contribute.it.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- contribute.it.html 24 Jun 2005 01:47:57 -0000 1.1 +++ contribute.it.html 28 Jun 2005 21:44:33 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -24,8 +24,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -39,13 +39,13 @@
    - -

    Tor: Contribuisci

    -
    -

    Questa traduzione non è stata controllata dagli sviluppatori di Tor +

    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di -Tor è in Inglese, all'indirizzo http://tor.eff.org/

    +Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Necessità presenti:

    +

    Tor: Contribuire

    +
    +

    Cosa abbiamo bisogno:

    • Utenti come te per testare Tor, e permettere agli sviluppatori di malfunzionamenti o nuovi modi di .
    • @@ -58,54 +58,55 @@
    • Informa i tuoi amici! Invitali a installare servers. Invitali a offrire hidden service. Invitali a passar parola ai loro amici.
    • Cosa va documentato? Che cosa è mal documentato?
    • -
    • Ti invitiamo a far parte dell'Electronic -Frontier Foundation. Maggior numero di donazioni a EFF equivalgono a un -maggior grado di libertà nel mondo e incluso un ulteriore sviluppo +
    • Entra a far parte dell'Electronic +Frontier Foundation. Un maggior numero di donazioni a EFF equivale a un +maggior grado di libertà nel mondo e a un ulteriore sviluppo della rete Tor.
    -

    We also have many project-lets: short-term or self-contained tasks -that would be really helpful for somebody to tackle so we can keep -focusing on Tor.

    +

    Siamo in continua attività: se qualcuno si occupasse di task a breve termine +sarebbe di grande aiuto a noi che possiamo così focalizzarci su Tor. +

    -

    Writing project-lets:

    +

    Attività di scrittura:

      -
    • Does somebody want to help maintain this website, or help with -documentation, or help with managing our TODO and handling bug reports?
    • -
    • We may have too much documentation. It's spread out too far -and duplicates itself in places. Can you help us consolidate?
    • -
    • Please help translate the web page and documentation -into other languages. See the translation guidelines -if you want to help out. (Examples: -French -, Persian and -Vietnamese.)
    • +
    • Volontari per manutenere il sito web, o che aiutino alla +documentazione, o in aiuto per gestire i nostri TODO e nella gestione dei bug reports?
    • +
    • Abbiamo molta documentazione. Non è centralizzata e a volte +in duplicati. Puoi aiutarci a ordinarla?
    • +
    • Aiutaci nella traduzione delle pagine web e della documentazione +in altre lingue. Leggi la guida alla traduzione +se vuoi cimentarti. (Esempi: +Francese +, Persiano e +Vietnamita.)
    • Sistemare le FAQ Wiki, e se conosci la risposta di qualche "FAQ senza risposta" non esitare a rispondere.
    -

    Packaging project-lets:

    +

    Attività di Packaging:

      -
    • We're always looking for better Windows installers. Specifically, -it would be great if somebody were to extend our NSIS-based windows -installer to include FreeCap and Privoxy.
    • -
    • Our OS X installer can't be uninstalled. Are there non-sucky OS X -packagers that have uninstall capabilities? This is becoming an -increasing bother.
    • +
    • Siamo alla costante ricerca di un installer migliore per Windows. Specialmente, +sarebbe di grande aiuto se qualcuno estendesse il nostro windows installer NSIS-based +per includere FreeCap e Privoxy.
    • +
    • Il nostro OS X installer non riesce nell'uninstall. Ci sar&agave; un benedetto OS X +packagers che ha le capacità per l'uninstall? Sta diventando una noia crescente +.
    -

    Organizational and application testing project-lets:

    +

    Attività di organizzazione e testing:

      -
    • We've got a list of potentially useful programs you might -run with Tor here. We also have the Esiste una lista di programmi potenzialmente interessanti con cui Tor +può funzionare qui. Esiste anche il Torify -howto. Can somebody try them out, simplify the explanations, expand -them where they need it, document them better, and make them all-around -more useful?
    • +howto. Cerchiamo persone che le provino, ne semplifichino le spiegazione, le +amplino dove bisogna, le documentino meglio, e facciano in modo che sia tutto più +usabile. +
    -

    Programmer and developer project-lets:

    +

    Attività di programmazione e sviluppo:

    • We need somebody to code up a GUI or other controller program, to do configuration, etc. See our + @@ -25,8 +25,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -39,23 +39,23 @@
      - -

      Tor: Developers

      -
      -

      Questa traduzione non è stata controllata dagli sviluppatori di Tor +

      Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

      -

      Browse the Tor CVS repository: (which may not -necessarily work or even compile)

      + +

      Tor: Sviluppatori

      +
      +

      Sfoglia il reporitorio CVS di Tor: (che non necessariamente +è funzionante)

        -
      • Regularly updated cvs sandbox
      • -
      • ViewCVS
      • -
      • anonymous pserver access (password is guest): +
      • cvs sandbox regolarmente aggiornato
      • +
      • Vai al CVS
      • +
      • accesso anonimo al pserver (la password è guest):
          -
        • Make a new empty directory and cd into it.
        • +
        • Crea una cartella vuota ed entraci.
        • cvs -d :pserver:guest at cvs.seul.org:/home/or/cvsroot login
        • cvs -d :pserver:guest at cvs.seul.org:/home/or/cvsroot co tor
        • -
        • cd tor; ./autogen.sh; make; make install if you like.
        • +
        • cd tor; ./autogen.sh; make; make install se ti va.
        • (use -r tor-0_0_9 or equivalent to fetch a particular version.)
        • (To check out the maintenance branch, use -r tor-0_0_9-patches)
        @@ -63,18 +63,18 @@

      -Read the Guide to Tor's source code for an -overview of the various files and components of the system. +Leggi la Guida del codice sorgente di Tor per +una panoramica su files e componenti del sistema.

      -The list of stuff the developers know they need to do. +La lista di cose di cui gli sviluppatori sanno di dover fare.

      -The Java Anon -Proxy (JAP) project has implemented the Tor client protocol in their -client. More on that coming soon. +Il progetto Java Anon +Proxy (JAP) ha implementato un protocollo Tor nel loro +client. Presto ne saprete di più.

      Index: documentation.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/documentation.it.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- documentation.it.html 24 Jun 2005 01:47:57 -0000 1.1 +++ documentation.it.html 28 Jun 2005 21:44:33 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -25,8 +25,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -39,14 +39,13 @@
      - -

      Indice Contenuti

      -
      -

      Questa traduzione non è stata controllata dagli sviluppatori di Tor +

      Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

      +

      Indice Contenuti

      +
      Index: download.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/download.it.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- download.it.html 24 Jun 2005 01:47:57 -0000 1.1 +++ download.it.html 28 Jun 2005 21:44:33 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -25,8 +25,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -37,12 +37,12 @@
      +

      Questa traduzione non è stata controllata dagli sviluppatori di Tor +e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di +Tor è in Inglese, all'indirizzo http://tor.eff.org/

      Tor: Pacchetti e sorgenti


      -

      Questa traduzione non è stata controllata dagli sviluppatori di Tor -e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di -Tor è in Inglese, all'indirizzo http://tor.eff.org/

      Tor viene distribuito come Free Software sotto le 3-clausole della licenza BSD.

      Index: faq.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/faq.it.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- faq.it.html 24 Jun 2005 01:47:57 -0000 1.1 +++ faq.it.html 28 Jun 2005 21:44:33 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -25,8 +25,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -39,12 +39,12 @@
      +

      Questa traduzione non è stata controllata dagli sviluppatori di Tor +e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di +Tor è in Inglese, all'indirizzo http://tor.eff.org/

      Tor: FAQs


      -

      Questa traduzione non è stata controllata dagli sviluppatori di Tor -e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di -Tor è in Inglese, all'indirizzo http://tor.eff.org/

      Il Tor Wiki delle FAQ Tecniche è editabile dagli utenti, questo Index: howitworks.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/howitworks.it.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- howitworks.it.html 24 Jun 2005 01:47:57 -0000 1.1 +++ howitworks.it.html 28 Jun 2005 21:44:33 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -25,8 +25,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -39,12 +39,12 @@

      +

      Questa traduzione non è stata controllata dagli sviluppatori di Tor +e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di +Tor è in Inglese, all'indirizzo http://tor.eff.org/

      Tor: Come Funziona


      -

      Questa traduzione non è stata controllata dagli sviluppatori di Tor -e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di -Tor è in Inglese, all'indirizzo http://tor.eff.org/

      Panoramica di base su Tor: cosa offre Tor, il suo valore, come funziona. @@ -52,7 +52,7 @@

      Installare, -configurare, e running Tor. +configurare, e avviare Tor.

      Il design document (pubblicato su Usenix @@ -64,8 +64,8 @@

    • versione HTML
    -

    Il nostro follow-up paper su challenges in low-latency anonymity -(ancora in forma di bozza) i più recenti risultati e sviluppi: +

    Il nostro documento supplementare su challenges in low-latency anonymity +(ancora in forma di bozza) mostra i più recenti risultati e sviluppi: versione PDF.

    Le specifiche mirano a dare agli sviluppatori Index: index.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/index.it.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index.it.html 24 Jun 2005 01:47:57 -0000 1.1 +++ index.it.html 28 Jun 2005 21:44:33 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -26,8 +26,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -57,12 +57,13 @@

    - -

    Tor: Un Sistema anonimo di comunicazione in Internet

    -

    Questa traduzione non è stata controllata dagli sviluppatori di Tor +

    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    + +

    Tor: Un Sistema anonimo di comunicazione in Internet

    +

    Tor è un toolset utile a tutte quelle organizzazioni e persone che vogliono migliorare il grado di protezione e sicurezza in Internet. Tor viene usato per rendere anonima la navigazione e la pubblicazione su @@ -105,7 +106,7 @@ IBM offre un indice ricercabile di brevetti e può tenere traccia delle interrogazioni che la tua Azienda ha richiesto. Un "ficcanaso" può utilizzare l'analisi del traffico per capire se ti trovi -in un certo Internet cafe. +in un certo Internet cafè.

    Index: people.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/people.it.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- people.it.html 24 Jun 2005 01:47:57 -0000 1.1 +++ people.it.html 28 Jun 2005 21:44:33 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -25,8 +25,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -38,15 +38,15 @@

    +

    Questa traduzione non è stata controllata dagli sviluppatori di Tor +e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di +Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Tor: Persone


    -

    Questa traduzione non è stata controllata dagli sviluppatori di Tor -e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di -Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Tor è gestito da The Free -Haven Project as a building block for -a robust censorship-resistant data haven. Viene sviluppato da ed è considerato come il fondamento ad un robusto + ambiente per combattere la censura. Viene sviluppato da Roger Dingledine e Nick Mathewson, con l'aiuto di tanti volontari sparsi in Internet. Index: research.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/research.it.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- research.it.html 24 Jun 2005 01:47:57 -0000 1.1 +++ research.it.html 28 Jun 2005 21:44:33 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -24,8 +24,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -37,20 +37,21 @@

    +

    Questa traduzione non è stata controllata dagli sviluppatori di Tor +e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di +Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Tor: Ricerca


    -

    Questa traduzione non è stata controllata dagli sviluppatori di Tor -e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di -Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Leggi questi -idocumenti (in particolare quelli nei riquadri) to get up to speed on anonymous -communication systems.

    +i documenti (in particolare quelli nei riquadri) per aumentare la +velocità nei sistemi di comunicazione anonimi. +

    -

    Abbiamo bisogno di persone che attacchino il sistema, quantify defenses, -etc. See the "security project-lets" section of the contribute page.

    +

    Abbiamo bisogno di persone che attacchino il sistema, quantifichino le difese, +etc. Leggi la sezione "security project-lets" della pagina contribuire.

    Index: users.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/users.it.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- users.it.html 24 Jun 2005 01:47:57 -0000 1.1 +++ users.it.html 28 Jun 2005 21:44:33 -0000 1.2 @@ -1,4 +1,4 @@ - + @@ -25,8 +25,8 @@ | Docs | Utenti | Faq - | Contribuisci - | Sviluppatori + | Contribuire + | Sviluppo | Ricerca | Persone @@ -39,51 +39,51 @@
    +

    Questa traduzione non è stata controllata dagli sviluppatori di Tor +e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di +Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Tor: Utenti


    -

    Questa traduzione non è stata controllata dagli sviluppatori di Tor -e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di -Tor è in Inglese, all'indirizzo http://tor.eff.org/

    -

    We have an IRC discussion channel for users and operators. Go to +

    C'è un canale di discussione IRC per utenti e operatori. Vai su #tor on irc.oftc.net.

    -

    We have a Trovi un bugtracker. -If you have a bug, especially a crash bug, read our how -to report a Tor bug FAQ wiki entry first and then go to the bugtracker -and tell us as much information about it as you can. (If your bug is -with Privoxy, your browser, or some other application, please don't put -it in our bugtracker.) +Se trovi un baco, specialmente quelli di crash, leggi prima di tutto come +segnalare un baco di Tor FAQ wiki e poi vai sul bugtracker +e riporta maggiori informazioni possibili a riguardo. (Se il baco riguarda +Privoxy, il tuo browser, o qualche altra applicazione , non segnalarcelo nel +nostro bugtracker.)

    -

    Check out weasel's graph of -the number of Tor servers over time. To learn more details of the -current Tor nodes, look at Geoff Goodell's list -of Tor exit nodes by country. You can also fetch the latest dynamically generated -directory directly. (Your Tor client fetches this automatically, -so loading it yourself is just for novelty.) +

    Verifica sul grafico di weasel il +numbero di Tor servers nel tempo. Per conoscere più dettagli sui +nodi Tor esistenti, consulta la lista +degli exit nodes di Tor per nazione di Geoff Goodell. Puoi anche recuperare direttamente la lista dei nodi +generata dinamicamente. (Il tuo client Tor la riceve in automatico, +quindi caricarla per conto proprio lo si fa solo per curiosità).

    -The hidden wiki has a list -of some hidden services and other things. You need Tor and a proxy like -Privoxy to access it. +L'hidden wiki presenta una lista +di qualche hidden services e altre cose. Ci puoi accedere solo tramite Tor +e un proxy come Privoxy.

    -See the Tor -wiki for other user-contributed documentation, etc. +Leggi il wiki +di Tor per la documentazione fornita dagli utenti, ed altro ancora.


    -Here's a brief list of programs you might want to use in association -with Tor:

    +Di seguito una lista di programmi che possono essere usati con Tor: +

    Connect: adds proxy support to SSH. (Win32, Linux, BSD, OS X)
    Dsocks: SOCKS client wrapper with enough support to use the built-in OpenSSH or Tor local SOCKS proxy. (BSD)
    From phobos at seul.org Wed Jun 29 01:46:43 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 28 Jun 2005 21:46:43 -0400 (EDT) Subject: [or-cvs] removed false easy, medium, hard categories for now Message-ID: <20050629014643.2A2D714080CE@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv15376 Modified Files: new-contribute.html Log Message: removed false easy, medium, hard categories for now Index: new-contribute.html =================================================================== RCS file: /home/or/cvsroot/website/new-contribute.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- new-contribute.html 14 Jun 2005 03:55:30 -0000 1.7 +++ new-contribute.html 29 Jun 2005 01:46:41 -0000 1.8 @@ -49,9 +49,6 @@

    Coding Challenges

    - **easy** - **medium** - **hard**
    • Update crypto usage to use openssl aes when available.
    • Implement a buffer design modelled after the linux kernel buffer design.
    • @@ -105,9 +102,6 @@

    Documentation Challenges

    - **easy** - **medium** - **hard**
    • Write server instructions for OSX and Windows operators.
    • Improve and clarify the wiki entry on port forwarding. url?
    • @@ -121,9 +115,6 @@

    Testing Challenges

    - **easy** - **medium** - **hard**
    • Test out why some of our tor servers have dns resolvers that resolve unknown addresses to 127.0.0.1.
    • @@ -154,9 +145,6 @@

    Research Challenges

    - **easy** - **medium** - **hard**
    • Arranging membership management for independence.
      • From phobos at seul.org Wed Jun 29 02:32:57 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 28 Jun 2005 22:32:57 -0400 (EDT) Subject: [or-cvs] Moved contribute.html to old-contribute.html Message-ID: <20050629023257.8BD321408084@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv16964 Modified Files: contribute.html Added Files: old-contribute.html Log Message: Moved contribute.html to old-contribute.html moved new-contribute.html to contribute.html Index: contribute.html =================================================================== RCS file: /home/or/cvsroot/website/contribute.html,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- contribute.html 9 Jun 2005 22:04:54 -0000 1.54 +++ contribute.html 29 Jun 2005 02:32:55 -0000 1.55 @@ -1,5 +1,4 @@ - + @@ -39,165 +38,193 @@
        +

        Six things everyone can do now:

        +
          +
        1. We need users like you to try Tor out, and let the Tor developers know about bugs you find or features you don't find.
        2. +
        3. Please consider running a server to help the Tor network grow.
        4. +
        5. We especially need people with Windows programming skills to run an exit server on Windows, to help us debug.
        6. +
        7. Run a Tor hidden service and put interesting content on it.
        8. +
        9. Tell your friends! Get them to run servers. Get them to run hidden services. Get them to tell their friends.
        10. +
        11. Consider joining the Electronic Frontier Foundation. More EFF donations means more freedom in the world, including more Tor development.
        12. +
        -

        Tor: Contribute

        -
        - -

        Ongoing needs:

        -
          -
        • We need users like you to try Tor out, and let the Tor developers -know about bugs you find or features you don't find.
        • -
        • Please consider running a -server to help the Tor network grow.
        • -
        • We especially need people with Windows programming skills -to run an exit server on Windows, to help us debug.
        • -
        • Run a Tor hidden -service and put interesting content on it.
        • -
        • Tell your friends! Get them to run servers. Get them to run hidden -services. Get them to tell their friends.
        • -
        • What else needs to be documented? What is mis-documented?
        • -
        • Consider joining the Electronic -Frontier Foundation. More EFF donations means more freedom in the world, -including more Tor development.
        • -
        - -

        We also have many project-lets: short-term or self-contained tasks -that would be really helpful for somebody to tackle so we can keep -focusing on Tor.

        - -

        Writing project-lets:

        -
          -
        • Does somebody want to help maintain this website, or help with -documentation, or help with managing our TODO and handling bug reports?
        • -
        • We may have too much documentation. It's spread out too far -and duplicates itself in places. Can you help us consolidate?
        • -
        • Please help translate the web page and documentation -into other languages. See the translation guidelines -if you want to help out. (Examples: -French -, Persian and -Vietnamese.)
        • -
        • Please fix up the FAQ Wiki, -and if you know the answer to a question in the "unanswered FAQs" list, -please answer it.
        • -
        - -

        Packaging project-lets:

        -
          -
        • We're always looking for better Windows installers. Specifically, -it would be great if somebody were to extend our NSIS-based windows -installer to include FreeCap and Privoxy.
        • -
        • Our OS X installer can't be uninstalled. Are there non-sucky OS X -packagers that have uninstall capabilities? This is becoming an -increasing bother.
        • -
        - -

        Organizational and application testing project-lets:

        +

        Coding Challenges

          -
        • We've got a list of potentially useful programs you might -run with Tor here. We also have the Torify -howto. Can somebody try them out, simplify the explanations, expand -them where they need it, document them better, and make them all-around -more useful?
        • +
        • Update crypto usage to use openssl aes when available.
        • +
        • Implement a buffer design modelled after the linux kernel buffer design.
        • +
        • how do ulimits work on win32, anyway? (We should handle WSAENOBUFS as needed, look at the MaxConnections registry entry, look at the MaxUserPort entry, and look at the TcpTimedWaitDelay entry. We may also want to provide a way to set them as needed. See bug 98.)
        • +
        • Implement reverse DNS (already specified)
        • +
        • Implement a FirewalledIPs config option that works like FirewallPorts.
        • +
        • Make configure.in handle cross-compilation
        • +
        • Have NULL_REP_IS_ZERO_BYTES default to 1.
        • +
        • Make with-ssl-dir disable search for ssl.
        • +
        • Implement preservation of reputation through reboots for clients and dirservers.
        • +
        • Add in support egd or other non-OS-integrated strong entropy sources.
        • +
        • Implement password protection for on-disk identity key
        • +
        • Implement a way to get autoconf to install things into ~/.tor.
        • +
        • Change server descriptors to declare log level.
        • +
        • Add in support for clients to avoid servers that are too loggy based upon user configuration of acceptable log level.
        • +
        • Separate node discovery from routing to allow neat extensions. [Goodell?]
        • +
          • +
          • Add SetServerStatus control event to adjust verified/running status of nodes.
          • +
          • Add NoDownload config option to prevent regular directory downloads from happening.
          • +
        • +
        • Choosing exit node by meta-data, e.g. country.
        • +
        • Use cpuworker for more heavy lifting.
        • +
          • +
          • Signing (and verifying) hidserv descriptors
          • +
          • Signing (and verifying) intro/rend requests
          • +
          • Signing (and verifying) router descriptors
          • +
          • Signing (and verifying) directories
          • +
          • Doing TLS handshake (this is very hard to separate out, though)
          • +
        • +
        • Buffer size pool: allocate a maximum size for all buffers, not a maximum size for each buffer. So we don't have to give up as quickly (and kill the thickpipe!) when there's congestion.
        • +
        • Add alternative versions of crypto.c and tortls.c to use libnss or libgcrypt+gnutls.
        • +
        • Implement a way to stop falling back to forbidden ports when FascistFirewall blocks all good dirservers, if there is already a good, cached directory locally.
        • +
        • Extend our NSIS-based windows installer to include FreeCap and/or Privoxy.
        • +
        • Develop a way to handle OS X installation and uninstallation.
        • +
        • Develop a GUI or other controller program, to do configuration, etc. See our control specification for details, and the rudimentary demonstration Python control script.
        • +
          • +
          • Design an interface for the control program. You can use any license you want, but we'd recommend 3-clause BSD or maybe GPL; and we can only help out if your license conforms to the DFSG.
          • +
          • Periodically people running servers tells us they want to have one + BandwidthRate during some part of the day, and a different + BandwidthRate at other parts of the day. Rather than coding this + inside Tor, we should have a little script that speaks via the Tor + Controller Interface, and does a setconf to change the bandwidth + rate. Perhaps it would run out of cron, or perhaps it would sleep + until appropriate times and then do its tweak (that's probably more + portable). Can somebody write one for us and we'll put it inside + tor/contrib/?
          • +
        • +
        • Develop a way to become a Windows NT service.
        • +
        • Develop a systray app for Tor under MS Windows (all versions).
        • +
        • Integrate a good (portable, fast, clean, BSD-free) asynchronous DNS library so we don't have to keep forking DNS worker threads to do gethostbyname.
        -

        Programmer and developer project-lets:

        +

        Documentation Challenges

          -
        • We need somebody to code up a GUI or other -controller program, to do configuration, etc. See our control specification for details, -and the rudimentary demonstration -Python control script. No, we don't know what the interface should look -like. You can use any license you want, but we'd recommend 3-clause BSD or -maybe GPL; and we can only help out if your license conforms to the -DFSG.
        • -
        • Periodically people running servers tells us they want to have one -BandwidthRate during some part of the day, and a different BandwidthRate -at other parts of the day. Rather than coding this inside Tor, we should -have a little script that speaks via the Tor Controller Interface, and does -a setconf to change the bandwidth rate. Perhaps it would run out of cron, -or perhaps it would sleep until appropriate times and then do its tweak -(that's probably more portable). Can somebody write one for us and we'll -put it inside tor/contrib/?
        • -
        • Does somebody want to do up a patch so we can be an NT service? Or -so we can go in the system tray?
        • -
        • A good (portable, fast, clean, BSD-free) asynchronous DNS library -would be really handy, so we don't have to keep forking DNS worker -threads to do gethostbyname.
        • -
        • Can somebody take a look at Martin's Squid -and Tor page, and update it to reflect Tor's -RedirectExit config -option?
        • -
        • See the TODO and -HACKING files in the Tor distribution -for more ideas.
        • +
        • Write server instructions for OSX and Windows operators.
        • +
        • Improve and clarify the wiki entry on port forwarding. url?
        • +
        • Document how to do exit node caching: tie into squid or other caching web proxy.
        • +
        • Help maintain this website; code, content, css, overall layout,
        • +
        • Help with documentation
        • +
        • Help consolidate documentation. We may have too much documentation. It's spread out too far and duplicates itself in places.
        • +
        • Help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
        • +
        • If you know the answer to a Wiki question in the "unanswered FAQs" list, please answer it. url?
        • +
        • Take a look at Martin's Squid and Tor page, and update it to reflect Tor's RedirectExit config option. url?
        -

        Security project-lets: We need people to attack the implementation -and clean it up, and also to attack the design and experiment with -defenses.

        +

        Testing Challenges

          -
        • We need somebody to fuzz Tor. Are there -good libraries out there for what we want? What are the first steps? Win -fame by getting credit when we put out a new release because of you!
        • -
        • Website volume fingerprinting attacks (Back et al, Hintz). -Defenses include a large cell size, defensive dropping, -etc. How well does each approach work?
        • +
        • Test out why some of our tor servers have dns resolvers that resolve +unknown addresses to 127.0.0.1.
        • +
          • +
          • Identify the servers that experience this issue.
          • +
          • Identify how to cause and repair the issue in BIND, DJBDNS, or +whatever daemon the misconfigured servers use.
          • +
        • +
        • Figure out how to setup web proxy gateways to let normal people +browse hidden services. (This has been done a few times, but nobody has +sent us code.)
        • +
        • Investigate privoxy vs. freecap for win32 clients
        • +
        • Evaluate, create, and document a list of programs that work with +Tor.
        • +
        • Perform a security analysis of Tor with "fuzz". Determine if there +good libraries out there for what we want. Win fame by getting credit +when we put out a new release because of you!
        • +
        • Website volume fingerprinting attacks (Back et al, Hintz). Defenses +include a large cell size, defensive dropping, etc. How well does each +approach work?
        • The end-to-end traffic confirmation attack. We need to study -long-range dummies more, along with traffic shaping. How much traffic -of what sort of distribution is needed before the adversary is confident -he has won?
        • -
        • It's not that hard to DoS Tor servers or dirservers. Are puzzles -the right answer? What other practical approaches are there?
        • -
        • What sensitive info squeaks by privoxy? Are other html scrubbers -better?
        • +long-range dummies more, along with traffic shaping. How much traffic of +what sort of distribution is needed before the adversary is confident he +has won? +
        • Determine what sensitive info squeaks by privoxy.
        • +
        • Deteremine if there are other html scrubbers that are better than +privoxy.
        -

        Designer project-lets:

        +

        Research Challenges

          +
        • Arranging membership management for independence.
        • +
          • +
          • Sybil defenses without having a human bottleneck.
          • +
          • How to gather random sample of nodes.
          • +
          • How to handle nodelist recommendations.
          • +
          • Consider incremental switches: a p2p tor with only 50 users has +different anonymity properties than one with 10k users, and should be +treated differently.
          • +
        • +
        • Incentives to relay; incentives to exit.
        • +
        • Allowing dissidents to relay through Tor clients.
        • +
        • Experiment with mid-latency systems. How do they impact usability, + how do they impact safety?
        • +
        • Understand how powerful fingerprinting attacks are, and experiment + with ways to foil them (long-range padding?).
        • +
        • Come up with practical approximations to picking entry and exit in + different routing zones.
        • +
        • Find ideal churn rate for helper nodes; how safe is it?
        • +
        • Attacking freenet-gnunet/timing-delay-randomness-arguments.
        • +
        • Is exiting from the middle of the circuit always a bad idea?
        • +
        • IPv6 support (For exit addresses)
        • +
          • +
          • Spec issue: if a resolve returns an IP4 and an IP6 address, + which to use?
          • +
          • Add to exit policy code
          • +
          • Make tor_gethostbyname into tor_getaddrinfo
          • +
          • Make everything that uses uint32_t as an IP address change to use + a generalize address struct.
          • +
          • Change relay cell types to accept new addresses.
          • +
          • Add flag to serverdescs to tell whether IPv6 is supported.
          • +
        • +
        • patch tsocks with our current patches + gethostbyname, getpeername, +etc.
        • +
        • make freecap (or whichever) do what we want.
        • +
        • scrubbing proxies for protocols other than http.
        • +
        • We need better default privoxy configs to ship.
        • +
        • We need a good scrubbing HTTP proxy; privoxy is unmaintained and +sucky.
        • +
        • A DNS proxy would let unmodified socks4/socks5 apps to work +well.
        • +
        • Add SOCKS support to more applications
        • +
        • store hidden service information to disk: dirservers forget service +descriptors when they restart; nodes offering hidden services forget +their chosen intro points when they restart.
        • +
        • It's not that hard to DoS Tor servers or dirservers. Are puzzles the +right answer? What other practical approaches are there?
        • Server CPU load is high because clients keep asking to make new -circuits, which uses public key crypto. Possible defenses include: -using helper nodes (fixed entry nodes); rate limiting the number of -create cells handled per second; having clients retry failed extensions -a few times; implementing ssl sessions; and using hardware crypto when +circuits, which uses public key crypto. Possible defenses include: using +helper nodes (fixed entry nodes); rate limiting the number of create +cells handled per second; having clients retry failed extensions a few +times; implementing ssl sessions; and using hardware crypto when available.
        • We fear we might not work very well when servers have asymmetric -bandwidth. Because Tor has separate TCP connections between each hop, -if the incoming bytes are arriving just fine and the outgoing bytes -are all getting dropped on the floor, the TCP push-back mechanisms -don't really transmit this information back to the incoming streams. -Perhaps Tor should detect when it's dropping a lot of outgoing packets, -and rate-limit incoming streams to regulate this itself? We need somebody -who's good with networks to simulate this and help design solutions.
        • +bandwidth. Because Tor has separate TCP connections between each hop, if +the incoming bytes are arriving just fine and the outgoing bytes are all +getting dropped on the floor, the TCP push-back mechanisms don't really +transmit this information back to the incoming streams. Perhaps Tor +should detect when it's dropping a lot of outgoing packets, and +rate-limit incoming streams to regulate this itself? We need somebody +who's good with networks to simulate this and help design +solutions.
        • Right now the hidden service descriptors are being stored on the dirservers, but any reliable distributed storage system would do (for example, a DHT that allows authenticated updates). Can somebody figure out our best options and decide if they're good enough?
        • -
        • How hard is it to patch bind or a DNS proxy to redirect requests -to Tor via our tor-resolve socks extension? What about to convert UDP -DNS requests to TCP requests and send them through Tor?
        • +
        • How hard is it to patch bind or a DNS proxy to redirect requests to +Tor via our tor-resolve socks extension? What about to convert UDP DNS +requests to TCP requests and send them through Tor?
        • Tor provides anonymous connections, but if you want to keep multiple pseudonyms in practice (say, in case you frequently go to two websites -and if anybody knew about both of them they would conclude it's you), -we don't support that well yet. We should find a good approach and -interface for handling pseudonymous profiles in Tor. See this -post and followup -for details.
        • +and if anybody knew about both of them they would conclude it's you), we +don't support that well yet. We should find a good approach and +interface for handling pseudonymous profiles in Tor. See this post and +followup for details. +
        • Congestion control. Is our current design sufficient once we have +heavy use? Need to measure and tweak, or maybe overhaul.
        -

        Drop by the #tor IRC channel at irc.oftc.net or -email -tor-volunteer at freehaven.net if you want to help out!

        +Drop by the #tor IRC channel at irc.oftc.net or email tor-volunteer at freehaven.net if you want to help out!
    --- NEW FILE: old-contribute.html --- Tor: Contribute

    Tor: Contribute


    Ongoing needs:

    • We need users like you to try Tor out, and let the Tor developers know about bugs you find or features you don't find.
    • Please consider running a server to help the Tor network grow.
    • We especially need people with Windows programming skills to run an exit server on Windows, to help us debug.
    • Run a Tor hidden service and put interesting content on it.
    • Tell your friends! Get them to run servers. Get them to run hidden services. Get them to tell their friends.
    • What else needs to be documented? What is mis-documented?
    • Consider joining the Electronic Frontier Foundation. More EFF donations means more freedom in the world, including more Tor development.

    We also have many project-lets: short-term or self-contained tasks that would be really helpful for somebody to tackle so we can keep focusing on Tor.

    Writing project-lets:

    • Does somebody want to help maintain this website, or help with documentation, or help with managing our TODO and handling bug reports?
    • We may have too much documentation. It's spread out too far and duplicates itself in places. Can you help us consolidate?
    • Please help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
    • Please fix up the FAQ Wiki, and if you know the answer to a question in the "unanswered FAQs" list, please answer it.

    Packaging project-lets:

    • We're always looking for better Windows installers. Specifically, it would be great if somebody were to extend our NSIS-based windows installer to include FreeCap and Privoxy.
    • Our OS X installer can't be uninstalled. Are there non-sucky OS X packagers that have uninstall capabilities? This is becoming an increasing bother.

    Organizational and application testing project-lets:

    • We've got a list of potentially useful programs you might run with Tor here. We also have the Torify howto. Can somebody try them out, simplify the explanations, expand them where they need it, document them better, and make them all-around more useful?

    Programmer and developer project-lets:

    • We need somebody to code up a GUI or other controller program, to do configuration, etc. See our control specification for details, and the rudimentary demonstration Python control script. No, we don't know what the interface should look like. You can use any license you want, but we'd recommend 3-clause BSD or maybe GPL; and we can only help out if your license conforms to the DFSG.
    • Periodically people running servers tells us they want to have one BandwidthRate during some part of the day, and a different BandwidthRate at other parts of the day. Rather than coding this inside Tor, we should have a little script that speaks via the Tor Controller Interface, and does a setconf to change the bandwidth rate. Perhaps it would run out of cron, or perhaps it would sleep until appropriate times and then do its tweak (that's probably more portable). Can somebody write one for us and we'll put it inside tor/contrib/?
    • Does somebody want to do up a patch so we can be an NT service? Or so we can go in the system tray?
    • A good (portable, fast, clean, BSD-free) asynchronous DNS library would be really handy, so we don't have to keep forking DNS worker threads to do gethostbyname.
    • Can somebody take a look at Martin's Squid and Tor page, and update it to reflect Tor's RedirectExit config option?
    • See the TODO and HACKING files in the Tor distribution for more ideas.

    Security project-lets: We need people to attack the implementation and clean it up, and also to attack the design and experiment with defenses.

    • We need somebody to fuzz Tor. Are there good libraries out there for what we want? What are the first steps? Win fame by getting credit when we put out a new release because of you!
    • Website volume fingerprinting attacks (Back et al, Hintz). Defenses include a large cell size, defensive dropping, etc. How well does each approach work?
    • The end-to-end traffic confirmation attack. We need to study long-range dummies more, along with traffic shaping. How much traffic of what sort of distribution is needed before the adversary is confident he has won?
    • It's not that hard to DoS Tor servers or dirservers. Are puzzles the right answer? What other practical approaches are there?
    • What sensitive info squeaks by privoxy? Are other html scrubbers better?

    Designer project-lets:

    • Server CPU load is high because clients keep asking to make new circuits, which uses public key crypto. Possible defenses include: using helper nodes (fixed entry nodes); rate limiting the number of create cells handled per second; having clients retry failed extensions a few times; implementing ssl sessions; and using hardware crypto when available.
    • We fear we might not work very well when servers have asymmetric bandwidth. Because Tor has separate TCP connections between each hop, if the incoming bytes are arriving just fine and the outgoing bytes are all getting dropped on the floor, the TCP push-back mechanisms don't really transmit this information back to the incoming streams. Perhaps Tor should detect when it's dropping a lot of outgoing packets, and rate-limit incoming streams to regulate this itself? We need somebody who's good with networks to simulate this and help design solutions.
    • Right now the hidden service descriptors are being stored on the dirservers, but any reliable distributed storage system would do (for example, a DHT that allows authenticated updates). Can somebody figure out our best options and decide if they're good enough?
    • How hard is it to patch bind or a DNS proxy to redirect requests to Tor via our tor-resolve socks extension? What about to convert UDP DNS requests to TCP requests and send them through Tor?
    • Tor provides anonymous connections, but if you want to keep multiple pseudonyms in practice (say, in case you frequently go to two websites and if anybody knew about both of them they would conclude it's you), we don't support that well yet. We should find a good approach and interface for handling pseudonymous profiles in Tor. See this post and followup for details.

    Drop by the #tor IRC channel at irc.oftc.net or email tor-volunteer at freehaven.net if you want to help out!

    Webmaster - $Id: old-contribute.html,v 1.1 2005/06/29 02:32:55 phobos Exp $
    From phobos at seul.org Wed Jun 29 02:33:17 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 28 Jun 2005 22:33:17 -0400 (EDT) Subject: [or-cvs] removed new-contribute.html Message-ID: <20050629023317.CD7931408084@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv17079 Removed Files: new-contribute.html Log Message: removed new-contribute.html --- new-contribute.html DELETED --- From phobos at seul.org Wed Jun 29 03:27:57 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 28 Jun 2005 23:27:57 -0400 (EDT) Subject: [or-cvs] renamed contribute to volunteer per terri/arma Message-ID: <20050629032757.A47491408108@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv19211 Added Files: volunteer.html Log Message: renamed contribute to volunteer per terri/arma --- NEW FILE: volunteer.html --- Tor: Contribute

    Six things everyone can do now:

    1. We need users like you to try Tor out, and let the Tor developers know about bugs you find or features you don't find.
    2. Please consider running a server to help the Tor network grow.
    3. We especially need people with Windows programming skills to run an exit server on Windows, to help us debug.
    4. Run a Tor hidden service and put interesting content on it.
    5. Tell your friends! Get them to run servers. Get them to run hidden services. Get them to tell their friends.
    6. Consider joining the Electronic Frontier Foundation. More EFF donations means more freedom in the world, including more Tor development.

    Coding Challenges

    • Update crypto usage to use openssl aes when available.
    • Implement a buffer design modelled after the linux kernel buffer design.
    • how do ulimits work on win32, anyway? (We should handle WSAENOBUFS as needed, look at the MaxConnections registry entry, look at the MaxUserPort entry, and look at the TcpTimedWaitDelay entry. We may also want to provide a way to set them as needed. See bug 98.)
    • Implement reverse DNS (already specified)
    • Implement a FirewalledIPs config option that works like FirewallPorts.
    • Make configure.in handle cross-compilation
    • Have NULL_REP_IS_ZERO_BYTES default to 1.
    • Make with-ssl-dir disable search for ssl.
    • Implement preservation of reputation through reboots for clients and dirservers.
    • Add in support egd or other non-OS-integrated strong entropy sources.
    • Implement password protection for on-disk identity key
    • Implement a way to get autoconf to install things into ~/.tor.
    • Change server descriptors to declare log level.
    • Add in support for clients to avoid servers that are too loggy based upon user configuration of acceptable log level.
    • Separate node discovery from routing to allow neat extensions. [Goodell?]
      • Add SetServerStatus control event to adjust verified/running status of nodes.
      • Add NoDownload config option to prevent regular directory downloads from happening.
    • Choosing exit node by meta-data, e.g. country.
    • Use cpuworker for more heavy lifting.
      • Signing (and verifying) hidserv descriptors
      • Signing (and verifying) intro/rend requests
      • Signing (and verifying) router descriptors
      • Signing (and verifying) directories
      • Doing TLS handshake (this is very hard to separate out, though)
    • Buffer size pool: allocate a maximum size for all buffers, not a maximum size for each buffer. So we don't have to give up as quickly (and kill the thickpipe!) when there's congestion.
    • Add alternative versions of crypto.c and tortls.c to use libnss or libgcrypt+gnutls.
    • Implement a way to stop falling back to forbidden ports when FascistFirewall blocks all good dirservers, if there is already a good, cached directory locally.
    • Extend our NSIS-based windows installer to include FreeCap and/or Privoxy.
    • Develop a way to handle OS X installation and uninstallation.
    • Develop a GUI or other controller program, to do configuration, etc. See our control specification for details, and the rudimentary demonstration Python control script.
      • Design an interface for the control program. You can use any license you want, but we'd recommend 3-clause BSD or maybe GPL; and we can only help out if your license conforms to the DFSG.
      • Periodically people running servers tells us they want to have one BandwidthRate during some part of the day, and a different BandwidthRate at other parts of the day. Rather than coding this inside Tor, we should have a little script that speaks via the Tor Controller Interface, and does a setconf to change the bandwidth rate. Perhaps it would run out of cron, or perhaps it would sleep until appropriate times and then do its tweak (that's probably more portable). Can somebody write one for us and we'll put it inside tor/contrib/?
    • Develop a way to become a Windows NT service.
    • Develop a systray app for Tor under MS Windows (all versions).
    • Integrate a good (portable, fast, clean, BSD-free) asynchronous DNS library so we don't have to keep forking DNS worker threads to do gethostbyname.

    Documentation Challenges

    • Write server instructions for OSX and Windows operators.
    • Improve and clarify the wiki entry on port forwarding. url?
    • Document how to do exit node caching: tie into squid or other caching web proxy.
    • Help maintain this website; code, content, css, overall layout,
    • Help with documentation
    • Help consolidate documentation. We may have too much documentation. It's spread out too far and duplicates itself in places.
    • Help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
    • If you know the answer to a Wiki question in the "unanswered FAQs" list, please answer it. url?
    • Take a look at Martin's Squid and Tor page, and update it to reflect Tor's RedirectExit config option. url?

    Testing Challenges

    • Test out why some of our tor servers have dns resolvers that resolve unknown addresses to 127.0.0.1.
      • Identify the servers that experience this issue.
      • Identify how to cause and repair the issue in BIND, DJBDNS, or whatever daemon the misconfigured servers use.
    • Figure out how to setup web proxy gateways to let normal people browse hidden services. (This has been done a few times, but nobody has sent us code.)
    • Investigate privoxy vs. freecap for win32 clients
    • Evaluate, create, and document a list of programs that work with Tor.
    • Perform a security analysis of Tor with "fuzz". Determine if there good libraries out there for what we want. Win fame by getting credit when we put out a new release because of you!
    • Website volume fingerprinting attacks (Back et al, Hintz). Defenses include a large cell size, defensive dropping, etc. How well does each approach work?
    • The end-to-end traffic confirmation attack. We need to study long-range dummies more, along with traffic shaping. How much traffic of what sort of distribution is needed before the adversary is confident he has won?
    • Determine what sensitive info squeaks by privoxy.
    • Deteremine if there are other html scrubbers that are better than privoxy.

    Research Challenges

    • Arranging membership management for independence.
      • Sybil defenses without having a human bottleneck.
      • How to gather random sample of nodes.
      • How to handle nodelist recommendations.
      • Consider incremental switches: a p2p tor with only 50 users has different anonymity properties than one with 10k users, and should be treated differently.
    • Incentives to relay; incentives to exit.
    • Allowing dissidents to relay through Tor clients.
    • Experiment with mid-latency systems. How do they impact usability, how do they impact safety?
    • Understand how powerful fingerprinting attacks are, and experiment with ways to foil them (long-range padding?).
    • Come up with practical approximations to picking entry and exit in different routing zones.
    • Find ideal churn rate for helper nodes; how safe is it?
    • Attacking freenet-gnunet/timing-delay-randomness-arguments.
    • Is exiting from the middle of the circuit always a bad idea?
    • IPv6 support (For exit addresses)
      • Spec issue: if a resolve returns an IP4 and an IP6 address, which to use?
      • Add to exit policy code
      • Make tor_gethostbyname into tor_getaddrinfo
      • Make everything that uses uint32_t as an IP address change to use a generalize address struct.
      • Change relay cell types to accept new addresses.
      • Add flag to serverdescs to tell whether IPv6 is supported.
    • patch tsocks with our current patches + gethostbyname, getpeername, etc.
    • make freecap (or whichever) do what we want.
    • scrubbing proxies for protocols other than http.
    • We need better default privoxy configs to ship.
    • We need a good scrubbing HTTP proxy; privoxy is unmaintained and sucky.
    • A DNS proxy would let unmodified socks4/socks5 apps to work well.
    • Add SOCKS support to more applications
    • store hidden service information to disk: dirservers forget service descriptors when they restart; nodes offering hidden services forget their chosen intro points when they restart.
    • It's not that hard to DoS Tor servers or dirservers. Are puzzles the right answer? What other practical approaches are there?
    • Server CPU load is high because clients keep asking to make new circuits, which uses public key crypto. Possible defenses include: using helper nodes (fixed entry nodes); rate limiting the number of create cells handled per second; having clients retry failed extensions a few times; implementing ssl sessions; and using hardware crypto when available.
    • We fear we might not work very well when servers have asymmetric bandwidth. Because Tor has separate TCP connections between each hop, if the incoming bytes are arriving just fine and the outgoing bytes are all getting dropped on the floor, the TCP push-back mechanisms don't really transmit this information back to the incoming streams. Perhaps Tor should detect when it's dropping a lot of outgoing packets, and rate-limit incoming streams to regulate this itself? We need somebody who's good with networks to simulate this and help design solutions.
    • Right now the hidden service descriptors are being stored on the dirservers, but any reliable distributed storage system would do (for example, a DHT that allows authenticated updates). Can somebody figure out our best options and decide if they're good enough?
    • How hard is it to patch bind or a DNS proxy to redirect requests to Tor via our tor-resolve socks extension? What about to convert UDP DNS requests to TCP requests and send them through Tor?
    • Tor provides anonymous connections, but if you want to keep multiple pseudonyms in practice (say, in case you frequently go to two websites and if anybody knew about both of them they would conclude it's you), we don't support that well yet. We should find a good approach and interface for handling pseudonymous profiles in Tor. See this post and followup for details.
    • Congestion control. Is our current design sufficient once we have heavy use? Need to measure and tweak, or maybe overhaul.
    Drop by the #tor IRC channel at irc.oftc.net or email tor-volunteer at freehaven.net if you want to help out!
    Webmaster - $Id: volunteer.html,v 1.1 2005/06/29 03:27:55 phobos Exp $
    From phobos at seul.org Tue Jun 7 02:10:15 2005 From: phobos at seul.org (phobos at seul.org) Date: Mon, 6 Jun 2005 22:10:15 -0400 (EDT) Subject: [or-cvs] Updated faq-abuse.html to match tor-legal-faq look and feel... Message-ID: <20050607021015.488571408029@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv12735 Modified Files: faq-abuse.html Log Message: Updated faq-abuse.html to match tor-legal-faq look and feel per arma changed nothing in faq.html? Index: faq-abuse.html =================================================================== RCS file: /home/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- faq-abuse.html 7 Jun 2005 01:46:30 -0000 1.1 +++ faq-abuse.html 7 Jun 2005 02:10:13 -0000 1.2 @@ -3,10 +3,10 @@ - Legal FAQ for Tor Server Operators - + Abuse FAQ for Tor Server Operators + - + @@ -17,16 +17,16 @@ - Home - | How It Works - | Download - | Docs - | Users - | FAQs - | Contribute - | Developers - | Research - | People + Home + | How It Works + | Download + | Docs + | Users + | FAQs + | Contribute + | Developers + | Research + | People @@ -63,7 +63,7 @@

    Distributed denial of service attacks typically rely on having a group of thousands of computers all sending floods of traffic to a victim. Since the goal is to overpower the bandwidth of the victim, they typically send UDP packets since those don't require handshakes or coordination.

    But because Tor only transports correctly-formed TCP streams, not all IP packets, you cannot send UDP packets over Tor. (You can't do specialized forms of this attack like SYN flooding either.) So ordinary DDoS attacks are not possible over Tor. Tor also doesn't allow bandwidth amplification attacks against external sites: you need to send in a byte for every byte which the Tor network will send to your destination. So in general, attackers who control enough bandwidth to launch an effective DDoS attack can do it just fine without Tor.

    -

    And if this argument doesn't convince you, go try Tor and see how much aggregate throughput you can eke out of it, then come back to us if you're still worried. :)

    +

    And if this argument doesn't convince you, go try Tor and see how much aggregate throughput you can eke out of it, then come back to us if you're still worried.

    What about spammers?

    @@ -82,7 +82,7 @@

    Does Tor get much abuse?

    Not much, in the grand scheme of things. We've been running the network since October 2003, and it's only generated a handful of complaints. Of course, like all privacy-oriented networks on the net, we attract our share of jerks. Tor's exit policies help separate the role of "willing to donate resources to the network" from the role of "willing to deal with exit abuse complaints", so we hope our network is more sustainable than past attempts at anonymity networks.

    -

    Since Tor has [WWW] many good uses as well, we feel that we're doing pretty well at striking a balance currently.

    +

    Since Tor has many good uses as well, we feel that we're doing pretty well at striking a balance currently.

    So what should I expect if I run a server?

    @@ -95,7 +95,7 @@
  • Somebody connects to an irc network and makes a nuisance of himself. Your ISP gets polite mail about how your computer has been compromised; and/or your computer gets ddosed. [Port 6667]

  • -
  • Somebody uses Tor to download a Vin Diesel movie, and your ISP gets a DMCA takedown notice. According to our lawyers (and this convinced the Harvard general counsel), your ISP can totally ignore this notice with no liability problems. See [WWW] http://tor.eff.org/eff/tor-dmca-response.html. [Arbitrary ports]

    +
  • Somebody uses Tor to download a Vin Diesel movie, and your ISP gets a DMCA takedown notice. According to our lawyers (and this convinced the Harvard general counsel), your ISP can totally ignore this notice with no liability problems. See http://tor.eff.org/eff/tor-dmca-response.html. [Arbitrary ports]

  • You might also find that your Tor server's IP is blocked from accessing some Internet sites/services. This might happen regardless of your exit policy, because some groups don't seem to know or care that Tor has exit policies. (If you have a spare IP not used for other activities, you might consider running your Tor server on it.) For example,

    @@ -115,12 +115,14 @@

    But the real answer is to implement application-level auth systems, to let in well-behaving users and keep out badly-behaving users. This needs to be based on some property of the human (such as a password he knows), not some property of the way his packets are transported.

    Of course, not all IRC networks are trying to ban Tor nodes. After all, quite a few people use Tor to IRC in privacy in order to carry on legitimate communications without tying them to their real-world identity. Each IRC network needs to decide for itself if blocking a few more of the millions of IPs that bad people can use is worth losing the contributions from the well-behaved Tor users.

    If you're being blocked, have a discussion with the network operators and explain the issues to them. They may not be aware of the existence of Tor at all, or they may not be aware that the hostnames they're klining are Tor exit nodes. If you explain the problem, and they conclude that Tor ought to be blocked, you may want to consider moving to a network that is more open to free speech. Maybe inviting them to #tor on irc.oftc.net helps them show that we are not all evil people.

    -

    Finally, if you become aware of an IRC network which seems to be blocking Tor, or a single Tor exit node, please put that information on ../BlockingIrc so that others can share. At least one IRC network consults that page to unblock exit nodes which have been blocked inadvertently.

    +

    Finally, if you become aware of an IRC network which seems to be +blocking Tor, or a single Tor exit node, please put that information on +BlockingIrc so that others can share. At least one IRC network consults that page to unblock exit nodes which have been blocked inadvertently.

    Your nodes are banned from the mail server I want to use.

    -

    Even though [WWW] Tor isn't useful for spamming, some over-zealous blacklisters seem to think that all open networks like Tor should be boycotted. They don't understand how Tor works (e.g. that it has exit policies), and don't seem to care to understand it. If your server administrators decide to make use of these blacklists to refuse incoming mail, you should have a conversation with them and explain how Tor works.

    +

    Even though Tor isn't useful for spamming, some over-zealous blacklisters seem to think that all open networks like Tor should be boycotted. They don't understand how Tor works (e.g. that it has exit policies), and don't seem to care to understand it. If your server administrators decide to make use of these blacklists to refuse incoming mail, you should have a conversation with them and explain how Tor works.

    I want to ban the Tor network from my service.

    @@ -128,16 +130,20 @@

    First, ask yourself if there's a way to do application-level decisions to separate the legitimate users from the jerks. For example, you might have certain areas of the site, or certain privileges like posting, available only to people who are registered. You could set up this distinction only for certain IP addresses such as Tor exit nodes. This way you can have multi-tiered access and not have to ban everything.

    Second, consider that thousands of people use Tor every day to protect against data-gathering corporations like Doubleclick while going about their normal activities. Some Tor users may be legitimately connecting to your service right now to carry on normal activities. You need to decide whether banning the Tor network is worth losing the contributions of these users, as well as potential future such users.

    Lastly, please remember that Tor servers have individual exit policies. Many Tor servers do not allow exiting connections at all. Many of those that do, probably already disallow connections to your service. When you go about banning nodes, you should parse the exit policies and only block the ones that allow these connections; and you should keep in mind that exit policies can change (as well as the overall list of nodes in the network).

    -

    If you really want to do this, there is a python script to parse the Tor directory [WWW] here.

    +

    If you really want to do this, there is a python script to parse the Tor directory here.

    I have legal questions about Tor abuse.

    We're only the developers. We can answer technical questions, but we're not the ones to talk to about legal questions or concerns.

    -

    Please take a look at the [WWW] Tor Legal FAQ, and contact EFF directly if you have any further questions.

    +

    Please take a look at the Tor Legal FAQ, and contact EFF directly if you have any further questions.

    -
    -
    +
    +
    +
    + Webmaster - + $Id$ +
    From phobos at seul.org Wed Jun 29 03:28:22 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 28 Jun 2005 23:28:22 -0400 (EDT) Subject: [or-cvs] removed contribute Message-ID: <20050629032822.1FD821408108@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv19307 Removed Files: contribute.html Log Message: removed contribute --- contribute.html DELETED --- From phobos at seul.org Wed Jun 29 03:37:44 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 28 Jun 2005 23:37:44 -0400 (EDT) Subject: [or-cvs] put back contribute.html for any real soon now releases. Message-ID: <20050629033744.2349914081A3@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv19541 Added Files: contribute.html Log Message: put back contribute.html for any real soon now releases. From phobos at seul.org Wed Jun 29 04:47:33 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 00:47:33 -0400 (EDT) Subject: [or-cvs] renamed all contribute.html links to volunteer.html Message-ID: <20050629044733.61A881408037@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv22068 Modified Files: developers.html documentation.html download.html faq-abuse.html faq.html gui-contest.html howitworks.html index.html overview.html people.html research.html translation.html users.html Removed Files: contribute.html Log Message: renamed all contribute.html links to volunteer.html --- contribute.html DELETED --- Index: developers.html =================================================================== RCS file: /home/or/cvsroot/website/developers.html,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- developers.html 21 Jun 2005 23:47:56 -0000 1.26 +++ developers.html 29 Jun 2005 04:47:31 -0000 1.27 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: documentation.html =================================================================== RCS file: /home/or/cvsroot/website/documentation.html,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- documentation.html 9 Jun 2005 22:24:50 -0000 1.35 +++ documentation.html 29 Jun 2005 04:47:31 -0000 1.36 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: download.html =================================================================== RCS file: /home/or/cvsroot/website/download.html,v retrieving revision 1.109 retrieving revision 1.110 diff -u -d -r1.109 -r1.110 --- download.html 23 Jun 2005 18:59:38 -0000 1.109 +++ download.html 29 Jun 2005 04:47:31 -0000 1.110 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: faq-abuse.html =================================================================== RCS file: /home/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- faq-abuse.html 8 Jun 2005 02:37:51 -0000 1.9 +++ faq-abuse.html 29 Jun 2005 04:47:31 -0000 1.10 @@ -23,7 +23,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: faq.html =================================================================== RCS file: /home/or/cvsroot/website/faq.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- faq.html 7 Jun 2005 16:13:39 -0000 1.8 +++ faq.html 29 Jun 2005 04:47:31 -0000 1.9 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: gui-contest.html =================================================================== RCS file: /home/or/cvsroot/website/gui-contest.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- gui-contest.html 28 May 2005 05:57:34 -0000 1.5 +++ gui-contest.html 29 Jun 2005 04:47:31 -0000 1.6 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: howitworks.html =================================================================== RCS file: /home/or/cvsroot/website/howitworks.html,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- howitworks.html 16 May 2005 07:35:41 -0000 1.25 +++ howitworks.html 29 Jun 2005 04:47:31 -0000 1.26 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: index.html =================================================================== RCS file: /home/or/cvsroot/website/index.html,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- index.html 21 Jun 2005 19:31:56 -0000 1.62 +++ index.html 29 Jun 2005 04:47:31 -0000 1.63 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: overview.html =================================================================== RCS file: /home/or/cvsroot/website/overview.html,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- overview.html 9 Jun 2005 22:26:00 -0000 1.34 +++ overview.html 29 Jun 2005 04:47:31 -0000 1.35 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People @@ -220,7 +220,7 @@ We're making progress, but we need your help. Please consider installing a server -or volunteering as a volunteering as a developer.

    Index: people.html =================================================================== RCS file: /home/or/cvsroot/website/people.html,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- people.html 21 Jun 2005 19:31:56 -0000 1.20 +++ people.html 29 Jun 2005 04:47:31 -0000 1.21 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: research.html =================================================================== RCS file: /home/or/cvsroot/website/research.html,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- research.html 16 May 2005 13:01:03 -0000 1.18 +++ research.html 29 Jun 2005 04:47:31 -0000 1.19 @@ -23,7 +23,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People @@ -48,7 +48,7 @@

    We need people to attack the system, quantify defenses, etc. See the "security project-lets" section of the contribute page.

    +href="volunteer.html">contribute page.

    Index: translation.html =================================================================== RCS file: /home/or/cvsroot/website/translation.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- translation.html 13 Jun 2005 18:13:30 -0000 1.13 +++ translation.html 29 Jun 2005 04:47:31 -0000 1.14 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: users.html =================================================================== RCS file: /home/or/cvsroot/website/users.html,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- users.html 22 Jun 2005 00:45:07 -0000 1.22 +++ users.html 29 Jun 2005 04:47:31 -0000 1.23 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People From phobos at seul.org Wed Jun 29 04:50:55 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 00:50:55 -0400 (EDT) Subject: [or-cvs] updated all contribute.de.html to point at volunteer.de.html Message-ID: <20050629045055.0A50714080FC@moria.seul.org> Update of /home/or/cvsroot/website/de In directory moria:/tmp/cvs-serv22326 Modified Files: developers.de.html documentation.de.html download.de.html faq.de.html howitworks.de.html index.de.html overview.de.html people.de.html research.de.html users.de.html Added Files: volunteer.de.html Removed Files: contribute.de.html Log Message: updated all contribute.de.html to point at volunteer.de.html --- contribute.de.html DELETED --- Index: developers.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/developers.de.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- developers.de.html 23 Jun 2005 00:15:13 -0000 1.4 +++ developers.de.html 29 Jun 2005 04:50:52 -0000 1.5 @@ -27,7 +27,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen Index: documentation.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/documentation.de.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- documentation.de.html 21 Jun 2005 22:10:54 -0000 1.5 +++ documentation.de.html 29 Jun 2005 04:50:52 -0000 1.6 @@ -27,7 +27,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen Index: download.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/download.de.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- download.de.html 14 Jun 2005 16:18:14 -0000 1.7 +++ download.de.html 29 Jun 2005 04:50:52 -0000 1.8 @@ -26,7 +26,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen Index: faq.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/faq.de.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- faq.de.html 27 May 2005 06:37:43 -0000 1.2 +++ faq.de.html 29 Jun 2005 04:50:52 -0000 1.3 @@ -25,7 +25,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen Index: howitworks.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/howitworks.de.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- howitworks.de.html 10 Jun 2005 21:12:30 -0000 1.2 +++ howitworks.de.html 29 Jun 2005 04:50:52 -0000 1.3 @@ -27,7 +27,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen Index: index.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/index.de.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- index.de.html 21 Jun 2005 22:10:14 -0000 1.8 +++ index.de.html 29 Jun 2005 04:50:52 -0000 1.9 @@ -27,7 +27,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen Index: overview.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/overview.de.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- overview.de.html 10 Jun 2005 21:12:30 -0000 1.2 +++ overview.de.html 29 Jun 2005 04:50:52 -0000 1.3 @@ -25,7 +25,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen @@ -206,7 +206,7 @@ Wir machen Fortschritte, aber wir ben?tigen Ihre Hilfe. Bitte ?berlegen Sie, ob Sie einen Server installieren oder ob -Sie freiwillig als freiwillig als Entwickler einen Beitrag leisten m?chten.

    Andauernde Trends in Gesetzgebung, Politik und Technologie bedrohen Index: people.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/people.de.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- people.de.html 21 Jun 2005 21:23:22 -0000 1.2 +++ people.de.html 29 Jun 2005 04:50:52 -0000 1.3 @@ -26,7 +26,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen Index: research.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/research.de.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- research.de.html 1 Jun 2005 15:58:10 -0000 1.1 +++ research.de.html 29 Jun 2005 04:50:52 -0000 1.2 @@ -26,7 +26,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen @@ -52,7 +52,7 @@

    Wir brauchen Leute, um das System zu attackieren, und Verteidigungen zu quantifizieren. Schaue dir auch den Abschnitt Sicherheitsaufgaben die -Seite Zum Projekte beitragen an.

    +Seite Zum Projekte beitragen an.

    Index: users.de.html =================================================================== RCS file: /home/or/cvsroot/website/de/users.de.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- users.de.html 23 Jun 2005 00:15:13 -0000 1.3 +++ users.de.html 29 Jun 2005 04:50:52 -0000 1.4 @@ -27,7 +27,7 @@ | Dokumente | Nutzer | FAQs - | Zum Projekt beitragen + | Zum Projekt beitragen | Entwickler | Forschung | Menschen --- NEW FILE: volunteer.de.html --- Tor: Zum Projekt beitragen

    Tor: Zum Projekt beitragen


    Laufender Bedarf:

    Wir haben auch viele Aufgaben: kurzfristige Aufgaben, die sehr hilfreich w?ren, wenn sie jemand in Angriff nimmt. Damit k?nnten wir uns mehr auf Tor konzentrieren.

    Schriftliche Aufgaben:

    Aufgaben bei Paketen:

    Organisatorische und Anwendungstestaufgaben:

    Programmier- und Projektaufgaben:

    Sicherheitsaufgaben: Wir brauchen Leute, um die Implementation anzugreifen und diese von Fehlern zu befreien. Weiterhin muss auch das Design einer Kontrolle unterzogen werden.

    Designeraufgaben:

    Schaue mal im #tor IRC-Kanal auf irc.oftc.net vorbei oder schreibe eine E-Mail an tor-volunteer at freehaven.net, wenn du helfen m?chtest!

    Webmaster - $Id: volunteer.de.html,v 1.1 2005/06/29 04:50:52 phobos Exp $
    From phobos at seul.org Wed Jun 29 04:53:49 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 00:53:49 -0400 (EDT) Subject: [or-cvs] updated all pages to point at volunteer.it.html instead of Message-ID: <20050629045349.5919D1408108@moria.seul.org> Update of /home/or/cvsroot/website/it In directory moria:/tmp/cvs-serv22483 Modified Files: developers.it.html documentation.it.html download.it.html faq.it.html howitworks.it.html index.it.html people.it.html research.it.html users.it.html Added Files: volunteer.it.html Removed Files: contribute.it.html Log Message: updated all pages to point at volunteer.it.html instead of contribute.it.html --- contribute.it.html DELETED --- Index: developers.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/developers.it.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- developers.it.html 28 Jun 2005 21:44:33 -0000 1.2 +++ developers.it.html 29 Jun 2005 04:53:47 -0000 1.3 @@ -25,7 +25,7 @@ | Docs | Utenti | Faq - | Contribuire + | Contribuire | Sviluppo | Ricerca | Persone Index: documentation.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/documentation.it.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- documentation.it.html 28 Jun 2005 21:44:33 -0000 1.2 +++ documentation.it.html 29 Jun 2005 04:53:47 -0000 1.3 @@ -25,7 +25,7 @@ | Docs | Utenti | Faq - | Contribuire + | Contribuire | Sviluppo | Ricerca | Persone Index: download.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/download.it.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- download.it.html 28 Jun 2005 21:44:33 -0000 1.2 +++ download.it.html 29 Jun 2005 04:53:47 -0000 1.3 @@ -25,7 +25,7 @@ | Docs | Utenti | Faq - | Contribuire + | Contribuire | Sviluppo | Ricerca | Persone Index: faq.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/faq.it.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- faq.it.html 28 Jun 2005 21:44:33 -0000 1.2 +++ faq.it.html 29 Jun 2005 04:53:47 -0000 1.3 @@ -25,7 +25,7 @@ | Docs | Utenti | Faq - | Contribuire + | Contribuire | Sviluppo | Ricerca | Persone Index: howitworks.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/howitworks.it.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- howitworks.it.html 28 Jun 2005 21:44:33 -0000 1.2 +++ howitworks.it.html 29 Jun 2005 04:53:47 -0000 1.3 @@ -25,7 +25,7 @@ | Docs | Utenti | Faq - | Contribuire + | Contribuire | Sviluppo | Ricerca | Persone Index: index.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/index.it.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.it.html 28 Jun 2005 21:44:33 -0000 1.2 +++ index.it.html 29 Jun 2005 04:53:47 -0000 1.3 @@ -26,7 +26,7 @@ | Docs | Utenti | Faq - | Contribuire + | Contribuire | Sviluppo | Ricerca | Persone Index: people.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/people.it.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- people.it.html 28 Jun 2005 21:44:33 -0000 1.2 +++ people.it.html 29 Jun 2005 04:53:47 -0000 1.3 @@ -25,7 +25,7 @@ | Docs | Utenti | Faq - | Contribuire + | Contribuire | Sviluppo | Ricerca | Persone Index: research.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/research.it.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- research.it.html 28 Jun 2005 21:44:33 -0000 1.2 +++ research.it.html 29 Jun 2005 04:53:47 -0000 1.3 @@ -24,7 +24,7 @@ | Docs | Utenti | Faq - | Contribuire + | Contribuire | Sviluppo | Ricerca | Persone @@ -51,7 +51,7 @@

    Abbiamo bisogno di persone che attacchino il sistema, quantifichino le difese, etc. Leggi la sezione "security project-lets" della pagina contribuire.

    +href="volunteer.it.html">contribuire.

    Index: users.it.html =================================================================== RCS file: /home/or/cvsroot/website/it/users.it.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- users.it.html 28 Jun 2005 21:44:33 -0000 1.2 +++ users.it.html 29 Jun 2005 04:53:47 -0000 1.3 @@ -25,7 +25,7 @@ | Docs | Utenti | Faq - | Contribuire + | Contribuire | Sviluppo | Ricerca | Persone --- NEW FILE: volunteer.it.html --- Tor: Contribuisci

    Questa traduzione non è stata controllata dagli sviluppatori di Tor e da EFF. Può risultare non attuale o sbagliata. Il sito ufficiale di Tor è in Inglese, all'indirizzo http://tor.eff.org/

    Necessità presenti:

    Tor: Contribuire


    Cosa abbiamo bisogno:

    Siamo in continua attività: se qualcuno si occupasse di task a breve termine sarebbe di grande aiuto a noi che possiamo così focalizzarci su Tor.

    Attività di scrittura:

    Attività di Packaging:

    Attività di organizzazione e testing:

    Attività di programmazione e sviluppo:

    Security project-lets: We need people to attack the implementation and clean it up, and also to attack the design and experiment with defenses.

    Designer project-lets:

    Drop by the #tor IRC channel at irc.oftc.net or email tor-volunteer at freehaven.net if you want to help out!

    Webmaster - $Id: volunteer.it.html,v 1.1 2005/06/29 04:53:47 phobos Exp $
    From phobos at seul.org Wed Jun 29 04:56:02 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 00:56:02 -0400 (EDT) Subject: [or-cvs] Updated to point to volunteer.html instead of contribute.html Message-ID: <20050629045602.0FE1D1408277@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv22603 Modified Files: research.html Log Message: Updated to point to volunteer.html instead of contribute.html Index: research.html =================================================================== RCS file: /home/or/cvsroot/website/research.html,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- research.html 29 Jun 2005 04:47:31 -0000 1.19 +++ research.html 29 Jun 2005 04:55:59 -0000 1.20 @@ -48,7 +48,7 @@

    We need people to attack the system, quantify defenses, etc. See the "security project-lets" section of the contribute page.

    +href="volunteer.html">volunteer page.

    From phobos at seul.org Wed Jun 29 04:56:02 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 00:56:02 -0400 (EDT) Subject: [or-cvs] Updated to point to volunteer.html instead of contribute.html Message-ID: <20050629045602.213DE1408ECF@moria.seul.org> Update of /home/or/cvsroot/website/eff In directory moria:/tmp/cvs-serv22603/eff Modified Files: tor-dmca-response.html tor-legal-faq.html Log Message: Updated to point to volunteer.html instead of contribute.html Index: tor-dmca-response.html =================================================================== RCS file: /home/or/cvsroot/website/eff/tor-dmca-response.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- tor-dmca-response.html 25 Jun 2005 06:27:49 -0000 1.4 +++ tor-dmca-response.html 29 Jun 2005 04:56:00 -0000 1.5 @@ -23,7 +23,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People Index: tor-legal-faq.html =================================================================== RCS file: /home/or/cvsroot/website/eff/tor-legal-faq.html,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- tor-legal-faq.html 20 Jun 2005 20:12:11 -0000 1.14 +++ tor-legal-faq.html 29 Jun 2005 04:56:00 -0000 1.15 @@ -23,7 +23,7 @@ | Docs | Users | FAQs - | Contribute + | Contribute | Developers | Research | People From phobos at seul.org Wed Jun 29 18:07:46 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 14:07:46 -0400 (EDT) Subject: [or-cvs] created redirect page to new volunteer for legacy links. Message-ID: <20050629180746.512E51408066@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv21811 Added Files: contribute.html Log Message: created redirect page to new volunteer for legacy links. From phobos at seul.org Wed Jun 29 18:13:41 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 14:13:41 -0400 (EDT) Subject: [or-cvs] Added country flag to do item for the website. Message-ID: <20050629181341.CD9241408066@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv22105 Modified Files: volunteer.html Log Message: Added country flag to do item for the website. Index: volunteer.html =================================================================== RCS file: /home/or/cvsroot/website/volunteer.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- volunteer.html 29 Jun 2005 03:27:55 -0000 1.1 +++ volunteer.html 29 Jun 2005 18:13:39 -0000 1.2 @@ -112,6 +112,7 @@
  • Help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
  • If you know the answer to a Wiki question in the "unanswered FAQs" list, please answer it. url?
  • Take a look at Martin's Squid and Tor page, and update it to reflect Tor's RedirectExit config option. url?
  • +
  • Update website to include the country flags for each language into which the website has been translated.
  • Testing Challenges

    From arma at seul.org Wed Jun 29 18:16:38 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 14:16:38 -0400 (EDT) Subject: [or-cvs] call it Volunteer in the navigation bar too Message-ID: <20050629181638.533A41408069@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: contribute.html developers.html documentation.html download.html faq-abuse.html faq.html gui-contest.html howitworks.html index.html overview.html people.html research.html translation.html users.html volunteer.html Log Message: call it Volunteer in the navigation bar too Index: contribute.html =================================================================== RCS file: /home2/or/cvsroot/website/contribute.html,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- contribute.html 29 Jun 2005 18:07:44 -0000 1.59 +++ contribute.html 29 Jun 2005 18:16:36 -0000 1.60 @@ -3,9 +3,13 @@ + +

    +[Redirecting you to the new volunteer.html page...] +

    Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: documentation.html =================================================================== RCS file: /home2/or/cvsroot/website/documentation.html,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- documentation.html 29 Jun 2005 04:47:31 -0000 1.36 +++ documentation.html 29 Jun 2005 18:16:36 -0000 1.37 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: download.html =================================================================== RCS file: /home2/or/cvsroot/website/download.html,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- download.html 29 Jun 2005 04:47:31 -0000 1.110 +++ download.html 29 Jun 2005 18:16:36 -0000 1.111 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- faq-abuse.html 29 Jun 2005 04:47:31 -0000 1.10 +++ faq-abuse.html 29 Jun 2005 18:16:36 -0000 1.11 @@ -23,7 +23,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: faq.html =================================================================== RCS file: /home2/or/cvsroot/website/faq.html,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- faq.html 29 Jun 2005 04:47:31 -0000 1.9 +++ faq.html 29 Jun 2005 18:16:36 -0000 1.10 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: gui-contest.html =================================================================== RCS file: /home2/or/cvsroot/website/gui-contest.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- gui-contest.html 29 Jun 2005 04:47:31 -0000 1.6 +++ gui-contest.html 29 Jun 2005 18:16:36 -0000 1.7 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: howitworks.html =================================================================== RCS file: /home2/or/cvsroot/website/howitworks.html,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- howitworks.html 29 Jun 2005 04:47:31 -0000 1.26 +++ howitworks.html 29 Jun 2005 18:16:36 -0000 1.27 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: index.html =================================================================== RCS file: /home2/or/cvsroot/website/index.html,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- index.html 29 Jun 2005 04:47:31 -0000 1.63 +++ index.html 29 Jun 2005 18:16:36 -0000 1.64 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: overview.html =================================================================== RCS file: /home2/or/cvsroot/website/overview.html,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- overview.html 29 Jun 2005 04:47:31 -0000 1.35 +++ overview.html 29 Jun 2005 18:16:36 -0000 1.36 @@ -19,12 +19,12 @@ Home - | How It Works + | How It Works | Download | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: people.html =================================================================== RCS file: /home2/or/cvsroot/website/people.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- people.html 29 Jun 2005 04:47:31 -0000 1.21 +++ people.html 29 Jun 2005 18:16:36 -0000 1.22 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: research.html =================================================================== RCS file: /home2/or/cvsroot/website/research.html,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- research.html 29 Jun 2005 04:55:59 -0000 1.20 +++ research.html 29 Jun 2005 18:16:36 -0000 1.21 @@ -23,7 +23,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: translation.html =================================================================== RCS file: /home2/or/cvsroot/website/translation.html,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- translation.html 29 Jun 2005 04:47:31 -0000 1.14 +++ translation.html 29 Jun 2005 18:16:36 -0000 1.15 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: users.html =================================================================== RCS file: /home2/or/cvsroot/website/users.html,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- users.html 29 Jun 2005 04:47:31 -0000 1.23 +++ users.html 29 Jun 2005 18:16:36 -0000 1.24 @@ -24,7 +24,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People Index: volunteer.html =================================================================== RCS file: /home2/or/cvsroot/website/volunteer.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- volunteer.html 29 Jun 2005 18:13:39 -0000 1.2 +++ volunteer.html 29 Jun 2005 18:16:36 -0000 1.3 @@ -2,7 +2,7 @@ - Tor: Contribute + Tor: Volunteer @@ -22,7 +22,7 @@ | Docs | Users | FAQs - | Contribute + | Volunteer | Developers | Research | People From phobos at seul.org Tue Jun 7 02:41:08 2005 From: phobos at seul.org (phobos at seul.org) Date: Mon, 6 Jun 2005 22:41:08 -0400 (EDT) Subject: [or-cvs] Removed all invalid classes, updated href records to point ... Message-ID: <20050607024108.D9698140825D@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv13998 Modified Files: faq-abuse.html Log Message: Removed all invalid classes, updated href records to point to valid urls. Index: faq-abuse.html =================================================================== RCS file: /home/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- faq-abuse.html 7 Jun 2005 02:10:13 -0000 1.2 +++ faq-abuse.html 7 Jun 2005 02:41:06 -0000 1.3 @@ -34,7 +34,8 @@ -
    +
    +
    @@ -47,16 +48,17 @@

    Doesn't Tor enable criminals to do bad things?

    -

    Criminals can already do bad things. Since they're willing to break laws, they already have lots of options available that provide _better_ privacy than Tor provides. They can steal cell phones, use them, and throw them in a ditch; they can crack into computers in Korea or Brazil and use them to launch abusive activities; they can spread viruses that take control of literally millions of Windows machines around the world.

    +

    Criminals can already do bad things. Since they're willing to break +laws, they already have lots of options available that provide better privacy than Tor provides. They can steal cell phones, use them, and throw them in a ditch; they can crack into computers in Korea or Brazil and use them to launch abusive activities; they can spread viruses that take control of literally millions of Windows machines around the world.

    Tor aims to provide protection for ordinary people who want to follow the law. Only criminals have privacy right now; we need to fix that.

    Isn't it just a tradeoff: accepting the bad uses for the good ones?

    No, we don't think that's how it works in the case of Tor.

    -

    There are lots of ways to get anonymity on the net, some legal and some illegal. As we explained above, many of the illegal approaches can provide stronger anonymity than Tor can provide, because they can control literally millions of computers via spyware, viruses, and other techniques.

    +

    There are lots of ways to get anonymity on the net, some legal and some illegal. As we explained above, many of the illegal approaches can provide stronger anonymity than Tor can provide, because they can control literally millions of computers via spyware, viruses, and other techniques.

    Criminals and other bad people have the motivation to learn how to get good anonymity, and many have the motivation to pay well to achieve it. Being able to steal and reuse the identities of innocent victims (identify theft) makes it even easier. Normal people, on the other hand, don't typically have the time or money to spend figuring out how to get privacy online. This is the worst of all possible worlds.

    -

    So yes, criminals could in theory use Tor, but they already have better options, and it seems unlikely that taking Tor away from the world will stop them from doing their bad things. At the same time, Tor and other privacy measures can *fight* identity theft, physical crimes like stalking, and so on.

    +

    So yes, criminals could in theory use Tor, but they already have better options, and it seems unlikely that taking Tor away from the world will stop them from doing their bad things. At the same time, Tor and other privacy measures can fight identity theft, physical crimes like stalking, and so on.

    What about distributed denial of service attacks?

    @@ -91,18 +93,18 @@
    • Somebody connects to hotmail, and sends a criminal mail somewhere. The FBI sends you a polite email, you explain that you run a Tor server, and they say 'oh well' and leave you alone. [Port 80]

    • -
    • Somebody tries to get you shut down by using Tor to connect to google groups and posting spam to usenet, and then sending an angry mail to your ISP about how you're destroying the world. [Port 80]

      +
    • Somebody tries to get you shut down by using Tor to connect to google groups and posting spam to usenet, and then sending an angry mail to your ISP about how you're destroying the world. [Port 80]

    • -
    • Somebody connects to an irc network and makes a nuisance of himself. Your ISP gets polite mail about how your computer has been compromised; and/or your computer gets ddosed. [Port 6667]

      +
    • Somebody connects to an irc network and makes a nuisance of himself. Your ISP gets polite mail about how your computer has been compromised; and/or your computer gets ddosed. [Port 6667]

    • -
    • Somebody uses Tor to download a Vin Diesel movie, and your ISP gets a DMCA takedown notice. According to our lawyers (and this convinced the Harvard general counsel), your ISP can totally ignore this notice with no liability problems. See http://tor.eff.org/eff/tor-dmca-response.html. [Arbitrary ports]

      +
    • Somebody uses Tor to download a Vin Diesel movie, and your ISP gets a DMCA takedown notice. According to our lawyers (and this convinced the Harvard general counsel), your ISP can totally ignore this notice with no liability problems. See Tor DMCA Response. [Arbitrary ports]

    You might also find that your Tor server's IP is blocked from accessing some Internet sites/services. This might happen regardless of your exit policy, because some groups don't seem to know or care that Tor has exit policies. (If you have a spare IP not used for other activities, you might consider running your Tor server on it.) For example,

    • Wikipedia is currently blocking many Tor server IPs from writing (reading still works), because they haven't figured out internally how to deal with the fact that they want to provide open access but they also have no ways to control abuse to their website. We're working with them to resolve this.

    • -
    • It seems that SORBS is putting some Tor server IPs on their email blacklist as well. They do this because they passively detect whether your server connects to certain IRC networks, and they conclude from this that your server is capable of spamming. We're working with them to teach them that not all software works this way. Until then, we recommend you avoid them, and teach your friends (if they use them) to avoid them too.

      +
    • It seems that SORBS is putting some Tor server IPs on their email blacklist as well. They do this because they passively detect whether your server connects to certain IRC networks, and they conclude from this that your server is capable of spamming. We're working with them to teach them that not all software works this way. Until then, we recommend you avoid them, and teach your friends (if they use them) to avoid them too.

    @@ -122,7 +124,7 @@

    Your nodes are banned from the mail server I want to use.

    -

    Even though Tor isn't useful for spamming, some over-zealous blacklisters seem to think that all open networks like Tor should be boycotted. They don't understand how Tor works (e.g. that it has exit policies), and don't seem to care to understand it. If your server administrators decide to make use of these blacklists to refuse incoming mail, you should have a conversation with them and explain how Tor works.

    +

    Even though Tor isn't useful for spamming, some over-zealous blacklisters seem to think that all open networks like Tor should be boycotted. They don't understand how Tor works (e.g. that it has exit policies), and don't seem to care to understand it. If your server administrators decide to make use of these blacklists to refuse incoming mail, you should have a conversation with them and explain how Tor works.

    I want to ban the Tor network from my service.

    @@ -130,13 +132,13 @@

    First, ask yourself if there's a way to do application-level decisions to separate the legitimate users from the jerks. For example, you might have certain areas of the site, or certain privileges like posting, available only to people who are registered. You could set up this distinction only for certain IP addresses such as Tor exit nodes. This way you can have multi-tiered access and not have to ban everything.

    Second, consider that thousands of people use Tor every day to protect against data-gathering corporations like Doubleclick while going about their normal activities. Some Tor users may be legitimately connecting to your service right now to carry on normal activities. You need to decide whether banning the Tor network is worth losing the contributions of these users, as well as potential future such users.

    Lastly, please remember that Tor servers have individual exit policies. Many Tor servers do not allow exiting connections at all. Many of those that do, probably already disallow connections to your service. When you go about banning nodes, you should parse the exit policies and only block the ones that allow these connections; and you should keep in mind that exit policies can change (as well as the overall list of nodes in the network).

    -

    If you really want to do this, there is a python script to parse the Tor directory here.

    +

    If you really want to do this, there is a python script to parse the Tor directory here.

    I have legal questions about Tor abuse.

    We're only the developers. We can answer technical questions, but we're not the ones to talk to about legal questions or concerns.

    -

    Please take a look at the Tor Legal FAQ, and contact EFF directly if you have any further questions.

    +

    Please take a look at the Tor Legal FAQ, and contact EFF directly if you have any further questions.

    From phobos at seul.org Wed Jun 29 18:18:38 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 14:18:38 -0400 (EDT) Subject: [or-cvs] Added to do to replace the old tor manual with the new stab... Message-ID: <20050629181838.23644140806D@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv22745 Modified Files: volunteer.html Log Message: Added to do to replace the old tor manual with the new stable manual. Index: volunteer.html =================================================================== RCS file: /home/or/cvsroot/website/volunteer.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- volunteer.html 29 Jun 2005 18:16:36 -0000 1.3 +++ volunteer.html 29 Jun 2005 18:18:36 -0000 1.4 @@ -113,6 +113,7 @@
  • If you know the answer to a Wiki question in the "unanswered FAQs" list, please answer it. url?
  • Take a look at Martin's Squid and Tor page, and update it to reflect Tor's RedirectExit config option. url?
  • Update website to include the country flags for each language into which the website has been translated.
  • +
  • Replace the old tor-manual.html and replace it with the new tor stable manual.
  • Testing Challenges

    From arma at seul.org Wed Jun 29 18:31:32 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 14:31:32 -0400 (EDT) Subject: [or-cvs] add a few url"s to volunteer Message-ID: <20050629183132.CD8BD14080AB@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: volunteer.html Log Message: add a few url's to volunteer Index: volunteer.html =================================================================== RCS file: /home2/or/cvsroot/website/volunteer.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- volunteer.html 29 Jun 2005 18:18:36 -0000 1.4 +++ volunteer.html 29 Jun 2005 18:31:30 -0000 1.5 @@ -45,7 +45,7 @@
  • We especially need people with Windows programming skills to run an exit server on Windows, to help us debug.
  • Run a Tor hidden service and put interesting content on it.
  • Tell your friends! Get them to run servers. Get them to run hidden services. Get them to tell their friends.
  • -
  • Consider joining the Electronic Frontier Foundation. More EFF donations means more freedom in the world, including more Tor development.
  • +
  • Consider joining the Electronic Frontier Foundation. More EFF donations means more freedom in the world, including more Tor development.
  • Coding Challenges

    @@ -110,7 +110,9 @@
  • Help with documentation
  • Help consolidate documentation. We may have too much documentation. It's spread out too far and duplicates itself in places.
  • Help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
  • -
  • If you know the answer to a Wiki question in the "unanswered FAQs" list, please answer it. url?
  • +
  • If you know a question that should go on the FAQ Wiki, please +add it and answer it.
  • Take a look at Martin's Squid and Tor page, and update it to reflect Tor's RedirectExit config option. url?
  • Update website to include the country flags for each language into which the website has been translated.
  • Replace the old tor-manual.html and replace it with the new tor stable manual.
  • From phobos at seul.org Wed Jun 29 19:11:29 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 15:11:29 -0400 (EDT) Subject: [or-cvs] merged changes so far, still have more to go Message-ID: <20050629191129.3E7EE1400082@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv25267 Modified Files: volunteer.html Log Message: merged changes so far, still have more to go Index: volunteer.html =================================================================== RCS file: /home/or/cvsroot/website/volunteer.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- volunteer.html 29 Jun 2005 18:31:30 -0000 1.5 +++ volunteer.html 29 Jun 2005 19:11:27 -0000 1.6 @@ -41,9 +41,9 @@

    Six things everyone can do now:

    1. We need users like you to try Tor out, and let the Tor developers know about bugs you find or features you don't find.
    2. -
    3. Please consider running a server to help the Tor network grow.
    4. +
    5. Please consider running a server to help the Tor network grow.
    6. We especially need people with Windows programming skills to run an exit server on Windows, to help us debug.
    7. -
    8. Run a Tor hidden service and put interesting content on it.
    9. +
    10. Run a Tor hidden service and put interesting content on it.
    11. Tell your friends! Get them to run servers. Get them to run hidden services. Get them to tell their friends.
    12. Consider joining the Electronic Frontier Foundation. More EFF donations means more freedom in the world, including more Tor development.
    @@ -83,9 +83,9 @@
  • Implement a way to stop falling back to forbidden ports when FascistFirewall blocks all good dirservers, if there is already a good, cached directory locally.
  • Extend our NSIS-based windows installer to include FreeCap and/or Privoxy.
  • Develop a way to handle OS X installation and uninstallation.
  • -
  • Develop a GUI or other controller program, to do configuration, etc. See our control specification for details, and the rudimentary demonstration Python control script.
  • +
  • Develop a GUI or other controller program, to do configuration, etc. See our control specification for details, and the rudimentary demonstration Python control script.
    • -
    • Design an interface for the control program. You can use any license you want, but we'd recommend 3-clause BSD or maybe GPL; and we can only help out if your license conforms to the DFSG.
    • +
    • Design an interface for the control program. You can use any license you want, but we'd recommend 3-clause BSD or maybe GPL; and we can only help out if your license conforms to the DFSG.
    • Periodically people running servers tells us they want to have one BandwidthRate during some part of the day, and a different BandwidthRate at other parts of the day. Rather than coding this @@ -94,7 +94,7 @@ rate. Perhaps it would run out of cron, or perhaps it would sleep until appropriate times and then do its tweak (that's probably more portable). Can somebody write one for us and we'll put it inside - tor/contrib/?
    • + tor/contrib/?
  • Develop a way to become a Windows NT service.
  • Develop a systray app for Tor under MS Windows (all versions).
  • @@ -109,11 +109,16 @@
  • Help maintain this website; code, content, css, overall layout,
  • Help with documentation
  • Help consolidate documentation. We may have too much documentation. It's spread out too far and duplicates itself in places.
  • +
  • Help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
  • +
  • If you know the answer to a Wiki question in the "unanswered FAQs" list, please answer it.
  • +
  • Take a look at Martin's +Squid and Tor page, and update it to reflect Tor's RedirectExit config option.
  • Help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
  • If you know a question that should go on the FAQ Wiki, please add it and answer it.
  • -
  • Take a look at Martin's Squid and Tor page, and update it to reflect Tor's RedirectExit config option. url?
  • Update website to include the country flags for each language into which the website has been translated.
  • Replace the old tor-manual.html and replace it with the new tor stable manual.
  • @@ -131,8 +136,7 @@ browse hidden services. (This has been done a few times, but nobody has sent us code.)
  • Investigate privoxy vs. freecap for win32 clients
  • -
  • Evaluate, create, and document a list of programs that work with -Tor.
  • +
  • Evaluate, create, and document a list of programs that work with Tor.
  • Perform a security analysis of Tor with "fuzz". Determine if there good libraries out there for what we want. Win fame by getting credit when we put out a new release because of you!
  • From arma at seul.org Wed Jun 29 19:15:26 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 15:15:26 -0400 (EDT) Subject: [or-cvs] make the local and private network masks explicit when we c... Message-ID: <20050629191526.1C21F140805F@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: routerlist.c Log Message: make the local and private network masks explicit when we complain Index: routerlist.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v retrieving revision 1.240 retrieving revision 1.241 diff -u -d -r1.240 -r1.241 --- routerlist.c 20 Jun 2005 23:04:13 -0000 1.240 +++ routerlist.c 29 Jun 2005 19:15:23 -0000 1.241 @@ -1263,11 +1263,11 @@ static struct { uint32_t addr; uint32_t mask; const char *network; } private_networks[] = { - { 0x7f000000, 0xff000000, "localhost (127.x)" }, - { 0x0a000000, 0xff000000, "addresses in private network 10.x" }, - { 0xa9fe0000, 0xffff0000, "addresses in private network 169.254.x" }, - { 0xac100000, 0xfff00000, "addresses in private network 172.16.x" }, - { 0xc0a80000, 0xffff0000, "addresses in private network 192.168.x" }, + { 0x7f000000, 0xff000000, "localhost (127.0.0.0/8)" }, + { 0x0a000000, 0xff000000, "addresses in private network 10.0.0.0/8" }, + { 0xa9fe0000, 0xffff0000, "addresses in private network 169.254.0.0/16" }, + { 0xac100000, 0xfff00000, "addresses in private network 172.16.0.0/12" }, + { 0xc0a80000, 0xffff0000, "addresses in private network 192.168.0.0/16" }, { 0,0,NULL}, }; for (i=0; private_networks[i].addr; ++i) { From phobos at seul.org Wed Jun 29 19:23:27 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 29 Jun 2005 15:23:27 -0400 (EDT) Subject: [or-cvs] inserted all missing urls into volunteer Message-ID: <20050629192327.A90391408060@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv25811 Modified Files: volunteer.html Log Message: inserted all missing urls into volunteer Index: volunteer.html =================================================================== RCS file: /home/or/cvsroot/website/volunteer.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- volunteer.html 29 Jun 2005 19:11:27 -0000 1.6 +++ volunteer.html 29 Jun 2005 19:23:25 -0000 1.7 @@ -137,12 +137,8 @@ sent us code.)
  • Investigate privoxy vs. freecap for win32 clients
  • Evaluate, create, and document a list of programs that work with Tor.
  • -
  • Perform a security analysis of Tor with "fuzz". Determine if there -good libraries out there for what we want. Win fame by getting credit -when we put out a new release because of you!
  • -
  • Website volume fingerprinting attacks (Back et al, Hintz). Defenses -include a large cell size, defensive dropping, etc. How well does each -approach work?
  • +
  • Perform a security analysis of Tor with fuzz"fuzz". Determine if there good libraries out there for what we want. Win fame by getting credit when we put out a new release because of you!
  • +
  • Website volume fingerprinting attacks (Back et al, Hintz). Defenses include a large cell size, defensive dropping, etc. How well does each approach work?
  • The end-to-end traffic confirmation attack. We need to study long-range dummies more, along with traffic shaping. How much traffic of what sort of distribution is needed before the adversary is confident he @@ -226,8 +222,9 @@ pseudonyms in practice (say, in case you frequently go to two websites and if anybody knew about both of them they would conclude it's you), we don't support that well yet. We should find a good approach and -interface for handling pseudonymous profiles in Tor. See this post and -followup for details.
  • +interface for handling pseudonymous profiles in Tor. See this +post and followup for details.
  • Congestion control. Is our current design sufficient once we have heavy use? Need to measure and tweak, or maybe overhaul.
  • From arma at seul.org Wed Jun 29 20:10:54 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 16:10:54 -0400 (EDT) Subject: [or-cvs] a changelog for 0.1.1.1-alpha Message-ID: <20050629201054.5027214080C2@moria.seul.org> Update of /home2/or/cvsroot/tor In directory moria:/home/arma/work/onion/cvs/tor Modified Files: ChangeLog Log Message: a changelog for 0.1.1.1-alpha Index: ChangeLog =================================================================== RCS file: /home2/or/cvsroot/tor/ChangeLog,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- ChangeLog 13 Jun 2005 01:29:57 -0000 1.96 +++ ChangeLog 29 Jun 2005 20:10:51 -0000 1.97 @@ -1,4 +1,27 @@ -Changes in version 0.1.0.10 (first stable release of 0.1.0.x) +Changes in version 0.1.1.1-alpha - 2005-06-29 + o Bugfixes: + - Make OSX init script check for missing argument, so we don't + confuse users who invoke it incorrectly. + - Fix a seg fault in "tor --hash-password foo" + - Fix a possible way to DoS dirservers. + - When we complain that your exit policy implicitly allows local or + private address spaces, name them explicitly so operators can + fix it. + - Make the log message less scary when all the dirservers are + temporarily unreachable + - We were printing the number of idle dns workers incorrectly when + culling them. + + o Features: + - Revised controller protocol (version 1) that uses ascii rather + than binary. Add supporting libraries in python and java so you + can use the controller from your applications without caring how + our protocol works. + - Spiffy new support for crypto hardware accelerators. Can somebody + test this? + + +Changes in version 0.1.0.10 - 2005-06-14 o Fixes on Win32: - Make NT services work and start on startup on Win32 (based on patch by Matt Edman). See the FAQ entry for details. From arma at seul.org Wed Jun 29 20:23:56 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 16:23:56 -0400 (EDT) Subject: [or-cvs] mention the new release on the download page Message-ID: <20050629202356.62E751408056@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv29984 Modified Files: download.html Log Message: mention the new release on the download page Index: download.html =================================================================== RCS file: /home/or/cvsroot/website/download.html,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- download.html 29 Jun 2005 18:16:36 -0000 1.111 +++ download.html 29 Jun 2005 20:23:54 -0000 1.112 @@ -46,27 +46,39 @@ under the 3-clause BSD license.

    You can get the latest release from the download -directory. The latest stable release is 0.1.0.10. +directory. +The latest stable release is 0.1.0.10, and the +latest development release is 0.1.1.1-alpha. Tor should run on Linux, BSD, OS X, Windows, Solaris, and more.

    • Windows installer: 0.1.0.10 (sig) +href="dist/win32/tor-0.1.0.10-win32.exe.asc">sig), +0.1.1.1-alpha (sig) Be sure to read the Win32-specific instructions.
    • Mac OS X installer: 0.1.0.10 (sig) +href="dist/osx/Tor 0.1.0.10 Bundle.dmg.asc">sig), +0.1.1.1-alpha (sig) Be sure to read the OS X specific instructions.
    • Red Hat Linux package: 0.1.0.10 RPM (sig), 0.1.0.10 SRPM (sig) +href="dist/rpm/tor-0.1.0.10-tor.0.fc1.src.rpm">sig), +0.1.1.1-alpha RPM (sig), +0.1.1.1-alpha SRPM (sig)
    • -
    • Latest stable source: 0.1.0.10 -(sig). +
    • Latest source tarballs: 0.1.0.10 +(sig), +0.1.1.1-alpha +(sig). You will need libevent. If you are brave enough to try building from source on Windows, you'll need libevent 1.0c or later.
    • @@ -185,6 +197,16 @@
      +

      Testing releases

      + +

      2005-06-28: +Tor 0.1.1.1-alpha has a revised +controller protocol (version 1) that uses ascii rather than binary. +

      + +
      +

      Stable releases

      2005-06-12: From arma at seul.org Wed Jun 29 20:53:04 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 16:53:04 -0400 (EDT) Subject: [or-cvs] i screwed up the rpm urls Message-ID: <20050629205304.847B11408061@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv31078 Modified Files: download.html Log Message: i screwed up the rpm urls Index: download.html =================================================================== RCS file: /home/or/cvsroot/website/download.html,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -r1.112 -r1.113 --- download.html 29 Jun 2005 20:23:54 -0000 1.112 +++ download.html 29 Jun 2005 20:53:02 -0000 1.113 @@ -70,10 +70,10 @@ href="dist/rpm/tor-0.1.0.10-tor.0.fc1.i386.rpm.asc">sig), 0.1.0.10 SRPM (sig), -0.1.1.1-alpha RPM (sig), -0.1.1.1-alpha SRPM (sig) +0.1.1.1-alpha RPM (sig), +0.1.1.1-alpha SRPM (sig)

    • Latest source tarballs: 0.1.0.10 (sig), From arma at seul.org Wed Jun 29 20:58:05 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 16:58:05 -0400 (EDT) Subject: [or-cvs] some punctuation couldn"t hurt Message-ID: <20050629205805.A97E61408061@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv31552 Modified Files: download.html Log Message: some punctuation couldn't hurt remove obsolete version announcements mention 0.0.9.10 Index: download.html =================================================================== RCS file: /home/or/cvsroot/website/download.html,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- download.html 29 Jun 2005 20:53:02 -0000 1.113 +++ download.html 29 Jun 2005 20:58:03 -0000 1.114 @@ -55,14 +55,14 @@ 0.1.0.10 (sig), 0.1.1.1-alpha (sig) +href="dist/win32/tor-0.1.1.1-alpha-win32.exe.asc">sig). Be sure to read the Win32-specific instructions.
    • Mac OS X installer: 0.1.0.10 (sig), 0.1.1.1-alpha (sig) +href="dist/osx/Tor 0.1.1.1-alpha Bundle.dmg.asc">sig). Be sure to read the OS X specific instructions.
    • Red Hat Linux package: @@ -221,72 +221,10 @@

      2005-04-23: -Tor 0.0.9.9 has a fix -for an assert trigger that happens when servers get weird TLS certs -from clients. -

      - -

      2005-04-07: -Tor 0.0.9.8 has a workaround -for a rare bug (reported by Alex de Joode) that makes servers stop -processing new circuits. -

      - -

      2005-04-01: -Tor 0.0.9.7 fixes another -server race crash bug, and also fixes a bug where we would refuse to -extend to an unknown server. -

      - -

      2005-03-24: -Tor 0.0.9.6 fixes yet -more server stability problems. -

      - -

      2005-02-22: -Tor 0.0.9.5 fixes an -assert race at exit nodes when resolve requests fail, and cleans up -a few other bugs. -

      - -

      2005-02-03: -Tor 0.0.9.4 fixes a -server bug that took down most of the network. It also makes us more -robust to running out of file descriptors. -

      - -

      2005-01-21: -Tor 0.0.9.3 improves cpu -usage, works better when the network was offline and you try to use Tor, -and makes hidden services less unbearable. -

      - -

      2005-01-04: -Tor 0.0.9.2 fixes many -more bugs. -

      - -

      2004-12-16: -Tor 0.0.9.1 fixes a -few minor bugs in 0.0.9. -

      - -

      2004-12-12: -Tor 0.0.9 adds a -win32 installer, better -circuit building algorithms, bandwidth accounting and hibernation, -more efficient directory fetching, and support for a separate Tor GUI -controller program (once somebody writes one). +Tor 0.0.9.10 has backports for some important security bugs. It +is available +for people who can't upgrade to Tor 0.1.0.x yet.


      From arma at seul.org Wed Jun 29 21:16:36 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 17:16:36 -0400 (EDT) Subject: [or-cvs] make the debian instructions not take up half the download ... Message-ID: <20050629211636.AE42514080C9@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: download.html Log Message: make the debian instructions not take up half the download page. Index: download.html =================================================================== RCS file: /home2/or/cvsroot/website/download.html,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- download.html 29 Jun 2005 20:58:03 -0000 1.114 +++ download.html 29 Jun 2005 21:16:34 -0000 1.115 @@ -100,71 +100,7 @@
      -

      Debian packages have been uploaded to the set of official unstable -(sid) and testing (etch) Debian packages. -If you are running stable (sarge) or oldstable (woody), you must first add -these lines to /etc/apt/sources.list:

      - -
        -
      • for sarge (stable):

        -

        -deb http://mirror.noreply.org/pub/tor sarge main
        -deb-src http://mirror.noreply.org/pub/tor sarge main -

      • -
      • or for woody (oldstable):

        -

        -deb http://mirror.noreply.org/pub/tor woody main
        -deb-src http://mirror.noreply.org/pub/tor woody main -

      • -
      - -

      To install the packages, issue the following commands:

      - -

      -$ apt-get update
      -$ apt-get install tor -

      - -

      Packages for the development version of Tor are available as well. To install these, -add the following lines to /etc/apt/sources.list:

      - -
        -
      • For sid use

        -

        -deb http://mirror.noreply.org/pub/tor experimental main
        -deb-src http://mirror.noreply.org/pub/tor experimental main -

      • -
      • or for sarge (stable) there is

        -

        -deb http://mirror.noreply.org/pub/tor experimental-sarge main
        -deb-src http://mirror.noreply.org/pub/tor experimental-sarge main -

      • -
      • and in case you still run woody (oldstable) add those two lines:

        -

        -deb http://mirror.noreply.org/pub/tor experimental-woody main
        -deb-src http://mirror.noreply.org/pub/tor experimental-woody main -

      • -
      - -

      Then issue the following commands:

      - -

      -$ apt-get update
      -$ apt-get install -t experimental tor -

      -

      or just

      -

      -$ apt-get update
      -$ apt-get install tor -

      -

      depending on which of those lines you added.

      - -

      Packages for architectures other than i386 can be built from the sources -above quite easily. Pester weasel if he -hasn't documented it yet.

      -

      -A guide to chrooting is available in the Wiki.

      -
      +

      Debian packages: apt-get install tor (guide for Sarge and experimental Tor versions)

      FreeBSD: portinstall -s security/tor

      From thomass at seul.org Tue Jun 7 11:35:40 2005 From: thomass at seul.org (thomass at seul.org) Date: Tue, 7 Jun 2005 07:35:40 -0400 (EDT) Subject: [or-cvs] faq-abuse.html - Small menu fix Message-ID: <20050607113540.CA8991408278@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv1310 Modified Files: faq-abuse.html Log Message: faq-abuse.html - Small menu fix Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- faq-abuse.html 7 Jun 2005 02:41:06 -0000 1.3 +++ faq-abuse.html 7 Jun 2005 11:35:38 -0000 1.4 @@ -22,7 +22,7 @@ | Download | Docs | Users - | FAQs + | FAQs | Contribute | Developers | Research From arma at seul.org Wed Jun 29 21:25:36 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 17:25:36 -0400 (EDT) Subject: [or-cvs] tweak the changelog Message-ID: <20050629212536.AB806140805B@moria.seul.org> Update of /home2/or/cvsroot/tor In directory moria:/home/arma/work/onion/cvs/tor Modified Files: ChangeLog Log Message: tweak the changelog Index: ChangeLog =================================================================== RCS file: /home2/or/cvsroot/tor/ChangeLog,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- ChangeLog 29 Jun 2005 20:10:51 -0000 1.97 +++ ChangeLog 29 Jun 2005 21:25:34 -0000 1.98 @@ -1,14 +1,14 @@ Changes in version 0.1.1.1-alpha - 2005-06-29 o Bugfixes: - - Make OSX init script check for missing argument, so we don't + - Make OS X init script check for missing argument, so we don't confuse users who invoke it incorrectly. - - Fix a seg fault in "tor --hash-password foo" + - Fix a seg fault in "tor --hash-password foo". - Fix a possible way to DoS dirservers. - When we complain that your exit policy implicitly allows local or private address spaces, name them explicitly so operators can fix it. - Make the log message less scary when all the dirservers are - temporarily unreachable + temporarily unreachable. - We were printing the number of idle dns workers incorrectly when culling them. From arma at seul.org Wed Jun 29 21:29:06 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 17:29:06 -0400 (EDT) Subject: [or-cvs] point url correctly Message-ID: <20050629212906.EED081408095@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: download.html Log Message: point url correctly Index: download.html =================================================================== RCS file: /home2/or/cvsroot/website/download.html,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- download.html 29 Jun 2005 21:16:34 -0000 1.115 +++ download.html 29 Jun 2005 21:29:04 -0000 1.116 @@ -137,7 +137,7 @@

      2005-06-28: Tor 0.1.1.1-alpha has a revised +href="http://archives.seul.org/or/talk/Jun-2005/msg00252.html">revised controller protocol (version 1) that uses ascii rather than binary.

      From nickm at seul.org Wed Jun 29 21:46:19 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 29 Jun 2005 17:46:19 -0400 (EDT) Subject: [or-cvs] Bump version to 0.1.1.1-alpha-cvs Message-ID: <20050629214619.A437A1408107@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/tmp/cvs-serv2666 Modified Files: configure.in Log Message: Bump version to 0.1.1.1-alpha-cvs Index: configure.in =================================================================== RCS file: /home/or/cvsroot/tor/configure.in,v retrieving revision 1.217 retrieving revision 1.218 diff -u -d -r1.217 -r1.218 --- configure.in 27 Jun 2005 18:35:10 -0000 1.217 +++ configure.in 29 Jun 2005 21:46:17 -0000 1.218 @@ -4,7 +4,7 @@ dnl See LICENSE for licensing information AC_INIT -AM_INIT_AUTOMAKE(tor, 0.1.1.1-alpha) +AM_INIT_AUTOMAKE(tor, 0.1.1.1-alpha-cvs) AM_CONFIG_HEADER(orconfig.h) AC_CANONICAL_HOST From nickm at seul.org Wed Jun 29 21:46:19 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 29 Jun 2005 17:46:19 -0400 (EDT) Subject: [or-cvs] Bump version to 0.1.1.1-alpha-cvs Message-ID: <20050629214619.C97311408118@moria.seul.org> Update of /home/or/cvsroot/tor/contrib In directory moria:/tmp/cvs-serv2666/contrib Modified Files: tor.nsi Log Message: Bump version to 0.1.1.1-alpha-cvs Index: tor.nsi =================================================================== RCS file: /home/or/cvsroot/tor/contrib/tor.nsi,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- tor.nsi 27 Jun 2005 18:35:10 -0000 1.43 +++ tor.nsi 29 Jun 2005 21:46:17 -0000 1.44 @@ -31,7 +31,7 @@ !include "MUI.nsh" -!define VERSION "0.1.1.1-alpha" +!define VERSION "0.1.1.1-alpha-cvs" !define INSTALLER "tor-${VERSION}-win32.exe" !define WEBSITE "http://tor.eff.org/" From nickm at seul.org Wed Jun 29 21:46:19 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 29 Jun 2005 17:46:19 -0400 (EDT) Subject: [or-cvs] Bump version to 0.1.1.1-alpha-cvs Message-ID: <20050629214619.C33531408109@moria.seul.org> Update of /home/or/cvsroot/tor/src/win32 In directory moria:/tmp/cvs-serv2666/src/win32 Modified Files: orconfig.h Log Message: Bump version to 0.1.1.1-alpha-cvs Index: orconfig.h =================================================================== RCS file: /home/or/cvsroot/tor/src/win32/orconfig.h,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- orconfig.h 27 Jun 2005 18:35:10 -0000 1.62 +++ orconfig.h 29 Jun 2005 21:46:17 -0000 1.63 @@ -215,4 +215,4 @@ #define HAVE_EVENT_H /* Version number of package */ -#define VERSION "0.1.1.1-alpha" +#define VERSION "0.1.1.1-alpha-cvs" From nickm at seul.org Wed Jun 29 21:46:57 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 29 Jun 2005 17:46:57 -0400 (EDT) Subject: [or-cvs] Logic to implement rendezvous/introduction via unknown serv... Message-ID: <20050629214657.7592B1408108@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv2828/src/or Modified Files: circuitbuild.c circuitlist.c circuituse.c connection_edge.c control.c directory.c onion.c or.h relay.c rendclient.c rendcommon.c rendservice.c test.c Log Message: Logic to implement rendezvous/introduction via unknown servers. - Add a new extend_info_t datatype to hold information needed to extend a circuit (addr,port,keyid,onion_key). Use it in cpath and build_state. Make appropriate functions take or return it instead of routerinfo_t or keyid. - #if 0 needless check in circuit_get_by_edge_conn; if nobody triggers this error in 0.1.0.10, nobody will trigger it. - Implement new hidden service descriptor format, which contains "extend info" for introduction points, along with protocol version list. - Parse new format. - Generate new format - Cache old and new formats alongside each other. - Directories serve "old" format if asked in old way, "newest available" format if asked in new way. - Use new format to find introduction points if possible; otherwise fall back. Keep nickname lists and extendinfo lists in sync. - Tests for new format. - Implement new "v2" INTRODUCE cell format. - Accept new format - Use new format if we have a versioned service descriptor that says the server accepts the new format. - Add documentation for functions and data types. Index: circuitbuild.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuitbuild.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -d -r1.120 -r1.121 --- circuitbuild.c 15 Jun 2005 18:34:46 -0000 1.120 +++ circuitbuild.c 29 Jun 2005 21:46:55 -0000 1.121 @@ -21,13 +21,12 @@ static int circuit_deliver_create_cell(circuit_t *circ, uint8_t cell_type, char *payload); -static int onion_pick_cpath_exit(circuit_t *circ, routerinfo_t *exit); +static int onion_pick_cpath_exit(circuit_t *circ, extend_info_t *exit); static crypt_path_t *onion_next_hop_in_cpath(crypt_path_t *cpath); -static int onion_next_router_in_cpath(circuit_t *circ, routerinfo_t **router); static int onion_extend_cpath(uint8_t purpose, crypt_path_t **head_ptr, cpath_build_state_t *state); static int count_acceptable_routers(smartlist_t *routers); -static int onion_append_hop(crypt_path_t **head_ptr, routerinfo_t *choice); +static int onion_append_hop(crypt_path_t **head_ptr, extend_info_t *choice); /** Iterate over values of circ_id, starting from conn-\>next_circ_id, * and with the high bit specified by circ_id_type (see @@ -85,31 +84,25 @@ elements = smartlist_create(); if (verbose) { + const char *nickname = build_state_get_exit_nickname(circ->build_state); tor_snprintf(buf, sizeof(buf)-1, "%s%s circ (length %d, exit %s):", circ->build_state->is_internal ? "internal" : "exit", circ->build_state->need_uptime ? " (high-uptime)" : "", circ->build_state->desired_path_len, - circ->build_state->chosen_exit_name); + nickname?nickname:"unnamed"); smartlist_add(elements, tor_strdup(buf)); } hop = circ->cpath; do { const char *elt; - routerinfo_t *r; if (!hop) break; if (!verbose && hop->state != CPATH_STATE_OPEN) break; - if ((r = router_get_by_digest(hop->identity_digest))) { - elt = r->nickname; - } else if (circ->purpose == CIRCUIT_PURPOSE_C_REND_JOINED) { - elt = ""; - } else { - buf[0]='$'; - base16_encode(buf+1,sizeof(buf)-1,hop->identity_digest,DIGEST_LEN); - elt = buf; - } + if (!hop->extend_info) + break; + elt = hop->extend_info->nickname; if (verbose) { size_t len = strlen(elt)+2+strlen(states[hop->state])+1; char *v = tor_malloc(len); @@ -166,7 +159,7 @@ prev_digest = me->identity_digest; } do { - router = router_get_by_digest(hop->identity_digest); + router = router_get_by_digest(hop->extend_info->identity_digest); if (router) { if (prev_digest) { if (hop->state == CPATH_STATE_OPEN) @@ -272,7 +265,7 @@ return circ; } -/** Build a new circuit for purpose. If exit +/** Build a new circuit for purpose. If info/b> * is defined, then use that as your exit router, else choose a suitable * exit node. * @@ -280,14 +273,14 @@ * it's not open already. */ circuit_t * -circuit_establish_circuit(uint8_t purpose, routerinfo_t *exit, +circuit_establish_circuit(uint8_t purpose, extend_info_t *info, int need_uptime, int need_capacity, int internal) { circuit_t *circ; circ = circuit_init(purpose, need_uptime, need_capacity, internal); - if (onion_pick_cpath_exit(circ, exit) < 0 || + if (onion_pick_cpath_exit(circ, info) < 0 || onion_populate_cpath(circ) < 0) { circuit_mark_for_close(circ); return NULL; @@ -309,26 +302,32 @@ int circuit_handle_first_hop(circuit_t *circ) { - routerinfo_t *firsthop; + crypt_path_t *firsthop; connection_t *n_conn; + char tmpbuf[INET_NTOA_BUF_LEN+1]; + struct in_addr in; - onion_next_router_in_cpath(circ, &firsthop); + firsthop = onion_next_hop_in_cpath(circ->cpath); tor_assert(firsthop); /* now see if we're already connected to the first OR in 'route' */ - log_fn(LOG_DEBUG,"Looking for firsthop '%s:%u'", - firsthop->address,firsthop->or_port); + in.s_addr = htonl(firsthop->extend_info->addr); + tor_inet_ntoa(&in, tmpbuf, sizeof(tmpbuf)); + log_fn(LOG_DEBUG,"Looking for firsthop '%s:%u'",tmpbuf, + firsthop->extend_info->port); /* imprint the circuit with its future n_conn->id */ - memcpy(circ->n_conn_id_digest, firsthop->identity_digest, DIGEST_LEN); - n_conn = connection_get_by_identity_digest(firsthop->identity_digest, - CONN_TYPE_OR); + memcpy(circ->n_conn_id_digest, firsthop->extend_info->identity_digest, + DIGEST_LEN); + n_conn = connection_get_by_identity_digest( + firsthop->extend_info->identity_digest, CONN_TYPE_OR); if (!n_conn || n_conn->state != OR_CONN_STATE_OPEN) { /* not currently connected */ - circ->n_addr = firsthop->addr; - circ->n_port = firsthop->or_port; + circ->n_addr = firsthop->extend_info->addr; + circ->n_port = firsthop->extend_info->port; if (!n_conn) { /* launch the connection */ - n_conn = connection_or_connect(firsthop->addr, firsthop->or_port, - firsthop->identity_digest); + n_conn = connection_or_connect(firsthop->extend_info->addr, + firsthop->extend_info->port, + firsthop->extend_info->identity_digest); if (!n_conn) { /* connect failed, forget the whole thing */ log_fn(LOG_INFO,"connect to firsthop failed. Closing."); return -1; @@ -452,7 +451,6 @@ { crypt_path_t *hop; routerinfo_t *router; - int r; char payload[2+4+DIGEST_LEN+ONIONSKIN_CHALLENGE_LEN]; char *onionskin; size_t payload_len; @@ -465,20 +463,15 @@ log_fn(LOG_DEBUG,"First skin; sending create cell."); router = router_get_by_digest(circ->n_conn->identity_digest); - if (!router) { - log_fn(LOG_WARN,"Couldn't find routerinfo for %s", - circ->n_conn->nickname); - return -1; - } if (1 || /* Disable this '1' once we believe CREATE_FAST works. XXXX */ - (get_options()->ORPort || !router->platform || + (get_options()->ORPort || !router || !router->platform || !tor_version_as_new_as(router->platform, "0.1.0.6-rc"))) { /* We are an OR, or we are connecting to an old Tor: we should * send an old slow create cell. */ cell_type = CELL_CREATE; - if (onion_skin_create(router->onion_pkey, + if (onion_skin_create(circ->cpath->extend_info->onion_key, &(circ->cpath->dh_handshake_state), payload) < 0) { log_fn(LOG_WARN,"onion_skin_create (first hop) failed."); @@ -505,8 +498,8 @@ tor_assert(circ->cpath->state == CPATH_STATE_OPEN); tor_assert(circ->state == CIRCUIT_STATE_BUILDING); log_fn(LOG_DEBUG,"starting to send subsequent skin."); - r = onion_next_router_in_cpath(circ, &router); - if (r > 0) { + hop = onion_next_hop_in_cpath(circ->cpath); + if (!hop) { /* done building the circuit. whew. */ circ->state = CIRCUIT_STATE_OPEN; log_fn(LOG_INFO,"circuit built!"); @@ -524,19 +517,17 @@ circuit_rep_hist_note_result(circ); circuit_has_opened(circ); /* do other actions as necessary */ return 0; - } else if (r < 0) { - return -1; } - hop = onion_next_hop_in_cpath(circ->cpath); - *(uint32_t*)payload = htonl(hop->addr); - *(uint16_t*)(payload+4) = htons(hop->port); + *(uint32_t*)payload = htonl(hop->extend_info->addr); + *(uint16_t*)(payload+4) = htons(hop->extend_info->port); onionskin = payload+2+4; - memcpy(payload+2+4+ONIONSKIN_CHALLENGE_LEN, hop->identity_digest, DIGEST_LEN); + memcpy(payload+2+4+ONIONSKIN_CHALLENGE_LEN, hop->extend_info->identity_digest, DIGEST_LEN); payload_len = 2+4+ONIONSKIN_CHALLENGE_LEN+DIGEST_LEN; - if (onion_skin_create(router->onion_pkey, &(hop->dh_handshake_state), onionskin) < 0) { + if (onion_skin_create(hop->extend_info->onion_key, + &(hop->dh_handshake_state), onionskin) < 0) { log_fn(LOG_WARN,"onion_skin_create failed."); return -1; } @@ -1218,10 +1209,9 @@ * router (or use exit if provided). Store these in the * cpath. Return 0 if ok, -1 if circuit should be closed. */ static int -onion_pick_cpath_exit(circuit_t *circ, routerinfo_t *exit) +onion_pick_cpath_exit(circuit_t *circ, extend_info_t *exit) { cpath_build_state_t *state = circ->build_state; - routerlist_t *rl; int r; @@ -1237,16 +1227,17 @@ if (exit) { /* the circuit-builder pre-requested one */ log_fn(LOG_INFO,"Using requested exit node '%s'", exit->nickname); + exit = extend_info_dup(exit); } else { /* we have to decide one */ - exit = choose_good_exit_server(circ->purpose, rl, + routerinfo_t *router = choose_good_exit_server(circ->purpose, rl, state->need_uptime, state->need_capacity); - if (!exit) { + if (!router) { log_fn(LOG_WARN,"failed to choose an exit server"); return -1; } + exit = extend_info_from_router(router); } - memcpy(state->chosen_exit_digest, exit->identity_digest, DIGEST_LEN); - state->chosen_exit_name = tor_strdup(exit->nickname); + state->chosen_exit = exit; return 0; } @@ -1255,30 +1246,32 @@ * the caller will do this if it wants to. */ int -circuit_append_new_exit(circuit_t *circ, routerinfo_t *exit) +circuit_append_new_exit(circuit_t *circ, extend_info_t *info) { - tor_assert(exit); + cpath_build_state_t *state; + tor_assert(info); tor_assert(circ && CIRCUIT_IS_ORIGIN(circ)); - tor_free(circ->build_state->chosen_exit_name); - circ->build_state->chosen_exit_name = tor_strdup(exit->nickname); - memcpy(circ->build_state->chosen_exit_digest, exit->identity_digest, DIGEST_LEN); + + state = circ->build_state; + tor_assert(state); + if (state->chosen_exit) + extend_info_free(state->chosen_exit); + state->chosen_exit = extend_info_dup(info); + ++circ->build_state->desired_path_len; - onion_append_hop(&circ->cpath, exit); + onion_append_hop(&circ->cpath, info); return 0; } -/** Take the open circ originating here, give it a new exit destination - * to exit, and get it to send the next extend cell. If you can't - * send the extend cell, mark the circuit for close and return -1, else - * return 0. */ +/** DOCDOC */ int -circuit_extend_to_new_exit(circuit_t *circ, routerinfo_t *exit) +circuit_extend_to_new_exit(circuit_t *circ, extend_info_t *info) { - circuit_append_new_exit(circ, exit); + circuit_append_new_exit(circ, info); circ->state = CIRCUIT_STATE_BUILDING; if (circuit_send_next_onion_skin(circ)<0) { log_fn(LOG_WARN, "Couldn't extend circuit to new point '%s'.", - circ->build_state->chosen_exit_name); + info->nickname); circuit_mark_for_close(circ); return -1; } @@ -1350,7 +1343,7 @@ log_fn(LOG_DEBUG, "Contemplating intermediate hop: random choice."); excluded = smartlist_create(); - if ((r = router_get_by_digest(state->chosen_exit_digest))) { + if ((r = build_state_get_exit_router(state))) { smartlist_add(excluded, r); routerlist_add_family(excluded, r); } @@ -1359,7 +1352,7 @@ routerlist_add_family(excluded, r); } for (i = 0, cpath = head; i < cur_len; ++i, cpath=cpath->next) { - if ((r = router_get_by_digest(cpath->identity_digest))) { + if ((r = router_get_by_digest(cpath->extend_info->identity_digest))) { smartlist_add(excluded, r); routerlist_add_family(excluded, r); } @@ -1379,7 +1372,7 @@ smartlist_t *excluded = smartlist_create(); or_options_t *options = get_options(); - if ((r = router_get_by_digest(state->chosen_exit_digest))) { + if ((r = build_state_get_exit_router(state))) { smartlist_add(excluded, r); routerlist_add_family(excluded, r); } @@ -1424,27 +1417,6 @@ return NULL; } -/** Find the router corresponding to the first non-open hop in - * circ->cpath. Make sure it's state closed. Return 1 if all - * hops are open (the circuit is complete), 0 if we find a router - * (and set it to *router), and -1 if we fail to lookup the router. - */ -static int -onion_next_router_in_cpath(circuit_t *circ, routerinfo_t **router) { - routerinfo_t *r; - crypt_path_t *hop = onion_next_hop_in_cpath(circ->cpath); - if (!hop) /* all hops are open */ - return 1; - tor_assert(hop->state == CPATH_STATE_CLOSED); - r = router_get_by_digest(hop->identity_digest); - if (!r) { - log_fn(LOG_WARN,"Circuit intended to extend to a hop whose routerinfo we've lost. Cancelling circuit."); - return -1; - } - *router = r; - return 0; -} - /** Choose a suitable next hop in the cpath head_ptr, * based on state. Append the hop info to head_ptr. */ @@ -1454,7 +1426,7 @@ { int cur_len; crypt_path_t *cpath; - routerinfo_t *choice; + extend_info_t *info = NULL; smartlist_t *excludednodes; tor_assert(head_ptr); @@ -1481,23 +1453,29 @@ add_nickname_list_to_smartlist(excludednodes,get_options()->ExcludeNodes,0); if (cur_len == state->desired_path_len - 1) { /* Picking last node */ - choice = router_get_by_digest(state->chosen_exit_digest); + info = extend_info_dup(state->chosen_exit); } else if (cur_len == 0) { /* picking first node */ - choice = choose_good_entry_server(state); + routerinfo_t *r = choose_good_entry_server(state); + if (r) + info = extend_info_from_router(r); } else { - choice = choose_good_middle_server(purpose, state, *head_ptr, cur_len); + routerinfo_t *r = + choose_good_middle_server(purpose, state, *head_ptr, cur_len); + if (r) + info = extend_info_from_router(r); } smartlist_free(excludednodes); - if (!choice) { + if (!info) { log_fn(LOG_WARN,"Failed to find node for hop %d of our path. Discarding this circuit.", cur_len); return -1; } log_fn(LOG_DEBUG,"Chose router %s for hop %d (exit is %s)", - choice->nickname, cur_len+1, state->chosen_exit_name); + info->nickname, cur_len+1, build_state_get_exit_nickname(state)); - onion_append_hop(head_ptr, choice); + onion_append_hop(head_ptr, info); + extend_info_free(info); return 0; } @@ -1505,7 +1483,7 @@ * corresponding router choice, and append it to the * end of the cpath head_ptr. */ static int -onion_append_hop(crypt_path_t **head_ptr, routerinfo_t *choice) +onion_append_hop(crypt_path_t **head_ptr, extend_info_t *choice) { crypt_path_t *hop = tor_malloc_zero(sizeof(crypt_path_t)); @@ -1515,9 +1493,7 @@ hop->magic = CRYPT_PATH_MAGIC; hop->state = CPATH_STATE_CLOSED; - hop->port = choice->or_port; - hop->addr = choice->addr; - memcpy(hop->identity_digest, choice->identity_digest, DIGEST_LEN); + hop->extend_info = extend_info_dup(choice); hop->package_window = CIRCWINDOW_START; hop->deliver_window = CIRCWINDOW_START; @@ -1525,3 +1501,67 @@ return 0; } +/** Allocate and return a new extend_info_t that can be used to build a + * circuit to or through the router r. */ +extend_info_t * +extend_info_from_router(routerinfo_t *r) +{ + extend_info_t *info; + tor_assert(r); + info = tor_malloc_zero(sizeof(extend_info_t)); + strlcpy(info->nickname, r->nickname, sizeof(info->nickname)); + memcpy(info->identity_digest, r->identity_digest, DIGEST_LEN); + info->onion_key = crypto_pk_dup_key(r->onion_pkey); + info->addr = r->addr; + info->port = r->or_port; + return info; +} + +/** Release storage held by an extend_info_t struct. */ +void +extend_info_free(extend_info_t *info) +{ + tor_assert(info); + crypto_free_pk_env(info->onion_key); + tor_free(info); +} + +/** Allocate and return a new extend_info_t with the same contents as + * info. */ +extend_info_t * +extend_info_dup(extend_info_t *info) +{ + extend_info_t *newinfo; + tor_assert(info); + newinfo = tor_malloc(sizeof(extend_info_t)); + memcpy(newinfo, info, sizeof(extend_info_t)); + newinfo->onion_key = crypto_pk_dup_key(info->onion_key); + return newinfo; +} + +/** + * Return the routerinfo_t for the chosen exit router in state. If + * there is no chosen exit, or if we don't know the routerinfo_t for the + * chosen exit, return NULL. + */ +routerinfo_t * +build_state_get_exit_router(cpath_build_state_t *state) +{ + if (!state || !state->chosen_exit) + return NULL; + return router_get_by_digest(state->chosen_exit->identity_digest); +} + +/** + * Return the nickname for the chosen exit router in state. If + * there is no chosen exit, or if we don't know the routerinfo_t for the + * chosen exit, return NULL. + */ +const char * +build_state_get_exit_nickname(cpath_build_state_t *state) +{ + if (!state || !state->chosen_exit) + return NULL; + return state->chosen_exit->nickname; +} + Index: circuitlist.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuitlist.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- circuitlist.c 19 Jun 2005 20:40:41 -0000 1.51 +++ circuitlist.c 29 Jun 2005 21:46:55 -0000 1.52 @@ -24,7 +24,8 @@ /********* END VARIABLES ************/ -/** DOCDOC This whole section */ +/** A map from OR connection and circuit ID to circuit. (Lookup performance is + * very important here, since we need to do it every time a cell arrives.) */ struct orconn_circid_circuit_map_t { RB_ENTRY(orconn_circid_circuit_map_t) node; connection_t *or_conn; @@ -32,7 +33,9 @@ circuit_t *circuit; }; -/** DOCDOC */ +/** helper for RB tree: compare the OR connection and circuit ID for a and b, + * and return less than, equal to, or greater than zero appropriately. + */ static INLINE int compare_orconn_circid_entries(struct orconn_circid_circuit_map_t *a, struct orconn_circid_circuit_map_t *b) @@ -49,9 +52,15 @@ RB_PROTOTYPE(orconn_circid_tree, orconn_circid_circuit_map_t, node, compare_orconn_circid_entries); RB_GENERATE(orconn_circid_tree, orconn_circid_circuit_map_t, node, compare_orconn_circid_entries); +/** The most recently returned entyr from circuit_get_by_circid_orconn; used + * to improve performance when many cells arrive in a row from the same circuit. + */ +/* (We tried using splay trees, but round-robin turned out to make them suck.) */ struct orconn_circid_circuit_map_t *_last_circid_orconn_ent = NULL; -/** DOCDOC */ +/** Set the p_conn or n_conn field of a circuit circ, along with the + * corresponding circuit ID, and add the circuit as appropriate to the + * (orconn,id)-\>circuit map. */ void circuit_set_circid_orconn(circuit_t *circ, uint16_t id, connection_t *conn, @@ -154,7 +163,7 @@ } } -/** DOCDOC **/ +/** Return the head of the global linked list of circuits. **/ circuit_t * _circuit_get_global_list(void) { @@ -227,7 +236,8 @@ if (circ->p_digest) crypto_free_digest_env(circ->p_digest); if (circ->build_state) { - tor_free(circ->build_state->chosen_exit_name); + if (circ->build_state->chosen_exit) + extend_info_free(circ->build_state->chosen_exit); if (circ->build_state->pending_final_cpath) circuit_free_cpath_node(circ->build_state->pending_final_cpath); } @@ -296,6 +306,9 @@ crypto_free_digest_env(victim->b_digest); if (victim->dh_handshake_state) crypto_dh_free(victim->dh_handshake_state); + if (victim->extend_info) + extend_info_free(victim->extend_info); + victim->magic = 0xDEADBEEFu; tor_free(victim); } @@ -367,7 +380,7 @@ } -/** DOCDOC */ +/** Return the circuit that a given edge connection is using. */ circuit_t * circuit_get_by_edge_conn(connection_t *conn) { @@ -385,8 +398,9 @@ } circ = conn->on_circuit; - /* All this stuff here is sanity-checking. */ tor_assert(circ->magic == CIRCUIT_MAGIC); +#if 0 + /* All this stuff here is sanity-checking. */ for (tmpconn = circ->p_streams; tmpconn; tmpconn=tmpconn->next_stream) if (tmpconn == conn) return circ; @@ -398,6 +412,8 @@ return circ; tor_assert(0); +#endif + return circ; } /** Return a circ such that circ is attached to conn, either as @@ -592,10 +608,14 @@ } if (circ->purpose == CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) { tor_assert(circ->state == CIRCUIT_STATE_OPEN); + tor_assert(circ->build_state->chosen_exit); /* treat this like getting a nack from it */ log_fn(LOG_INFO,"Failed intro circ %s to %s (awaiting ack). Removing from descriptor.", - safe_str(circ->rend_query), safe_str(circ->build_state->chosen_exit_name)); - rend_client_remove_intro_point(circ->build_state->chosen_exit_name, circ->rend_query); + safe_str(circ->rend_query), + safe_str(build_state_get_exit_nickname(circ->build_state))); + // XXXX NM + rend_client_remove_intro_point(circ->build_state->chosen_exit, + circ->rend_query); } if (circ->n_conn) Index: circuituse.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/circuituse.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- circuituse.c 11 Jun 2005 18:52:11 -0000 1.75 +++ circuituse.c 29 Jun 2005 21:46:55 -0000 1.76 @@ -74,12 +74,7 @@ * circuit, it's the magical extra bob hop. so just check the nickname * of the one we meant to finish at. */ - exitrouter = router_get_by_digest(circ->build_state->chosen_exit_digest); - - if (!exitrouter) { - log_fn(LOG_INFO,"Skipping broken circ (exit router vanished)"); - return 0; /* this circuit is screwed and doesn't know it yet */ - } + exitrouter = build_state_get_exit_router(circ->build_state); if (!circ->build_state->need_uptime && smartlist_string_num_isin(get_options()->LongLivedPorts, @@ -87,6 +82,11 @@ return 0; if (purpose == CIRCUIT_PURPOSE_C_GENERAL) { + if (!exitrouter) { + log_fn(LOG_DEBUG,"Not considering circuit with unknown router."); + return 0; /* this circuit is screwed and doesn't know it yet, + * or is a rendezvous circuit. */ + } if (!connection_ap_can_use_exit(conn, exitrouter)) { /* can't exit from this router */ return 0; @@ -296,7 +296,7 @@ circ->purpose == CIRCUIT_PURPOSE_C_GENERAL && (!circ->timestamp_dirty || circ->timestamp_dirty + get_options()->MaxCircuitDirtiness < now)) { - exitrouter = router_get_by_digest(circ->build_state->chosen_exit_digest); + exitrouter = build_state_get_exit_router(circ->build_state); if (exitrouter && (!need_uptime || circ->build_state->need_uptime)) { int ok; @@ -682,7 +682,7 @@ /* Don't increment failure count, since Alice may have picked * the rendezvous point maliciously */ log_fn(LOG_INFO,"Couldn't connect to Alice's chosen rend point %s (%s hop failed).", - circ->build_state->chosen_exit_name, + build_state_get_exit_nickname(circ->build_state), failed_at_last_hop?"last":"non-last"); rend_service_relaunch_rendezvous(circ); break; @@ -703,12 +703,34 @@ * success. */ #define MAX_CIRCUIT_FAILURES 5 -/** Launch a new circuit based on our arguments. */ +/** Launch a new circuit; see circuit_launch_by_extend_info for details on + * arguments. */ circuit_t * circuit_launch_by_router(uint8_t purpose, routerinfo_t *exit, int need_uptime, int need_capacity, int internal) { circuit_t *circ; + extend_info_t *info = NULL; + if (exit) + info = extend_info_from_router(exit); + circ = circuit_launch_by_extend_info(purpose, info, need_uptime, need_capacity, + internal); + if (info) + extend_info_free(info); + return circ; +} + +/** Launch a new circuit with purpose purpose and exit node info + * (or NULL to select a random exit node). If need_uptime is true, + * choose among routers with high uptime. If need_capacity is true, + * choose among routers with high bandwidth. If internal is true, the + * last hop need not be an exit node. Return the newly allocated circuit on + * success, or NULL on failure. */ +circuit_t * +circuit_launch_by_extend_info(uint8_t purpose, extend_info_t *info, + int need_uptime, int need_capacity, int internal) +{ + circuit_t *circ; if (!has_fetched_directory) { log_fn(LOG_DEBUG,"Haven't fetched directory yet; canceling circuit launch."); @@ -721,7 +743,7 @@ if ((circ = circuit_get_clean_open(CIRCUIT_PURPOSE_C_GENERAL, need_uptime, need_capacity, internal))) { log_fn(LOG_INFO,"Cannibalizing circ '%s' for purpose %d", - circ->build_state->chosen_exit_name, purpose); + build_state_get_exit_nickname(circ->build_state), purpose); circ->purpose = purpose; /* reset the birth date of this circ, else expire_building * will see it and think it's been trying to build since it @@ -740,8 +762,8 @@ case CIRCUIT_PURPOSE_C_INTRODUCING: case CIRCUIT_PURPOSE_S_CONNECT_REND: /* need to add a new hop */ - tor_assert(exit); - if (circuit_extend_to_new_exit(circ, exit) < 0) + tor_assert(info); + if (circuit_extend_to_new_exit(circ, info) < 0) return NULL; break; default: @@ -762,11 +784,12 @@ } /* try a circ. if it fails, circuit_mark_for_close will increment n_circuit_failures */ - return circuit_establish_circuit(purpose, exit, + return circuit_establish_circuit(purpose, info, need_uptime, need_capacity, internal); } -/** Launch a new circuit and return a pointer to it. Return NULL if you failed. */ +/** Launch a new circuit; see circuit_launch_by_extend_info for details on + * arguments. */ circuit_t * circuit_launch_by_nickname(uint8_t purpose, const char *exit_nickname, int need_uptime, int need_capacity, int internal) @@ -867,30 +890,22 @@ /* is one already on the way? */ circ = circuit_get_best(conn, 0, desired_circuit_purpose); if (!circ) { - char *exitname=NULL; + extend_info_t *extend_info=NULL; uint8_t new_circ_purpose; int is_internal; if (desired_circuit_purpose == CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) { /* need to pick an intro point */ -try_an_intro_point: - exitname = rend_client_get_random_intro(conn->rend_query); - if (!exitname) { + extend_info = rend_client_get_random_intro(conn->rend_query); + if (!extend_info) { log_fn(LOG_INFO,"No intro points for '%s': refetching service descriptor.", safe_str(conn->rend_query)); rend_client_refetch_renddesc(conn->rend_query); conn->state = AP_CONN_STATE_RENDDESC_WAIT; return 0; } - if (!router_get_by_nickname(exitname)) { - log_fn(LOG_NOTICE,"Advertised intro point '%s' is not recognized for hidserv address '%s'. Skipping over.", - exitname, safe_str(conn->rend_query)); - rend_client_remove_intro_point(exitname, conn->rend_query); - tor_free(exitname); - goto try_an_intro_point; - } log_fn(LOG_INFO,"Chose %s as intro point for %s.", - exitname, safe_str(conn->rend_query)); + extend_info->nickname, safe_str(conn->rend_query)); } /* If we have specified a particular exit node for our @@ -898,13 +913,13 @@ */ if (desired_circuit_purpose == CIRCUIT_PURPOSE_C_GENERAL) { if (conn->chosen_exit_name) { - exitname = tor_strdup(conn->chosen_exit_name); - if (!router_get_by_nickname(exitname)) { + routerinfo_t *r; + if (!(r = router_get_by_nickname(conn->chosen_exit_name))) { log_fn(LOG_NOTICE,"Requested exit point '%s' is not known. Closing.", - exitname); - tor_free(exitname); + conn->chosen_exit_name); return -1; } + extend_info = extend_info_from_router(r); } } @@ -916,9 +931,10 @@ new_circ_purpose = desired_circuit_purpose; is_internal = (new_circ_purpose != CIRCUIT_PURPOSE_C_GENERAL || is_resolve); - circ = circuit_launch_by_nickname(new_circ_purpose, exitname, need_uptime, - 1, is_internal); - tor_free(exitname); + circ = circuit_launch_by_extend_info( + new_circ_purpose, extend_info, need_uptime, 1, is_internal); + if (extend_info) + extend_info_free(extend_info); if (desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL) { /* help predict this next time */ @@ -989,18 +1005,18 @@ } }); - if (!found_needle) + if (!found_needle || !circ->build_state->chosen_exit) return; /* Add this exit/hostname pair to the addressmap. */ len = strlen(conn->socks_request->address) + 1 /* '.' */ + - strlen(circ->build_state->chosen_exit_name) + 1 /* '.' */ + + strlen(circ->build_state->chosen_exit->nickname) + 1 /* '.' */ + strlen("exit") + 1 /* '\0' */; new_address = tor_malloc(len); tor_snprintf(new_address, len, "%s.%s.exit", conn->socks_request->address, - circ->build_state->chosen_exit_name); + circ->build_state->chosen_exit->nickname); addressmap_register(conn->socks_request->address, new_address, time(NULL) + options->TrackHostExitsExpire); Index: connection_edge.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v retrieving revision 1.333 retrieving revision 1.334 diff -u -d -r1.333 -r1.334 --- connection_edge.c 19 Jun 2005 20:40:41 -0000 1.333 +++ connection_edge.c 29 Jun 2005 21:46:55 -0000 1.334 @@ -1051,7 +1051,7 @@ log_fn(LOG_INFO,"Got a hidden service request for ID '%s'", safe_str(conn->rend_query)); /* see if we already have it cached */ - r = rend_cache_lookup_entry(conn->rend_query, &entry); + r = rend_cache_lookup_entry(conn->rend_query, -1, &entry); if (r<0) { log_fn(LOG_WARN,"Invalid service descriptor %s", safe_str(conn->rend_query)); Index: control.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/control.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- control.c 27 Jun 2005 23:35:04 -0000 1.97 +++ control.c 29 Jun 2005 21:46:55 -0000 1.98 @@ -1402,7 +1402,9 @@ /* now circ refers to something that is ready to be extended */ SMARTLIST_FOREACH(routers, routerinfo_t *, r, { - circuit_append_new_exit(circ, r); + extend_info_t *info = extend_info_from_router(r); + circuit_append_new_exit(circ, info); + extend_info_free(info); }); /* now that we've populated the cpath, start extending */ Index: directory.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/directory.c,v retrieving revision 1.236 retrieving revision 1.237 diff -u -d -r1.236 -r1.237 --- directory.c 22 Jun 2005 21:59:11 -0000 1.236 +++ directory.c 29 Jun 2005 21:46:55 -0000 1.237 @@ -435,6 +435,9 @@ httpcommand = "GET"; tor_snprintf(url, sizeof(url), "/tor/rendezvous/%s", resource); + /* XXXX011 Once directories understand versioned descriptors, switch to this + * URL in order to get the most recent version */ + // tor_snprintf(url, sizeof(url), "/tor/rendezvous1/%s", resource); break; case DIR_PURPOSE_UPLOAD_RENDDESC: @@ -1004,10 +1007,13 @@ return 0; } - if (!strcmpstart(url,"/tor/rendezvous/")) { + if (!strcmpstart(url,"/tor/rendezvous/") || + !strcmpstart(url,"/tor/rendezvous1/")) { /* rendezvous descriptor fetch */ const char *descp; size_t desc_len; + int versioned = !strcmpstart(url,"/tor/rendezvous1/"); + const char *query = url+strlen("/tor/rendezvous/")+(versioned?1:0); if (!authdir_mode(get_options())) { /* We don't hand out rend descs. In fact, it could be a security @@ -1019,7 +1025,7 @@ tor_free(url); return 0; } - switch (rend_cache_lookup_desc(url+strlen("/tor/rendezvous/"), &descp, &desc_len)) { + switch (rend_cache_lookup_desc(query, versioned?-1:0, &descp, &desc_len)) { case 1: /* valid */ format_rfc1123_time(date, time(NULL)); tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: application/octet-stream\r\n\r\n", Index: onion.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/onion.c,v retrieving revision 1.182 retrieving revision 1.183 diff -u -d -r1.182 -r1.183 --- onion.c 13 Jun 2005 17:33:12 -0000 1.182 +++ onion.c 29 Jun 2005 21:46:55 -0000 1.183 @@ -153,6 +153,9 @@ crypto_dh_env_t *dh = NULL; int dhbytes, pkbytes; + tor_assert(dest_router_key); + tor_assert(handshake_state_out); + tor_assert(onion_skin_out); *handshake_state_out = NULL; memset(onion_skin_out, 0, ONIONSKIN_CHALLENGE_LEN); Index: or.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.621 retrieving revision 1.622 diff -u -d -r1.621 -r1.622 --- or.h 27 Jun 2005 23:35:04 -0000 1.621 +++ or.h 29 Jun 2005 21:46:55 -0000 1.622 @@ -664,7 +664,8 @@ int done_receiving; /**< For half-open connections; not used currently. */ char has_sent_end; /**< For debugging: set once we've set the stream end, and check in circuit_about_to_close_connection(). */ - struct circuit_t *on_circuit; /**< DOCDOC */ + struct circuit_t *on_circuit; /**< The circuit (if any) that this edge + * connection is using. */ /* Used only by AP connections */ socks_request_t *socks_request; /**< SOCKS structure describing request (AP @@ -766,6 +767,17 @@ char *signing_router; } routerlist_t; +/** Informetation on router used when extending a circuit. (We don't need a + * full routerinfo_t to extend: we only need addr:port:keyid to build an OR + * connection, and onion_key to create the onionskin.) */ +typedef struct extend_info_t { + char nickname[MAX_HEX_NICKNAME_LEN+1]; /**< This router's nickname for display*/ + char identity_digest[DIGEST_LEN]; /**< Hash of this router's identity key */ + uint32_t addr; /**< IP address in host order */ + uint16_t port; /**< OR port */ + crypto_pk_env_t *onion_key; /**< Current onionskin key */ +} extend_info_t; + #define CRYPT_PATH_MAGIC 0x70127012u /** Holds accounting information for a single step in the layered encryption @@ -793,12 +805,8 @@ /** Negotiated key material shared with the OR at this step. */ char handshake_digest[DIGEST_LEN];/* KH in tor-spec.txt */ - /** IP4 address of the OR at this step. */ - uint32_t addr; - /** Port of the OR at this step. */ - uint16_t port; - /** Identity key digest of the OR at this step. */ - char identity_digest[DIGEST_LEN]; + /** Information to extend to the OR at this step. */ + extend_info_t *extend_info; /** Is the circuit built to this step? Must be one of: * - CPATH_STATE_CLOSED (The circuit has not been extended to this step) @@ -836,10 +844,8 @@ typedef struct { /** Intended length of the final circuit. */ int desired_path_len; - /** Nickname of planned exit node. */ - char *chosen_exit_name; - /** Identity of planned exit node. */ - char chosen_exit_digest[DIGEST_LEN]; + /** How to extend to the planned exit node. */ + extend_info_t *chosen_exit; /** Whether every node in the circ must have adequate uptime. */ int need_uptime; /** Whether every node in the circ must have adequate capacity. */ @@ -1220,7 +1226,7 @@ void circuit_dump_by_conn(connection_t *conn, int severity); circuit_t *circuit_init(uint8_t purpose, int need_uptime, int need_capacity, int internal); -circuit_t *circuit_establish_circuit(uint8_t purpose, routerinfo_t *exit, +circuit_t *circuit_establish_circuit(uint8_t purpose, extend_info_t *exit, int need_uptime, int need_capacity, int internal); int circuit_handle_first_hop(circuit_t *circ); void circuit_n_conn_done(connection_t *or_conn, int status); @@ -1234,9 +1240,14 @@ int circuit_all_predicted_ports_handled(time_t now, int *need_uptime, int *need_capacity); -int circuit_append_new_exit(circuit_t *circ, routerinfo_t *exit); -int circuit_extend_to_new_exit(circuit_t *circ, routerinfo_t *exit); +int circuit_append_new_exit(circuit_t *circ, extend_info_t *info); +int circuit_extend_to_new_exit(circuit_t *circ, extend_info_t *info); void onion_append_to_cpath(crypt_path_t **head_ptr, crypt_path_t *new_hop); +extend_info_t *extend_info_from_router(routerinfo_t *r); +extend_info_t *extend_info_dup(extend_info_t *info); +void extend_info_free(extend_info_t *info); +routerinfo_t *build_state_get_exit_router(cpath_build_state_t *state); +const char *build_state_get_exit_nickname(cpath_build_state_t *state); /********************************* circuitlist.c ***********************/ @@ -1280,6 +1291,9 @@ void circuit_build_failed(circuit_t *circ); circuit_t *circuit_launch_by_nickname(uint8_t purpose, const char *exit_nickname, int need_uptime, int need_capacity, int is_internal); +circuit_t *circuit_launch_by_extend_info(uint8_t purpose, + extend_info_t *info, + int need_uptime, int need_capacity, int is_internal); circuit_t *circuit_launch_by_router(uint8_t purpose, routerinfo_t *exit, int need_uptime, int need_capacity, int is_internal); void circuit_reset_failure_count(int timeout); @@ -1707,22 +1721,34 @@ void rend_client_rendcirc_has_opened(circuit_t *circ); int rend_client_introduction_acked(circuit_t *circ, const char *request, size_t request_len); void rend_client_refetch_renddesc(const char *query); -int rend_client_remove_intro_point(char *failed_intro, const char *query); +int rend_client_remove_intro_point(extend_info_t *failed_intro, const char *query); int rend_client_rendezvous_acked(circuit_t *circ, const char *request, size_t request_len); int rend_client_receive_rendezvous(circuit_t *circ, const char *request, size_t request_len); -void rend_client_desc_here(char *query); +void rend_client_desc_here(const char *query); -char *rend_client_get_random_intro(char *query); +extend_info_t *rend_client_get_random_intro(const char *query); int rend_client_send_introduction(circuit_t *introcirc, circuit_t *rendcirc); /********************************* rendcommon.c ***************************/ +/** Information used to connect to a hidden service. */ typedef struct rend_service_descriptor_t { - crypto_pk_env_t *pk; - time_t timestamp; - int n_intro_points; + crypto_pk_env_t *pk; /**< This service's public key. */ + int version; /**< 0 or 1 */ + time_t timestamp; /**< Time when the descriptor was generated. */ + uint16_t protocols; /**< Bitmask: which rendezvous protocols are supporeted? + * (We allow bits '0', '1', and '2' to be set.) */ + int n_intro_points; /**< Number of introduction points. */ + /** Array of n_intro_points elements for this service's introduction points' + * nicknames. Elements are removed from this array if introduction attempts + * fail. */ char **intro_points; + /** Array of n_intro_points elements for this service's introduction points' + * extend_infos, or NULL if this descriptor is V0. Elements are removed + * from this array if introduction attempts fail. If this array is present, + * its elements correspond to the elements of intro_points. */ + extend_info_t **intro_point_extend_info; } rend_service_descriptor_t; int rend_cmp_service_ids(const char *one, const char *two); @@ -1732,6 +1758,7 @@ void rend_service_descriptor_free(rend_service_descriptor_t *desc); int rend_encode_service_descriptor(rend_service_descriptor_t *desc, + int version, crypto_pk_env_t *key, char **str_out, size_t *len_out); @@ -1740,7 +1767,7 @@ typedef struct rend_cache_entry_t { size_t len; /* Length of desc */ - time_t received; /* When did we get the descriptor? */ + time_t received; /* When was the descriptor received? */ char *desc; /* Service descriptor */ rend_service_descriptor_t *parsed; /* Parsed value of 'desc' */ } rend_cache_entry_t; @@ -1749,8 +1776,8 @@ void rend_cache_clean(void); void rend_cache_free_all(void); int rend_valid_service_id(const char *query); -int rend_cache_lookup_desc(const char *query, const char **desc, size_t *desc_len); -int rend_cache_lookup_entry(const char *query, rend_cache_entry_t **entry_out); +int rend_cache_lookup_desc(const char *query, int version, const char **desc, size_t *desc_len); +int rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **entry_out); int rend_cache_store(const char *desc, size_t desc_len); /********************************* rendservice.c ***************************/ Index: relay.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/relay.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- relay.c 19 Jun 2005 08:35:16 -0000 1.73 +++ relay.c 29 Jun 2005 21:46:55 -0000 1.74 @@ -633,11 +633,8 @@ log_fn(LOG_INFO,"Address '%s' refused due to '%s'. Considering retrying.", safe_str(conn->socks_request->address), connection_edge_end_reason_str(reason)); - exitrouter = router_get_by_digest(circ->build_state->chosen_exit_digest); - if (!exitrouter) { - log_fn(LOG_INFO,"Skipping broken circ (exit router vanished)"); - return 0; /* this circuit is screwed and doesn't know it yet */ - } + exitrouter = + router_get_by_digest(circ->build_state->chosen_exit->identity_digest); switch (reason) { case END_STREAM_REASON_EXITPOLICY: if (rh->length >= 5) { @@ -652,15 +649,15 @@ conn->chosen_exit_name); } /* check if he *ought* to have allowed it */ - if (rh->length < 5 || - (!tor_inet_aton(conn->socks_request->address, &in) && - !conn->chosen_exit_name)) { + if (exitrouter && + (rh->length < 5 || + (!tor_inet_aton(conn->socks_request->address, &in) && + !conn->chosen_exit_name))) { log_fn(LOG_NOTICE,"Exitrouter '%s' seems to be more restrictive than its exit policy. Not using this router as exit for now.", exitrouter->nickname); addr_policy_free(exitrouter->exit_policy); exitrouter->exit_policy = router_parse_addr_policy_from_string("reject *:*"); } - if (connection_ap_detach_retriable(conn, circ) >= 0) return 0; /* else, conn will get closed below */ @@ -683,10 +680,11 @@ break; case END_STREAM_REASON_HIBERNATING: case END_STREAM_REASON_RESOURCELIMIT: - addr_policy_free(exitrouter->exit_policy); - exitrouter->exit_policy = - router_parse_addr_policy_from_string("reject *:*"); - + if (exitrouter) { + addr_policy_free(exitrouter->exit_policy); + exitrouter->exit_policy = + router_parse_addr_policy_from_string("reject *:*"); + } if (connection_ap_detach_retriable(conn, circ) >= 0) return 0; /* else, will close below */ Index: rendclient.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendclient.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- rendclient.c 11 Jun 2005 18:52:11 -0000 1.89 +++ rendclient.c 29 Jun 2005 21:46:55 -0000 1.90 @@ -58,15 +58,16 @@ size_t payload_len; int r; char payload[RELAY_PAYLOAD_SIZE]; - char tmp[1+(MAX_HEX_NICKNAME_LEN+1)+REND_COOKIE_LEN+DH_KEY_LEN]; + char tmp[RELAY_PAYLOAD_SIZE]; rend_cache_entry_t *entry; crypt_path_t *cpath; + off_t dh_offset; tor_assert(introcirc->purpose == CIRCUIT_PURPOSE_C_INTRODUCING); tor_assert(rendcirc->purpose == CIRCUIT_PURPOSE_C_REND_READY); tor_assert(!rend_cmp_service_ids(introcirc->rend_query, rendcirc->rend_query)); - if (rend_cache_lookup_entry(introcirc->rend_query, &entry) < 1) { + if (rend_cache_lookup_entry(introcirc->rend_query, -1, &entry) < 1) { log_fn(LOG_WARN,"query '%s' didn't have valid rend desc in cache. Failing.", safe_str(introcirc->rend_query)); goto err; @@ -95,22 +96,28 @@ } /* write the remaining items into tmp */ -#if 0 - tmp[0] = 1; /* version 1 of the cell format */ - /* nul pads */ - strncpy(tmp+1, rendcirc->build_state->chosen_exit_name, (MAX_HEX_NICKNAME_LEN+1)); - memcpy(tmp+1+MAX_HEX_NICKNAME_LEN+1, rendcirc->rend_cookie, REND_COOKIE_LEN); -#else - strncpy(tmp, rendcirc->build_state->chosen_exit_name, (MAX_NICKNAME_LEN+1)); /* nul pads */ - memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_cookie, REND_COOKIE_LEN); -#endif - if (crypto_dh_get_public(cpath->dh_handshake_state, -#if 0 - tmp+1+MAX_HEX_NICKNAME_LEN+1+REND_COOKIE_LEN, -#else - tmp+MAX_NICKNAME_LEN+1+REND_COOKIE_LEN, -#endif + if (entry->parsed->protocols & (1<<2)) { + /* version 2 format */ + extend_info_t *extend_info = rendcirc->build_state->chosen_exit; + int klen; + tmp[0] = 2; /* version 2 of the cell format */ + /* nul pads */ + set_uint32(tmp+1, htonl(extend_info->addr)); + set_uint16(tmp+5, htons(extend_info->port)); + memcpy(tmp+7, extend_info->identity_digest, DIGEST_LEN); + klen = crypto_pk_asn1_encode(extend_info->onion_key, tmp+7+DIGEST_LEN+2, + sizeof(tmp)-(7+DIGEST_LEN+2)); + set_uint16(tmp+7+DIGEST_LEN, htons(klen)); + memcpy(tmp+7+DIGEST_LEN+2+klen, rendcirc->rend_cookie, REND_COOKIE_LEN); + dh_offset = 7+DIGEST_LEN+2+klen+REND_COOKIE_LEN; + } else { + /* Version 0. */ + strncpy(tmp, rendcirc->build_state->chosen_exit->nickname, (MAX_NICKNAME_LEN+1)); /* nul pads */ + memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_cookie, REND_COOKIE_LEN); + dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN; + } + if (crypto_dh_get_public(cpath->dh_handshake_state, tmp+dh_offset, DH_KEY_LEN)<0) { log_fn(LOG_WARN, "Couldn't extract g^x"); goto err; @@ -119,11 +126,7 @@ /*XXX maybe give crypto_pk_public_hybrid_encrypt a max_len arg, * to avoid buffer overflows? */ r = crypto_pk_public_hybrid_encrypt(entry->parsed->pk, payload+DIGEST_LEN, tmp, -#if 0 - 1+MAX_HEX_NICKNAME_LEN+1+REND_COOKIE_LEN+DH_KEY_LEN, -#else - MAX_NICKNAME_LEN+1+REND_COOKIE_LEN+DH_KEY_LEN, -#endif + dh_offset+DH_KEY_LEN, PK_PKCS1_OAEP_PADDING, 0); if (r<0) { log_fn(LOG_WARN,"hybrid pk encrypt failed."); @@ -174,7 +177,6 @@ rend_client_introduction_acked(circuit_t *circ, const char *request, size_t request_len) { - char *nickname; circuit_t *rendcirc; if (circ->purpose != CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) { @@ -184,7 +186,8 @@ return -1; } - tor_assert(circ->build_state->chosen_exit_name); + tor_assert(circ->build_state->chosen_exit); + tor_assert(circ->build_state->chosen_exit->nickname); if (request_len == 0) { /* It's an ACK; the introduction point relayed our introduction request. */ @@ -209,27 +212,26 @@ * points. If any remain, extend to a new one and try again. * If none remain, refetch the service descriptor. */ - if (rend_client_remove_intro_point(circ->build_state->chosen_exit_name, + if (rend_client_remove_intro_point(circ->build_state->chosen_exit, circ->rend_query) > 0) { /* There are introduction points left. re-extend the circuit to * another intro point and try again. */ - routerinfo_t *r; - nickname = rend_client_get_random_intro(circ->rend_query); - tor_assert(nickname); - log_fn(LOG_INFO,"Got nack for %s from %s, extending to %s.", - safe_str(circ->rend_query), - circ->build_state->chosen_exit_name, nickname); - if (!(r = router_get_by_nickname(nickname))) { - log_fn(LOG_WARN, "Advertised intro point '%s' for %s is not known. Closing.", - nickname, safe_str(circ->rend_query)); - tor_free(nickname); + extend_info_t *info; + int result; + info = rend_client_get_random_intro(circ->rend_query); + if (!info) { + log_fn(LOG_WARN, "No introduction points left for %s. Closing.", + safe_str(circ->rend_query)); circuit_mark_for_close(circ); return -1; } - log_fn(LOG_INFO, "Chose new intro point %s for %s (circ %d)", - nickname, safe_str(circ->rend_query), circ->n_circ_id); - tor_free(nickname); - return circuit_extend_to_new_exit(circ, r); + log_fn(LOG_INFO,"Got nack for %s from %s, extending circ %d to %s.", + safe_str(circ->rend_query), + circ->build_state->chosen_exit->nickname, circ->n_circ_id, + info->nickname); + result = circuit_extend_to_new_exit(circ, info); + extend_info_free(info); + return result; } } return 0; @@ -257,13 +259,13 @@ * unrecognized, 1 if recognized and some intro points remain. */ int -rend_client_remove_intro_point(char *failed_intro, const char *query) +rend_client_remove_intro_point(extend_info_t *failed_intro, const char *query) { int i, r; rend_cache_entry_t *ent; connection_t *conn; - r = rend_cache_lookup_entry(query, &ent); + r = rend_cache_lookup_entry(query, -1, &ent); if (r<0) { log_fn(LOG_WARN, "Malformed service ID '%s'", safe_str(query)); return -1; @@ -275,12 +277,31 @@ return 0; } - for (i=0; i < ent->parsed->n_intro_points; ++i) { - if (!strcasecmp(ent->parsed->intro_points[i], failed_intro)) { - tor_free(ent->parsed->intro_points[i]); - ent->parsed->intro_points[i] = - ent->parsed->intro_points[--ent->parsed->n_intro_points]; - break; + if (ent->parsed->intro_point_extend_info) { + for (i=0; i < ent->parsed->n_intro_points; ++i) { + if (!memcmp(failed_intro->identity_digest, + ent->parsed->intro_point_extend_info[i]->identity_digest, + DIGEST_LEN)) { + tor_assert(!strcmp(ent->parsed->intro_points[i], + ent->parsed->intro_point_extend_info[i]->nickname)); + tor_free(ent->parsed->intro_points[i]); + extend_info_free(ent->parsed->intro_point_extend_info[i]); + --ent->parsed->n_intro_points; + ent->parsed->intro_points[i] = + ent->parsed->intro_points[ent->parsed->n_intro_points]; + ent->parsed->intro_point_extend_info[i] = + ent->parsed->intro_point_extend_info[ent->parsed->n_intro_points]; + break; + } + } + } else { + for (i=0; i < ent->parsed->n_intro_points; ++i) { + if (!strcasecmp(ent->parsed->intro_points[i], failed_intro->nickname)) { + tor_free(ent->parsed->intro_points[i]); + ent->parsed->intro_points[i] = + ent->parsed->intro_points[--ent->parsed->n_intro_points]; + break; + } } } @@ -385,7 +406,7 @@ * else fail them. */ void -rend_client_desc_here(char *query) +rend_client_desc_here(const char *query) { connection_t *conn; rend_cache_entry_t *entry; @@ -393,7 +414,7 @@ while ((conn = connection_get_by_type_state_rendquery(CONN_TYPE_AP, AP_CONN_STATE_RENDDESC_WAIT, query))) { - if (rend_cache_lookup_entry(conn->rend_query, &entry) == 1 && + if (rend_cache_lookup_entry(conn->rend_query, -1, &entry) == 1 && entry->parsed->n_intro_points > 0) { /* either this fetch worked, or it failed but there was a * valid entry from before which we should reuse */ @@ -419,37 +440,42 @@ } } -/** strdup a nickname for a random introduction - * point of query. return NULL if error. +/** Return a newly allocated extend_info_t* for a randomly chosen introduction + * point for the named hidden service. Return NULL if all introduction points + * have been tried and failed. */ -char * -rend_client_get_random_intro(char *query) +extend_info_t * +rend_client_get_random_intro(const char *query) { int i; - smartlist_t *sl; - char *choice; - char *nickname; rend_cache_entry_t *entry; - if (rend_cache_lookup_entry(query, &entry) < 1) { + if (rend_cache_lookup_entry(query, -1, &entry) < 1) { log_fn(LOG_WARN,"query '%s' didn't have valid rend desc in cache. Failing.", safe_str(query)); return NULL; } - sl = smartlist_create(); + again: + if (!entry->parsed->n_intro_points) + return NULL; - /* add the intro point nicknames */ - for (i=0;iparsed->n_intro_points;i++) - smartlist_add(sl,entry->parsed->intro_points[i]); + i = crypto_pseudo_rand_int(entry->parsed->n_intro_points); - choice = smartlist_choose(sl); - if (!choice) { - smartlist_free(sl); - return NULL; + if (entry->parsed->intro_point_extend_info) { + return extend_info_dup(entry->parsed->intro_point_extend_info[i]); + } else { + /* add the intro point nicknames */ + char *choice = entry->parsed->intro_points[i]; + routerinfo_t *router = router_get_by_nickname(choice); + if (!router) { + log_fn(LOG_WARN, "Unknown router with nickname %s; trying another.",choice); + tor_free(choice); + entry->parsed->intro_points[i] = + entry->parsed->intro_points[--entry->parsed->n_intro_points]; + goto again; + } + return extend_info_from_router(router); } - nickname = tor_strdup(choice); - smartlist_free(sl); - return nickname; } Index: rendcommon.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendcommon.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- rendcommon.c 11 Jun 2005 18:52:11 -0000 1.50 +++ rendcommon.c 29 Jun 2005 21:46:55 -0000 1.51 @@ -29,6 +29,13 @@ } tor_free(desc->intro_points); } + if (desc->intro_point_extend_info) { + for (i=0; i < desc->n_intro_points; ++i) { + if (desc->intro_point_extend_info[i]) + extend_info_free(desc->intro_point_extend_info[i]); + } + tor_free(desc->intro_point_extend_info); + } tor_free(desc); } @@ -38,38 +45,52 @@ */ int rend_encode_service_descriptor(rend_service_descriptor_t *desc, + int version, crypto_pk_env_t *key, char **str_out, size_t *len_out) { - char *buf, *cp, *ipoint; + char *cp; + char *end; int i; - size_t keylen, asn1len; - keylen = crypto_pk_keysize(desc->pk); - buf = tor_malloc(keylen*2); /* Too long, but that's okay. */ - i = crypto_pk_asn1_encode(desc->pk, buf, keylen*2); - if (i<0) { - tor_free(buf); - return -1; - } - asn1len = i; - *len_out = 2 + asn1len + 4 + 2 + keylen; - for (i = 0; i < desc->n_intro_points; ++i) { - *len_out += strlen(desc->intro_points[i]) + 1; + size_t asn1len; + cp = *str_out = tor_malloc(PK_BYTES*2*(desc->n_intro_points+1)); /*Too long, but ok*/ + end = cp + PK_BYTES*2*(desc->n_intro_points+1); + if (version) { + *(uint8_t*)cp = (uint8_t)0xff; + *(uint8_t*)(cp+1) = (uint8_t)version; + cp += 2; } - cp = *str_out = tor_malloc(*len_out); + asn1len = crypto_pk_asn1_encode(desc->pk, cp+2, end-(cp+2)); set_uint16(cp, htons((uint16_t)asn1len)); - cp += 2; - memcpy(cp, buf, asn1len); - tor_free(buf); - cp += asn1len; + cp += 2+asn1len; set_uint32(cp, htonl((uint32_t)desc->timestamp)); cp += 4; + if (version == 1) { + set_uint16(cp, htons(desc->protocols)); + cp += 2; + } set_uint16(cp, htons((uint16_t)desc->n_intro_points)); cp += 2; - for (i=0; i < desc->n_intro_points; ++i) { - ipoint = (char*)desc->intro_points[i]; - strlcpy(cp, ipoint, *len_out-(cp-*str_out)); - cp += strlen(ipoint)+1; + if (version == 0) { + tor_assert(desc->intro_points); + for (i=0; i < desc->n_intro_points; ++i) { + char *ipoint = (char*)desc->intro_points[i]; + strlcpy(cp, ipoint, *len_out-(cp-*str_out)); + cp += strlen(ipoint)+1; + } + } else { + tor_assert(desc->intro_point_extend_info); + for (i=0; i < desc->n_intro_points; ++i) { + extend_info_t *info = desc->intro_point_extend_info[i]; + int klen; + set_uint32(cp, htonl(info->addr)); + set_uint16(cp+4, htons(info->port)); + memcpy(cp+6, info->identity_digest, DIGEST_LEN); + klen = crypto_pk_asn1_encode(info->onion_key, cp+6+DIGEST_LEN+2, + (end-(cp+6+DIGEST_LEN+2))); + set_uint16(cp+6+DIGEST_LEN, htons((uint16_t)klen)); + cp += 6+DIGEST_LEN+2+klen; + } } i = crypto_pk_private_sign_digest(key, cp, *str_out, cp-*str_out); if (i<0) { @@ -77,7 +98,7 @@ return -1; } cp += i; - tor_assert(*len_out == (size_t)(cp-*str_out)); + *len_out = (size_t)(cp-*str_out); return 0; } @@ -92,10 +113,18 @@ int i; size_t keylen, asn1len; const char *end, *cp, *eos; + int version = 0; result = tor_malloc_zero(sizeof(rend_service_descriptor_t)); cp = str; end = str+len; + if (end-cp<2) goto truncated; + if (*(uint8_t*)cp == 0xff) { + result->version = version = *(uint8_t*)(cp+1); + cp += 2; + } else { + result->version = version = 0; + } if (end-cp < 2) goto truncated; asn1len = ntohs(get_uint16(cp)); cp += 2; @@ -106,16 +135,51 @@ if (end-cp < 4) goto truncated; result->timestamp = (time_t) ntohl(get_uint32(cp)); cp += 4; + if (version == 1) { + if (end-cp < 2) goto truncated; + result->protocols = ntohs(get_uint16(cp)); + cp += 2; + } else { + result->protocols = 1; + } if (end-cp < 2) goto truncated; result->n_intro_points = ntohs(get_uint16(cp)); - result->intro_points = tor_malloc_zero(sizeof(char*)*result->n_intro_points); + cp += 2; - for (i=0;in_intro_points;++i) { - if (end-cp < 2) goto truncated; - eos = (const char *)memchr(cp,'\0',end-cp); - if (!eos) goto truncated; - result->intro_points[i] = tor_strdup(cp); - cp = eos+1; + if (version == 0) { + result->intro_points = tor_malloc_zero(sizeof(char*)*result->n_intro_points); + for (i=0;in_intro_points;++i) { + if (end-cp < 2) goto truncated; + eos = (const char *)memchr(cp,'\0',end-cp); + if (!eos) goto truncated; + result->intro_points[i] = tor_strdup(cp); + cp = eos+1; + } + } else { + result->intro_point_extend_info = + tor_malloc_zero(sizeof(extend_info_t*)*result->n_intro_points); + result->intro_points = tor_malloc_zero(sizeof(char*)*result->n_intro_points); + for (i=0;in_intro_points;++i) { + extend_info_t *info = result->intro_point_extend_info[i] = + tor_malloc_zero(sizeof(extend_info_t)); + int klen; + if (end-cp < 8+DIGEST_LEN) goto truncated; + info->addr = ntohl(get_uint32(cp)); + info->port = ntohs(get_uint16(cp+4)); + memcpy(info->identity_digest, cp+6, DIGEST_LEN); + info->nickname[0] = '$'; + base16_encode(info->nickname+1, sizeof(info->nickname)-1, + info->identity_digest, DIGEST_LEN); + result->intro_points[i] = tor_strdup(info->nickname); + klen = ntohs(get_uint16(cp+6+DIGEST_LEN)); + cp += 8+DIGEST_LEN; + if (end-cp < klen) goto truncated; + if (!(info->onion_key = crypto_pk_asn1_decode(cp,klen))) { + log_fn(LOG_WARN, "error decoding onion key for intro point"); + goto error; + } + cp += klen; + } } keylen = crypto_pk_keysize(result->pk); tor_assert(end-cp >= 0); @@ -227,16 +291,28 @@ return 1; } -/** If we have a cached rend_cache_entry_t for the service ID query, set - * *e to that entry and return 1. Else return 0. +/** If we have a cached rend_cache_entry_t for the service ID query, + * set *e to that entry and return 1. Else return 0. If + * version is nonnegative, only return an entry in that descriptor + * format version. Otherwise (if version is negative), return the most + * recent format we have. */ int -rend_cache_lookup_entry(const char *query, rend_cache_entry_t **e) +rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e) { + char key[REND_SERVICE_ID_LEN+2]; tor_assert(rend_cache); if (!rend_valid_service_id(query)) return -1; - *e = strmap_get_lc(rend_cache, query); + *e = NULL; + if (version != 0) { + tor_snprintf(key, sizeof(key), "1%s", query); + *e = strmap_get_lc(rend_cache, key); + } + if (!*e && version != 1) { + tor_snprintf(key, sizeof(key), "0%s", query); + *e = strmap_get_lc(rend_cache, key); + } if (!*e) return 0; return 1; @@ -251,11 +327,11 @@ * *desc. */ int -rend_cache_lookup_desc(const char *query, const char **desc, size_t *desc_len) +rend_cache_lookup_desc(const char *query, int version, const char **desc, size_t *desc_len) { rend_cache_entry_t *e; int r; - r = rend_cache_lookup_entry(query,&e); + r = rend_cache_lookup_entry(query,version,&e); if (r <= 0) return r; *desc = e->desc; *desc_len = e->len; @@ -275,6 +351,7 @@ rend_cache_entry_t *e; rend_service_descriptor_t *parsed; char query[REND_SERVICE_ID_LEN+1]; + char key[REND_SERVICE_ID_LEN+2]; time_t now; tor_assert(rend_cache); @@ -288,6 +365,7 @@ rend_service_descriptor_free(parsed); return -1; } + tor_snprintf(key, sizeof(key), "%c%s", parsed->version?'1':'0', query); now = time(NULL); if (parsed->timestamp < now-REND_CACHE_MAX_AGE-REND_CACHE_MAX_SKEW) { log_fn(LOG_WARN,"Service descriptor %s is too old", safe_str(query)); @@ -300,9 +378,9 @@ rend_service_descriptor_free(parsed); return -1; } - e = (rend_cache_entry_t*) strmap_get_lc(rend_cache, query); + e = (rend_cache_entry_t*) strmap_get_lc(rend_cache, key); if (e && e->parsed->timestamp > parsed->timestamp) { - log_fn(LOG_INFO,"We already have a newer service descriptor %s with the same ID", safe_str(query)); + log_fn(LOG_INFO,"We already have a newer service descriptor %s with the same ID and version", safe_str(query)); rend_service_descriptor_free(parsed); return 0; } @@ -314,7 +392,7 @@ } if (!e) { e = tor_malloc_zero(sizeof(rend_cache_entry_t)); - strmap_set_lc(rend_cache, query, e); + strmap_set_lc(rend_cache, key, e); } else { rend_service_descriptor_free(e->parsed); tor_free(e->desc); Index: rendservice.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/rendservice.c,v retrieving revision 1.126 retrieving revision 1.127 diff -u -d -r1.126 -r1.127 --- rendservice.c 11 Jun 2005 18:52:11 -0000 1.126 +++ rendservice.c 29 Jun 2005 21:46:55 -0000 1.127 @@ -272,9 +272,12 @@ d = service->desc = tor_malloc(sizeof(rend_service_descriptor_t)); d->pk = crypto_pk_dup_key(service->private_key); d->timestamp = time(NULL); + d->version = 1; n = smartlist_len(service->intro_nodes); d->n_intro_points = 0; - d->intro_points = tor_malloc(sizeof(char*)*n); + d->intro_points = tor_malloc_zero(sizeof(char*)*n); + d->intro_point_extend_info = tor_malloc_zero(sizeof(extend_info_t*)*n); + d->protocols = (1<<2) | (1<<0); /* We support protocol 2 and protocol 0. */ for (i=0; i < n; ++i) { router = router_get_by_nickname(smartlist_get(service->intro_nodes, i)); if (!router) { @@ -285,7 +288,10 @@ circ = find_intro_circuit(router, service->pk_digest); if (circ && circ->purpose == CIRCUIT_PURPOSE_S_INTRO) { /* We have an entirely established intro circuit. */ - d->intro_points[d->n_intro_points++] = tor_strdup(router->nickname); + d->intro_points[d->n_intro_points] = tor_strdup(router->nickname); + d->intro_point_extend_info[d->n_intro_points] = + extend_info_from_router(router); + d->n_intro_points++; } } } @@ -379,7 +385,8 @@ int rend_service_introduce(circuit_t *circuit, const char *request, size_t request_len) { - char *ptr, *rp_nickname, *r_cookie; + char *ptr, *r_cookie; + extend_info_t *extend_info = NULL; char buf[RELAY_PAYLOAD_SIZE]; char keys[DIGEST_LEN+CPATH_KEY_MATERIAL_LEN]; /* Holds KH, Df, Db, Kf, Kb */ rend_service_t *service; @@ -390,8 +397,6 @@ crypt_path_t *cpath = NULL; char serviceid[REND_SERVICE_ID_LEN+1]; char hexcookie[9]; - int version; - size_t nickname_field_len; int circ_needs_uptime; base32_encode(serviceid, REND_SERVICE_ID_LEN+1, @@ -441,34 +446,73 @@ return -1; } len = r; - if (*buf == 1) { - rp_nickname = buf+1; - nickname_field_len = MAX_HEX_NICKNAME_LEN+1; - version = 1; + if (*buf == 2) { + /* Version 2 INTRODUCE2 cell. */ + int klen; + extend_info = tor_malloc_zero(sizeof(extend_info_t)); + extend_info->addr = ntohl(get_uint32(buf+1)); + extend_info->port = ntohs(get_uint16(buf+5)); + memcpy(extend_info->identity_digest, buf+7, DIGEST_LEN); + extend_info->nickname[0] = '$'; + base16_encode(extend_info->nickname+1, sizeof(extend_info->nickname)-1, + extend_info->identity_digest, DIGEST_LEN); + + klen = ntohs(get_uint16(buf+7+DIGEST_LEN)); + if (len != 7+DIGEST_LEN+2+klen+20+128) { + log_fn(LOG_WARN, "Bad length %u for version 2 INTRODUCE2 cell.", (int)len); + goto err; + } + extend_info->onion_key = crypto_pk_asn1_decode(buf+7+DIGEST_LEN+2, klen); + if (!extend_info->onion_key) { + log_fn(LOG_WARN, "Error decoding onion key in version 2 INTRODUCE2 cell."); + goto err; + } + ptr = buf+7+DIGEST_LEN+2+klen; + len -= 7+DIGEST_LEN+2+klen; } else { - nickname_field_len = MAX_NICKNAME_LEN+1; - rp_nickname = buf; - version = 0; - } - /* XXX when 0.0.9.x is obsolete, change this to reject version != 1. */ - ptr=memchr(rp_nickname,0,nickname_field_len); - if (!ptr || ptr == rp_nickname) { - log_fn(LOG_WARN, "Couldn't find a null-padded nickname in INTRODUCE2 cell"); - return -1; - } - if ((version == 0 && !is_legal_nickname(rp_nickname)) || - (version == 1 && !is_legal_nickname_or_hexdigest(rp_nickname))) { - log_fn(LOG_WARN, "Bad nickname in INTRODUCE2 cell."); - return -1; + char *rp_nickname; + size_t nickname_field_len; + routerinfo_t *router; + int version; + if (*buf == 1) { + rp_nickname = buf+1; + nickname_field_len = MAX_HEX_NICKNAME_LEN+1; + version = 1; + } else { + nickname_field_len = MAX_NICKNAME_LEN+1; + rp_nickname = buf; + version = 0; + } + /* XXX when 0.1.0.x is obsolete, change this to reject version != 2. */ + ptr=memchr(rp_nickname,0,nickname_field_len); + if (!ptr || ptr == rp_nickname) { + log_fn(LOG_WARN, "Couldn't find a null-padded nickname in INTRODUCE2 cell"); + return -1; + } + if ((version == 0 && !is_legal_nickname(rp_nickname)) || + (version == 1 && !is_legal_nickname_or_hexdigest(rp_nickname))) { + log_fn(LOG_WARN, "Bad nickname in INTRODUCE2 cell."); + return -1; + } + /* Okay, now we know that a nickname is at the start of the buffer. */ + ptr = rp_nickname+nickname_field_len; + len -= nickname_field_len; + len -= rp_nickname - buf; /* also remove header space used by version, if any */ + router = router_get_by_nickname(rp_nickname); + if (!router) { + log_fn(LOG_WARN, "Couldn't found router '%s' named in rendezvous cell.", + rp_nickname); + goto err; + } + + extend_info = extend_info_from_router(router); } - /* Okay, now we know that a nickname is at the start of the buffer. */ - ptr = rp_nickname+nickname_field_len; - len -= nickname_field_len; - len -= rp_nickname - buf; /* also remove header space used by version, if any */ + if (len != REND_COOKIE_LEN+DH_KEY_LEN) { log_fn(LOG_WARN, "Bad length %u for INTRODUCE2 cell.", (int)len); return -1; } + r_cookie = ptr; base16_encode(hexcookie,9,r_cookie,4); @@ -492,19 +536,20 @@ /* Launch a circuit to alice's chosen rendezvous point. */ for (i=0;inickname, serviceid); goto err; } log_fn(LOG_INFO, "Accepted intro; launching circuit to '%s' (cookie %s) for service %s", - rp_nickname, hexcookie, serviceid); + extend_info->nickname, hexcookie, serviceid); tor_assert(launched->build_state); /* Fill in the circuit's state. */ memcpy(launched->rend_pk_digest, circuit->rend_pk_digest, @@ -522,11 +567,13 @@ if (circuit_init_cpath_crypto(cpath,keys+DIGEST_LEN,1)<0) goto err; memcpy(cpath->handshake_digest, keys, DIGEST_LEN); + if (extend_info) extend_info_free(extend_info); return 0; err: if (dh) crypto_dh_free(dh); if (launched) circuit_mark_for_close(launched); + if (extend_info) extend_info_free(extend_info); return -1; } @@ -545,7 +592,7 @@ oldcirc->build_state->failure_count > MAX_REND_FAILURES || oldcirc->build_state->expiry_time < time(NULL)) { log_fn(LOG_INFO,"Attempt to build circuit to %s for rendezvous has failed too many times or expired; giving up.", - oldcirc->build_state->chosen_exit_name); + oldcirc->build_state->chosen_exit->nickname); return; } @@ -558,13 +605,13 @@ } log_fn(LOG_INFO,"Reattempting rendezvous circuit to %s", - oldstate->chosen_exit_name); + oldstate->chosen_exit->nickname); - newcirc = circuit_launch_by_nickname(CIRCUIT_PURPOSE_S_CONNECT_REND, - oldstate->chosen_exit_name, 0, 1, 1); + newcirc = circuit_launch_by_extend_info(CIRCUIT_PURPOSE_S_CONNECT_REND, + oldstate->chosen_exit, 0, 1, 1); if (!newcirc) { log_fn(LOG_WARN,"Couldn't relaunch rendezvous circuit to %s", - oldstate->chosen_exit_name); + oldstate->chosen_exit->nickname); return; } newstate = newcirc->build_state; @@ -783,8 +830,8 @@ while ((circ = circuit_get_next_by_pk_and_purpose(circ,pk_digest, CIRCUIT_PURPOSE_S_INTRO))) { tor_assert(circ->cpath); - if (circ->build_state->chosen_exit_name && - !strcasecmp(circ->build_state->chosen_exit_name, router->nickname)) { + if (circ->build_state->chosen_exit->nickname && + !strcasecmp(circ->build_state->chosen_exit->nickname, router->nickname)) { return circ; } } @@ -793,8 +840,8 @@ while ((circ = circuit_get_next_by_pk_and_purpose(circ,pk_digest, CIRCUIT_PURPOSE_S_ESTABLISH_INTRO))) { tor_assert(circ->cpath); - if (circ->build_state->chosen_exit_name && - !strcasecmp(circ->build_state->chosen_exit_name, router->nickname)) { + if (circ->build_state->chosen_exit->nickname && + !strcasecmp(circ->build_state->chosen_exit->nickname, router->nickname)) { return circ; } } @@ -805,7 +852,7 @@ * and upload it to all the dirservers. */ static void -upload_service_descriptor(rend_service_t *service) +upload_service_descriptor(rend_service_t *service, int version) { char *desc; size_t desc_len; @@ -813,6 +860,7 @@ /* Update the descriptor. */ rend_service_update_descriptor(service); if (rend_encode_service_descriptor(service->desc, + version, service->private_key, &desc, &desc_len)<0) { log_fn(LOG_WARN, "Couldn't encode service descriptor; not uploading"); @@ -963,7 +1011,10 @@ /* if it's time, or if the directory servers have a wrong service * descriptor and ours has been stable for 5 seconds, upload a * new one. */ - upload_service_descriptor(service); + upload_service_descriptor(service, 0); + /* XXXX011 NM Once directories understand versioned descriptors, enable + * this. */ + // upload_service_descriptor(service, 1); service->next_upload_time = now + rendpostperiod; } } Index: test.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/test.c,v retrieving revision 1.183 retrieving revision 1.184 diff -u -d -r1.183 -r1.184 --- test.c 27 Jun 2005 22:25:09 -0000 1.183 +++ test.c 29 Jun 2005 21:46:55 -0000 1.184 @@ -1400,30 +1400,89 @@ rend_service_descriptor_t *d1, *d2; char *encoded; size_t len; - crypto_pk_env_t *pk1; + crypto_pk_env_t *pk1, *pk2; time_t now; pk1 = crypto_new_pk_env(); - + pk2 = crypto_new_pk_env(); test_assert(!crypto_pk_generate_key(pk1)); + test_assert(!crypto_pk_generate_key(pk2)); + + /* Test unversioned descriptor */ d1 = tor_malloc_zero(sizeof(rend_service_descriptor_t)); - d1->pk = pk1; + d1->pk = crypto_pk_dup_key(pk1); now = time(NULL); d1->timestamp = now; d1->n_intro_points = 3; + d1->version = 0; d1->intro_points = tor_malloc(sizeof(char*)*3); d1->intro_points[0] = tor_strdup("tom"); d1->intro_points[1] = tor_strdup("crow"); d1->intro_points[2] = tor_strdup("joel"); - test_assert(! rend_encode_service_descriptor(d1, pk1, &encoded, &len)); + test_assert(! rend_encode_service_descriptor(d1, 0, pk1, &encoded, &len)); d2 = rend_parse_service_descriptor(encoded, len); test_assert(d2); test_assert(!crypto_pk_cmp_keys(d1->pk, d2->pk)); test_eq(d2->timestamp, now); + test_eq(d2->version, 0); + test_eq(d2->protocols, 1); test_eq(d2->n_intro_points, 3); test_streq(d2->intro_points[0], "tom"); test_streq(d2->intro_points[1], "crow"); test_streq(d2->intro_points[2], "joel"); + test_eq(NULL, d2->intro_point_extend_info); + + rend_service_descriptor_free(d1); + rend_service_descriptor_free(d2); + tor_free(encoded); + + /* Test versioned descriptor. */ + d1 = tor_malloc_zero(sizeof(rend_service_descriptor_t)); + d1->pk = crypto_pk_dup_key(pk1); + now = time(NULL); + d1->timestamp = now; + d1->n_intro_points = 2; + d1->version = 1; + d1->protocols = 60; + d1->intro_points = tor_malloc(sizeof(char*)*2); + d1->intro_point_extend_info = tor_malloc(sizeof(extend_info_t*)*2); + d1->intro_points[0] = tor_strdup("tom"); + d1->intro_points[1] = tor_strdup("crow"); + d1->intro_point_extend_info[0] = tor_malloc_zero(sizeof(extend_info_t)); + strcpy(d1->intro_point_extend_info[0]->nickname, "tom"); + d1->intro_point_extend_info[0]->addr = 1234; + d1->intro_point_extend_info[0]->port = 4567; + d1->intro_point_extend_info[0]->onion_key = crypto_pk_dup_key(pk1); + memset(d1->intro_point_extend_info[0]->identity_digest, 'a', DIGEST_LEN); + + d1->intro_point_extend_info[1] = tor_malloc_zero(sizeof(extend_info_t)); + strcpy(d1->intro_point_extend_info[1]->nickname, "crow"); + d1->intro_point_extend_info[1]->addr = 6060842; + d1->intro_point_extend_info[1]->port = 8000; + d1->intro_point_extend_info[1]->onion_key = crypto_pk_dup_key(pk2); + memset(d1->intro_point_extend_info[1]->identity_digest, 'b', DIGEST_LEN); + + test_assert(! rend_encode_service_descriptor(d1, 1, pk1, &encoded, &len)); + d2 = rend_parse_service_descriptor(encoded, len); + test_assert(d2); + + test_assert(!crypto_pk_cmp_keys(d1->pk, d2->pk)); + test_eq(d2->timestamp, now); + test_eq(d2->version, 1); + test_eq(d2->protocols, 60); + test_eq(d2->n_intro_points, 2); + test_streq(d2->intro_points[0], d2->intro_point_extend_info[0]->nickname); + test_streq(d2->intro_points[1], d2->intro_point_extend_info[1]->nickname); + test_eq(d2->intro_point_extend_info[0]->addr, 1234); + test_eq(d2->intro_point_extend_info[0]->port, 4567); + test_assert(!crypto_pk_cmp_keys(pk1,d2->intro_point_extend_info[0]->onion_key)); + test_memeq(d2->intro_point_extend_info[0]->identity_digest, + d1->intro_point_extend_info[0]->identity_digest, DIGEST_LEN); + test_eq(d2->intro_point_extend_info[1]->addr, 6060842); + test_eq(d2->intro_point_extend_info[1]->port, 8000); + + test_memeq(d2->intro_point_extend_info[1]->identity_digest, + d1->intro_point_extend_info[1]->identity_digest, DIGEST_LEN); test_eq(BAD_HOSTNAME, parse_extended_hostname(address1)); test_eq(ONION_HOSTNAME, parse_extended_hostname(address2)); @@ -1432,6 +1491,8 @@ rend_service_descriptor_free(d1); rend_service_descriptor_free(d2); + crypto_free_pk_env(pk1); + crypto_free_pk_env(pk2); } int From nickm at seul.org Wed Jun 29 21:51:33 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 29 Jun 2005 17:51:33 -0400 (EDT) Subject: [or-cvs] Update rendezvous fix status; add more items to TODO Message-ID: <20050629215133.013A914080DC@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv3268/doc Modified Files: TODO Log Message: Update rendezvous fix status; add more items to TODO Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.328 retrieving revision 1.329 diff -u -d -r1.328 -r1.329 --- TODO 20 Jun 2005 18:56:34 -0000 1.328 +++ TODO 29 Jun 2005 21:51:30 -0000 1.329 @@ -13,6 +13,9 @@ X Abandoned Non-Coding, Soon: +N - contact umass folks +N - Packaging logic and HOWTO for controller libs +N - Mention controller libs someplace. - FAQ entry: why gnutls is bad/not good for tor P - flesh out the rest of the section 6 of the faq P - gather pointers to livecd distros that include tor @@ -70,9 +73,12 @@ . Switch example controllers to use new protocol . Python o Implement main controller interface - - Glue code - - Testing - - Java + o Glue code + . Testing + . Java + o Implement main controller interface + o Glue code + . Testing - switch accountingmax to count total in+out, not either in or out. it's easy to move in this direction (not risky), but hard to back, out if we decide we prefer it the way it already is. hm. @@ -82,13 +88,22 @@ first place.) Also, we should audit all users of get_pending_bytes().) - Make it harder to circumvent bandwidth caps: look at number of bytes sent across sockets, not number sent inside TLS stream. -N - Handle rendezvousing with unverified nodes. +N . Handle rendezvousing with unverified nodes. o Specify: Stick rendezvous point's address and port in INTRODUCE cell. - - Handle new format. - - Parse and generate new format (#if0 out the logic to generate it.) - - Support to extend circuit/target circuit to a chosen combination of + o Handle new format. + o Support to extend circuit/target circuit to a chosen combination of addr/port/ID/onionkey - - Verify that new code works. + o Parse new format + o Generate new format (#ifdef out the logic to generate it for now) + o Specify: make service descriptors contain onion key and identity. + o Implement new service desc format + - Think: are we okay with the partitioning? + o Implement new directory code + o Implement new server code (Don't enable till directory code is deployed) + o Implement new client code (Don't enable till directory code is deployed) + o Look for v1 descriptor if available, else look for v0 descriptor. + o Use new INTRODUCE protocol if allowed. + . Verify that new code works. - it looks like tor_assert writes to stderr. what happens if stderr was closed and is now something else? uh. - christian grothoff's attack of infinite-length circuit. @@ -154,6 +169,8 @@ - something, anything, for sys tray on Windows. - figure out how to make nt service stuff work? . Document it. + - Simple logic to estimate number of active/total users + - Add version number to directory. N - Vet all pending installer patches - Win32 installer plus privoxy, sockscap/freecap, etc. - Vet win32 systray helper code From thomass at seul.org Wed Jun 29 23:02:37 2005 From: thomass at seul.org (thomass at seul.org) Date: Wed, 29 Jun 2005 19:02:37 -0400 (EDT) Subject: [or-cvs] Update tor-manual.html to 0.1.0.10 Message-ID: <20050629230237.6925714080DC@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv8233 Modified Files: tor-manual.html Log Message: Update tor-manual.html to 0.1.0.10 Index: tor-manual.html =================================================================== RCS file: /home2/or/cvsroot/website/tor-manual.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- tor-manual.html 19 May 2005 13:10:21 -0000 1.7 +++ tor-manual.html 29 Jun 2005 23:02:35 -0000 1.8 @@ -4,7 +4,7 @@ Man page of TOR

      TOR

      -Section: User Commands (1)
      Updated: November 2004
      Index +Section: User Commands (1)
      Updated: May 2005
      Index Return to Main Contents
        @@ -45,24 +45,42 @@
      Other options can be specified either on the command-line (--option
      value), or in the configuration file (option value). Options are case-insensitive. -
      Log minSeverity[-maxSeverity] stderr|stdout|syslog
      -Send all messages between minSeverity and maxSeverity to -the standard output stream, the standard error stream, or to the system -log. (The "syslog" value is only supported on Unix.) Recognized -severity levels are debug, info, notice, warn, and err. If only one -severity level is given, all messages of that level or higher will be -sent to the listed destination. -
      Log minSeverity[-maxSeverity] file FILENAME
      -As above, but send log messages to the listed filename. The "Log" -option may appear more than once in a configuration file. Messages -are sent to all the logs that match their severity level.
      BandwidthRate N bytes|KB|MB|GB|TB
      A token bucket limits the average incoming bandwidth on this node to -the specified number of bytes per second. (Default: 780 KB) +the specified number of bytes per second. (Default: 2 MB)
      BandwidthBurst N bytes|KB|MB|GB|TB
      -Limit the maximum token bucket size (also known as the burst) to the given number of bytes. (Default: 48 MB) +Limit the maximum token bucket size (also known as the burst) to the given number of bytes. (Default: 5 MB) +
      MaxAdvertisedBandwidth N bytes|KB|MB|GB|TB
      +If set, we will not advertise more than this amount of bandwidth for our +BandwidthRate. Server operators who want to reduce the number of clients +who ask to build circuits through them (since this is proportional to +advertised bandwidth rate) can thus reduce the CPU demands on their +server without impacting network performance. +
      ControlPort Port
      +If set, Tor will accept connections from the same machine (localhost only) on +this port, and allow those connections to control the Tor process using the +Tor Control Protocol (described in control-spec.txt). Note: unless you also +specify one of HashedControlPassword or CookieAuthentication, +setting this option will cause Tor to allow any process on the local host to +control it. +
      HashedControlPassword hashed_password
      +Don't allow any connections on the control port except when the other process +knows the password whose one-way hash is hashed_password. You can +compute the hash of a password by running "tor --hash-password +password". +
      CookieAuthentication 0|1
      +If this option is set to 1, don't allow any connections on the control port +except when the connecting process knows the contents of a file named +"control_auth_cookie", which Tor will create in its data directory. This +authentication methods should only be used on systems with good filesystem +security. (Default: 0)
      DataDirectory DIR
      Store working data in DIR (Default: @LOCALSTATEDIR@/lib/tor) +
      DirFetchPeriod N seconds|minutes|hours|days|weeks
      +Every time the specified period elapses, Tor downloads a directory. +A directory contains a signed list of all known servers as well as +their current liveness status. A value of "0 seconds" tells Tor to choose an +appropriate default. (Default: 1 hour for clients, 20 minutes for servers)
      DirServer address:port fingerprint
      Use a nonstandard authoritative directory server at the provided address and port, with the specified key fingerprint. This option can @@ -72,11 +90,44 @@
      Group GID
      On startup, setgid to this user.
      HttpProxy host[:port]
      -If set, Tor will make all its directory requests through this host:port, +Tor will make all its directory requests through this host:port +(or host:80 if port is not specified), rather than connecting directly to any directory servers. +
      HttpProxyAuthenticator username:password
      +If defined, Tor will use this username:password for Basic Http proxy +authentication, as in RFC 2617. This is currently the only form of +Http proxy authentication that Tor supports; feel free to submit a +patch if you want it to support others. +
      HttpsProxy host[:port]
      +Tor will make all its OR (SSL) connections through this host:port +(or host:443 if port is not specified), via HTTP CONNECT rather than +connecting directly to servers. You may want to set FascistFirewall +to restrict the set of ports you might try to connect to, if your Https +proxy only allows connecting to certain ports. +
      HttpsProxyAuthenticator username:password
      +If defined, Tor will use this username:password for Basic Https proxy +authentication, as in RFC 2617. This is currently the only form of +Https proxy authentication that Tor supports; feel free to submit a +patch if you want it to support others.
      KeepalivePeriod NUM
      To keep firewalls from expiring connections, send a padding keepalive -cell on open connections every NUM seconds. (Default: 5 minutes.) +cell every NUM seconds on open connections that are in use. If the +connection has no open circuits, it will instead be closed after NUM +seconds of idleness. (Default: 5 minutes) +
      Log minSeverity[-maxSeverity] stderr|stdout|syslog
      +Send all messages between minSeverity and maxSeverity to +the standard output stream, the standard error stream, or to the system +log. (The "syslog" value is only supported on Unix.) Recognized +severity levels are debug, info, notice, warn, and err. If only one +severity level is given, all messages of that level or higher will be +sent to the listed destination. +
      Log minSeverity[-maxSeverity] file FILENAME
      +As above, but send log messages to the listed filename. The "Log" +option may appear more than once in a configuration file. Messages +are sent to all the logs that match their severity level. +
      MaxConn NUM
      +Maximum number of simultaneous sockets allowed. You probably don't need +to adjust this. (Default: 1024)
      OutboundBindAddress IP
      Make all outbound connections originate from the IP address specified. This is only useful when you have multiple network interfaces, and you want all @@ -85,37 +136,18 @@ On startup, write our PID to FILE. On clean shutdown, remove FILE.
      RunAsDaemon 0|1
      If 1, Tor forks and daemonizes to the background. (Default: 0) -
      User UID
      -On startup, setuid to this user. -
      ControlPort Port
      -If set, Tor will accept connections from the same machine (localhost only) on -this port, and allow those connections to control the Tor process using the -Tor Control Protocol (described in control-spec.txt). Note: unless you also -specify one of HashedControlPassword or CookieAuthentication, -setting this option will cause Tor to allow any process on the local host to -control it. -
      HashedControlPassword hashed_password
      -Don't allow any connections on the control port except when the other process -knows the password whose one-way hash is hashed_password. You can -compute the hash of a password by running "tor --hash-password -password". -
      CookieAuthentication 0|1
      -If this option is set to 1, don't allow any connections on the control port -except when the connecting process knows the contents of a file named -"control_auth_cookie", which Tor will create in its data directory. This -authentication methods should only be used on systems with good filesystem -security. -DirFetchPeriod N seconds|minutes|hours|days|weeks -Every time the specified period elapses, Tor downloads a directory. -A directory contains a signed list of all known servers as well as -their current liveness status. (Default: 1 hour) +
      SafeLogging 0|1
      +If 1, Tor replaces potentially sensitive strings in the logs +(e.g. addresses) with the string [scrubbed]. This way logs can still be +useful, but they don't leave behind personally identifying information +about what sites a user might have visited. (Default: 1)
      StatusFetchPeriod N seconds|minutes|hours|days|weeks
      Every time the specified period elapses, Tor downloads signed status -information about the current state of known servers. (Default: 20 minutes.) -
      RendPostPeriod N seconds|minutes|hours|days|weeks
      -Every time the specified period elapses, Tor uploads any rendezvous -service descriptors to the directory servers. This information is also -uploaded whenever it changes. (Default: 20 minutes.) +information about the current state of known servers. A value of +"0 seconds" tells Tor to choose an appropriate default. (Default: 30 +minutes for clients, 15 minutes for servers) +
      User UID
      +On startup, setuid to this user.

        @@ -127,11 +159,15 @@

      AllowUnverifiedNodes entry|exit|middle|introduction|rendezvous|...
      Where on our circuits should we allow Tor servers that the directory -servers haven't authenticated as "verified"? (Default: middle,rendezvous.) +servers haven't authenticated as "verified"? (Default: middle,rendezvous)
      ClientOnly 0|1
      -If set to 1, Tor will under no circumstances run as a server. (Usually, +If set to 1, Tor will under no circumstances run as a server. The default +is to run as a client unless ORPort is configured. (Usually, you don't need to set this; Tor is pretty smart at figuring out whether -you are reliable and high-bandwidth enough to be a good server.) +you are reliable and high-bandwidth enough to be a useful server.) +

      +This option will likely be deprecated in the future; see the NoPublish +option below. (Default: 0)

      EntryNodes nickname,nickname,...
      A list of preferred nodes to use for the first hop in the circuit, if possible.
      ExitNodes nickname,nickname,...
      @@ -151,10 +187,23 @@ but will not allow you to run as a server behind such a firewall.
      FirewallPorts PORTS
      A list of ports that your firewall allows you to connect to. Only used when -FascistFirewall is set. (Default: 80, 443.) -
      -NewCircuitPeriod NUM -Every NUM seconds consider whether to build a new circuit. (Default: 60) +FascistFirewall is set. (Default: 80, 443) +
      LongLivedPorts PORTS
      +A list of ports for services that tend to have long-running connections +(e.g. chat and interactive shells). Circuits for streams that use these +ports will contain only high-uptime nodes, to reduce the chance that a +node will go down before the stream is finished. (Default: 21, 22, 706, 1863, 5050, +5190, 5222, 5223, 6667, 8300, 8888) +
      MapAddress address newaddress
      +When a request for address arrives to Tor, it will rewrite it to newaddress before +processing it. For example, if you always want connections to www.indymedia.org to +exit via torserver (where torserver is the nickname of the server), +use "MapAddress www.indymedia.org www.indymedia.org.torserver.exit". +
      NewCircuitPeriod NUM
      +Every NUM seconds consider whether to build a new circuit. (Default: 30 seconds) +
      MaxCircuitDirtiness NUM
      +Feel free to reuse a circuit that was first used at most NUM seconds +ago, but never attach a new stream to a circuit that is too old. (Default: 10 minutes)
      NodeFamily nickname,nickname,...
      The named Tor servers constitute a "family" of similar or co-administered servers, so never use any two of them in the same circuit. Defining a @@ -164,18 +213,38 @@
      + RendNodes nickname,nickname,... A list of preferred nodes to use for the rendezvous point, if possible.
      RendExcludeNodes nickname,nickname,...
      A list of nodes to never use when choosing a rendezvous point.
      SOCKSPort PORT
      -Bind to this port to listen for connections from SOCKS-speaking applications. -Set this to 0 if you don't want to allow application connections. (Default: -9050) -
      SOCKSBindAddress IP
      -Bind to this address to listen for connections from socks-speaking applications. (Default: 127.0.0.1) You can also specify a port (e.g. 192.168.0.1:9100). This directive can be specified multiple times to bind to multiple addresses/ports. +Advertise this port to listen for connections from SOCKS-speaking +applications. Set this to 0 if you don't want to allow application +connections. (Default: 9050) +
      SOCKSBindAddress IP[:PORT]
      +Bind to this address to listen for connections from SOCKS-speaking +applications. (Default: 127.0.0.1) You can also specify a port +(e.g. 192.168.0.1:9100). This directive can be specified multiple times +to bind to multiple addresses/ports.
      SOCKSPolicy policy,policy,...
      -Set an entrance policy for this server, to limit who can connect to the socks ports. The policies have the same form as exit policies below. +Set an entrance policy for this server, to limit who can connect to the SOCKS ports. +The policies have the same form as exit policies below. +
      TrackHostExits host,.domain,...
      +For each value in the comma separated list, Tor will track recent connections +to hosts that match this value and attempt to +reuse the same exit node for each. If the value is prepended with a '.', it is +treated as matching an entire domain. If one of the values is just a '.', it +means match everything. This option is useful if you frequently connect to +sites that will expire all your authentication cookies (ie log you out) if +your IP address changes. Note that this option does have the disadvantage of +making it more clear that a given history is +associated with a single user. However, most people who would wish to observe +this will observe it through cookies or other protocol-specific means anyhow. +
      TrackHostExitsExpire NUM
      +Since exit servers go up and down, it is desirable to expire the association +between host and exit server after NUM seconds of inactivity. The default +is 1800 seconds (30 minutes).

        @@ -192,11 +261,12 @@ Administrative contact information for server.
      ExitPolicy policy,policy,...
      Set an exit policy for this server. Each policy is of the form -"accept|reject ADDR[/MASK]:PORT". +"accept|reject ADDR[/MASK][:PORT]". If /MASK is omitted then this policy just applies to the host given. Instead of giving a host or network you can also use "*" to denote the universe (0.0.0.0/0). PORT can be a single port number, an interval of ports "FROM_PORT-TO_PORT", or "*". +If PORT is omitted, that means "*".

      For example, "reject 127.0.0.1:*,reject 192.168.1.0/24:*,accept *:*" would reject any traffic destined for localhost and any 192.168.1.* address, but @@ -219,22 +289,16 @@

      reject 192.168.0.0/16
      reject 10.0.0.0/8
      reject 172.16.0.0/12
      -
      accept *:20-22
      -
      accept *:53
      -
      accept *:79-81
      -
      accept *:110
      -
      accept *:143
      -
      accept *:443
      -
      accept *:706
      -
      accept *:873
      -
      accept *:993
      -
      accept *:995
      +
      reject *:25
      +
      reject *:119
      +
      reject *:135-139
      +
      reject *:445
      reject *:1214
      reject *:4661-4666
      reject *:6346-6429
      +
      reject *:6699
      reject *:6881-6999
      -
      accept *:1024-65535
      -
      reject *:*
      +
      accept *:*
      @@ -245,16 +309,24 @@ Declare that this Tor server is controlled or administered by a group or organization identical or similar to that of the other named servers. When two servers both declare that they are in the same 'family', Tor clients -will not use them in the same circuit. (Each server only need to list the -other servers in its family; it doesn't need to list itself.) +will not use them in the same circuit. (Each server only needs to list the +other servers in its family; it doesn't need to list itself, but it won't hurt.)
      Nickname name
      Set the server's nickname to 'name'. +
      NoPublish 0|1
      +If you set NoPublish 1, Tor will act as a server if you have an ORPort +defined, but it will not publish its descriptor to the dirservers. This +option is useful if you're testing out your server, or if you're using +alternate dirservers (e.g. for other Tor networks such as Blossom). +(Default: 0)
      NumCPUs num
      How many processes to use at once for decrypting onionskins. (Default: 1)
      ORPort PORT
      -Bind to this port to listen for connections from Tor clients and servers. -
      ORBindAddress IP
      -Bind to this address to listen for connections from Tor clients and servers. (Default: 0.0.0.0) +Advertise this port to listen for connections from Tor clients and servers. +
      ORBindAddress IP[:PORT]
      +Bind to this IP address to listen for connections from Tor clients and +servers. If you specify a port, bind to this port rather than the one +specified in ORPort. (Default: 0.0.0.0)
      RedirectExit pattern target
      Whenever an outgoing connection tries to connect to one of a given set of addresses, connect to target (an address:port pair) instead. @@ -266,18 +338,26 @@ redirection is to be performed on a given set of addresses by using the special target string "pass", which prevents subsequent rules from being considered. +
      ShutdownWaitLengthNUM
      +When we get a SIGINT and we're a server, we begin shutting down: we close +listeners and start refusing new circuits. After NUM seconds, +we exit. If we get a second SIGINT, we exit immediately. (Default: +30 seconds)
      DirPostPeriod N seconds|minutes|hours|days|weeks
      Every time the specified period elapses, Tor uploads its server descriptors to the directory servers. This information is also -uploaded whenever it changes. (Default: 20 minutes.) +uploaded whenever it changes. (Default: 20 minutes)
      AccountingMax N bytes|KB|MB|GB|TB
      Never send more than the specified number of bytes in a given accounting period, or receive more than that number in the period. +For example, with AccountingMax set to 1 GB, a server could send 900 MB +and receive 800 MB and continue running. It will only hibernate once one +of the two reaches 1 GB. When the number of bytes is exhausted, Tor will hibernate until some time in the next accounting period. To prevent all servers from waking at the same time, Tor will also wait until a random point in each period before waking up. If you have bandwidth cost issues, -using this option is preferable to setting a low bandwidth, since it +enabling hibernation is preferable to setting a low bandwidth, since it provides users with a collection of fast servers that are up some of the time, which is more useful than a set of slow servers that are always "available". @@ -309,17 +389,23 @@ probably do not want to set this option. Please coordinate with the other admins at tor-ops at freehaven.net if you think you should be a directory.
      DirPort PORT
      -Bind the directory service to this port. -
      DirBindAddress IP
      -Bind the directory service to this address. (Default: 0.0.0.0) +Advertise the directory service on this port. +
      DirBindAddress IP[:PORT]
      +Bind the directory service to this address. If you specify a port, bind +to this port rather than the one specified in DirPort. (Default: 0.0.0.0)
      DirPolicy policy,policy,...
      -Set an entrance policy for this server, to limit who can connect to the directory ports. The policies have the same form as exit policies above. +Set an entrance policy for this server, to limit who can connect to the directory ports. +The policies have the same form as exit policies above.
      RecommendedVersions STRING
      STRING is a command-separated list of Tor versions currently believed to be safe. The list is included in each directory, and nodes which pull down the directory learn whether they need to upgrade. This option can appear multiple times: the values from multiple lines are spliced together. +
      DirAllowPrivateAddresses 0|1
      +If set to 1, Tor will accept router descriptors with arbitrary "Address" +elements. Otherwise, if the address is not an IP or is a private IP, +it will reject the router descriptor. Defaults to 0.
      RunTesting 0|1
      If set to 1, Tor tries to build circuits through all of the servers it knows about, so it can tell which are up and which are down. This @@ -346,10 +432,15 @@ by specifying a target of addr, port, or addr:port.
      HiddenServiceNodes nickname,nickname,...
      If possible, use the specified nodes as introduction points for the hidden -service. +service. If this is left unset, Tor will be smart and pick some reasonable +ones; most people can leave this unset.
      HiddenServiceExcludeNodes nickname,nickname,...
      Do not use the specified nodes as introduction points for the hidden -service. +service. In normal use there is no reason to set this. +
      RendPostPeriod N seconds|minutes|hours|days|weeks
      +Every time the specified period elapses, Tor uploads any rendezvous +service descriptors to the directory servers. This information is also +uploaded whenever it changes. (Default: 20 minutes)

      @@ -365,9 +456,11 @@

      SIGINT
      Tor clients behave as with SIGTERM; but Tor servers will do a controlled slow shutdown, closing listeners and waiting 30 seconds before exiting. +(The delay can be configured with the ShutdownWaitLength config option.)
      SIGHUP
      -The signal instructs Tor to reload its configuration, fetch a new -directory, and kill and restart its helper processes if applicable. +The signal instructs Tor to reload its configuration (including closing +and reopening logs), fetch a new directory, and kill and restart its +helper processes if applicable.
      SIGUSR1
      Log statistics about current connections, past connections, and throughput. @@ -391,10 +484,6 @@
      The configuration file, which contains "option value" pairs. -
      @CONFDIR@/dirservers - -
      -A list of directory servers, to bootstrap into the network.
      @LOCALSTATEDIR@/lib/tor/
      @@ -411,13 +500,13 @@ torify(1)

      -http://tor.eff.org +http://tor.eff.org/

       

      BUGS

      -Plenty, probably. It's still in alpha. Please report them. +Plenty, probably. Tor is still in development. Please report them.  

      AUTHORS

      @@ -445,6 +534,6 @@ This document was created by man2html, using the manual pages.
      -Time: 13:07:23 GMT, May 19, 2005 +Time: 23:00:41 GMT, June 29, 2005 From arma at seul.org Thu Jun 30 01:07:19 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 21:07:19 -0400 (EDT) Subject: [or-cvs] revise the abuse faq based on comments from kevin and chris Message-ID: <20050630010719.2FF2B1408107@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: faq-abuse.html Log Message: revise the abuse faq based on comments from kevin and chris Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- faq-abuse.html 29 Jun 2005 18:16:36 -0000 1.11 +++ faq-abuse.html 30 Jun 2005 01:07:16 -0000 1.12 @@ -51,22 +51,15 @@ better privacy than Tor provides. They can steal cell phones, use them, and throw them in a ditch; they can crack into computers in Korea or Brazil and use them to launch abusive activities; they -can spread viruses that take control of literally millions of Windows -machines around the world.

      +can use spyware, viruses, and other techniques to take control of +literally millions of Windows machines around the world.

      Tor aims to provide protection for ordinary people who want to follow the law. Only criminals have privacy right now; we need to fix that.

      - -

      Isn't it just a tradeoff: accepting the bad uses for the good ones?

      - -

      No, we don't think that's how it works in the case of Tor.

      - -

      There are lots of ways to get anonymity on the net, some legal and -some illegal. As we explained above, many of the illegal approaches -can provide stronger anonymity than Tor can provide, because they can -control literally millions of computers via spyware, viruses, and other -techniques.

      +

      Some advocates of anonymity explain that it's just a tradeoff --- +accepting the bad uses for the good ones --- but we don't think that's +how it works in the case of Tor.

      Criminals and other bad people have the motivation to learn how to get good anonymity, and many have the motivation to pay well to achieve @@ -98,10 +91,6 @@ in general, attackers who control enough bandwidth to launch an effective DDoS attack can do it just fine without Tor.

      -

      And if this argument doesn't convince you, go try Tor and see how -much aggregate throughput you can eke out of it, then come back to us -if you're still worried.

      -

      What about spammers?

      @@ -113,8 +102,13 @@ relay too, independent of Tor. In short, Tor isn't useful for spammers, because nearly all Tor servers refuse to deliver their mail.

      -

      The complex answer: Even if the above were not true, spammers are -already doing great without Tor. They +

      Of course, it's not all about delivering the mail. Spammers can use +Tor to connect to open HTTP proxies (and from there to SMTP servers), +to connect to badly written mail-sending CGI scripts, and to control +their botnets. +

      + +

      The better answer: Spammers are already doing great without Tor. They have armies of compromised computers that do their spamming. The added complexity of getting new software installed and configured, and doing Tor's public key operations, etc, makes it not economically worthwhile @@ -129,8 +123,9 @@ will automatically avoid picking exit nodes that would refuse to exit to their intended destination.

      -

      This way each server can decide the services he wants to allow -connections to, based on abuse potential and his own situation.

      +

      This way each server can decide the services, hosts, and networks +he wants to allow connections to, based on abuse potential and his own +situation.

      Does Tor get much abuse?

      @@ -153,10 +148,11 @@

      If you run a Tor server that allows exit connections (such as the default exit policy), it's probably safe to say that you will eventually -hear from somebody. Abuse complaints can come in a variety of forms. The -main ones so far have taken the following form:

      +hear from somebody. Abuse complaints can come in a variety of forms. Abuse +complaints may come in a variety of forms. For example:

        -
      • Somebody connects to hotmail, and sends a criminal mail somewhere. The +
      • Somebody connects to hotmail, and sends a ransom note to a +company. The FBI sends you a polite email, you explain that you run a Tor server, and they say 'oh well' and leave you alone. [Port 80]
      • Somebody tries to get you shut down by using Tor to connect to google @@ -166,11 +162,10 @@ himself. Your ISP gets polite mail about how your computer has been compromised; and/or your computer gets ddosed. [Port 6667]
      • Somebody uses Tor to download a Vin Diesel movie, and -your ISP gets a DMCA takedown notice. According to our lawyers -(and this convinced the Harvard general counsel), your ISP can -totally ignore this notice with no liability problems. See EFF's Tor DMCA -Response Template. [Arbitrary ports]
      • +your ISP gets a DMCA takedown notice. See EFF's Tor DMCA Response +Template, which explains to your ISP why they can probably ignore +the notice without any liability. [Arbitrary ports]

      You might also find that your Tor server's IP is blocked from accessing @@ -180,12 +175,15 @@ you might consider running your Tor server on it.) For example,

        -
      • Wikipedia is currently blocking many Tor server IPs from writing -(reading still works), because they haven't figured out internally how -to deal with the fact that they want to provide open access but they -also have no ways to control abuse to their website. We're working with -them to resolve this.
      • -
      • It seems that SORBS is putting some Tor server IPs on their email +
      • Because of a few cases of anonymous jerks messing with its web +pages, Wikipedia is currently blocking many Tor server IPs from writing +(reading still works). We're talking to Wikipedia about how they might +control abuse while still providing access to anonymous contributors, +who often have hot news or inside info on a topic but don't want to risk +revealing their identities when publishing it (or don't want to reveal +to local observers that they're accessing Wikipedia). Slashdot is also +in the same boat.
      • +
      • SORBS is putting some Tor server IPs on their email blacklist as well. They do this because they passively detect whether your server connects to certain IRC networks, and they conclude from this that your server is capable of spamming. We're working with them to teach them @@ -252,11 +250,13 @@

        Even though Tor isn't useful for spamming, some over-zealous blacklisters seem to think that all -open networks like Tor should be boycotted. They don't understand how -Tor works (e.g. that it has exit policies), and don't seem to care to -understand it. If your server administrators decide to make use of these +open networks like Tor are evil --- they attempt to strong-arm network +administrators on policy, service and routing issues, and then extract +ransoms from victims.

        + +

        If your server administrators decide to make use of these blacklists to refuse incoming mail, you should have a conversation with -them and explain how Tor works.

        +them and explain about Tor and Tor's exit policies.

        I want to ban the Tor network from my service.

        From arma at seul.org Thu Jun 30 01:13:16 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 29 Jun 2005 21:13:16 -0400 (EDT) Subject: [or-cvs] a bit more cleanup Message-ID: <20050630011316.09EF114081A3@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: faq-abuse.html Log Message: a bit more cleanup Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- faq-abuse.html 30 Jun 2005 01:07:16 -0000 1.12 +++ faq-abuse.html 30 Jun 2005 01:13:13 -0000 1.13 @@ -59,9 +59,8 @@

        Some advocates of anonymity explain that it's just a tradeoff --- accepting the bad uses for the good ones --- but we don't think that's -how it works in the case of Tor.

        - -

        Criminals and other bad people have the motivation to learn how to +how it works in the case of Tor. +Criminals and other bad people have the motivation to learn how to get good anonymity, and many have the motivation to pay well to achieve it. Being able to steal and reuse the identities of innocent victims (identify theft) makes it even easier. Normal people, on the other hand, From nickm at seul.org Tue Jun 7 13:46:00 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 09:46:00 -0400 (EDT) Subject: [or-cvs] Adapt patch from Adam Langley: fix possible memory leak in ... Message-ID: <20050607134600.7E5CB1408274@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv6590 Modified Files: compat.c Log Message: Adapt patch from Adam Langley: fix possible memory leak in tor_lookup_hostname Index: compat.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/compat.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- compat.c 2 May 2005 21:49:04 -0000 1.47 +++ compat.c 7 Jun 2005 13:45:58 -0000 1.48 @@ -526,8 +526,9 @@ } else { #ifdef HAVE_GETADDRINFO int err; - struct addrinfo *res, *res_p; + struct addrinfo *res=NULL, *res_p; struct addrinfo hints; + int result = -1; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET; hints.ai_socktype = SOCK_STREAM; @@ -537,14 +538,13 @@ if (res_p->ai_family == AF_INET) { struct sockaddr_in *sin = (struct sockaddr_in *)res_p->ai_addr; memcpy(addr, &sin->sin_addr, 4); - freeaddrinfo(res); - return 0; - } else { + result = 0; + break; } } - return -1; + freeaddrinfo(res); + return result; } - return (err == EAI_AGAIN) ? 1 : -1; #else struct hostent *ent; From nickm at seul.org Thu Jun 30 06:56:02 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 30 Jun 2005 02:56:02 -0400 (EDT) Subject: [or-cvs] Fix an fd leak in start_daemon Message-ID: <20050630065602.6F9DF14080BE@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv26346/src/common Modified Files: util.c Log Message: Fix an fd leak in start_daemon Index: util.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/util.c,v retrieving revision 1.210 retrieving revision 1.211 diff -u -d -r1.210 -r1.211 --- util.c 11 Jun 2005 05:31:15 -0000 1.210 +++ util.c 30 Jun 2005 06:56:00 -0000 1.211 @@ -1418,6 +1418,8 @@ log_fn(LOG_ERR,"dup2 failed. Exiting."); exit(1); } + if (nullfd > 2) + close(nullfd); write(daemon_filedes[1], &c, sizeof(char)); /* signal success */ close(daemon_filedes[1]); } From nickm at seul.org Thu Jun 30 07:17:40 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 30 Jun 2005 03:17:40 -0400 (EDT) Subject: [or-cvs] Make errors retrievable from tor_socketpair; resolve bug 163. Message-ID: <20050630071740.C0840140810D@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv26913/src/common Modified Files: compat.c Log Message: Make errors retrievable from tor_socketpair; resolve bug 163. Index: compat.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/compat.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- compat.c 27 Jun 2005 23:40:17 -0000 1.57 +++ compat.c 30 Jun 2005 07:17:38 -0000 1.58 @@ -294,15 +294,17 @@ * be able to read while localhost is down later (the socket pair may * even close, depending on OS-specific timeouts). * - * XXX Bug: this function assumes errno is how you report errors, but - * that isn't the case for Windows, which is where it's most likely - * to be called. + * Returns 0 on success and -errno on failure; do not rely on the value + * of errno or WSAGetLastSocketError(). **/ +/* It would be nicer just to set errno, but that won't work for windows. */ int tor_socketpair(int family, int type, int protocol, int fd[2]) { #ifdef HAVE_SOCKETPAIR - return socketpair(family, type, protocol, fd); + int r; + r = socketpair(family, type, protocol, fd); + return r < 0 ? -errno : r; #else /* This socketpair does not work when localhost is down. So * it's really not the same thing at all. But it's close enough @@ -315,6 +317,7 @@ struct sockaddr_in listen_addr; struct sockaddr_in connect_addr; int size; + int saved_errno = -1; if (protocol #ifdef AF_UNIX @@ -322,24 +325,22 @@ #endif ) { #ifdef MS_WINDOWS - errno = WSAEAFNOSUPPORT; + return -WSAEAFNOSUPPORT; #else - errno = EAFNOSUPPORT; + return -EAFNOSUPPORT; #endif - return -1; } if (!fd) { - errno = EINVAL; - return -1; + return -EINVAL; } listener = socket(AF_INET, type, 0); if (listener == -1) - return -1; + return -tor_socket_errno(-1); if (!SOCKET_IS_POLLABLE(listener)) { log_fn(LOG_WARN, "Too many connections; can't open socketpair"); tor_close_socket(listener); - return -1; + return -ENCONN; } memset(&listen_addr, 0, sizeof(listen_addr)); listen_addr.sin_family = AF_INET; @@ -347,13 +348,13 @@ listen_addr.sin_port = 0; /* kernel chooses port. */ if (bind(listener, (struct sockaddr *) &listen_addr, sizeof (listen_addr)) == -1) - goto tidy_up_and_fail; + goto tidy_up_and_fail; if (listen(listener, 1) == -1) - goto tidy_up_and_fail; + goto tidy_up_and_fail; connector = socket(AF_INET, type, 0); if (connector == -1) - goto tidy_up_and_fail; + goto tidy_up_and_fail; if (!SOCKET_IS_POLLABLE(connector)) { log_fn(LOG_WARN, "Too many connections; can't open socketpair"); goto tidy_up_and_fail; @@ -361,33 +362,33 @@ /* We want to find out the port number to connect to. */ size = sizeof(connect_addr); if (getsockname(listener, (struct sockaddr *) &connect_addr, &size) == -1) - goto tidy_up_and_fail; + goto tidy_up_and_fail; if (size != sizeof (connect_addr)) - goto abort_tidy_up_and_fail; + goto abort_tidy_up_and_fail; if (connect(connector, (struct sockaddr *) &connect_addr, sizeof(connect_addr)) == -1) - goto tidy_up_and_fail; + goto tidy_up_and_fail; size = sizeof(listen_addr); acceptor = accept(listener, (struct sockaddr *) &listen_addr, &size); if (acceptor == -1) - goto tidy_up_and_fail; + goto tidy_up_and_fail; if (!SOCKET_IS_POLLABLE(acceptor)) { log_fn(LOG_WARN, "Too many connections; can't open socketpair"); goto tidy_up_and_fail; } if (size != sizeof(listen_addr)) - goto abort_tidy_up_and_fail; + goto abort_tidy_up_and_fail; tor_close_socket(listener); /* Now check we are talking to ourself by matching port and host on the two sockets. */ if (getsockname(connector, (struct sockaddr *) &connect_addr, &size) == -1) - goto tidy_up_and_fail; + goto tidy_up_and_fail; if (size != sizeof (connect_addr) || listen_addr.sin_family != connect_addr.sin_family || listen_addr.sin_addr.s_addr != connect_addr.sin_addr.s_addr || listen_addr.sin_port != connect_addr.sin_port) { - goto abort_tidy_up_and_fail; + goto abort_tidy_up_and_fail; } fd[0] = connector; fd[1] = acceptor; @@ -396,22 +397,20 @@ abort_tidy_up_and_fail: #ifdef MS_WINDOWS - errno = WSAECONNABORTED; + saved_errno = WSAECONNABORTED; #else - errno = ECONNABORTED; /* I hope this is portable and appropriate. */ + saved_errno = ECONNABORTED; /* I hope this is portable and appropriate. */ #endif tidy_up_and_fail: - { - int save_errno = errno; - if (listener != -1) - tor_close_socket(listener); - if (connector != -1) - tor_close_socket(connector); - if (acceptor != -1) - tor_close_socket(acceptor); - errno = save_errno; - return -1; - } + if (saved_errno < 0) + saved_errno = errno; + if (listener != -1) + tor_close_socket(listener); + if (connector != -1) + tor_close_socket(connector); + if (acceptor != -1) + tor_close_socket(acceptor); + return -saved_errno; #endif } From nickm at seul.org Thu Jun 30 07:17:40 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 30 Jun 2005 03:17:40 -0400 (EDT) Subject: [or-cvs] Make errors retrievable from tor_socketpair; resolve bug 163. Message-ID: <20050630071740.F1F281408EE7@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv26913/src/or Modified Files: connection_edge.c cpuworker.c dns.c Log Message: Make errors retrievable from tor_socketpair; resolve bug 163. Index: connection_edge.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v retrieving revision 1.334 retrieving revision 1.335 diff -u -d -r1.334 -r1.335 --- connection_edge.c 29 Jun 2005 21:46:55 -0000 1.334 +++ connection_edge.c 30 Jun 2005 07:17:38 -0000 1.335 @@ -1207,12 +1207,13 @@ { int fd[2]; connection_t *conn; + int err; log_fn(LOG_INFO,"Making AP bridge to %s:%d ...",safe_str(address),port); - if (tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fd) < 0) { + if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) < 0) { log(LOG_WARN,"Couldn't construct socketpair (%s). Network down? Delaying.", - tor_socket_strerror(tor_socket_errno(-1))); + tor_socket_strerror(-err)); return -1; } Index: cpuworker.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/cpuworker.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- cpuworker.c 11 Jun 2005 18:52:11 -0000 1.83 +++ cpuworker.c 30 Jun 2005 07:17:38 -0000 1.84 @@ -301,11 +301,11 @@ int *fdarray; int fd; connection_t *conn; + int err; fdarray = tor_malloc(sizeof(int)*2); - if (tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray) < 0) { - log(LOG_ERR, "Couldn't construct socketpair: %s", - tor_socket_strerror(tor_socket_errno(-1))); + if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray)) < 0) { + log(LOG_ERR, "Couldn't construct socketpair: %s", tor_socket_strerror(-err)); tor_cleanup(); tor_free(fdarray); exit(1); Index: dns.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/dns.c,v retrieving revision 1.160 retrieving revision 1.161 diff -u -d -r1.160 -r1.161 --- dns.c 28 Jun 2005 01:53:15 -0000 1.160 +++ dns.c 30 Jun 2005 07:17:38 -0000 1.161 @@ -824,11 +824,11 @@ int *fdarray; int fd; connection_t *conn; + int err; fdarray = tor_malloc(sizeof(int)*2); - if (tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray) < 0) { - log(LOG_ERR, "Couldn't construct socketpair: %s", - tor_socket_strerror(tor_socket_errno(-1))); + if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray)) < 0) { + log(LOG_ERR, "Couldn't construct socketpair: %s", tor_socket_strerror(-err)); tor_cleanup(); tor_free(fdarray); exit(1); From nickm at seul.org Thu Jun 30 07:19:22 2005 From: nickm at seul.org (Nick Mathewson) Date: Thu, 30 Jun 2005 03:19:22 -0400 (EDT) Subject: [or-cvs] Mark a few bugs as done or as nonstarters Message-ID: <20050630071922.E313F14081A9@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv27131/doc Modified Files: TODO Log Message: Mark a few bugs as done or as nonstarters Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.329 retrieving revision 1.330 diff -u -d -r1.329 -r1.330 --- TODO 29 Jun 2005 21:51:30 -0000 1.329 +++ TODO 30 Jun 2005 07:19:20 -0000 1.330 @@ -104,8 +104,9 @@ o Look for v1 descriptor if available, else look for v0 descriptor. o Use new INTRODUCE protocol if allowed. . Verify that new code works. - - it looks like tor_assert writes to stderr. what happens if - stderr was closed and is now something else? uh. + X It looks like tor_assert writes to stderr. This isn't a problem, because + start_daemon doesn't close fd 2; it uses dup2 to replace it with + a file open to /dev/null. - christian grothoff's attack of infinite-length circuit. the solution is to have a separate 'extend-data' cell type which is used for the first N data cells, and only @@ -118,8 +119,8 @@ (AGL had a patch; consider applying it.) - recommended-versions for client / server ? - warn if listening for SOCKS on public IP. - - Forward-compatibility: add "needclientversion" option or "opt critical" - prefix. + o Forward-compatibility: add "needclientversion" option or "opt critical" + prefix? No, just make unknown keywords less critical. - cpu fixes: - see if we should make use of truncate to retry o hardware accelerator support (configure engines.) From arma at seul.org Thu Jun 30 19:53:32 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 30 Jun 2005 15:53:32 -0400 (EDT) Subject: [or-cvs] remove duplicate sentence Message-ID: <20050630195332.A5DCB1408FE0@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: faq-abuse.html Log Message: remove duplicate sentence Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- faq-abuse.html 30 Jun 2005 01:13:13 -0000 1.13 +++ faq-abuse.html 30 Jun 2005 19:53:30 -0000 1.14 @@ -147,7 +147,7 @@

        If you run a Tor server that allows exit connections (such as the default exit policy), it's probably safe to say that you will eventually -hear from somebody. Abuse complaints can come in a variety of forms. Abuse +hear from somebody. Abuse complaints may come in a variety of forms. For example:

        • Somebody connects to hotmail, and sends a ransom note to a From arma at seul.org Thu Jun 30 22:56:10 2005 From: arma at seul.org (arma at seul.org) Date: Thu, 30 Jun 2005 18:56:10 -0400 (EDT) Subject: [or-cvs] clean up volunteer page Message-ID: <20050630225610.28F561408063@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: volunteer.html Log Message: clean up volunteer page Index: volunteer.html =================================================================== RCS file: /home2/or/cvsroot/website/volunteer.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- volunteer.html 29 Jun 2005 19:23:25 -0000 1.7 +++ volunteer.html 30 Jun 2005 22:56:08 -0000 1.8 @@ -65,26 +65,26 @@
        • Change server descriptors to declare log level.
        • Add in support for clients to avoid servers that are too loggy based upon user configuration of acceptable log level.
        • Separate node discovery from routing to allow neat extensions. [Goodell?]
        • -
          • +
            • Add SetServerStatus control event to adjust verified/running status of nodes.
            • Add NoDownload config option to prevent regular directory downloads from happening.
            • -
            +
        • Choosing exit node by meta-data, e.g. country.
        • Use cpuworker for more heavy lifting.
        • -
          • +
            • Signing (and verifying) hidserv descriptors
            • Signing (and verifying) intro/rend requests
            • Signing (and verifying) router descriptors
            • Signing (and verifying) directories
            • Doing TLS handshake (this is very hard to separate out, though)
            • -
            +
        • Buffer size pool: allocate a maximum size for all buffers, not a maximum size for each buffer. So we don't have to give up as quickly (and kill the thickpipe!) when there's congestion.
        • Add alternative versions of crypto.c and tortls.c to use libnss or libgcrypt+gnutls.
        • Implement a way to stop falling back to forbidden ports when FascistFirewall blocks all good dirservers, if there is already a good, cached directory locally.
        • Extend our NSIS-based windows installer to include FreeCap and/or Privoxy.
        • Develop a way to handle OS X installation and uninstallation.
        • Develop a GUI or other controller program, to do configuration, etc. See our control specification for details, and the rudimentary demonstration Python control script.
        • -
          • +
            • Design an interface for the control program. You can use any license you want, but we'd recommend 3-clause BSD or maybe GPL; and we can only help out if your license conforms to the DFSG.
            • Periodically people running servers tells us they want to have one BandwidthRate during some part of the day, and a different @@ -95,7 +95,7 @@ until appropriate times and then do its tweak (that's probably more portable). Can somebody write one for us and we'll put it inside tor/contrib/?
            • -
            +
        • Develop a way to become a Windows NT service.
        • Develop a systray app for Tor under MS Windows (all versions).
        • Integrate a good (portable, fast, clean, BSD-free) asynchronous DNS library so we don't have to keep forking DNS worker threads to do gethostbyname.
        • @@ -104,40 +104,39 @@

          Documentation Challenges

          • Write server instructions for OSX and Windows operators.
          • -
          • Improve and clarify the wiki entry on port forwarding. url?
          • +
          • Improve and clarify the wiki entry on port forwarding.
          • Document how to do exit node caching: tie into squid or other caching web proxy.
          • Help maintain this website; code, content, css, overall layout,
          • Help with documentation
          • Help consolidate documentation. We may have too much documentation. It's spread out too far and duplicates itself in places.
          • Help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
          • +
          • If you know a question that should go on the FAQ Wiki, please +add it and answer it.
          • If you know the answer to a Wiki question in the "unanswered FAQs" list, please answer it.
          • Take a look at Martin's Squid and Tor page, and update it to reflect Tor's RedirectExit config option.
          • Help translate the web page and documentation into other languages. See the translation guidelines if you want to help out. (Examples: French , Persian and Vietnamese.)
          • -
          • If you know a question that should go on the FAQ Wiki, please -add it and answer it.
          • Update website to include the country flags for each language into which the website has been translated.
          • -
          • Replace the old tor-manual.html and replace it with the new tor stable manual.

          Testing Challenges

          • Test out why some of our tor servers have dns resolvers that resolve unknown addresses to 127.0.0.1.
          • -
            • +
              • Identify the servers that experience this issue.
              • Identify how to cause and repair the issue in BIND, DJBDNS, or whatever daemon the misconfigured servers use.
              • -
              +
          • Figure out how to setup web proxy gateways to let normal people browse hidden services. (This has been done a few times, but nobody has sent us code.)
          • Investigate privoxy vs. freecap for win32 clients
          • Evaluate, create, and document a list of programs that work with Tor.
          • -
          • Perform a security analysis of Tor with fuzz"fuzz". Determine if there good libraries out there for what we want. Win fame by getting credit when we put out a new release because of you!
          • +
          • Perform a security analysis of Tor with "fuzz"". Determine if there good libraries out there for what we want. Win fame by getting credit when we put out a new release because of you!
          • Website volume fingerprinting attacks (Back et al, Hintz). Defenses include a large cell size, defensive dropping, etc. How well does each approach work?
          • The end-to-end traffic confirmation attack. We need to study long-range dummies more, along with traffic shaping. How much traffic of @@ -151,14 +150,14 @@

            Research Challenges

            • Arranging membership management for independence.
            • -
              • +
                • Sybil defenses without having a human bottleneck.
                • How to gather random sample of nodes.
                • How to handle nodelist recommendations.
                • Consider incremental switches: a p2p tor with only 50 users has different anonymity properties than one with 10k users, and should be treated differently.
                • -
                +
            • Incentives to relay; incentives to exit.
            • Allowing dissidents to relay through Tor clients.
            • Experiment with mid-latency systems. How do they impact usability, @@ -171,7 +170,7 @@
            • Attacking freenet-gnunet/timing-delay-randomness-arguments.
            • Is exiting from the middle of the circuit always a bad idea?
            • IPv6 support (For exit addresses)
            • -
              • +
                • Spec issue: if a resolve returns an IP4 and an IP6 address, which to use?
                • Add to exit policy code
                • @@ -180,7 +179,7 @@ a generalize address struct.
                • Change relay cell types to accept new addresses.
                • Add flag to serverdescs to tell whether IPv6 is supported.
                • -
                +
            • patch tsocks with our current patches + gethostbyname, getpeername, etc.
            • make freecap (or whichever) do what we want.
            • From phobos at seul.org Tue Jun 7 16:13:41 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 7 Jun 2005 12:13:41 -0400 (EDT) Subject: [or-cvs] faq.html: Wrote a blurb about the Abuse FAQ for Tor Server ... Message-ID: <20050607161341.DE3AA1408259@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv12295 Modified Files: faq.html Log Message: faq.html: Wrote a blurb about the Abuse FAQ for Tor Server Operators, and linked to faq-abuse.html. Index: faq.html =================================================================== RCS file: /home/or/cvsroot/website/faq.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- faq.html 16 May 2005 07:35:41 -0000 1.7 +++ faq.html 7 Jun 2005 16:13:39 -0000 1.8 @@ -57,6 +57,11 @@ that arise from the Tor project.

              +

              +The Abuse FAQ for Tor Server Operators is a collection +of common questions and issues discussed when running a Tor server. +

              +
    From nickm at seul.org Tue Jun 7 17:32:35 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 13:32:35 -0400 (EDT) Subject: [or-cvs] Use correct errno from libevent on win32 Message-ID: <20050607173235.AD9DF1408401@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv20160/src/or Modified Files: main.c Log Message: Use correct errno from libevent on win32 Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.508 retrieving revision 1.509 diff -u -d -r1.508 -r1.509 --- main.c 6 Jun 2005 20:06:10 -0000 1.508 +++ main.c 7 Jun 2005 17:32:33 -0000 1.509 @@ -941,7 +941,7 @@ /* let catch() handle things like ^c, and otherwise don't worry about it */ if (loop_result < 0) { - int e = errno; + int e = tor_socket_errno(-1); /* let the program survive things like ^z */ if (e != EINTR && !ERRNO_IS_EINPROGRESS(e)) { #ifdef HAVE_EVENT_GET_METHOD From nickm at seul.org Tue Jun 7 17:34:42 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 13:34:42 -0400 (EDT) Subject: [or-cvs] backport: Use correct errno from libevent on win32 Message-ID: <20050607173442.6C5401408401@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv20275/src/or Modified Files: Tag: tor-0_1_0-patches main.c Log Message: backport: Use correct errno from libevent on win32 Index: main.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.505.2.1 retrieving revision 1.505.2.2 diff -u -d -r1.505.2.1 -r1.505.2.2 --- main.c 6 Jun 2005 20:10:02 -0000 1.505.2.1 +++ main.c 7 Jun 2005 17:34:40 -0000 1.505.2.2 @@ -941,7 +941,7 @@ /* let catch() handle things like ^c, and otherwise don't worry about it */ if (loop_result < 0) { - int e = errno; + int e = tor_socket_errno(-1); /* let the program survive things like ^z */ if (e != EINTR && !ERRNO_IS_EINPROGRESS(e)) { #ifdef HAVE_EVENT_GET_METHOD From arma at seul.org Tue Jun 7 17:34:43 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 7 Jun 2005 13:34:43 -0400 (EDT) Subject: [or-cvs] clean up faq-abuse page; add anchors. Message-ID: <20050607173443.A674F1408413@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: faq-abuse.html Log Message: clean up faq-abuse page; add anchors. Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- faq-abuse.html 7 Jun 2005 11:35:38 -0000 1.4 +++ faq-abuse.html 7 Jun 2005 17:34:41 -0000 1.5 @@ -22,7 +22,7 @@ | Download | Docs | Users - | FAQs + | FAQs | Contribute | Developers | Research @@ -43,109 +43,260 @@

    Abuse FAQ for Tor Server Operators


    - -

    - +

    Doesn't Tor enable criminals to do bad things?

    -

    Criminals can already do bad things. Since they're willing to break -laws, they already have lots of options available that provide better privacy than Tor provides. They can steal cell phones, use them, and throw them in a ditch; they can crack into computers in Korea or Brazil and use them to launch abusive activities; they can spread viruses that take control of literally millions of Windows machines around the world.

    -

    Tor aims to provide protection for ordinary people who want to follow the law. Only criminals have privacy right now; we need to fix that.

    -

    +

    Criminals can already do bad things. Since they're willing to +break laws, they already have lots of options available that provide +better privacy than Tor provides. They can steal cell phones, +use them, and throw them in a ditch; they can crack into computers +in Korea or Brazil and use them to launch abusive activities; they +can spread viruses that take control of literally millions of Windows +machines around the world.

    +

    Tor aims to provide protection for ordinary people who want to follow +the law. Only criminals have privacy right now; we need to fix that.

    + +

    Isn't it just a tradeoff: accepting the bad uses for the good ones?

    No, we don't think that's how it works in the case of Tor.

    -

    There are lots of ways to get anonymity on the net, some legal and some illegal. As we explained above, many of the illegal approaches can provide stronger anonymity than Tor can provide, because they can control literally millions of computers via spyware, viruses, and other techniques.

    -

    Criminals and other bad people have the motivation to learn how to get good anonymity, and many have the motivation to pay well to achieve it. Being able to steal and reuse the identities of innocent victims (identify theft) makes it even easier. Normal people, on the other hand, don't typically have the time or money to spend figuring out how to get privacy online. This is the worst of all possible worlds.

    -

    So yes, criminals could in theory use Tor, but they already have better options, and it seems unlikely that taking Tor away from the world will stop them from doing their bad things. At the same time, Tor and other privacy measures can fight identity theft, physical crimes like stalking, and so on.

    -

    +

    There are lots of ways to get anonymity on the net, some legal and +some illegal. As we explained above, many of the illegal approaches +can provide stronger anonymity than Tor can provide, because they can +control literally millions of computers via spyware, viruses, and other +techniques.

    + +

    Criminals and other bad people have the motivation to learn how to +get good anonymity, and many have the motivation to pay well to achieve +it. Being able to steal and reuse the identities of innocent victims +(identify theft) makes it even easier. Normal people, on the other hand, +don't typically have the time or money to spend figuring out how to get +privacy online. This is the worst of all possible worlds.

    + +

    So yes, criminals could in theory use Tor, but they already have +better options, and it seems unlikely that taking Tor away from the +world will stop them from doing their bad things. At the same time, Tor +and other privacy measures can fight identity theft, physical +crimes like stalking, and so on.

    + +

    What about distributed denial of service attacks?

    -

    Distributed denial of service attacks typically rely on having a group of thousands of computers all sending floods of traffic to a victim. Since the goal is to overpower the bandwidth of the victim, they typically send UDP packets since those don't require handshakes or coordination.

    -

    But because Tor only transports correctly-formed TCP streams, not all IP packets, you cannot send UDP packets over Tor. (You can't do specialized forms of this attack like SYN flooding either.) So ordinary DDoS attacks are not possible over Tor. Tor also doesn't allow bandwidth amplification attacks against external sites: you need to send in a byte for every byte which the Tor network will send to your destination. So in general, attackers who control enough bandwidth to launch an effective DDoS attack can do it just fine without Tor.

    -

    And if this argument doesn't convince you, go try Tor and see how much aggregate throughput you can eke out of it, then come back to us if you're still worried.

    -

    +

    Distributed denial of service attacks typically rely on having a group +of thousands of computers all sending floods of traffic to a victim. Since +the goal is to overpower the bandwidth of the victim, they typically send +UDP packets since those don't require handshakes or coordination.

    +

    But because Tor only transports correctly-formed TCP streams, not +all IP packets, you cannot send UDP packets over Tor. (You can't do +specialized forms of this attack like SYN flooding either.) So ordinary +DDoS attacks are not possible over Tor. Tor also doesn't allow bandwidth +amplification attacks against external sites: you need to send in a byte +for every byte which the Tor network will send to your destination. So +in general, attackers who control enough bandwidth to launch an effective +DDoS attack can do it just fine without Tor.

    + +

    And if this argument doesn't convince you, go try Tor and see how +much aggregate throughput you can eke out of it, then come back to us +if you're still worried.

    + +

    What about spammers?

    -

    The default Tor exit policy rejects all outgoing port 25 (SMTP) traffic. So sending spam mail through Tor isn't going to work. It's possible that some server operators will enable port 25 on their particular exit node, in which case only that computer will allow outgoing mails; but that individual could just set up an open mail relay too, independent of Tor.

    -

    So far, no Tor server has enabled outgoing port 25 in his exit policy.

    +

    The default Tor exit policy rejects all outgoing port 25 (SMTP) +traffic. So sending spam mail through Tor isn't going to work. It's +possible that some server operators will enable port 25 on their +particular exit node, in which case only that computer will allow outgoing +mails; but that individual could just set up an open mail relay too, +independent of Tor.

    + +

    So far, no Tor server has enabled outgoing port 25 in his exit +policy.

    +

    In short, Tor isn't useful for spammers.

    -

    +

    How do Tor exit policies work?

    -

    Each Tor server has an exit policy that specifies what sort of outbound connections are allowed or refused from that server. The exit policies are propagated to the client via the directory, so clients will automatically avoid picking exit nodes that would refuse to exit to their intended destination.

    -

    This way each server can decide the services he wants to allow connections to, based on abuse potential and his own situation.

    -

    +

    Each Tor server has an exit policy that specifies what sort of +outbound connections are allowed or refused from that server. The exit +policies are propagated to the client via the directory, so clients +will automatically avoid picking exit nodes that would refuse to exit +to their intended destination.

    +

    This way each server can decide the services he wants to allow +connections to, based on abuse potential and his own situation.

    + +

    Does Tor get much abuse?

    -

    Not much, in the grand scheme of things. We've been running the network since October 2003, and it's only generated a handful of complaints. Of course, like all privacy-oriented networks on the net, we attract our share of jerks. Tor's exit policies help separate the role of "willing to donate resources to the network" from the role of "willing to deal with exit abuse complaints", so we hope our network is more sustainable than past attempts at anonymity networks.

    -

    Since Tor has many good uses as well, we feel that we're doing pretty well at striking a balance currently.

    -

    +

    Not much, in the grand scheme of things. We've been running the network +since October 2003, and it's only generated a handful of complaints. Of +course, like all privacy-oriented networks on the net, we attract our +share of jerks. Tor's exit policies help separate the role of "willing +to donate resources to the network" from the role of "willing to deal +with exit abuse complaints", so we hope our network is more sustainable +than past attempts at anonymity networks.

    +

    Since Tor has many good uses as +well, we feel that we're doing pretty well at striking a balance +currently.

    + +

    So what should I expect if I run a server?

    -

    If you run a Tor server that allows exit connections (such as the default exit policy), it's probably safe to say that you will eventually hear from somebody. Abuse complaints can come in a variety of forms. The main ones so far have taken the following form:

    +

    If you run a Tor server that allows exit connections (such as the +default exit policy), it's probably safe to say that you will eventually +hear from somebody. Abuse complaints can come in a variety of forms. The +main ones so far have taken the following form:

      -
    • Somebody connects to hotmail, and sends a criminal mail somewhere. The FBI sends you a polite email, you explain that you run a Tor server, and they say 'oh well' and leave you alone. [Port 80]

      -
    • -
    • Somebody tries to get you shut down by using Tor to connect to google groups and posting spam to usenet, and then sending an angry mail to your ISP about how you're destroying the world. [Port 80]

      -
    • -
    • Somebody connects to an irc network and makes a nuisance of himself. Your ISP gets polite mail about how your computer has been compromised; and/or your computer gets ddosed. [Port 6667]

      -
    • -
    • Somebody uses Tor to download a Vin Diesel movie, and your ISP gets a DMCA takedown notice. According to our lawyers (and this convinced the Harvard general counsel), your ISP can totally ignore this notice with no liability problems. See Tor DMCA Response. [Arbitrary ports]

      -
    • +
    • Somebody connects to hotmail, and sends a criminal mail somewhere. The +FBI sends you a polite email, you explain that you run a Tor server, +and they say 'oh well' and leave you alone. [Port 80]
    • +
    • Somebody tries to get you shut down by using Tor to connect to google +groups and posting spam to usenet, and then sending an angry mail to +your ISP about how you're destroying the world. [Port 80]
    • +
    • Somebody connects to an irc network and makes a nuisance of +himself. Your ISP gets polite mail about how your computer has been +compromised; and/or your computer gets ddosed. [Port 6667]
    • +
    • Somebody uses Tor to download a Vin Diesel movie, and +your ISP gets a DMCA takedown notice. According to our lawyers +(and this convinced the Harvard general counsel), your ISP can +totally ignore this notice with no liability problems. See EFF's Tor DMCA +Response Template. [Arbitrary ports]
    -

    You might also find that your Tor server's IP is blocked from accessing some Internet sites/services. This might happen regardless of your exit policy, because some groups don't seem to know or care that Tor has exit policies. (If you have a spare IP not used for other activities, you might consider running your Tor server on it.) For example,

    + +

    You might also find that your Tor server's IP is blocked from accessing +some Internet sites/services. This might happen regardless of your exit +policy, because some groups don't seem to know or care that Tor has +exit policies. (If you have a spare IP not used for other activities, +you might consider running your Tor server on it.) For example,

    +
      -
    • Wikipedia is currently blocking many Tor server IPs from writing (reading still works), because they haven't figured out internally how to deal with the fact that they want to provide open access but they also have no ways to control abuse to their website. We're working with them to resolve this.

      -
    • -
    • It seems that SORBS is putting some Tor server IPs on their email blacklist as well. They do this because they passively detect whether your server connects to certain IRC networks, and they conclude from this that your server is capable of spamming. We're working with them to teach them that not all software works this way. Until then, we recommend you avoid them, and teach your friends (if they use them) to avoid them too.

      -
    • +
    • Wikipedia is currently blocking many Tor server IPs from writing +(reading still works), because they haven't figured out internally how +to deal with the fact that they want to provide open access but they +also have no ways to control abuse to their website. We're working with +them to resolve this.
    • +
    • It seems that SORBS is putting some Tor server IPs on their email +blacklist as well. They do this because they passively detect whether your +server connects to certain IRC networks, and they conclude from this that +your server is capable of spamming. We're working with them to teach them +that not all software works this way. Until then, we recommend you avoid +them, and teach your friends (if they use them) to avoid them too.
    -

    +

    Tor is banned from the IRC network I want to use.

    -

    Sometimes jerks make use of Tor to troll IRC channels. This abuse results in IP-specific temporary bans ("klines" in IRC lingo), as the network operators try to keep the troll off of their network.

    -

    This response underscores a fundamental flaw in IRC's security model: they assume that IP addresses equate to humans, and by banning the IP address they can ban the human. In reality this is not the case -- many such trolls routinely make use of the literally millions of open proxies and compromised computers around the Internet. The IRC networks are fighting a losing battle of trying to block all these nodes, and an entire cottage industry of blacklists and counter-trolls has sprung up based on this flawed security model (not unlike the antivirus industry). The Tor network is just a drop in the bucket here.

    -

    On the other hand, from the viewpoint of IRC server operators, security is not an all-or-nothing thing. By responding quickly to trolls or any other social attack, it may be possible to make the attack scenario less attractive to the attacker. And most individual IP addresses do equate to individual humans, on any given IRC network at any given time. The exceptions include NAT gateways which may be allocated access as special cases. While it's a losing battle to try to stop the use of open proxies, it's not generally a losing battle to keep klining a single ill-behaved IRC user until that user gets bored and goes away.

    -

    But the real answer is to implement application-level auth systems, to let in well-behaving users and keep out badly-behaving users. This needs to be based on some property of the human (such as a password he knows), not some property of the way his packets are transported.

    -

    Of course, not all IRC networks are trying to ban Tor nodes. After all, quite a few people use Tor to IRC in privacy in order to carry on legitimate communications without tying them to their real-world identity. Each IRC network needs to decide for itself if blocking a few more of the millions of IPs that bad people can use is worth losing the contributions from the well-behaved Tor users.

    -

    If you're being blocked, have a discussion with the network operators and explain the issues to them. They may not be aware of the existence of Tor at all, or they may not be aware that the hostnames they're klining are Tor exit nodes. If you explain the problem, and they conclude that Tor ought to be blocked, you may want to consider moving to a network that is more open to free speech. Maybe inviting them to #tor on irc.oftc.net helps them show that we are not all evil people.

    +

    Sometimes jerks make use of Tor to troll IRC channels. This abuse +results in IP-specific temporary bans ("klines" in IRC lingo), as the +network operators try to keep the troll off of their network.

    + +

    This response underscores a fundamental flaw in IRC's security model: +they assume that IP addresses equate to humans, and by banning the +IP address they can ban the human. In reality this is not the case -- +many such trolls routinely make use of the literally millions of open +proxies and compromised computers around the Internet. The IRC networks +are fighting a losing battle of trying to block all these nodes, +and an entire cottage industry of blacklists and counter-trolls has +sprung up based on this flawed security model (not unlike the antivirus +industry). The Tor network is just a drop in the bucket here.

    + +

    On the other hand, from the viewpoint of IRC server operators, security +is not an all-or-nothing thing. By responding quickly to trolls or +any other social attack, it may be possible to make the attack scenario +less attractive to the attacker. And most individual IP addresses do +equate to individual humans, on any given IRC network at any given time. +The exceptions include NAT gateways which may be allocated access as +special cases. While it's a losing battle to try to stop the use of open +proxies, it's not generally a losing battle to keep klining a single +ill-behaved IRC user until that user gets bored and goes away.

    + +

    But the real answer is to implement application-level auth systems, +to let in well-behaving users and keep out badly-behaving users. This +needs to be based on some property of the human (such as a password he +knows), not some property of the way his packets are transported.

    + +

    Of course, not all IRC networks are trying to ban Tor nodes. After +all, quite a few people use Tor to IRC in privacy in order to carry +on legitimate communications without tying them to their real-world +identity. Each IRC network needs to decide for itself if blocking a few +more of the millions of IPs that bad people can use is worth losing the +contributions from the well-behaved Tor users.

    + +

    If you're being blocked, have a discussion with the network operators +and explain the issues to them. They may not be aware of the existence of +Tor at all, or they may not be aware that the hostnames they're klining +are Tor exit nodes. If you explain the problem, and they conclude that +Tor ought to be blocked, you may want to consider moving to a network that +is more open to free speech. Maybe inviting them to #tor on irc.oftc.net +helps them show that we are not all evil people.

    +

    Finally, if you become aware of an IRC network which seems to be -blocking Tor, or a single Tor exit node, please put that information on -BlockingIrc so that others can share. At least one IRC network consults that page to unblock exit nodes which have been blocked inadvertently.

    -

    +blocking Tor, or a single Tor exit node, please put that information on BlockingIrc +so that others can share. At least one IRC network consults that page +to unblock exit nodes which have been blocked inadvertently.

    +

    Your nodes are banned from the mail server I want to use.

    -

    Even though Tor isn't useful for spamming, some over-zealous blacklisters seem to think that all open networks like Tor should be boycotted. They don't understand how Tor works (e.g. that it has exit policies), and don't seem to care to understand it. If your server administrators decide to make use of these blacklists to refuse incoming mail, you should have a conversation with them and explain how Tor works.

    -

    +

    Even though Tor isn't useful for +spamming, some over-zealous blacklisters seem to think that all +open networks like Tor should be boycotted. They don't understand how +Tor works (e.g. that it has exit policies), and don't seem to care to +understand it. If your server administrators decide to make use of these +blacklists to refuse incoming mail, you should have a conversation with +them and explain how Tor works.

    +

    I want to ban the Tor network from my service.

    -

    First, ask yourself if there's a way to do application-level decisions to separate the legitimate users from the jerks. For example, you might have certain areas of the site, or certain privileges like posting, available only to people who are registered. You could set up this distinction only for certain IP addresses such as Tor exit nodes. This way you can have multi-tiered access and not have to ban everything.

    -

    Second, consider that thousands of people use Tor every day to protect against data-gathering corporations like Doubleclick while going about their normal activities. Some Tor users may be legitimately connecting to your service right now to carry on normal activities. You need to decide whether banning the Tor network is worth losing the contributions of these users, as well as potential future such users.

    -

    Lastly, please remember that Tor servers have individual exit policies. Many Tor servers do not allow exiting connections at all. Many of those that do, probably already disallow connections to your service. When you go about banning nodes, you should parse the exit policies and only block the ones that allow these connections; and you should keep in mind that exit policies can change (as well as the overall list of nodes in the network).

    -

    If you really want to do this, there is a python script to parse the Tor directory here.

    -

    +

    First, ask yourself if there's a way to do application-level decisions +to separate the legitimate users from the jerks. For example, you might +have certain areas of the site, or certain privileges like posting, +available only to people who are registered. You could set up this +distinction only for certain IP addresses such as Tor exit nodes. This +way you can have multi-tiered access and not have to ban everything.

    + +

    Second, consider that thousands of people use Tor every day to protect +against data-gathering corporations like Doubleclick while going about +their normal activities. Some Tor users may be legitimately connecting +to your service right now to carry on normal activities. You need to +decide whether banning the Tor network is worth losing the contributions +of these users, as well as potential future such users.

    + +

    Lastly, please remember that Tor servers have individual exit +policies. Many Tor servers do not allow exiting connections at +all. Many of those that do, probably already disallow connections to +your service. When you go about banning nodes, you should parse the +exit policies and only block the ones that allow these connections; +and you should keep in mind that exit policies can change (as well as +the overall list of nodes in the network).

    +

    If you really want to do this, there is a +python script to parse the Tor directory here.

    + +

    I have legal questions about Tor abuse.

    -

    We're only the developers. We can answer technical questions, but we're not the ones to talk to about legal questions or concerns.

    -

    Please take a look at the Tor Legal FAQ, and contact EFF directly if you have any further questions.

    -

    +

    We're only the developers. We can answer technical questions, but +we're not the ones to talk to about legal questions or concerns.

    + +

    Please take a look at the Tor Legal FAQ, +and contact EFF directly if you have any further questions.

    - Webmaster - - $Id$ + Webmaster - $Id$
    From nickm at seul.org Sat Jun 4 02:42:58 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 3 Jun 2005 22:42:58 -0400 (EDT) Subject: [or-cvs] Oops. I guess I would probably get more comments about thi... Message-ID: <20050604024258.5F4E914081A7@moria.seul.org> Update of /home/or/cvsroot/control/python In directory moria:/tmp/cvs-serv6608/python Added Files: .cvsignore TorCtl.py TorExample.py Log Message: Oops. I guess I would probably get more comments about this clever controller API/demo stuff if I actually committed it to CVS. Here then. --- NEW FILE: .cvsignore --- *.pyo *.pyc --- NEW FILE: TorCtl.py --- #!/usr/bin/python # TorCtl.py -- Python module to interface with Tor Control interface. # Copyright 2005 Nick Mathewson -- See LICENSE for licensing information. #$Id: TorCtl.py,v 1.1 2005/06/04 02:42:56 nickm Exp $ """ TorCtl -- Library to control Tor processes. See TorCtlDemo.py for example use. """ import binascii import os import sha import socket import struct import sys import threading import Queue __all__ = [ "MSG_TYPE", "EVENT_TYPE", "CIRC_STATUS", "STREAM_STATUS", "OR_CONN_STATUS", "SIGNAL", "ERR_STATUS", "TorCtlError", "ProtocolError", "ErrorReply", "Connection", "EventHandler", "DebugEventHandler", "parseHostAndPort" ] class _Enum: # Helper: define an ordered dense name-to-number 1-1 mapping. def __init__(self, start, names): self.nameOf = {} idx = start for name in names: setattr(self,name,idx) self.nameOf[idx] = name idx += 1 class _Enum2: # Helper: define an ordered sparse name-to-number 1-1 mapping. def __init__(self, **args): self.__dict__.update(args) self.nameOf = {} for k,v in args.items(): self.nameOf[v] = k # Message types that client or server can send. MSG_TYPE = _Enum(0x0000, ["ERROR", "DONE", "SETCONF", "GETCONF", "CONFVALUE", "SETEVENTS", "EVENT", "AUTH", "SAVECONF", "SIGNAL", "MAPADDRESS", "GETINFO", "INFOVALUE", "EXTENDCIRCUIT", "ATTACHSTREAM", "POSTDESCRIPTOR", "FRAGMENTHEADER", "FRAGMENT", "REDIRECTSTREAM", "CLOSESTREAM", "CLOSECIRCUIT", ]) # Make sure that the enumeration code is working. assert MSG_TYPE.SAVECONF == 0x0008 assert MSG_TYPE.CLOSECIRCUIT == 0x0014 # Types of "EVENT" message. EVENT_TYPE = _Enum(0x0001, ["CIRCSTATUS", "STREAMSTATUS", "ORCONNSTATUS", "BANDWIDTH", "OBSOLETE_LOG", "NEWDESC", "DEBUG_MSG", "INFO_MSG", "NOTICE_MSG", "WARN_MSG", "ERR_MSG", ]) assert EVENT_TYPE.ERR_MSG == 0x000B assert EVENT_TYPE.OBSOLETE_LOG == 0x0005 # Status codes for "CIRCSTATUS" events. CIRC_STATUS = _Enum(0x00, ["LAUNCHED", "BUILT", "EXTENDED", "FAILED", "CLOSED"]) # Status codes for "STREAMSTATUS" events STREAM_STATUS = _Enum(0x00, ["SENT_CONNECT", "SENT_RESOLVE", "SUCCEEDED", "FAILED", "CLOSED", "NEW_CONNECT", "NEW_RESOLVE", "DETACHED"]) # Status codes for "ORCONNSTATUS" events OR_CONN_STATUS = _Enum(0x00, ["LAUNCHED","CONNECTED","FAILED","CLOSED"]) # Signal codes for "SIGNAL" events. SIGNAL = _Enum2(HUP=0x01,INT=0x02,USR1=0x0A,USR2=0x0C,TERM=0x0F) # Error codes for "ERROR" events. ERR_CODES = { 0x0000 : "Unspecified error", 0x0001 : "Internal error", 0x0002 : "Unrecognized message type", 0x0003 : "Syntax error", 0x0004 : "Unrecognized configuration key", 0x0005 : "Invalid configuration value", 0x0006 : "Unrecognized byte code", 0x0007 : "Unauthorized", 0x0008 : "Failed authentication attempt", 0x0009 : "Resource exhausted", 0x000A : "No such stream", 0x000B : "No such circuit", 0x000C : "No such OR" } class TorCtlError(Exception): "Generic error raised by TorControl code." pass class ProtocolError(TorCtlError): "Raised on violations in Tor controller protocol" pass class ErrorReply(TorCtlError): "Raised when Tor controller returns an error" pass def parseHostAndPort(h): """Given a string of the form 'address:port' or 'address' or 'port' or '', return a two-tuple of (address, port) """ host, port = "localhost", 9100 if ":" in h: i = h.index(":") host = h[:i] try: port = int(h[i+1:]) except ValueError: print "Bad hostname %r"%h sys.exit(1) elif h: try: port = int(h) except ValueError: host = h return host, port def _unpack_singleton_msg(msg): """Helper: unpack a single packet. Return (None, minLength, body-so-far) on incomplete packet or (type,body,rest) on somplete packet """ if len(msg) < 4: return None, 4, msg length,type = struct.unpack("!HH",msg) if len(msg) >= 4+length: return type,msg[4:4+length],msg[4+length:] else: return None,4+length,msg def _minLengthToPack(bytes): """Return the minimum number of bytes needed to pack the message 'smg'""" whole,left = divmod(bytes,65535) if left: return whole*(65535+4)+4+left else: return whole*(65535+4) def _unpack_msg(msg): "returns as for _unpack_singleton_msg" tp,body,rest = _unpack_singleton_msg(msg) if tp != MSG_TYPE.FRAGMENTHEADER: return tp, body, rest if len(body) < 6: raise ProtocolError("FRAGMENTHEADER message too short") realType,realLength = struct.unpack("!HL", body[:6]) # Okay; could the message _possibly_ be here? minLength = _minLengthToPack(realLength+6) if len(msg) < minLength: return None, minLength, msg # Okay; optimistically try to build up the msg. soFar = [ body[6:] ] lenSoFarLen = len(body)-6 while len(rest)>=4 and lenSoFar < realLength: ln, tp = struct.unpack("!HH", rest[:4]) if tp != MSG_TYPE.FRAGMENT: raise ProtocolError("Missing FRAGMENT message") soFar.append(rest[4:4+ln]) lenSoFar += ln if 4+ln > len(rest): rest = "" leftInPacket = 4+ln-len(rest) else: rest = rest[4+ln:] leftInPacket=0 if lenSoFar == realLength: return realType, "".join(soFar), rest elif lenSoFar > realLength: raise ProtocolError("Bad fragmentation: message longer than declared") else: inOtherPackets = realLength-lenSoFar-leftInPacket minLength = _minLengthToPack(inOtherPackets) return None, len(msg)+leftInPacket+inOtherPackets, msg def _receive_singleton_msg(s): """Read a single packet from the socket s. """ body = "" header = s.recv(4) length,type = struct.unpack("!HH",header) if length: while length > len(body): body += s.recv(length-len(body)) return length,type,body def _receive_message(s): """Read a single message (possibly multi-packet) from the socket s.""" length, tp, body = _receive_singleton_msg(s) if tp != MSG_TYPE.FRAGMENTHEADER: return length, tp, body if length < 6: raise ProtocolError("FRAGMENTHEADER message too short") realType,realLength = struct.unpack("!HL", body[:6]) data = [ body[6:] ] soFar = len(data[0]) while 1: length, tp, body = _receive_singleton_msg(s) if tp != MSG_TYPE.FRAGMENT: raise ProtocolError("Missing FRAGMENT message") soFar += length data.append(body) if soFar == realLength: return realLength, realType, "".join(data) elif soFar > realLength: raise ProtocolError("FRAGMENT message too long!") def pack_message(type, body=""): """Given a message type and optional message body, generate a set of packets to send. """ length = len(body) if length < 65536: reqheader = struct.pack("!HH", length, type) return "%s%s"%(reqheader,body) fragheader = struct.pack("!HHHL", 65535, MSG_TYPE.FRAGMENTHEADER, type, length) msgs = [ fragheader, body[:65535-6] ] body = body[65535-6:] while body: if len(body) > 65535: fl = 65535 else: fl = len(body) fragheader = struct.pack("!HH", MSG_TYPE.FRAGMENT, fl) msgs.append(fragheader) msgs.append(body[:fl]) body = body[fl:] return "".join(msgs) def _parseKV(body,sep=" ",term="\n"): """Helper: parse a key/value list of the form [key sep value term]* . Return a list of (k,v).""" res = [] for line in body.split(term): if not line: continue k, v = line.split(sep,1) res.append((k,v)) return res def _unterminate(s): """Strip trailing NUL characters from s.""" if s[-1] == '\0': return s[:-1] else: return s class Connection: """A Connection represents a connection to the Tor process.""" def __init__(self, sock): """Create a Connection to communicate with the Tor process over the socket 'sock'. """ self._s = sock self._handler = None self._sendLock = threading.RLock() self._queue = Queue.Queue() self._thread = None def setEventHandler(self, handler): """Cause future events from the Tor process to be sent to 'handler'. """ self._handler = handler def launchThread(self, daemon=1): """Launch a background thread to handle messages from the Tor process.""" assert self._thread is None t = threading.Thread(target=self._loop) if daemon: t.setDaemon(daemon) t.start() self._thread = t return t def _send(self, type, body=""): """Helper: Deliver a command of type 'type' and body 'body' to Tor. """ self._s.sendall(pack_message(type, body)) def _loop(self): """Main subthread loop: Read commands from Tor, and handle them either as events or as responses to other commands. """ while 1: try: length, tp, body = _receive_message(self._s) except OSError: if self._queue.get(timeout=0) != "CLOSE": raise if tp == MSG_TYPE.EVENT: if self._handler is not None: self._handler.handle(body) else: cb = self._queue.get() cb(tp, body) def _sendAndRecv(self, tp, msg="", expectedTypes=(MSG_TYPE.DONE,)): """Helper: Send a command of type 'tp' and body 'msg' to Tor, and wait for a command in response. If the response type is in expectedTypes, return a (tp,body) tuple. If it is an error, raise ErrorReply. Otherwise, raise ProtocolError. """ # This condition will get notified when we've got a result... condition = threading.Condition() # Here's where the result goes... result = [] def cb(tp,body,condition=condition,result=result): condition.acquire() try: result.append((tp, body)) condition.notify() finally: condition.release() # Sends a message to Tor... self._sendLock.acquire() try: self._queue.put(cb) self._send(tp, msg) finally: self._sendLock.release() # Now wait till the answer is in... condition.acquire() try: while not result: condition.wait() finally: condition.release() # ...And handle the answer appropriately. assert len(result) == 1 tp, msg = result[0] if tp in expectedTypes: return tp, msg elif tp == MSG_TYPE.ERROR: if len(msg)<2: raise ProtocolError("(Truncated error message)") errCode, = struct.unpack("!H", msg[:2]) raise ErrorReply((errCode, ERR_CODES.get(errCode,"[unrecognized]"), msg[2:])) else: raise ProtocolError("Unexpectd message type 0x%04x"%tp) def close(self): """Shut down this controller connection""" self._sendLock.acquire() try: self._queue.put("CLOSE") self._s.close() finally: self._sendLock.release() def authenticate(self, secret=""): """Send an authenticating secret to Tor. You'll need to call this method before Tor can start. """ self._sendAndRecv(MSG_TYPE.AUTH,secret) def get_option(self,name): """Return the value of the configuration option named 'name'. """ if not isinstance(name, str): name = "".join(["%s\n"%s for s in name]) tp,body = self._sendAndRecv(MSG_TYPE.GETCONF,name,[MSG_TYPE.CONFVALUE]) return _parseKV(body) def set_option(self,key,value): """Set the value of the configuration option 'key' to the value 'value'. """ self.set_options([key, value]) def set_options(self,kvlist): """Given a list of [(key,value)] pairs, set them as configuration options. """ msg = "".join(["%s %s\n" for k,v in kvlist]) self._sendAndRecv(MSG_TYPE.SETCONF,msg) def get_info(self,name): """Return the value of the internal information field named 'named'. """ if not isinstance(name, str): name = "".join(["%s\n"%s for s in name]) tp, body = self._sendAndRecv(MSG_TYPE.GETINFO,name,[MSG_TYPE.INFOVALUE]) kvs = body.split("\0") d = {} for i in xrange(0,len(kvs)-1,2): d[kvs[i]] = kvs[i+1] return d def set_events(self,events): """Change the list of events that the event handler is interested in to those in 'events', which is a list of EVENT_TYPE members. """ self._sendAndRecv(MSG_TYPE.SETEVENTS, "".join([struct.pack("!H", event) for event in events])) def save_conf(self): """Flush all configuration changes to disk. """ self._sendAndRecv(s,MSG_TYPE.SAVECONF) def send_signal(self, sig): """Send the signal 'sig' to the Tor process; 'sig' must be a member of SIGNAL. """ self._sendAndRecv(MSG_TYPE.SIGNAL,struct.pack("B",sig)) def map_address(self, kvList): """Given a list of (old-address,new-address), have Tor redirect streams from old-address to new-address. Old-address can be in a special "dont-care" form of "0.0.0.0" or ".". """ msg = [ "%s %s\n"%(k,v) for k,v in kvList ] tp, body = self._sendAndRecv(MSG_TYPE.MAPADDRESS,"".join(msg)) return _parseKV(body) def extend_circuit(self, circid, hops): """Tell Tor to extend the circuit identified by 'circid' through the servers named in the list "hops". """ msg = struct.pack("!L",circid) + ",".join(hops) + "\0" tp, body = self._sendAndRecv(MSG_TYPE.EXTENDCIRCUIT,msg) if len(body) != 4: raise ProtocolError("Extendcircuit reply too short or long") return struct.unpack("!L",body)[0] def redirect_stream(self, streamid, newtarget): """Tell Tor to change the target address of the stream identified by 'streamid' from its old value to 'newtarget'.""" msg = struct.pack("!L",streamid) + newtarget + "\0" self._sendAndRecv(MSG_TYPE.REDIRECTSTREAM,msg) def attach_stream(self, streamid, circid): """Tell Tor To attach stream 'streamid' to circuit 'circid'.""" msg = struct.pack("!LL",streamid, circid) self._sendAndRecv(MSG_TYPE.ATTACHSTREAM,msg) def close_stream(self, streamid, reason=0, flags=0): """Close the stream 'streamid'. """ msg = struct.pack("!LBB",streamid,reason,flags) self._sendAndRecv(MSG_TYPE.CLOSESTREAM,msg) def close_circuit(self, circid, flags=0): """Close the circuit 'circid'.""" msg = struct.pack("!LB",circid,flags) self._sendAndRecv(MSG_TYPE.CLOSECIRCUIT,msg) def post_descriptor(self, descriptor): """Tell Tor about a new descriptor in 'descriptor'.""" self._sendAndRecv(MSG_TYPE.POSTDESCRIPTOR,descriptor) class EventHandler: """An 'EventHandler' wraps callbacks for the events Tor can return.""" def __init__(self): """Create a new EventHandler.""" self._map = { EVENT_TYPE.CIRCSTATUS : self.circStatus, EVENT_TYPE.STREAMSTATUS : self.streamStatus, EVENT_TYPE.ORCONNSTATUS : self.orConnStatus, EVENT_TYPE.BANDWIDTH : self.circStatus, EVENT_TYPE.NEWDESC : self.newDesc, EVENT_TYPE.INFO_MSG : self.msg, EVENT_TYPE.NOTICE_MSG : self.msg, EVENT_TYPE.WARN_MSG : self.msg, EVENT_TYPE.ERR_MSG : self.msg, } def handle(self, evbody): """Dispatcher: called from Connection when an event is received.""" evtype, args = self.decode(evbody) self._map.get(evtype, self.unknownEvent)(evtype, *args) def decode(self, body): """Unpack an event message into a type/arguments-tuple tuple.""" if len(body)<2: raise ProtocolError("EVENT body too short.") evtype, = struct.unpack("!H", body[:2]) body = body[2:] if evtype == EVENT_TYPE.CIRCSTATUS: if len(body)<5: raise ProtocolError("CIRCUITSTATUS event too short.") status,ident = struct.unpack("!BL", body[:5]) path = _unterminate(body[5:]).split(",") args = status, ident, path elif evtype == EVENT_TYPE.STREAMSTATUS: if len(body)<5: raise ProtocolError("STREAMSTATUS event too short.") status,ident = struct.unpack("!BL", body[:5]) target = _unterminate(body[5:]) args = status, ident, target elif evtype == EVENT_TYPE.ORCONNSTATUS: if len(body)<2: raise ProtocolError("ORCONNSTATUS event too short.") status = ord(body[0]) target = _unterminate(body[1:]) args = status, target elif evtype == EVENT_TYPE.BANDWIDTH: if len(body)<8: raise ProtocolError("BANDWIDTH event too short.") read, written = struct.unpack("!LL",body[:8]) args = read, written elif evtype == EVENT_TYPE.OBSOLETE_LOG: args = (_unterminate(body),) elif evtype == EVENT_TYPE.NEWDESC: args = (_unterminate(body).split(","),) elif EVENT_TYPE.DEBUG_MSG <= evtype <= EVENT_TYPE.ERR_MSG: args = (EVENT_TYPE.nameOf[evtype], _unterminate(body)) else: args = (body,) return evtype, args def circStatus(self, status, circID, path): """Called when a circuit status changes if listening to CIRCSTATUS events. 'status' is a member of CIRC_STATUS; circID is a numeric circuit ID, and 'path' is the circuit's path so far as a list of names. """ raise NotImplemented def streamStatus(self, status, circID, target): """Called when a stream status changes if listening to STREAMSTATUS events. 'status' is a member of STREAM_STATUS; streamID is a numeric stream ID, and 'target' is the destination of the stream. """ raise NotImplemented def orConnStatus(self, status, target): """Called when an OR connection's status changes if listening to ORCONNSTATUS events. 'status' is a member of OR_CONN_STATUS; target is the OR in question. """ raise NotImplemented def bandwidth(self, read, written): """Called once a second if listening to BANDWIDTH events. 'read' is the number of bytes read; 'written' is the number of bytes written. """ raise NotImplemented def newDesc(self, identities): """Called when Tor learns a new server descriptor if listenting to NEWDESC events. """ raise NotImplemented def msg(self, severity, message): """Called when a log message of a given severity arrives if listening to INFO_MSG, NOTICE_MSG, WARN_MSG, or ERR_MSG events.""" raise NotImplemented class DebugEventHandler(EventHandler): """Trivial event handler: dumps all events to stdout.""" def __init__(self, out=None): if out is None: out = sys.stdout self._out = out def handle(self, body): evtype, args = self.decode(body) print >>self._out,EVENT_TYPE.nameOf[evtype],args def secret_to_key(secret, s2k_specifier): c = ord(s2k_specifier[8]) EXPBIAS = 6 count = (16+(c&15)) << ((c>>4) + EXPBIAS) d = sha.new() tmp = s2k_specifier[:8]+secret slen = len(tmp) while count: if count > slen: d.update(tmp) count -= slen else: d.update(tmp[:count]) count = 0 return d.digest() def urandom_rng(n): f = open('/dev/urandom', 'rb') try: return f.read(n) finally: f.close() def s2k_gen(secret, rng): spec = "%s%s"%(rng(8), chr(96)) return "16:%s"%( binascii.b2a_hex(spec + secret_to_key(secret, spec))) def s2k_check(secret, k): assert k[:3] == "16:" k = binascii.a2b_hex(k[3:]) return secret_to_key(secret, k[:9]) == k[9:] def run_example(host,port): print "host is %s:%d"%(host,port) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host,port)) c = Connection(s) c.setEventHandler(DebugEventHandler()) th = c.launchThread() c.authenticate() print "nick",`c.get_option("nickname")` print c.get_option("DirFetchPeriod\n") print `c.get_info("version")` #print `c.get_info("desc/name/moria1")` print `c.get_info("network-status")` print `c.get_info("addr-mappings/all")` print `c.get_info("addr-mappings/config")` print `c.get_info("addr-mappings/cache")` print `c.get_info("addr-mappings/control")` print `c.map_address([("0.0.0.0", "Foobar.com"), ("1.2.3.4", "foobaz.com"), ("frebnitz.com", "5.6.7.8"), (".", "abacinator.onion")])` print `c.extend_circuit(0,["moria1"])` try: print `c.extend_circuit(0,[""])` except ErrorReply: print "got error. good." #send_signal(s,1) #save_conf(s) #set_option(s,"1") #set_option(s,"bandwidthburstbytes 100000") #set_option(s,"runasdaemon 1") #set_events(s,[EVENT_TYPE.WARN]) c.set_events([EVENT_TYPE.ORCONNSTATUS, EVENT_TYPE.STREAMSTATUS, EVENT_TYPE.CIRCSTATUS, EVENT_TYPE.INFO_MSG, EVENT_TYPE.BANDWIDTH]) th.join() return if __name__ == '__main__': if len(sys.argv) > 2: print "Syntax: TorControl.py torhost:torport" sys.exit(0) else: sys.argv.append("localhost:9051") sh,sp = parseHostAndPort(sys.argv[1]) run_example(sh,sp) --- NEW FILE: TorExample.py --- #!/usr/bin/python # TorExample.py -- Python module to demonstrate tor controller functionality. # Copyright 2005 Nick Mathewson -- See LICENSE for licensing information. #$Id: TorExample.py,v 1.1 2005/06/04 02:42:56 nickm Exp $ import socket import sys from TorCtl import * def getConnection(daemon=1): if sys.argv[1] == '--host': hostport = sys.argv[2] del sys.argv[1:3] elif sys.argv[1].startswith("--host="): hostport = sys.argv[1][7:] del sys.argv[1] else: hostport = "localhost:9100" host,port = parseHostAndPort(hostport) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host,port)) conn = Connection(s) th = conn.launchThread(daemon) conn.authenticate("") return conn def run(): if len(sys.argv)<2: print "No command given." cmd = sys.argv[1].replace("-","_") del sys.argv[1] fn = globals().get("run_"+cmd) if fn is None: print "Unrecognized command:",cmd fn() def run_set_config(): conn = getConnection() if sys.argv[1] == '--save': save = 1 del sys.argv[1] else: save = 0 kvList = [] for i in xrange(1, len(sys.argv), 2): kvList.append((sys.argv[i], sys.argv[i+1])) conn.set_options(kvList) if save: conn.save_conf() def run_get_config(): conn = getConnection() opts = conn.get_option(sys.argv[1:]) for k in sys.argv[1:]: print "KEY:",k print "VALUE:",opts.get(k) def run_get_info(): conn = getConnection() opts = conn.get_option(sys.argv[1:]) for k in sys.argv[1:]: print "KEY:",k print "VALUE:",opts.get(k) def run_listen(): m = { "circ": "CIRCSTATUS", "stream": "STREAMSTATUS", "orconn", "ORCONNSTATUS", "bw": "BANDWIDTH", "newdesc": "NEWDESC", "info": "INFO_MSG", "notice": "NOTICE_MSG", "warn": "WARN_MSG", "error": "ERR_MSG", } conn = getConnection(daemon=0) events = [] for kw in sys.argv[1:]: try: events.append(EVENT_TYPE.get(m[kw])) except KeyError: print "Unrecognized event %r; recognized events are: %s"%( kw, ", ".join(m.keys())) if not events: return conn.setEventHandler(DebugEventHandler()) conn.listenForEvents(events) def run_signal(): conn = getConnection() m = { 'reload': "HUP", 'shutdown': "INT", 'dump': "USR1", 'debug': "USR2", 'halt': 'TERM' } if len(sys.argv)<2: print "Syntax: signal [signal]" return try: sig = SIGNAL.get(m[sys.argv[1]]) except KeyError: print "Unrecognized signal %r. Options are %s"%( sys.argv[1], ", ".join(m.keys())) conn.signal(sig) def run_authdemo(): conn = getConnection() conn.close() #XXXX From arma at seul.org Tue Jun 7 18:01:19 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 7 Jun 2005 14:01:19 -0400 (EDT) Subject: [or-cvs] clean up the spammer section Message-ID: <20050607180119.1D690140811D@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: faq-abuse.html Log Message: clean up the spammer section Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- faq-abuse.html 7 Jun 2005 17:34:41 -0000 1.5 +++ faq-abuse.html 7 Jun 2005 18:01:17 -0000 1.6 @@ -105,17 +105,19 @@

    What about spammers?

    -

    The default Tor exit policy rejects all outgoing port 25 (SMTP) -traffic. So sending spam mail through Tor isn't going to work. It's -possible that some server operators will enable port 25 on their -particular exit node, in which case only that computer will allow outgoing -mails; but that individual could just set up an open mail relay too, -independent of Tor.

    - -

    So far, no Tor server has enabled outgoing port 25 in his exit -policy.

    +

    The simple answer: The default Tor exit policy rejects all outgoing +port 25 (SMTP) traffic. So sending spam mail through Tor isn't going to +work. It's possible that some server operators will enable port 25 on +their particular exit node, in which case only that computer will allow +outgoing mails; but that individual could just set up an open mail relay +too, independent of Tor. In short, Tor isn't useful for spammers, because +nearly all Tor servers refuse to deliver it.

    -

    In short, Tor isn't useful for spammers.

    +

    The complex answer: Spammers are already doing great without Tor. They +have armies of compromised computers that do their spamming. The added +complexity of getting new software installed and configured, and doing +Tor's public key operations, etc, makes it not economically worthwhile +for them to use Tor.

    How do Tor exit policies work?

    From nickm at seul.org Tue Jun 7 18:01:48 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 14:01:48 -0400 (EDT) Subject: [or-cvs] Fix for 152: reject malformed .onion addresses rather then ... Message-ID: <20050607180148.5B9F114081A6@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv21764/src/or Modified Files: connection_edge.c or.h test.c Log Message: Fix for 152: reject malformed .onion addresses rather then passing them on Index: connection_edge.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v retrieving revision 1.327 retrieving revision 1.328 diff -u -d -r1.327 -r1.328 --- connection_edge.c 17 May 2005 17:01:36 -0000 1.327 +++ connection_edge.c 7 Jun 2005 18:01:46 -0000 1.328 @@ -911,6 +911,12 @@ */ addresstype = parse_extended_hostname(socks->address); + if (addresstype == BAD_HOSTNAME) { + log_fn(LOG_WARN, "Invalid hostname %s; rejecting", socks->address); + connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL); + return -1; + } + if (addresstype == EXIT_HOSTNAME) { /* foo.exit -- modify conn->chosen_exit_node to specify the exit * node, and conn->address to hold only the address portion.*/ @@ -1712,6 +1718,6 @@ failed: /* otherwise, return to previous state and return 0 */ *s = '.'; - return NORMAL_HOSTNAME; + return BAD_HOSTNAME; } Index: or.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.610 retrieving revision 1.611 diff -u -d -r1.610 -r1.611 --- or.h 23 May 2005 05:20:52 -0000 1.610 +++ or.h 7 Jun 2005 18:01:46 -0000 1.611 @@ -1377,7 +1377,7 @@ void set_exit_redirects(smartlist_t *lst); typedef enum hostname_type_t { - NORMAL_HOSTNAME, ONION_HOSTNAME, EXIT_HOSTNAME + NORMAL_HOSTNAME, ONION_HOSTNAME, EXIT_HOSTNAME, BAD_HOSTNAME } hostname_type_t; hostname_type_t parse_extended_hostname(char *address); Index: test.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/test.c,v retrieving revision 1.178 retrieving revision 1.179 diff -u -d -r1.178 -r1.179 --- test.c 4 Jun 2005 13:43:03 -0000 1.178 +++ test.c 7 Jun 2005 18:01:46 -0000 1.179 @@ -1384,6 +1384,7 @@ char address1[] = "fooaddress.onion"; char address2[] = "aaaaaaaaaaaaaaaa.onion"; char address3[] = "fooaddress.exit"; + char address4[] = "tor.eff.org"; rend_service_descriptor_t *d1, *d2; char *encoded; size_t len; @@ -1412,9 +1413,10 @@ test_streq(d2->intro_points[1], "crow"); test_streq(d2->intro_points[2], "joel"); - test_eq(NORMAL_HOSTNAME, parse_extended_hostname(address1)); + test_eq(BAD_HOSTNAME, parse_extended_hostname(address1)); test_eq(ONION_HOSTNAME, parse_extended_hostname(address2)); test_eq(EXIT_HOSTNAME, parse_extended_hostname(address3)); + test_eq(NORMAL_HOSTNAME, parse_extended_hostname(address4)); rend_service_descriptor_free(d1); rend_service_descriptor_free(d2); From nickm at seul.org Tue Jun 7 18:03:35 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 14:03:35 -0400 (EDT) Subject: [or-cvs] Backport: Fix for 152: reject malformed .onion addresses ra... Message-ID: <20050607180335.6E5CB140811D@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv21982/src/or Modified Files: Tag: tor-0_1_0-patches connection_edge.c or.h test.c Log Message: Backport: Fix for 152: reject malformed .onion addresses rather then passing them on Index: connection_edge.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v retrieving revision 1.327 retrieving revision 1.327.2.1 diff -u -d -r1.327 -r1.327.2.1 --- connection_edge.c 17 May 2005 17:01:36 -0000 1.327 +++ connection_edge.c 7 Jun 2005 18:03:33 -0000 1.327.2.1 @@ -911,6 +911,12 @@ */ addresstype = parse_extended_hostname(socks->address); + if (addresstype == BAD_HOSTNAME) { + log_fn(LOG_WARN, "Invalid hostname %s; rejecting", socks->address); + connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL); + return -1; + } + if (addresstype == EXIT_HOSTNAME) { /* foo.exit -- modify conn->chosen_exit_node to specify the exit * node, and conn->address to hold only the address portion.*/ @@ -1712,6 +1718,6 @@ failed: /* otherwise, return to previous state and return 0 */ *s = '.'; - return NORMAL_HOSTNAME; + return BAD_HOSTNAME; } Index: or.h =================================================================== RCS file: /home/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.610 retrieving revision 1.610.2.1 diff -u -d -r1.610 -r1.610.2.1 --- or.h 23 May 2005 05:20:52 -0000 1.610 +++ or.h 7 Jun 2005 18:03:33 -0000 1.610.2.1 @@ -1377,7 +1377,7 @@ void set_exit_redirects(smartlist_t *lst); typedef enum hostname_type_t { - NORMAL_HOSTNAME, ONION_HOSTNAME, EXIT_HOSTNAME + NORMAL_HOSTNAME, ONION_HOSTNAME, EXIT_HOSTNAME, BAD_HOSTNAME } hostname_type_t; hostname_type_t parse_extended_hostname(char *address); Index: test.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/test.c,v retrieving revision 1.178 retrieving revision 1.178.2.1 diff -u -d -r1.178 -r1.178.2.1 --- test.c 4 Jun 2005 13:43:03 -0000 1.178 +++ test.c 7 Jun 2005 18:03:33 -0000 1.178.2.1 @@ -1384,6 +1384,7 @@ char address1[] = "fooaddress.onion"; char address2[] = "aaaaaaaaaaaaaaaa.onion"; char address3[] = "fooaddress.exit"; + char address4[] = "tor.eff.org"; rend_service_descriptor_t *d1, *d2; char *encoded; size_t len; @@ -1412,9 +1413,10 @@ test_streq(d2->intro_points[1], "crow"); test_streq(d2->intro_points[2], "joel"); - test_eq(NORMAL_HOSTNAME, parse_extended_hostname(address1)); + test_eq(BAD_HOSTNAME, parse_extended_hostname(address1)); test_eq(ONION_HOSTNAME, parse_extended_hostname(address2)); test_eq(EXIT_HOSTNAME, parse_extended_hostname(address3)); + test_eq(NORMAL_HOSTNAME, parse_extended_hostname(address4)); rend_service_descriptor_free(d1); rend_service_descriptor_free(d2); From nickm at seul.org Tue Jun 7 18:04:39 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 14:04:39 -0400 (EDT) Subject: [or-cvs] Backport fix to getaddrinfo mem leak Message-ID: <20050607180439.2C25F140811D@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv22067/src/common Modified Files: Tag: tor-0_1_0-patches compat.c Log Message: Backport fix to getaddrinfo mem leak Index: compat.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/compat.c,v retrieving revision 1.47 retrieving revision 1.47.2.1 diff -u -d -r1.47 -r1.47.2.1 --- compat.c 2 May 2005 21:49:04 -0000 1.47 +++ compat.c 7 Jun 2005 18:04:37 -0000 1.47.2.1 @@ -526,8 +526,9 @@ } else { #ifdef HAVE_GETADDRINFO int err; - struct addrinfo *res, *res_p; + struct addrinfo *res=NULL, *res_p; struct addrinfo hints; + int result = -1; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET; hints.ai_socktype = SOCK_STREAM; @@ -537,14 +538,13 @@ if (res_p->ai_family == AF_INET) { struct sockaddr_in *sin = (struct sockaddr_in *)res_p->ai_addr; memcpy(addr, &sin->sin_addr, 4); - freeaddrinfo(res); - return 0; - } else { + result = 0; + break; } } - return -1; + freeaddrinfo(res); + return result; } - return (err == EAI_AGAIN) ? 1 : -1; #else struct hostent *ent; From arma at seul.org Tue Jun 7 18:16:16 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 7 Jun 2005 14:16:16 -0400 (EDT) Subject: [or-cvs] when you send a USR2 signal, the log message now tells you ... Message-ID: <20050607181616.6603B14081A6@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: main.c Log Message: when you send a USR2 signal, the log message now tells you to send a HUP signal if you want to change back to old log levels. Index: main.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.509 retrieving revision 1.510 diff -u -d -r1.509 -r1.510 --- main.c 7 Jun 2005 17:32:33 -0000 1.509 +++ main.c 7 Jun 2005 18:16:14 -0000 1.510 @@ -1033,7 +1033,7 @@ break; case SIGUSR2: switch_logs_debug(); - log(LOG_NOTICE,"Caught USR2. Going to loglevel debug."); + log(LOG_NOTICE,"Caught USR2, going to loglevel debug. Send HUP to change back."); break; case SIGHUP: if (do_hup() < 0) { From nickm at seul.org Tue Jun 7 18:21:34 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 14:21:34 -0400 (EDT) Subject: [or-cvs] Resolve OSX installer bugs 147 and 148 Message-ID: <20050607182134.7486614081A6@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/tmp/cvs-serv22783 Modified Files: configure.in Log Message: Resolve OSX installer bugs 147 and 148 Index: configure.in =================================================================== RCS file: /home/or/cvsroot/tor/configure.in,v retrieving revision 1.213 retrieving revision 1.214 diff -u -d -r1.213 -r1.214 --- configure.in 6 Jun 2005 20:27:32 -0000 1.213 +++ configure.in 7 Jun 2005 18:21:32 -0000 1.214 @@ -484,7 +484,7 @@ echo "confdir: $CONFDIR" -AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile) +AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile) if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then ./contrib/updateVersions.pl From nickm at seul.org Tue Jun 7 18:21:34 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 14:21:34 -0400 (EDT) Subject: [or-cvs] Resolve OSX installer bugs 147 and 148 Message-ID: <20050607182134.D76C61408436@moria.seul.org> Update of /home/or/cvsroot/tor/contrib/osx In directory moria:/tmp/cvs-serv22783/contrib/osx Modified Files: Makefile.am TorPostflight Added Files: TorStartupDesc.plist.in Removed Files: TorStartupDesc.plist Log Message: Resolve OSX installer bugs 147 and 148 Index: Makefile.am =================================================================== RCS file: /home/or/cvsroot/tor/contrib/osx/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 5 Jan 2005 02:46:25 -0000 1.2 +++ Makefile.am 7 Jun 2005 18:21:32 -0000 1.3 @@ -3,6 +3,6 @@ EXTRA_DIST = PrivoxyConfDesc.plist PrivoxyConfInfo.plist \ ReadMe.rtf StartupParameters.plist Tor TorBundleDesc.plist.in \ TorBundleInfo.plist.in TorBundleWelcome.rtf TorDesc.plist.in \ - TorInfo.plist.in TorStartupDesc.plist TorStartupInfo.plist \ + TorInfo.plist.in TorStartupDesc.plist.in TorStartupInfo.plist \ package.sh privoxy.config TorPostflight addsysuser Index: TorPostflight =================================================================== RCS file: /home/or/cvsroot/tor/contrib/osx/TorPostflight,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- TorPostflight 17 May 2005 05:26:54 -0000 1.6 +++ TorPostflight 7 Jun 2005 18:21:32 -0000 1.7 @@ -58,11 +58,10 @@ ln -sf $LOGDIR tor fi -if [ ! -d /Library/StartupItems/Tor ]; then - mkdir -p /Library/StartupItems/Tor +if [ -d /Library/StartupItems/Tor ]; then + rm -f /Library/StartupItems/Tor/Tor.loc + echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc fi -rm -f /Library/StartupItems/Tor/Tor.loc -echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc if [ -d /Library/StartupItems/Privoxy ]; then find /Library/StartupItems/Privoxy -print0 | xargs -0 chown root:wheel --- TorStartupDesc.plist DELETED --- --- NEW FILE: TorStartupDesc.plist.in --- (This appears to be a binary file; contents omitted.) From nickm at seul.org Tue Jun 7 18:26:28 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 14:26:28 -0400 (EDT) Subject: [or-cvs] Backport: Resolve OSX installer bugs 147 and 148 Message-ID: <20050607182628.4F6DD140841B@moria.seul.org> Update of /home/or/cvsroot/tor/contrib/osx In directory moria:/tmp/cvs-serv27105/contrib/osx Modified Files: Tag: tor-0_1_0-patches Makefile.am TorPostflight Added Files: Tag: tor-0_1_0-patches TorStartupDesc.plist.in Log Message: Backport: Resolve OSX installer bugs 147 and 148 Index: Makefile.am =================================================================== RCS file: /home/or/cvsroot/tor/contrib/osx/Makefile.am,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- Makefile.am 5 Jan 2005 02:46:25 -0000 1.2 +++ Makefile.am 7 Jun 2005 18:26:26 -0000 1.2.2.1 @@ -3,6 +3,6 @@ EXTRA_DIST = PrivoxyConfDesc.plist PrivoxyConfInfo.plist \ ReadMe.rtf StartupParameters.plist Tor TorBundleDesc.plist.in \ TorBundleInfo.plist.in TorBundleWelcome.rtf TorDesc.plist.in \ - TorInfo.plist.in TorStartupDesc.plist TorStartupInfo.plist \ + TorInfo.plist.in TorStartupDesc.plist.in TorStartupInfo.plist \ package.sh privoxy.config TorPostflight addsysuser Index: TorPostflight =================================================================== RCS file: /home/or/cvsroot/tor/contrib/osx/TorPostflight,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- TorPostflight 17 May 2005 05:26:54 -0000 1.6 +++ TorPostflight 7 Jun 2005 18:26:26 -0000 1.6.2.1 @@ -58,11 +58,10 @@ ln -sf $LOGDIR tor fi -if [ ! -d /Library/StartupItems/Tor ]; then - mkdir -p /Library/StartupItems/Tor +if [ -d /Library/StartupItems/Tor ]; then + rm -f /Library/StartupItems/Tor/Tor.loc + echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc fi -rm -f /Library/StartupItems/Tor/Tor.loc -echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc if [ -d /Library/StartupItems/Privoxy ]; then find /Library/StartupItems/Privoxy -print0 | xargs -0 chown root:wheel --- NEW FILE: TorStartupDesc.plist.in --- (This appears to be a binary file; contents omitted.) From nickm at seul.org Tue Jun 7 18:26:28 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 14:26:28 -0400 (EDT) Subject: [or-cvs] Backport: Resolve OSX installer bugs 147 and 148 Message-ID: <20050607182628.3C98E14081A6@moria.seul.org> Update of /home/or/cvsroot/tor In directory moria:/tmp/cvs-serv27105 Modified Files: Tag: tor-0_1_0-patches configure.in Log Message: Backport: Resolve OSX installer bugs 147 and 148 Index: configure.in =================================================================== RCS file: /home/or/cvsroot/tor/configure.in,v retrieving revision 1.212 retrieving revision 1.212.2.1 diff -u -d -r1.212 -r1.212.2.1 --- configure.in 23 May 2005 06:47:38 -0000 1.212 +++ configure.in 7 Jun 2005 18:26:26 -0000 1.212.2.1 @@ -484,7 +484,7 @@ echo "confdir: $CONFDIR" -AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile) +AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile) if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then ./contrib/updateVersions.pl From nickm at seul.org Tue Jun 7 18:32:15 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 14:32:15 -0400 (EDT) Subject: [or-cvs] Add generated file to contrib/osx/.cvsignore Message-ID: <20050607183215.B079A14081A6@moria.seul.org> Update of /home/or/cvsroot/tor/contrib/osx In directory moria:/home/nickm/src/tor/contrib/osx Modified Files: .cvsignore Log Message: Add generated file to contrib/osx/.cvsignore Index: .cvsignore =================================================================== RCS file: /home/or/cvsroot/tor/contrib/osx/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .cvsignore 5 Jan 2005 02:46:25 -0000 1.2 +++ .cvsignore 7 Jun 2005 18:32:13 -0000 1.3 @@ -4,3 +4,4 @@ TorBundleInfo.plist TorDesc.plist TorInfo.plist +TorStartupDesc.plist From nickm at seul.org Sat Jun 4 02:42:57 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 3 Jun 2005 22:42:57 -0400 (EDT) Subject: [or-cvs] Oops. I guess I would probably get more comments about thi... Message-ID: <20050604024257.005E114080C4@moria.seul.org> Update of /home/or/cvsroot/control/java/net/freehaven/tor/control In directory moria:/tmp/cvs-serv6608/java/net/freehaven/tor/control Added Files: .cvsignore Bytes.java EventHandler.java PasswordDigest.java TorControlCommands.java TorControlConnection.java TorControlError.java TorControlSyntaxError.java Log Message: Oops. I guess I would probably get more comments about this clever controller API/demo stuff if I actually committed it to CVS. Here then. --- NEW FILE: .cvsignore --- *.class --- NEW FILE: Bytes.java --- // $Id: Bytes.java,v 1.1 2005/06/04 02:42:55 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control; import java.util.List; /** * Static class to do bytewise structure manipulation in Java. */ /* XXXX There must be a better way to do most of this. * XXXX The string logic here uses default encoding, which is stupid. */ final class Bytes { /** Write the two-byte value in 's' into the byte array 'ba', starting at * the index 'pos'. */ public static void setU16(byte[] ba, int pos, short s) { ba[pos] = (byte)((s >> 8) & 0xff); ba[pos+1] = (byte)((s ) & 0xff); } /** Write the four-byte value in 'i' into the byte array 'ba', starting at * the index 'pos'. */ public static void setU32(byte[] ba, int pos, int i) { ba[pos] = (byte)((i >> 24) & 0xff); ba[pos+1] = (byte)((i >> 16) & 0xff); ba[pos+2] = (byte)((i >> 8) & 0xff); ba[pos+3] = (byte)((i ) & 0xff); } /** Return the four-byte value starting at index 'pos' within 'ba' */ public static int getU32(byte[] ba, int pos) { return ((ba[pos ]&0xff)<<24) | ((ba[pos+1]&0xff)<<16) | ((ba[pos+2]&0xff)<< 8) | ((ba[pos+3]&0xff)); } /** Return the two-byte value starting at index 'pos' within 'ba' */ public static int getU16(byte[] ba, int pos) { return ((ba[pos ]&0xff)<<8) | ((ba[pos+1]&0xff)); } /** Return the string starting at position 'pos' of ba and extending * until a zero byte or the end of the string. */ public static String getNulTerminatedStr(byte[] ba, int pos) { int len, maxlen = ba.length-pos; for (len=0; len0) lst.add(new String(ba, pos, len)); pos += len; if (ba[pos] == split) ++pos; } } private Bytes() {}; } --- NEW FILE: EventHandler.java --- // $Id: EventHandler.java,v 1.1 2005/06/04 02:42:55 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control; /** * Abstract interface whose methods are invoked when Tor sends us an event. * * @see TorControlConnection#setEventHandler * @see TorControlConnection#listenForEvents */ public interface EventHandler { /** * Invoked when a circuit's status has changed. * See TorControlCommands.CIRC_STATUS_* for possible status codes. */ public void circuitStatus(int status, int circID, String path); /** * Invoked when a stream's status has changed. * See TorControlCommands.STREAM_STATUS_* for possible status codes. */ public void streamStatus(int status, int streamID, String target); /** * Invoked when the status of a connection to an OR has changed. * See TorControlCommands.OR_CONN_STATUS_* for possible status codes. */ public void orConnStatus(int status, String orName); /** * Invoked once per second with the number of bytes read an written in * the last secone. */ public void bandwidthUsed(long read, long written); /** * Invoked whenever Tor learns about new ORs. */ public void newDescriptors(java.util.List orList); /** * Invoked when Tor logs a message. */ public void message(int type, String msg); } --- NEW FILE: PasswordDigest.java --- // $Id: PasswordDigest.java,v 1.1 2005/06/04 02:42:55 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control; import java.security.SecureRandom; import java.security.MessageDigest; /** * A hashed digest of a secret password (used to set control connection * security.) * * For the actual hashing algorithm, see RFC2440's secret-to-key conversion. */ public class PasswordDigest { byte[] secret; String hashedKey; /** Return a new password digest with a random secret and salt. */ public static PasswordDigest generateDigest() { byte[] secret = new byte[20]; SecureRandom rng = new SecureRandom(); rng.nextBytes(secret); return new PasswordDigest(secret); } /** Construct a new password digest with a given secret and random salt */ public PasswordDigest(byte[] secret) { this(secret, null); } /** Construct a new password digest with a given secret and random salt. * Note that the 9th byte of the specifier determines the number of hash * iterations as in RFC2440. */ public PasswordDigest(byte[] secret, byte[] specifier) { this.secret = secret; if (specifier == null) { specifier = new byte[9]; SecureRandom rng = new SecureRandom(); rng.nextBytes(specifier); specifier[8] = 96; } hashedKey = "16:"+encodeBytes(secretToKey(secret, specifier)); } /** Return the secret used to generate this password hash. */ public byte[] getSecret() { return secret; } /** Return the hashed password in the format used by Tor. */ public String getHashedPassword() { return hashedKey; } /** Parameter used by RFC2440's s2k algorithm. */ private static final int EXPBIAS = 6; /** Implement rfc2440 s2k */ public static byte[] secretToKey(byte[] secret, byte[] specifier) { MessageDigest d; try { d = MessageDigest.getInstance("SHA-1"); } catch (java.security.NoSuchAlgorithmException ex) { throw new RuntimeException("Can't run without sha-1."); } int c = ((int)specifier[8])&0xff; int count = (16 + (c&15)) << ((c>>4) + EXPBIAS); byte[] tmp = new byte[8+secret.length]; System.arraycopy(specifier, 0, tmp, 0, 8); System.arraycopy(secret, 0, tmp, 8, secret.length); while (count > 0) { if (count >= tmp.length) { d.update(tmp); count -= tmp.length; } else { d.update(tmp, 0, count); count = 0; } } byte[] key = new byte[20+9]; System.arraycopy(d.digest(), 0, key, 9, 20); System.arraycopy(specifier, 0, key, 0, 9); return key; } private static final char[] NYBBLES = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; /** Return a hexadecimal encoding of a byte array. */ // XXX There must be a better way to do this in Java. private static final String encodeBytes(byte[] ba) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < ba.length; ++i) { int b = ((int)ba[i]) & 0xff; buf.append(NYBBLES[b >> 4]); buf.append(NYBBLES[b&0x0f]); } return buf.toString(); } } --- NEW FILE: TorControlCommands.java --- // $Id: TorControlCommands.java,v 1.1 2005/06/04 02:42:55 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control; /** Interface defining constants used by the Tor controller protocol. */ // XXXX Take documentation for these from control-spec.txt public interface TorControlCommands { public static final short CMD_ERROR = 0x0000; public static final short CMD_DONE = 0x0001; public static final short CMD_SETCONF = 0x0002; public static final short CMD_GETCONF = 0x0003; public static final short CMD_CONFVALUE = 0x0004; public static final short CMD_SETEVENTS = 0x0005; public static final short CMD_EVENT = 0x0006; public static final short CMD_AUTH = 0x0007; public static final short CMD_SAVECONF = 0x0008; public static final short CMD_SIGNAL = 0x0009; public static final short CMD_MAPADDRESS = 0x000A; public static final short CMD_GETINFO = 0x000B; public static final short CMD_INFOVALUE = 0x000C; public static final short CMD_EXTENDCIRCUIT = 0x000D; public static final short CMD_ATTACHSTREAM = 0x000E; public static final short CMD_POSTDESCRIPTOR = 0x000F; public static final short CMD_FRAGMENTHEADER = 0x0010; public static final short CMD_FRAGMENT = 0x0011; public static final short CMD_REDIRECTSTREAM = 0x0012; public static final short CMD_CLOSESTREAM = 0x0013; public static final short CMD_CLOSECIRCUIT = 0x0014; public static final String[] CMD_NAMES = { "ERROR", "DONE", "SETCONF", "GETCONF", "CONFVALUE", "SETEVENTS", "EVENT", "AUTH", "SAVECONF", "SIGNAL", "MAPADDRESS", "GETINFO", "INFOVALUE", "EXTENDCIRCUIT", "ATTACHSTREAM", "POSTDESCRIPTOR", "FRAGMENTHEADER", "FRAGMENT", "REDIRECTSTREAM", "CLOSESTREAM", "CLOSECIRCUIT", }; public static final short EVENT_CIRCSTATUS = 0x0001; public static final short EVENT_STREAMSTATUS = 0x0002; public static final short EVENT_ORCONNSTATUS = 0x0003; public static final short EVENT_BANDWIDTH = 0x0004; public static final short EVENT_NEWDESCRIPTOR = 0x0006; public static final short EVENT_MSG_DEBUG = 0x0007; public static final short EVENT_MSG_INFO = 0x0008; public static final short EVENT_MSG_NOTICE = 0x0009; public static final short EVENT_MSG_WARN = 0x000A; public static final short EVENT_MSG_ERROR = 0x000B; public static final byte CIRC_STATUS_LAUNCHED = 0x01; public static final byte CIRC_STATUS_BUILT = 0x02; public static final byte CIRC_STATUS_EXTENDED = 0x03; public static final byte CIRC_STATUS_FAILED = 0x04; public static final byte CIRC_STATUS_CLOSED = 0x05; public static final String[] CIRC_STATUS_NAMES = { "LAUNCHED", "BUILT", "EXTENDED", "FAILED", "CLOSED", }; public static final byte STREAM_STATUS_SENT_CONNECT = 0x00; public static final byte STREAM_STATUS_SENT_RESOLVE = 0x01; public static final byte STREAM_STATUS_SUCCEEDED = 0x02; public static final byte STREAM_STATUS_FAILED = 0x03; public static final byte STREAM_STATUS_CLOSED = 0x04; public static final byte STREAM_STATUS_NEW_CONNECT = 0x05; public static final byte STREAM_STATUS_NEW_RESOLVE = 0x06; public static final byte STREAM_STATUS_DETACHED = 0x07; public static final String[] STREAM_STATUS_NAMES = { "SENT_CONNECT", "SENT_RESOLVE", "SUCCEEDED", "FAILED", "CLOSED", "NEW_CONNECT", "NEW_RESOLVE", "DETACHED" }; public static final byte OR_CONN_STATUS_LAUNCHED = 0x00; public static final byte OR_CONN_STATUS_CONNECTED = 0x01; public static final byte OR_CONN_STATUS_FAILED = 0x02; public static final byte OR_CONN_STATUS_CLOSED = 0x03; public static final String[] OR_CONN_STATUS_NAMES = { "LAUNCHED","CONNECTED","FAILED","CLOSED" }; public static final byte SIGNAL_HUP = 0x01; public static final byte SIGNAL_INT = 0x02; public static final byte SIGNAL_USR1 = 0x0A; public static final byte SIGNAL_USR2 = 0x0C; public static final byte SIGNAL_TERM = 0x0F; public static final String ERROR_MSGS[] = { "Unspecified error", "Internal error", "Unrecognized message type", "Syntax error", "Unrecognized configuration key", "Invalid configuration value", "Unrecognized byte code", "Unauthorized", "Failed authentication attempt", "Resource exhausted", "No such stream", "No such circuit", "No such OR", }; } --- NEW FILE: TorControlConnection.java --- // $Id: TorControlConnection.java,v 1.1 2005/06/04 02:42:55 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; /** A connection to a running Tor process. */ public class TorControlConnection implements TorControlCommands { protected java.io.DataOutputStream outStream; protected java.io.DataInputStream inStream; protected EventHandler handler; protected LinkedList waiters; static class Waiter { Cmd response; public synchronized Cmd getResponse() { try { while (response == null) { wait(); } } catch (InterruptedException ex) { return null; } return response; } public synchronized void setResponse(Cmd response) { this.response = response; notifyAll(); } } static class Cmd { public int type; public byte[] body; Cmd(int t, byte[] b) { type = t; body = b; } Cmd(int t, int l) { type = t; body = new byte[l]; }; } /** Create a new TorControlConnection to communicate with Tor over * a given socket. After calling this constructor, it is typical to * call launchThread and authenticate. */ public TorControlConnection(java.net.Socket connection) throws IOException { this(connection.getInputStream(), connection.getOutputStream()); } /** Create a new TorControlConnection to communicate with Tor over * an arbitrary pair of data streams. */ public TorControlConnection(java.io.InputStream i, java.io.OutputStream o) throws IOException { this.outStream = new java.io.DataOutputStream(o); this.inStream = new java.io.DataInputStream(i); this.waiters = new LinkedList(); } /** helper: sends a single (unfragmentable) command to Tor */ protected final void sendCommand0(int type, byte[] cmd) throws IOException { int length = cmd == null ? 0 : cmd.length; outStream.writeShort((short)length); outStream.writeShort(type); if (cmd != null) outStream.write(cmd); } /** helper: sends a single (possibly fragmented) command to Tor */ protected void sendCommand(short type, byte[] cmd) throws IOException { synchronized(this.outStream) { if (cmd == null || cmd.length <= 65535) { sendCommand0(type, cmd); return; } int length = cmd.length; outStream.writeShort(65535); outStream.writeShort(CMD_FRAGMENTHEADER); outStream.writeShort(type); outStream.writeInt(length); outStream.write(cmd, 0, 65535); for (int pos=65535; pos < length; pos += 65535) { int flen = length-pos < 65535 ? length-pos : 65535; outStream.writeShort(flen); outStream.writeShort(CMD_FRAGMENT); this.outStream.write(cmd, pos, flen); } } } /** helper: read a possibly fragmented command from Tor */ protected final Cmd readCommand0() throws IOException { int len = this.inStream.readUnsignedShort(); int cmd = this.inStream.readUnsignedShort(); byte[] result = new byte[len]; this.inStream.readFully(result); return new Cmd(cmd, result); } /** Read a command from Tor, defragmenting as necessary */ protected Cmd readCommand() throws IOException { synchronized (inStream) { Cmd c = readCommand0(); if (c.type != CMD_FRAGMENT && c.type != CMD_FRAGMENTHEADER) return c; if (c.type == CMD_FRAGMENT) throw new TorControlSyntaxError("Fragment without header"); int realType = Bytes.getU16(c.body, 0); int realLen = Bytes.getU32(c.body, 2); Cmd out = new Cmd(realType, realLen); System.arraycopy(c.body, 6, out.body, 0, c.body.length-6); int pos = c.body.length-6; while (pos < realLen) { c = readCommand0(); if (c.type != CMD_FRAGMENT) throw new TorControlSyntaxError("Incomplete fragmented message"); System.arraycopy(c.body, 0, out.body, pos, c.body.length); pos += c.body.length; } return out; } } /** Set the EventHandler object that will be notified of any * events Tor delivers to this connection. To make Tor send us * events, call listenForEvents(). */ public void setEventHandler(EventHandler handler) { this.handler = handler; } /** * Start a thread to react to Tor's responses in the background. * This is necessary to handle asynchronous events and synchronous * responses that arrive independantly over the same socket. */ public Thread launchThread(boolean daemon) { Thread th = new Thread() { public void run() { try { react(); } catch (IOException ex) { throw new RuntimeException(ex); } } }; if (daemon) th.setDaemon(true); th.start(); return th; } /** helper: implement the main background loop. */ protected void react() throws IOException { while (true) { Cmd c = readCommand(); if (c.type == CMD_EVENT) handleEvent(c); else { Waiter w; synchronized (waiters) { w = (Waiter) waiters.removeFirst(); } w.setResponse(c); } } } /** helper: Send a command and wait for the next reponse type command * to be received (in order) */ protected synchronized Cmd _sendAndWaitForResponse(short type, byte[] cmd) throws IOException { Waiter w = new Waiter(); synchronized (waiters) { sendCommand(type, cmd); waiters.addLast(w); } return w.getResponse(); } /** Send a message to Tor, and wait for a respose. * * @throw TorControlError if Tor tells us about an error * @throw TorControlSyntaxError if the response type wasn't exType1...4 **/ protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1, short exType2, short exType3, short exType4) throws IOException { Cmd c = _sendAndWaitForResponse(type, cmd); if (c.type == CMD_ERROR) throw new TorControlError(Bytes.getU16(c.body, 0), Bytes.getNulTerminatedStr(c.body, 2)); if (c.type == exType1 || c.type == exType2 || c.type == exType3 || c.type == exType4) return c; throw new TorControlSyntaxError("Unexpected reply type: "+c.type); } protected Cmd sendAndWaitForResponse(short type, byte[] cmd) throws IOException { return sendAndWaitForResponse(type, cmd, CMD_DONE, CMD_DONE, CMD_DONE, CMD_DONE); } protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1) throws IOException { return sendAndWaitForResponse(type, cmd, exType1, exType1, exType1, exType1); } protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1, short exType2) throws IOException { return sendAndWaitForResponse(type, cmd, exType1, exType2, exType2, exType2); } protected Cmd sendAndWaitForResponse(short type, byte[] cmd, short exType1, short exType2, short exType3) throws IOException { return sendAndWaitForResponse(type, cmd, exType1, exType2, exType3, exType3); } /** Helper: decode a CMD_EVENT command and dispatch it to our * EventHandler (if any). */ protected void handleEvent(Cmd c) { if (handler == null) return; int type = Bytes.getU16(c.body, 0); switch (type) { case EVENT_CIRCSTATUS: handler.circuitStatus(c.body[2], (int)Bytes.getU32(c.body, 3), Bytes.getNulTerminatedStr(c.body, 7)); break; case EVENT_STREAMSTATUS: handler.streamStatus(c.body[2], (int)Bytes.getU32(c.body, 3), Bytes.getNulTerminatedStr(c.body, 7)); break; case EVENT_ORCONNSTATUS: handler.orConnStatus(c.body[2], Bytes.getNulTerminatedStr(c.body, 3)); break; case EVENT_BANDWIDTH: handler.bandwidthUsed(Bytes.getU32(c.body, 2), Bytes.getU32(c.body, 6)); break; case EVENT_NEWDESCRIPTOR: List lst = new ArrayList(); Bytes.splitStr(lst, c.body, 2, (byte)','); handler.newDescriptors(lst); break; case EVENT_MSG_DEBUG: case EVENT_MSG_INFO: case EVENT_MSG_NOTICE: case EVENT_MSG_WARN: case EVENT_MSG_ERROR: handler.message(type, Bytes.getNulTerminatedStr(c.body, 2)); break; default: throw new TorControlSyntaxError("Unrecognized event type."); } } /** Change the value of the configuration option 'key' to 'val'. */ public void setConf(String key, String value) throws IOException { List lst = new ArrayList(); lst.add(key+" "+value); setConf(lst); } /** Change the values of the configuration options stored in * 'kvList'. (The format is "key value"). */ public void setConf(Collection kvList) throws IOException { StringBuffer b = new StringBuffer(); for (Iterator it = kvList.iterator(); it.hasNext(); ) { String kv = (String) it.next(); b.append(kv).append("\n"); } sendAndWaitForResponse(CMD_SETCONF, b.toString().getBytes()); } /** Change the values of the configuration options stored in kvMap. */ public void setConf(Map kvMap) throws IOException { List lst = new ArrayList(); for (Iterator it = kvMap.entrySet().iterator(); it.hasNext(); ) { Map.Entry ent = (Map.Entry) it.next(); lst.add(ent.getKey()+" "+ent.getValue()+"\n"); } setConf(lst); } /** Return the value of the configuration option 'key' */ public String getConf(String key) throws IOException { List lst = new ArrayList(); lst.add(key); Map r = getConf(lst); return (String) r.get(key); } /** Return a key-value map for the configuration options in 'keys' */ public Map getConf(Collection keys) throws IOException { StringBuffer s = new StringBuffer(); for (Iterator it = keys.iterator(); it.hasNext(); ) { String key = (String) it.next(); s.append(key).append("\n"); } Cmd c = sendAndWaitForResponse(CMD_GETCONF, s.toString().getBytes(), CMD_CONFVALUE); List lines = new ArrayList(); Bytes.splitStr(lines, c.body, 0, (byte)'\n'); Map result = new HashMap(); for (Iterator it = lines.iterator(); it.hasNext(); ) { String kv = (String) it.next(); int idx = kv.indexOf(' '); result.put(kv.substring(0, idx), kv.substring(idx+1)); } return result; } /** Tell Tor to begin sending us events of the types listed in 'events'. * Elements must be one of the EVENT_* values from TorControlCommands */ public void setEvents(List events) throws IOException { byte[] ba = new byte[events.size() * 2]; int i; Iterator it; for(i=0, it = events.iterator(); it.hasNext(); i += 2) { short event = ((Number)it.next()).shortValue(); Bytes.setU16(ba, i, event); } sendAndWaitForResponse(CMD_SETEVENTS, ba); System.out.println("OK"); } /** Send Tor an authentication sequence 'auth' */ // XXXX more info about how to set this up securely. public void authenticate(byte[] auth) throws IOException { if (auth == null) auth = new byte[0]; sendAndWaitForResponse(CMD_AUTH, auth); } /** Tell Tor to save the value of its configuration to disk. */ public void saveConf() throws IOException { sendAndWaitForResponse(CMD_SAVECONF, new byte[0]); } /** Send a signal to the Tor process. */ public void signal(int signal) throws IOException { if (signal != SIGNAL_HUP && signal != SIGNAL_INT && signal != SIGNAL_USR1 && signal != SIGNAL_USR2 && signal != SIGNAL_TERM) throw new Error("Unrecognized value for signal()"); byte[] ba = { (byte)signal }; sendAndWaitForResponse(CMD_SIGNAL, ba); } /** Tell Tor to replace incoming addresses with those as listed in 'kvLines'. */ public Map mapAddresses(Collection kvLines) throws IOException { StringBuffer sb = new StringBuffer(); for (Iterator it = kvLines.iterator(); it.hasNext(); ) { sb.append((String)it.next()).append("\n"); } Cmd c = sendAndWaitForResponse(CMD_MAPADDRESS, sb.toString().getBytes()); Map result = new HashMap(); List lst = new ArrayList(); Bytes.splitStr(lst, c.body, 0, (byte)'\n'); for (Iterator it = lst.iterator(); it.hasNext(); ) { String kv = (String) it.next(); int idx = kv.indexOf(' '); result.put(kv.substring(0, idx), kv.substring(idx+1)); } return result; } public Map mapAddresses(Map addresses) throws IOException { List kvList = new ArrayList(); for (Iterator it = addresses.entrySet().iterator(); it.hasNext(); ) { Map.Entry e = (Map.Entry) it.next(); kvList.add(e.getKey()+" "+e.getValue()); } return mapAddresses(kvList); } public String mapAddress(String fromAddr, String toAddr) throws IOException { List lst = new ArrayList(); lst.add(fromAddr+" "+toAddr+"\n"); Map m = mapAddresses(lst); return (String) m.get(fromAddr); } /** Look up the information values listed in keys. */ public Map getInfo(Collection keys) throws IOException { StringBuffer sb = new StringBuffer(); for (Iterator it = keys.iterator(); it.hasNext(); ) { sb.append(((String)it.next())+"\n"); } Cmd c = sendAndWaitForResponse(CMD_GETINFO, sb.toString().getBytes(), CMD_INFOVALUE); Map m = new HashMap(); List lst = new ArrayList(); Bytes.splitStr(lst, c.body, 0, (byte)0); if ((lst.size() % 2) != 0) throw new TorControlSyntaxError( "Odd number of substrings from GETINFO"); for (Iterator it = lst.iterator(); it.hasNext(); ) { Object k = it.next(); Object v = it.next(); m.put(k, v); } return m; } /** Return the value of the information field 'key' */ public String getInfo(String key) throws IOException { List lst = new ArrayList(); lst.add(key); Map m = getInfo(lst); return (String) m.get(key); } /** * Tell Tor to extend the circuit identified by 'circID' through the * servers named in the list 'path'. */ public int extendCircuit(int circID, String path) throws IOException { byte[] p = path.getBytes(); byte[] ba = new byte[p.length+4]; Bytes.setU32(ba, 0, circID); System.arraycopy(p, 0, ba, 4, p.length); Cmd c = sendAndWaitForResponse(CMD_EXTENDCIRCUIT, ba); return Bytes.getU32(c.body, 0); } /** * Tell Tor to attach the stream identified by 'streamID' to the circuit * identified by 'circID'. */ public void attachStream(int streamID, int circID) throws IOException { byte[] ba = new byte[8]; Bytes.setU32(ba, 0, streamID); Bytes.setU32(ba, 4, circID); sendAndWaitForResponse(CMD_ATTACHSTREAM, ba); } /** Tell Tor about the server descriptor in 'desc' */ public String postDescriptor(byte[] desc) throws IOException { return new String( sendAndWaitForResponse(CMD_POSTDESCRIPTOR, desc).body); } /** Tell Tor to change the target of the stream identified by 'streamID' * to 'address'. */ public void redirectStream(int streamID, String address) throws IOException { byte[] addr = address.getBytes(); byte[] ba = new byte[addr.length+4]; Bytes.setU32(ba, 0, streamID); System.arraycopy(addr, 0, ba, 4, addr.length); sendAndWaitForResponse(CMD_REDIRECTSTREAM, ba); } /** Tell Tor to close the stream identified by 'streamID'. */ public void closeStream(int streamID, byte reason, byte flags) throws IOException { byte[] ba = new byte[6]; Bytes.setU32(ba, 0, streamID); ba[4] = reason; ba[5] = flags; sendAndWaitForResponse(CMD_CLOSESTREAM, ba); } /** Tell Tor to close the circuit identified by 'streamID'. */ public void closeCircuit(int circID, byte flags) throws IOException { byte[] ba = new byte[5]; Bytes.setU32(ba, 0, circID); ba[4] = flags; sendAndWaitForResponse(CMD_CLOSECIRCUIT, ba); } } --- NEW FILE: TorControlError.java --- // $Id: TorControlError.java,v 1.1 2005/06/04 02:42:55 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control; /** * An exception raised when Tor tells us about an error. */ public class TorControlError extends RuntimeException { int errorType; public TorControlError(int type, String s) { super(s); errorType = type; } public int getErrorType() { return errorType; } public String getErrorMsg() { try { return TorControlCommands.ERROR_MSGS[errorType]; } catch (ArrayIndexOutOfBoundsException ex) { return "Unrecongized error #"+errorType; } } } --- NEW FILE: TorControlSyntaxError.java --- package net.freehaven.tor.control; /** * An exception raised when Tor behaves in an unexpected way. */ public class TorControlSyntaxError extends RuntimeException { public TorControlSyntaxError(String s) { super(s); } } From arma at seul.org Tue Jun 7 20:48:49 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 7 Jun 2005 16:48:49 -0400 (EDT) Subject: [or-cvs] tentative 0.1.1.x todo list Message-ID: <20050607204849.DCF7414080AA@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: TODO Log Message: tentative 0.1.1.x todo list Index: TODO =================================================================== RCS file: /home2/or/cvsroot/tor/doc/TODO,v retrieving revision 1.301 retrieving revision 1.302 diff -u -d -r1.301 -r1.302 --- TODO 15 May 2005 00:51:11 -0000 1.301 +++ TODO 7 Jun 2005 20:48:47 -0000 1.302 @@ -11,6 +11,49 @@ D Deferred X Abandoned +for 0.1.1.x: + - cpu fixes: + - create-light + - see if we should make use of truncate to retry + - hardware accelerator support + - use aes when available + - do the kernel buffer style design + - continue decentralizing the directory + M have two router descriptor formats + - dirservers verify reachability claims + - find 10 dirservers. + - dirservers have blacklist of IPs they hate. + - dirservers publish router-status with all these flags. + - alices fetch many router-statuses and update descriptors as needed. + - add if-newer-than fetch options + - dirservers allow people to lookup by N descriptors, or to fetch all. + - alices avoid duplicate class C nodes. + - everybody with a dirport will give you his descriptor. + - config option, on by default, to cache all descriptors. + - Compress router desc sets before transmitting them + M Analyze how bad the partitioning is or isn't. + - Naming: + - some dirservers announce that they manage bindings (a flag in + router-status). + - other dirservers mention a binding if there is no conflict for + that binding among the dirservers that manage it. + no conflict == any of them bind it and no disagreement. + - alice can specify a nickname and it will record that name in her + datadir along with the key *if* it is bound. otherwise her specifying + will fail (loudly we hope). + - thus when a binding vanishes (e.g. conflict) alice will keep using + the one she meant. + - if the binding changes keys, the entry in her datadir will silently + get corrected. + - helper nodes (at least preliminary) + - enclaves (at least preliminary) + - packaging and ui stuff: + - uninstallers + - something, anything, for sys tray on Windows. + - let ORPort config option change. + + + For sometime soon: - Server instructions for OSX and Windows operators. - Audit all changes to bandwidth buckets for integer over/underflow. From nickm at seul.org Tue Jun 7 21:14:53 2005 From: nickm at seul.org (Nick Mathewson) Date: Tue, 7 Jun 2005 17:14:53 -0400 (EDT) Subject: [or-cvs] Summarize remaining 0.1.0.x items Message-ID: <20050607211453.63F691408412@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv12937/doc Modified Files: TODO Log Message: Summarize remaining 0.1.0.x items Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.302 retrieving revision 1.303 diff -u -d -r1.302 -r1.303 --- TODO 7 Jun 2005 20:48:47 -0000 1.302 +++ TODO 7 Jun 2005 21:14:51 -0000 1.303 @@ -11,6 +11,15 @@ D Deferred X Abandoned +For 0.1.0.x: + - Memory use on Linux: what's happening? + - Why do solaris cpuworks go dormant? + (Apparently, disabling threads fixes this.) + - Why does kevent barf with EINVAL on some freebsd boxes? + - Fix the remaining flyspray bugs marked for 0.1.0.9 + - Free remaining unfreed memory (arma will run valgrind) + - Note libevent/method/platform combos that are unlikely to work. + for 0.1.1.x: - cpu fixes: - create-light From arma at seul.org Tue Jun 7 21:16:47 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 7 Jun 2005 17:16:47 -0400 (EDT) Subject: [or-cvs] another 011x item Message-ID: <20050607211647.DE1781408412@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: TODO Log Message: another 011x item Index: TODO =================================================================== RCS file: /home2/or/cvsroot/tor/doc/TODO,v retrieving revision 1.303 retrieving revision 1.304 diff -u -d -r1.303 -r1.304 --- TODO 7 Jun 2005 21:14:51 -0000 1.303 +++ TODO 7 Jun 2005 21:16:45 -0000 1.304 @@ -60,6 +60,7 @@ - uninstallers - something, anything, for sys tray on Windows. - let ORPort config option change. + - new controller protocol From thomass at seul.org Tue Jun 7 21:29:12 2005 From: thomass at seul.org (thomass at seul.org) Date: Tue, 7 Jun 2005 17:29:12 -0400 (EDT) Subject: [or-cvs] download.html - debian got a new stable Message-ID: <20050607212912.ADB7B1408259@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv13767 Modified Files: download.html Log Message: download.html - debian got a new stable Index: download.html =================================================================== RCS file: /home2/or/cvsroot/website/download.html,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- download.html 25 May 2005 03:56:50 -0000 1.98 +++ download.html 7 Jun 2005 21:29:10 -0000 1.99 @@ -97,7 +97,7 @@

    Debian packages have been uploaded to the set of official unstable -Debian packages. If you are running stable (woody) or testing (sarge), you +Debian packages. If you are running stable (sarge) or testing (sid), you must first add these lines to /etc/apt/sources.list:

    From thomass at seul.org Tue Jun 7 21:29:12 2005 From: thomass at seul.org (thomass at seul.org) Date: Tue, 7 Jun 2005 17:29:12 -0400 (EDT) Subject: [or-cvs] download.html - debian got a new stable Message-ID: <20050607212912.C0BDB140843A@moria.seul.org> Update of /home2/or/cvsroot/website/de In directory moria:/tmp/cvs-serv13767/de Modified Files: download.de.html Log Message: download.html - debian got a new stable Index: download.de.html =================================================================== RCS file: /home2/or/cvsroot/website/de/download.de.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- download.de.html 30 May 2005 11:43:06 -0000 1.3 +++ download.de.html 7 Jun 2005 21:29:10 -0000 1.4 @@ -99,8 +99,8 @@


    Debianpakete sind zu den offiziellen Quellen in der -Unstable-Distribution hochgeladen worden. Wenn du stable (woody) oder testing -(sarge) nutzt, musst du folgende Zeilen zur /etc/apt/sources.list +Unstable-Distribution hochgeladen worden. Wenn du stable (sarge) oder testing +(sid) nutzt, musst du folgende Zeilen zur /etc/apt/sources.list hinzuf?gen:

    From arma at seul.org Wed Jun 8 00:56:52 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 7 Jun 2005 20:56:52 -0400 (EDT) Subject: [or-cvs] clean up more abuse faq answers Message-ID: <20050608005652.05B19140843B@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: faq-abuse.html Log Message: clean up more abuse faq answers Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- faq-abuse.html 7 Jun 2005 18:01:17 -0000 1.6 +++ faq-abuse.html 8 Jun 2005 00:56:49 -0000 1.7 @@ -94,7 +94,7 @@ specialized forms of this attack like SYN flooding either.) So ordinary DDoS attacks are not possible over Tor. Tor also doesn't allow bandwidth amplification attacks against external sites: you need to send in a byte -for every byte which the Tor network will send to your destination. So +for every byte that the Tor network will send to your destination. So in general, attackers who control enough bandwidth to launch an effective DDoS attack can do it just fine without Tor.

    @@ -107,13 +107,14 @@

    The simple answer: The default Tor exit policy rejects all outgoing port 25 (SMTP) traffic. So sending spam mail through Tor isn't going to -work. It's possible that some server operators will enable port 25 on -their particular exit node, in which case only that computer will allow -outgoing mails; but that individual could just set up an open mail relay -too, independent of Tor. In short, Tor isn't useful for spammers, because -nearly all Tor servers refuse to deliver it.

    +work by default. It's possible that some server operators will enable +port 25 on their particular exit node, in which case that computer will +allow outgoing mails; but that individual could just set up an open mail +relay too, independent of Tor. In short, Tor isn't useful for spammers, +because nearly all Tor servers refuse to deliver their mail.

    -

    The complex answer: Spammers are already doing great without Tor. They +

    The complex answer: Even if the above were not true, spammers are +already doing great without Tor. They have armies of compromised computers that do their spamming. The added complexity of getting new software installed and configured, and doing Tor's public key operations, etc, makes it not economically worthwhile @@ -159,7 +160,7 @@ FBI sends you a polite email, you explain that you run a Tor server, and they say 'oh well' and leave you alone. [Port 80]

  • Somebody tries to get you shut down by using Tor to connect to google -groups and posting spam to usenet, and then sending an angry mail to +groups and post spam to usenet, and then sending an angry mail to your ISP about how you're destroying the world. [Port 80]
  • Somebody connects to an irc network and makes a nuisance of himself. Your ISP gets polite mail about how your computer has been @@ -237,13 +238,14 @@ are Tor exit nodes. If you explain the problem, and they conclude that Tor ought to be blocked, you may want to consider moving to a network that is more open to free speech. Maybe inviting them to #tor on irc.oftc.net -helps them show that we are not all evil people.

    +will help show them that we are not all evil people.

    -

    Finally, if you become aware of an IRC network which seems to be +

    Finally, if you become aware of an IRC network that seems to be blocking Tor, or a single Tor exit node, please put that information on BlockingIrc +href="http://wiki.noreply.org/wiki/TheOnionRouter/BlockingIrc">The Tor +IRC block tracker so that others can share. At least one IRC network consults that page -to unblock exit nodes which have been blocked inadvertently.

    +to unblock exit nodes that have been blocked inadvertently.

    Your nodes are banned from the mail server I want to use.

    @@ -273,9 +275,14 @@ decide whether banning the Tor network is worth losing the contributions of these users, as well as potential future such users.

    +

    At this point, you should also ask yourself what you do about other +services that aggregate many users behind a few IP addresses. Tor is +not so different from AOL in this respect.

    +

    Lastly, please remember that Tor servers have individual exit policies. Many Tor servers do not allow exiting connections at -all. Many of those that do, probably already disallow connections to +all. Many of those that do allow some exit connections probably already +disallow connections to your service. When you go about banning nodes, you should parse the exit policies and only block the ones that allow these connections; and you should keep in mind that exit policies can change (as well as @@ -293,7 +300,7 @@

    Please take a look at the Tor Legal FAQ, -and contact EFF directly if you have any further questions.

    +and contact EFF directly if you have any further legal questions.

    From phobos at seul.org Wed Jun 8 01:35:23 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 7 Jun 2005 21:35:23 -0400 (EDT) Subject: [or-cvs] TODO: Added in random to do list of arma and phobos. Message-ID: <20050608013523.555621408259@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv23546 Modified Files: TODO Log Message: TODO: Added in random to do list of arma and phobos. Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.304 retrieving revision 1.305 diff -u -d -r1.304 -r1.305 --- TODO 7 Jun 2005 21:16:45 -0000 1.304 +++ TODO 8 Jun 2005 01:35:21 -0000 1.305 @@ -4,6 +4,7 @@ SPEC - Spec not finalized NICK - nick claims ARMA - arma claims +PHOBOS - phobos claims - Not done * Top priority . Partially done @@ -373,3 +374,35 @@ Other transport. HTTP, udp, rdp, airhook, etc. May have to do our own link crypto, unless we can bully openssl into it. +*********** uncategorized + +- solx86 cpu worker never responds +- why gnutls is bad/not good for tor + +PHOBOS - convert the abuse section of the faq into a webpage like the +rest of ours; submit it to shari for approval to add to the official +site + +- flesh out the rest of the section 6 of the faq +- follow up to the archive.org lady to try to get her tor server working +- rewrite how libevent does select() on win32 so it's not so very slow. +- instrument the code to figure out where our memory is going. +- compare 0.1.0.5-rc vs 0.1.0.8-rc memory usage to test out old buffer +(1015) vs new buffer (0108) algorithms +- gather pointers to livecd distros that include tor +- we should remove our libevent tree from cvs. it's obsolete now. +- desired contribute.html patch: atches for dir-servers to verify server +reachability. +- i want to put the logo on the website, in source form, so people can +put it on stickers directly, etc. +- i want more pictures from ren. he wants to describe the tor handshake, +i want to talk about hidden services. +- make it clearer how to find the mailing lists from the website +(they're in users.html) +- switch accountingmax to count total in+out, not either in or out. it's +easy to move in this direction (not risky), but hard to back, out if we +decide we prefer it the way it already is. hm. +- clean up the places where our docs are redundant (or worse, obsolete +in one file and correct elsewhere). agl has a start on a global +list-of-tor-docs. + From arma at seul.org Wed Jun 8 02:03:28 2005 From: arma at seul.org (arma at seul.org) Date: Tue, 7 Jun 2005 22:03:28 -0400 (EDT) Subject: [or-cvs] try out something thomas suggested Message-ID: <20050608020328.B0947140804A@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/home/arma/work/onion/cvs/website Modified Files: faq-abuse.html stylesheet.css Log Message: try out something thomas suggested Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- faq-abuse.html 8 Jun 2005 00:56:49 -0000 1.7 +++ faq-abuse.html 8 Jun 2005 02:03:26 -0000 1.8 @@ -43,8 +43,8 @@

    Abuse FAQ for Tor Server Operators


    - -

    Doesn't Tor enable criminals to do bad things?

    + +

    Doesn't Tor enable criminals to do bad things?

    Criminals can already do bad things. Since they're willing to break laws, they already have lots of options available that provide Index: stylesheet.css =================================================================== RCS file: /home2/or/cvsroot/website/stylesheet.css,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- stylesheet.css 16 May 2005 21:06:27 -0000 1.13 +++ stylesheet.css 8 Jun 2005 02:03:26 -0000 1.14 @@ -90,6 +90,13 @@ font-size: 11px; } +a.anchor { + font-size: 12pt; + color: black; + font-weight: bold; + text-decoration: none; +} + /* The main column (left text) */ div.main-column { From phobos at seul.org Wed Jun 8 02:08:21 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 7 Jun 2005 22:08:21 -0400 (EDT) Subject: [or-cvs] TODO: cleaned up duplicates, moved some tasks from uncateg... Message-ID: <20050608020821.8B33014080CE@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv25735 Modified Files: TODO Log Message: TODO: cleaned up duplicates, moved some tasks from uncategorized into valid sections. Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.305 retrieving revision 1.306 diff -u -d -r1.305 -r1.306 --- TODO 8 Jun 2005 01:35:21 -0000 1.305 +++ TODO 8 Jun 2005 02:08:19 -0000 1.306 @@ -20,6 +20,8 @@ - Fix the remaining flyspray bugs marked for 0.1.0.9 - Free remaining unfreed memory (arma will run valgrind) - Note libevent/method/platform combos that are unlikely to work. + - rewrite how libevent does select() on win32 so it's not so very slow. + - instrument the code to figure out where our memory is going. (all platforms?) for 0.1.1.x: - cpu fixes: @@ -376,33 +378,17 @@ *********** uncategorized -- solx86 cpu worker never responds - why gnutls is bad/not good for tor - -PHOBOS - convert the abuse section of the faq into a webpage like the -rest of ours; submit it to shari for approval to add to the official -site - - flesh out the rest of the section 6 of the faq -- follow up to the archive.org lady to try to get her tor server working -- rewrite how libevent does select() on win32 so it's not so very slow. -- instrument the code to figure out where our memory is going. -- compare 0.1.0.5-rc vs 0.1.0.8-rc memory usage to test out old buffer -(1015) vs new buffer (0108) algorithms +- compare 0.1.0.5-rc vs 0.1.0.8-rc memory usage to test out old buffer (1015) vs new buffer (0108) algorithms - gather pointers to livecd distros that include tor - we should remove our libevent tree from cvs. it's obsolete now. -- desired contribute.html patch: atches for dir-servers to verify server -reachability. -- i want to put the logo on the website, in source form, so people can -put it on stickers directly, etc. -- i want more pictures from ren. he wants to describe the tor handshake, -i want to talk about hidden services. -- make it clearer how to find the mailing lists from the website -(they're in users.html) +- desired contribute.html patch: atches for dir-servers to verify server reachability. +- i want to put the logo on the website, in source form, so people can put it on stickers directly, etc. +- i want more pictures from ren. he wants to describe the tor handshake, i want to talk about hidden services. +- make it clearer how to find the mailing lists from the website (they're in users.html) - switch accountingmax to count total in+out, not either in or out. it's easy to move in this direction (not risky), but hard to back, out if we decide we prefer it the way it already is. hm. -- clean up the places where our docs are redundant (or worse, obsolete -in one file and correct elsewhere). agl has a start on a global -list-of-tor-docs. +- clean up the places where our docs are redundant (or worse, obsolete in one file and correct elsewhere). agl has a start on a global list-of-tor-docs. From phobos at seul.org Wed Jun 8 02:10:22 2005 From: phobos at seul.org (phobos at seul.org) Date: Tue, 7 Jun 2005 22:10:22 -0400 (EDT) Subject: [or-cvs] TODO: took some tasks to complete. Message-ID: <20050608021022.2625114080CE@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv25862 Modified Files: TODO Log Message: TODO: took some tasks to complete. Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.306 retrieving revision 1.307 diff -u -d -r1.306 -r1.307 --- TODO 8 Jun 2005 02:08:19 -0000 1.306 +++ TODO 8 Jun 2005 02:10:20 -0000 1.307 @@ -1,4 +1,4 @@ - +$Id$ Legend: SPEC!! - Not specified SPEC - Spec not finalized @@ -379,14 +379,14 @@ *********** uncategorized - why gnutls is bad/not good for tor -- flesh out the rest of the section 6 of the faq +PHOBOS - flesh out the rest of the section 6 of the faq - compare 0.1.0.5-rc vs 0.1.0.8-rc memory usage to test out old buffer (1015) vs new buffer (0108) algorithms -- gather pointers to livecd distros that include tor +PHOBOS - gather pointers to livecd distros that include tor - we should remove our libevent tree from cvs. it's obsolete now. - desired contribute.html patch: atches for dir-servers to verify server reachability. -- i want to put the logo on the website, in source form, so people can put it on stickers directly, etc. +PHOBOS - i want to put the logo on the website, in source form, so people can put it on stickers directly, etc. - i want more pictures from ren. he wants to describe the tor handshake, i want to talk about hidden services. -- make it clearer how to find the mailing lists from the website (they're in users.html) +PHOBOS - make it clearer how to find the mailing lists from the website (they're in users.html) - switch accountingmax to count total in+out, not either in or out. it's easy to move in this direction (not risky), but hard to back, out if we decide we prefer it the way it already is. hm. From nickm at seul.org Sat Jun 4 02:43:01 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 3 Jun 2005 22:43:01 -0400 (EDT) Subject: [or-cvs] Oops. I guess I would probably get more comments about thi... Message-ID: <20050604024301.CCEE214081BA@moria.seul.org> Update of /home/or/cvsroot/control/java/net/freehaven/tor/control/examples In directory moria:/tmp/cvs-serv6608/java/net/freehaven/tor/control/examples Added Files: .cvsignore DebuggingEventHandler.java Main.java Log Message: Oops. I guess I would probably get more comments about this clever controller API/demo stuff if I actually committed it to CVS. Here then. --- NEW FILE: .cvsignore --- *.class --- NEW FILE: DebuggingEventHandler.java --- // $Id: DebuggingEventHandler.java,v 1.1 2005/06/04 02:42:55 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control.examples; import net.freehaven.tor.control.*; import java.io.PrintWriter; import java.util.Iterator; public class DebuggingEventHandler implements EventHandler, TorControlCommands { protected PrintWriter out; public DebuggingEventHandler(PrintWriter p) { out = p; } public void circuitStatus(int status, int circID, String path) { out.println("Circuit "+Integer.toHexString(circID)+" is now "+ CIRC_STATUS_NAMES[status]+" (path="+path+")"); } public void streamStatus(int status, int streamID, String target) { out.println("Stream "+Integer.toHexString(streamID)+" is now "+ STREAM_STATUS_NAMES[status]+" (target="+target+")"); } public void orConnStatus(int status, String orName) { out.println("OR connection to "+orName+" is now "+ OR_CONN_STATUS_NAMES[status]); } public void bandwidthUsed(long read, long written) { out.println("Bandwidth usage: "+read+" bytes read; "+ written+" bytes written."); } public void newDescriptors(java.util.List orList) { out.println("New descriptors for routers:"); for (Iterator i = orList.iterator(); i.hasNext(); ) out.println(" "+i.next()); } public void message(int type, String msg) { String tp; switch (type) { case EVENT_MSG_INFO: tp = "info"; break; case EVENT_MSG_NOTICE: tp = "notice"; break; case EVENT_MSG_WARN: tp = "warn"; break; case EVENT_MSG_ERROR: tp = "error"; break; default: throw new Error("EventHandler.message() called with bad type: "+ type); } out.println("["+tp+"] "+msg.trim()); } } --- NEW FILE: Main.java --- // $Id: Main.java,v 1.1 2005/06/04 02:42:55 nickm Exp $ // Copyright 2005 Nick Mathewson, Roger Dingledine // See LICENSE file for copying information package net.freehaven.tor.control.examples; import net.freehaven.tor.control.*; import java.io.PrintWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.util.Iterator; public class Main implements TorControlCommands { public static void main(String args[]) { if (args.length < 1) { System.err.println("No command given."); return; } try { if (args[0].equals("set-config")) { setConfig(args); } else if (args[0].equals("get-config")) { getConfig(args); } else if (args[0].equals("get-info")) { getInfo(args); } else if (args[0].equals("listen")) { listenForEvents(args); } else if (args[0].equals("signal")) { signal(args); } else if (args[0].equals("auth")) { authDemo(args); } else { System.err.println("Unrecognized command: "+args[0]); } } catch (java.io.EOFException ex) { System.out.println("Control socket closed by Tor."); } catch (IOException ex) { System.err.println("IO exception when talking to Tor process: "+ ex); ex.printStackTrace(System.err); } catch (TorControlError ex) { System.err.println("Error from Tor process: "+ ex+" ["+ex.getErrorMsg()+"]"); } } private static TorControlConnection getConnection(String[] args, boolean daemon) throws IOException { TorControlConnection conn = new TorControlConnection(new java.net.Socket("127.0.0.1", 9100)); Thread th = conn.launchThread(daemon); conn.authenticate(new byte[0]); return conn; } private static TorControlConnection getConnection(String[] args) throws IOException { return getConnection(args, true); } public static void setConfig(String[] args) throws IOException { // Usage: "set-config [-save] key value key value key value" TorControlConnection conn = getConnection(args); ArrayList lst = new ArrayList(); int i = 1; boolean save = false; if (args[i].equals("-save")) { save = true; ++i; } for (; i < args.length; i +=2) { lst.add(args[i]+" "+args[i+1]); } conn.setConf(lst); if (save) { conn.saveConf(); } } public static void getConfig(String[] args) throws IOException { // Usage: get-config key key key TorControlConnection conn = getConnection(args); Map m = conn.getConf(Arrays.asList(args).subList(1,args.length)); for (int i = 1; i < args.length; ++i) { System.out.println("KEY: "+args[i]); System.out.println("VAL: "+m.get(args[i])); } } public static void getInfo(String[] args) throws IOException { TorControlConnection conn = getConnection(args); Map m = conn.getInfo(Arrays.asList(args).subList(1,args.length)); for (int i = 1; i < args.length; ++i) { System.out.println("KEY: "+args[i]); System.out.println("VAL: "+m.get(args[i])); } } public static void listenForEvents(String[] args) throws IOException { // Usage: listen [circ|stream|orconn|bw|newdesc|info|notice|warn|error]* TorControlConnection conn = getConnection(args, false); ArrayList lst = new ArrayList(); for (int i = 1; i < args.length; ++i) { short s = -1; if (args[i].equals("circ")) s = EVENT_CIRCSTATUS; else if (args[i].equals("stream")) s = EVENT_STREAMSTATUS; else if (args[i].equals("orconn")) s = EVENT_ORCONNSTATUS; else if (args[i].equals("bw")) s = EVENT_BANDWIDTH; else if (args[i].equals("newdesc")) s = EVENT_NEWDESCRIPTOR; else if (args[i].equals("info")) s = EVENT_MSG_INFO; else if (args[i].equals("notice")) s = EVENT_MSG_NOTICE; else if (args[i].equals("warn")) s = EVENT_MSG_WARN; else if (args[i].equals("error")) s = EVENT_MSG_ERROR; else { System.err.println("Unrecognized event type: "+args[i]); continue; } lst.add(new Integer(s)); } conn.setEventHandler( new DebuggingEventHandler(new PrintWriter(System.out, true))); conn.setEvents(lst); } public static void signal(String[] args) throws IOException { // Usage signal [reload|shutdown|dump|debug|halt] TorControlConnection conn = getConnection(args); byte sig; if (args[1].equals("reload")) sig = SIGNAL_HUP; else if (args[1].equals("shutdown")) sig = SIGNAL_INT; else if (args[1].equals("dump")) sig = SIGNAL_USR1; else if (args[1].equals("debug")) sig = SIGNAL_USR2; else if (args[1].equals("halt")) sig = SIGNAL_TERM; else { System.err.println("Unrecognized signal: "+args[1]); return; } conn.signal(sig); } public static void authDemo(String[] args) throws IOException { PasswordDigest pwd = PasswordDigest.generateDigest(); java.net.Socket s = new java.net.Socket("127.0.0.1", 9100); TorControlConnection conn = new TorControlConnection(s); conn.launchThread(true); conn.authenticate(new byte[0]); conn.setConf("HashedControlPassword", pwd.getHashedPassword()); conn = new TorControlConnection(new java.net.Socket("127.0.0.1", 9100)); conn.launchThread(true); conn.authenticate(pwd.getSecret()); } } From thomass at seul.org Wed Jun 8 02:17:47 2005 From: thomass at seul.org (thomass at seul.org) Date: Tue, 7 Jun 2005 22:17:47 -0400 (EDT) Subject: [or-cvs] Add a.anchor:link to stylesheet. Message-ID: <20050608021747.8BBE5140821C@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv26094 Modified Files: stylesheet.css Log Message: Add a.anchor:link to stylesheet. Index: stylesheet.css =================================================================== RCS file: /home2/or/cvsroot/website/stylesheet.css,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- stylesheet.css 8 Jun 2005 02:03:26 -0000 1.14 +++ stylesheet.css 8 Jun 2005 02:17:45 -0000 1.15 @@ -90,6 +90,13 @@ font-size: 11px; } +a.anchor:link { + font-size: 12pt; + color: black; + font-weight: bold; + text-decoration: none; +} + a.anchor { font-size: 12pt; color: black; From thomass at seul.org Wed Jun 8 02:27:03 2005 From: thomass at seul.org (thomass at seul.org) Date: Tue, 7 Jun 2005 22:27:03 -0400 (EDT) Subject: [or-cvs] Move and fix the rest of a:anchor. Thanks draco. Message-ID: <20050608022703.3B8EA1408EB1@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv26974 Modified Files: stylesheet.css Log Message: Move and fix the rest of a:anchor. Thanks draco. Index: stylesheet.css =================================================================== RCS file: /home2/or/cvsroot/website/stylesheet.css,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- stylesheet.css 8 Jun 2005 02:17:45 -0000 1.15 +++ stylesheet.css 8 Jun 2005 02:27:01 -0000 1.16 @@ -90,20 +90,6 @@ font-size: 11px; } -a.anchor:link { - font-size: 12pt; - color: black; - font-weight: bold; - text-decoration: none; -} - -a.anchor { - font-size: 12pt; - color: black; - font-weight: bold; - text-decoration: none; -} - /* The main column (left text) */ div.main-column { @@ -142,6 +128,28 @@ font-size: 10pt; } + +a.anchor:link { + font-size: 12pt; + color: black; + font-weight: bold; + text-decoration: none; +} + +a.anchor:visited { + font-size: 12pt; + color: black; + font-weight: bold; + text-decoration: none; +} + +a.anchor { + font-size: 12pt; + color: black; + font-weight: bold; + text-decoration: none; +} + td { vertical-align: top; } From thomass at seul.org Wed Jun 8 02:37:53 2005 From: thomass at seul.org (thomass at seul.org) Date: Tue, 7 Jun 2005 22:37:53 -0400 (EDT) Subject: [or-cvs] added the rest of the anchors to faq-abuse.html Message-ID: <20050608023753.18D731408075@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv27485 Modified Files: faq-abuse.html Log Message: added the rest of the anchors to faq-abuse.html Index: faq-abuse.html =================================================================== RCS file: /home2/or/cvsroot/website/faq-abuse.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- faq-abuse.html 8 Jun 2005 02:03:26 -0000 1.8 +++ faq-abuse.html 8 Jun 2005 02:37:51 -0000 1.9 @@ -57,8 +57,8 @@

    Tor aims to provide protection for ordinary people who want to follow the law. Only criminals have privacy right now; we need to fix that.

    - -

    Isn't it just a tradeoff: accepting the bad uses for the good ones?

    + +

    Isn't it just a tradeoff: accepting the bad uses for the good ones?

    No, we don't think that's how it works in the case of Tor.

    @@ -81,8 +81,8 @@ and other privacy measures can fight identity theft, physical crimes like stalking, and so on.

    - -

    What about distributed denial of service attacks?

    + +

    What about distributed denial of service attacks?

    Distributed denial of service attacks typically rely on having a group of thousands of computers all sending floods of traffic to a victim. Since @@ -102,8 +102,8 @@ much aggregate throughput you can eke out of it, then come back to us if you're still worried.

    - -

    What about spammers?

    + +

    What about spammers?

    The simple answer: The default Tor exit policy rejects all outgoing port 25 (SMTP) traffic. So sending spam mail through Tor isn't going to @@ -120,8 +120,8 @@ Tor's public key operations, etc, makes it not economically worthwhile for them to use Tor.

    - -

    How do Tor exit policies work?

    + +

    How do Tor exit policies work?

    Each Tor server has an exit policy that specifies what sort of outbound connections are allowed or refused from that server. The exit @@ -132,8 +132,8 @@

    This way each server can decide the services he wants to allow connections to, based on abuse potential and his own situation.

    - -

    Does Tor get much abuse?

    + +

    Does Tor get much abuse?

    Not much, in the grand scheme of things. We've been running the network since October 2003, and it's only generated a handful of complaints. Of @@ -148,8 +148,8 @@ well, we feel that we're doing pretty well at striking a balance currently.

    - -

    So what should I expect if I run a server?

    + +

    So what should I expect if I run a server?

    If you run a Tor server that allows exit connections (such as the default exit policy), it's probably safe to say that you will eventually @@ -193,8 +193,8 @@ them, and teach your friends (if they use them) to avoid them too.

  • - -

    Tor is banned from the IRC network I want to use.

    + +

    Tor is banned from the IRC network I want to use.

    Sometimes jerks make use of Tor to troll IRC channels. This abuse results in IP-specific temporary bans ("klines" in IRC lingo), as the @@ -247,8 +247,8 @@ so that others can share. At least one IRC network consults that page to unblock exit nodes that have been blocked inadvertently.

    - -

    Your nodes are banned from the mail server I want to use.

    + +

    Your nodes are banned from the mail server I want to use.

    Even though Tor isn't useful for spamming, some over-zealous blacklisters seem to think that all @@ -258,8 +258,8 @@ blacklists to refuse incoming mail, you should have a conversation with them and explain how Tor works.

    - -

    I want to ban the Tor network from my service.

    + +

    I want to ban the Tor network from my service.

    First, ask yourself if there's a way to do application-level decisions to separate the legitimate users from the jerks. For example, you might @@ -292,8 +292,8 @@ python script to parse the Tor directory here.

    - -

    I have legal questions about Tor abuse.

    + +

    I have legal questions about Tor abuse.

    We're only the developers. We can answer technical questions, but we're not the ones to talk to about legal questions or concerns.

    From arma at seul.org Wed Jun 8 04:55:08 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 8 Jun 2005 00:55:08 -0400 (EDT) Subject: [or-cvs] reenable the part of the code that tries to flush as soon a... Message-ID: <20050608045508.565D5140843D@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: connection.c connection_or.c main.c Log Message: reenable the part of the code that tries to flush as soon as an OR outbuf has a full tls record available. perhaps this will make OR outbufs not grow as huge except in rare cases, thus saving lots of cpu time plus memory. Index: connection.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/connection.c,v retrieving revision 1.373 retrieving revision 1.374 diff -u -d -r1.373 -r1.374 --- connection.c 23 May 2005 05:20:52 -0000 1.373 +++ connection.c 8 Jun 2005 04:55:06 -0000 1.374 @@ -975,6 +975,9 @@ int connection_handle_read(connection_t *conn) { int max_to_read=-1, try_to_read; + if (conn->marked_for_close) + return 0; /* do nothing */ + conn->timestamp_lastread = time(NULL); switch (conn->type) { @@ -1176,6 +1179,9 @@ tor_assert(!connection_is_listener(conn)); + if (conn->marked_for_close) + return 0; /* do nothing */ + conn->timestamp_lastwritten = now; /* Sometimes, "writable" means "connected". */ Index: connection_or.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/connection_or.c,v retrieving revision 1.174 retrieving revision 1.175 diff -u -d -r1.174 -r1.175 --- connection_or.c 20 May 2005 08:51:45 -0000 1.174 +++ connection_or.c 8 Jun 2005 04:55:06 -0000 1.175 @@ -579,20 +579,26 @@ connection_write_to_buf(n, CELL_NETWORK_SIZE, conn); -#if 0 /* commented out -- can we get away with not doing this, - * because we're already round-robining in handle_read? - */ #define MIN_TLS_FLUSHLEN 15872 /* openssl tls record size is 16383, this is close. The goal here is to * push data out as soon as we know there's enough for a tls record, so * during periods of high load we won't read the entire megabyte from - * input before pushing any data out. */ + * input before pushing any data out. It also has the feature of not + * growing huge outbufs unless something is slow. */ if (conn->outbuf_flushlen-CELL_NETWORK_SIZE < MIN_TLS_FLUSHLEN && conn->outbuf_flushlen >= MIN_TLS_FLUSHLEN) { int extra = conn->outbuf_flushlen - MIN_TLS_FLUSHLEN; conn->outbuf_flushlen = MIN_TLS_FLUSHLEN; if (connection_handle_write(conn) < 0) { - log_fn(LOG_WARN,"flushing failed."); + if (!conn->marked_for_close) { + /* this connection is broken. remove it. */ + log_fn(LOG_WARN,"Bug: unhandled error on write for OR conn (fd %d); removing", + conn->s); + tor_fragile_assert(); + conn->has_sent_end = 1; /* otherwise we cry wolf about duplicate close */ + /* XXX do we need a close-immediate here, so we don't try to flush? */ + connection_mark_for_close(conn); + } return; } if (extra) { @@ -600,8 +606,6 @@ connection_start_writing(conn); } } -#endif - } /** Process cells from conn's inbuf. Index: main.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.510 retrieving revision 1.511 diff -u -d -r1.510 -r1.511 --- main.c 7 Jun 2005 18:16:14 -0000 1.510 +++ main.c 8 Jun 2005 04:55:06 -0000 1.511 @@ -344,8 +344,6 @@ conn_read_callback(int fd, short event, void *_conn) { connection_t *conn = _conn; - if (conn->marked_for_close) - return; log_fn(LOG_DEBUG,"socket %d wants to read.",conn->s); @@ -376,8 +374,6 @@ connection_t *conn = _conn; log_fn(LOG_DEBUG,"socket %d wants to write.",conn->s); - if (conn->marked_for_close) - return; assert_connection_ok(conn, time(NULL)); From phobos at seul.org Wed Jun 8 05:13:38 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 8 Jun 2005 01:13:38 -0400 (EDT) Subject: [or-cvs] documentation.html: added TOC, cleaned up references, inser... Message-ID: <20050608051338.6621A1408EAD@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv6398 Modified Files: documentation.html users.html Log Message: documentation.html: added TOC, cleaned up references, inserted mailing list information users.html: removed mailing list information Index: documentation.html =================================================================== RCS file: /home/or/cvsroot/website/documentation.html,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- documentation.html 24 May 2005 15:11:59 -0000 1.30 +++ documentation.html 8 Jun 2005 05:13:36 -0000 1.31 @@ -39,10 +39,19 @@
    -

    Tor: Documentation

    +

    Table of Contents


    -

    Running Tor:

    + +
    + + +

    Running Tor

    + +

    Design Documents

    The design document (published at Usenix Security 2004) gives our justifications and security analysis for the Tor design:

    @@ -87,6 +98,8 @@ listen to the audio from the talk.

    + +

    Various HOWTO Docs

    Guide to Tor-ifying various applications @@ -106,6 +119,18 @@ Squid and Tor

    + +

    Mailing List Information

    +

    +The or-announce +mailing list is a low volume list for announcements of new +releases. The or-dev +mailing list is for posting by developers only and is where we +send notifications of prereleases and release candidates. The or-talk mailing list +is where a lot of the discussion happens. There's also a list for cvs commits. +

    Index: users.html =================================================================== RCS file: /home/or/cvsroot/website/users.html,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- users.html 24 May 2005 22:22:16 -0000 1.20 +++ users.html 8 Jun 2005 05:13:36 -0000 1.21 @@ -67,18 +67,6 @@

    -The or-announce -mailing list is a low volume list for announcements of new -releases. The or-dev -mailing list is for posting by developers only and is where we -send notifications of prereleases and release candidates. The or-talk mailing list -is where a lot of the discussion happens. There's also a list for cvs commits. -

    - - -

    The hidden wiki has a list of some hidden services and other things. You need Tor and a proxy like Privoxy to access it. From phobos at seul.org Wed Jun 8 05:17:37 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 8 Jun 2005 01:17:37 -0400 (EDT) Subject: [or-cvs] documentation.html: made mailing list info an unordered li... Message-ID: <20050608051737.A35EE1408EAD@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv6586 Modified Files: documentation.html Log Message: documentation.html: made mailing list info an unordered list sorta like everything else. Index: documentation.html =================================================================== RCS file: /home/or/cvsroot/website/documentation.html,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- documentation.html 8 Jun 2005 05:13:36 -0000 1.31 +++ documentation.html 8 Jun 2005 05:17:35 -0000 1.32 @@ -122,14 +122,17 @@

    Mailing List Information

    -The or-announce +

    From phobos at seul.org Wed Jun 8 05:29:17 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 8 Jun 2005 01:29:17 -0400 (EDT) Subject: [or-cvs] documentation.html: fixed an egregious duplicate of anchor... Message-ID: <20050608052917.59C9C1408279@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv7200 Modified Files: documentation.html Log Message: documentation.html: fixed an egregious duplicate of anchors in TOC and actual section. Turned HOWTO into ul as well. Index: documentation.html =================================================================== RCS file: /home/or/cvsroot/website/documentation.html,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- documentation.html 8 Jun 2005 05:17:35 -0000 1.32 +++ documentation.html 8 Jun 2005 05:29:15 -0000 1.33 @@ -43,10 +43,10 @@

    @@ -100,37 +100,22 @@

    Various HOWTO Docs

    -

    -Guide +

    Mailing List Information

    From phobos at seul.org Wed Jun 8 05:55:02 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 8 Jun 2005 01:55:02 -0400 (EDT) Subject: [or-cvs] documentation.html: fixed some non-xhtml 1.1 elements. Message-ID: <20050608055502.3D0661408EBB@moria.seul.org> Update of /home/or/cvsroot/website In directory moria:/tmp/cvs-serv7900 Modified Files: documentation.html Log Message: documentation.html: fixed some non-xhtml 1.1 elements. W3C Validator says, "This Page Is Valid XHTML 1.1!" Index: documentation.html =================================================================== RCS file: /home/or/cvsroot/website/documentation.html,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- documentation.html 8 Jun 2005 05:29:15 -0000 1.33 +++ documentation.html 8 Jun 2005 05:55:00 -0000 1.34 @@ -43,15 +43,15 @@

    -

    Running Tor

    +

    Running Tor

    -

    Design Documents

    +

    Design Documents

    The design document (published at Usenix Security 2004) gives our justifications and security analysis for the Tor design:

    @@ -99,26 +99,38 @@ listen to the audio from the talk.

    -

    Various HOWTO Docs

    +

    Various HOWTO Docs

    -

    Mailing List Information

    -

    +

    Mailing List Information

    -

    From nickm at seul.org Wed Jun 8 13:53:22 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 09:53:22 -0400 (EDT) Subject: [or-cvs] add patch for 143 and code to check for known-bad/slow libe... Message-ID: <20050608135322.AA6851408ECC@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv4933/src/or Modified Files: config.c Log Message: add patch for 143 and code to check for known-bad/slow libevent versions. Needs more testing. Index: config.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.353 retrieving revision 1.354 diff -u -d -r1.353 -r1.354 --- config.c 23 May 2005 04:28:58 -0000 1.353 +++ config.c 8 Jun 2005 13:53:19 -0000 1.354 @@ -216,6 +216,9 @@ static uint64_t config_parse_memunit(const char *s, int *ok); static int config_parse_interval(const char *s, int *ok); static void print_cvs_version(void); +static int init_libevent(void); +static void check_libevent_version(const char *m, const char *v, int server); + /* * Functions to read and write the global options pointer. @@ -283,27 +286,6 @@ if (options->RunAsDaemon) { start_daemon(); } - if (!libevent_initialized) { - configure_libevent_logging(); - /* If the kernel complains that some method (say, epoll) doesn't - * exist, we don't care about it, since libevent will cope. - */ - suppress_libevent_log_msg("Function not implemented"); -#ifdef __APPLE__ - putenv("EVENT_NOKQUEUE=1"); -#endif - event_init(); - suppress_libevent_log_msg(NULL); -#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD) - /* Making this a NOTICE for now so we can link bugs to a libevent versions - * or methods better. */ - log(LOG_NOTICE, "Initialized libevent version %s using method %s", - event_get_version(), event_get_method()); -#else - log(LOG_NOTICE, "Initialized old libevent (version 1.0b or earlier)"); -#endif - libevent_initialized = 1; - } clear_trusted_dir_servers(); for (cl = options->DirServers; cl; cl = cl->next) { @@ -342,12 +324,20 @@ mark_logs_temp(); /* Close current logs once new logs are open. */ if (config_init_logs(options, 0)<0) /* Configure the log(s) */ return -1; + /* Close the temporary log we used while starting up, if it isn't already * gone. */ close_temp_logs(); add_callback_log(LOG_ERR, LOG_ERR, control_event_logmsg); adjust_event_log_severity(); + /* Set up libevent. */ + if (!libevent_initialized) { + if (init_libevent()) + return -1; + libevent_initialized = 1; + } + options->_ConnLimit = set_max_file_descriptors((unsigned)options->ConnLimit, MAXCONNECTIONS); if (options->_ConnLimit < 0) @@ -2619,6 +2609,83 @@ return (int)r; } +/** + * Initialize the libevent library. + */ +static int +init_libevent(void) +{ + configure_libevent_logging(); + /* If the kernel complains that some method (say, epoll) doesn't + * exist, we don't care about it, since libevent will cope. + */ + suppress_libevent_log_msg("Function not implemented"); +#ifdef __APPLE__ + putenv("EVENT_NOKQUEUE=1"); +#endif + event_init(); + suppress_libevent_log_msg(NULL); +#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD) + /* Making this a NOTICE for now so we can link bugs to a libevent versions + * or methods better. */ + log(LOG_NOTICE, "Initialized libevent version %s using method %s", + event_get_version(), event_get_method()); + check_libevent_version(event_get_method(), event_get_version(), + get_options()->ORPort != 0); +#else + log(LOG_NOTICE, "Initialized old libevent (version 1.0b or earlier)"); + log(LOG_WARN, "You have a very old version of libevent. It is likely to be buggy; please consider building Tor with a more recent version."); +#endif + + return 0; +} + + +/** + * Compare the given libevent method and version to a list of versions + * which are known not to work. Warn the user as appropriate. + * + */ +static void +check_libevent_version(const char *m, const char *v, int server) +{ + int buggy = 0, iffy = 0, slow = 0; + + tor_assert(m && v); + + if (!strcmp(m, "kqueue")) { + if (!strcmp(v, "1.0c")) { + buggy = 1; + } + } else if (!strcmp(m, "epoll")) { + if (!strcmp(v, "1.0c") || !strcmp(v, "1.0d") || !strcmp(v, "1.0e")) + iffy = 1; + } else if (!strcmp(m, "poll")) { + if (!strcmp(v, "1.0c") || !strcmp(v, "1.0d")) + buggy = 1; + else if (!strcmp(v, "1.0e")) + slow = 1; + } else if (!strcmp(m, "poll")) { + if (!strcmp(v, "1.0c") || !strcmp(v, "1.0d") || !strcmp(v, "1.0e")) + slow = 1; + } + + if (buggy) { + log(LOG_WARN, + "There are known bugs in using %s with libevent %s. " + "Please use the latest version of libevent.", m, v); + } else if (iffy) { + log(LOG_WARN, + "There are minor bugs in using %s with libevent %s. " + "You may want to use the latest version of libevent.", m, v); + } else if (slow && server) { + log(LOG_WARN, +c "libevent %s can be very slow with %s. " + "When running a server, please use the latest version of libevent.",v,m); + } + +} + static void print_cvs_version(void) { From nickm at seul.org Wed Jun 8 13:54:04 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 09:54:04 -0400 (EDT) Subject: [or-cvs] Note item status Message-ID: <20050608135404.C2DAD1408ECC@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv5038/doc Modified Files: TODO Log Message: Note item status Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.307 retrieving revision 1.308 diff -u -d -r1.307 -r1.308 --- TODO 8 Jun 2005 02:10:20 -0000 1.307 +++ TODO 8 Jun 2005 13:54:02 -0000 1.308 @@ -19,8 +19,12 @@ - Why does kevent barf with EINVAL on some freebsd boxes? - Fix the remaining flyspray bugs marked for 0.1.0.9 - Free remaining unfreed memory (arma will run valgrind) - - Note libevent/method/platform combos that are unlikely to work. + . Note libevent/method/platform combos that are unlikely to work. + o Write + - Test + - Backport - rewrite how libevent does select() on win32 so it's not so very slow. + (Nice idea but nontrivial.) - instrument the code to figure out where our memory is going. (all platforms?) for 0.1.1.x: From nickm at seul.org Sat Jun 4 02:56:52 2005 From: nickm at seul.org (Nick Mathewson) Date: Fri, 3 Jun 2005 22:56:52 -0400 (EDT) Subject: [or-cvs] start a makefile Message-ID: <20050604025652.3C03414081A4@moria.seul.org> Update of /home/or/cvsroot/control In directory moria:/tmp/cvs-serv7218 Added Files: Makefile Log Message: start a makefile --- NEW FILE: Makefile --- (This appears to be a binary file; contents omitted.) From nickm at seul.org Wed Jun 8 16:26:46 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:26:46 -0400 (EDT) Subject: [or-cvs] Fix syntax error. Message-ID: <20050608162646.3ED161408ED9@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv12121/src/or Modified Files: config.c Log Message: Fix syntax error. Index: config.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.354 retrieving revision 1.355 diff -u -d -r1.354 -r1.355 --- config.c 8 Jun 2005 13:53:19 -0000 1.354 +++ config.c 8 Jun 2005 16:26:44 -0000 1.355 @@ -2680,7 +2680,7 @@ "You may want to use the latest version of libevent.", m, v); } else if (slow && server) { log(LOG_WARN, -c "libevent %s can be very slow with %s. " + "libevent %s can be very slow with %s. " "When running a server, please use the latest version of libevent.",v,m); } From nickm at seul.org Wed Jun 8 16:39:04 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:04 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163904.8F7031408EDA@moria.seul.org> Update of /home/or/cvsroot/libevent In directory moria:/tmp/cvs-serv13243 Removed Files: .cvsignore Makefile.am Makefile.in README README.tor acconfig.h aclocal.m4 buffer.c config.h.in configure configure.in devpoll.c epoll.c epoll_sub.c evbuffer.c event-internal.h event.3 event.c event.h evsignal.h install-sh kqueue.c log.c log.h missing mkinstalldirs poll.c rtsig.c select.c signal.c stamp-h.in Log Message: Remove tor libevent CVS fork --- .cvsignore DELETED --- --- Makefile.am DELETED --- --- Makefile.in DELETED --- --- README DELETED --- --- README.tor DELETED --- --- acconfig.h DELETED --- --- aclocal.m4 DELETED --- --- buffer.c DELETED --- --- config.h.in DELETED --- --- configure DELETED --- --- configure.in DELETED --- --- devpoll.c DELETED --- --- epoll.c DELETED --- --- epoll_sub.c DELETED --- --- evbuffer.c DELETED --- --- event-internal.h DELETED --- --- event.3 DELETED --- --- event.c DELETED --- --- event.h DELETED --- --- evsignal.h DELETED --- --- install-sh DELETED --- --- kqueue.c DELETED --- --- log.c DELETED --- --- log.h DELETED --- --- missing DELETED --- --- mkinstalldirs DELETED --- --- poll.c DELETED --- --- rtsig.c DELETED --- --- select.c DELETED --- --- signal.c DELETED --- --- stamp-h.in DELETED --- From nickm at seul.org Wed Jun 8 16:39:04 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:04 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163904.ACB661408EDE@moria.seul.org> Update of /home/or/cvsroot/libevent/WIN32-Prj In directory moria:/tmp/cvs-serv13243/WIN32-Prj Removed Files: libevent.dsp libevent.dsw Log Message: Remove tor libevent CVS fork --- libevent.dsp DELETED --- --- libevent.dsw DELETED --- From nickm at seul.org Wed Jun 8 16:39:04 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:04 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163904.AFA921408EDB@moria.seul.org> Update of /home/or/cvsroot/libevent/WIN32-Prj/event_test In directory moria:/tmp/cvs-serv13243/WIN32-Prj/event_test Removed Files: event_test.dsp test.txt Log Message: Remove tor libevent CVS fork --- event_test.dsp DELETED --- --- test.txt DELETED --- From nickm at seul.org Wed Jun 8 16:39:04 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:04 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163904.B1F0F1408EE1@moria.seul.org> Update of /home/or/cvsroot/libevent/WIN32-Code In directory moria:/tmp/cvs-serv13243/WIN32-Code Removed Files: config.h misc.c misc.h win32.c Log Message: Remove tor libevent CVS fork --- config.h DELETED --- --- misc.c DELETED --- --- misc.h DELETED --- --- win32.c DELETED --- From nickm at seul.org Wed Jun 8 16:39:04 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:04 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163904.DD9AB1408EE7@moria.seul.org> Update of /home/or/cvsroot/libevent/WIN32-Prj/signal_test In directory moria:/tmp/cvs-serv13243/WIN32-Prj/signal_test Removed Files: signal_test.dsp Log Message: Remove tor libevent CVS fork --- signal_test.dsp DELETED --- From nickm at seul.org Wed Jun 8 16:39:05 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:05 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163905.22D4D1408EEC@moria.seul.org> Update of /home/or/cvsroot/libevent/compat/sys In directory moria:/tmp/cvs-serv13243/compat/sys Removed Files: _time.h queue.h tree.h Log Message: Remove tor libevent CVS fork --- _time.h DELETED --- --- queue.h DELETED --- --- tree.h DELETED --- From nickm at seul.org Wed Jun 8 16:39:05 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:05 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163905.1FD671408EEB@moria.seul.org> Update of /home/or/cvsroot/libevent/compat In directory moria:/tmp/cvs-serv13243/compat Removed Files: err.h Log Message: Remove tor libevent CVS fork --- err.h DELETED --- From nickm at seul.org Wed Jun 8 16:39:05 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:05 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163905.80CEF1408EE4@moria.seul.org> Update of /home/or/cvsroot/libevent/sample In directory moria:/tmp/cvs-serv13243/sample Removed Files: .cvsignore Makefile.am Makefile.in event-test.c signal-test.c time-test.c Log Message: Remove tor libevent CVS fork --- .cvsignore DELETED --- --- Makefile.am DELETED --- --- Makefile.in DELETED --- --- event-test.c DELETED --- --- signal-test.c DELETED --- --- time-test.c DELETED --- From nickm at seul.org Wed Jun 8 16:39:05 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:05 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163905.2418C1408EEE@moria.seul.org> Update of /home/or/cvsroot/libevent/WIN32-Prj/time_test In directory moria:/tmp/cvs-serv13243/WIN32-Prj/time_test Removed Files: time_test.dsp Log Message: Remove tor libevent CVS fork --- time_test.dsp DELETED --- From nickm at seul.org Sat Jun 4 13:43:05 2005 From: nickm at seul.org (Nick Mathewson) Date: Sat, 4 Jun 2005 09:43:05 -0400 (EDT) Subject: [or-cvs] Add unit test for openpgp s2k Message-ID: <20050604134305.684A814080AF@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv26586/src/or Modified Files: test.c Log Message: Add unit test for openpgp s2k Index: test.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/test.c,v retrieving revision 1.177 retrieving revision 1.178 diff -u -d -r1.177 -r1.178 --- test.c 14 May 2005 00:13:17 -0000 1.177 +++ test.c 4 Jun 2005 13:43:03 -0000 1.178 @@ -565,6 +565,35 @@ } static void +test_crypto_s2k(void) +{ + char buf[29]; + char buf2[29]; + char *buf3; + int i; + + memset(buf, 0, sizeof(buf)); + memset(buf2, 0, sizeof(buf2)); + buf3 = tor_malloc(65536); + memset(buf3, 0, 65536); + + secret_to_key(buf+9, 20, "", 0, buf); + crypto_digest(buf2+9, buf3, 1024); + test_memeq(buf, buf2, 29); + + memcpy(buf,"vrbacrda",8); + memcpy(buf2,"vrbacrda",8); + buf[8] = 96; + buf2[8] = 96; + secret_to_key(buf+9, 20, "12345678", 8, buf); + for (i = 0; i < 65536; i += 16) { + memcpy(buf3+i, "vrbacrda12345678", 16); + } + crypto_digest(buf2+9, buf3, 65536); + test_memeq(buf, buf2, 29); +} + +static void test_util(void) { struct timeval start, end; struct tm a_time; @@ -1411,6 +1440,7 @@ // add_stream_log(LOG_DEBUG, LOG_ERR, "", stdout); test_crypto(); test_crypto_dh(); + test_crypto_s2k(); puts("\n========================= Util ============================"); test_gzip(); test_util(); From nickm at seul.org Wed Jun 8 16:39:06 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:39:06 -0400 (EDT) Subject: [or-cvs] Remove tor libevent CVS fork Message-ID: <20050608163906.D5D341408EDC@moria.seul.org> Update of /home/or/cvsroot/libevent/test In directory moria:/tmp/cvs-serv13243/test Removed Files: .cvsignore Makefile.am Makefile.in bench.c regress.c test-eof.c test-init.c test-time.c test-weof.c test.sh Log Message: Remove tor libevent CVS fork --- .cvsignore DELETED --- --- Makefile.am DELETED --- --- Makefile.in DELETED --- --- bench.c DELETED --- --- regress.c DELETED --- --- test-eof.c DELETED --- --- test-init.c DELETED --- --- test-time.c DELETED --- --- test-weof.c DELETED --- --- test.sh DELETED --- From nickm at seul.org Wed Jun 8 16:40:09 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 12:40:09 -0400 (EDT) Subject: [or-cvs] Add a "where did all the files go" README Message-ID: <20050608164009.A98F31408EDB@moria.seul.org> Update of /home/or/cvsroot/libevent In directory moria:/tmp/cvs-serv13898 Added Files: README.tor Log Message: Add a "where did all the files go" README From arma at seul.org Wed Jun 8 17:22:11 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 8 Jun 2005 13:22:11 -0400 (EDT) Subject: [or-cvs] update todo a bit more Message-ID: <20050608172211.9304E140827B@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: TODO Log Message: update todo a bit more Index: TODO =================================================================== RCS file: /home2/or/cvsroot/tor/doc/TODO,v retrieving revision 1.308 retrieving revision 1.309 diff -u -d -r1.308 -r1.309 --- TODO 8 Jun 2005 13:54:02 -0000 1.308 +++ TODO 8 Jun 2005 17:22:09 -0000 1.309 @@ -23,16 +23,15 @@ o Write - Test - Backport - - rewrite how libevent does select() on win32 so it's not so very slow. - (Nice idea but nontrivial.) - instrument the code to figure out where our memory is going. (all platforms?) for 0.1.1.x: - cpu fixes: + M rewrite how libevent does select() on win32 so it's not so very slow. - create-light - see if we should make use of truncate to retry - hardware accelerator support - - use aes when available + - use openssl aes when available - do the kernel buffer style design - continue decentralizing the directory M have two router descriptor formats @@ -387,7 +386,7 @@ - compare 0.1.0.5-rc vs 0.1.0.8-rc memory usage to test out old buffer (1015) vs new buffer (0108) algorithms PHOBOS - gather pointers to livecd distros that include tor - we should remove our libevent tree from cvs. it's obsolete now. -- desired contribute.html patch: atches for dir-servers to verify server reachability. +- desired contribute.html patch: patches for dir-servers to verify server reachability. PHOBOS - i want to put the logo on the website, in source form, so people can put it on stickers directly, etc. - i want more pictures from ren. he wants to describe the tor handshake, i want to talk about hidden services. PHOBOS - make it clearer how to find the mailing lists from the website (they're in users.html) From arma at seul.org Wed Jun 8 17:25:00 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 8 Jun 2005 13:25:00 -0400 (EDT) Subject: [or-cvs] dump periodic memory usage stats Message-ID: <20050608172500.D57161408ED3@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: main.c Log Message: dump periodic memory usage stats Index: main.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/main.c,v retrieving revision 1.511 retrieving revision 1.512 diff -u -d -r1.511 -r1.512 --- main.c 8 Jun 2005 04:55:06 -0000 1.511 +++ main.c 8 Jun 2005 17:24:58 -0000 1.512 @@ -34,6 +34,7 @@ /********* PROTOTYPES **********/ +static void dumpmemusage(int severity); static void dumpstats(int severity); /* log stats */ static void conn_read_callback(int fd, short event, void *_conn); static void conn_write_callback(int fd, short event, void *_conn); @@ -831,6 +832,9 @@ current_second = now.tv_sec; /* remember which second it is, for next time */ + if (current_second % 60 == 0) + dumpmemusage(get_min_log_level() Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: buffers.c Log Message: Some play code to throw away old buffers sometimes rather than constantly reallocing them; just in case this is our memory problem. It looks for now like it isn't, so disabled. Index: buffers.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/buffers.c,v retrieving revision 1.153 retrieving revision 1.154 diff -u -d -r1.153 -r1.154 --- buffers.c 6 Jun 2005 17:03:21 -0000 1.153 +++ buffers.c 8 Jun 2005 17:27:11 -0000 1.154 @@ -69,6 +69,11 @@ static INLINE void peek_from_buf(char *string, size_t string_len, buf_t *buf); +/** If the contents of buf wrap around the end of the allocated space, + * malloc a new buf and copy the contents in starting at the + * beginning. This operation is relatively expensive, so it shouldn't + * be used e.g. for every single read or write. + */ static void buf_normalize(buf_t *buf) { check(); @@ -156,7 +161,7 @@ buf->len-offset); offset -= (buf->len-new_capacity); } else { - /* The data doen't wrap around, but it does extend beyond the new + /* The data doesn't wrap around, but it does extend beyond the new * buffer length: * mem[offset] ... mem[offset+datalen-1] (the data) */ @@ -164,11 +169,27 @@ offset = 0; } } - buf->mem = GUARDED_MEM(tor_realloc(RAW_MEM(buf->mem), - ALLOC_LEN(new_capacity))); - SET_GUARDS(buf->mem, new_capacity); + + /* XXX Some play code to throw away old buffers sometimes rather + * than constantly reallocing them; just in case this is our memory + * problem. It looks for now like it isn't, so disabled. -RD */ + if (0 && new_capacity == MIN_LAZY_SHRINK_SIZE && + !buf->datalen && + buf->len >= 1<<16) { + /* don't realloc; free and malloc */ + char *newmem = GUARDED_MEM(tor_malloc(ALLOC_LEN(new_capacity))); + SET_GUARDS(newmem, new_capacity); + free(RAW_MEM(buf->mem)); + buf->mem = buf->cur = newmem; + + } else { + buf->mem = GUARDED_MEM(tor_realloc(RAW_MEM(buf->mem), + ALLOC_LEN(new_capacity))); + SET_GUARDS(buf->mem, new_capacity); + buf->cur = buf->mem+offset; + } buf_total_alloc += (new_capacity - buf->len); - buf->cur = buf->mem+offset; + if (offset + buf->datalen > buf->len) { /* We need to move data now that we are done growing. The buffer * now contains: From nickm at seul.org Wed Jun 8 17:41:34 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 13:41:34 -0400 (EDT) Subject: [or-cvs] Remove extraneous newlines from libevent log messages. Back... Message-ID: <20050608174134.BA2BF1408ED7@moria.seul.org> Update of /home/or/cvsroot/tor/src/common In directory moria:/tmp/cvs-serv16688/src/common Modified Files: log.c Log Message: Remove extraneous newlines from libevent log messages. Backport candidate? Index: log.c =================================================================== RCS file: /home/or/cvsroot/tor/src/common/log.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- log.c 8 Apr 2005 03:47:18 -0000 1.93 +++ log.c 8 Jun 2005 17:41:32 -0000 1.94 @@ -499,23 +499,29 @@ static void libevent_logging_callback(int severity, const char *msg) { + char buf[1024]; + size_t n; if (suppress_msg && strstr(msg, suppress_msg)) return; + n = strlcpy(buf, msg, sizeof(buf)); + if (n && n < sizeof(buf) && buf[n-1] == '\n') { + buf[n-1] = '\0'; + } switch (severity) { case _EVENT_LOG_DEBUG: - log(LOG_DEBUG, "Message from libevent: %s", msg); + log(LOG_DEBUG, "Message from libevent: %s", buf); break; case _EVENT_LOG_MSG: - log(LOG_INFO, "Message from libevent: %s", msg); + log(LOG_INFO, "Message from libevent: %s", buf); break; case _EVENT_LOG_WARN: - log(LOG_WARN, "Warning from libevent: %s", msg); + log(LOG_WARN, "Warning from libevent: %s", buf); break; case _EVENT_LOG_ERR: - log(LOG_ERR, "Error from libevent: %s", msg); + log(LOG_ERR, "Error from libevent: %s", buf); break; default: - log(LOG_WARN, "Message [%d] from libevent: %s", severity, msg); + log(LOG_WARN, "Message [%d] from libevent: %s", severity, buf); break; } } From nickm at seul.org Wed Jun 8 17:44:07 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 13:44:07 -0400 (EDT) Subject: [or-cvs] Backport: resolve bug 143 and warn about known-bad libevent... Message-ID: <20050608174407.5D6FC1408ED3@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv16818 Modified Files: Tag: tor-0_1_0-patches config.c Log Message: Backport: resolve bug 143 and warn about known-bad libevent versions Index: config.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.353 retrieving revision 1.353.2.1 diff -u -d -r1.353 -r1.353.2.1 --- config.c 23 May 2005 04:28:58 -0000 1.353 +++ config.c 8 Jun 2005 17:44:05 -0000 1.353.2.1 @@ -216,6 +216,9 @@ static uint64_t config_parse_memunit(const char *s, int *ok); static int config_parse_interval(const char *s, int *ok); static void print_cvs_version(void); +static int init_libevent(void); +static void check_libevent_version(const char *m, const char *v, int server); + /* * Functions to read and write the global options pointer. @@ -283,27 +286,6 @@ if (options->RunAsDaemon) { start_daemon(); } - if (!libevent_initialized) { - configure_libevent_logging(); - /* If the kernel complains that some method (say, epoll) doesn't - * exist, we don't care about it, since libevent will cope. - */ - suppress_libevent_log_msg("Function not implemented"); -#ifdef __APPLE__ - putenv("EVENT_NOKQUEUE=1"); -#endif - event_init(); - suppress_libevent_log_msg(NULL); -#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD) - /* Making this a NOTICE for now so we can link bugs to a libevent versions - * or methods better. */ - log(LOG_NOTICE, "Initialized libevent version %s using method %s", - event_get_version(), event_get_method()); -#else - log(LOG_NOTICE, "Initialized old libevent (version 1.0b or earlier)"); -#endif - libevent_initialized = 1; - } clear_trusted_dir_servers(); for (cl = options->DirServers; cl; cl = cl->next) { @@ -342,12 +324,20 @@ mark_logs_temp(); /* Close current logs once new logs are open. */ if (config_init_logs(options, 0)<0) /* Configure the log(s) */ return -1; + /* Close the temporary log we used while starting up, if it isn't already * gone. */ close_temp_logs(); add_callback_log(LOG_ERR, LOG_ERR, control_event_logmsg); adjust_event_log_severity(); + /* Set up libevent. */ + if (!libevent_initialized) { + if (init_libevent()) + return -1; + libevent_initialized = 1; + } + options->_ConnLimit = set_max_file_descriptors((unsigned)options->ConnLimit, MAXCONNECTIONS); if (options->_ConnLimit < 0) @@ -2619,6 +2609,83 @@ return (int)r; } +/** + * Initialize the libevent library. + */ +static int +init_libevent(void) +{ + configure_libevent_logging(); + /* If the kernel complains that some method (say, epoll) doesn't + * exist, we don't care about it, since libevent will cope. + */ + suppress_libevent_log_msg("Function not implemented"); +#ifdef __APPLE__ + putenv("EVENT_NOKQUEUE=1"); +#endif + event_init(); + suppress_libevent_log_msg(NULL); +#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD) + /* Making this a NOTICE for now so we can link bugs to a libevent versions + * or methods better. */ + log(LOG_NOTICE, "Initialized libevent version %s using method %s", + event_get_version(), event_get_method()); + check_libevent_version(event_get_method(), event_get_version(), + get_options()->ORPort != 0); +#else + log(LOG_NOTICE, "Initialized old libevent (version 1.0b or earlier)"); + log(LOG_WARN, "You have a very old version of libevent. It is likely to be buggy; please consider building Tor with a more recent version."); +#endif + + return 0; +} + + +/** + * Compare the given libevent method and version to a list of versions + * which are known not to work. Warn the user as appropriate. + * + */ +static void +check_libevent_version(const char *m, const char *v, int server) +{ + int buggy = 0, iffy = 0, slow = 0; + + tor_assert(m && v); + + if (!strcmp(m, "kqueue")) { + if (!strcmp(v, "1.0c")) { + buggy = 1; + } + } else if (!strcmp(m, "epoll")) { + if (!strcmp(v, "1.0c") || !strcmp(v, "1.0d") || !strcmp(v, "1.0e")) + iffy = 1; + } else if (!strcmp(m, "poll")) { + if (!strcmp(v, "1.0c") || !strcmp(v, "1.0d")) + buggy = 1; + else if (!strcmp(v, "1.0e")) + slow = 1; + } else if (!strcmp(m, "poll")) { + if (!strcmp(v, "1.0c") || !strcmp(v, "1.0d") || !strcmp(v, "1.0e")) + slow = 1; + } + + if (buggy) { + log(LOG_WARN, + "There are known bugs in using %s with libevent %s. " + "Please use the latest version of libevent.", m, v); + } else if (iffy) { + log(LOG_WARN, + "There are minor bugs in using %s with libevent %s. " + "You may want to use the latest version of libevent.", m, v); + } else if (slow && server) { + log(LOG_WARN, + "libevent %s can be very slow with %s. " + "When running a server, please use the latest version of libevent.",v,m); + } + +} + static void print_cvs_version(void) { From arma at seul.org Wed Jun 8 19:45:19 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 8 Jun 2005 15:45:19 -0400 (EDT) Subject: [or-cvs] don"t upload your descriptor if rebuilding it failed Message-ID: <20050608194519.554161408EF3@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: or.h router.c Log Message: don't upload your descriptor if rebuilding it failed Index: or.h =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/or.h,v retrieving revision 1.611 retrieving revision 1.612 diff -u -d -r1.611 -r1.612 --- or.h 7 Jun 2005 18:01:46 -0000 1.611 +++ or.h 8 Jun 2005 19:45:17 -0000 1.612 @@ -162,7 +162,7 @@ /** How long do we keep DNS cache entries before purging them? */ #define MAX_DNS_ENTRY_AGE (150*60) #else -#define MAX_DNS_ENTRY_AGE (15*60) +#define MAX_DNS_ENTRY_AGE (30*60) #endif /** How often do we rotate onion keys? */ Index: router.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/router.c,v retrieving revision 1.176 retrieving revision 1.177 diff -u -d -r1.176 -r1.177 --- router.c 27 May 2005 17:43:43 -0000 1.176 +++ router.c 8 Jun 2005 19:45:17 -0000 1.177 @@ -500,8 +500,8 @@ void consider_publishable_server(time_t now, int force) { if (decide_if_publishable_server(now)) { set_server_advertised(1); - router_rebuild_descriptor(force); - router_upload_dir_desc_to_dirservers(force); + if (router_rebuild_descriptor(force) == 0) + router_upload_dir_desc_to_dirservers(force); } else { set_server_advertised(0); } From nickm at seul.org Wed Jun 8 20:17:07 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 16:17:07 -0400 (EDT) Subject: [or-cvs] Reset buf->highwater every time buf_shrink is called, not j... Message-ID: <20050608201707.317951408EFA@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv26125/src/or Modified Files: buffers.c Log Message: Reset buf->highwater every time buf_shrink is called, not just on suffessful shrink. Index: buffers.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/buffers.c,v retrieving revision 1.154 retrieving revision 1.155 diff -u -d -r1.154 -r1.155 --- buffers.c 8 Jun 2005 17:27:11 -0000 1.154 +++ buffers.c 8 Jun 2005 20:17:05 -0000 1.155 @@ -284,13 +284,13 @@ while (buf->highwater < (new_len>>2) && new_len > MIN_LAZY_SHRINK_SIZE*2) new_len >>= 1; + buf->highwater = buf->datalen; if (new_len == buf->len) return; log_fn(LOG_DEBUG,"Shrinking buffer from %d to %d bytes.", (int)buf->len, (int)new_len); buf_resize(buf, new_len); - buf->highwater = buf->datalen; } /** Remove the first n bytes from buf. From nickm at seul.org Wed Jun 8 20:17:34 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 16:17:34 -0400 (EDT) Subject: [or-cvs] Reset buf->highwater every time buf_shrink is called, not j... Message-ID: <20050608201734.98D1F1408F00@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv26197/src/or Modified Files: Tag: tor-0_1_0-patches buffers.c Log Message: Reset buf->highwater every time buf_shrink is called, not just on suffessful shrink. Index: buffers.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/buffers.c,v retrieving revision 1.152 retrieving revision 1.152.2.1 diff -u -d -r1.152 -r1.152.2.1 --- buffers.c 3 May 2005 10:04:07 -0000 1.152 +++ buffers.c 8 Jun 2005 20:17:32 -0000 1.152.2.1 @@ -259,13 +259,13 @@ while (buf->highwater < (new_len>>2) && new_len > MIN_LAZY_SHRINK_SIZE*2) new_len >>= 1; + buf->highwater = buf->datalen; if (new_len == buf->len) return; log_fn(LOG_DEBUG,"Shrinking buffer from %d to %d bytes.", (int)buf->len, (int)new_len); buf_resize(buf, new_len); - buf->highwater = buf->datalen; } /** Remove the first n bytes from buf. From nickm at seul.org Sun Jun 5 14:10:50 2005 From: nickm at seul.org (Nick Mathewson) Date: Sun, 5 Jun 2005 10:10:50 -0400 (EDT) Subject: [or-cvs] Document s2k and cookie auth methods; resolve bug 153 Message-ID: <20050605141050.CE2EE14081D8@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv10258/doc Modified Files: control-spec.txt Log Message: Document s2k and cookie auth methods; resolve bug 153 Index: control-spec.txt =================================================================== RCS file: /home/or/cvsroot/tor/doc/control-spec.txt,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- control-spec.txt 5 Apr 2005 22:56:17 -0000 1.36 +++ control-spec.txt 5 Jun 2005 14:10:48 -0000 1.37 @@ -234,8 +234,11 @@ 3.8. AUTHENTICATE (Type 0x0007) Sent from the client to the server. Contains a 'magic cookie' to prove - that client is really the admin for this Tor process. The server responds - with DONE or ERROR. + that client is really allowed to control this Tor process. The server + responds with DONE or ERROR. + + The format of the 'cookie' is implementation-dependent; see 4.1 below for + information on how the standard Tor implementation handles it. 3.9. SAVECONF (Type 0x0008) @@ -460,30 +463,28 @@ 4. Implementation notes -4.1. There are four ways we could authenticate, for now: - - 1) Listen on 127.0.0.1; trust all local users. - - 2) Write a named socket in tor's data-directory or in some other location; - rely on the OS to ensure that only authorized users can open it. (NOTE: - the Linux unix(7) man page suggests that some BSDs don't enforce - authorization.) If the OS has named sockets, and implements - authentication, trust all users who can read Tor's data directory. - - 3) Write a random magic cookie to the FS in Tor's data-directory; use that - magic cookie for authentication. Trust all users who can read Tor's data - directory. +4.1. Authentication - 4) Store a salted-and-hashed passphrase in Tor's configuration. Use the - passphrase for authentication. Trust all users who know the passphrase. + By default, the current Tor implementation trusts all local users. - On Win32, our only options are 1, 3, and 4. Since the semantics for 2 - and 3 are so similar, we chose to not support 2, and just always bind - on 127.0.0.1. We've implemented 1, 3, and 4. + If the 'CookieAuthentication' option is true, Tor writes a "magic cookie" + file named "control_auth_cookie" into its data directory. To authenticate, + the controller must send the contents of this file. - By default, the Tor client accepts authentication approach #1. If - the controller wants Tor to demand more authentication, it should use - setconf and saveconf to configure Tor to demand more next time. + If the 'HashedControlPassword' option is set, it must contain the salted + hash of a secret password. The salted hash is computed according to the + S2K algorithm in RFC 2440 (OpenPGP), and prefixed with the s2k specifier. + This is then encoded in hexadecimal, prefixed by the indicator sequence + "16:". Thus, for example, the password 'foo' could encode to: + 16:660537E3E1CD49996044A3BF558097A981F539FEA2F9DA662B4626C1C2 + ++++++++++++++++**^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + salt hashed value + indicator + You can generate the salt of a password by calling + 'tor --hash-password ' + or by using the example code in the Python and Java controller libraries. + To authenticate under this scheme, the controller sends Tor the original + secret that was used to generate the password. 4.2. Don't let the buffer get too big. From arma at seul.org Wed Jun 8 20:32:24 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 8 Jun 2005 16:32:24 -0400 (EDT) Subject: [or-cvs] absolutely refuse to let people pick internal IP addresses if Message-ID: <20050608203224.BDA4D14081BB@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: config.c Log Message: absolutely refuse to let people pick internal IP addresses if they're using the default dirservers. we're getting a big pile of a dozen or so servers that have picked private IP addresses despite the warning (presumably they don't even know they have logs) Index: config.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.355 retrieving revision 1.356 diff -u -d -r1.355 -r1.356 --- config.c 8 Jun 2005 16:26:44 -0000 1.355 +++ config.c 8 Jun 2005 20:32:22 -0000 1.356 @@ -944,8 +944,9 @@ } /** - * Based on address, guess our public IP address and put it - * in addr. + * Based on options-\>Address, guess our public IP address and put it + * in *addr. Return 0 if all is well, or -1 if we can't find a + * suitable public IP address. */ int resolve_my_address(or_options_t *options, uint32_t *addr) @@ -994,12 +995,23 @@ } tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf)); - if (!explicit_ip && is_internal_IP(htonl(in.s_addr))) { - log_fn(LOG_WARN,"Address '%s' resolves to private IP '%s'. " - "Please set the Address config option to be the IP you want to use.", - hostname, tmpbuf); - if (!options->NoPublish) + if (is_internal_IP(htonl(in.s_addr)) && !options->NoPublish) { + /* make sure we're ok with publishing an internal IP */ + if (!options->DirServers) { + /* if they are using the default dirservers, disallow internal IPs always. */ + log_fn(LOG_WARN,"Address '%s' resolves to private IP '%s'. " + "Servers must use public IP addresses.", + hostname, tmpbuf); return -1; + } + if (!explicit_ip) { + /* even if they've set their own dirservers, require an explicit IP if + * they're using an internal address. */ + log_fn(LOG_WARN,"Address '%s' resolves to private IP '%s'. " + "Please set the Address config option to be the IP you want to use.", + hostname, tmpbuf); + return -1; + } } log_fn(LOG_DEBUG, "Resolved Address to %s.", tmpbuf); From nickm at seul.org Wed Jun 8 20:35:30 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 16:35:30 -0400 (EDT) Subject: [or-cvs] Fix warning about unused function when compiling with ancie... Message-ID: <20050608203530.9F6281408EFB@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv28124/src/or Modified Files: config.c Log Message: Fix warning about unused function when compiling with ancient libevent Index: config.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.356 retrieving revision 1.357 diff -u -d -r1.356 -r1.357 --- config.c 8 Jun 2005 20:32:22 -0000 1.356 +++ config.c 8 Jun 2005 20:35:28 -0000 1.357 @@ -217,8 +217,9 @@ static int config_parse_interval(const char *s, int *ok); static void print_cvs_version(void); static int init_libevent(void); +#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD) static void check_libevent_version(const char *m, const char *v, int server); - +#endif /* * Functions to read and write the global options pointer. @@ -2652,7 +2653,7 @@ return 0; } - +#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD) /** * Compare the given libevent method and version to a list of versions * which are known not to work. Warn the user as appropriate. @@ -2697,6 +2698,7 @@ } } +#endif static void print_cvs_version(void) From nickm at seul.org Wed Jun 8 20:36:15 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 16:36:15 -0400 (EDT) Subject: [or-cvs] Backport: Fix warning about unused function when compiling ... Message-ID: <20050608203615.8B41E1408EFB@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv28228 Modified Files: Tag: tor-0_1_0-patches config.c Log Message: Backport: Fix warning about unused function when compiling with ancient libevent Index: config.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.353.2.1 retrieving revision 1.353.2.2 diff -u -d -r1.353.2.1 -r1.353.2.2 --- config.c 8 Jun 2005 17:44:05 -0000 1.353.2.1 +++ config.c 8 Jun 2005 20:36:13 -0000 1.353.2.2 @@ -217,8 +217,9 @@ static int config_parse_interval(const char *s, int *ok); static void print_cvs_version(void); static int init_libevent(void); +#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD) static void check_libevent_version(const char *m, const char *v, int server); - +#endif /* * Functions to read and write the global options pointer. @@ -2640,7 +2641,7 @@ return 0; } - +#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD) /** * Compare the given libevent method and version to a list of versions * which are known not to work. Warn the user as appropriate. @@ -2685,6 +2686,7 @@ } } +#endif static void print_cvs_version(void) From arma at seul.org Wed Jun 8 20:45:31 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 8 Jun 2005 16:45:31 -0400 (EDT) Subject: [or-cvs] clean up the log warn a bit Message-ID: <20050608204531.C7DE21408EF0@moria.seul.org> Update of /home2/or/cvsroot/tor/src/or In directory moria:/home/arma/work/onion/cvs/tor/src/or Modified Files: config.c Log Message: clean up the log warn a bit Index: config.c =================================================================== RCS file: /home2/or/cvsroot/tor/src/or/config.c,v retrieving revision 1.357 retrieving revision 1.358 diff -u -d -r1.357 -r1.358 --- config.c 8 Jun 2005 20:35:28 -0000 1.357 +++ config.c 8 Jun 2005 20:45:29 -0000 1.358 @@ -1001,7 +1001,7 @@ if (!options->DirServers) { /* if they are using the default dirservers, disallow internal IPs always. */ log_fn(LOG_WARN,"Address '%s' resolves to private IP '%s'. " - "Servers must use public IP addresses.", + "Tor servers that use the default DirServers must have public IP addresses.", hostname, tmpbuf); return -1; } From arma at seul.org Wed Jun 8 21:22:38 2005 From: arma at seul.org (arma at seul.org) Date: Wed, 8 Jun 2005 17:22:38 -0400 (EDT) Subject: [or-cvs] more todo Message-ID: <20050608212238.DF6291408F0E@moria.seul.org> Update of /home2/or/cvsroot/tor/doc In directory moria:/home/arma/work/onion/cvs/tor/doc Modified Files: TODO Log Message: more todo Index: TODO =================================================================== RCS file: /home2/or/cvsroot/tor/doc/TODO,v retrieving revision 1.309 retrieving revision 1.310 diff -u -d -r1.309 -r1.310 --- TODO 8 Jun 2005 17:22:09 -0000 1.309 +++ TODO 8 Jun 2005 21:22:36 -0000 1.310 @@ -4,7 +4,7 @@ SPEC - Spec not finalized NICK - nick claims ARMA - arma claims -PHOBOS - phobos claims +PHOBOS - phobos claims - Not done * Top priority . Partially done @@ -13,7 +13,6 @@ X Abandoned For 0.1.0.x: - - Memory use on Linux: what's happening? - Why do solaris cpuworks go dormant? (Apparently, disabling threads fixes this.) - Why does kevent barf with EINVAL on some freebsd boxes? @@ -23,7 +22,9 @@ o Write - Test - Backport + - Memory use on Linux: what's happening? - instrument the code to figure out where our memory is going. (all platforms?) + - change torrc to point to abuse-faq (once abuse-faq is posted) for 0.1.1.x: - cpu fixes: @@ -37,7 +38,12 @@ M have two router descriptor formats - dirservers verify reachability claims - find 10 dirservers. - - dirservers have blacklist of IPs they hate. + - some back-out mechanism? + - dirservers have blacklist of IPs they hate + - a way of rolling back approvals to before a timestamp + - have new people be in limbo and need to demonstrate usefulness + before we approve them + - other? - dirservers publish router-status with all these flags. - alices fetch many router-statuses and update descriptors as needed. - add if-newer-than fetch options From nickm at seul.org Wed Jun 8 21:47:44 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 17:47:44 -0400 (EDT) Subject: [or-cvs] Update item status Message-ID: <20050608214744.8969D140809B@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv11198/doc Modified Files: TODO Log Message: Update item status Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.310 retrieving revision 1.311 diff -u -d -r1.310 -r1.311 --- TODO 8 Jun 2005 21:22:36 -0000 1.310 +++ TODO 8 Jun 2005 21:47:42 -0000 1.311 @@ -16,13 +16,15 @@ - Why do solaris cpuworks go dormant? (Apparently, disabling threads fixes this.) - Why does kevent barf with EINVAL on some freebsd boxes? + (Lucky is trying a patch that should tell us why.) - Fix the remaining flyspray bugs marked for 0.1.0.9 + (Only 124 remains.) - Free remaining unfreed memory (arma will run valgrind) - . Note libevent/method/platform combos that are unlikely to work. - o Write - - Test - - Backport - - Memory use on Linux: what's happening? + (Not for a stable release) + o Note libevent/method/platform combos that are unlikely to work. + . Memory use on Linux: what's happening? + - Is it threading? (Maybe, maybe not) + - Is it the buf_shrink bug? (Quite possibly) - instrument the code to figure out where our memory is going. (all platforms?) - change torrc to point to abuse-faq (once abuse-faq is posted) From nickm at seul.org Wed Jun 8 21:55:04 2005 From: nickm at seul.org (Nick Mathewson) Date: Wed, 8 Jun 2005 17:55:04 -0400 (EDT) Subject: [or-cvs] Fix an underflow in buffer use conting. Message-ID: <20050608215504.CADE414081A3@moria.seul.org> Update of /home/or/cvsroot/tor/src/or In directory moria:/tmp/cvs-serv11534/src/or Modified Files: buffers.c Log Message: Fix an underflow in buffer use conting. Index: buffers.c =================================================================== RCS file: /home/or/cvsroot/tor/src/or/buffers.c,v retrieving revision 1.155 retrieving revision 1.156 diff -u -d -r1.155 -r1.156 --- buffers.c 8 Jun 2005 20:17:05 -0000 1.155 +++ buffers.c 8 Jun 2005 21:55:02 -0000 1.156 @@ -669,6 +669,7 @@ tor_assert(_buf_end(buf) == buf->mem); memcpy(buf->mem, string+string_len, len2); buf->datalen += len2; + buf_total_used += len2; } if (buf->datalen > buf->highwater) buf->highwater = buf->datalen; From thomass at seul.org Wed Jun 8 22:52:44 2005 From: thomass at seul.org (thomass at seul.org) Date: Wed, 8 Jun 2005 18:52:44 -0400 (EDT) Subject: [or-cvs] download.html - point libevent link to provos" page Message-ID: <20050608225244.F1AE41408F1C@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv14260 Modified Files: download.html Log Message: download.html - point libevent link to provos' page Index: download.html =================================================================== RCS file: /home2/or/cvsroot/website/download.html,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- download.html 7 Jun 2005 21:29:10 -0000 1.99 +++ download.html 8 Jun 2005 22:52:42 -0000 1.100 @@ -74,7 +74,7 @@
  • Latest testing source: 0.1.0.8-rc (sig). -You will need +You will need libevent. If you are brave enough to try building from source on Windows, you'll need libevent 1.0c or later.
  • Latest stable source: 0.0.9.9 From thomass at seul.org Wed Jun 8 23:19:44 2005 From: thomass at seul.org (thomass at seul.org) Date: Wed, 8 Jun 2005 19:19:44 -0400 (EDT) Subject: [or-cvs] download.html - point OBSD chroot link to Wiki, add Debian ... Message-ID: <20050608231944.E89CE140809E@moria.seul.org> Update of /home2/or/cvsroot/website In directory moria:/tmp/cvs-serv15475 Modified Files: download.html Log Message: download.html - point OBSD chroot link to Wiki, add Debian chroot link Index: download.html =================================================================== RCS file: /home2/or/cvsroot/website/download.html,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- download.html 8 Jun 2005 22:52:42 -0000 1.100 +++ download.html 8 Jun 2005 23:19:42 -0000 1.101 @@ -130,14 +130,15 @@

    Packages for architectures other than i386 can be added on demand.

    - +

    +A guide to chrooting is available in the Wiki.


    FreeBSD: ports are obsolete, please install from source.

    -

    OpenBSD: cd /usr/ports/net/tor && make && make install (guide to chrooting)

    +

    OpenBSD: cd /usr/ports/net/tor && make && make install (guide to chrooting)

    NetBSD: cd /usr/pkgsrc/net/tor && make install

    From phobos at seul.org Thu Jun 9 01:57:13 2005 From: phobos at seul.org (phobos at seul.org) Date: Wed, 8 Jun 2005 21:57:13 -0400 (EDT) Subject: [or-cvs] removed mailing list to do for website Message-ID: <20050609015713.AABAD140804C@moria.seul.org> Update of /home/or/cvsroot/tor/doc In directory moria:/tmp/cvs-serv20453 Modified Files: TODO Log Message: removed mailing list to do for website Index: TODO =================================================================== RCS file: /home/or/cvsroot/tor/doc/TODO,v retrieving revision 1.311 retrieving revision 1.312 diff -u -d -r1.311 -r1.312 --- TODO 8 Jun 2005 21:47:42 -0000 1.311 +++ TODO 9 Jun 2005 01:57:11 -0000 1.312 @@ -389,17 +389,13 @@ *********** uncategorized -- why gnutls is bad/not good for tor -PHOBOS - flesh out the rest of the section 6 of the faq -- compare 0.1.0.5-rc vs 0.1.0.8-rc memory usage to test out old buffer (1015) vs new buffer (0108) algorithms -PHOBOS - gather pointers to livecd distros that include tor -- we should remove our libevent tree from cvs. it's obsolete now. -- desired contribute.html patch: patches for dir-servers to verify server reachability. -PHOBOS - i want to put the logo on the website, in source form, so people can put it on stickers directly, etc. -- i want more pictures from ren. he wants to describe the tor handshake, i want to talk about hidden services. -PHOBOS - make it clearer how to find the mailing lists from the website (they're in users.html) -- switch accountingmax to count total in+out, not either in or out. it's -easy to move in this direction (not risky), but hard to back, out if we -decide we prefer it the way it already is. hm. -- clean up the places where our docs are redundant (or worse, obsolete in one file and correct elsewhere). agl has a start on a global list-of-tor-docs. - + - why gnutls is bad/not good for tor +P - flesh out the rest of the section 6 of the faq + - compare 0.1.0.5-rc vs 0.1.0.8-rc memory usage to test out old buffer (1015) vs new buffer (0108) algorithms +P - gather pointers to livecd distros that include tor + - we should remove our libevent tree from cvs. it's obsolete now. + - desired contribute.html patch: patches for dir-servers to verify server reachability. +P - i want to put the logo on the website, in source form, so people can put it on stickers directly, etc. + - i want more pictures from ren. he wants to describe the tor handshake, i want to talk about hidden services. + o switch accountingmax to count total in+out, not either in or out. it's easy to move in this direction (not risky), but hard to back, out if we decide we prefer it the way it already is. hm. + - clean up the places where our docs are redundant (or worse, obsolete in one file and correct elsewhere). agl has a start on a global list-of-tor-docs.