Compare commits

..

243 Commits

Author SHA1 Message Date
Nick Mathewson 8608e6823e Add an initial .gitignore to maint-0.1.2 2009-04-29 09:20:05 -04:00
Nick Mathewson 571974d02a Backport to 0.1.2.x: Never allow a circuit to be created with the same circid as a circuit that has been marked for close. May fix 779. Needs testing.
svn:r16464
2008-08-07 20:19:53 +00:00
Nick Mathewson a0404dad39 r16691@tombo: nickm | 2008-07-03 11:04:03 -0400
Backport to 0.1.2: Fix for bug 742: do not use O_CREAT on 2-option version of open().  Especially do not use it on /dev/null.  Fix from Michael Scherer. Bugfix on 0.0.2pre19 (wow).


svn:r15628
2008-07-03 15:04:51 +00:00
Nick Mathewson 3403739969 Add instrumentation to the 0.1.2.x branch (disabled by default) to dump the weights of various directory servers when we update our local networkstatus opinions. To turn this on, define DUMP_DIR_WEIGHTS in routerlist.c. This has to be in 0.1.2.x, since the code to pick 0.1.2.x directories is pretty different in more recent releases.
svn:r15343
2008-06-18 03:26:13 +00:00
Peter Palfrader 6573da7f00 * backport from 0.2.0.26-rc-1: Conflict with old libssls.
* backport from 0.2.0.26-rc-1: On upgrading from versions prior to,
  including, 0.1.2.19-2 if we are a server (we have a /var/lib/tor/keys
  directory)
  - move /var/lib/tor/keys/secret_onion_key out of the way.
  - move /var/lib/tor/keys/secret_onion_key.old out of the way.
  - move /var/lib/tor/keys/secret_id_key out of the way if it was
    created on or after 2006-09-17, which is the day the bad
    libssl was uploaded to Debian unstable.
* backport from 0.2.0.26-rc-1: Add a NEWS file explaining this change.


svn:r14616
2008-05-14 20:29:47 +00:00
Peter Palfrader a2164245c0 Work around fig2dev failing to build the images on all archs - backport from 0.2.0.22-rc-1 (re #457568).
svn:r14609
2008-05-14 13:01:20 +00:00
Roger Dingledine 2bed102003 Take lefkada out of the list of v2 directory authorities, since
it has been down for months.


svn:r14427
2008-04-23 17:36:46 +00:00
Roger Dingledine b306920af1 backport r14375
svn:r14376
2008-04-16 00:08:20 +00:00
Nick Mathewson 5cbc887573 r18931@catbus: nickm | 2008-03-18 12:08:44 -0400
Backport to 0.1.2: Detect errors from directory listing correctly on win32.  Bug found by lodger.


svn:r14104
2008-03-18 16:09:07 +00:00
Nick Mathewson 69198d0156 r14473@tombo: nickm | 2008-02-26 13:44:19 -0500
Rearrange TODO.012 items.


svn:r13742
2008-02-26 19:27:45 +00:00
Nick Mathewson 564028a07d r14472@tombo: nickm | 2008-02-26 13:44:08 -0500
Backport trivial fix for problem that kept nameserver errors from getting reported.


svn:r13741
2008-02-26 19:27:39 +00:00
Nick Mathewson c9c7f3c892 r14360@31-33-219: nickm | 2008-02-21 10:41:09 -0500
Note a couple of items for backport. in TODO.012, including a couple from arma.


svn:r13656
2008-02-21 15:41:14 +00:00
Roger Dingledine 2d7f7a6456 fix bug in r13469:
Feb 21 01:07:02.132 [warn] connection_about_to_close_connection(): Harmless bug: Edge connection (marked at dirserv.c:2062) hasn't sent end yet?


svn:r13646
2008-02-21 06:45:04 +00:00
Roger Dingledine c047d647e3 bump stable to 0.1.2.19-dev, so i can mess with it.
svn:r13629
2008-02-20 22:39:26 +00:00
Roger Dingledine f1b581bfac nick wants this one to compile too. geez.
svn:r13589
2008-02-19 22:08:44 +00:00
Nick Mathewson 352824d95f r18214@catbus: nickm | 2008-02-19 17:07:55 -0500
Backport to 0.1.2.x: Add some checks in torgzip.c to make sure we never overflow size_t there.  Also make sure we do not realloc(list,0) in container.c.


svn:r13588
2008-02-19 22:08:01 +00:00
Roger Dingledine a1e8cf5ccb backport r13583
svn:r13584
2008-02-19 21:38:27 +00:00
Nick Mathewson 839a8a8014 r14192@tombo: nickm | 2008-02-15 18:41:35 -0500
Note some items for backport.


svn:r13534
2008-02-15 23:41:40 +00:00
Roger Dingledine 27227679b4 backport r13488
svn:r13489
2008-02-13 07:25:27 +00:00
Nick Mathewson c3bd8d144c r18031@catbus: nickm | 2008-02-11 13:54:58 -0500
Have assert_connection_ok() allow marked-for-close dir conns with stuff to flush but no way to flush it.  Adjust conn_dirserv_unlink_from_bridge() to mark edge and dir conns not already marked, since once linked conns are unlinked they are no longer viable.  Likely fix for bug 406, which was crashing 0.1.2.x servers periodically.


svn:r13469
2008-02-11 18:55:05 +00:00
Roger Dingledine 259d2f7207 backport r13442 and r13444
svn:r13445
2008-02-09 13:13:38 +00:00
Peter Palfrader 54d2258feb Copyright file update
svn:r13367
2008-02-03 20:53:52 +00:00
Peter Palfrader 6a7a064498 Backport from 0.2.0.18-alpha + 1: We now use the shipped images on mipsel and
sparc (in addition to s390) because fig2dev segfaults on those archs (re
#457568).


svn:r13359
2008-02-02 14:16:14 +00:00
Nick Mathewson 76ca012a3b r17856@catbus: nickm | 2008-01-30 18:45:36 -0500
Backport leak fixes from r13148.


svn:r13343
2008-01-30 23:46:02 +00:00
Nick Mathewson 2a9ba2e257 r17845@catbus: nickm | 2008-01-30 13:32:22 -0500
Backport: Fix bug 597: stop telling people to email Tor-ops.  Also give a better suggestion when some other identity has been assigned the nickname we are using.


svn:r13338
2008-01-30 18:32:39 +00:00
Roger Dingledine 1ae9d27387 a blurb for 0.1.2.19, and put it in the release notes
svn:r13187
2008-01-19 17:56:14 +00:00
Peter Palfrader 23c72821e7 New upstream version
svn:r13164
2008-01-17 20:33:51 +00:00
Roger Dingledine fe4a6cd08e bump stable to 0.1.2.19
svn:r13158
2008-01-17 19:49:26 +00:00
Nick Mathewson 31473ee286 r17627@catbus: nickm | 2008-01-15 00:57:52 -0500
Backport the user-visible bugfixes from r13136.


svn:r13137
2008-01-15 05:57:55 +00:00
Nick Mathewson b7494ce8e9 r17621@catbus: nickm | 2008-01-14 14:03:29 -0500
Backport the parts of r13129 through r13133 that represent actual potential for bugs.


svn:r13134
2008-01-14 19:03:33 +00:00
Nick Mathewson 6d9816d9e9 r17562@catbus: nickm | 2008-01-10 13:11:25 -0500
Oops. Forgot to commit changelog for a couple of 0.1.2.x backports.


svn:r13097
2008-01-10 18:11:34 +00:00
Andrew Lewman bf6ef1bf00 Backport: update documentation to match the new installers.
svn:r13069
2008-01-08 01:58:36 +00:00
Andrew Lewman 24551dfc73 update copyright in suse script.
svn:r13068
2008-01-08 01:55:07 +00:00
Andrew Lewman 86bee1e461 Backport: the new win32 installer has been through four releases,
consider it well tested.


svn:r13066
2008-01-08 01:51:17 +00:00
Andrew Lewman 136c7482aa Backport: the alpha installer for osx has been through four release,
consider it well tested.


svn:r13065
2008-01-08 01:50:28 +00:00
Nick Mathewson a0eb902277 r17507@catbus: nickm | 2008-01-07 15:03:24 -0500
Backport r12341: If setting our rlimit to rlim_max or cap fails, fall back to OPEN_FILES if defiled.  This makes Tor run on OSX 10.5, while allowing OSX to mend its ways in the future.


svn:r13060
2008-01-07 20:03:27 +00:00
Nick Mathewson 75299426d0 r17505@catbus: nickm | 2008-01-07 14:51:37 -0500
Backport r12339 with fix in r12931: Work on platforms where rlim_t is wider than unsigned long.


svn:r13059
2008-01-07 19:51:42 +00:00
Nick Mathewson ad7837d925 r17496@catbus: nickm | 2008-01-07 12:49:06 -0500
Backport: Consequence of fix for 539: when a client gets a 503 response with a nontrivial body, pretend it got a 200 response.  This lets clients use information erroneously sent to them by old buggy servers.


svn:r13055
2008-01-07 17:49:22 +00:00
Roger Dingledine 83ac50c2b2 If we were having problems getting a particular descriptor from the
directory caches, and then we learned about a new descriptor for
that router, we weren't resetting our failure count. Reported
by lodger.


svn:r13047
2008-01-07 08:43:52 +00:00
Roger Dingledine b5e04c92a9 bump stable to 0.1.2.18-dev; we should put out a 0.1.2.19 soon.
svn:r13046
2008-01-07 07:54:48 +00:00
Andrew Lewman b2362c352c fix a typo. thanks sjmurdoch.
svn:r12979
2007-12-25 19:03:23 +00:00
Nick Mathewson 77da84b70c r15650@tombo: nickm | 2007-12-23 13:29:07 -0500
mark a couple of patches as bakportable.


svn:r12947
2007-12-23 18:29:41 +00:00
Nick Mathewson c52cacb1a2 r17275@catbus: nickm | 2007-12-20 01:15:04 -0500
Backport: Don't try to create the datadir when we are only verifying the configuration or hashing a password. Resolves bug 540.


svn:r12885
2007-12-20 06:15:19 +00:00
Nick Mathewson 349e55e6cb r17271@catbus: nickm | 2007-12-20 00:05:49 -0500
Backport: When we decide to send a 503 in response to a request for server descriptors, disable spooling so that we do not then send the descriptors anyway.  Fixes bug 539.


svn:r12883
2007-12-20 05:09:53 +00:00
Nick Mathewson 5fe06d0f02 r17099@catbus: nickm | 2007-12-11 18:16:59 -0500
Backport part of 12767: make configure script work even on my current catbus install, even with weird headers.


svn:r12773
2007-12-11 23:21:44 +00:00
Nick Mathewson 8e5cb98b8f r17097@catbus: nickm | 2007-12-11 18:13:48 -0500
Move last changelog entry to 0.1.2.19; 0.1.2.18 is already out.


svn:r12772
2007-12-11 23:21:41 +00:00
Nick Mathewson 9a3597c418 r17095@catbus: nickm | 2007-12-11 18:11:13 -0500
Backport r12766: Patch from mwenge: fix consensus status lookup by nickname when nickname is a hexdigest.


svn:r12770
2007-12-11 23:17:06 +00:00
Roger Dingledine 1acfe321f8 backport r12658
svn:r12659
2007-12-03 22:47:18 +00:00
Roger Dingledine 47f011cac8 backport r12628
svn:r12629
2007-12-01 23:34:43 +00:00
Roger Dingledine 9df8eec60e backport r12459
svn:r12611
2007-11-30 07:49:49 +00:00
Roger Dingledine d9ad41767b backport r12507
svn:r12508
2007-11-15 22:08:12 +00:00
Peter Palfrader 6a8180657c Seems I never committed the 0.1.2.18-1 chlog
svn:r12500
2007-11-15 10:05:05 +00:00
Roger Dingledine 12e6d8c7f2 backport the fixes for bug 549.
svn:r12473
2007-11-11 05:36:28 +00:00
Roger Dingledine 036c72bd21 a blurb for 0.1.2.18; put it in releasenotes too
svn:r12464
2007-11-11 00:33:04 +00:00
Roger Dingledine 281c749648 we might want to backport r12459 too
svn:r12460
2007-11-10 21:19:22 +00:00
Nick Mathewson 75e2026626 r16469@catbus: nickm | 2007-11-06 15:16:13 -0500
Oops.  0.1.2.18 is already released; put the changelog entry for r12402 in the right place.


svn:r12403
2007-11-06 20:17:17 +00:00
Nick Mathewson fad1656a7f r16467@catbus: nickm | 2007-11-06 14:57:00 -0500
Backport r12400 and r12401: Do not allow buckets to overflow.


svn:r12402
2007-11-06 19:58:06 +00:00
Nick Mathewson 897f64c95d r14654@tombo: nickm | 2007-11-02 12:05:39 -0400
Note r12341 for backport.


svn:r12342
2007-11-02 16:05:42 +00:00
Nick Mathewson f7eb647cfb r14650@tombo: nickm | 2007-11-02 10:53:42 -0400
Note r12339 for backport


svn:r12340
2007-11-02 14:53:47 +00:00
Andrew Lewman 21f26ab0cf backport the removal of openssl from trunk
svn:r12322
2007-11-02 03:08:26 +00:00
Andrew Lewman c6d931e2eb backport the torrc changes to postflight for osx.
svn:r12309
2007-11-01 04:43:02 +00:00
Andrew Lewman 39ab0161e5 Fix the logfile location for osx.
svn:r12308
2007-11-01 04:40:36 +00:00
Andrew Lewman 0be7df0932 Update -stable privoxy.config
svn:r12288
2007-10-31 03:41:58 +00:00
Andrew Lewman 443bb2c771 Look at all of these places with the wrong url.
svn:r12266
2007-10-29 00:57:14 +00:00
Andrew Lewman a6bf7e8c4c Update url in more places.
svn:r12265
2007-10-29 00:49:54 +00:00
Andrew Lewman 7bf9217a3b Update openssl version.
svn:r12264
2007-10-29 00:48:19 +00:00
Andrew Lewman 04bb9d1ddf Update website links.
svn:r12263
2007-10-29 00:47:02 +00:00
Roger Dingledine 105ac3a1da bump stable to 0.1.2.18, and schedule it for today.
svn:r12249
2007-10-28 11:17:47 +00:00
Nick Mathewson 3e8a1707e9 r16106@catbus: nickm | 2007-10-24 11:45:56 -0400
Note r12153/4 as backportable.


svn:r12155
2007-10-24 15:47:01 +00:00
Roger Dingledine 1137f40010 notes for two more backports we want to do
svn:r12142
2007-10-24 12:51:24 +00:00
Peter Palfrader 266b66ef8a Enable unit tests again
svn:r12039
2007-10-19 01:57:47 +00:00
Roger Dingledine 9efb93165c backport r12034
svn:r12036
2007-10-18 23:16:08 +00:00
Nick Mathewson 022b087148 r15902@catbus: nickm | 2007-10-18 07:53:26 -0400
Backport: "if (!router_get_trusted_dirservers())" is a bad test: router_get_trusted_dirservers() always returns a list.  Instead, check for whether the list is empty.


svn:r12015
2007-10-18 11:59:39 +00:00
Nick Mathewson b3c6fd7fc6 r15881@catbus: nickm | 2007-10-17 14:59:36 -0400
Backport: Patch from robert hogan: do not reset trusted dir server list when we get a config option.


svn:r12014
2007-10-18 11:56:56 +00:00
Andrew Lewman d3a6276031 devilproxytor noticed tor_gencert isn't needed, so remove it.
svn:r12003
2007-10-17 19:57:18 +00:00
Andrew Lewman b545fb5f7e backport osx 10.5 (leopard) fixes for uninstaller.
svn:r11996
2007-10-17 11:37:42 +00:00
Nick Mathewson 427eb4649b r15842@catbus: nickm | 2007-10-16 09:58:33 -0400
Backport warning-suppression for gcc 4.2.


svn:r11981
2007-10-16 13:59:34 +00:00
Nick Mathewson a58ba03b85 r15841@catbus: nickm | 2007-10-16 09:49:19 -0400
Backport unit test fix for revised hidden service code.


svn:r11980
2007-10-16 13:59:32 +00:00
Peter Palfrader b031d6c139 0.1.2.17-dev-1 development snapshot
svn:r11978
2007-10-16 11:36:45 +00:00
Roger Dingledine 586c943ee7 rearrange the 0.1.2.18 changelog
svn:r11941
2007-10-15 06:08:54 +00:00
Roger Dingledine ec186e77d5 backport a little bit of r11915
svn:r11940
2007-10-15 05:41:02 +00:00
Andrew Lewman 75992364c9 Update my backport todo's
svn:r11933
2007-10-14 18:19:19 +00:00
Andrew Lewman d628b63285 backport torpostflight changes
svn:r11931
2007-10-14 12:29:26 +00:00
Andrew Lewman 291dc2eeed Backport TorPreFlight changes.
svn:r11930
2007-10-14 12:26:59 +00:00
Nick Mathewson 2e11f7d9dd r15764@catbus: nickm | 2007-10-14 04:43:10 -0400
Backport r11829: Downgrade warning that caused bug 463; comment; resolve.


svn:r11929
2007-10-14 08:48:59 +00:00
Nick Mathewson 05053561b9 r15763@catbus: nickm | 2007-10-14 04:40:00 -0400
Backport r11886 and r11887: Fix for the reported case of bug 438: check families as well as identities in circuit_find_to_cannibalize().  Code audit STILL pending. ;)


svn:r11928
2007-10-14 08:48:56 +00:00
Nick Mathewson 3cb69a9ce4 r15762@catbus: nickm | 2007-10-14 04:33:10 -0400
Minimal backport for r11882: Fix bug 451 by bailing out of connection_finish_flushing when there is no socket or write_event.


svn:r11927
2007-10-14 08:48:54 +00:00
Nick Mathewson dd44c068c5 r15761@catbus: nickm | 2007-10-14 04:24:18 -0400
backport r11828:  when accept gives us something we didn't want (which means "not AF_INET" in 0.1.2.x) then warn and bail from connection_handle_listener_read().


svn:r11926
2007-10-14 08:48:51 +00:00
Nick Mathewson 172773cf55 r15760@catbus: nickm | 2007-10-14 04:16:19 -0400
Backport 11166: When loading state info from disk, never believe any date in the future.


svn:r11925
2007-10-14 08:48:48 +00:00
Roger Dingledine 8bf32223d7 backport r11499, r11500, r11501: hidserv hexdigests rather than nicknames
svn:r11922
2007-10-14 07:51:39 +00:00
Roger Dingledine 8b35202b47 remove some done items; futz with changelog
svn:r11920
2007-10-14 07:31:57 +00:00
Roger Dingledine 9b2802c4be assign some backport items to nick and phobos and roger, mostly
based on who wrote the original patch. also recommend against
backporting a few of them.


svn:r11919
2007-10-14 07:19:39 +00:00
Roger Dingledine d84aa94cba i bet we'll be happier if we backport some of r11915
svn:r11916
2007-10-13 22:35:59 +00:00
Nick Mathewson 2d4f755072 r15709@catbus: nickm | 2007-10-11 17:36:47 -0400
Note r11886 for backport


svn:r11888
2007-10-11 21:41:43 +00:00
Nick Mathewson 3ae157b8dc r15700@catbus: nickm | 2007-10-11 16:41:55 -0400
Note 3 more backportable items.


svn:r11883
2007-10-11 20:46:57 +00:00
Roger Dingledine 60c9b17774 backport r11864
svn:r11865
2007-10-11 03:30:15 +00:00
Andrew Lewman 02e6165664 Apparently we really want libevent-1.1a required for Redhat EL 5 and
beyond.  Backported as well.


svn:r11825
2007-10-09 23:35:39 +00:00
Andrew Lewman 08371520d2 backport the dscl addition for osx 10.5 users.
svn:r11766
2007-10-05 00:48:04 +00:00
Roger Dingledine b0b1665765 also update ReleaseNotes in 0.1.2.x
svn:r11703
2007-09-28 22:53:53 +00:00
Andrew Lewman 39027356ec Updates to the SUSE init script. Suggestions by Lars Vodgt.
svn:r11647
2007-09-25 23:59:33 +00:00
Andrew Lewman 40675e9eff Backport the spurious % removal.
svn:r11645
2007-09-25 23:43:08 +00:00
Andrew Lewman f24cfdd75d backport torrc.sample changes.
svn:r11643
2007-09-25 23:11:59 +00:00
Nick Mathewson 2cd6a240bd r15320@catbus: nickm | 2007-09-24 11:49:09 -0400
Backport r11332: fix a user-triggerable segfault in expand_filename("~").


svn:r11608
2007-09-24 15:53:51 +00:00
Nick Mathewson 3115905506 r15319@catbus: nickm | 2007-09-24 11:47:16 -0400
Backport r11293: bulletproof the code that generates extend_info.  I am still not sure whether this bug ever occurs on 0.1.2.x, or whether it only appears when the bridge code is present, but in any case it costs us nothing.


svn:r11607
2007-09-24 15:53:49 +00:00
Nick Mathewson 383c8deced r15318@catbus: nickm | 2007-09-24 11:42:25 -0400
Backport r11566 so that --list-fingerprint will not die when it finds no state file.


svn:r11606
2007-09-24 15:53:47 +00:00
Nick Mathewson dcbae324ec r15315@catbus: nickm | 2007-09-24 11:37:25 -0400
Backport patch from Robert Hogan: fix a status-event related typo.


svn:r11605
2007-09-24 15:41:28 +00:00
Roger Dingledine d2b76f34e6 we'll need to backport some variant of r11566 before the
next stable release.


svn:r11567
2007-09-21 21:54:26 +00:00
Nick Mathewson 396ebc075a r15261@catbus: nickm | 2007-09-21 15:58:27 -0400
Make a couple more backportable patches.


svn:r11562
2007-09-21 20:02:50 +00:00
Roger Dingledine 2ee02e848e r11548 is a backport candidate, phobos says
svn:r11549
2007-09-21 02:03:31 +00:00
Andrew Lewman 1a4cbf7e1d Backport the removal of requiring libevent on rpm installation. It's
statically linked in the official rpms anyway.


svn:r11505
2007-09-19 03:13:03 +00:00
Roger Dingledine dd8c157810 remember we want to backport r11499, r11500, r11501 (once tested)
svn:r11502
2007-09-19 00:42:10 +00:00
Nick Mathewson b228d62898 r14427@Kushana: nickm | 2007-09-13 13:28:22 -0400
Backport: Do not load state when options->command is not RUN_TOR. (Resolves bug 499)


svn:r11438
2007-09-13 17:40:11 +00:00
Nick Mathewson ff7e0e8971 r14875@catbus: nickm | 2007-08-31 10:18:11 -0400
Backport: Check correct circuit type when calling functions from rend_process_relay_cell.


svn:r11335
2007-08-31 14:20:41 +00:00
Nick Mathewson ddd44cb602 r14874@catbus: nickm | 2007-08-31 10:16:15 -0400
Note backportability of r11166


svn:r11334
2007-08-31 14:20:38 +00:00
Nick Mathewson 5c2cea6563 r14873@catbus: nickm | 2007-08-31 10:15:47 -0400
Bump 0.1.2.x branch to 0.1.2.17-dev.


svn:r11333
2007-08-31 14:20:37 +00:00
Peter Palfrader 571fc28fc3 New upstream version
svn:r11325
2007-08-31 01:17:31 +00:00
Roger Dingledine b597d0ee10 bump to 0.1.2.17
svn:r11321
2007-08-30 21:01:26 +00:00
Roger Dingledine e852f30350 clean up the 0.1.2.17 changelog and schedule its release for tomorrow
svn:r11296
2007-08-29 08:31:42 +00:00
Nick Mathewson 2308e8b924 r14229@Kushana: nickm | 2007-08-27 11:38:01 -0400
Note backportability, and cleanup.


svn:r11288
2007-08-27 15:38:17 +00:00
Roger Dingledine 7d9051940a backport the load balancing stuff. man, i hope i got all
of this right. other people should check too.


svn:r11274
2007-08-25 21:42:31 +00:00
Roger Dingledine 26bdb03d28 backport r11251.
(gosh, it looks like we didn't backport any control-spec sections?)


svn:r11252
2007-08-22 07:59:57 +00:00
Roger Dingledine ee9cc158ba backport r11249
svn:r11250
2007-08-22 03:22:51 +00:00
Roger Dingledine a5b347e9f4 backport r11247
svn:r11248
2007-08-22 03:04:09 +00:00
Roger Dingledine 2fb3f9beba remember that some part of r11229 might want to be backported,
depending on what it breaks.


svn:r11230
2007-08-20 20:07:04 +00:00
Roger Dingledine 0153b6b20e backport r11186
svn:r11188
2007-08-19 07:23:54 +00:00
Andrew Lewman 07d9dc945b Update to openssl 0.9.8e and libevent 1.3b
svn:r11176
2007-08-19 03:00:03 +00:00
Roger Dingledine c054f75dfa backport r11171
svn:r11173
2007-08-19 02:55:36 +00:00
Roger Dingledine c0ea203c0c clean up 0.1.2.17 changelog
svn:r11172
2007-08-19 02:53:49 +00:00
Nick Mathewson 19015885a0 r14655@catbus: nickm | 2007-08-18 11:41:49 -0400
Backport r11138: Implement PROTOCOLINFO/proposal 119.


svn:r11164
2007-08-18 15:42:56 +00:00
Roger Dingledine 87f4dc04b8 let's leave the cookieauthfile stuff out of 0.1.2 if we can help it.
unix users can handle "switch to the dev version if you want to try
that feature".


svn:r11156
2007-08-17 20:52:34 +00:00
Roger Dingledine 521b065368 bump stable to 0.1.2.16-dev since it needs some testing now
svn:r11144
2007-08-16 18:54:35 +00:00
Nick Mathewson 278b75619a r14610@catbus: nickm | 2007-08-16 14:31:44 -0400
Terminate multi-line controller events correctly with a single "650 OK".  Backport of 10964.


svn:r11143
2007-08-16 18:32:45 +00:00
Nick Mathewson 00581b58e9 r14608@catbus: nickm | 2007-08-16 13:45:31 -0400
Mark 11141 for backport.


svn:r11142
2007-08-16 17:46:30 +00:00
Nick Mathewson 6c4c4ea0e1 r14603@catbus: nickm | 2007-08-16 13:33:49 -0400
mark r11138 for backport


svn:r11140
2007-08-16 17:34:58 +00:00
Nick Mathewson ebb8a62ad4 r14602@catbus: nickm | 2007-08-16 13:33:27 -0400
Make 0.1.2 give a warning on v0 control commands and close the connnection, rather than simply failing apart and yelling.


svn:r11139
2007-08-16 17:34:55 +00:00
Roger Dingledine d0ecd468eb backport r11119 too
svn:r11136
2007-08-16 16:53:15 +00:00
Nick Mathewson 5da1f97670 r14591@catbus: nickm | 2007-08-16 12:40:30 -0400
Remove support for v0 control protocol in 0.1.2 branch: it has been deprecated for a very long time, and keeping it safe and securable has gotten too darned hard.


svn:r11135
2007-08-16 16:41:48 +00:00
Nick Mathewson 0690f1fd7e r14590@catbus: nickm | 2007-08-16 12:19:12 -0400
Backport r11117: exit when we fail to write an auth cookie, and do not attempt to rewrite the auth cookie every time we restart.


svn:r11134
2007-08-16 16:41:41 +00:00
Nick Mathewson 2268d29e94 r14589@catbus: nickm | 2007-08-16 12:16:06 -0400
Backport r10939 and r10956: correct handling for weighted exit selection.  I'm not backporting the bitfield code, so this is marginally slower than the version in trunk.


svn:r11133
2007-08-16 16:41:38 +00:00
Nick Mathewson 2b00470094 r14588@catbus: nickm | 2007-08-16 12:04:44 -0400
Backport r10994: stop using SENTINELS checking, in order to use less  RAM in buffer allocation.


svn:r11132
2007-08-16 16:41:36 +00:00
Roger Dingledine bc0692a5d9 remember two things we want to backport
svn:r11118
2007-08-15 15:28:58 +00:00
Peter Palfrader c79aed0ec5 Save on most routerlist_assert_ok() calls in routerlist.c, thus greatly
speeding up loading cached-routers from disk on startup (backport from trunk).


svn:r11096
2007-08-13 22:57:03 +00:00
Peter Palfrader aacc56bdf2 New upstream version
svn:r11029
2007-08-02 06:50:02 +00:00
Roger Dingledine 474894b85d bump stable to 0.1.2.16
svn:r11020
2007-08-02 04:38:45 +00:00
Roger Dingledine 0247ed481b backport r11018
svn:r11019
2007-08-02 04:30:32 +00:00
Nick Mathewson b80048a65e r13894@Kushana: nickm | 2007-08-01 18:29:39 -0700
Close immediately after anything but a successful authentication attempt on the control port.  [Backport.]  Isn't Defcon _fun_, kids?


svn:r11017
2007-08-02 01:29:53 +00:00
Peter Palfrader 0305f49258 Change build-depends from tetex to texlive suite.
New upstream version.

svn:r11006
2007-07-31 09:36:08 +00:00
Nick Mathewson 5d91b10da9 r14020@catbus: nickm | 2007-07-30 13:51:36 -0400
Note backportability of r10994.


svn:r10995
2007-07-30 17:51:51 +00:00
Nick Mathewson 669101378b r13975@catbus: nickm | 2007-07-29 00:05:58 -0400
Note a couple more backport opportunities.


svn:r10965
2007-07-29 04:06:11 +00:00
Roger Dingledine 45819cac72 start planning for a 0.1.2.16
svn:r10958
2007-07-29 00:05:47 +00:00
Roger Dingledine 56b099015e bump to 0.1.2.15; futz with changelog one last time.
svn:r10857
2007-07-17 20:46:46 +00:00
Nick Mathewson e5641fa52b r13798@catbus: nickm | 2007-07-17 11:26:08 -0400
Apparently r10346 is already backported


svn:r10855
2007-07-17 15:26:12 +00:00
Roger Dingledine 2648a6266c on further looking, r10835 doesn't need a backport. i think.
svn:r10850
2007-07-17 07:24:37 +00:00
Nick Mathewson eb576f0a18 r13786@catbus: nickm | 2007-07-16 13:46:28 -0400
Backport a minimal fix for bug 455: strndup a NUL-terminated copy of each router descriptor before trying to parse it.  If this slows us down a lot, we will need to reconsider, but it seems far safer than the more sophisticated stuff we are trying to do to fix 455 on trunk.


svn:r10846
2007-07-16 17:46:31 +00:00
Nick Mathewson 1953de9dd1 r13767@catbus: nickm | 2007-07-16 10:52:47 -0400
Backport 10830: fix a small memory leak when rebuilding the router store.


svn:r10841
2007-07-16 14:52:54 +00:00
Roger Dingledine 800a0924da remember to backport r10835
svn:r10836
2007-07-16 03:40:25 +00:00
Roger Dingledine 0e34c68fd4 backport r10832
svn:r10833
2007-07-16 00:14:38 +00:00
Roger Dingledine 17759c320e remember that we'll want to be backporting r10830
svn:r10831
2007-07-15 08:35:28 +00:00
Roger Dingledine e459ba56aa clean up changelog; add two more backports we should do but not yet
svn:r10824
2007-07-13 13:04:01 +00:00
Roger Dingledine d39b7fdbe2 bump stable to 0.1.2.14-dev in preparation for release
svn:r10822
2007-07-12 23:52:25 +00:00
Roger Dingledine c222971b5a backport r10818: prevent streamid collisions on relay cells
svn:r10819
2007-07-12 17:16:18 +00:00
Nick Mathewson d9cee67479 r13738@catbus: nickm | 2007-07-12 13:00:35 -0400
Backport r10730: Do not choose guard nodes that appear after any never-before-connected-to guard.


svn:r10817
2007-07-12 17:00:44 +00:00
Nick Mathewson cce7548d0c r13737@catbus: nickm | 2007-07-12 12:57:30 -0400
Backport r10521: Fix a memory leak


svn:r10816
2007-07-12 17:00:42 +00:00
Nick Mathewson afd0f2d13b r13736@catbus: nickm | 2007-07-12 12:54:33 -0400
Backport r10493: weight guard selection by bandwidth


svn:r10815
2007-07-12 17:00:40 +00:00
Nick Mathewson d52051da48 r13734@catbus: nickm | 2007-07-12 12:50:39 -0400
Backport r10790: omit reasons from destroy cells from the circuit origin.


svn:r10814
2007-07-12 16:50:41 +00:00
Nick Mathewson c09f015b55 r13732@catbus: nickm | 2007-07-12 12:35:06 -0400
Backport 10812: avoid roundoff-error-induced crash bugs when picking routers by bandwith.


svn:r10813
2007-07-12 16:35:10 +00:00
Nick Mathewson 588a007b8a r13718@catbus: nickm | 2007-07-12 12:16:49 -0400
Backport r10760: fix possible buffer overrun in natd code used by old BSDs.


svn:r10811
2007-07-12 16:17:31 +00:00
Nick Mathewson d6f01a37c6 r13717@catbus: nickm | 2007-07-12 12:14:20 -0400
Backport r10524: make it clear that LICENSE and AUTHORS are the license and authors for Tor only.


svn:r10810
2007-07-12 16:17:30 +00:00
Nick Mathewson f59e1694d3 r13716@catbus: nickm | 2007-07-12 12:12:45 -0400
Backport r10478: stop tearing down entire circuits just because the user asked for a nonexistent hidden service port.


svn:r10809
2007-07-12 16:17:27 +00:00
Nick Mathewson fef206a7d1 r13715@catbus: nickm | 2007-07-12 12:11:09 -0400
Partial backport of r10376, just in case it was important.


svn:r10808
2007-07-12 16:17:25 +00:00
Nick Mathewson 25e312e1a3 r13714@catbus: nickm | 2007-07-12 12:08:35 -0400
Backport r10148: open cached-routers with FILE_SHARE_READ on win32.


svn:r10807
2007-07-12 16:17:23 +00:00
Nick Mathewson cd61565ad3 r13713@catbus: nickm | 2007-07-12 12:06:24 -0400
Sort entries in 0.1.2.15 changelog.


svn:r10806
2007-07-12 16:17:20 +00:00
Nick Mathewson 984342dfb5 r13712@catbus: nickm | 2007-07-12 12:03:30 -0400
Add a list of backportable patches for 0.1.2.x


svn:r10805
2007-07-12 16:17:18 +00:00
Nick Mathewson 657bae5f53 r13705@catbus: nickm | 2007-07-12 11:54:41 -0400
Backport r10643: fix solaris eventdns.c behavior: we must redefine _FILE_OFFSET_BITS *before* including sys/types.


svn:r10804
2007-07-12 16:17:15 +00:00
Nick Mathewson 5de93f2670 r13704@catbus: nickm | 2007-07-12 11:43:18 -0400
Backport r10566: build correctly when size_t is bigger than unsigned long


svn:r10803
2007-07-12 16:17:12 +00:00
Nick Mathewson 12a873acce r13703@catbus: nickm | 2007-07-12 11:41:38 -0400
Partial backport of r10563: desc_digest_map holds signed_descriptor_t, not routerinfo_t.


svn:r10802
2007-07-12 16:17:09 +00:00
Nick Mathewson b1ab445c60 r13702@catbus: nickm | 2007-07-12 11:35:51 -0400
Backport r10495: change an assert into a tor_assert().


svn:r10801
2007-07-12 16:17:05 +00:00
Peter Palfrader f64a5b71e0 Backport r10799
svn:r10800
2007-07-12 15:58:03 +00:00
Peter Palfrader 0bea370d3c Backport r1075[2-4]: Fix a crash bug in directory authorities when we re-number the routerlist while inserting a new router.
svn:r10755
2007-07-07 00:20:52 +00:00
Nick Mathewson f647ff501f r13323@catbus: nickm | 2007-06-08 14:45:28 -0400
Backport r10537: bugfix: we were undercounting the number of authorities that recommended any given version by 1.


svn:r10538
2007-06-08 18:46:18 +00:00
Nick Mathewson 39d52ec93a r13088@catbus: nickm | 2007-05-30 01:11:38 -0400
Verbose output for hunting bug 404.


svn:r10408
2007-05-30 05:11:40 +00:00
Nick Mathewson 49b1ea5e5b r13086@catbus: nickm | 2007-05-30 01:08:30 -0400
Backport some debugging code; may slow stuff down; should get taken out by 0.1.2.15 if it shows up on profiles.


svn:r10407
2007-05-30 05:09:17 +00:00
Nick Mathewson 7bd9c2de24 r13082@catbus: nickm | 2007-05-30 00:53:20 -0400
Just in case we have one of the bugs that turned up in the alpha series, backport the patch to tolerate a null reason_phrase in our status line.


svn:r10406
2007-05-30 04:53:27 +00:00
Nick Mathewson 2bb833b43d r13081@catbus: nickm | 2007-05-30 00:45:34 -0400
Backport r10305; probably harmless; Set signed_descriptor_digest field in own descriptor correctly.


svn:r10405
2007-05-30 04:53:24 +00:00
Roger Dingledine cd6d3e5f86 by "that's not ok", we actually meant "that's ok"
svn:r10360
2007-05-27 04:56:14 +00:00
Nick Mathewson 3419e7446e r12986@catbus: nickm | 2007-05-25 20:07:08 -0400
Try even harder not to dereference the first character after an mmap(). [Bug reported by lodger]


svn:r10346
2007-05-26 00:07:48 +00:00
Nick Mathewson 20773596d3 r12981@catbus: nickm | 2007-05-25 19:23:12 -0400
Always default to "No threads" on net/openbsd in 0.1.2, even with eventdns, since apparently they have had no real testing up to this point, and 0.1.2.x is supposed to be stable.


svn:r10344
2007-05-25 23:23:18 +00:00
Roger Dingledine 9204034cf0 and start a changelog based on r10340
svn:r10343
2007-05-25 22:00:17 +00:00
Peter Palfrader 8e1f802584 New upstream version
svn:r10341
2007-05-25 21:58:30 +00:00
Roger Dingledine a895df1e62 and backport r10339
darn it


svn:r10340
2007-05-25 21:57:15 +00:00
Roger Dingledine de4263b450 last tweak to 0.1.2.14
svn:r10321
2007-05-25 04:18:44 +00:00
Roger Dingledine f93226e3dc don't segfault when we're trying to build a testing circ to ourselves
svn:r10318
2007-05-24 23:38:14 +00:00
Roger Dingledine 6243cb2b71 bump to 0.1.2.14 since we're getting close
svn:r10311
2007-05-24 17:36:44 +00:00
Roger Dingledine 6ae73ad808 backport r10240 and r10242
svn:r10310
2007-05-24 17:31:59 +00:00
Nick Mathewson a6d2f877f5 r12928@catbus: nickm | 2007-05-24 13:23:07 -0400
Backport 10307: Warn when using a version of libevent before 1.3b to run a server on osx or bsd: these versions of libevent interact badly with userspace threads.


svn:r10309
2007-05-24 17:23:10 +00:00
Roger Dingledine 5dcac14bab minimal backport of r10238
svn:r10302
2007-05-24 17:11:12 +00:00
Nick Mathewson fa64904306 r12912@catbus: nickm | 2007-05-24 11:48:49 -0400
Backport minimal parts of r10192 (fix bugs found by Benedikt) and r10248 (handle lack of nul at end of mmap).


svn:r10301
2007-05-24 15:48:53 +00:00
Roger Dingledine 5616baa52a actually commit the file i changed:
new IP/port for moria1/moria2


svn:r10299
2007-05-23 04:02:52 +00:00
Roger Dingledine 35e14d1426 prepare for the 0.1.2.14 release
svn:r10298
2007-05-23 03:44:59 +00:00
Nick Mathewson 8cf3fd98ec r12847@catbus: nickm | 2007-05-21 21:55:47 -0400
Backport r12842: Make stores get rebuild at the proper time, and note dropped bytes better.


svn:r10246
2007-05-22 01:55:48 +00:00
Nick Mathewson 1837b5670f r12840@catbus: nickm | 2007-05-21 21:39:23 -0400
Backport 10237: use the same logic as in read_all when reading resolv.conf.  Maybe this fixes bug 433.


svn:r10243
2007-05-22 01:39:31 +00:00
Roger Dingledine 993c497325 backport FastFirstHopPK typo fix
svn:r10235
2007-05-21 13:46:06 +00:00
Roger Dingledine 0868a4004b backport r10187
svn:r10234
2007-05-21 12:35:33 +00:00
Nick Mathewson 9091d0c49a r12816@catbus: nickm | 2007-05-19 18:21:44 -0400
Backport the gist of r10210.


svn:r10225
2007-05-19 22:21:46 +00:00
Roger Dingledine dc76c31c79 backport r10157
svn:r10178
2007-05-13 00:53:13 +00:00
Roger Dingledine f597b73dc0 backport r10153 and r10156
svn:r10177
2007-05-13 00:46:50 +00:00
Roger Dingledine 2ded13ecdc backport r10175
svn:r10176
2007-05-13 00:14:48 +00:00
Roger Dingledine 3597eaab79 changelog tweaks
svn:r10163
2007-05-10 19:46:10 +00:00
Nick Mathewson 4fce4886bc r12720@catbus: nickm | 2007-05-10 15:29:24 -0400
Backport r10087: Include micro-versions in network-status documents.


svn:r10161
2007-05-10 19:29:46 +00:00
Nick Mathewson 1d5beb0df9 r12719@catbus: nickm | 2007-05-10 15:26:54 -0400
Backport r10071: correctly set the purpose of routers that are inserted by the controller with purpose=controller.


svn:r10160
2007-05-10 19:29:39 +00:00
Nick Mathewson 49b8638801 r12718@catbus: nickm | 2007-05-10 15:24:05 -0400
Backport 10052+10053: avoid rare memory corruption on dirserver.


svn:r10159
2007-05-10 19:29:32 +00:00
Roger Dingledine f294708f7f backport r10154
svn:r10155
2007-05-10 08:57:57 +00:00
Peter Palfrader f8cccdbe50 Always give a shell (/bin/sh) when we use su(1) in our init script (closes: #421465)
svn:r10124
2007-05-06 12:46:08 +00:00
Peter Palfrader 225ea3dba3 Minor wording change
svn:r10037
2007-04-27 13:24:11 +00:00
Peter Palfrader 47675391d9 In options_init_from_torrc()'s error path only config_free() options if they
already have been initialized (closes: #421235).


svn:r10036
2007-04-27 11:07:22 +00:00
Peter Palfrader c553066d9e New upstream version
svn:r10019
2007-04-24 21:32:33 +00:00
Roger Dingledine 6f44c3250e correct the release notes a bit. this won't be in the
tarball, but so be it.


svn:r10017
2007-04-24 18:26:34 +00:00
Roger Dingledine e35659f66b bump to 0.1.2.13
we're getting close!


svn:r10015
2007-04-24 05:06:48 +00:00
Roger Dingledine 1fa6c65abe backport r9918:
- Fix a memory leak when we ask for "all" networkstatuses and we
  get one we don't recognize.


svn:r10014
2007-04-24 05:04:21 +00:00
Andrew Lewman 4007d93d94 Fix paths to documents for osx package building.
svn:r10012
2007-04-24 01:24:38 +00:00
Peter Palfrader 9289e35d81 Back out backport of r9799 from the 0.1.2.x branch.
svn:r10008
2007-04-23 19:48:13 +00:00
Peter Palfrader dec649d564 Backport r9799 and r10003 (two patches that add more asserts to hunt down #417) to the 0.1.2.x branch.
svn:r10007
2007-04-23 17:06:54 +00:00
Andrew Lewman fb60822f5c Disable kqueue on ppc only OSX versions (panther, jaguar, puma,
cheetah).  Confirmed in bug #371.


svn:r10002
2007-04-23 00:14:27 +00:00
Roger Dingledine 2290eb92b6 first cut at 0.1.2.13 release notes
svn:r9962
2007-04-15 23:49:37 +00:00
Andrew Lewman 11fa67a5b8 Update paths to spec files. Thanks to Matt for noticing.
svn:r9950
2007-04-14 01:12:17 +00:00
Roger Dingledine 30cb4ecbac a bit of revisionist history is good for the soul
(remove a mistaken changelog entry)


svn:r9916
2007-03-29 02:53:16 +00:00
Andrew Lewman 89f8089482 Updated to include NSIS installer instructions.
svn:r9869
2007-03-18 13:48:49 +00:00
Peter Palfrader ec479e9db1 New upstream version
svn:r9859
2007-03-17 12:37:44 +00:00
Roger Dingledine 378e33a8da bump to 0.1.2.12-rc
this time for sure!
no really!


svn:r9851
2007-03-17 03:30:00 +00:00
Roger Dingledine f47cf63f8a When creating a circuit via the controller, send a 'launched'
event when we're done, so we follow the spec better.


svn:r9850
2007-03-17 03:24:22 +00:00
Roger Dingledine b55c768d84 bump to 0.1.2.11-rc-dev so we can distinguish versions
with the infinite loop bug from those without


svn:r9843
2007-03-16 07:11:35 +00:00
Roger Dingledine 4104f0a014 backport r9841.
phooey, there'll be another rc.


svn:r9842
2007-03-16 06:58:19 +00:00
Roger Dingledine 55aa184ac5 tweak the changelog
svn:r9837
2007-03-16 03:12:28 +00:00
Roger Dingledine 574f234dc7 backport r9817 and r9823, and bump to 0.1.2.11-rc.
svn:r9836
2007-03-16 03:00:57 +00:00
Roger Dingledine 9027b7acf9 minimal backport to fix bug from r9690
svn:r9809
2007-03-13 02:01:17 +00:00
Peter Palfrader 09fcc77606 New upstream version
svn:r9777
2007-03-09 10:13:05 +00:00
Andrew Lewman e52790aa8f Update libevent version to 1.3b.
svn:r9769
2007-03-09 00:16:35 +00:00
Roger Dingledine 0066174afa bump to 0.1.2.10-rc
svn:r9757
2007-03-07 09:44:10 +00:00
Roger Dingledine 350bfb641d fix a socks5 error number as pointed out by juliusz
and prepare the changelog


svn:r9756
2007-03-07 09:41:23 +00:00
Peter Palfrader fbf610e679 It only is a single |, not two
svn:r9754
2007-03-07 09:20:10 +00:00
Peter Palfrader c05abaee94 Merge 9746 into 0.1.2.x branch
svn:r9751
2007-03-06 20:55:10 +00:00
Roger Dingledine 197e4f8e5a backport those three log messages
svn:r9744
2007-03-06 19:41:12 +00:00
Nick Mathewson 1a4d934054 Create a new branch for Tor 0.1.2.x work.
svn:r9725
2007-03-04 19:22:04 +00:00
1028 changed files with 76602 additions and 619807 deletions

View File

@ -1,62 +0,0 @@
version: 1.0.{build}
clone_depth: 50
environment:
compiler: mingw
matrix:
- target: i686-w64-mingw32
compiler_path: mingw32
openssl_path: /c/OpenSSL-Win32
- target: x86_64-w64-mingw32
compiler_path: mingw64
openssl_path: /c/OpenSSL-Win64
install:
- ps: >-
Function Execute-Command ($commandPath)
{
& $commandPath $args 2>&1
if ( $LastExitCode -ne 0 ) {
$host.SetShouldExit( $LastExitCode )
}
}
Function Execute-Bash ()
{
Execute-Command 'c:\msys64\usr\bin\bash' '-e' '-c' $args
}
Execute-Command "C:\msys64\usr\bin\pacman" -Sy --noconfirm openssl-devel openssl libevent-devel libevent mingw-w64-i686-libevent mingw-w64-x86_64-libevent mingw-w64-i686-openssl mingw-w64-x86_64-openssl mingw-w64-i686-zstd mingw-w64-x86_64-zstd
build_script:
- ps: >-
if ($env:compiler -eq "mingw") {
$oldpath = ${env:Path} -split ';'
$buildpath = @("C:\msys64\${env:compiler_path}\bin", "C:\msys64\usr\bin") + $oldpath
$env:Path = @($buildpath) -join ';'
$env:build = @("${env:APPVEYOR_BUILD_FOLDER}", $env:target) -join '\'
Set-Location "${env:APPVEYOR_BUILD_FOLDER}"
Execute-Bash 'autoreconf -i'
mkdir "${env:build}"
Set-Location "${env:build}"
Execute-Bash "../configure --prefix=/${env:compiler_path} --build=${env:target} --host=${env:target} --disable-asciidoc --enable-fatal-warnings --with-openssl-dir=${env:openssl_path}"
Execute-Bash "V=1 make -j2"
Execute-Bash "V=1 make -j2 install"
}
test_script:
- ps: >-
if ($env:compiler -eq "mingw") {
$oldpath = ${env:Path} -split ';'
$buildpath = @("C:\msys64\${env:compiler_path}\bin") + $oldpath
$env:Path = $buildpath -join ';'
Set-Location "${env:build}"
Execute-Bash "VERBOSE=1 make -j2 check"
}
on_success:
- cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci success
on_failure:
- cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci failure

179
.gitignore vendored
View File

@ -1,50 +1,29 @@
# Editor droppings
# Global ignores
\#*\#
.#*
*~
*.swp
*.swo
# C stuff
*.o
*.obj
# Diff droppings
*.orig
*.rej
# gcov stuff
*.gcno
*.gcov
*.gcda
# latex stuff
*.aux
*.dvi
*.blg
*.bbl
*.log
# Autotools stuff
.deps
.dirstamp
*.trs
*.log
# Calltool stuff
.*.graph
# Stuff made by our makefiles
*.bak
# Python droppings
*.pyc
*.pyo
# Cscope
cscope.*
# OSX junk
*.dSYM
.DS_Store
# updateFallbackDirs.py temp files
details-*.json
uptime-*.json
*.full_url
*.last_modified
# /
/Makefile
/Makefile.in
/aclocal.m4
/ar-lib
/autom4te.cache
/build-stamp
/compile
/configure
/Doxyfile
/orconfig.h
@ -55,13 +34,10 @@ uptime-*.json
/config.guess
/config.sub
/conftest*
/micro-revision.*
/patch-stamp
/stamp-h
/stamp-h.in
/stamp-h1
/TAGS
/test-driver
/tor.sh
/tor.spec
/depcomp
@ -70,19 +46,35 @@ uptime-*.json
/mkinstalldirs
/Tor*Bundle.dmg
/tor-*-win32.exe
/coverage_html/
/callgraph/
# /contrib/
/contrib/dist/tor.sh
/contrib/dist/torctl
/contrib/dist/tor.service
/contrib/operator-tools/tor.logrotate
/contrib/dist/suse/tor.sh
/contrib/Makefile
/contrib/Makefile.in
/contrib/tor.sh
/contrib/torctl
/contrib/torify
/contrib/*.pyc
/contrib/*.pyo
/contrib/tor.logrotate
/contrib/tor.wxs
# /contrib/osx/
/contrib/osx/Makefile
/contrib/osx/Makefile.in
/contrib/osx/TorBundleDesc.plist
/contrib/osx/TorBundleInfo.plist
/contrib/osx/TorDesc.plist
/contrib/osx/TorInfo.plist
/contrib/osx/TorStartupDesc.plist
/contrib/osx/net.freehaven.tor.plist
# /contrib/suse/
/contrib/suse/tor.sh
/contrib/suse/Makefile.in
/contrib/suse/Makefile
# /debian/
/debian/files
/debian/micro-revision.i
/debian/patched
/debian/tor
/debian/tor.postinst.debhelper
@ -93,60 +85,26 @@ uptime-*.json
# /doc/
/doc/Makefile
/doc/Makefile.in
/doc/doxygen
/doc/tor.1
/doc/tor.1.in
/doc/tor.html
/doc/tor.html.in
/doc/tor.1.xml
/doc/tor-gencert.1
/doc/tor-gencert.1.in
/doc/tor-gencert.html
/doc/tor-gencert.html.in
/doc/tor-gencert.1.xml
/doc/tor-resolve.1
/doc/tor-resolve.1.in
/doc/tor-resolve.html
/doc/tor-resolve.html.in
/doc/tor-resolve.1.xml
/doc/torify.1
/doc/torify.1.in
/doc/torify.html
/doc/torify.html.in
/doc/torify.1.xml
/doc/doxygen
# /doc/design-paper/
/doc/design-paper/Makefile
/doc/design-paper/Makefile.in
# /doc/spec/
/doc/spec/Makefile
/doc/spec/Makefile.in
# /scripts
/scripts/maint/checkOptionDocs.pl
/scripts/maint/updateVersions.pl
# /src/
/src/Makefile
/src/Makefile.in
# /src/trace
/src/trace/libor-trace.a
# /src/common/
/src/common/Makefile
/src/common/Makefile.in
/src/common/libor.a
/src/common/libor-testing.a
/src/common/libor.lib
/src/common/libor-ctime.a
/src/common/libor-ctime-testing.a
/src/common/libor-ctime.lib
/src/common/libor-crypto.a
/src/common/libor-crypto-testing.a
/src/common/libor-crypto.lib
/src/common/libor-event.a
/src/common/libor-event-testing.a
/src/common/libor-event.lib
/src/common/libcurve25519_donna.a
/src/common/libcurve25519_donna.lib
# /src/config/
/src/config/Makefile
@ -154,82 +112,21 @@ uptime-*.json
/src/config/sample-server-torrc
/src/config/torrc
/src/config/torrc.sample
/src/config/torrc.minimal
# /src/ext/
/src/ext/ed25519/ref10/libed25519_ref10.a
/src/ext/ed25519/ref10/libed25519_ref10.lib
/src/ext/ed25519/donna/libed25519_donna.a
/src/ext/ed25519/donna/libed25519_donna.lib
/src/ext/keccak-tiny/libkeccak-tiny.a
/src/ext/keccak-tiny/libkeccak-tiny.lib
# /src/or/
/src/or/Makefile
/src/or/Makefile.in
/src/or/micro-revision.*
/src/or/tor
/src/or/tor.exe
/src/or/tor-cov
/src/or/tor-cov.exe
/src/or/libtor.a
/src/or/libtor-testing.a
/src/or/libtor.lib
# /src/rust
/src/rust/.cargo/config
/src/rust/.cargo/registry
/src/rust/target
/src/rust/registry
# /src/test
/src/test/Makefile
/src/test/Makefile.in
/src/test/bench
/src/test/bench.exe
/src/test/test
/src/test/test-slow
/src/test/test-bt-cl
/src/test/test-child
/src/test/test-memwipe
/src/test/test-ntor-cl
/src/test/test-hs-ntor-cl
/src/test/test-switch-id
/src/test/test-timers
/src/test/test_workqueue
/src/test/test.exe
/src/test/test-slow.exe
/src/test/test-bt-cl.exe
/src/test/test-child.exe
/src/test/test-ntor-cl.exe
/src/test/test-hs-ntor-cl.exe
/src/test/test-memwipe.exe
/src/test/test-switch-id.exe
/src/test/test-timers.exe
/src/test/test_workqueue.exe
# /src/test/fuzz
/src/test/fuzz/fuzz-*
/src/test/fuzz/lf-fuzz-*
/src/or/test
# /src/tools/
/src/tools/libtorrunner.a
/src/tools/tor-checkkey
/src/tools/tor-resolve
/src/tools/tor-cov-resolve
/src/tools/tor-gencert
/src/tools/tor-cov-gencert
/src/tools/tor-checkkey.exe
/src/tools/tor-resolve.exe
/src/tools/tor-cov-resolve.exe
/src/tools/tor-gencert.exe
/src/tools/tor-cov-gencert.exe
/src/tools/Makefile
/src/tools/Makefile.in
# /src/trunnel/
/src/trunnel/libor-trunnel-testing.a
/src/trunnel/libor-trunnel.a
# /src/win32/
/src/win32/Makefile
/src/win32/Makefile.in

View File

@ -1,45 +0,0 @@
before_script:
- apt-get update -qq
- apt-get upgrade -qy
build:
script:
- apt-get install -qy --fix-missing automake build-essential
libevent-dev libssl-dev zlib1g-dev
libseccomp-dev liblzma-dev libscrypt-dev
- ./autogen.sh
- ./configure --disable-asciidoc --enable-fatal-warnings
--disable-silent-rules
- make check || (e=$?; cat test-suite.log; exit $e)
- make install
update:
only:
- schedules
script:
- "apt-get install -y --fix-missing git openssh-client"
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- ssh-add <(echo "$DEPLOY_KEY")
# For Docker builds disable host key checking. Be aware that by adding that
# you are susceptible to man-in-the-middle attacks.
# WARNING: Use this only with the Docker executor, if you use it with shell
# you will overwrite your user's SSH config.
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
# In order to properly check the server's host key, assuming you created the
# SSH_SERVER_HOSTKEYS variable previously, uncomment the following two lines
# instead.
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts'
- echo "merging from torgit"
- git config --global user.email "labadmin@oniongit.eu"
- git config --global user.name "gitadmin"
- "mkdir tor"
- "cd tor"
- git clone --bare https://git.torproject.org/tor.git
- git push --mirror git@oniongit.eu:network/tor.git

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "src/ext/rust"]
path = src/ext/rust
url = https://git.torproject.org/tor-rust-dependencies

View File

@ -1,169 +0,0 @@
language: c
## Comment out the compiler list for now to allow an explicit build
## matrix.
# compiler:
# - gcc
# - clang
notifications:
irc:
channels:
- "irc.oftc.net#tor-ci"
template:
- "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
- "Build #%{build_number} %{result}. Details: %{build_url}"
on_success: change
on_failure: change
email:
on_success: never
on_failure: change
os:
- linux
## Uncomment the following line to also run the entire build matrix on OSX.
## This will make your CI builds take roughly ten times longer to finish.
# - osx
## Use the Ubuntu Trusty images.
dist: trusty
## We don't need sudo. (The "apt:" stanza after this allows us to not need sudo;
## otherwise, we would need it for getting dependencies.)
##
## We override this in the explicit build matrix to work around a
## Travis CI environment regression
## https://github.com/travis-ci/travis-ci/issues/9033
sudo: false
## (Linux only) Download our dependencies
addons:
apt:
packages:
## Required dependencies
- libevent-dev
- libseccomp2
- zlib1g-dev
## Optional dependencies
- liblzma-dev
- libscrypt-dev
## zstd doesn't exist in Ubuntu Trusty
#- libzstd
## The build matrix in the following two stanzas expands into four builds (per OS):
##
## * with GCC, with Rust
## * with GCC, without Rust
## * with Clang, with Rust
## * with Clang, without Rust
env:
global:
## The Travis CI environment allows us two cores, so let's use both.
- MAKEFLAGS="-j 2"
matrix:
## Leave at least one entry here or Travis seems to generate a
## matrix entry with empty matrix environment variables. Leaving
## more than one entry causes unwanted matrix entries with
## unspecified compilers.
- RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
# - RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
# - RUST_OPTIONS=""
matrix:
## Uncomment to allow the build to report success (with non-required
## sub-builds continuing to run) if all required sub-builds have
## succeeded. This is somewhat buggy currently: it can cause
## duplicate notifications and prematurely report success if a
## single sub-build has succeeded. See
## https://github.com/travis-ci/travis-ci/issues/1696
# fast_finish: true
## Uncomment the appropriate lines below to allow the build to
## report success even if some less-critical sub-builds fail and it
## seems likely to take a while for someone to fix it. Currently
## Travis CI doesn't distinguish "all builds succeeded" from "some
## non-required sub-builds failed" except on the individual build's
## page, which makes it somewhat annoying to detect from the
## branches and build history pages. See
## https://github.com/travis-ci/travis-ci/issues/8716
allow_failures:
# - env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
# - env: RUST_OPTIONS="--enable-rust --enable-cargo-online-mode
# - compiler: clang
## Create explicit matrix entries to work around a Travis CI
## environment issue. Missing keys inherit from the first list
## entry under that key outside the "include" clause.
include:
- compiler: gcc
- compiler: gcc
env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
- compiler: gcc
env: RUST_OPTIONS=""
- compiler: gcc
env: COVERAGE_OPTIONS="--enable-coverage"
- compiler: gcc
env: DISTCHECK="yes" RUST_OPTIONS=""
- compiler: gcc
env: DISTCHECK="yes" RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
- compiler: gcc
env: MODULES_OPTIONS="--disable-module-dirauth"
## The "sudo: required" forces non-containerized builds, working
## around a Travis CI environment issue: clang LeakAnalyzer fails
## because it requires ptrace and the containerized environment no
## longer allows ptrace.
- compiler: clang
sudo: required
- compiler: clang
sudo: required
env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
- compiler: clang
sudo: required
env: RUST_OPTIONS=""
- compiler: clang
sudo: required
env: MODULES_OPTIONS="--disable-module-dirauth"
before_install:
## If we're on OSX, homebrew usually needs to updated first
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
## Download rustup
- if [[ "$RUST_OPTIONS" != "" ]]; then curl -Ssf -o rustup.sh https://sh.rustup.rs; fi
- if [[ "$COVERAGE_OPTIONS" != "" ]]; then pip install --user cpp-coveralls; fi
install:
## If we're on OSX use brew to install required dependencies (for Linux, see the "apt:" section above)
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated openssl || brew upgrade openssl; }; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libevent || brew upgrade libevent; }; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated pkg-config || brew upgrade pkg-config; }; fi
## If we're on OSX also install the optional dependencies
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated xz || brew upgrade xz; }; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libscrypt || brew upgrade libscrypt; }; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated zstd || brew upgrade zstd; }; fi
## Install the stable channels of rustc and cargo and setup our toolchain environment
- if [[ "$RUST_OPTIONS" != "" ]]; then sh rustup.sh -y --default-toolchain stable; fi
- if [[ "$RUST_OPTIONS" != "" ]]; then source $HOME/.cargo/env; fi
## Get some info about rustc and cargo
- if [[ "$RUST_OPTIONS" != "" ]]; then which rustc; fi
- if [[ "$RUST_OPTIONS" != "" ]]; then which cargo; fi
- if [[ "$RUST_OPTIONS" != "" ]]; then rustc --version; fi
- if [[ "$RUST_OPTIONS" != "" ]]; then cargo --version; fi
## If we're testing rust builds in offline-mode, then set up our vendored dependencies
- if [[ "$TOR_RUST_DEPENDENCIES" == "true" ]]; then export TOR_RUST_DEPENDENCIES=$PWD/src/ext/rust/crates; fi
script:
- ./autogen.sh
- ./configure $RUST_OPTIONS $COVERAGE_OPTIONS $MODULES_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules --enable-fragile-hardening
## We run `make check` because that's what https://jenkins.torproject.org does.
- if [[ "$DISTCHECK" == "" ]]; then make check; fi
- if [[ "$DISTCHECK" != "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$RUST_OPTIONS $COVERAGE_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules --enable-fragile-hardening"; fi
after_failure:
## `make check` will leave a log file with more details of test failures.
- if [[ "$DISTCHECK" == "" ]]; then cat test-suite.log; fi
## `make distcheck` puts it somewhere different.
- if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog; fi
after_success:
## If this build was one that produced coverage, upload it.
- if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p'; fi

42
AUTHORS Normal file
View File

@ -0,0 +1,42 @@
This file lists the authors for Tor,
a free software project to provide anonymity on the Internet.
For more information about Tor, see http://www.torproject.org/.
If you got this file as a part of a larger bundle,
there are probably other authors that you should be aware of.
Main authors:
-------------
Roger Dingledine <arma@freehaven.net> overhauled all of the code, did
a bunch of new design work, etc.
Nick Mathewson <nickm@freehaven.net> wrote lots of stuff too, in
particular the router and descriptor parsing, and the crypto and tls
wrappers.
Matej Pfajfar <badbytes@freehaven.net> wrote the first version of the code
(called OR) in 2001-2002.
Contributors:
-------------
John Bashinski <jbash@velvet.com> contributed the initial rpm spec file.
Christian Grothoff <grothoff@cs.purdue.edu> contributed better daemonizing
behavior.
Steven Hazel <sah@thalassocracy.org> made 'make install' do the right
thing.
Jason Holt <jason@lunkwill.org> contributed patches to the instructions
and the man page.
Peter Palfrader <peter@palfrader.org> maintains everything that's
debian-specific.
Aaron Turner <aturner@netscreen.com> contributed the first version of
the tor.sh initscripts shell script.

View File

@ -1,39 +0,0 @@
Contributing to Tor
-------------------
### Getting started
Welcome!
We have a bunch of documentation about how to develop Tor in the
doc/HACKING/ directory. We recommend that you start with
doc/HACKING/README.1st.md , and then go from there. It will tell
you how to find your way around the source code, how to get
involved with the Tor community, how to write patches, and much
more!
You don't have to be a C developer to help with Tor: have a look
at https://www.torproject.org/getinvolved/volunteer !
The Tor Project is committed to fostering a inclusive community
where people feel safe to engage, share their points of view, and
participate. For the latest version of our Code of Conduct, please
see
https://gitweb.torproject.org/community/policies.git/plain/code_of_conduct.txt
### License issues
Tor is distributed under the license terms in the LICENSE -- in
brief, the "3-clause BSD license". If you send us code to
distribute with Tor, it needs to be code that we can distribute
under those terms. Please don't send us patches unless you agree
to allow this.
Some compatible licenses include:
- 3-clause BSD
- 2-clause BSD
- CC0 Public Domain Dedication

23958
ChangeLog

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

36
INSTALL
View File

@ -1,10 +1,9 @@
Most users who realize that INSTALL files still exist should simply
follow the directions at
Most users should simply follow the directions at
https://www.torproject.org/docs/tor-doc-unix
If you got the source from git, run "./autogen.sh", which will
run the various auto* programs. Then you can run ./configure, and
If you got the source from cvs, run "./autogen.sh", which will run the
various auto* programs and then run ./configure for you. From there,
refer to the above instructions.
If it doesn't build for you:
@ -21,32 +20,5 @@ If it doesn't build for you:
For example, "setenv LD_LIBRARY_PATH /usr/athena/lib".
Lastly, check out
https://www.torproject.org/docs/faq#DoesntWork
How to do static builds of tor:
Tor supports linking each of the libraries it needs statically. Use the
--enable-static-X ./configure option in conjunction with the --with-X-dir
option for libevent, zlib, and openssl. For this to work sanely, libevent
should be built with --disable-shared --enable-static --with-pic, and
OpenSSL should be built with no-shared no-dso.
If you need to build tor so that system libraries are also statically linked,
use the --enable-static-tor ./configure option. This won't work on OS X
unless you build the required crt0.o yourself. It is also incompatible with
the --enable-gcc-hardening option.
An example of how to build a mostly static tor:
./configure --enable-static-libevent \
--enable-static-openssl \
--enable-static-zlib \
--with-libevent-dir=/tmp/static-tor/libevent-1.4.14b-stable \
--with-openssl-dir=/tmp/static-tor/openssl-0.9.8r/ \
--with-zlib-dir=/tmp/static-tor/zlib-1.2.5
An example of how to build an entirely static tor:
./configure --enable-static-tor \
--with-libevent-dir=/tmp/static-tor/libevent-1.4.14b-stable \
--with-openssl-dir=/tmp/static-tor/openssl-0.9.8r/ \
--with-zlib-dir=/tmp/static-tor/zlib-1.2.5
http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#ItDoesntWork

312
LICENSE
View File

@ -3,17 +3,17 @@
It also lists the licenses for other components used by Tor.
For more information about Tor, see https://www.torproject.org/.
For more information about Tor, see http://www.torproject.org/.
If you got this file as a part of a larger bundle,
there may be other license terms that you should be aware of.
===============================================================================
Tor is distributed under this license:
Copyright (c) 2001-2004, Roger Dingledine
Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
Copyright (c) 2007-2017, The Tor Project, Inc.
Copyright (c) 2004-2007, Roger Dingledine, Nick Mathewson
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@ -43,7 +43,7 @@ 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.
===============================================================================
src/ext/strlcat.c and src/ext/strlcpy.c by Todd C. Miller are licensed
src/common/strlcat.c and src/common/strlcpy.c by Todd C. Miller are licensed
under the following license:
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@ -70,312 +70,10 @@ under the following license:
* 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.
===============================================================================
src/ext/tor_queue.h is licensed under the following license:
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
===============================================================================
src/ext/csiphash.c is licensed under the following license:
Copyright (c) 2013 Marek Majkowski <marek@popcount.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
===============================================================================
Trunnel is distributed under this license:
Copyright 2014 The Tor Project, Inc.
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.
===============================================================================
src/config/geoip is licensed under the following license:
OPEN DATA LICENSE (GeoLite Country and GeoLite City databases)
Copyright (c) 2008 MaxMind, Inc. All Rights Reserved.
All advertising materials and documentation mentioning features or use of
this database must display the following acknowledgment:
"This product includes GeoLite data created by MaxMind, available from
http://maxmind.com/"
Redistribution and use with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions must retain the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
2. All advertising materials and documentation mentioning features or use of
this database must display the following acknowledgement:
"This product includes GeoLite data created by MaxMind, available from
http://maxmind.com/"
3. "MaxMind" may not be used to endorse or promote products derived from this
database without specific prior written permission.
THIS DATABASE IS PROVIDED BY MAXMIND, INC ``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 MAXMIND 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
DATABASE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
===============================================================================
m4/pc_from_ucontext.m4 is available under the following license. Note that
it is *not* built into the Tor software.
Copyright (c) 2005, Google Inc.
All rights reserved.
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 name of Google Inc. 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.
===============================================================================
m4/pkg.m4 is available under the following license. Note that
it is *not* built into the Tor software.
pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
serial 1 (pkg-config-0.24)
Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception to the GNU General Public License, if you
distribute this file as part of a program that contains a
configuration script generated by Autoconf, you may include it under
the same distribution terms that you use for the rest of that program.
===============================================================================
src/ext/readpassphrase.[ch] are distributed under this license:
Copyright (c) 2000-2002, 2007 Todd C. Miller <Todd.Miller@courtesan.com>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Sponsored in part by the Defense Advanced Research Projects
Agency (DARPA) and Air Force Research Laboratory, Air Force
Materiel Command, USAF, under agreement number F39502-99-1-0512.
===============================================================================
src/ext/mulodi4.c is distributed under this license:
=========================================================================
compiler_rt License
=========================================================================
The compiler_rt library is dual licensed under both the
University of Illinois "BSD-Like" license and the MIT license.
As a user of this code you may choose to use it under either
license. As a contributor, you agree to allow your code to be
used under both.
Full text of the relevant licenses is included below.
=========================================================================
University of Illinois/NCSA
Open Source License
Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT
All rights reserved.
Developed by:
LLVM Team
University of Illinois at Urbana-Champaign
http://llvm.org
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal with the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimers.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimers in the documentation and/or other materials
provided with the distribution.
* Neither the names of the LLVM Team, University of Illinois
at Urbana-Champaign, nor the names of its contributors may
be used to endorse or promote products derived from this
Software without specific prior written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS WITH THE SOFTWARE.
=========================================================================
Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
=========================================================================
Copyrights and Licenses for Third Party Software Distributed with LLVM:
=========================================================================
The LLVM software contains code written by third parties. Such
software will have its own individual LICENSE.TXT file in the
directory in which it appears. This file will describe the
copyrights, license, and restrictions which apply to that code.
The disclaimer of warranty in the University of Illinois Open
Source License applies to all code in the LLVM Distribution, and
nothing in any of the other licenses gives permission to use the
names of the LLVM Team or the University of Illinois to endorse
or promote products derived from this Software.
===============================================================================
If you got Tor as a static binary with OpenSSL included, then you should know:
"This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/)"
===============================================================================

View File

@ -1,285 +1,76 @@
# $Id$
# Copyright (c) 2001-2004, Roger Dingledine
# Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
# Copyright (c) 2007-2017, The Tor Project, Inc.
# Copyright (c) 2004-2007, Roger Dingledine, Nick Mathewson
# See LICENSE for licensing information
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign
# else it keeps trying to put COPYING back in
noinst_LIBRARIES=
EXTRA_DIST=
noinst_HEADERS=
bin_PROGRAMS=
EXTRA_PROGRAMS=
CLEANFILES=
TESTS=
noinst_PROGRAMS=
DISTCLEANFILES=
bin_SCRIPTS=
AM_CPPFLAGS=
AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@ @TOR_LZMA_CFLAGS@ @TOR_ZSTD_CFLAGS@
SHELL=@SHELL@
SUBDIRS = src doc contrib
if COVERAGE_ENABLED
TESTING_TOR_BINARY=$(top_builddir)/src/or/tor-cov$(EXEEXT)
else
TESTING_TOR_BINARY=$(top_builddir)/src/or/tor$(EXEEXT)
endif
DIST_SUBDIRS = src doc contrib
if USE_RUST
rust_ldadd=$(top_builddir)/src/rust/target/release/@TOR_RUST_STATIC_NAME@ \
@TOR_RUST_EXTRA_LIBS@
else
rust_ldadd=
endif
include src/include.am
include doc/include.am
include contrib/include.am
EXTRA_DIST+= \
ChangeLog \
CONTRIBUTING \
INSTALL \
LICENSE \
Makefile.nmake \
README \
ReleaseNotes \
scripts/maint/checkSpace.pl
## This tells etags how to find mockable function definitions.
AM_ETAGSFLAGS=--regex='{c}/MOCK_IMPL([^,]+,\W*\([a-zA-Z0-9_]+\)\W*,/\1/s'
if COVERAGE_ENABLED
TEST_CFLAGS=-fno-inline -fprofile-arcs -ftest-coverage
if DISABLE_ASSERTS_IN_UNIT_TESTS
TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE -DDISABLE_ASSERTS_IN_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@
else
TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE @TOR_MODULES_ALL_ENABLED@
endif
TEST_NETWORK_FLAGS=--coverage --hs-multi-client 1
else
TEST_CFLAGS=
TEST_CPPFLAGS=-DTOR_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@
TEST_NETWORK_FLAGS=--hs-multi-client 1
endif
TEST_NETWORK_WARNING_FLAGS=--quiet --only-warnings
if LIBFUZZER_ENABLED
TEST_CFLAGS += -fsanitize-coverage=trace-pc-guard,trace-cmp,trace-div
# not "edge"
endif
TEST_NETWORK_ALL_LOG_DIR=$(top_builddir)/test_network_log
TEST_NETWORK_ALL_DRIVER_FLAGS=--color-tests yes
EXTRA_DIST = INSTALL README AUTHORS LICENSE ChangeLog \
ReleaseNotes tor.spec tor.spec.in
#install-data-local:
# $(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
# Allows to override rpmbuild with rpmbuild-md5 from fedora-packager so that
# building for EL5 won't fail on https://bugzilla.redhat.com/show_bug.cgi?id=490613
RPMBUILD ?= rpmbuild
# Assume a tarball is in .. for now.
dist-rpm:
RPM_BUILD_DIR="/tmp/tor-rpm-build-$$$$"; \
rm -rf $$RPM_BUILD_DIR; \
mkdir $$RPM_BUILD_DIR || exit 1; \
for subdir in BUILD RPMS SOURCES SPECS SRPMS; do \
mkdir $$RPM_BUILD_DIR/$$subdir; \
done; \
mkdir $$RPM_BUILD_DIR/SOURCES/tor-$(VERSION); \
cp -R ./ $$RPM_BUILD_DIR/SOURCES/tor-$(VERSION)/; \
pushd $$RPM_BUILD_DIR/SOURCES/; \
tar zcf tor-$(VERSION).tar.gz ./; \
popd; \
rpmbuild -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec; \
mv $$RPM_BUILD_DIR/SRPMS/* .; \
mv $$RPM_BUILD_DIR/RPMS/* .; \
rm -rf $$RPM_BUILD_DIR
# Use automake's dist-gzip target to build the tarball
dist-rpm: dist-gzip
TIMESTAMP=$$(date +"%Y-%m-%d_%H.%M.%S"); \
RPM_BUILD_DIR=$$(mktemp -d "/tmp/tor-rpm-build-$$TIMESTAMP-XXXX"); \
mkdir -p "$$RPM_BUILD_DIR"/{BUILD,RPMS,SOURCES/"tor-$(VERSION)",SPECS,SRPMS}; \
cp -fa "$(distdir).tar.gz" "$$RPM_BUILD_DIR"/SOURCES/; \
LIBS=-lrt $(RPMBUILD) -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec; \
cp -fa "$$RPM_BUILD_DIR"/SRPMS/* .; \
cp -fa "$$RPM_BUILD_DIR"/RPMS/* .; \
rm -rf "$$RPM_BUILD_DIR"; \
echo "RPM build finished"; \
#end of dist-rpm
dist-osx:
@if [ "x$(prefix)" != 'x/Library/Tor' ]; then \
echo "Configure with --prefix=/Library/Tor, please"; \
exit 1; \
fi; \
if [ "x$(bindir)" != 'x/Library/Tor' ]; then \
echo "Configure with --bindir=/Library/Tor, please"; \
exit 1; \
fi; \
if [ "x$(sysconfdir)" != 'x/Library' ]; then \
echo "Configure with --sysconfdir=/Library, please"; \
exit 1; \
fi; \
if [ "x$(CONFDIR)" != 'x/Library/Tor' ]; then \
echo "Configure with CONFDIR=/Library/Tor, please"; \
fi
$(MAKE) all
VERSION=$(VERSION) sh ./contrib/osx/package.sh
doxygen:
doxygen && cd doc/doxygen/latex && make
test: all
$(top_builddir)/src/test/test
test:
./src/or/test
check-local: check-spaces check-changes
need-chutney-path:
@if test ! -d "$$CHUTNEY_PATH"; then \
echo '$$CHUTNEY_PATH was not set.'; \
if test -d $(top_srcdir)/../chutney -a -x $(top_srcdir)/../chutney/chutney; then \
echo "Assuming test-network.sh will find" $(top_srcdir)/../chutney; \
else \
echo; \
echo "To run these tests, git clone https://git.torproject.org/chutney.git ; export CHUTNEY_PATH=\`pwd\`/chutney"; \
exit 1; \
fi \
fi
# Note that test-network requires a copy of Chutney in $CHUTNEY_PATH.
# Chutney can be cloned from https://git.torproject.org/chutney.git .
test-network: need-chutney-path $(TESTING_TOR_BINARY) src/tools/tor-gencert
$(top_srcdir)/src/test/test-network.sh $(TEST_NETWORK_FLAGS)
# Run all available tests using automake's test-driver
# only run IPv6 tests if we can ping6 ::1 (localhost)
# only run IPv6 tests if we can ping ::1 (localhost)
# some IPv6 tests will fail without an IPv6 DNS server (see #16971 and #17011)
# only run mixed tests if we have a tor-stable binary
# Try the syntax for BSD ping6, Linux ping6, and Linux ping -6,
# because they're incompatible
test-network-all: need-chutney-path test-driver $(TESTING_TOR_BINARY) src/tools/tor-gencert
mkdir -p $(TEST_NETWORK_ALL_LOG_DIR)
@flavors="$(TEST_CHUTNEY_FLAVORS)"; \
if ping6 -q -c 1 -o ::1 >/dev/null 2>&1 || ping6 -q -c 1 -W 1 ::1 >/dev/null 2>&1 || ping -6 -c 1 -W 1 ::1 >/dev/null 2>&1; then \
echo "ping6 ::1 or ping ::1 succeeded, running IPv6 flavors: $(TEST_CHUTNEY_FLAVORS_IPV6)."; \
flavors="$$flavors $(TEST_CHUTNEY_FLAVORS_IPV6)"; \
else \
echo "ping6 ::1 and ping ::1 failed, skipping IPv6 flavors: $(TEST_CHUTNEY_FLAVORS_IPV6)."; \
skip_flavors="$$skip_flavors $(TEST_CHUTNEY_FLAVORS_IPV6)"; \
fi; \
if command -v tor-stable >/dev/null 2>&1; then \
echo "tor-stable found, running mixed flavors: $(TEST_CHUTNEY_FLAVORS_MIXED)."; \
flavors="$$flavors $(TEST_CHUTNEY_FLAVORS_MIXED)"; \
else \
echo "tor-stable not found, skipping mixed flavors: $(TEST_CHUTNEY_FLAVORS_MIXED)."; \
skip_flavors="$$skip_flavors $(TEST_CHUTNEY_FLAVORS_MIXED)"; \
fi; \
for f in $$skip_flavors; do \
echo "SKIP: $$f"; \
done; \
for f in $$flavors; do \
$(SHELL) $(top_srcdir)/test-driver --test-name $$f --log-file $(TEST_NETWORK_ALL_LOG_DIR)/$$f.log --trs-file $(TEST_NETWORK_ALL_LOG_DIR)/$$f.trs $(TEST_NETWORK_ALL_DRIVER_FLAGS) $(top_srcdir)/src/test/test-network.sh --flavor $$f $(TEST_NETWORK_FLAGS); \
$(top_srcdir)/src/test/test-network.sh $(TEST_NETWORK_WARNING_FLAGS); \
done; \
echo "Log and result files are available in $(TEST_NETWORK_ALL_LOG_DIR)."; \
! grep -q FAIL test_network_log/*.trs
need-stem-path:
@if test ! -d "$$STEM_SOURCE_DIR"; then \
echo '$$STEM_SOURCE_DIR was not set.'; echo; \
echo "To run these tests, git clone https://git.torproject.org/stem.git/ ; export STEM_SOURCE_DIR=\`pwd\`/stem"; \
exit 1; \
fi
test-stem: need-stem-path $(TESTING_TOR_BINARY)
@$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor "$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL;
test-stem-full: need-stem-path $(TESTING_TOR_BINARY)
@$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor "$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL,ONLINE -v;
test-full: need-stem-path need-chutney-path check test-network test-stem
test-full-online: need-stem-path need-chutney-path check test-network test-stem-full
reset-gcov:
rm -f $(top_builddir)/src/*/*.gcda $(top_builddir)/src/*/*/*.gcda
HTML_COVER_DIR=$(top_builddir)/coverage_html
coverage-html: all
if COVERAGE_ENABLED
test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
test -d "$(HTML_COVER_DIR)" || $(MKDIR_P) "$(HTML_COVER_DIR)"
lcov --rc lcov_branch_coverage=1 --directory $(top_builddir)/src --zerocounters
$(MAKE) reset-gcov
$(MAKE) check
lcov --capture --rc lcov_branch_coverage=1 --no-external --directory $(top_builddir) --base-directory $(top_srcdir) --output-file "$(HTML_COVER_DIR)/lcov.tmp"
lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
else
@printf "Not configured with --enable-coverage, run ./configure --enable-coverage\n"
endif
coverage-html-full: all
test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
test -d "$(HTML_COVER_DIR)" || mkdir -p "$(HTML_COVER_DIR)"
lcov --rc lcov_branch_coverage=1 --directory ./src --zerocounters
$(MAKE) reset-gcov
$(MAKE) check
$(MAKE) test-stem-full
CHUTNEY_TOR=tor-cov CHUTNEY_TOR_GENCERT=tor-cov-gencert $(top_srcdir)/src/test/test-network.sh
CHUTNEY_TOR=tor-cov CHUTNEY_TOR_GENCERT=tor-cov-gencert $(top_srcdir)/src/test/test-network.sh --flavor hs
lcov --capture --rc lcov_branch_coverage=1 --no-external --directory . --output-file "$(HTML_COVER_DIR)/lcov.tmp"
lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
# Avoid strlcpy.c, strlcat.c, aes.c, OpenBSD_malloc_Linux.c, sha256.c,
# tinytest*.[ch]
# Avoid strlcpy.c, strlcat.c, tree.h
check-spaces:
if USE_PERL
$(PERL) $(top_srcdir)/scripts/maint/checkSpace.pl -C \
$(top_srcdir)/src/common/*.[ch] \
$(top_srcdir)/src/or/*.[ch] \
$(top_srcdir)/src/test/*.[ch] \
$(top_srcdir)/src/test/*/*.[ch] \
$(top_srcdir)/src/tools/*.[ch]
endif
./contrib/checkSpace.pl -C \
src/common/*.h \
src/common/[^as]*.c \
src/or/[^et]*.[ch] src/or/t*.c src/or/eventdns_tor.h
check-docs: all
$(PERL) $(top_builddir)/scripts/maint/checkOptionDocs.pl
check-docs:
./contrib/checkOptionDocs.pl
check-logs:
$(top_srcdir)/scripts/maint/checkLogs.pl \
$(top_srcdir)/src/*/*.[ch] | sort -n
./contrib/checkLogs.pl \
src/*/*.[ch] | sort -n
.PHONY: check-typos
check-typos:
@if test -x "`which misspell 2>&1;true`"; then \
echo "Checking for Typos ..."; \
(misspell \
$(top_srcdir)/src/[^e]*/*.[ch] \
$(top_srcdir)/doc \
$(top_srcdir)/contrib \
$(top_srcdir)/scripts \
$(top_srcdir)/README \
$(top_srcdir)/ChangeLog \
$(top_srcdir)/INSTALL \
$(top_srcdir)/ReleaseNotes \
$(top_srcdir)/LICENSE); \
else \
echo "Tor can use misspell to check for typos."; \
echo "It seems that you don't have misspell installed."; \
echo "You can install the latest version of misspell here: https://github.com/client9/misspell#install"; \
fi
.PHONY: check-changes
check-changes:
if USEPYTHON
@if test -d "$(top_srcdir)/changes"; then \
$(PYTHON) $(top_srcdir)/scripts/maint/lintChanges.py $(top_srcdir)/changes; \
fi
endif
.PHONY: update-versions
update-versions:
$(PERL) $(top_builddir)/scripts/maint/updateVersions.pl
.PHONY: callgraph
callgraph:
$(top_builddir)/scripts/maint/run_calltool.sh
version:
@echo "Tor @VERSION@"
@if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
echo -n "git: " ;\
(cd "$(top_srcdir)" && git rev-parse --short=16 HEAD); \
fi
mostlyclean-local:
rm -f $(top_builddir)/src/*/*.gc{da,no} $(top_builddir)/src/*/*/*.gc{da,no}
rm -rf $(HTML_COVER_DIR)
rm -rf $(top_builddir)/doc/doxygen
rm -rf $(TEST_NETWORK_ALL_LOG_DIR)
clean-local:
rm -rf $(top_builddir)/src/rust/target
rm -rf $(top_builddir)/src/rust/.cargo/registry
if USE_RUST
distclean-local: distclean-rust
endif
# This relies on some internal details of how automake implements
# distcheck. We check two directories because automake-1.15 changed
# from $(distdir)/_build to $(distdir)/_build/sub.
show-distdir-testlog:
@if test -d "$(distdir)/_build/sub"; then \
cat $(distdir)/_build/sub/$(TEST_SUITE_LOG); \
else \
cat $(distdir)/_build/$(TEST_SUITE_LOG); fi

View File

@ -1,19 +0,0 @@
all:
cd src/common
$(MAKE) /F Makefile.nmake
cd ../../src/ext
$(MAKE) /F Makefile.nmake
cd ../../src/or
$(MAKE) /F Makefile.nmake
cd ../../src/test
$(MAKE) /F Makefile.nmake
clean:
cd src/common
$(MAKE) /F Makefile.nmake clean
cd ../../src/ext
$(MAKE) /F Makefile.nmake clean
cd ../../src/or
$(MAKE) /F Makefile.nmake clean
cd ../../src/test
$(MAKE) /F Makefile.nmake clean

32
README
View File

@ -1,32 +1,4 @@
Tor protects your privacy on the internet by hiding the connection
between your Internet address and the services you use. We believe Tor
is reasonably secure, but please ensure you read the instructions and
configure it properly.
To build Tor from source:
./configure && make && make install
Tor is an implementation of Onion Routing. You can read more
at https://www.torproject.org/
To build Tor from a just-cloned git repository:
sh autogen.sh && ./configure && make && make install
Home page:
https://www.torproject.org/
Download new versions:
https://www.torproject.org/download/download.html
Documentation, including links to installation and setup instructions:
https://www.torproject.org/docs/documentation.html
Making applications work with Tor:
https://wiki.torproject.org/projects/tor/wiki/doc/TorifyHOWTO
Frequently Asked Questions:
https://www.torproject.org/docs/faq.html
To get started working on Tor development:
See the doc/HACKING directory.
Release timeline:
https://trac.torproject.org/projects/tor/wiki/org/teams/NetworkTeam/CoreTorReleases

15876
ReleaseNotes

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,80 @@
Changes related to compilation under MinGW/any sane win32 gcc
=============================================================
* event.c
- If gcc include "WIN32-Code/misc.h" instead of "misc.h"
* WIN32-Code/misc.h
- Add struct prototypes for timeval and timezone
* buffer.c
- changed type of "i" from "u_int" to "unsigned int". My MinGW wasn't
recognizing it. (u_int is normally typedef'ed to unsigned int, right?)
* evbuffer.c
- removed incorrect win32 error checking, see bufferevent_writecb().
(this needs to be fixed by anyone planning to use evbuffer on win32)
* log.c
- If gcc include "WIN32-Code/misc.h" instead of "misc.h"
* WIN32-Code/misc.c
- if gcc, include "misc.h"
- added newline at end of file to shut up gcc
* WIN32-Code/win32.c
- Altered the prototypes of win32_*() so their argument types didn't conflict
with the function definitions.
- Casted types of win32_* to void inside win32ops so that it didn't conflict
with the definition of eventops (gcc doesn't like this)
- Altered prototype of signal_handler to be static since definition is static
(why wasn't it like this before)
- Casted the second argument of signal() to be void*, some reason my MinGW
doesn't have sighandler_t typedef'ed.
* configure.in
- some code to check if we are compiling for WIN32.
* Makefile.am
- if BUILD_WIN32 is defined, include WIN32-Code/misc.c and
WIN32-Code/win32.c as source files.
- if WIN32, do not build test stuff. (not windows friendly)
- if WIN32, explicitly link to ws2_32.dll
Notes
-----
- We assume that if __GNUC__ is undefined we are building with MSVC
- If the user wishes to build a dll, they are on their own, the syntax is
compiler specific.
- Getting this warning from libtool, no idea why
"libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32
shared libraries"
Changes related to "custom eventops"
====================================
* configure.in
- add argument --enable-custom-eventops, sets USE_CUSTOM_EVENTOPS in config.h
- add argument --enable-custom-code, sets USE_CUSTOM_CODE in Makefile
* Makefile.am
- if USE_CUSTOM_CODE, include custom/custom.c as a source file.
(I can't think of a way to pass a string to Makefile.am, so I'm stuck naming
the new source file custom.c. It just seems simpler this way, but I'm open
to suggestions)
* event.c
- if USE_CUSTOM_EVENTOPS, use eventops as defined in custom-eventops.h
Notes
-----
Just in case it isn't completely obvious, the goal of "custom eventops" is to
allow the user to include their own event processing system without requiring a
fork. This is accomplished through two parts. Firstly, by allowing the user to
redefine eventops. (for example, the user may wish to use epoll() exclusively).
Secondly, by allowing the user to include their own code to support a private
eventop (note, this may not be necessary, as the user may choose to include
already defined eventop's.

8
Win32Build/mingw/README Normal file
View File

@ -0,0 +1,8 @@
The current SVN version of Tor should compile with MinGW.
OpenSSL and libz both compile on MinGW out of the box.
libevent 1.1b will not build unless you apply the diff in this directory.

View File

@ -0,0 +1,338 @@
Only in libevent-1.1b: CHANGES
Only in libevent-1.1b: Makefile
diff -uwr libevent-1.1b-old/Makefile.am libevent-1.1b/Makefile.am
--- libevent-1.1b-old/Makefile.am Wed Aug 9 22:16:35 2006
+++ libevent-1.1b/Makefile.am Sat Sep 2 03:49:26 2006
@@ -1,6 +1,5 @@
AUTOMAKE_OPTIONS = foreign no-dependencies
-SUBDIRS = . sample test
EXTRA_DIST = acconfig.h event.h event-internal.h log.h evsignal.h event.3 \
kqueue.c epoll_sub.c epoll.c select.c rtsig.c poll.c signal.c \
@@ -20,8 +19,29 @@
lib_LTLIBRARIES = libevent.la
-libevent_la_SOURCES = event.c buffer.c evbuffer.c log.c
-libevent_la_LIBADD = @LTLIBOBJS@
+
+if BUILD_WIN32
+
+SUBDIRS = . sample
+SYS_LIBS = -lws2_32
+SYS_SRC = WIN32-Code/misc.c WIN32-Code/win32.c
+
+else
+
+SUBDIRS = . sample test
+SYS_LIBS =
+SYS_SRC =
+
+endif
+
+if USE_CUSTOM_CODE
+CUST_SRC = custom/custom.c
+else
+CUST_SRC =
+endif
+
+libevent_la_SOURCES = event.c buffer.c evbuffer.c log.c $(CUST_SRC) $(SYS_SRC)
+libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_la_LDFLAGS = -release @VERSION@ -version-info 1:2:0
include_HEADERS = event.h
Only in libevent-1.1b: Makefile.in
diff -uwr libevent-1.1b-old/WIN32-Code/misc.c libevent-1.1b/WIN32-Code/misc.c
--- libevent-1.1b-old/WIN32-Code/misc.c Wed Aug 9 21:01:14 2006
+++ libevent-1.1b/WIN32-Code/misc.c Fri Sep 1 22:21:31 2006
@@ -4,6 +4,12 @@
#include <sys/timeb.h>
#include <time.h>
+#ifdef __GNUC__
+/*our prototypes for timeval and timezone are in here, just in case the above
+ headers don't have them*/
+#include "misc.h"
+#endif
+
/****************************************************************************
*
* Function: gettimeofday(struct timeval *, struct timezone *)
diff -uwr libevent-1.1b-old/WIN32-Code/misc.h libevent-1.1b/WIN32-Code/misc.h
--- libevent-1.1b-old/WIN32-Code/misc.h Wed Aug 9 21:01:14 2006
+++ libevent-1.1b/WIN32-Code/misc.h Fri Sep 1 18:47:09 2006
@@ -1,6 +1,9 @@
#ifndef MISC_H
#define MISC_H
+struct timezone;
+struct timeval;
+
int gettimeofday(struct timeval *,struct timezone *);
#endif
diff -uwr libevent-1.1b-old/WIN32-Code/win32.c libevent-1.1b/WIN32-Code/win32.c
--- libevent-1.1b-old/WIN32-Code/win32.c Wed Aug 9 21:25:48 2006
+++ libevent-1.1b/WIN32-Code/win32.c Sat Sep 2 00:45:55 2006
@@ -60,7 +60,8 @@
/* MSDN says this is required to handle SIGFPE */
volatile double SIGFPE_REQ = 0.0f;
-int signal_handler(int sig);
+static int signal_handler(int sig);
+
void signal_process(void);
int signal_recalc(void);
@@ -77,20 +78,21 @@
};
void *win32_init (void);
-int win32_insert (void *, struct event *);
-int win32_del (void *, struct event *);
+int win32_insert (struct win32op *, struct event *);
+int win32_del (struct win32op *, struct event *);
int win32_recalc (struct event_base *base, void *, int);
-int win32_dispatch (struct event_base *base, void *, struct timeval *);
+int win32_dispatch (struct event_base *base, struct win32op *, struct timeval *);
struct eventop win32ops = {
"win32",
win32_init,
- win32_insert,
- win32_del,
+ (int (*) (void*, struct event*)) win32_insert,
+ (int (*) (void*, struct event*)) win32_del,
win32_recalc,
- win32_dispatch
+ (int (*) (struct event_base*, void*, struct timeval*)) win32_dispatch
};
+
#define FD_SET_ALLOC_SIZE(n) ((sizeof(struct win_fd_set) + ((n)-1)*sizeof(SOCKET)))
static int
@@ -213,7 +215,13 @@
if (ev->ev_events & (EV_READ|EV_WRITE))
event_errx(1, "%s: EV_SIGNAL incompatible use",
__func__);
+
+#ifndef __GNUC__
if((int)signal(EVENT_SIGNAL(ev), signal_handler) == -1)
+#else
+ if((int)signal(EVENT_SIGNAL(ev), (void*) signal_handler) == -1)
+#endif
+
return (-1);
return (0);
@@ -382,8 +390,13 @@
/* Reinstall our signal handler. */
TAILQ_FOREACH(ev, &signalqueue, ev_signal_next) {
+#ifndef __GNUC__
if((int)signal(EVENT_SIGNAL(ev), signal_handler) == -1)
+#else
+ if((int)signal(EVENT_SIGNAL(ev), (void*) signal_handler) == -1)
+#endif
return (-1);
+
}
return (0);
}
Only in libevent-1.1b-old/: aclocal.m4
Only in libevent-1.1b: autom4te.cache
diff -uwr libevent-1.1b-old/buffer.c libevent-1.1b/buffer.c
--- libevent-1.1b-old/buffer.c Wed Aug 9 22:01:40 2006
+++ libevent-1.1b/buffer.c Fri Sep 1 18:52:56 2006
@@ -197,7 +197,7 @@
u_char *data = EVBUFFER_DATA(buffer);
size_t len = EVBUFFER_LENGTH(buffer);
char *line;
- u_int i;
+ unsigned int i;
for (i = 0; i < len; i++) {
if (data[i] == '\r' || data[i] == '\n')
Only in libevent-1.1b: config.guess
Only in libevent-1.1b: config.h
diff -uwr libevent-1.1b-old/config.h.in libevent-1.1b/config.h.in
--- libevent-1.1b-old/config.h.in Wed Aug 9 21:27:37 2006
+++ libevent-1.1b/config.h.in Sat Sep 2 02:23:17 2006
@@ -223,6 +223,9 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
+/* Define to 1 if you want to use a custom eventops variable */
+#undef USE_CUSTOM_EVENTOPS
+
/* Version number of package */
#undef VERSION
@@ -232,11 +235,9 @@
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
#undef inline
-#endif
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
Only in libevent-1.1b: config.h.in~
Only in libevent-1.1b: config.log
Only in libevent-1.1b: config.status
Only in libevent-1.1b: configure
diff -uwr libevent-1.1b-old/configure.in libevent-1.1b/configure.in
--- libevent-1.1b-old/configure.in Wed Aug 9 22:05:17 2006
+++ libevent-1.1b/configure.in Sat Sep 2 03:40:15 2006
@@ -21,6 +21,18 @@
CFLAGS="$CFLAGS -Wall"
fi
+AC_ARG_ENABLE(custom-eventops,
+ [ --enable-custom-eventops Use custom eventops variable],
+ AC_DEFINE([USE_CUSTOM_EVENTOPS],[1],
+ [Define to 1 to use a custom eventops variable])
+ ,)
+AC_ARG_ENABLE(custom-code,
+ [ --enable-custom-code Use custom code from custom/],
+ customcodev=true,
+ customcodev=false)
+
+AM_CONDITIONAL(USE_CUSTOM_CODE, test x$customcodev = xtrue)
+
AC_PROG_LIBTOOL
dnl Uncomment "AC_DISABLE_SHARED" to make shared librraries not get
@@ -110,6 +122,22 @@
AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
)
fi
+
+dnl - check if the macro WIN32 is defined on this compiler.
+dnl - (this is how we check for a windows version of GCC)
+AC_MSG_CHECKING(for WIN32)
+AC_TRY_COMPILE(,
+ [
+ #ifndef WIN32
+ #error
+ #endif
+ ],
+ bwin32=true; AC_MSG_RESULT(yes),
+ bwin32=false; AC_MSG_RESULT(no),
+)
+
+AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
+
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
diff -uwr libevent-1.1b-old/evbuffer.c libevent-1.1b/evbuffer.c
--- libevent-1.1b-old/evbuffer.c Wed Aug 9 21:01:14 2006
+++ libevent-1.1b/evbuffer.c Fri Sep 1 19:18:13 2006
@@ -154,12 +154,20 @@
if (EVBUFFER_LENGTH(bufev->output)) {
res = evbuffer_write(bufev->output, fd);
if (res == -1) {
+#ifndef WIN32
+/*todo. evbuffer uses WriteFile when WIN32 is set. WIN32 system calls do not
+ *set errno. thus this error checking is not portable*/
if (errno == EAGAIN ||
errno == EINTR ||
errno == EINPROGRESS)
goto reschedule;
/* error case */
what |= EVBUFFER_ERROR;
+
+#else
+ goto reschedule;
+#endif
+
} else if (res == 0) {
/* eof case */
what |= EVBUFFER_EOF;
@@ -181,6 +189,7 @@
return;
reschedule:
+
if (EVBUFFER_LENGTH(bufev->output) != 0)
bufferevent_add(&bufev->ev_write, bufev->timeout_write);
return;
diff -uwr libevent-1.1b-old/event.c libevent-1.1b/event.c
--- libevent-1.1b-old/event.c Wed Aug 9 21:25:48 2006
+++ libevent-1.1b/event.c Sat Sep 2 04:22:05 2006
@@ -30,8 +30,14 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
+
+#ifdef __GNUC__
+#include "WIN32-Code/misc.h"
+#else
#include "misc.h"
#endif
+
+#endif
#include <sys/types.h>
#include <sys/tree.h>
#ifdef HAVE_SYS_TIME_H
@@ -53,6 +59,7 @@
#include "event-internal.h"
#include "log.h"
+
#ifdef HAVE_SELECT
extern const struct eventop selectops;
#endif
@@ -75,6 +82,8 @@
extern const struct eventop win32ops;
#endif
+#ifndef USE_CUSTOM_EVENTOPS
+
/* In order of preference */
const struct eventop *eventops[] = {
#ifdef HAVE_WORKING_KQUEUE
@@ -101,6 +110,11 @@
NULL
};
+#else
+#include "custom-eventops.h"
+#endif //USE_CUSTOM_EVENTOPS
+
+
/* Global state */
struct event_list signalqueue;
Only in libevent-1.1b: libtool
diff -uwr libevent-1.1b-old/log.c libevent-1.1b/log.c
--- libevent-1.1b-old/log.c Wed Aug 9 21:01:14 2006
+++ libevent-1.1b/log.c Fri Sep 1 19:09:45 2006
@@ -45,8 +45,14 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
+
+#ifdef __GNUC__
+#include "WIN32-Code/misc.h"
+#else
#include "misc.h"
#endif
+
+#endif
#include <sys/types.h>
#include <sys/tree.h>
#ifdef HAVE_SYS_TIME_H
Only in libevent-1.1b/sample: Makefile
Only in libevent-1.1b/sample: Makefile.in
Only in libevent-1.1b: stamp-h1
Only in libevent-1.1b/test: Makefile
Only in libevent-1.1b/test: Makefile.in

View File

@ -0,0 +1,221 @@
=== Makefile.am
==================================================================
--- Makefile.am (revision 8794)
+++ Makefile.am (local)
@@ -1,6 +1,5 @@
AUTOMAKE_OPTIONS = foreign no-dependencies
-SUBDIRS = . sample test
EXTRA_DIST = acconfig.h event.h event-internal.h log.h evsignal.h event.3 \
kqueue.c epoll_sub.c epoll.c select.c rtsig.c poll.c signal.c \
@@ -20,13 +19,29 @@
lib_LTLIBRARIES = libevent.la
-libevent_la_SOURCES = event.c buffer.c evbuffer.c log.c
-libevent_la_LIBADD = @LTLIBOBJS@
+if BUILD_WIN32
+
+SUBDIRS = . sample
+SYS_LIBS = -lws2_32
+SYS_SRC = WIN32-Code/misc.c WIN32-Code/win32.c
+SYS_INCLUDES = -IWIN32-Code
+
+else
+
+SUBDIRS = . sample test
+SYS_LIBS =
+SYS_SRC =
+SYS_INCLUDES =
+
+endif
+
+libevent_la_SOURCES = event.c buffer.c evbuffer.c log.c $(SYS_SRC)
+libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_la_LDFLAGS = -release @VERSION@ -version-info 1:2:0
include_HEADERS = event.h
-INCLUDES = -Icompat
+INCLUDES = -Icompat $(SYS_INCLUDES)
man_MANS = event.3
=== WIN32-Code/misc.c
==================================================================
--- WIN32-Code/misc.c (revision 8794)
+++ WIN32-Code/misc.c (local)
@@ -4,6 +4,12 @@
#include <sys/timeb.h>
#include <time.h>
+#ifdef __GNUC__
+/*our prototypes for timeval and timezone are in here, just in case the above
+ headers don't have them*/
+#include "misc.h"
+#endif
+
/****************************************************************************
*
* Function: gettimeofday(struct timeval *, struct timezone *)
@@ -17,6 +23,7 @@
*
****************************************************************************/
+#ifndef HAVE_GETTIMEOFDAY
int gettimeofday(struct timeval *tv, struct timezone *tz) {
struct _timeb tb;
@@ -28,6 +35,7 @@
tv->tv_usec = ((int) tb.millitm) * 1000;
return 0;
}
+#endif
int
win_read(int fd, void *buf, unsigned int length)
=== WIN32-Code/misc.h
==================================================================
--- WIN32-Code/misc.h (revision 8794)
+++ WIN32-Code/misc.h (local)
@@ -1,6 +1,11 @@
#ifndef MISC_H
#define MISC_H
+struct timezone;
+struct timeval;
+
+#ifndef HAVE_GETTIMEOFDAY
int gettimeofday(struct timeval *,struct timezone *);
+#endif
#endif
=== WIN32-Code/win32.c
==================================================================
--- WIN32-Code/win32.c (revision 8794)
+++ WIN32-Code/win32.c (local)
@@ -60,7 +60,8 @@
/* MSDN says this is required to handle SIGFPE */
volatile double SIGFPE_REQ = 0.0f;
-int signal_handler(int sig);
+static void signal_handler(int sig);
+
void signal_process(void);
int signal_recalc(void);
@@ -205,8 +206,9 @@
}
int
-win32_insert(struct win32op *win32op, struct event *ev)
+win32_insert(void *op, struct event *ev)
{
+ struct win32op *win32op = op;
int i;
if (ev->ev_events & EV_SIGNAL) {
@@ -251,8 +253,9 @@
}
int
-win32_del(struct win32op *win32op, struct event *ev)
+win32_del(void *op, struct event *ev)
{
+ struct win32op *win32op = op;
int i, found;
if (ev->ev_events & EV_SIGNAL)
@@ -302,9 +305,10 @@
*/
int
-win32_dispatch(struct event_base *base, struct win32op *win32op,
+win32_dispatch(struct event_base *base, void *op,
struct timeval *tv)
{
+ struct win32op *win32op = op;
int res = 0;
int i;
int fd_count;
@@ -366,13 +370,11 @@
}
-static int
+static void
signal_handler(int sig)
{
evsigcaught[sig]++;
signal_caught = 1;
-
- return 0;
}
int
=== buffer.c
==================================================================
--- buffer.c (revision 8794)
+++ buffer.c (local)
@@ -197,7 +197,7 @@
u_char *data = EVBUFFER_DATA(buffer);
size_t len = EVBUFFER_LENGTH(buffer);
char *line;
- u_int i;
+ unsigned int i;
for (i = 0; i < len; i++) {
if (data[i] == '\r' || data[i] == '\n')
=== configure.in
==================================================================
--- configure.in (revision 8794)
+++ configure.in (local)
@@ -111,6 +111,21 @@
)
fi
+dnl - check if the macro WIN32 is defined on this compiler.
+dnl - (this is how we check for a windows version of GCC)
+AC_MSG_CHECKING(for WIN32)
+AC_TRY_COMPILE(,
+ [
+ #ifndef WIN32
+ #error
+ #endif
+ ],
+ bwin32=true; AC_MSG_RESULT(yes),
+ bwin32=false; AC_MSG_RESULT(no),
+)
+
+AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
+
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
=== evbuffer.c
==================================================================
--- evbuffer.c (revision 8794)
+++ evbuffer.c (local)
@@ -154,12 +154,20 @@
if (EVBUFFER_LENGTH(bufev->output)) {
res = evbuffer_write(bufev->output, fd);
if (res == -1) {
+#ifndef WIN32
+/*todo. evbuffer uses WriteFile when WIN32 is set. WIN32 system calls do not
+ *set errno. thus this error checking is not portable*/
if (errno == EAGAIN ||
errno == EINTR ||
errno == EINPROGRESS)
goto reschedule;
/* error case */
what |= EVBUFFER_ERROR;
+
+#else
+ goto reschedule;
+#endif
+
} else if (res == 0) {
/* eof case */
what |= EVBUFFER_EOF;

View File

@ -0,0 +1,210 @@
=== Makefile.am
==================================================================
--- Makefile.am (revision 8794)
+++ Makefile.am (local)
@@ -1,6 +1,5 @@
AUTOMAKE_OPTIONS = foreign no-dependencies
-SUBDIRS = . sample test
bin_SCRIPTS = event_rpcgen.py
@@ -22,18 +21,34 @@
lib_LTLIBRARIES = libevent.la
+if BUILD_WIN32
+
+SUBDIRS = . sample
+SYS_LIBS = -lws2_32
+SYS_SRC = WIN32-Code/misc.c WIN32-Code/win32.c
+SYS_INCLUDES = -IWIN32-Code
+
+else
+
+SUBDIRS = . sample test
+SYS_LIBS =
+SYS_SRC =
+SYS_INCLUDES =
+
+endif
+
libevent_la_SOURCES = event.c buffer.c evbuffer.c log.c event_tagging.c \
- http.c evhttp.h http-internal.h evdns.c evdns.h
-libevent_la_LIBADD = @LTLIBOBJS@
+ http.c evhttp.h http-internal.h evdns.c evdns.h $(SYS_SRC)
+libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_la_LDFLAGS = -release @VERSION@ -version-info 1:3:0
include_HEADERS = event.h evhttp.h evdns.h
-INCLUDES = -Icompat
+INCLUDES = -Icompat $(SYS_INCLUDES)
man_MANS = event.3
verify: libevent.la
- cd $(srcdir)/test && make verify
+ cd $(srcdir)/test && make verify
DISTCLEANFILES = *~
=== WIN32-Code/misc.c
==================================================================
--- WIN32-Code/misc.c (revision 8794)
+++ WIN32-Code/misc.c (local)
@@ -4,6 +4,12 @@
#include <sys/timeb.h>
#include <time.h>
+#ifdef __GNUC__
+/*our prototypes for timeval and timezone are in here, just in case the above
+ headers don't have them*/
+#include "misc.h"
+#endif
+
/****************************************************************************
*
* Function: gettimeofday(struct timeval *, struct timezone *)
=== WIN32-Code/misc.h
==================================================================
--- WIN32-Code/misc.h (revision 8794)
+++ WIN32-Code/misc.h (local)
@@ -1,6 +1,9 @@
#ifndef MISC_H
#define MISC_H
+struct timezone;
+struct timeval;
+
int gettimeofday(struct timeval *,struct timezone *);
#endif
=== WIN32-Code/win32.c
==================================================================
--- WIN32-Code/win32.c (revision 8794)
+++ WIN32-Code/win32.c (local)
@@ -60,7 +60,8 @@
/* MSDN says this is required to handle SIGFPE */
volatile double SIGFPE_REQ = 0.0f;
-int signal_handler(int sig);
+static void signal_handler(int sig);
+
void signal_process(void);
int signal_recalc(void);
@@ -207,8 +208,9 @@
}
int
-win32_insert(struct win32op *win32op, struct event *ev)
+win32_insert(void *op, struct event *ev)
{
+ struct win32op *win32op = op;
int i;
if (ev->ev_events & EV_SIGNAL) {
@@ -253,8 +255,9 @@
}
int
-win32_del(struct win32op *win32op, struct event *ev)
+win32_del(void *op, struct event *ev)
{
+ struct win32op *win32op = op;
int i, found;
if (ev->ev_events & EV_SIGNAL)
@@ -304,9 +307,10 @@
*/
int
-win32_dispatch(struct event_base *base, struct win32op *win32op,
+win32_dispatch(struct event_base *base, void *op,
struct timeval *tv)
{
+ struct win32op *win32op = op;
int res = 0;
int i;
int fd_count;
@@ -389,13 +393,11 @@
free(win32op);
}
-static int
+static void
signal_handler(int sig)
{
evsigcaught[sig]++;
signal_caught = 1;
-
- return 0;
}
int
=== buffer.c
==================================================================
--- buffer.c (revision 8794)
+++ buffer.c (local)
@@ -197,7 +197,7 @@
u_char *data = EVBUFFER_DATA(buffer);
size_t len = EVBUFFER_LENGTH(buffer);
char *line;
- u_int i;
+ unsigned int i;
for (i = 0; i < len; i++) {
if (data[i] == '\r' || data[i] == '\n')
=== configure.in
==================================================================
--- configure.in (revision 8794)
+++ configure.in (local)
@@ -111,6 +111,22 @@
)
fi
+dnl - check if the macro WIN32 is defined on this compiler.
+dnl - (this is how we check for a windows version of GCC)
+AC_MSG_CHECKING(for WIN32)
+AC_TRY_COMPILE(,
+ [
+ #ifndef WIN32
+ #error
+ #endif
+ ],
+ bwin32=true; AC_MSG_RESULT(yes),
+ bwin32=false; AC_MSG_RESULT(no),
+)
+
+AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
+
+
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
=== evbuffer.c
==================================================================
--- evbuffer.c (revision 8794)
+++ evbuffer.c (local)
@@ -163,12 +162,20 @@
if (EVBUFFER_LENGTH(bufev->output)) {
res = evbuffer_write(bufev->output, fd);
if (res == -1) {
+#ifndef WIN32
+/*todo. evbuffer uses WriteFile when WIN32 is set. WIN32 system calls do not
+ *set errno. thus this error checking is not portable*/
if (errno == EAGAIN ||
errno == EINTR ||
errno == EINPROGRESS)
goto reschedule;
/* error case */
what |= EVBUFFER_ERROR;
+
+#else
+ goto reschedule;
+#endif
+
} else if (res == 0) {
/* eof case */
what |= EVBUFFER_EOF;

41
Win32Build/vc6/Tor.dsw Normal file
View File

@ -0,0 +1,41 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "tor"=".\tor\tor.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "tor_resolve"=".\tor_resolve\tor_resolve.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

398
Win32Build/vc6/tor/Tor.dsp Normal file
View File

@ -0,0 +1,398 @@
# Microsoft Developer Studio Project File - Name="tor" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=tor - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "tor.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "tor.mak" CFG="tor - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "tor - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "tor - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "tor - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\src\win32" /I "c:\openssl\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ssleay32.lib libeay32.lib /nologo /subsystem:console /machine:I386 /libpath:"c:\openssl\lib\vc"
!ELSEIF "$(CFG)" == "tor - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\src\win32" /I "c:\openssl\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 wsock32.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"c:\openssl\lib\vc"
!ENDIF
# Begin Target
# Name "tor - Win32 Release"
# Name "tor - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Group "common"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\src\common\aes.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\compat.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\container.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\crypto.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\log.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\log.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\torgzip.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\tortls.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\util.c
# End Source File
# End Group
# Begin Group "zlib"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\contrib\zlib\adler32.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\compress.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\crc32.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\crc32.h
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\deflate.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\deflate.h
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\gzio.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\infback.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\inffast.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\inffast.h
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\inffixed.h
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\inflate.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\inflate.h
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\inftrees.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\inftrees.h
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\trees.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\trees.h
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\uncompr.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\zconf.h
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\zlib.h
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\zutil.c
# End Source File
# Begin Source File
SOURCE=..\..\..\contrib\zlib\zutil.h
# End Source File
# End Group
# Begin Group "or"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\src\or\buffers.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\circuitbuild.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\circuitlist.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\circuituse.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\command.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\config.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\connection.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\connection_edge.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\connection_or.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\control.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\cpuworker.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\directory.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\dirserv.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\dns.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\hibernate.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\main.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\onion.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\policies.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\relay.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\rendclient.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\rendcommon.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\rendmid.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\rendservice.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\rephist.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\router.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\routerlist.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\routerparse.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\tor_main.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\tree.h
# End Source File
# End Group
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\..\src\common\aes.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\compat.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\container.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\crypto.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\fakepoll.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\or\or.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\win32\orconfig.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\test.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\torgzip.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\torint.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\tortls.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\util.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -0,0 +1,134 @@
# Microsoft Developer Studio Project File - Name="tor_resolve" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=tor_resolve - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "tor_resolve.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "tor_resolve.mak" CFG="tor_resolve - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "tor_resolve - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "tor_resolve - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "tor_resolve - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\src\win32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "tor_resolve - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\src\win32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "tor_resolve - Win32 Release"
# Name "tor_resolve - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\..\src\common\compat.c
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\log.c
# End Source File
# Begin Source File
SOURCE="..\..\..\src\tools\tor-resolve.c"
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\util.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\..\src\common\compat.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\log.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\win32\orconfig.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\torint.h
# End Source File
# Begin Source File
SOURCE=..\..\..\src\common\util.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -0,0 +1,45 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tor", "Tor.vcproj", "{63A6B170-E742-400C-B3A0-9CCED3699043}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tor_resolve", "..\tor_resolve\tor_resolve.vcproj", "{E2D2762A-26BD-4A28-BD72-DDAB181324B4}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unittests", "..\unittests\unittests.vcproj", "{F1F64693-11A9-4992-8B4B-2A67C07BD8C8}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "..\..\..\contrib\libevent\WIN32-Prj\libevent.vcproj", "{52BBFCA6-6F82-4596-BBAD-0BCFBC637B80}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{63A6B170-E742-400C-B3A0-9CCED3699043}.Debug.ActiveCfg = Debug|Win32
{63A6B170-E742-400C-B3A0-9CCED3699043}.Debug.Build.0 = Debug|Win32
{63A6B170-E742-400C-B3A0-9CCED3699043}.Release.ActiveCfg = Release|Win32
{63A6B170-E742-400C-B3A0-9CCED3699043}.Release.Build.0 = Release|Win32
{E2D2762A-26BD-4A28-BD72-DDAB181324B4}.Debug.ActiveCfg = Debug|Win32
{E2D2762A-26BD-4A28-BD72-DDAB181324B4}.Debug.Build.0 = Debug|Win32
{E2D2762A-26BD-4A28-BD72-DDAB181324B4}.Release.ActiveCfg = Release|Win32
{E2D2762A-26BD-4A28-BD72-DDAB181324B4}.Release.Build.0 = Release|Win32
{F1F64693-11A9-4992-8B4B-2A67C07BD8C8}.Debug.ActiveCfg = Debug|Win32
{F1F64693-11A9-4992-8B4B-2A67C07BD8C8}.Debug.Build.0 = Debug|Win32
{F1F64693-11A9-4992-8B4B-2A67C07BD8C8}.Release.ActiveCfg = Release|Win32
{F1F64693-11A9-4992-8B4B-2A67C07BD8C8}.Release.Build.0 = Release|Win32
{52BBFCA6-6F82-4596-BBAD-0BCFBC637B80}.Debug.ActiveCfg = Debug|Win32
{52BBFCA6-6F82-4596-BBAD-0BCFBC637B80}.Debug.Build.0 = Debug|Win32
{52BBFCA6-6F82-4596-BBAD-0BCFBC637B80}.Release.ActiveCfg = Release|Win32
{52BBFCA6-6F82-4596-BBAD-0BCFBC637B80}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,357 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Tor"
ProjectGUID="{63A6B170-E742-400C-B3A0-9CCED3699043}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="c:\openssl\include;..\..\..\src\win32;..\..\..\contrib\libevent"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
IgnoreStandardIncludePath="FALSE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"
CompileAs="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib t:\openssl\install\lib\vc\ssleay32.lib t:\openssl\install\lib\vc\libeay32.lib ..\..\..\contrib\libevent\win32-prj\Debug\libevent.lib ws2_32.lib"
OutputFile="$(OutDir)/Tor.exe"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBCD"
DelayLoadDLLs="advapi32.dll"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/Tor.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="c:\openssl\include;..\..\..\src\win32;..\..\..\contrib\libevent"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
IgnoreStandardIncludePath="FALSE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"
CompileAs="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib c:\openssl\lib\vc\ssleay32.lib c:\openssl\lib\vc\libeay32.lib"
OutputFile="$(OutDir)/Tor.exe"
LinkIncremental="1"
DelayLoadDLLs="advapi32.dll"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\..\..\src\common\aes.c">
</File>
<File
RelativePath="..\..\..\src\or\buffers.c">
</File>
<File
RelativePath="..\..\..\src\or\circuitbuild.c">
</File>
<File
RelativePath="..\..\..\src\or\circuitlist.c">
</File>
<File
RelativePath="..\..\..\src\or\circuituse.c">
</File>
<File
RelativePath="..\..\..\src\or\command.c">
</File>
<File
RelativePath="..\..\..\src\common\compat.c">
</File>
<File
RelativePath="..\..\..\src\or\config.c">
</File>
<File
RelativePath="..\..\..\src\or\connection.c">
</File>
<File
RelativePath="..\..\..\src\or\connection_edge.c">
</File>
<File
RelativePath="..\..\..\src\or\connection_or.c">
</File>
<File
RelativePath="..\..\..\src\common\container.c">
</File>
<File
RelativePath="..\..\..\src\or\control.c">
</File>
<File
RelativePath="..\..\..\src\or\cpuworker.c">
</File>
<File
RelativePath="..\..\..\src\common\crypto.c">
</File>
<File
RelativePath="..\..\..\src\or\directory.c">
</File>
<File
RelativePath="..\..\..\src\or\dirserv.c">
</File>
<File
RelativePath="..\..\..\src\or\dns.c">
</File>
<File
RelativePath="..\..\..\src\or\hibernate.c">
</File>
<File
RelativePath="..\..\..\src\common\log.c">
</File>
<File
RelativePath="..\..\..\src\or\main.c">
</File>
<File
RelativePath="..\..\..\src\or\onion.c">
</File>
<File
RelativePath="..\..\..\src\or\or.h">
</File>
<File
RelativePath="..\..\..\src\win32\orconfig.h">
</File>
<File
RelativePath="..\..\..\src\or\policies.c">
</File>
<File
RelativePath="..\..\..\src\or\relay.c">
</File>
<File
RelativePath="..\..\..\src\or\rendclient.c">
</File>
<File
RelativePath="..\..\..\src\or\rendcommon.c">
</File>
<File
RelativePath="..\..\..\src\or\rendmid.c">
</File>
<File
RelativePath="..\..\..\src\or\rendservice.c">
</File>
<File
RelativePath="..\..\..\src\or\rephist.c">
</File>
<File
RelativePath="..\..\..\src\or\router.c">
</File>
<File
RelativePath="..\..\..\src\or\routerlist.c">
</File>
<File
RelativePath="..\..\..\src\or\routerparse.c">
</File>
<File
RelativePath="..\..\..\src\or\tor_main.c">
</File>
<File
RelativePath="..\..\..\src\common\torgzip.c">
</File>
<File
RelativePath="..\..\..\src\common\torint.h">
</File>
<File
RelativePath="..\..\..\src\common\tortls.c">
</File>
<File
RelativePath="..\..\..\src\common\util.c">
</File>
<Filter
Name="zlib"
Filter="">
<File
RelativePath="..\..\..\contrib\zlib\adler32.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\compress.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\crc32.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\crc32.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\deflate.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\deflate.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\gzio.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\infback.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inffast.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inffast.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inffixed.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inflate.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inflate.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inftrees.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inftrees.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\trees.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\trees.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\uncompr.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\zconf.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\zlib.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\zutil.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\zutil.h">
</File>
</Filter>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\..\..\src\common\aes.h">
</File>
<File
RelativePath="..\..\..\src\common\compat.h">
</File>
<File
RelativePath="..\..\..\src\common\container.h">
</File>
<File
RelativePath="..\..\..\src\common\crypto.h">
</File>
<File
RelativePath="..\..\..\src\common\log.h">
</File>
<File
RelativePath="..\..\..\src\common\torgzip.h">
</File>
<File
RelativePath="..\..\..\src\common\tortls.h">
</File>
<File
RelativePath="..\..\..\src\or\tree.h">
</File>
<File
RelativePath="..\..\..\src\common\util.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<File
RelativePath=".\ReadMe.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,169 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="tor_resolve"
ProjectGUID="{E2D2762A-26BD-4A28-BD72-DDAB181324B4}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\contrib\libevent;..\..\..\src\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib ..\..\..\contrib\libevent\win32-prj\Debug\libevent.lib"
OutputFile="$(OutDir)/tor_resolve.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/tor_resolve.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\contrib\libevent;..\..\..\src\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib ..\..\..\contrib\libevent\win32-prj\Debug\libevent.lib"
OutputFile="$(OutDir)/tor_resolve.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\..\..\src\common\compat.c">
</File>
<File
RelativePath="..\..\..\src\common\compat.h">
</File>
<File
RelativePath="..\..\..\src\common\container.c">
</File>
<File
RelativePath="..\..\..\src\common\container.h">
</File>
<File
RelativePath="..\..\..\src\common\log.c">
</File>
<File
RelativePath="..\..\..\src\common\log.h">
</File>
<File
RelativePath="..\..\..\src\win32\orconfig.h">
</File>
<File
RelativePath="..\..\..\src\tools\tor-resolve.c">
</File>
<File
RelativePath="..\..\..\src\common\torint.h">
</File>
<File
RelativePath="..\..\..\src\common\util.c">
</File>
<File
RelativePath="..\..\..\src\common\util.h">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<File
RelativePath=".\ReadMe.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,342 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="unittests"
ProjectGUID="{F1F64693-11A9-4992-8B4B-2A67C07BD8C8}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\src\win32;c:\openssl\include;..\..\..\contrib\libevent"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib t:\openssl\install\lib\vc\libeay32.lib t:\openssl\install\lib\vc\ssleay32.lib ws2_32.lib ..\..\..\contrib\libevent\win32-prj\Debug\libevent.lib"
OutputFile="$(OutDir)/unittests.exe"
LinkIncremental="2"
IgnoreDefaultLibraryNames="LIBCD"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/unittests.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\src\win32;c:\openssl\include;..\..\..\contrib\libevent"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib c:\openssl\lib\vc\libeay32.lib c:\openssl\lib\vc\ssleay32.lib"
OutputFile="$(OutDir)/unittests.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\..\..\src\common\aes.c">
</File>
<File
RelativePath="..\..\..\src\or\buffers.c">
</File>
<File
RelativePath="..\..\..\src\or\circuitbuild.c">
</File>
<File
RelativePath="..\..\..\src\or\circuitlist.c">
</File>
<File
RelativePath="..\..\..\src\or\circuituse.c">
</File>
<File
RelativePath="..\..\..\src\or\command.c">
</File>
<File
RelativePath="..\..\..\src\common\compat.c">
</File>
<File
RelativePath="..\..\..\src\or\config.c">
</File>
<File
RelativePath="..\..\..\src\or\connection.c">
</File>
<File
RelativePath="..\..\..\src\or\connection_edge.c">
</File>
<File
RelativePath="..\..\..\src\or\connection_or.c">
</File>
<File
RelativePath="..\..\..\src\common\container.c">
</File>
<File
RelativePath="..\..\..\src\or\control.c">
</File>
<File
RelativePath="..\..\..\src\or\cpuworker.c">
</File>
<File
RelativePath="..\..\..\src\common\crypto.c">
</File>
<File
RelativePath="..\..\..\src\or\directory.c">
</File>
<File
RelativePath="..\..\..\src\or\dirserv.c">
</File>
<File
RelativePath="..\..\..\src\or\dns.c">
</File>
<File
RelativePath="..\..\..\src\or\hibernate.c">
</File>
<File
RelativePath="..\..\..\src\common\log.c">
</File>
<File
RelativePath="..\..\..\src\or\main.c">
</File>
<File
RelativePath="..\..\..\src\or\onion.c">
</File>
<File
RelativePath="..\..\..\src\or\or.h">
</File>
<File
RelativePath="..\..\..\src\win32\orconfig.h">
</File>
<File
RelativePath="..\..\..\src\or\policies.c">
</File>
<File
RelativePath="..\..\..\src\or\relay.c">
</File>
<File
RelativePath="..\..\..\src\or\rendclient.c">
</File>
<File
RelativePath="..\..\..\src\or\rendcommon.c">
</File>
<File
RelativePath="..\..\..\src\or\rendmid.c">
</File>
<File
RelativePath="..\..\..\src\or\rendservice.c">
</File>
<File
RelativePath="..\..\..\src\or\rephist.c">
</File>
<File
RelativePath="..\..\..\src\or\router.c">
</File>
<File
RelativePath="..\..\..\src\or\routerlist.c">
</File>
<File
RelativePath="..\..\..\src\or\routerparse.c">
</File>
<File
RelativePath="..\..\..\src\or\test.c">
</File>
<File
RelativePath="..\..\..\src\common\torgzip.c">
</File>
<File
RelativePath="..\..\..\src\common\torint.h">
</File>
<File
RelativePath="..\..\..\src\common\tortls.c">
</File>
<File
RelativePath="..\..\..\src\common\util.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\zutil.h">
</File>
<Filter
Name="zlib">
<File
RelativePath="..\..\..\contrib\zlib\adler32.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\compress.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\crc32.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\crc32.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\deflate.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\deflate.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\gzio.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\infback.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inffast.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inffast.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inffixed.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inflate.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inflate.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inftrees.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\inftrees.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\trees.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\trees.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\uncompr.c">
</File>
<File
RelativePath="..\..\..\contrib\zlib\zconf.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\zlib.h">
</File>
<File
RelativePath="..\..\..\contrib\zlib\zutil.c">
</File>
</Filter>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\..\..\src\common\aes.h">
</File>
<File
RelativePath="..\..\..\src\common\compat.h">
</File>
<File
RelativePath="..\..\..\src\common\container.h">
</File>
<File
RelativePath="..\..\..\src\common\crypto.h">
</File>
<File
RelativePath="..\..\..\src\common\log.h">
</File>
<File
RelativePath="..\..\..\src\common\torgzip.h">
</File>
<File
RelativePath="..\..\..\src\common\tortls.h">
</File>
<File
RelativePath="..\..\..\src\or\tree.h">
</File>
<File
RelativePath="..\..\..\src\common\util.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,288 +0,0 @@
dnl Helper macros for Tor configure.ac
dnl Copyright (c) 2001-2004, Roger Dingledine
dnl Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
dnl Copyright (c) 2007-2008, Roger Dingledine, Nick Mathewson
dnl Copyright (c) 2007-2017, The Tor Project, Inc.
dnl See LICENSE for licensing information
AC_DEFUN([TOR_EXTEND_CODEPATH],
[
if test -d "$1/lib"; then
LDFLAGS="-L$1/lib $LDFLAGS"
else
LDFLAGS="-L$1 $LDFLAGS"
fi
if test -d "$1/include"; then
CPPFLAGS="-I$1/include $CPPFLAGS"
else
CPPFLAGS="-I$1 $CPPFLAGS"
fi
])
AC_DEFUN([TOR_DEFINE_CODEPATH],
[
if test x$1 = "x(system)"; then
TOR_LDFLAGS_$2=""
TOR_CPPFLAGS_$2=""
else
if test -d "$1/lib"; then
TOR_LDFLAGS_$2="-L$1/lib"
TOR_LIBDIR_$2="$1/lib"
else
TOR_LDFLAGS_$2="-L$1"
TOR_LIBDIR_$2="$1"
fi
if test -d "$1/include"; then
TOR_CPPFLAGS_$2="-I$1/include"
else
TOR_CPPFLAGS_$2="-I$1"
fi
fi
AC_SUBST(TOR_CPPFLAGS_$2)
AC_SUBST(TOR_LDFLAGS_$2)
])
dnl 1: flags
dnl 2: try to link too if this is nonempty.
dnl 3: what to do on success compiling
dnl 4: what to do on failure compiling
AC_DEFUN([TOR_TRY_COMPILE_WITH_CFLAGS], [
AS_VAR_PUSHDEF([VAR],[tor_cv_cflags_$1])
AC_CACHE_CHECK([whether the compiler accepts $1], VAR, [
tor_saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -pedantic -Werror $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[AS_VAR_SET(VAR,yes)],
[AS_VAR_SET(VAR,no)])
if test x$2 != x; then
AS_VAR_PUSHDEF([can_link],[tor_can_link_$1])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[AS_VAR_SET(can_link,yes)],
[AS_VAR_SET(can_link,no)])
AS_VAR_POPDEF([can_link])
fi
CFLAGS="$tor_saved_CFLAGS"
])
if test x$VAR = xyes; then
$3
else
$4
fi
AS_VAR_POPDEF([VAR])
])
dnl 1:flags
dnl 2:also try to link (yes: non-empty string)
dnl will set yes or no in $tor_can_link_$1 (as modified by AS_VAR_PUSHDEF)
AC_DEFUN([TOR_CHECK_CFLAGS], [
TOR_TRY_COMPILE_WITH_CFLAGS($1, $2, CFLAGS="$CFLAGS $1", true)
])
dnl 1:flags
dnl 2:extra ldflags
dnl 3:extra libraries
AC_DEFUN([TOR_CHECK_LDFLAGS], [
AS_VAR_PUSHDEF([VAR],[tor_cv_ldflags_$1])
AC_CACHE_CHECK([whether the linker accepts $1], VAR, [
tor_saved_CFLAGS="$CFLAGS"
tor_saved_LDFLAGS="$LDFLAGS"
tor_saved_LIBS="$LIBS"
CFLAGS="$CFLAGS -pedantic -Werror"
LDFLAGS="$LDFLAGS $2 $1"
LIBS="$LIBS $3"
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [fputs("", stdout)])],
[AS_VAR_SET(VAR,yes)],
[AS_VAR_SET(VAR,no)],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[AS_VAR_SET(VAR,yes)],
[AS_VAR_SET(VAR,no)])])
CFLAGS="$tor_saved_CFLAGS"
LDFLAGS="$tor_saved_LDFLAGS"
LIBS="$tor_saved_LIBS"
])
if test x$VAR = xyes; then
LDFLAGS="$LDFLAGS $1"
fi
AS_VAR_POPDEF([VAR])
])
dnl 1:libname
AC_DEFUN([TOR_WARN_MISSING_LIB], [
h=""
if test x$2 = xdevpkg; then
h=" headers for"
fi
if test -f /etc/debian_version && test x"$tor_$1_$2_debian" != x; then
AC_MSG_WARN([On Debian, you can install$h $1 using "apt-get install $tor_$1_$2_debian"])
if test x"$tor_$1_$2_debian" != x"$tor_$1_devpkg_debian"; then
AC_MSG_WARN([ You will probably need $tor_$1_devpkg_debian too.])
fi
fi
if test -f /etc/fedora-release && test x"$tor_$1_$2_redhat" != x; then
AC_MSG_WARN([On Fedora, you can install$h $1 using "dnf install $tor_$1_$2_redhat"])
if test x"$tor_$1_$2_redhat" != x"$tor_$1_devpkg_redhat"; then
AC_MSG_WARN([ You will probably need to install $tor_$1_devpkg_redhat too.])
fi
else
if test -f /etc/redhat-release && test x"$tor_$1_$2_redhat" != x; then
AC_MSG_WARN([On most Redhat-based systems, you can get$h $1 by installing the $tor_$1_$2_redhat RPM package])
if test x"$tor_$1_$2_redhat" != x"$tor_$1_devpkg_redhat"; then
AC_MSG_WARN([ You will probably need to install $tor_$1_devpkg_redhat too.])
fi
fi
fi
])
dnl Look for a library, and its associated includes, and how to link
dnl against it.
dnl
dnl TOR_SEARCH_LIBRARY(1:libname, 2:IGNORED, 3:linkargs, 4:headers,
dnl 5:prototype,
dnl 6:code, 7:IGNORED, 8:searchextra)
dnl
dnl Special variables:
dnl ALT_{libname}_WITHVAL -- another possible value for --with-$1-dir.
dnl Used to support renaming --with-ssl-dir to --with-openssl-dir
dnl
AC_DEFUN([TOR_SEARCH_LIBRARY], [
try$1dir=""
AC_ARG_WITH($1-dir,
AS_HELP_STRING(--with-$1-dir=PATH, [specify path to $1 installation]),
[
if test x$withval != xno ; then
try$1dir="$withval"
fi
])
if test "x$try$1dir" = x && test "x$ALT_$1_WITHVAL" != x ; then
try$1dir="$ALT_$1_WITHVAL"
fi
tor_saved_LIBS="$LIBS"
tor_saved_LDFLAGS="$LDFLAGS"
tor_saved_CPPFLAGS="$CPPFLAGS"
AC_CACHE_CHECK([for $1 directory], tor_cv_library_$1_dir, [
tor_$1_dir_found=no
tor_$1_any_linkable=no
for tor_trydir in "$try$1dir" "(system)" "$prefix" /usr/local /usr/pkg $8; do
LDFLAGS="$tor_saved_LDFLAGS"
LIBS="$tor_saved_LIBS $3"
CPPFLAGS="$tor_saved_CPPFLAGS"
if test -z "$tor_trydir" ; then
continue;
fi
# Skip the directory if it isn't there.
if test ! -d "$tor_trydir" && test "$tor_trydir" != "(system)"; then
continue;
fi
# If this isn't blank, try adding the directory (or appropriate
# include/libs subdirectories) to the command line.
if test "$tor_trydir" != "(system)"; then
TOR_EXTEND_CODEPATH($tor_trydir)
fi
# Can we link against (but not necessarily run, or find the headers for)
# the binary?
AC_LINK_IFELSE([AC_LANG_PROGRAM([$5], [$6])],
[linkable=yes], [linkable=no])
if test "$linkable" = yes; then
tor_$1_any_linkable=yes
# Okay, we can link against it. Can we find the headers?
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$4], [$6])],
[buildable=yes], [buildable=no])
if test "$buildable" = yes; then
tor_cv_library_$1_dir=$tor_trydir
tor_$1_dir_found=yes
break
fi
fi
done
if test "$tor_$1_dir_found" = no; then
if test "$tor_$1_any_linkable" = no ; then
AC_MSG_WARN([Could not find a linkable $1. If you have it installed somewhere unusual, you can specify an explicit path using --with-$1-dir])
TOR_WARN_MISSING_LIB($1, pkg)
AC_MSG_ERROR([Missing libraries; unable to proceed.])
else
AC_MSG_WARN([We found the libraries for $1, but we could not find the C header files. You may need to install a devel package.])
TOR_WARN_MISSING_LIB($1, devpkg)
AC_MSG_ERROR([Missing headers; unable to proceed.])
fi
fi
LDFLAGS="$tor_saved_LDFLAGS"
LIBS="$tor_saved_LIBS"
CPPFLAGS="$tor_saved_CPPFLAGS"
]) dnl end cache check
LIBS="$LIBS $3"
if test "$tor_cv_library_$1_dir" != "(system)"; then
TOR_EXTEND_CODEPATH($tor_cv_library_$1_dir)
fi
TOR_DEFINE_CODEPATH($tor_cv_library_$1_dir, $1)
if test "$cross_compiling" != yes; then
AC_CACHE_CHECK([whether we need extra options to link $1],
tor_cv_library_$1_linker_option, [
orig_LDFLAGS="$LDFLAGS"
runs=no
linked_with=nothing
if test -d "$tor_cv_library_$1_dir/lib"; then
tor_trydir="$tor_cv_library_$1_dir/lib"
else
tor_trydir="$tor_cv_library_$1_dir"
fi
for tor_tryextra in "(none)" "-Wl,-R$tor_trydir" "-R$tor_trydir" \
"-Wl,-rpath,$tor_trydir" ; do
if test "$tor_tryextra" = "(none)"; then
LDFLAGS="$orig_LDFLAGS"
else
LDFLAGS="$tor_tryextra $orig_LDFLAGS"
fi
AC_RUN_IFELSE([AC_LANG_PROGRAM([$5], [$6])],
[runnable=yes], [runnable=no],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[runnable=yes],
[runnable=no])])
if test "$runnable" = yes; then
tor_cv_library_$1_linker_option=$tor_tryextra
break
fi
done
if test "$runnable" = no; then
AC_MSG_ERROR([Found linkable $1 in $tor_cv_library_$1_dir, but it does not seem to run, even with -R. Maybe specify another using --with-$1-dir}])
fi
LDFLAGS="$orig_LDFLAGS"
]) dnl end cache check check for extra options.
if test "$tor_cv_library_$1_linker_option" != "(none)" ; then
TOR_LDFLAGS_$1="$TOR_LDFLAGS_$1 $tor_cv_library_$1_linker_option"
fi
fi # cross-compile
LIBS="$tor_saved_LIBS"
LDFLAGS="$tor_saved_LDFLAGS"
CPPFLAGS="$tor_saved_CPPFLAGS"
]) dnl end defun
dnl Check whether the prototype for a function is present or missing.
dnl Apple has a nasty habit of putting functions in their libraries (so that
dnl AC_CHECK_FUNCS passes) but not actually declaring them in the headers.
dnl
dnl TOR_CHECK_PROTYPE(1:functionname, 2:macroname, 2: includes)
AC_DEFUN([TOR_CHECK_PROTOTYPE], [
AC_CACHE_CHECK([for declaration of $1], tor_cv_$1_declared, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$3],[void *ptr= $1 ;])],
tor_cv_$1_declared=yes,tor_cv_$1_declared=no)])
if test x$tor_cv_$1_declared != xno ; then
AC_DEFINE($2, 1,
[Defined if the prototype for $1 seems to be present.])
fi
])

View File

@ -1,23 +1,7 @@
#!/bin/sh
if [ -x "`which autoreconf 2>/dev/null`" ] ; then
opt="-i -f -W all,error"
for i in $@; do
case "$i" in
-v)
opt="${opt} -v"
;;
esac
done
exec autoreconf $opt
fi
set -e
# Run this to generate all the initial makefiles, etc.
aclocal -I m4 && \
aclocal && \
autoheader && \
autoconf && \
automake --add-missing --copy
automake --add-missing --copy && \
if test x$NOCONF = x ; then ./configure; fi

View File

@ -1,37 +0,0 @@
This file is here to keep git from removing the changes directory when
all the changes files have been merged.
"I'm Nobody! Who are you?
Are you--Nobody--too?
Then there's a pair of us!
Dont tell! they'd advertise--you know!
How dreary--to be--Somebody!
How public--like a Frog--
To tell one's name--the livelong June--
To an admiring Bog!"
-- Emily Dickinson

View File

@ -1,6 +0,0 @@
o Major bugfixes (security, directory authority, denial-of-service):
- Fix a bug that could have allowed an attacker to force a
directory authority to use up all its RAM by passing it a
maliciously crafted protocol versions string. Fixes bug 25517;
bugfix on 0.2.9.4-alpha. This issue is also tracked as
TROVE-2018-005.

View File

@ -1,3 +0,0 @@
o Minor bugfixes (onion services):
- Fix a bug that blocked the creation of ephemeral v3 onion services. Fixes
bug 25939; bugfix on 0.3.4.1-alpha.

View File

@ -1,5 +0,0 @@
o Minor bugfixes (test coverage tools):
- Update our "cov-diff" script to handle output from the latest
version of gcov, and to remove extraneous timestamp information
from its output. Fixes bugs 26101 and 26102; bugfix on
0.2.5.1-alpha.

View File

@ -1,7 +0,0 @@
o Minor bugfixes (compatibility, openssl):
- Work around a change in OpenSSL 1.1.1 where
return values that would previously indicate "no password" now
indicate an empty password. Without this workaround, Tor instances
running with OpenSSL 1.1.1 would accept descriptors that other Tor
instances would reject. Fixes bug 26116; bugfix on 0.2.5.16.

View File

@ -1,6 +0,0 @@
o Minor bugfixes (controller):
- Improve accuracy of the BUILDTIMEOUT_SET control port event's
TIMEOUT_RATE and CLOSE_RATE fields. (We were previously miscounting
the total number of circuits for these field values.) Fixes bug
26121; bugfix on 0.3.3.1-alpha.

View File

@ -1,3 +0,0 @@
o Minor bugfixes (compilation):
- Fix compilation when building with OpenSSL 1.1.0 with the
"no-deprecated" flag enabled. Fixes bug 26156; bugfix on 0.3.4.1-alpha.

View File

@ -1,4 +0,0 @@
o Minor bugfixes (hardening):
- Prevent a possible out-of-bounds smartlist read in
protover_compute_vote(). Fixes bug 26196; bugfix on
0.2.9.4-alpha.

View File

@ -1,4 +0,0 @@
o Minor bugfixes (control port):
- Do not count 0-length RELAY_COMMAND_DATA cells as valid data in CIRC_BW
events. Previously, such cells were counted entirely in the OVERHEAD
field. Now they are not. Fixes bug 26259; bugfix on 0.3.4.1-alpha.

View File

@ -1,4 +0,0 @@
o Documentation:
- In code comment, point the reader to the exact section
in Tor specification that specifies circuit close error
code values. Resolves ticket 25237.

View File

@ -1,4 +0,0 @@
o Minor features (continuous integration):
- Add the necessary configuration files for continuous integration
testing on Windows, via the Appveyor platform. Closes ticket 25549.
Patches from Marcin Cieślak and Isis Lovecruft.

File diff suppressed because it is too large Load Diff

896
configure.in Normal file
View File

@ -0,0 +1,896 @@
dnl $Id$
dnl Copyright (c) 2001-2004, Roger Dingledine
dnl Copyright (c) 2004-2007, Roger Dingledine, Nick Mathewson
dnl See LICENSE for licensing information
AC_INIT
AM_INIT_AUTOMAKE(tor, 0.1.2.19-dev)
AM_CONFIG_HEADER(orconfig.h)
AC_CANONICAL_HOST
if test -f /etc/redhat-release; then
CFLAGS="$CFLAGS -I/usr/kerberos/include"
fi
AC_ARG_ENABLE(debug,
AC_HELP_STRING(--enable-debug, compile with debugging info),
[if test x$enableval = xyes; then
CFLAGS="$CFLAGS -g"
fi])
AC_ARG_ENABLE(eventdns,
AC_HELP_STRING(--enable-eventdns, enable asynchronous dns module),
[case "${enableval}" in
yes) eventdns=true ;;
no) eventdns=false ;;
*) AC_MSG_ERROR(bad value for --enable-eventdns) ;;
esac], [eventdns=true])
AM_CONDITIONAL(EVENTDNS, test x$eventdns = xtrue)
if test x$eventdns = xtrue; then
AC_DEFINE([USE_EVENTDNS], 1, "Define to 1 if we'll be using eventdns.c")
fi
AC_ARG_ENABLE(transparent,
AC_HELP_STRING(--disable-transparent, disable transparent proxy support),
[case "${enableval}" in
yes) transparent=true ;;
no) transparent=false ;;
*) AC_MSG_ERROR(bad value for --enable-transparent) ;;
esac], [transparent=true])
AC_ARG_ENABLE(threads,
AC_HELP_STRING(--disable-threads, disable multi-threading support))
if test x$enable_threads = x; then
case $host in
*-*-netbsd* | *-*-openbsd* )
# Don't try multithreading on netbsd -- there is no threadsafe DNS
# lookup function there.
if test x$eventdns != xtrue; then
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"
else
# This was an inadvertant default up through 0.1.2.14; in 0.2.0.x,
# it's getting some testing, but for now, best leave threads off
# unless the user urns them on.
AC_MSG_NOTICE([You are running OpenBSD or NetBSD; Tor 0.1.2.x hasn't
been tested with threads on these platforms, so I'm turning them off. You
can enable threads by passing --enable-threads to the configure script.])
enable_threads="no"
fi ;;
*-*-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
fi
if test $enable_threads = "yes"; then
AC_DEFINE(ENABLE_THREADS, 1, [Defined if we will try to use multithreading])
fi
case $host in
*-*-solaris* )
AC_DEFINE(_REENTRANT, 1, [Define on some platforms to activate x_r() functions in time.h])
;;
esac
AC_ARG_ENABLE(gcc-warnings,
AC_HELP_STRING(--enable-gcc-warnings, enable verbose warnings))
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# The big search for OpenSSL
# copied from openssh's configure.ac
tryssldir=""
AC_ARG_WITH(ssl-dir,
[ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
[
if test "x$withval" != "xno" ; then
tryssldir=$withval
fi
]
)
trylibeventdir=""
AC_ARG_WITH(libevent-dir,
[ --with-libevent-dir=PATH Specify path to Libevent installation ],
[
if test "x$withval" != "xno" ; then
trylibeventdir=$withval
fi
]
)
TORUSER=_tor
AC_ARG_WITH(tor-user,
[ --with-tor-user=NAME Specify username for tor daemon ],
[
TORUSER=$withval
]
)
AC_SUBST(TORUSER)
TORGROUP=_tor
AC_ARG_WITH(tor-group,
[ --with-tor-group=NAME Specify group name for tor daemon ],
[
TORGROUP=$withval
]
)
AC_SUBST(TORGROUP)
dnl If WIN32 is defined and non-zero, we are building for win32
AC_MSG_CHECKING([for win32])
AC_RUN_IFELSE([
int main(int c, char **v) {
#ifdef WIN32
#if WIN32
return 0;
#else
return 1;
#endif
#else
return 2;
#endif
}],
bwin32=true; AC_MSG_RESULT([yes]),
bwin32=false; AC_MSG_RESULT([no]),
bwin32=cross; AC_MSG_RESULT([cross])
)
if test $bwin32 = cross; then
AC_MSG_CHECKING([for win32 (cross)])
AC_COMPILE_IFELSE([
#ifdef WIN32
int main(int c, char **v) {return 0;}
#else
#error
int main(int c, char **v) {return x(y);}
#endif
],
bwin32=true; AC_MSG_RESULT([yes]),
bwin32=false; AC_MSG_RESULT([no]))
fi
if test $bwin32 = true; then
AC_DEFINE(MS_WINDOWS, 1, [Define to 1 if we are building for Windows.])
fi
dnl Enable C99 when compiling with MIPSpro
AC_MSG_CHECKING([for MIPSpro compiler])
AC_TRY_COMPILE([], [
#if (defined(__sgi) && defined(_COMPILER_VERSION))
#error
return x(y);
#endif
],
bmipspro=false; AC_MSG_RESULT([no]),
bmipspro=true; AC_MSG_RESULT([yes]))
if test $bmipspro = true; then
CFLAGS="$CFLAGS -c99"
fi
AC_SEARCH_LIBS(socket, [socket])
AC_SEARCH_LIBS(gethostbyname, [nsl])
AC_SEARCH_LIBS(dlopen, [dl])
AC_SEARCH_LIBS(inet_aton, [resolv])
if test $enable_threads = "yes"; then
AC_SEARCH_LIBS(pthread_create, [pthread])
AC_SEARCH_LIBS(pthread_detach, [pthread])
fi
dnl -------------------------------------------------------------------
dnl Check for functions before libevent, since libevent-1.2 apparently
dnl exports strlcpy without defining it in a header.
AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit strlcat strlcpy strtoull ftello getaddrinfo localtime_r gmtime_r memmem strtok_r)
if test $enable_threads = "yes"; then
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_FUNCS(pthread_create)
fi
dnl ------------------------------------------------------
dnl Where do you live, libevent? And how do we call you?
dnl This needs to happen before the below disgusting hack.
AC_CHECK_HEADERS(sys/types.h)
dnl This is a disgusting hack so we safely include older libevent headers.
AC_CHECK_TYPE(u_int64_t, unsigned long long)
AC_CHECK_TYPE(u_int32_t, unsigned long)
AC_CHECK_TYPE(u_int16_t, unsigned short)
AC_CHECK_TYPE(u_int8_t, unsigned char)
AC_CACHE_CHECK([for libevent directory], tor_cv_libevent_dir, [
saved_LIBS="$LIBS"
saved_LDFLAGS="$LDFLAGS"
saved_CPPFLAGS="$CPPFLAGS"
le_found=no
for ledir in $trylibeventdir "" $prefix /usr/local /usr/pkg ; do
LDFLAGS="$saved_LDFLAGS"
if test $bwin32 = true; then
LIBS="$saved_LIBS -levent -lws2_32"
else
LIBS="$saved_LIBS -levent"
fi
# Skip the directory if it isn't there.
if test ! -z "$ledir" -a ! -d "$ledir" ; then
continue;
fi
if test ! -z "$ledir" ; then
if test -d "$ledir/lib" ; then
LDFLAGS="-L$ledir/lib $LDFLAGS"
else
LDFLAGS="-L$ledir $LDFLAGS"
fi
if test -d "$ledir/include" ; then
CPPFLAGS="-I$ledir/include $CPPFLAGS"
else
CPPFLAGS="-I$ledir $CPPFLAGS"
fi
fi
# Can I compile and link it?
AC_TRY_LINK([#include <sys/time.h>
#include <sys/types.h>
#include <event.h>], [ event_init(); ],
[ libevent_linked=yes ], [ libevent_linked=no ])
if test $libevent_linked = yes; then
if test ! -z "$ledir" ; then
tor_cv_libevent_dir=$ledir
else
tor_cv_libevent_dir="(system)"
fi
le_found=yes
break
fi
done
LIBS="$saved_LIBS"
LDFLAGS="$saved_LDFLAGS"
CPPFLAGS="$saved_CPPFLAGS"
if test $le_found = no ; then
AC_MSG_ERROR([Could not find a linkable libevent. You can specify an explicit path using --with-libevent-dir])
fi
])
if test $bwin32 = true; then
LIBS="$LIBS -levent -lws2_32"
else
LIBS="$LIBS -levent"
fi
if test "$tor_cv_libevent_dir" != "(system)"; then
if test -d "$tor_cv_libevent_dir/lib" ; then
LDFLAGS="-L$tor_cv_libevent_dir/lib $LDFLAGS"
le_libdir="$tor_cv_libevent_dir/lib"
else
LDFLAGS="-L$tor_cv_libevent_dir $LDFLAGS"
le_libdir="$tor_cv_libevent_dir"
fi
if test -d "$tor_cv_libevent_dir/include" ; then
CPPFLAGS="-I$tor_cv_libevent_dir/include $CPPFLAGS"
else
CPPFLAGS="-I$tor_cv_libevent_dir $CPPFLAGS"
fi
fi
if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether we need extra options to link libevent],
tor_cv_libevent_linker_option, [
saved_LDFLAGS="$LDFLAGS"
le_runs=no
linked_with=nothing
for le_extra in "" "-Wl,-R$le_libdir" "-R$le_libdir" "-Wl,-rpath,$le_libdir" ; do
LDFLAGS="$le_extra $saved_LDFLAGS"
AC_TRY_RUN([void *event_init(void);
int main(int c, char **v) {
event_init(); return 0;
}],
libevent_runs=yes, libevent_runs=no, libevent_runs=cross)
if test $libevent_runs != no ; then
if test -z "$le_extra" ; then
tor_cv_libevent_linker_option='(none)'
else
tor_cv_libevent_linker_option=$le_extra
fi
le_runs=yes
break
fi
done
if test $le_runs = no ; then
AC_MSG_ERROR([Found linkable libevent in $tor_cv_libevent_dir, but it doesn't run, even with -R. Maybe specify another using --with-libevent-dir?])
fi
LDFLAGS="$saved_LDFLAGS"
])
if test $tor_cv_libevent_linker_option != '(none)' ; then
LDFLAGS="$tor_cv_libevent_linker_option $LDFLAGS"
fi
fi
dnl Now check for particular libevent functions.
AC_CHECK_FUNCS(event_get_version event_get_method event_set_log_callback)
dnl ------------------------------------------------------
dnl Where do you live, openssl? And how do we call you?
AC_CACHE_CHECK([for OpenSSL directory], tor_cv_openssl_dir, [
saved_LIBS="$LIBS"
saved_LDFLAGS="$LDFLAGS"
saved_CPPFLAGS="$CPPFLAGS"
ssl_found=no
for ssldir in $tryssldir "" $prefix /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/athena /usr/pkg /opt /opt/openssl ; do
LDFLAGS="$saved_LDFLAGS"
if test $bwin32 = true; then
LIBS="$saved_LIBS -lssl -lcrypto -lws2_32 -lgdi32"
else
LIBS="$saved_LIBS -lssl -lcrypto"
fi
# Skip the directory if it isn't there.
if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
continue;
fi
if test ! -z "$ssldir" ; then
if test -d "$ssldir/lib" ; then
LDFLAGS="-L$ssldir/lib $LDFLAGS"
else
LDFLAGS="-L$ssldir $LDFLAGS"
fi
if test -d "$ssldir/include" ; then
CPPFLAGS="-I$ssldir/include $CPPFLAGS"
else
CPPFLAGS="-I$ssldir $CPPFLAGS"
fi
fi
# Can I link it?
AC_TRY_LINK([#include <openssl/rand.h>],
[ RAND_add((void*)0,0,0); ],
[ openssl_linked=yes ], [ openssl_linked=no ])
if test $openssl_linked = yes; then
if test ! -z "$ssldir" ; then
tor_cv_openssl_dir=$ssldir
else
tor_cv_openssl_dir="(system)"
fi
ssl_found=yes
break
fi
done
LIBS="$saved_LIBS"
LDFLAGS="$saved_LDFLAGS"
CPPFLAGS="$saved_CPPFLAGS"
if test $ssl_found = no ; then
AC_MSG_ERROR([Could not find a linkable OpenSSL. You can specify an explicit path using --with-ssl-dir])
fi
])
if test $bwin32 = true; then
LIBS="$LIBS -lssl -lcrypto -lws2_32 -lgdi32"
else
LIBS="$LIBS -lssl -lcrypto"
fi
if test "$tor_cv_openssl_dir" != "(system)"; then
if test -d "$tor_cv_openssl_dir/lib" ; then
LDFLAGS="-L$tor_cv_openssl_dir/lib $LDFLAGS"
ssl_libdir="$tor_cv_openssl_dir/lib"
else
LDFLAGS="-L$tor_cv_openssl_dir $LDFLAGS"
ssl_libdir="$tor_cv_openssl_dir"
fi
if test -d "$tor_cv_openssl_dir/include" ; then
CPPFLAGS="-I$tor_cv_openssl_dir/include $CPPFLAGS"
else
CPPFLAGS="-I$tor_cv_openssl_dir $CPPFLAGS"
fi
fi
if test -z "$CROSS_COMPILE"
then
AC_CACHE_CHECK([whether we need extra options to link OpenSSL],
tor_cv_openssl_linker_option, [
saved_LDFLAGS="$LDFLAGS"
ssl_runs=no
linked_with=nothing
for ssl_extra in "" "-Wl,-R$ssl_libdir" "-R$ssl_libdir" ; do
LDFLAGS="$ssl_extra $saved_LDFLAGS"
AC_TRY_RUN([
#include <string.h>
#include <openssl/rand.h>
int main(void)
{
char a[2048];
memset(a, 0, sizeof(a));
RAND_add(a, sizeof(a), sizeof(a));
return(RAND_status() <= 0);
}
],
openssl_runs=yes, openssl_runs=no, openssl_runs=cross)
if test $openssl_runs != no ; then
if test "$linked_with" = nothing; then
linked_with="$ssl_extra"
fi
AC_TRY_RUN([
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
int main(void) {
return (OPENSSL_VERSION_NUMBER == SSLeay()) == 0;
}],
right_version=yes, right_version=no)
if test "$right_version" = yes; then
if test -z "$ssl_extra" ; then
tor_cv_openssl_linker_option='(none)'
else
tor_cv_openssl_linker_option=$ssl_extra
fi
ssl_runs=yes
break
fi
fi
done
if test $ssl_runs = no ; then
if test "$linked_with" = 'nothing' ; then
AC_MSG_ERROR([Found linkable OpenSSL in $tor_cv_openssl_dir, but it doesn't run, even with -R. Maybe specify another using --with-ssl-dir?])
else
if test -z "$linked_with" ; then
tor_cv_openssl_linker_option='(none)'
else
tor_cv_openssl_linker_option=$linked_with
fi
AC_MSG_WARN([I managed to make OpenSSL link and run, but I couldn't make it link against the same version I found header files for.])
fi
fi
LDFLAGS="$saved_LDFLAGS"
])
if test "$tor_cv_openssl_linker_option" != '(none)' ; then
LDFLAGS="$tor_cv_openssl_linker_option $LDFLAGS"
fi
fi
dnl Make sure to enable support for large off_t if avalable.
AC_SYS_LARGEFILE
dnl The warning message here is no longer strictly accurate.
AC_CHECK_HEADERS(unistd.h string.h signal.h ctype.h sys/stat.h fcntl.h sys/fcntl.h sys/time.h errno.h assert.h time.h, , AC_MSG_WARN(some headers were not found, compilation may fail))
AC_CHECK_HEADERS(netdb.h sys/ioctl.h sys/socket.h arpa/inet.h netinet/in.h pwd.h grp.h)
AC_CHECK_HEADERS(event.h, , AC_MSG_ERROR(Libevent header (event.h) not found. Tor requires libevent to build.),
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
struct timeval {
long tv_sec;
long tv_usec;
};
#endif])
AC_CHECK_HEADERS(zlib.h, , AC_MSG_ERROR(Zlib header (zlib.h) not found. Tor requires zlib to build. You may need to install a zlib development package.))
dnl These headers are not essential
AC_CHECK_HEADERS(stdint.h sys/types.h inttypes.h sys/param.h sys/wait.h limits.h sys/limits.h netinet/in.h arpa/inet.h machine/limits.h syslog.h sys/time.h sys/resource.h inttypes.h utime.h sys/utime.h sys/mman.h netintet/in.h netinet/in6.h sys/syslimits.h)
AC_CHECK_HEADERS(net/if.h, [net_if_found=1], [net_if_found=0],
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif])
AC_CHECK_HEADERS(net/pfvar.h, [net_pfvar_found=1], [net_pfvar_found=0],
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif])
AC_CHECK_HEADERS(linux/netfilter_ipv4.h,
[linux_netfilter_ipv4=1], [linux_netfilter_ipv4=0],
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif])
if test x$transparent = xtrue ; then
transparent_ok=0
if test x$net_if_found = x1 -a x$net_pfvar_found = x1 ; then
transparent_ok=1
fi
if test x$linux_netfilter_ipv4 = x1 ; then
transparent_ok=1
fi
if test x$transparent_ok = x1 ; then
AC_DEFINE(USE_TRANSPARENT, 1, "Define to enable transparent proxy support")
case $host in
*-*-openbsd*)
AC_DEFINE(OPENBSD, 1, "Define to handle pf on OpenBSD properly") ;;
esac
else
AC_MSG_NOTICE([Transparent proxy support enabled, but missing headers.])
fi
fi
AC_FUNC_FSEEKO
AC_CHECK_MEMBERS([struct timeval.tv_sec], , ,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif])
dnl In case we aren't given a working stdint.h, we'll need to grow our own.
dnl Watch out.
AC_CHECK_SIZEOF(int8_t)
AC_CHECK_SIZEOF(int16_t)
AC_CHECK_SIZEOF(int32_t)
AC_CHECK_SIZEOF(int64_t)
AC_CHECK_SIZEOF(uint8_t)
AC_CHECK_SIZEOF(uint16_t)
AC_CHECK_SIZEOF(uint32_t)
AC_CHECK_SIZEOF(uint64_t)
AC_CHECK_SIZEOF(intptr_t)
AC_CHECK_SIZEOF(uintptr_t)
dnl AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, intptr_t, uintptr_t])
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(__int64)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(time_t)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_TYPES([uint, u_char])
AC_CHECK_TYPES([struct in6_addr, struct sockaddr_storage], , ,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif])
AC_CHECK_TYPES([rlim_t], , ,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
])
if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether time_t is signed], tor_cv_time_t_signed, [
AC_TRY_RUN([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
int main(int c, char**v) { if (((time_t)-1)<0) return 1; else return 0; }],
tor_cv_time_t_signed=no, tor_cv_time_t_signed=yes)
])
else
# Cross-compiling; let's hope the target platform isn't loony.
AC_MSG_NOTICE([Cross compiling: assuming that time_t is signed.])
tor_cv_time_t_signed=yes
fi
if test $tor_cv_time_t_signed = yes; then
AC_DEFINE([TIME_T_IS_SIGNED], 1,
[Define to 1 iff time_t is signed])
fi
AC_CHECK_SIZEOF(socklen_t, , [AC_INCLUDES_DEFAULT()
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])
# We want to make sure that we _don't_ have a cell_t defined, like IRIX does.
AC_CHECK_SIZEOF(cell_t)
# Now make sure that NULL can be represented as zero bytes.
if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether memset(0) sets pointers to NULL], tor_cv_null_is_zero,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif
int main () { char *p1,*p2; p1=NULL; memset(&p2,0,sizeof(p2));
return memcmp(&p1,&p2,sizeof(char*))?1:0; }]])],
[tor_cv_null_is_zero=yes],
[tor_cv_null_is_zero=no],
[tor_cv_null_is_zero=cross])])
else
# Cross-compiling; let's hope that the target isn't raving mad.
AC_MSG_NOTICE([Cross-compiling: we'll assume that NULL is represented as a sequence of 0-valued bytes.])
tor_cv_null_is_zero=yes
fi
if test $tor_cv_null_is_zero = yes; then
AC_DEFINE([NULL_REP_IS_ZERO_BYTES], 1,
[Define to 1 iff memset(0) sets pointers to NULL])
fi
# And what happens when we malloc zero?
if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether we can malloc(0) safely.], tor_cv_malloc_zero_works,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif
int main () { return malloc(0)?0:1; }]])],
[tor_cv_malloc_zero_works=yes],
[tor_cv_malloc_zero_works=no],
[tor_cv_malloc_zero_works=cross])])
else
# Cross-compiling; let's hope that the target isn't raving mad.
AC_MSG_NOTICE([Cross-compiling: we'll assume that we need to check malloc() arguments for 0.])
tor_cv_malloc_zero_works=no
fi
if test $tor_cv_malloc_zero_works = yes; then
AC_DEFINE([MALLOC_ZERO_WORKS], 1,
[Define to 1 iff malloc(0) returns a pointer])
fi
# whether we seem to be in a 2s-complement world.
if test -z "$CROSS_COMPILE"; then
AC_CACHE_CHECK([whether we are using 2s-complement arithmetic], tor_cv_twos_complement,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[int main () { int problem = ((-99) != (~99)+1);
return problem ? 1 : 0; }]])],
[tor_cv_twos_complement=yes],
[tor_cv_twos_complement=no],
[tor_cv_twos_complement=cross])])
else
# Cross-compiling; let's hope that the target isn't raving mad.
AC_MSG_NOTICE([Cross-compiling: we'll assume that negative integers are represented with two's complement.])
tor_cv_twos_complement=yes
fi
if test $tor_cv_twos_complement = yes; then
AC_DEFINE([USING_TWOS_COMPLEMENT], 1,
[Define to 1 iff we represent negative integers with two's complement])
fi
# Whether we should use the dmalloc memory allocation debugging library.
AC_MSG_CHECKING(whether to use dmalloc (debug memory allocation library))
AC_ARG_WITH(dmalloc,
[ --with-dmalloc Use debug memory allocation library. ],
[if [[ "$withval" = "yes" ]]; then
dmalloc=1
AC_MSG_RESULT(yes)
else
dmalloc=1
AC_MSG_RESULT(no)
fi], [ dmalloc=0; AC_MSG_RESULT(no) ]
)
if [[ $dmalloc -eq 1 ]]; then
AC_CHECK_HEADERS(dmalloc.h, , AC_MSG_ERROR(dmalloc header file not found. Do you have the development files for dmalloc installed?))
AC_SEARCH_LIBS(dmalloc_malloc, [dmallocth dmalloc], , AC_MSG_ERROR(Libdmalloc library not found. If you enable it you better have it installed.))
AC_DEFINE(USE_DMALLOC, 1, [Debug memory allocation library])
AC_DEFINE(DMALLOC_FUNC_CHECK, 1, [Enable dmalloc's malloc function check])
fi
# Allow user to specify an alternate syslog facility
AC_ARG_WITH(syslog-facility,
[ --with-syslog-facility=LOG syslog facility to use (default=LOG_DAEMON)],
syslog_facility="$withval", syslog_facility="LOG_DAEMON")
AC_DEFINE_UNQUOTED(LOGFACILITY,$syslog_facility,[name of the syslog facility])
AC_SUBST(LOGFACILITY)
# Check for gethostbyname_r in all its glorious incompatible versions.
# (This logic is based on that in Python's configure.in)
AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
[Define this if you have any gethostbyname_r()])
AC_CHECK_FUNC(gethostbyname_r, [
AC_MSG_CHECKING([how many arguments gethostbyname_r() wants])
OLD_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
AC_TRY_COMPILE([
#include <netdb.h>
], [
char *cp1, *cp2;
struct hostent *h1, *h2;
int i1, i2;
(void)gethostbyname_r(cp1,h1,cp2,i1,&h2,&i2);
], [
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
[Define this if gethostbyname_r takes 6 arguments])
AC_MSG_RESULT(6)
], [
AC_TRY_COMPILE([
#include <netdb.h>
], [
char *cp1, *cp2;
struct hostent *h1;
int i1, i2;
(void)gethostbyname_r(cp1,h1,cp2,i1,&i2);
], [
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
[Define this if gethostbyname_r takes 5 arguments])
AC_MSG_RESULT(5)
], [
AC_TRY_COMPILE([
#include <netdb.h>
], [
char *cp1;
struct hostent *h1;
struct hostent_data hd;
(void) gethostbyname_r(cp1,h1,&hd);
], [
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
[Define this if gethostbyname_r takes 3 arguments])
AC_MSG_RESULT(3)
], [
AC_MSG_RESULT(0)
])
])
])
CFLAGS=$OLD_CFLAGS
])
AC_CACHE_CHECK([whether the C compiler supports __func__],
tor_cv_have_func_macro,
AC_COMPILE_IFELSE([
#include <stdio.h>
int main(int c, char **v) { puts(__func__); }],
tor_cv_have_func_macro=yes,
tor_cv_have_func_macro=no))
AC_CACHE_CHECK([whether the C compiler supports __FUNC__],
tor_cv_have_FUNC_macro,
AC_COMPILE_IFELSE([
#include <stdio.h>
int main(int c, char **v) { puts(__FUNC__); }],
tor_cv_have_FUNC_macro=yes,
tor_cv_have_FUNC_macro=no))
AC_CACHE_CHECK([whether the C compiler supports __FUNCTION__],
tor_cv_have_FUNCTION_macro,
AC_COMPILE_IFELSE([
#include <stdio.h>
int main(int c, char **v) { puts(__FUNCTION__); }],
tor_cv_have_FUNCTION_macro=yes,
tor_cv_have_FUNCTION_macro=no))
if test $tor_cv_have_func_macro = 'yes'; then
AC_DEFINE(HAVE_MACRO__func__, 1, [Defined if the compiler supports __func__])
fi
if test $tor_cv_have_FUNC_macro = 'yes'; then
AC_DEFINE(HAVE_MACRO__FUNC__, 1, [Defined if the compiler supports __FUNC__])
fi
if test $tor_cv_have_FUNCTION_macro = 'yes'; then
AC_DEFINE(HAVE_MACRO__FUNCTION__, 1,
[Defined if the compiler supports __FUNCTION__])
fi
# $prefix stores the value of the --prefix command line option, or
# NONE if the option wasn't set. In the case that it wasn't set, make
# it be the default, so that we can use it to expand directories now.
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
fi
# and similarly for $exec_prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
if test "x$CONFDIR" = "x"; then
CONFDIR=`eval echo $sysconfdir/tor`
fi
AC_SUBST(CONFDIR)
AH_TEMPLATE([CONFDIR],[tor's configuration directory])
AC_DEFINE_UNQUOTED(CONFDIR,"$CONFDIR")
BINDIR=`eval echo $bindir`
AC_SUBST(BINDIR)
LOCALSTATEDIR=`eval echo $localstatedir`
AC_SUBST(LOCALSTATEDIR)
AH_TEMPLATE([LOCALSTATEDIR], [Default location to store state files.])
AC_DEFINE_UNQUOTED(LOCALSTATEDIR,"$LOCALSTATEDIR")
# Set CFLAGS _after_ all the above checks, since our warnings are stricter
# than autoconf's macros like.
if test $ac_cv_c_compiler_gnu = yes; then
CFLAGS="$CFLAGS -Wall -g -O2"
else
CFLAGS="$CFLAGS -g -O"
enable_gcc_warnings=no
fi
# Add some more warnings which we use in the cvs version but not in the
# released versions. (Some relevant gcc versions can't handle these.)
if test x$enable_gcc_warnings = xyes; then
AC_TRY_COMPILE([], [
#if !defined(__GNUC__) || (__GNUC__ < 4)
#error
#endif], have_gcc4=yes, have_gcc4=no)
CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum -Werror"
if test x$have_gcc4 = xyes ; then
# These warnings break gcc 3.3.5 and work on gcc 4.0.2
CFLAGS="$CFLAGS -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement -Wold-style-definition"
fi
##This will break the world on some 64-bit architectures
# CFLAGS="$CFLAGS -Winline"
fi
AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/tor.logrotate 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 doc/spec/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile contrib/suse/Makefile contrib/suse/tor.sh)
if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then
./contrib/updateVersions.pl
fi

148
contrib/ExerciseServer.py Normal file
View File

@ -0,0 +1,148 @@
#!/usr/bin/python
import TorControl
import threading
import socket
import struct
import random
SOCKS_PORT=9050
CONTROL_PORT=9051
def runSocks4A(nonce, targetHost, targetPort, targetURL):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", SOCKS_PORT))
socksheader = struct.pack("!BBHL", 4, 0x01, targetPort, 1)
username = ""
socksheader = "%s%s\x00%s\x00" %(socksheader, username, nonce)
s.send(socksheader)
response = s.recv(8)
version,status,port=struct.unpack("!BBH",response[:4])
if status != 90:
print "Error: non-successful SOCKS status"
s.close()
return 0
s.send("GET %s HTTP/1.0\r\nHost: %s\r\n\r\n"%(targetURL,targetHost))
while 1:
r = s.recv(1024)
if not r:
print "WOOT! Got a web page."
s.close()
return 1
HOSTS_TO_TEST = [ "serifos", "chaoscomputerclub", "NetWorkXXIII", "caethaver2",
"theoryorg", "samaire", "alrua", "ihopethisisunique",
"xolotl", "cacophony", "ghettocluster", "torserverzillion",
"ned", "richhomednsorg", "subzeronet"]
EXITS_TO_TEST = [ "pvt", ]
HOSTS_THAT_WORK = [ "serifos", "rodos", "moria2", "chaoscomputerclub"]
EXITS_THAT_WORK = [ "serifos", "rodos"]
TARGETS = [ ("belegost.mit.edu", "/"),
("seul.org", "/")]
N_CIRCS_TO_TRY = 5*len(HOSTS_TO_TEST)
CIRCS_AT_A_TIME = 3
CIRC_LEN = 3
HOST_STATUS = {}
N_CIRCS_DONE = 0
def launchCirc(s):
htw = HOSTS_THAT_WORK[:]
random.shuffle(htw)
path = htw[:CIRC_LEN-2] + \
[random.choice(HOSTS_TO_TEST)] + \
[random.choice(EXITS_THAT_WORK)]
circid = TorControl.extend_circuit(s, 0, path)
for name in path:
lst = HOST_STATUS.setdefault(name,[0,0])
lst[0] += 1
return circid, path
def runControl(s):
circs = {}
s1,s2 = {},{}
_h = lambda body,circs=circs,s1=s1,s2=s2,s=s:handleEvent(s,body,
circs,s1,s2)
TorControl._event_handler = _h
TorControl.set_events(s,
[TorControl.EVENT_TYPE.CIRCSTATUS,
TorControl.EVENT_TYPE.STREAMSTATUS])
TorControl.set_option(s,"__LeaveStreamsUnattached 1")
global N_CIRCS_DONE
while N_CIRCS_DONE < N_CIRCS_TO_TRY:
while len(circs) < CIRCS_AT_A_TIME:
c,p = launchCirc(s)
print "launching circuit %s to %s"%(c,p)
circs[c]=p
_, tp, body = TorControl.receive_message(s)
if tp == TorControl.MSG_TYPE.EVENT:
handleEvent(s, body, circs, s1,s2)
i = HOST_STATUS.items()
i.sort()
for n,(all,good) in i:
print "%s in %s circuits; %s/%s ok"%(n,all,good,all)
def handleEvent(s, body, circs, streamsByNonce, streamsByIdent):
global N_CIRCS_DONE
event, args = TorControl.unpack_event(body)
if event == TorControl.EVENT_TYPE.STREAMSTATUS:
status, ident, target = args
print "Got stream event:",TorControl.STREAM_STATUS.nameOf[status],\
ident,target
if status in (TorControl.STREAM_STATUS.NEW_CONNECT,
TorControl.STREAM_STATUS.NEW_RESOLVE,
TorControl.STREAM_STATUS.DETACHED):
target,port=target.split(":")
if not target.endswith(".exnonce"):
TorControl.attach_stream(s, ident, 0)
else:
circid, (host,url) = streamsByNonce[target]
streamsByIdent[ident] = circid,(host,url)
print "Redirecting circuit",circid,"to",host
TorControl.redirect_stream(s, ident, host)
TorControl.attach_stream(s, ident, circid)
elif status in (TorControl.STREAM_STATUS.CLOSED,
TorControl.STREAM_STATUS.FAILED):
circid, (host,url) = streamsByIdent[ident]
if circs.has_key(circid):
for name in circs[circid]:
HOST_STATUS[name][1] += 1
del circs[circid]
N_CIRCS_DONE += 1
print N_CIRCS_DONE, "circuit attempts done"
del streamsByIdent[ident]
elif event == TorControl.EVENT_TYPE.CIRCSTATUS:
status, ident, path = args
print "Got circuit event",TorControl.CIRC_STATUS.nameOf[status],\
ident,path
if status in (TorControl.CIRC_STATUS.CLOSED,
TorControl.CIRC_STATUS.FAILED):
if circs.has_key(ident):
print "Circuit failed."
del circs[ident]
N_CIRCS_DONE += 1
print N_CIRCS_DONE, "circuit attempts done"
elif status == TorControl.CIRC_STATUS.BUILT:
nonce = random.randint(1,100000000)
nonce = "%s.exnonce" % nonce
host,url = random.choice(TARGETS)
streamsByNonce[nonce] = ident, (host,url)
print "Launching socks4a connection"
t = threading.Thread(target=runSocks4A, args=(nonce, host, 80, url))
t.setDaemon(1)
t.start()
def run():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", CONTROL_PORT))
TorControl.authenticate(s)
runControl(s)
if __name__ == '__main__':
run()

12
contrib/Makefile.am Normal file
View File

@ -0,0 +1,12 @@
SUBDIRS = osx suse
DIST_SUBDIRS = osx suse
confdir = $(sysconfdir)/tor
EXTRA_DIST = exitlist tor-tsocks.conf torify.1 TorControl.py tor.nsi.in tor.sh torctl rc.subr ExerciseServer.py PathDemo.py cross.sh tor-mingw.nsi.in package_nsis-mingw.sh tor.ico
conf_DATA = tor-tsocks.conf
bin_SCRIPTS = torify
man_MANS = torify.1

99
contrib/PathDemo.py Normal file
View File

@ -0,0 +1,99 @@
#!/usr/bin/python
import TorControl
import threading
import socket
import struct
import random
circuits = {}
streams = {}
def runControl(s):
pendingEvents = [] #XXX This tric. should become standard
TorControl._event_handler = pendingEvents.append
TorControl.set_events(s,
[TorControl.EVENT_TYPE.CIRCSTATUS,
TorControl.EVENT_TYPE.STREAMSTATUS])
TorControl.set_option(s,"__LeaveStreamsUnattached 1")
while 1:
e = pendingEvents[:]
del pendingEvents[:]
for ev in e:
handleEvent(s, ev)
_, tp, body = TorControl.receive_message(s)
if tp == TorControl.MSG_TYPE.EVENT:
handleEvent(s, body)
def parsePath(name):
assert name.endswith(".path")
items = name.split(".")
try:
n = int(items[-2])
except:
return None,None
path = items[-(2+n):-2]
host = items[:-(2+n)]
print path,host
return path,".".join(host)
def handleEvent(s,body):
event, args = TorControl.unpack_event(body)
if event == TorControl.EVENT_TYPE.STREAMSTATUS:
status, ident, target = args
print "Got stream event:",TorControl.STREAM_STATUS.nameOf[status],\
ident,target
if status in (TorControl.STREAM_STATUS.NEW_CONNECT,
TorControl.STREAM_STATUS.NEW_RESOLVE):
target,port=target.split(":")
if not target.endswith(".path"):
TorControl.attach_stream(s, ident, 0)
else:
path,host = parsePath(target)
#XXXX Don't launch so many circuits!
streams[ident] = path,host
circid = TorControl.extend_circuit(s, 0, path)
circuits[circid] = path
elif status == TorControl.STREAM_STATUS.DETACHED:
if not streams.has_key(ident):
TorControl.attach_stream(s, ident, 0)
else:
TorControl.close_stream(s, ident, 1)
elif event == TorControl.EVENT_TYPE.CIRCSTATUS:
status, ident, path = args
print "Got circuit event",TorControl.CIRC_STATUS.nameOf[status],\
ident,path
if not circuits.has_key(ident):
return
if status in (TorControl.CIRC_STATUS.CLOSED,
TorControl.CIRC_STATUS.FAILED):
ok = 0
elif status == TorControl.CIRC_STATUS.BUILT:
ok = 1
else:
return
ids = [ streamID for (streamID, (path,host)) in streams.items()
if path == circuits[ident] ]
for streamID in ids:
if ok:
_,host = streams[streamID]
TorControl.redirect_stream(s, streamID, host)
TorControl.attach_stream(s, streamID, ident)
#XXXX Don't do this twice.
else:
TorControl.close_stream(s, streamID, 1)
if not ok:
del circuits[ident]
def run():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", 9051))
TorControl.authenticate(s)
runControl(s)
if __name__ == '__main__':
run()

View File

@ -1,68 +0,0 @@
The contrib/ directory contains small tools that might be useful for using
with Tor. A few of them are included in the Tor source distribution; you can
find the others in the main Tor repository. We don't guarantee that they're
particularly useful.
dirauth-tools/ -- Tools useful for directory authority administrators
---------------------------------------------------------------------
add-tor is an old script to manipulate the approved-routers file.
nagios-check-tor-authority-cert is a nagios script to check when Tor
authority certificates are expired or nearly expired.
clang/ -- Files for use with the clang compiler
-----------------------------------------------
sanitize_blacklist.txt is used to build Tor with clang's dynamic
AddressSanitizer and UndefinedBehaviorSanitizer. It contains detailed
instructions on configuration, build, and testing with clang's sanitizers.
client-tools/ -- Tools for use with Tor clients
-----------------------------------------------
torify is a small wrapper script around torsocks.
tor-resolve.py uses Tor's SOCKS port extensions to perform DNS lookups. You
should probably use src/tools/tor-resolve instead.
dist/ -- Scripts and files for use when packaging Tor
-----------------------------------------------------
torctl, rc.subr, and tor.sh are init scripts for use with SysV-style init
tools. Everybody likes to write init scripts differently, it seems.
tor.service is a sample service file for use with systemd.
The suse/ subdirectory contains files used by the suse distribution.
operator-tools/ -- Tools for Tor relay operators
------------------------------------------------
tor-exit-notice.html is an HTML file for use with the DirPortFrontPage
option. It tells visitors that your relay is a Tor exit node, and that they
shouldn't assume you're the origin for the traffic that you're delivering.
tor.logrotate is a configuration file for use with the logrotate tool. You
may need to edit it to work for you.
linux-tor-prio.sh uses Linux iptables tools to traffic-shape your Tor relay's
traffic. If it breaks, you get to keep both pieces.
or-tools/ -- Tools for interacting with relays
----------------------------------------------
checksocks.pl is a tool to scan relays to see if any of them have advertised
public SOCKS ports, so we can tell them not to.
check-tor is a quick shell script to try doing a TLS handshake with a router
or to try fetching a directory from it.
exitlist is a precursor of check.torproject.org: it parses a bunch of cached
server descriptors to determine which can connect to a given address:port.
win32build -- Old files for windows packaging
---------------------------------------------
You shouldn't need these unless you're building some of the older Windows
packages.

464
contrib/TorControl.py Executable file
View File

@ -0,0 +1,464 @@
#!/usr/bin/python
# TorControl.py -- Python module to interface with Tor Control interface.
# 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
#__all__ = [ "MSG_TYPE", "" ]
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):
""
pass
def parseHostAndPort(h):
host, port = "localhost", 9051
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_msg(msg):
"return None, minLength, body or type,body,rest"
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):
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_msg"
tp,body,rest = _unpack_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_msg(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):
length, tp, body = _receive_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_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!")
_event_handler = None
def receive_reply(s, expected=None):
while 1:
_, tp, body = receive_message(s)
if tp == MSG_TYPE.EVENT:
if _event_handler is not None:
_event_handler(body)
elif tp == MSG_TYPE.ERROR:
if len(body)<2:
raise ProtocolError("(Truncated error message)")
errCode, = struct.unpack("!H", body[:2])
raise ErrorReply((errCode,
ERR_CODES.get(errCode,"[unrecognized]"),
body[2:]))
elif (expected is not None) and (tp not in expected):
raise ProtocolError("Unexpected message type 0x%04x"%tp)
else:
return tp, body
def pack_message(type, body=""):
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 send_message(s, type, body=""):
s.sendall(pack_message(type, body))
def authenticate(s):
send_message(s,MSG_TYPE.AUTH)
type,body = receive_reply(s)
return
def _parseKV(body,sep=" ",term="\n"):
res = []
for line in body.split(term):
if not line: continue
print repr(line)
k, v = line.split(sep,1)
res.append((k,v))
return res
def get_option(s,name):
send_message(s,MSG_TYPE.GETCONF,name)
tp,body = receive_reply(s,[MSG_TYPE.CONFVALUE])
return _parseKV(body)
def set_option(s,msg):
send_message(s,MSG_TYPE.SETCONF,msg)
tp,body = receive_reply(s,[MSG_TYPE.DONE])
def get_info(s,name):
send_message(s,MSG_TYPE.GETINFO,name)
tp,body = receive_reply(s,[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(s,events):
send_message(s,MSG_TYPE.SETEVENTS,
"".join([struct.pack("!H", event) for event in events]))
type,body = receive_reply(s,[MSG_TYPE.DONE])
return
def save_conf(s):
send_message(s,MSG_TYPE.SAVECONF)
receive_reply(s,[MSG_TYPE.DONE])
def send_signal(s, sig):
send_message(s,MSG_TYPE.SIGNAL,struct.pack("B",sig))
receive_reply(s,[MSG_TYPE.DONE])
def map_address(s, kv):
msg = [ "%s %s\n"%(k,v) for k,v in kv ]
send_message(s,MSG_TYPE.MAPADDRESS,"".join(msg))
tp, body = receive_reply(s,[MSG_TYPE.DONE])
return _parseKV(body)
def extend_circuit(s, circid, hops):
msg = struct.pack("!L",circid) + ",".join(hops) + "\0"
send_message(s,MSG_TYPE.EXTENDCIRCUIT,msg)
tp, body = receive_reply(s,[MSG_TYPE.DONE])
if len(body) != 4:
raise ProtocolError("Extendcircuit reply too short or long")
return struct.unpack("!L",body)[0]
def redirect_stream(s, streamid, newtarget):
msg = struct.pack("!L",streamid) + newtarget + "\0"
send_message(s,MSG_TYPE.REDIRECTSTREAM,msg)
tp,body = receive_reply(s,[MSG_TYPE.DONE])
def attach_stream(s, streamid, circid):
msg = struct.pack("!LL",streamid, circid)
send_message(s,MSG_TYPE.ATTACHSTREAM,msg)
tp,body = receive_reply(s,[MSG_TYPE.DONE])
def close_stream(s, streamid, reason=0, flags=0):
msg = struct.pack("!LBB",streamid,reason,flags)
send_message(s,MSG_TYPE.CLOSESTREAM,msg)
tp,body = receive_reply(s,[MSG_TYPE.DONE])
def close_circuit(s, circid, flags=0):
msg = struct.pack("!LB",circid,flags)
send_message(s,MSG_TYPE.CLOSECIRCUIT,msg)
tp,body = receive_reply(s,[MSG_TYPE.DONE])
def post_descriptor(s, descriptor):
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]
else:
return s
def unpack_event(body):
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("CIRCUITSTATUS 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("CIRCUITSTATUS 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 listen_for_events(s):
while(1):
_,type,body = receive_message(s)
print unpack_event(body)
return
def do_main_loop(host,port):
print "host is %s:%d"%(host,port)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host,port))
authenticate(s)
print "nick",`get_option(s,"nickname")`
print get_option(s,"DirFetchPeriod\n")
print `get_info(s,"version")`
#print `get_info(s,"desc/name/moria1")`
print `get_info(s,"network-status")`
print `get_info(s,"addr-mappings/all")`
print `get_info(s,"addr-mappings/config")`
print `get_info(s,"addr-mappings/cache")`
print `get_info(s,"addr-mappings/control")`
print `map_address(s, [("0.0.0.0", "Foobar.com"),
("1.2.3.4", "foobaz.com"),
("frebnitz.com", "5.6.7.8"),
(".", "abacinator.onion")])`
print `extend_circuit(s,0,["moria1"])`
print '========'
#print `extend_circuit(s,0,[""])`
print '========'
#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])
set_events(s,[EVENT_TYPE.OBSOLETE_LOG])
listen_for_events(s)
return
if __name__ == '__main__':
if len(sys.argv) != 2:
print "Syntax: TorControl.py torhost:torport"
sys.exit(0)
sh,sp = parseHostAndPort(sys.argv[1])
do_main_loop(sh,sp)

View File

@ -1,17 +1,27 @@
#!/usr/bin/perl -w
# $Id
use strict;
my %options = ();
my %descOptions = ();
my %torrcSampleOptions = ();
my %torrcCompleteOptions = ();
my %manPageOptions = ();
# Load the canonical list as actually accepted by Tor.
open(F, "@abs_top_builddir@/src/or/tor --list-torrc-options |") or die;
my $mostRecentOption;
open(F, "./src/or/tor --list-torrc-options |") or die;
while (<F>) {
next if m!\[notice\] Tor v0\.!;
if (m!^([A-Za-z0-9_]+)!) {
$options{$1} = 1;
$mostRecentOption = lc $1;
$options{$mostRecentOption} = 1;
} elsif (m!^ !) {
$descOptions{$mostRecentOption} = 1;
if (m!\{DEPRECATED\}!) {
delete $descOptions{$mostRecentOption};
delete $options{$mostRecentOption};
}
} else {
print "Unrecognized output> ";
print;
@ -19,7 +29,7 @@ while (<F>) {
}
close F;
# Load the contents of torrc.sample
# Load the contents of torrc.sample and torrc.complete
sub loadTorrc {
my ($fname, $options) = @_;
local *F;
@ -27,23 +37,30 @@ sub loadTorrc {
while (<F>) {
next if (m!##+!);
if (m!#([A-Za-z0-9_]+)!) {
$options->{$1} = 1;
$options->{lc $1} = 1;
}
}
close F;
0;
}
loadTorrc("@abs_top_srcdir@/src/config/torrc.sample.in", \%torrcSampleOptions);
loadTorrc("./src/config/torrc.sample.in", \%torrcSampleOptions);
loadTorrc("./src/config/torrc.complete.in", \%torrcCompleteOptions);
# Try to figure out what's in the man page.
my $considerNextLine = 0;
open(F, "@abs_top_srcdir@/doc/tor.1.txt") or die;
open(F, "./doc/tor.1.in") or die;
while (<F>) {
if (m!^(?:\[\[([A-za-z0-9_]+)\]\] *)?\*\*([A-Za-z0-9_]+)\*\*!) {
$manPageOptions{$2} = 1;
print "Missing an anchor: $2\n" unless (defined $1 or $2 eq 'tor');
if ($considerNextLine and
m!^\\fB([A-Za-z0-9_]+)!) {
$manPageOptions{lc $1} = 1;
}
if (m!^\.(?:SH|TP)!) {
$considerNextLine = 1; next;
} else {
$considerNextLine = 0;
}
}
close F;
@ -60,10 +77,14 @@ sub subtractHashes {
0;
}
# subtractHashes("No online docs", \%options, \%descOptions);
subtractHashes("No online docs", \%options, \%descOptions);
# subtractHashes("Orphaned online docs", \%descOptions, \%options);
subtractHashes("Not in torrc.complete.in", \%options, \%torrcCompleteOptions);
subtractHashes("Orphaned in torrc.complete.in", \%torrcCompleteOptions, \%options);
subtractHashes("Orphaned in torrc.sample.in", \%torrcSampleOptions, \%options);
subtractHashes("Not in man page", \%options, \%manPageOptions);
subtractHashes("Orphaned in man page", \%manPageOptions, \%options);

117
contrib/checkSpace.pl Executable file
View File

@ -0,0 +1,117 @@
#!/usr/bin/perl -w
if ($ARGV[0] =~ /^-/) {
$lang = shift @ARGV;
$C = ($lang eq '-C');
# $TXT = ($lang eq '-txt');
}
for $fn (@ARGV) {
open(F, "$fn");
$lastnil = 0;
$incomment = 0;
while (<F>) {
## Warn about windows-style newlines.
if (/\r/) {
print " CR:$fn:$.\n";
}
## Warn about tabs.
if (/\t/) {
print " TAB:$fn:$.\n";
}
## Warn about trailing whitespace.
if (/ +$/) {
print "Space\@EOL:$fn:$.\n";
}
## Warn about control keywords without following space.
if ($C && /\s(?:if|while|for|switch)\(/) {
print " KW(:$fn:$.\n";
}
## Warn about multiple empty lines.
if ($lastnil && /^$/) {
print " DoubleNL:$fn:$.\n";
} elsif (/^$/) {
$lastnil = 1;
} else {
$lastnil = 0;
}
## Terminals are still 80 columns wide in my world. I refuse to
## accept double-line lines. Except, of course, svn Id tags
## can make us go long.
if (/^.{80}/ && !/\$Id: /) {
print " Wide:$fn:$.\n";
}
### Juju to skip over comments and strings, since the tests
### we're about to do are okay there.
if ($C) {
if ($incomment) {
if (m!\*/!) {
s!.*?\*/!!;
$incomment = 0;
} else {
next;
}
}
if (m!/\*.*?\*/!) {
s!\s*/\*.*?\*/!!;
} elsif (m!/\*!) {
s!\s*/\*!!;
$incomment = 1;
next;
}
s!"(?:[^\"]+|\\.)*"!"X"!g;
next if /^\#/;
## Warn about C++-style comments.
if (m!//!) {
# print " //:$fn:$.\n";
s!//.*!!;
}
## Warn about braces preceded by non-space.
if (/([^\s])\{/) {
print " $1\{:$fn:$.\n";
}
## Warn about multiple internal spaces.
#if (/[^\s,:]\s{2,}[^\s\\=]/) {
# print " X X:$fn:$.\n";
#}
## Warn about { with stuff after.
#s/\s+$//;
#if (/\{[^\}\\]+$/) {
# print " {X:$fn:$.\n";
#}
## Warn about function calls with space before parens.
if (/(\w+)\s\(([A-Z]*)/) {
if ($1 ne "if" and $1 ne "while" and $1 ne "for" and
$1 ne "switch" and $1 ne "return" and $1 ne "int" and
$1 ne "elsif" and $1 ne "WINAPI" and $2 ne "WINAPI" and
$1 ne "void" and $1 ne "__attribute__") {
print " fn ():$fn:$.\n";
}
}
## Warn about functions not declared at start of line.
if ($in_func_head ||
($fn !~ /\.h$/ && /^[a-zA-Z0-9_]/ &&
! /^(?:const |static )*(?:typedef|struct|union)[^\(]*$/ &&
! /= *\{$/ && ! /;$/)) {
if (/.\{$/){
print "fn() {:$fn:$.\n";
$in_func_head = 0;
} elsif (/^\S[^\(]* +\**[a-zA-Z0-9_]+\(/) {
$in_func_head = -1; # started with tp fn
} elsif (/;$/) {
$in_func_head = 0;
} elsif (/\{/) {
if ($in_func_head == -1) {
print "tp fn():$fn:$.\n";
}
$in_func_head = 0;
}
}
}
}
if (! $lastnil) {
print " EOL\@EOF:$fn:$.\n";
}
close(F);
}

View File

@ -1,103 +0,0 @@
# clang sanitizer special case list
# syntax specified in http://clang.llvm.org/docs/SanitizerSpecialCaseList.html
# for more info see http://clang.llvm.org/docs/AddressSanitizer.html
#
# Tor notes: This file is obsolete!
#
# It was necessary in order to apply the sanitizers to all of tor. But
# we don't believe that's a good idea: some parts of tor need constant-time
# behavior that is hard to guarantee with these sanitizers.
#
# If you need this behavior, then please consider --enable-expensive-hardening,
# and report bugs as needed.
#
# usage:
# 1. configure tor build:
# ./configure \
# CC=clang \
# CFLAGS="-fsanitize-blacklist=contrib/clang/sanitize_blacklist.txt -fsanitize=undefined -fsanitize=address -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-inline" \
# LDFLAGS="-fsanitize=address" \
# --disable-gcc-hardening
# and any other flags required to build tor on your OS.
#
# 2. build tor:
# make
#
# 3. test tor:
# ASAN_OPTIONS=allow_user_segv_handler=1 make test
# ASAN_OPTIONS=allow_user_segv_handler=1 make check
# make test-network # requires chutney
#
# 4. the tor binary is now instrumented with clang sanitizers,
# and can be run just like a standard tor binary
# Compatibility:
# This blacklist has been tested with clang 3.7's UndefinedBehaviorSanitizer
# and AddressSanitizer on OS X 10.10 Yosemite, with all tests passing
# on both x86_64 and i386 (using CC="clang -arch i386")
# It has not been tested with ThreadSanitizer or MemorySanitizer
# Success report and patches for other sanitizers or OSs are welcome
# ccache and make don't account for the sanitizer blacklist as a dependency
# you might need to set CCACHE_DISABLE=1 and/or use make clean to workaround
# Configuration Flags:
# -fno-sanitize-recover=all
# causes clang to crash on undefined behavior, rather than printing
# a warning and continuing (the AddressSanitizer always crashes)
# -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-inline
# make clang backtraces easier to read
# --disable-gcc-hardening
# disables warnings about the redefinition of _FORTIFY_SOURCE
# (it conflicts with the sanitizers)
# Turning the sanitizers off for particular functions:
# (Unfortunately, exempting functions doesn't work for the blacklisted
# functions below, and we can't turn the code off because it's essential)
#
# #if defined(__has_feature)
# #if __has_feature(address_sanitizer)
# /* tell clang AddressSanitizer not to instrument this function */
# #define NOASAN __attribute__((no_sanitize_address))
# #define _CLANG_ASAN_
# #else
# #define NOASAN
# #endif
# #else
# #define NOASAN
# #endif
#
# /* Telling AddressSanitizer to not instrument a function */
# void func(void) NOASAN;
#
# /* Including or excluding sections of code */
# #ifdef _CLANG_ASAN_
# /* code that only runs under address sanitizer */
# #else
# /* code that doesn't run under address sanitizer */
# #endif
# Blacklist Entries:
# test-memwipe.c checks if a freed buffer was properly wiped
fun:vmemeq
fun:check_a_buffer
# we need to allow the tor bt handler to catch SIGSEGV
# otherwise address sanitizer munges the expected output and the test fails
# we can do this by setting an environmental variable
# See https://code.google.com/p/address-sanitizer/wiki/Flags
# ASAN_OPTIONS=allow_user_segv_handler=1
# test_bt_cl.c stores to a NULL pointer to trigger a crash
fun:crash
# curve25519-donna.c left-shifts 1 bits into and past the sign bit of signed
# integers. Until #13538 is resolved, we exempt functions that do left shifts.
# Note that x86_64 uses curve25519-donna-c64.c instead of curve25519-donna.c
fun:freduce_coefficients
fun:freduce_degree
fun:s32_eq
fun:fcontract

View File

@ -1,61 +0,0 @@
#! /bin/sh
# This script used to call (the now deprecated) tsocks as a fallback in case
# torsocks wasn't installed.
# Now, it's just a backwards compatible shim around torsocks with reasonable
# behavior if -v/--verbose or -h/--help arguments are passed.
#
# Copyright (c) 2004, 2006, 2009 Peter Palfrader
# Modified by Jacob Appelbaum <jacob@appelbaum.net> April 16th 2006
# Stripped of all the tsocks cruft by ugh on February 22nd 2012
# May be distributed under the same terms as Tor itself
compat() {
echo "torify is now just a wrapper around torsocks(1) for backwards compatibility."
}
usage() {
compat
echo "Usage: $0 [-hv] <command> [<options>...]"
}
case $# in 0)
usage >&2
exit 1
esac
case $# in 1)
case $1 in -h|--help)
usage
exit 0
esac
esac
case $1 in -v|--verbose)
compat >&2
shift
esac
# taken from Debian's Developer's Reference, 6.4
pathfind() {
OLDIFS="$IFS"
IFS=:
for p in $PATH; do
if [ -x "$p/$*" ]; then
IFS="$OLDIFS"
return 0
fi
done
IFS="$OLDIFS"
return 1
}
if pathfind torsocks; then
exec torsocks "$@"
echo "$0: Failed to exec torsocks $@" >&2
exit 1
else
echo "$0: torsocks not found in your PATH. Perhaps it isn't installed? (tsocks is no longer supported, for security reasons.)" >&2
fi

196
contrib/cross.sh Executable file
View File

@ -0,0 +1,196 @@
#!/bin/bash
# $Id$
# Copyright 2006 Michael Mohr with modifications by Roger Dingledine
# See LICENSE for licensing information.
#######################################################################
# Tor-cross: a tool to help cross-compile Tor
#
# The purpose of a cross-compiler is to produce an executable for
# one system (CPU) on another. This is useful, for example, when
# the target system does not have a native compiler available.
# You might, for example, wish to cross-compile a program on your
# host (the computer you're working on now) for a target such as
# a router or handheld computer.
#
# A number of environment variables must be set in order for this
# script to work:
# $PREFIX, $CROSSPATH, $HOST_TRIPLET, $HOST,
# and (optionally) $BUILD
# Please run the script for a description of each one. If automated
# builds are desired, the above variables can be exported at the top
# of this script.
#
# Recent releases of Tor include test programs in configure. Normally
# this is a good thing, since it catches a number of problems.
# However, this also presents a problem when cross compiling, since
# you can't run binary images for the target system on the host.
#
# Tor-cross assumes that you know what you're doing and removes a
# number of checks known to cause problems with this process.
# Note that this does not guarantee that the program will run or
# even compile; it simply allows configure to generate the Makefiles.
#
# Stripping the binaries should almost always be done for an
# embedded environment where space is at an exacting premium.
# However, the default is NOT to strip them since they are useful for
# debugging. If you do not plan to do any debugging and you
# don't care about the debugging symbols, set $STRIP to "yes" before
# running this script.
#
# Tor-cross was written by Michael Mohr. He can be contacted at
# m(dot)mohr(at)laposte(dot)net. Comments are appreciated, but
# flames go to /dev/null.
#
# The target with which this script is tested is little-endian
# MIPS Linux, built on an Athlon-based Linux desktop.
#
#######################################################################
# disable the platform-specific tests in configure
export CROSS_COMPILE=yes
# for error conditions
EXITVAL=0
if [ ! -f autogen.sh ]
then
echo "Please run this script from the root of the Tor distribution"
exit -1
fi
if [ ! -f configure ]
then
if [ -z $GEN_BUILD ]
then
echo "To automatically generate the build environment, set \$GEN_BUILD"
echo "to yes; for example,"
echo " export GEN_BUILD=yes"
EXITVAL=-1
fi
fi
if [ -z $PREFIX ]
then
echo "You must define \$PREFIX since you are cross-compiling."
echo "Select a non-system location (i.e. /tmp/tor-cross):"
echo " export PREFIX=/tmp/tor-cross"
EXITVAL=-1
fi
if [ -z $CROSSPATH ]
then
echo "You must define the location of your cross-compiler's"
echo "directory using \$CROSSPATH; for example,"
echo " export CROSSPATH=/opt/cross/staging_dir_mipsel/bin"
EXITVAL=-1
fi
if [ -z $HOST_TRIPLET ]
then
echo "You must define \$HOST_TRIPLET to continue. For example,"
echo "if you normally cross-compile applications using"
echo "mipsel-linux-uclibc-gcc, you would set \$HOST_TRIPLET like so:"
echo " export HOST_TRIPLET=mipsel-linux-uclibc-"
EXITVAL=-1
fi
if [ -z $HOST ]
then
echo "You must specify a target processor with \$HOST; for example:"
echo " export HOST=mipsel-unknown-elf"
EXITVAL=-1
fi
if [ -z $BUILD ]
then
echo "You should specify the host machine's type with \$BUILD; for example:"
echo " export BUILD=i686-pc-linux-gnu"
echo "If you wish to let configure autodetect the host, set \$BUILD to 'auto':"
echo " export BUILD=auto"
EXITVAL=-1
fi
if [ ! -x $CROSSPATH/$HOST_TRIPLETgcc ]
then
echo "The specified toolchain does not contain an executable C compiler."
echo "Please double-check your settings and rerun cross.sh."
EXITVAL=-1
fi
if [ $EXITVAL -ne 0 ]
then
echo "Remember, you can hard-code these values in cross.sh if needed."
exit $EXITVAL
fi
if [ ! -z "$GEN_BUILD" -a ! -f configure ]
then
export NOCONF=yes
./autogen.sh
fi
# clean up any existing object files
if [ -f src/or/tor ]
then
make clean
fi
# Set up the build environment and try to run configure
export PATH=$PATH:$CROSSPATH
export RANLIB=${HOST_TRIPLET}ranlib
export CC=${HOST_TRIPLET}gcc
if [ $BUILD == "auto" ]
then
./configure \
--enable-debug \
--enable-eventdns \
--prefix=$PREFIX \
--host=$HOST
else
./configure \
--enable-debug \
--enable-eventdns \
--prefix=$PREFIX \
--host=$HOST \
--build=$BUILD
fi
# has a problem occurred?
if [ $? -ne 0 ]
then
echo ""
echo "A problem has been detected with configure."
echo "Please check the output above and rerun cross.sh"
echo ""
exit -1
fi
# Now we're cookin'
make
# has a problem occurred?
if [ $? -ne 0 ]
then
echo ""
echo "A problem has been detected with make."
echo "Please check the output above and rerun make."
echo ""
exit -1
fi
# if $STRIP has length (i.e. STRIP=yes), strip the binaries
if [ ! -z $STRIP ]
then
${HOST_TRIPLET}strip \
src/or/tor \
src/or/test \
src/tools/tor-resolve
fi
echo ""
echo "Tor should be compiled at this point. Now run 'make install' to"
echo "install to $PREFIX"
echo ""

View File

@ -1,86 +0,0 @@
#!/bin/bash
# nagios-check-tor-authority-cert - check certificate expiry time
# A nagios check for Tor v3 directory authorities:
# - Checks the current certificate expiry time
#
# Usage: nagios-check-tor-authority-cert <authority identity fingerprint>
# e.g.: nagios-check-tor-authority-cert A9AC67E64B200BBF2FA26DF194AC0469E2A948C6
# Copyright (c) 2008 Peter Palfrader <peter@palfrader.org>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
set -e
set -u
if [ -z "${1:-}" ]; then
echo "Usage: $0 <authority identity fingerprint>" 2>&1
exit 3
fi
identity="$1"
DIRSERVERS=""
DIRSERVERS="$DIRSERVERS 86.59.21.38:80" # tor26
DIRSERVERS="$DIRSERVERS 128.31.0.34:9031" # moria1
DIRSERVERS="$DIRSERVERS 216.224.124.114:9030" # ides
DIRSERVERS="$DIRSERVERS 80.190.246.100:80" # gabelmoo
#DIRSERVERS="$DIRSERVERS 140.247.60.64:80" # lefkada
DIRSERVERS="$DIRSERVERS 194.109.206.212:80" # dizum
DIRSERVERS="$DIRSERVERS 213.73.91.31:80" # dannenberg
TMPFILE="`tempfile`"
trap 'rm -f "$TMPFILE"' 0
for dirserver in $DIRSERVERS; do
wget -q -O "$TMPFILE" "http://$dirserver/tor/keys/fp/$identity"
if [ "$?" = 0 ]; then
break
else
cat /dev/null > "$TMPFILE"
continue
fi
done
if ! [ -s "$TMPFILE" ] ; then
echo "UNKNOWN: Downloading certificate for $identity failed."
exit 3
fi
expirydate="$(awk '$1=="dir-key-expires" {printf "%s %s", $2, $3}' < "$TMPFILE")"
expiryunix=$(TZ=UTC date -d "$expirydate" +%s)
now=$(date +%s)
if [ "$now" -ge "$expiryunix" ]; then
echo "CRITICAL: Certificate expired $expirydate (authority $identity)."
exit 2
elif [ "$(( $now + 7*24*60*60 ))" -ge "$expiryunix" ]; then
echo "CRITICAL: Certificate expires $expirydate (authority $identity)."
exit 2
elif [ "$(( $now + 30*24*60*60 ))" -ge "$expiryunix" ]; then
echo "WARNING: Certificate expires $expirydate (authority $identity)."
exit 1
else
echo "OK: Certificate expires $expirydate (authority $identity)."
exit 0
fi

View File

@ -1,35 +0,0 @@
# tor.service -- this systemd configuration file for Tor sets up a
# relatively conservative, hardened Tor service. You may need to
# edit it if you are making changes to your Tor configuration that it
# does not allow. Package maintainers: this should be a starting point
# for your tor.service; it is not the last point.
[Unit]
Description=Anonymizing overlay network for TCP
After=syslog.target network.target nss-lookup.target
[Service]
Type=notify
NotifyAccess=all
ExecStartPre=@BINDIR@/tor -f @CONFDIR@/torrc --verify-config
ExecStart=@BINDIR@/tor -f @CONFDIR@/torrc
ExecReload=/bin/kill -HUP ${MAINPID}
KillSignal=SIGINT
TimeoutSec=30
Restart=on-failure
WatchdogSec=1m
LimitNOFILE=32768
# Hardening
PrivateTmp=yes
PrivateDevices=yes
ProtectHome=yes
ProtectSystem=full
ReadOnlyDirectories=/
ReadWriteDirectories=-@LOCALSTATEDIR@/lib/tor
ReadWriteDirectories=-@LOCALSTATEDIR@/log/tor
NoNewPrivileges=yes
CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target

View File

@ -8,25 +8,20 @@
exitlist -- Given a Tor directory on stdin, lists the Tor servers
that accept connections to given addreses.
example usage:
example usage (Tor 0.1.0.x and earlier):
cat ~/.tor/cached-descriptors* | python exitlist 18.244.0.188:80
python exitlist 18.244.0.188:80 < ~/.tor/cached-directory
You should look at the "FetchUselessDescriptors" and "FetchDirInfoEarly"
config options in the man page.
example usage (Tor 0.1.1.10-alpha and later):
cat ~/.tor/cached-routers* | python exitlist 18.244.0.188:80
If you're using Tor 0.1.1.18-rc or later, you should look at
the "FetchUselessDescriptors" config option in the man page.
Note that this script won't give you a perfect list of IP addresses
that might connect to you using Tor.
False negatives:
- Some Tor servers might exit from other addresses than the one they
publish in their descriptor.
False positives:
- This script just looks at the descriptor lists, so it counts relays
that were running a day in the past and aren't running now (or are
now running at a different address).
See https://check.torproject.org/ for an alternative (more accurate!)
approach.
that might connect to you using Tor, since some Tor servers might exit
from other addresses than the one they publish.
"""
@ -63,7 +58,6 @@ import re
import getopt
import socket
import struct
import time
assert sys.version_info >= (2,2)
@ -202,12 +196,10 @@ class Policy:
return True
class Server:
def __init__(self, name, ip, policy, published, fingerprint):
def __init__(self, name, ip, policy):
self.name = name
self.ip = ip
self.policy = policy
self.published = published
self.fingerprint = fingerprint
def uniq_sort(lst):
d = {}
@ -226,7 +218,7 @@ def run():
opts, pargs = getopt.getopt(sys.argv[1:], "vx")
except getopt.GetoptError, e:
print """
usage: cat ~/.tor/cached-routers* | %s [-v] [-x] [host:port [host:port [...]]]
usage: %s [-v] [-x] [host:port [host:port [...]]]
-v verbose output
-x invert results
""" % sys.argv[0]
@ -243,34 +235,17 @@ usage: cat ~/.tor/cached-routers* | %s [-v] [-x] [host:port [host:port [...]]]
servers = []
policy = []
name = ip = None
published = 0
fp = ""
for line in sys.stdin.xreadlines():
if line.startswith('router '):
if name:
servers.append(Server(name, ip, Policy.parseLines(policy),
published, fp))
servers.append(Server(name, ip, Policy.parseLines(policy)))
_, name, ip, rest = line.split(" ", 3)
policy = []
published = 0
fp = ""
elif line.startswith('fingerprint') or \
line.startswith('opt fingerprint'):
elts = line.strip().split()
if elts[0] == 'opt': del elts[0]
assert elts[0] == 'fingerprint'
del elts[0]
fp = "".join(elts)
elif line.startswith('accept ') or line.startswith('reject '):
policy.append(line.strip())
elif line.startswith('published '):
date = time.strptime(line[len('published '):].strip(),
"%Y-%m-%d %H:%M:%S")
published = time.mktime(date)
if name:
servers.append(Server(name, ip, Policy.parseLines(policy), published,
fp))
servers.append(Server(name, ip, Policy.parseLines(policy)))
targets = []
for line in ADDRESSES_OF_INTEREST.split("\n"):
@ -279,32 +254,19 @@ usage: cat ~/.tor/cached-routers* | %s [-v] [-x] [host:port [host:port [...]]]
p = Pattern.parse(line)
targets.append((p.ip, p.portMin))
# remove all but the latest server of each IP/Nickname pair.
latest = {}
for s in servers:
if (not latest.has_key((s.fingerprint))
or s.published > latest[(s.fingerprint)]):
latest[s.fingerprint] = s
servers = latest.values()
accepters, rejecters = {}, {}
accepters, rejecters = [], []
for s in servers:
for ip,port in targets:
if s.policy.accepts(ip,port):
accepters[s.ip] = s
accepters.append(s)
break
else:
rejecters[s.ip] = s
# If any server at IP foo accepts, the IP does not reject.
for k in accepters.keys():
if rejecters.has_key(k):
del rejecters[k]
rejecters.append(s)
if INVERSE:
printlist = rejecters.values()
printlist = rejecters
else:
printlist = accepters.values()
printlist = accepters
ents = []
if VERBOSE:

78
contrib/id_to_fp.c Normal file
View File

@ -0,0 +1,78 @@
/* Copyright 2006 Nick Mathewson; see LICENSE for licensing information */
/* $Id$ */
/* id_to_fp.c : Helper for directory authority ops. When somebody sends us
* a private key, this utility converts the private key into a fingerprint
* so you can de-list that fingerprint.
*/
#include <openssl/rsa.h>
#include <openssl/bio.h>
#include <openssl/sha.h>
#include <openssl/pem.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define die(s) do { fprintf(stderr, "%s\n", s); goto err; } while (0)
int
main(int argc, char **argv)
{
BIO *b = NULL;
RSA *key = NULL;
unsigned char *buf = NULL, *bufp;
int len, i;
unsigned char digest[20];
int status = 1;
if (argc < 2) {
fprintf(stderr, "Reading key from stdin...\n");
if (!(b = BIO_new_fp(stdin, BIO_NOCLOSE)))
die("couldn't read from stdin");
} else if (argc == 2) {
if (strcmp(argv[1], "-h") == 0 ||
strcmp(argv[1], "--help") == 0) {
fprintf(stdout, "Usage: %s [keyfile]\n", argv[0]);
status = 0;
goto err;
} else {
if (!(b = BIO_new_file(argv[1], "r")))
die("couldn't open file");
}
} else {
fprintf(stderr, "Usage: %s [keyfile]\n", argv[0]);
goto err;
}
if (!(key = PEM_read_bio_RSAPrivateKey(b, NULL, NULL, NULL)))
die("couldn't parse key");
len = i2d_RSAPublicKey(key, NULL);
if (len < 0)
die("Bizarre key");
bufp = buf = malloc(len+1);
if (!buf)
die("Out of memory");
len = i2d_RSAPublicKey(key, &bufp);
if (len < 0)
die("Bizarre key");
SHA1(buf, len, digest);
for (i=0; i < 20; i += 2) {
printf("%02X%02X ", (int)digest[i], (int)digest[i+1]);
}
printf("\n");
status = 0;
err:
if (buf)
free(buf);
if (key)
RSA_free(key);
if (b)
BIO_free(b);
return status;
}

View File

@ -1,18 +0,0 @@
EXTRA_DIST+= \
contrib/README \
contrib/client-tools/torify \
contrib/dist/rc.subr \
contrib/dist/suse/tor.sh.in \
contrib/dist/tor.sh \
contrib/dist/torctl \
contrib/dist/tor.service.in \
contrib/operator-tools/linux-tor-prio.sh \
contrib/operator-tools/tor-exit-notice.html \
contrib/or-tools/exitlist \
contrib/win32build/package_nsis-mingw.sh \
contrib/win32build/tor-mingw.nsi.in \
contrib/win32build/tor.ico \
contrib/win32build/tor.nsi.in
bin_SCRIPTS+= contrib/client-tools/torify

169
contrib/mdd.py Executable file
View File

@ -0,0 +1,169 @@
#!/usr/bin/env python2.3
import re, sys
import textwrap
files = sys.argv[1:]
funcDeclaredIn = {}
fileDeclares = {}
functionCalls = {}
funcCalledByFile = {}
funcCalledByFunc = {}
cpp_re = re.compile(r'//.*$')
c_re = re.compile(r'/[*]+(?:[^*]+|[*]+[^/*])*[*]+/', re.M|re.S)
for fname in files:
f = open(fname, 'r')
curFunc = "???"
functionCalls.setdefault(curFunc,{})
lineno = 0
body = f.read()
body = cpp_re.sub(" ",body)
body = c_re.sub(" ",body)
#if fname == 'dns.c': print body
for line in body.split("\n"):
lineno += 1
m = re.match(r'^[^\s/].*\s(\w+)\([^;]*$', line)
if m:
#print line, "->", m.group(1)
curFunc = m.group(1)
if curFunc[0] == '_': curFunc = curFunc[1:]
functionCalls.setdefault(curFunc,{})
funcDeclaredIn[m.group(1)] = fname
fileDeclares.setdefault(fname, {})[m.group(1)] = 1
continue
m = re.match(r'^(\w+)\([^;]', line)
if m:
#print line, "->", m.group(1)
curFunc = m.group(1)
if curFunc[0] == '_': curFunc = curFunc[1:]
functionCalls.setdefault(curFunc,{})
funcDeclaredIn[m.group(1)] = fname
fileDeclares.setdefault(fname, {})[m.group(1)] = 1
continue
while line:
m = re.search(r'(\w+)\(', line)
if not m: break
#print fname, line, curFunc, "->", m.group(1)
fn = m.group(1)
if fn[0] == '_':
fn = fn[1:]
functionCalls[curFunc][m.group(1)] = 1
#if curFunc == "???":
# print ">>!!!!! at %s:%s"%(fname,lineno)
funcCalledByFunc.setdefault(m.group(1), {})[curFunc]=1
funcCalledByFile.setdefault(m.group(1), {})[fname]=1
line = line[m.end():]
f.close()
fileUsers = {}
fileUses = {}
for fname in files:
print "%s:"%fname
users = {}
for func in fileDeclares[fname]:
cb = funcCalledByFile.get(func,{}).keys()
for f in cb: users[f] = 1
#print "users[%s] = %s"%(f,users[f])
users = users.keys()
users.sort()
fileUsers[fname] = users
for user in users:
fileUses.setdefault(user,[]).append(fname)
if user == fname: continue
print " from %s:"%user
for func in fileDeclares[fname]:
if funcCalledByFile.get(func,{}).get(user,0):
print " %s()"%func
def wrap(s, pre):
return textwrap.fill(s,
width=77, initial_indent=pre,
subsequent_indent=" "*len(pre))
for fname in files:
print
print "===== %s"%fname
print wrap(" ".join(fileUses[fname]),
" Calls: ")
print wrap(" ".join(fileUsers[fname]),
" Called by: ")
print "=============================="
funcnames = functionCalls.keys()
funcnames.sort()
if 1:
for func in funcnames:
print "===== %s"%func
callers = [c for c in funcCalledByFunc.get(func,{}).keys()
if c != "???"]
callers.sort()
called = [c for c in functionCalls[func].keys() if c != "???" and
c in funcnames]
called.sort()
print wrap(" ".join(callers),
" Called by:")
print wrap(" ".join(called),
" Calls:")
# simple topological sort.
functionDepth = {}
while 1:
BIG = 1000000
any = 0
for func in funcnames:
if functionDepth.has_key(func):
continue
called = [c for c in functionCalls[func] if c != func and
functionCalls.has_key(c)]
if len(called) == 0:
functionDepth[func] = 0
#print "Depth(%s)=%s"%(func,0)
any = 1
continue
calledDepths = [ functionDepth.get(c,BIG) for c in called ]
if max(calledDepths) < BIG:
d = functionDepth[func] = max(calledDepths)+1
#print "Depth(%s)=%s"%(func,d)
any = 1
continue
if not any:
break
# compute lexical closure.
cycCalls = {}
for func in funcnames:
if not functionDepth.has_key(func):
calls = [ c for c in functionCalls[func] if c != func and
functionCalls.has_key(c) and not functionDepth.has_key(c)]
cycCalls[func] = d = {}
for c in calls:
d[c]=1
cycNames = cycCalls.keys()
while 1:
any = 0
for func in cycNames:
L = len(cycCalls[func])
for called in cycCalls[func].keys():
cycCalls[func].update(cycCalls[called])
if L != len(cycCalls[func]):
any = 1
if not any:
break
depthList = [ (v,k) for k,v in functionDepth.items() ]
depthList.sort()
cycList = [ (len(v),k) for k,v in cycCalls.items() ]
cycList.sort()
for depth,name in depthList:
print "Depth[%s]=%s"%(name,depth)
for bredth,name in cycList:
print "Width[%s]=%s"%(name,bredth)
print "Sorted %s / %s"%(len(functionDepth),len(funcnames))

View File

@ -1,192 +0,0 @@
#!/bin/bash
# Written by Marco Bonetti & Mike Perry
# Based on instructions from Dan Singletary's ADSL BW Management HOWTO:
# http://www.faqs.org/docs/Linux-HOWTO/ADSL-Bandwidth-Management-HOWTO.html
# This script is Public Domain.
############################### README #################################
# This script provides prioritization of Tor traffic below other
# traffic on a Linux server. It has two modes of operation: UID based
# and IP based.
# UID BASED PRIORITIZATION
#
# The UID based method requires that Tor be launched from
# a specific user ID. The "User" Tor config setting is
# insufficient, as it sets the UID after the socket is created.
# Here is a C wrapper you can use to execute Tor and drop privs before
# it creates any sockets.
#
# Compile with:
# gcc -DUID=`id -u tor` -DGID=`id -g tor` tor_wrap.c -o tor_wrap
#
# #include <unistd.h>
# int main(int argc, char **argv) {
# if(initgroups("tor", GID) == -1) { perror("initgroups"); return 1; }
# if(setresgid(GID, GID, GID) == -1) { perror("setresgid"); return 1; }
# if(setresuid(UID, UID, UID) == -1) { perror("setresuid"); return 1; }
# execl("/bin/tor", "/bin/tor", "-f", "/etc/tor/torrc", NULL);
# perror("execl"); return 1;
# }
# IP BASED PRIORITIZATION
#
# The IP setting requires that a separate IP address be dedicated to Tor.
# Your Torrc should be set to bind to this IP for "OutboundBindAddress",
# "ListenAddress", and "Address".
# GENERAL USAGE
#
# You should also tune the individual connection rate parameters below
# to your individual connection. In particular, you should leave *some*
# minimum amount of bandwidth for Tor, so that Tor users are not
# completely choked out when you use your server's bandwidth. 30% is
# probably a reasonable choice. More is better of course.
#
# To start the shaping, run it as:
# ./linux-tor-prio.sh
#
# To get status information (useful to verify packets are getting marked
# and prioritized), run:
# ./linux-tor-prio.sh status
#
# And to stop prioritization:
# ./linux-tor-prio.sh stop
#
########################################################################
# BEGIN USER TUNABLE PARAMETERS
DEV=eth0
# NOTE! You must START Tor under this UID. Using the Tor User
# config setting is NOT sufficient. See above.
TOR_UID=$(id -u tor)
# If the UID mechanism doesn't work for you, you can set this parameter
# instead. If set, it will take precedence over the UID setting. Note that
# you need multiple IPs with one specifically devoted to Tor for this to
# work.
#TOR_IP="42.42.42.42"
# Average ping to most places on the net, milliseconds
RTT_LATENCY=40
# RATE_UP must be less than your connection's upload capacity in
# kbits/sec. If it is larger, then the bottleneck will be at your
# router's queue, which you do not control. This will cause congestion
# and a revert to normal TCP fairness no matter what the queing
# priority is.
RATE_UP=5000
# RATE_UP_TOR is the minimum speed your Tor connections will have in
# kbits/sec. They will have at least this much bandwidth for upload.
# In general, you probably shouldn't set this too low, or else Tor
# users who use your node will be completely choked out whenever your
# machine does any other network activity. That is not very fun.
RATE_UP_TOR=1500
# RATE_UP_TOR_CEIL is the maximum rate allowed for all Tor traffic in
# kbits/sec.
RATE_UP_TOR_CEIL=5000
CHAIN=OUTPUT
#CHAIN=PREROUTING
#CHAIN=POSTROUTING
MTU=1500
AVG_PKT=900 # should be more like 600 for non-exit nodes
# END USER TUNABLE PARAMETERS
# The queue size should be no larger than your bandwidth-delay
# product. This is RT latency*bandwidth/MTU/2
BDP=$(expr $RTT_LATENCY \* $RATE_UP / $AVG_PKT)
# Further research indicates that the BDP calculations should use
# RTT/sqrt(n) where n is the expected number of active connections..
BDP=$(expr $BDP / 4)
if [ "$1" = "status" ]
then
echo "[qdisc]"
tc -s qdisc show dev $DEV
tc -s qdisc show dev imq0
echo "[class]"
tc -s class show dev $DEV
tc -s class show dev imq0
echo "[filter]"
tc -s filter show dev $DEV
tc -s filter show dev imq0
echo "[iptables]"
iptables -t mangle -L TORSHAPER-OUT -v -x 2> /dev/null
exit
fi
# Reset everything to a known state (cleared)
tc qdisc del dev $DEV root 2> /dev/null > /dev/null
tc qdisc del dev imq0 root 2> /dev/null > /dev/null
iptables -t mangle -D POSTROUTING -o $DEV -j TORSHAPER-OUT 2> /dev/null > /dev/null
iptables -t mangle -D PREROUTING -o $DEV -j TORSHAPER-OUT 2> /dev/null > /dev/null
iptables -t mangle -D OUTPUT -o $DEV -j TORSHAPER-OUT 2> /dev/null > /dev/null
iptables -t mangle -F TORSHAPER-OUT 2> /dev/null > /dev/null
iptables -t mangle -X TORSHAPER-OUT 2> /dev/null > /dev/null
ip link set imq0 down 2> /dev/null > /dev/null
rmmod imq 2> /dev/null > /dev/null
if [ "$1" = "stop" ]
then
echo "Shaping removed on $DEV."
exit
fi
# Outbound Shaping (limits total bandwidth to RATE_UP)
ip link set dev $DEV qlen $BDP
# Add HTB root qdisc, default is high prio
tc qdisc add dev $DEV root handle 1: htb default 20
# Add main rate limit class
tc class add dev $DEV parent 1: classid 1:1 htb rate ${RATE_UP}kbit
# Create the two classes, giving Tor at least RATE_UP_TOR kbit and capping
# total upstream at RATE_UP so the queue is under our control.
tc class add dev $DEV parent 1:1 classid 1:20 htb rate $(expr $RATE_UP - $RATE_UP_TOR)kbit ceil ${RATE_UP}kbit prio 0
tc class add dev $DEV parent 1:1 classid 1:21 htb rate $[$RATE_UP_TOR]kbit ceil ${RATE_UP_TOR_CEIL}kbit prio 10
# Start up pfifo
tc qdisc add dev $DEV parent 1:20 handle 20: pfifo limit $BDP
tc qdisc add dev $DEV parent 1:21 handle 21: pfifo limit $BDP
# filter traffic into classes by fwmark
tc filter add dev $DEV parent 1:0 prio 0 protocol ip handle 20 fw flowid 1:20
tc filter add dev $DEV parent 1:0 prio 0 protocol ip handle 21 fw flowid 1:21
# add TORSHAPER-OUT chain to the mangle table in iptables
iptables -t mangle -N TORSHAPER-OUT
iptables -t mangle -I $CHAIN -o $DEV -j TORSHAPER-OUT
# Set firewall marks
# Low priority to Tor
if [ ""$TOR_IP == "" ]
then
echo "Using UID-based QoS. UID $TOR_UID marked as low priority."
iptables -t mangle -A TORSHAPER-OUT -m owner --uid-owner $TOR_UID -j MARK --set-mark 21
else
echo "Using IP-based QoS. $TOR_IP marked as low priority."
iptables -t mangle -A TORSHAPER-OUT -s $TOR_IP -j MARK --set-mark 21
fi
# High prio for everything else
iptables -t mangle -A TORSHAPER-OUT -m mark --mark 0 -j MARK --set-mark 20
echo "Outbound shaping added to $DEV. Rate for Tor upload at least: ${RATE_UP_TOR}Kbyte/sec."

View File

@ -1,144 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>This is a Tor Exit Router</title>
<!--
This notice is intended to be placed on a virtual host for a domain that
your Tor exit node IP reverse resolves to so that people who may be about
to file an abuse complaint would check it first before bothering you or
your ISP. Ex:
http://tor-exit.yourdomain.org or http://tor-readme.yourdomain.org.
This type of setup has proven very effective at reducing abuse complaints
for exit node operators.
There are a few places in this document that you may want to customize.
They are marked with FIXME.
-->
</head>
<body>
<p style="text-align:center; font-size:xx-large; font-weight:bold">This is a
Tor Exit Router</p>
<p>
Most likely you are accessing this website because you had some issue with
the traffic coming from this IP. This router is part of the <a
href="https://www.torproject.org/">Tor Anonymity Network</a>, which is
dedicated to <a href="https://www.torproject.org/about/overview">providing
privacy</a> to people who need it most: average computer users. This
router IP should be generating no other traffic, unless it has been
compromised.</p>
<!-- FIXME: you should probably grab your own copy of how_tor_works_thumb.png
and serve it locally -->
<p style="text-align:center">
<a href="https://www.torproject.org/about/overview">
<img src="https://www.torproject.org/images/how_tor_works_thumb.png" alt="How Tor works" style="border-style:none"/>
</a></p>
<p>
Tor sees use by <a href="https://www.torproject.org/about/torusers">many
important segments of the population</a>, including whistle blowers,
journalists, Chinese dissidents skirting the Great Firewall and oppressive
censorship, abuse victims, stalker targets, the US military, and law
enforcement, just to name a few. While Tor is not designed for malicious
computer users, it is true that they can use the network for malicious ends.
In reality however, the actual amount of <a
href="https://www.torproject.org/docs/faq-abuse">abuse</a> is quite low. This
is largely because criminals and hackers have significantly better access to
privacy and anonymity than do the regular users whom they prey upon. Criminals
can and do <a
href="http://voices.washingtonpost.com/securityfix/2008/08/web_fraud_20_tools.html">build,
sell, and trade</a> far larger and <a
href="http://voices.washingtonpost.com/securityfix/2008/08/web_fraud_20_distributing_your.html">more
powerful networks</a> than Tor on a daily basis. Thus, in the mind of this
operator, the social need for easily accessible censorship-resistant private,
anonymous communication trumps the risk of unskilled bad actors, who are
almost always more easily uncovered by traditional police work than by
extensive monitoring and surveillance anyway.</p>
<p>
In terms of applicable law, the best way to understand Tor is to consider it a
network of routers operating as common carriers, much like the Internet
backbone. However, unlike the Internet backbone routers, Tor routers
explicitly do not contain identifiable routing information about the source of
a packet, and no single Tor node can determine both the origin and destination
of a given transmission.</p>
<p>
As such, there is little the operator of this router can do to help you track
the connection further. This router maintains no logs of any of the Tor
traffic, so there is little that can be done to trace either legitimate or
illegitimate traffic (or to filter one from the other). Attempts to
seize this router will accomplish nothing.</p>
<!-- FIXME: US-Only section. Remove if you are a non-US operator -->
<p>
Furthermore, this machine also serves as a carrier of email, which means that
its contents are further protected under the ECPA. <a
href="http://www.law.cornell.edu/uscode/text/18/2707">18
USC 2707</a> explicitly allows for civil remedies ($1000/account
<i><b>plus</b></i> legal fees)
in the event of a seizure executed without good faith or probable cause (it
should be clear at this point that traffic with an originating IP address of
FIXME_DNS_NAME should not constitute probable cause to seize the
machine). Similar considerations exist for 1st amendment content on this
machine.</p>
<!-- FIXME: May or may not be US-only. Some non-US tor nodes have in
fact reported DMCA harassment... -->
<p>
If you are a representative of a company who feels that this router is being
used to violate the DMCA, please be aware that this machine does not host or
contain any illegal content. Also be aware that network infrastructure
maintainers are not liable for the type of content that passes over their
equipment, in accordance with <a
href="http://www.law.cornell.edu/uscode/text/17/512">DMCA
"safe harbor" provisions</a>. In other words, you will have just as much luck
sending a takedown notice to the Internet backbone providers. Please consult
<a href="https://www.torproject.org/eff/tor-dmca-response">EFF's prepared
response</a> for more information on this matter.</p>
<p>For more information, please consult the following documentation:</p>
<ol>
<li><a href="https://www.torproject.org/about/overview">Tor Overview</a></li>
<li><a href="https://www.torproject.org/docs/faq-abuse">Tor Abuse FAQ</a></li>
<li><a href="https://www.torproject.org/eff/tor-legal-faq">Tor Legal FAQ</a></li>
</ol>
<p>
That being said, if you still have a complaint about the router, you may
email the <a href="mailto:FIXME_YOUR_EMAIL_ADDRESS">maintainer</a>. If
complaints are related to a particular service that is being abused, I will
consider removing that service from my exit policy, which would prevent my
router from allowing that traffic to exit through it. I can only do this on an
IP+destination port basis, however. Common P2P ports are
already blocked.</p>
<p>
You also have the option of blocking this IP address and others on
the Tor network if you so desire. The Tor project provides a <a
href="https://check.torproject.org/cgi-bin/TorBulkExitList.py">web service</a>
to fetch a list of all IP addresses of Tor exit nodes that allow exiting to a
specified IP:port combination, and an official <a
href="https://www.torproject.org/tordnsel/dist/">DNSRBL</a> is also available to
determine if a given IP address is actually a Tor exit server. Please
be considerate
when using these options. It would be unfortunate to deny all Tor users access
to your site indefinitely simply because of a few bad apples.</p>
</body>
</html>

12
contrib/osx/Makefile.am Normal file
View File

@ -0,0 +1,12 @@
# XXX Is this define necessary, or is it redundant with the
# one from the top-level configure? -RD
confdir = $(sysconfdir)/Tor
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.in TorStartupInfo.plist \
package.sh privoxy.config TorPostflight addsysuser \
Tor_Uninstaller.applescript uninstall_tor_bundle.sh \
TorbuttonInfo.plist TorbuttonDesc.plist \
package_list.txt tor_logo.gif TorPreFlight

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionTitle</key>
<string>Privoxy configuration for Tor</string>
<key>IFPkgDescriptionVersion</key>
<string>0.1</string>
</dict>
</plist>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>Privoxy configuration for Tor</string>
<key>CFBundleGetInfoString</key>
<string>Privoxy configuration for Tor</string>
<key>CFBundleName</key>
<string>Privoxy configuration for Tor</string>
<key>CFBundleSortVersionString</key>
<string>0.1</string>
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
<key>IFPkgFlagRestartAction</key>
<string>RecommendedRestart</string>
<key>IFPkgFlagFollowLinks</key>
<true/>
<key>IFPkgFlagIsRequired</key>
<false/>
</dict>
</plist>

7
contrib/osx/ReadMe.rtf Normal file
View File

@ -0,0 +1,7 @@
{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh9000\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f0\fs24 \cf0 Tor is a toolset for a wide range of organizations and people who 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 build new applications with built-in anonymity, safety, and privacy features.}

View File

@ -0,0 +1,13 @@
{
Description = "Tor";
Provides = ("tor");
Requires = ("Network");
Uses = ("Network");
OrderPreference = "Last";
Messages =
{
start = "Starting Tor";
stop = "Stopping Tor";
};
}

86
contrib/osx/Tor Executable file
View File

@ -0,0 +1,86 @@
#!/bin/sh
TORLOC=/Library/StartupItems/Tor/Tor.loc
if [ -f $TORLOC ]; then
TORDIR=`cat /Library/StartupItems/Tor/Tor.loc`
if [ "x$TORDIR" = "x" -o ! -d $TORDIR -o ! -x $TORDIR/tor ]; then
TORDIR=/Library/Tor
fi
else
TORDIR=/Library/Tor
fi
TORCONF=$TORDIR/torrc
TORDATA=$TORDIR/var/lib/tor
TORPID=/var/run/Tor.pid
TORUSER=_tor
TORGROUP=daemon
TORCMD=$TORDIR/tor
TORLOG=/var/log/tor.log
## Determine OSX Version
# map version to name
if [ -x /usr/bin/sw_vers ]; then
# This is poor, yet functional. We don't care about the 3rd number in
# the OS version
OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
case "$OSVER" in
"10.5") OS="leopard" ARCH="universal";;
"10.4") OS="tiger" ARCH="universal";;
"10.3") OS="panther" ARCH="ppc";;
"10.2") OS="jaguar" ARCH="ppc";;
"10.1") OS="puma" ARCH="ppc";;
"10.0") OS="cheetah" ARCH="ppc";;
esac
else
OS="unknown"
fi
if [ $ARCH != "universal" ]; then
export EVENT_NOKQUEUE=1
fi
##
# Tor Service
##
. /etc/rc.common
StartService ()
{
if [ -f $TORCMD ]; then
if pid=$(GetPID Tor); then
return 0
else
ConsoleMessage "Starting Tor Service"
# Tentative
# Making sure it is not running (I know it is not a best approarch)
killall tor 2>/dev/null
$TORCMD -f "$TORCONF" --runasdaemon 1 --pidfile "$TORPID" --datadirectory "$TORDATA" --user "$TORUSER" --group "$TORGROUP" --log "notice file $TORLOG" &
fi
fi
}
StopService ()
{
if pid=$(GetPID Tor); then
ConsoleMessage "Stopping Tor Service"
kill -TERM "${pid}"
# Just for sanity (sometimes necessary.)
killall tor 2>/dev/null
else
ConsoleMessage "Tor Service not responding."
# Just for sanity (sometimes necessary.)
killall tor 2>/dev/null
fi
}
RestartService () { StopService; StartService; }
if [ "$#" = 0 ]; then
echo "Syntax: tor {start|stop}"
exit 1
fi
RunService "$1"

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionDeleteWarning</key>
<string></string>
<key>IFPkgDescriptionDescription</key>
<string>Bundled package of Tor @VERSION@, Privoxy 3.0.6, and Torbutton.</string>
<key>IFPkgDescriptionTitle</key>
<string>Tor - Privoxy - Torbutton Bundle</string>
<key>IFPkgDescriptionVersion</key>
<string>@VERSION@</string>
</dict>
</plist>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>Tor Bundle</string>
<key>CFBundleGetInfoString</key>
<string>Tor Bundle @VERSION@</string>
<key>CFBundleIdentifier</key>
<string>net.freehaven.torbundle</string>
<key>CFBundleSortVersionString</key>
<string>@VERSION@</string>
<key>IFPkgFlagComponentDirectory</key>
<string>../.contained_packages</string>
<key>IFPkgFlagPackageList</key>
<array>
<dict>
<key>IFPkgFlagPackageLocation</key>
<string>Tor.pkg</string>
<key>IFPkgFlagPackageSelection</key>
<string>required</string>
</dict>
<dict>
<key>IFPkgFlagPackageLocation</key>
<string>Privoxy.pkg</string>
<key>IFPkgFlagPackageSelection</key>
<string>selected</string>
</dict>
<dict>
<key>IFPkgFlagPackageLocation</key>
<string>privoxyconf.pkg</string>
<key>IFPkgFlagPackageSelection</key>
<string>selected</string>
</dict>
<dict>
<key>IFPkgFlagPackageLocation</key>
<string>torstartup.pkg</string>
<key>IFPkgFlagPackageSelection</key>
<string>selected</string>
</dict>
<dict>
<key>IFPkgFlagPackageLocation</key>
<string>torbutton.pkg</string>
<key>IFPkgFlagPackageSelection</key>
<string>selected</string>
</dict>
</array>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
</dict>
</plist>

View File

@ -0,0 +1,38 @@
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Oblique;\f2\fswiss\fcharset77 Helvetica-Bold;
}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh9000\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\f0\fs24 \cf0 Welcome to Tor - Privoxy - Torbutton Bundle installer.\
This will install Tor, Privoxy, and Torbutton in your computer.\
\
\f1\i Tor, Privoxy, and Torbutton are separate products.\
They are packaged together for your convenience.
\f2\i0\b \
\f0\b0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f2\b \cf0 Tor
\f0\b0 is a system for using the Internet anonymously, and allowing\
others to do so.\
\
For more information, please visit https://www.torproject.org/\
\
\f2\b Privoxy
\f0\b0 stands between your web browser and Tor to make your web surfing experience safer.\
\
For more information, please visit http://www.privoxy.org/\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f2\b \cf0 Torbutton
\f0\b0 is a 1-click way for Firefox users to enable or disable the browser's use of Tor.
\f1\i Torbutton will not install if you do not have Firefox installed.
\f0\i0 \
\
For more information, please visit https://torbutton.torproject.org/}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionTitle</key>
<string>Tor</string>
<key>IFPkgDescriptionVersion</key>
<string>@VERSION@</string>
</dict>
</plist>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>Tor @VERSION@</string>
<key>CFBundleGetInfoString</key>
<string>Tor @VERSION@</string>
<key>CFBundleName</key>
<string>Tor</string>
<key>CFBundleSortVersionString</key>
<string>@VERSION@</string>
<key>IFPkgFlagAllowBackRev</key>
<true/>
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
<key>IFPkgFlagFollowLinks</key>
<true/>
<key>IFPkgFlagIsRequired</key>
<true/>
<key>IFPkgFlagRootVolumeOnly</key>
<true/>
<key>IfPkgFlagBackgroundScaling</key>
<string>proportional</string>
<key>IFPkgFlagBackgroundAlignment</key>
<string>bottomleft</string>
</dict>
</plist>

138
contrib/osx/TorPostflight Normal file
View File

@ -0,0 +1,138 @@
#!/bin/sh
# ====================================================================
# TorPostFlight is distributed under this license
#
# Copyright (c) 2006 Andrew Lewman
#
# 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.
# ======================================================================
# TorPostflight gets invoked after any install or upgrade.
ADDSYSUSER=$RECEIPT_PATH/addsysuser
if [ ! -x "$ADDSYSUSER" ]; then
echo "Could not find addsysuser script."
exit 1
fi
TORUSER=_tor
TORGROUP=daemon
TARGET=$2/Library/Tor
TORDIR=$TARGET/var/lib/tor
LOGFILE=/var/log/tor.log
TORBUTTON_VERSION="1.0.4.01-fx+tb"
# Check defaults for TARGET
if [ "$TARGET" == "//Library/Tor" ]; then
TARGET=/Library/Tor
fi
# Create user $TORUSER in group daemon. If it's already there, great.
$ADDSYSUSER $TORUSER "Tor System user" $TORDIR
# Create the tor directory, if it doesn't exist.
if [ ! -d $TORDIR ]; then
mkdir -p $TORDIR
fi
# Check its permissions.
chown $TORUSER $TORDIR
chgrp daemon $TORDIR
chmod 700 $TORDIR
if [ ! -f $LOGFILE ]; then
touch $LOGFILE
chown $TORUSER $LOGFILE
chgrp daemon $LOGFILE
chmod 660 $LOGFILE
fi
# Create the configuration file only if there wasn't one already.
if [ ! -f $TARGET/torrc ]; then
cp $TARGET/torrc.sample $TARGET/torrc
fi
# Ensure symbolic links
cd /usr/bin
if [ -e /usr/bin/tor -a ! -L /usr/bin/tor ]; then
mv tor tor_old
fi
if [ -e /usr/bin/tor-resolve -a ! -L /usr/bin/tor-resolve ]; then
mv tor-resolve tor-resolve_old
fi
ln -sf $TARGET/tor .
ln -sf $TARGET/tor-resolve .
cd /usr/share/man/man1
MAN1=$TARGET/share/man/man1
#ln -sf $MAN1/*.1 .
if [ -d /Library/StartupItems/Privoxy ]; then
find /Library/StartupItems/Privoxy -print0 | xargs -0 chown root:wheel
fi
# Copy Documentation
if [ -d $PACKAGE_PATH/Contents/Resources/documents ];then
cp -r $PACKAGE_PATH/Contents/Resources/documents $TARGET/documents
fi
# Copy Uninstaller
if [ -f $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript ]; then
cp $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript $TARGET/Tor_Uninstaller.applescript
chmod 550 $TARGET/Tor_Uninstaller.applescript
fi
if [ -f $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh ]; then
cp $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh $TARGET/uninstall_tor_bundle.sh
chmod 550 $TARGET/uninstall_tor_bundle.sh
fi
if [ -f $PACKAGE_PATH/Contents/Resources/package_list.txt ]; then
cp $PACKAGE_PATH/Contents/Resources/package_list.txt $TARGET/package_list.txt
fi
if [ -d /Library/StartupItems/Tor ]; then
rm -f /Library/StartupItems/Tor/Tor.loc
echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc
fi
if [ -f /Applications/Firefox.app/Contents/MacOS/firefox ]; then
if [ -f $TARGET/torbutton-$TORBUTTON_VERSION.xpi ]; then
/Applications/Firefox.app/Contents/MacOS/firefox -install-global-extension $TARGET/torbutton-$TORBUTTON_VERSION.xpi
# The following is a kludge to get around the fact that the installer
# runs as root. This means the Torbutton extension will install with
# root permissions; thereby making uninstalling Torbutton from inside
# Firefox impossible. The user will be caught in an endless loop of
# uninstall -> automatic re-installation of Torbutton. The OSX
# installer doesn't tell you the owner of Firefox, therefore we have to
# parse it.
USR=`ls -alrt /Applications/Firefox.app/Contents/MacOS/extensions/ | tail -1 | awk '{print $3}'`
GRP=`ls -alrt /Applications/Firefox.app/Contents/MacOS/extensions/ | tail -1 | awk '{print $4}'`
chown -R $USR:$GRP /Applications/Firefox.app/Contents/MacOS/extensions/
fi
fi

59
contrib/osx/TorPreFlight Normal file
View File

@ -0,0 +1,59 @@
#!/bin/sh
#
# ===================================================================
#
# TorPreFlight is distributed under this license:
#
# Copyright (c) 2006 Andrew Lewman
#
# 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.
#===============================================================================
# TorPreFlight is invoked before the install begins
# Figure out where Tor is installed
if [ -f /Library/StartupItems/Tor/Tor.loc ]; then
TORPATH=`cat /Library/StartupItems/Tor/Tor.loc`
else
TORPATH="/Library/Tor/"
fi
if [ -f /Library/StartupItems/Privoxy/Privoxy.loc ]; then
PRIVOXYPATH=`cat /Library/StartupItems/Privoxy/Privoxy.loc`
else
PRIVOXYPATH="/Library/Privoxy/"
fi
# Backup all of Tor, just in case
if [ -d $TORPATH ]; then
cp $TORPATH/torrc $TORPATH/torrc.installer-saved
cp $PRIVOXYPATH/config $PRIVOXYPATH/config.installer-saved
cp $PRIVOXYPATH/user.action $PRIVOXYPATH/user.action.installer-saved
fi

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionTitle</key>
<string>Tor Startup Script</string>
<key>IFPkgDescriptionVersion</key>
<string>@VERSION@</string>
</dict>
</plist>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>Tor Startup Script</string>
<key>CFBundleGetInfoString</key>
<string>Tor Startup Script</string>
<key>CFBundleName</key>
<string>Tor Startup Script</string>
<key>CFBundleSortVersionString</key>
<string>0.1</string>
<key>IFPkgFlagAllowBackRev</key>
<true/>
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
<key>IFPkgFlagRestartAction</key>
<string>NoRestart</string>
<key>IFPkgFlagFollowLinks</key>
<true/>
<key>IFPkgFlagIsRequired</key>
<false/>
<key>IFPkgFlagRootVolumeOnly</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,68 @@
-- Tor Uninstaller.applescript
-- Tor Uninstaller
-- ===============================================================================
-- Tor Uninstaller is distributed under this license:
--
-- Copyright (c) 2005 Andrew Lewman ( pgp key: 31B0974B )
--
-- 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.
-- ===============================================================================
on run
-- Validate & find disk paths
set boot_disk to (path to startup disk) as string
set default_tor_path to boot_disk & "Library:Tor"
set default_privoxy_path to boot_disk & "Library:Privoxy"
set default_tor_startup_path to boot_disk & "Library:StartupItems:Tor"
set default_privoxy_startup_path to boot_disk & "Library:StartupItems:Privoxy"
set shell_script to default_tor_path & ":uninstall_tor_bundle.sh"
set doomed_path_list to {default_tor_path, default_privoxy_path, default_tor_startup_path, default_privoxy_startup_path}
-- Display what we're removing and ask for validation
-- this is the simplest way to do this
set remove_me to display dialog "Welcome to the Tor + Privoxy Uninstaller. This program will remove:" & return & return & POSIX path of default_tor_path & return & POSIX path of default_privoxy_path & return & POSIX path of default_tor_startup_path & return & POSIX path of default_privoxy_startup_path & return & return & "If this looks correct, choose Yes. Otherwise, choose No." buttons {"Yes", "No"} default button "No"
-- Run a shell script to do all the unix work since applescript can't see it at all
if button returned of result is "Yes" then
try
do shell script (POSIX path of shell_script) with administrator privileges
on error
display dialog "Too many errors, quitting." buttons {"Quit"} default button "Quit" with icon stop giving up after 3
quit
end try
-- So Long and Thanks for all the Fish!
display dialog "Thank you for using tor!" buttons {"Ok"} giving up after 3
else
display dialog "Thank you for your continued use of Tor & Privoxy" buttons {"You're welcome."} giving up after 3
end if
end run
-- We're done

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionTitle</key>
<string>Torbutton Extension for Firefox</string>
<key>IFPkgDescriptionVersion</key>
<string>0.1</string>
</dict>
</plist>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>Torbutton Extension for Firefox</string>
<key>CFBundleGetInfoString</key>
<string>Torbutton configuration for Tor</string>
<key>CFBundleName</key>
<string>Torbutton configuration for Tor</string>
<key>CFBundleSortVersionString</key>
<string>0.1</string>
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
<key>IFPkgFlagRestartAction</key>
<string>RecommendedRestart</string>
<key>IFPkgFlagFollowLinks</key>
<true/>
<key>IFPkgFlagIsRequired</key>
<false/>
</dict>
</plist>

83
contrib/osx/addsysuser Executable file
View File

@ -0,0 +1,83 @@
#!/bin/sh
#
# Original adduser 05 Feb 2002 by Jon L. Gardner
#
# Modified for Tor installer by Nick Mathewson
# 2007-06-12 Modified for leopard by Andrew Lewman
# Copyright (c) 2007 Andrew Lewman
#
ROOTPROP=/
if [ "`whoami`" != "root" ]; then
echo "You must be root to execute this script."
exit
fi
if [ "x$3" = "x" ]; then
echo 'Usage: addsysuser <username> "<full name>" <homedir>'
exit 0
fi
username=$1
realname=$2
homedir=$3
if [ -x /usr/bin/dscl ]; then
# Determine the gid of the daemon group
gid=`dscl . -read /groups/daemon gid`
if [ "x`dscl . -list /users|cut -f2 -d' '|grep $username`" != "x" ]; then
echo The account $username already exists.
exit 0
fi
if [ -x /usr/bin/nidump ]; then
uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1`
else
_tmp=/tmp/_dsexport_tmp.txt.$$
rm -f $_tmp
dsexport $_tmp '/Local/Default' 'dsRecTypeStandard:Users' > /dev/null 2>&1
uiddef=`cat $_tmp | sed 's/\\\://g' | cut -d: -f6 | grep '^[0-9]' | sort -n | grep -v '^[56789]..' | grep -v '^....$' | tail -n 1`
rm -f $_tmp
fi
uiddef=`echo $uiddef + 1 | bc`
dscl . -create /users/$username uid $uiddef
# home is the local path to the home directory
home=/Users/$username
echo Creating account for $username...
dscl . -create /users/$username
dscl . -create /users/$username _writers_tim_passwd $username
dscl . -create /users/$username realname $realname
dscl . -create /users/$username _writers_passwd $username
dscl . -create /users/$username gid $gid
dscl . -create /users/$username home $homedir
dscl . -create /users/$username name $username
dscl . -create /users/$username passwd '*'
dscl . -create /users/$username shell /dev/null
else
# Determine the gid of the daemon group
gid=`niutil -readprop $ROOTPROP /groups/daemon gid`
if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then
echo The account $username already exists.
exit 0
fi
# home is the local path to the home directory
home=/Users/$username
# defhome is what goes into NetInfo
defhome="/Network/Servers/MyServer/Users"
#echo "Determining next available system uid (please be patient)..."
# Uids over 500 are for system users.
uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1`
uiddef=`echo $uiddef + 1 |bc`
echo Creating account for $username...
niutil -create $ROOTPROP /users/$username
niutil -createprop $ROOTPROP /users/$username _writers_tim_passwd $username
niutil -createprop $ROOTPROP /users/$username realname $realname
niutil -createprop $ROOTPROP /users/$username _writers_passwd $username
niutil -createprop $ROOTPROP /users/$username uid $uiddef
#niutil -createprop $ROOTPROP /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>"
niutil -createprop $ROOTPROP /users/$username gid $gid
niutil -createprop $ROOTPROP /users/$username home $homedir
niutil -createprop $ROOTPROP /users/$username name $username
niutil -createprop $ROOTPROP /users/$username passwd '*'
niutil -createprop $ROOTPROP /users/$username shell /dev/null
fi

214
contrib/osx/package.sh Normal file
View File

@ -0,0 +1,214 @@
#!/bin/sh
# $Id$
# Copyright 2004-2005 Nick Mathewson.
# Copyright 2005-2008 Andrew Lewman
# See LICENSE in Tor distribution for licensing information.
# This script builds a Macintosh OS X metapackage containing 4 packages:
# - One for Tor.
# - One for Privoxy.
# - One for a tor-specific privoxy configuration script.
# - One for Startup scripts for Tor.
# - One for Torbutton, an extension for FireFox
#
# This script expects to be run from the toplevel makefile, with VERSION
# set to the latest Tor version, and Tor already built.
#
# Read the documentation located in tor/doc/tor-osx-dmg-creation.txt on
# how to build Tor for OSX
# Where have we put the zip file containing Privoxy? Edit this if your
# privoxy lives somewhere else.
PRIVOXY_PKG_ZIP=~/tmp/privoxyosx_setup_3.0.6.zip
# Where have we put the xpi and license for Torbutton? Edit this if your
# torbutton and torbutton license live somewhere else.
TORBUTTON_PATH=~/tmp/torbutton-1.0.4.01-fx+tb.xpi
TORBUTTON_LIC_PATH=~/tmp/LICENSE
###
# Helpful info on OS X packaging:
# http://developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution/index.html
# man packagemaker
# Make sure VERSION is set, so we don't name the package
# "Tor--$OS-$ARCH-Bundle.dmg"
if [ "XX$VERSION" = 'XX' ]; then
echo "VERSION not set."
exit 1
fi
## Determine OSX Version
# map version to name
if [ -x /usr/bin/sw_vers ]; then
# This is poor, yet functional. We don't care about the 3rd number in
# the OS version
OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
case "$OSVER" in
"10.5") OS="leopard" ARCH="universal";;
"10.4") OS="tiger" ARCH="universal";;
"10.3") OS="panther" ARCH="ppc";;
"10.2") OS="jaguar" ARCH="ppc";;
"10.1") OS="puma" ARCH="ppc";;
"10.0") OS="cheetah" ARCH="ppc";;
*) OS="unknown";;
esac
else
OS="unknown"
fi
# Where will we put our temporary files?
BUILD_DIR=/tmp/tor-osx-$$
# Path to PackageMaker app.
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
umask 022
echo I might ask you for your password now, so you can sudo.
sudo rm -rf $BUILD_DIR
mkdir $BUILD_DIR || exit 1
for subdir in tor_packageroot tor_resources \
torstartup_packageroot \
privoxyconf_packageroot \
torbundle_resources \
torbutton_packageroot \
output; do
mkdir $BUILD_DIR/$subdir
done
### Make Tor package.
make install DESTDIR=$BUILD_DIR/tor_packageroot
#mv $BUILD_DIR/tor_packageroot/Library/Tor/torrc.sample $BUILD_DIR/tor_packageroot/Library/Tor/torrc
cp contrib/osx/ReadMe.rtf $BUILD_DIR/tor_resources
#cp contrib/osx/License.rtf $BUILD_DIR/tor_resources
chmod 755 contrib/osx/TorPostflight
cp contrib/osx/TorPostflight $BUILD_DIR/tor_resources/postflight
cp contrib/osx/addsysuser $BUILD_DIR/tor_resources/addsysuser
cp contrib/osx/Tor_Uninstaller.applescript $BUILD_DIR/tor_resources/Tor_Uninstaller.applescript
cp contrib/osx/uninstall_tor_bundle.sh $BUILD_DIR/tor_resources/uninstall_tor_bundle.sh
cp contrib/osx/package_list.txt $BUILD_DIR/tor_resources/package_list.txt
cp contrib/osx/tor_logo.gif $BUILD_DIR/tor_resources/background.gif
cat <<EOF > $BUILD_DIR/tor_resources/Welcome.txt
Tor: an anonymous Internet communication system
Tor is a system for using the internet anonymously, and allowing
others to do so.
EOF
### Assemble documentation
DOC=$BUILD_DIR/tor_resources/documents
mkdir $DOC
mkdir $DOC/howto
#cp doc/website/stylesheet.css doc/website/tor-doc-osx.html.* $DOC/howto
#cp doc/website/tor-doc-server.html.* $DOC/howto
#cp doc/website/tor-hidden-service.html.* $DOC/howto
#cp doc/website/tor-switchproxy.html.* $DOC/howto
#mkdir $DOC/img
#cp doc/img/screenshot-osx* $DOC/img
cp AUTHORS $DOC/AUTHORS.txt
groff doc/tor.1.in -T ps -m man | pstopdf -i -o $DOC/tor-reference.pdf
groff doc/tor-resolve.1 -T ps -m man | pstopdf -i -o $DOC/tor-resolve.pdf
mkdir $DOC/Advanced
cp doc/spec/tor-spec.txt \
doc/spec/rend-spec.txt \
doc/spec/control-spec.txt \
doc/spec/socks-extensions.txt \
doc/spec/version-spec.txt \
doc/spec/address-spec.txt \
doc/spec/path-spec.txt \
$DOC/Advanced
cp doc/HACKING $DOC/Advanced/HACKING.txt
cp ChangeLog $DOC/Advanced/ChangeLog.txt
find $BUILD_DIR/tor_packageroot -print0 |sudo xargs -0 chown root:wheel
$PACKAGEMAKER -build \
-p $BUILD_DIR/output/Tor.pkg \
-f $BUILD_DIR/tor_packageroot \
-r $BUILD_DIR/tor_resources \
-i contrib/osx/TorInfo.plist \
-d contrib/osx/TorDesc.plist
### Put privoxy configuration package in place.
mkdir -p $BUILD_DIR/privoxyconf_packageroot/Library/Privoxy
cp contrib/osx/privoxy.config $BUILD_DIR/privoxyconf_packageroot/Library/Privoxy/config
find $BUILD_DIR/privoxyconf_packageroot -print0 |sudo xargs -0 chown root:wheel
$PACKAGEMAKER -build \
-p $BUILD_DIR/output/privoxyconf.pkg \
-f $BUILD_DIR/privoxyconf_packageroot \
-i contrib/osx/PrivoxyConfInfo.plist \
-d contrib/osx/PrivoxyConfDesc.plist
### Make Startup Script package
mkdir -p $BUILD_DIR/torstartup_packageroot/Library/StartupItems/Tor
cp contrib/osx/Tor contrib/osx/StartupParameters.plist \
$BUILD_DIR/torstartup_packageroot/Library/StartupItems/Tor
find $BUILD_DIR/torstartup_packageroot -print0 | sudo xargs -0 chown root:wheel
$PACKAGEMAKER -build \
-p $BUILD_DIR/output/torstartup.pkg \
-f $BUILD_DIR/torstartup_packageroot \
-i contrib/osx/TorStartupInfo.plist \
-d contrib/osx/TorStartupDesc.plist
### Make Torbutton Installation package
mkdir -p $BUILD_DIR/torbutton_packageroot/Library/Torbutton
cp $TORBUTTON_PATH $BUILD_DIR/torbutton_packageroot/Library/Torbutton/
cp $TORBUTTON_LIC_PATH $BUILD_DIR/torbutton_packageroot/Library/Torbutton/Torbutton-LICENSE.txt
find $BUILD_DIR/torbutton_packageroot -print0 | sudo xargs -0 chown root:wheel
$PACKAGEMAKER -build \
-p $BUILD_DIR/output/torbutton.pkg \
-f $BUILD_DIR/torbutton_packageroot \
-i contrib/osx/TorbuttonInfo.plist \
-d contrib/osx/TorbuttonDesc.plist
### Assemble the metapackage. Packagemaker won't buld metapackages from
# the command line, so we need to do it by hand.
MPKG=$BUILD_DIR/output/Tor-$VERSION-$OS-$ARCH-Bundle.mpkg
mkdir -p "$MPKG/Contents/Resources"
echo -n "pmkrpkg1" > "$MPKG/Contents/PkgInfo"
cp contrib/osx/ReadMe.rtf "$MPKG/Contents/Resources"
#cp contrib/osx/License.rtf "$MPKG/Contents/Resources"
cp contrib/osx/TorBundleInfo.plist "$MPKG/Contents/Info.plist"
cp contrib/osx/TorBundleWelcome.rtf "$MPKG/Contents/Resources/Welcome.rtf"
cp contrib/osx/TorBundleDesc.plist "$MPKG/Contents/Resources/Description.plist"
cp contrib/osx/tor_logo.gif "$MPKG/Contents/Resources/background.gif"
# Move all the subpackages into place. unzip Privoxy.pkg into place,
# and fix its file permissions so we can rm -rf it later.
mkdir $BUILD_DIR/output/.contained_packages
mv $BUILD_DIR/output/*.pkg $BUILD_DIR/OUTPUT/.contained_packages
( cd $BUILD_DIR/output/.contained_packages && unzip $PRIVOXY_PKG_ZIP && find Privoxy.pkg -type d -print0 | xargs -0 chmod u+w )
### Copy readmes and licenses into toplevel.
PRIVOXY_RESDIR=$BUILD_DIR/output/.contained_packages/Privoxy.pkg/Contents/Resources
cp $PRIVOXY_RESDIR/License.html $BUILD_DIR/output/Privoxy\ License.html
cp $PRIVOXY_RESDIR/ReadMe.txt $BUILD_DIR/output/Privoxy\ ReadMe.txt
cp contrib/osx/ReadMe.rtf $BUILD_DIR/output/Tor\ ReadMe.rtf
cp LICENSE $BUILD_DIR/output/Tor\ License.txt
cp $TORBUTTON_LIC_PATH $BUILD_DIR/output/Torbutton_LICENSE.txt
### Package it all into a DMG
find $BUILD_DIR/output -print0 | sudo xargs -0 chown root:wheel
mv $BUILD_DIR/output "$BUILD_DIR/Tor-$VERSION-$OS-$ARCH-Bundle"
rm -f "Tor-$VERSION-$OS-$ARCH-Bundle.dmg"
USER="`whoami`"
sudo hdiutil create -format UDZO -srcfolder "$BUILD_DIR/Tor-$VERSION-$OS-$ARCH-Bundle" "Tor-$VERSION-$OS-$ARCH-Bundle.dmg"
sudo chown "$USER" "Tor-$VERSION-$OS-$ARCH-Bundle.dmg"
sudo rm -rf $BUILD_DIR

View File

@ -0,0 +1,6 @@
Tor
Privoxy
torstartup
privoxyconf
Vidalia
torbutton

1179
contrib/osx/privoxy.config Normal file

File diff suppressed because it is too large Load Diff

BIN
contrib/osx/tor_logo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,140 @@
#!/bin/sh
#
# not a psueber-pretty uninstall script for the Tor bundle package
# . this currently leaves ~/.tor, /var/log/tor and empty
# directories /Library/Tor, /Library/Privoxy (see comment below)
# . this relies on the fact that the startup items directories (if any)
# will be named the same as the package name (ie. Tor)
#
#
# version history
# initial version - 21 may, 2005 - loki der quaeler
#
#
# comments
# loki: because of the way the Tor package installs itself (the root directory
# is the filesystem root, as opposed to the much nicer way that privoxy
# installs itself with the privoxy home (/Library/Privoxy) as its
# install root directory), i thought it more prudent to leave empty
# directories laying around rather than try to incorrectly intuit from
# the bom contents what directories should exist and which ones could be
# deleted (ie, the Tor package has /Library listed in its bom --
# obviously this is a Bad Thing(tm) to delete).
# + when the Tor installer is changed, this uninstaller could be modified.
# loki: /bin/ps, when run from a terminal window in osX, restricts information
# based on the width of the window. an 80 col window will stupidly cause
# the grep search for the privoxy pid to not find the pid, whereas the grep
# in a wider window succeeds. consider using killall. in the meantime,
# advise uninstall runners to drag wide their terminal window.. ugh
#
### this is the location of a file which contains all the actual package names
## (ie "Tor", "torstartup", ...) the list should be new-line-delimited.
PACKAGE_LIST_SRC=./package_list.txt
### this is the name of the user created in the install process of Tor
TOR_USER=_tor
### these should be constant across all osX installs (so leave them be)
STARTUP_ITEMS_DIR=/Library/StartupItems
PKG_RCPT_BASE_DIR=/Library/Receipts
BOM_INTERMEDIATE_DIR=Contents/Resources
INFO_INTERMEDIATE_DIR=$BOM_INTERMEDIATE_DIR/English.lproj
TEMP_BOM_CONTENTS=/tmp/tor_uninst_scratch
### make sure the script is being run as root, barf if not
if [ "`whoami`" != "root" ]; then
echo "Must be root to run the uninstall script."
exit -1
fi
### check to see if tor is currently running, kill it if it is
## we grep on 'Tor/tor ' because 'tor' is too common (like in 'directory')
## -- this relies on the fact that tor has been started with command
## line arguments.. :-/
TOR_PID=`ps -uax | grep 'Tor/tor ' | grep -v grep | awk '{print $2;}'`
if [ ${#TOR_PID} -gt 0 ]; then
echo ". Killing currently running tor process, pid is $TOR_PID"
kill -9 $TOR_PID
else
echo ". tor process appears to already be stopped"
fi
### check to see if privoxy is currently running, kill it if it is
PRIVOXY_PID=`ps -uax | grep privoxy | grep -v grep | awk '{print $2;}'`
if [ ${#PRIVOXY_PID} -gt 0 ]; then
echo ". Killing currently running privoxy process, pid is $PRIVOXY_PID"
kill -9 $PRIVOXY_PID
else
echo ". privoxy process appears to already be stopped"
fi
## grab each package name from the package list file
while read LINE; do
if [ ${#LINE} -gt 0 ]; then
PACKAGE_NAME=$LINE.pkg
PACKAGE_PATH=$PKG_RCPT_BASE_DIR/$PACKAGE_NAME
echo ". Uninstalling $PACKAGE_NAME"
if [ ! -d $PACKAGE_PATH ]; then
echo " . No receipt exists for this package -- skipping."
continue
fi
## get rid of the startup item if it exists
STARTUP_DIR=$STARTUP_ITEMS_DIR/$LINE
if [ -d $STARTUP_DIR ]; then
echo " . Deleting startup item $STARTUP_DIR"
rm -rf $STARTUP_DIR
fi
## determine the root directory of the the relative paths specified in the bom
DEFAULT_LOC=`grep DefaultLocation $PACKAGE_PATH/$INFO_INTERMEDIATE_DIR/$LINE.info | awk '{print $2;}'`
if [ ${#DEFAULT_LOC} -eq 0 ]; then
echo "!! Could not find default location for $LINE package -- skipping package."
continue
fi
## examine the list of installed items desribed in the bom
BOM_FILE=$PACKAGE_PATH/$BOM_INTERMEDIATE_DIR/$LINE.bom
lsbom $BOM_FILE > $TEMP_BOM_CONTENTS
while read BOM_ITEM; do
## 3 column items describe just directories, 5 column items describe actual files
COL_COUNT=$(echo $BOM_ITEM | awk '{print NF;}')
if [ "$COL_COUNT" -eq 5 ]; then
FILE_NAME=$DEFAULT_LOC/$(echo $BOM_ITEM | awk '{print $1;}')
echo " . Removing $FILE_NAME"
rm -rf $FILE_NAME
fi
done < $TEMP_BOM_CONTENTS
## remove package receipt
echo " . Removing package receipt $PACKAGE_PATH"
rm -rf $PACKAGE_PATH
fi
done < $PACKAGE_LIST_SRC
## nuke the user created by the install process.
echo ". Removing created user $TOR_USER"
if [ -x /usr/bin/dscl ]; then
dscl . -delete /users/$TOR_USER
else
niutil -destroy . /users/$TOR_USER
fi
## clean up
echo ". Cleaning up"
rm -rf $TEMP_BOM_CONTENTS
rm -rf /Library/Privoxy/ /Library/StartupItems/Privoxy/ /Library/Tor/ /Library/StartupItems/Tor/ /Library/Torbutton/
echo ". Finished"

View File

@ -3,8 +3,7 @@
# ===============================================================================
# package_nsis-ming.sh is distributed under this license:
# Copyright (c) 2006-2007 Andrew Lewman
# Copyright (c) 2008 The Tor Project, Inc.
# Copyright (c) 2006-2008 Andrew Lewman
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@ -40,7 +39,7 @@
# you know what you are doing.
# Start in the tor source directory after you've compiled tor.exe
# This means start as ./contrib/win32build/package_nsis-mingw.sh
# This means start as ./contrib/package_nsis-mingw.sh
rm -rf win_tmp
mkdir win_tmp
@ -56,9 +55,10 @@ mkdir win_tmp/tmp
cp src/or/tor.exe win_tmp/bin/
cp src/tools/tor-resolve.exe win_tmp/bin/
cp contrib/win32build/tor.ico win_tmp/bin/
cp src/config/geoip win_tmp/bin/
strip win_tmp/bin/*.exe
cp contrib/tor.ico win_tmp/bin/
# YOU must copy torbutton xpi into the contrib dir
#cp contrib/torbutton-1.0.4-fx+tb.xpi win_tmp/bin/
# There is no man2html in mingw.
# Maybe we should add this into make dist instead.
@ -74,22 +74,24 @@ clean_localstatedir() {
perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg; s{\@LOCALSTATEDIR\@/(lib|log)/tor/}{C:\\Documents and Settings\\Application Data\\Tor\\}' $1 >$2
}
for fn in address-spec.txt bridges-spec.txt control-spec.txt dir-spec.txt path-spec.txt rend-spec.txt socks-extensions.txt tor-spec.txt version-spec.txt; do
for fn in address-spec.txt control-spec.txt control-spec-v0.txt dir-spec.txt dir-spec-v1.txt path-spec.txt rend-spec.txt socks-extensions.txt tor-spec.txt version-spec.txt; do
clean_newlines doc/spec/$fn win_tmp/doc/spec/$fn
done
for fn in HACKING tor-gencert.html tor.html torify.html tor-resolve.html; do
cp doc/design-paper/tor-design.pdf win_tmp/doc/design-paper/tor-design.pdf
for fn in HACKING tor-reference.html tor-resolve.html; do
clean_newlines doc/$fn win_tmp/doc/$fn
done
for fn in README ChangeLog LICENSE; do
for fn in README AUTHORS ChangeLog LICENSE; do
clean_newlines $fn win_tmp/$fn
done
clean_localstatedir src/config/torrc.sample.in win_tmp/src/config/torrc.sample
cp contrib/win32build/tor-mingw.nsi.in win_tmp/contrib/
cp contrib/tor-mingw.nsi.in win_tmp/contrib/
cd win_tmp
makensis.exe contrib/tor-mingw.nsi.in
"C:\Program Files\NSIS\makensis.exe" contrib/tor-mingw.nsi.in

90
contrib/package_nsis-weasel.sh Executable file
View File

@ -0,0 +1,90 @@
#!/bin/sh
set -e
#
# Script to package a Tor installer on win32. This script assumes that
# you have already built Tor, that you are running cygwin, and that your
# environment is basically exactly the same as Nick's.
if ! [ -d Win32Build ] || ! [ -d contrib ]; then
echo "No Win32Build and/or no contrib directory here. Are we in the right place?" >&2
exit 1
fi
rm -rf win_tmp
mkdir win_tmp
mkdir win_tmp/bin
mkdir win_tmp/contrib
mkdir win_tmp/doc
mkdir win_tmp/doc/website
mkdir win_tmp/doc/design-paper
mkdir win_tmp/doc/contrib
mkdir win_tmp/src
mkdir win_tmp/src/config
mkdir win_tmp/tmp
cp Win32Build/vc7/Tor/Debug/Tor.exe win_tmp/bin/tor.exe
cp Win32Build/vc7/tor_resolve/Debug/tor_resolve.exe win_tmp/bin
cp ../c-windows-system32/libeay32.dll win_tmp/bin
cp ../c-windows-system32/ssleay32.dll win_tmp/bin
man2html doc/tor.1.in > win_tmp/tmp/tor-reference.html
man2html doc/tor-resolve.1 > win_tmp/tmp/tor-resolve.html
clean_newlines() {
perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg;' $1 >$2
}
clean_localstatedir() {
perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg; s{\@LOCALSTATEDIR\@/(lib|log)/tor/}{C:\\Documents and Settings\\Application Data\\Tor\\}' $1 >$2
}
for fn in \
doc/HACKING \
doc/control-spec.txt \
doc/dir-spec.txt \
doc/rend-spec.txt \
doc/socks-extensions.txt \
doc/tor-spec.txt \
doc/version-spec.txt \
\
doc/website/* \
; do
clean_newlines "$fn" win_tmp/"$fn"
done
mmv win_tmp/doc/website/"*.html.*" win_tmp/doc/website/"#1.#2.html"
cp doc/design-paper/tor-design.pdf win_tmp/doc/design-paper/tor-design.pdf
for fn in tor-reference.html tor-resolve.html; do \
clean_newlines win_tmp/tmp/$fn win_tmp/doc/$fn
done
for fn in README AUTHORS ChangeLog LICENSE; do \
clean_newlines $fn win_tmp/$fn
done
clean_localstatedir src/config/torrc.sample.in win_tmp/src/config/torrc.sample
cp contrib/tor.nsi.in win_tmp/contrib/tor.nsi
(
echo '/WEBSITE-FILES-HERE/'
echo 'a' # append
for fn in win_tmp/doc/website/*; do
echo -n 'File "..\doc\website\'
echo -n "`basename $fn`"
echo '"'
done
echo "." # end input
echo "w" # write
echo "q" # quit
) | ed win_tmp/contrib/tor.nsi
cd win_tmp/contrib
echo "Now run"
echo ' t:'
echo ' cd \tor\win_tmp\contrib'
echo ' c:\programme\nsis\makensis tor.nsi'
echo ' move tor-*.exe ../../..'

57
contrib/package_nsis.sh Normal file
View File

@ -0,0 +1,57 @@
#!/bin/sh
#
# Script to package a Tor installer on win32. This script assumes that
# you have already built Tor, that you are running cygwin, and that your
# environment is basically exactly the same as Nick's.
# This file is obsolete.
rm -rf win_tmp
mkdir win_tmp
mkdir win_tmp/bin
mkdir win_tmp/contrib
mkdir win_tmp/doc
mkdir win_tmp/doc/design-paper
mkdir win_tmp/doc/contrib
mkdir win_tmp/src
mkdir win_tmp/src/config
mkdir win_tmp/tmp
cp Win32Build/vc7/Tor/Debug/Tor.exe win_tmp/bin/tor.exe
cp Win32Build/vc7/tor_resolve/Debug/tor_resolve.exe win_tmp/bin
cp c:/windows/system32/libeay32.dll win_tmp/bin
cp c:/windows/system32/ssleay32.dll win_tmp/bin
man2html doc/tor.1.in > win_tmp/tmp/tor-reference.html
man2html doc/tor-resolve.1 > win_tmp/tmp/tor-resolve.html
clean_newlines() {
perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg;' $1 >$2
}
clean_localstatedir() {
perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg; s{\@LOCALSTATEDIR\@/(lib|log)/tor/}{C:\\Documents and Settings\\Application Data\\Tor\\}' $1 >$2
}
for fn in tor-spec.txt HACKING rend-spec.txt control-spec.txt \
tor-doc.html tor-doc.css version-spec.txt; do
clean_newlines doc/$fn win_tmp/doc/$fn
done
cp doc/design-paper/tor-design.pdf win_tmp/doc/design-paper/tor-design.pdf
for fn in tor-reference.html tor-resolve.html; do \
clean_newlines win_tmp/tmp/$fn win_tmp/doc/$fn
done
for fn in README AUTHORS ChangeLog LICENSE; do \
clean_newlines $fn win_tmp/$fn
done
clean_localstatedir src/config/torrc.sample.in win_tmp/src/config/torrc.sample
cp contrib/tor.nsi win_tmp/contrib
cd win_tmp/contrib
makensis tor.nsi
mv tor-*.exe ../..

View File

@ -0,0 +1,73 @@
#!/bin/sh
# A script to turn Tor SOCKS4a in Privoxy on or off.
CONFFILE=/etc/privoxy/config # privoxy config file.
TOR_REG="forward.*localhost:9050" # Regular expression to find Tor in privoxy
PRIVOXY="/etc/init.d/privoxy restart" # command to reload privoxy config file.
SED="/bin/sed" # sed command, of course.
GREP="/bin/grep" # grep command.
usage () {
echo "\
privoxy-tor-toggle: Change Privoxy's configuration to use/not use Tor.
Usage:
privoxy.tor <-- Switch Tor on or off.
privoxy.tor [on|off] <-- Set Tor on or off.
privoxy.tor status <-- Display Tor's current status.
privoxy.tor [-h|--help|-?] <-- Print usage.
"
}
# Find out the current status of tor. Set $tor_status
get_status () {
gret=`$GREP -l -e "^$TOR_REG" $CONFFILE`
if [ x$gret = x ] ; then
tor_status=off;
else
tor_status=on;
fi
return
}
# Turn tor on/off according to $1
set_tor () {
tor_gate=$1
get_status
if [ $tor_status = $tor_gate ] ; then
echo "Tor is already $1."
return
elif [ $tor_gate = flip ] ; then
if [ $tor_status = on ] ; then
tor_gate=off
elif [ $tor_status = off ] ; then
tor_gate=on
fi
fi
echo "Turning Tor $tor_gate..."
if [ $tor_gate = on ] ; then
reg=s/^#\($TOR_REG\)/\\1/
$SED -i.bak -r "$reg" $CONFFILE
else
reg=s/^\($TOR_REG\)/#\\1/
$SED -i.bak -r "$reg" $CONFFILE
fi
$PRIVOXY
return 0;
}
if [ x$1 = x ] ; then
set_tor flip
elif [ $1 = on ] ; then
set_tor on
elif [ $1 = off ] ; then
set_tor off
elif [ $1 = status ] ; then
get_status
echo "Tor is $tor_status"
elif [ $1 = --help ] || [ $1 = -h ] || [ $1 = "-?" ] ; then
usage
exit 0
else
echo "Unrecognized option: \"$1\""
fi

View File

@ -0,0 +1,52 @@
Subject:
Re: Anonymous/Nonymous Communication Coexisting?
From:
Kristian Köhntopp <kris@xn--khntopp-90a.de>
Date:
Fri, 10 Jun 2005 08:56:19 +0200
To:
or-talk@freehaven.net
On Wednesday 08 June 2005 04:20, yancm@sdf.lonestar.org wrote:
>> Is it possible to have a single application, such as a web
>> browser or a p2p client behave normally with normal url's but
>> use tor if the url is an xyz.onion address? Or is it
>> everything or nothing?
This is basically a question of using your proxy or not. You can
control the behaviour of your browser in great detail writing a
proxy.pac program in Javascript and setting that program as the
proxy autoconfiguration URL in your browser.
An example:
kris@jordan01:~> cat /srv/www/htdocs/proxy.pac
function FindProxyForURL(url, host)
{
var proxy_yes = "PROXY jordan01.int.cinetic.de:3128";
var proxy_no = "DIRECT";
// Redirect all accesses to mlan hosts to the mlan proxy
if (dnsDomainIs(host, ".mlan.cinetic.de")) {
return proxy_yes;
}
// Everything else is direct
return proxy_no;
}
So here the program checks if the destination is a mlan-Host, and
if so, uses the appropriate proxy on jordan for the access,
while all other accesses are direct.
You could do a similar thing with .onion accesses with a trivial
modification.
Docs:
http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html
Kristian

View File

@ -1,4 +1,5 @@
#!/bin/sh
# $Id$
# $FreeBSD: ports/security/tor-devel/files/tor.in,v 1.1 2006/02/17 22:21:25 mnag Exp $
#
# (rc.subr written by Peter Thoenen for Net/FreeBSD)
@ -13,6 +14,7 @@
# tor_conf (str): Points to your tor conf file
# Default: /usr/local/etc/tor/torrc
# tor_user (str): Tor Daemon user. Default _tor
# tor_groupr (str): Tor Daemon group. Default _tor
#
. /etc/rc.subr
@ -25,6 +27,7 @@ load_rc_config ${name}
: ${tor_enable="NO"}
: ${tor_conf="/usr/local/etc/tor/torrc"}
: ${tor_user="_tor"}
: ${tor_group="_tor"}
: ${tor_pidfile="/var/run/tor/tor.pid"}
: ${tor_logfile="/var/log/tor"}
: ${tor_datadir="/var/run/tor"}
@ -32,7 +35,7 @@ load_rc_config ${name}
required_files=${tor_conf}
required_dirs=${tor_datadir}
command="/usr/local/bin/${name}"
command_args="-f ${tor_conf} --pidfile ${tor_pidfile} --runasdaemon 1 --datadirectory ${tor_datadir} --user ${tor_user}"
command_args="-f ${tor_conf} --pidfile ${tor_pidfile} --runasdaemon 1 --datadirectory ${tor_datadir} --user ${tor_user} --group ${tor_group}"
extra_commands="log"
log_cmd="${name}_log"

3
contrib/suse/Makefile.am Normal file
View File

@ -0,0 +1,3 @@
confdir = $(sysconfdir)/tor
EXTRA_DIST = tor.sh

View File

@ -51,8 +51,6 @@ export TORUSER
TORGROUP=@TORGROUP@
export TORGROUP
TOR_DAEMON_PID_DIR="@LOCALSTATEDIR@/run/tor"
if [ -x /bin/su ] ; then
SUPROG=/bin/su
elif [ -x /sbin/su ] ; then
@ -69,12 +67,6 @@ case "$1" in
start)
echo "Starting tor daemon"
if [ ! -d $TOR_DAEMON_PID_DIR ] ; then
mkdir -p $TOR_DAEMON_PID_DIR
chown $TORUSER:$TORGROUP $TOR_DAEMON_PID_DIR
fi
## Start daemon with startproc(8). If this fails
## the echo return value is set appropriate.

View File

@ -1,6 +1,6 @@
;tor.nsi - A basic win32 installer for Tor
; Originally written by J Doe.
; Modified by Steve Topletz, Andrew Lewman
; Modified by Steve Topletz
; See the Tor LICENSE for licensing information
;-----------------------------------------
;
@ -8,7 +8,8 @@
!include "LogicLib.nsh"
!include "FileFunc.nsh"
!insertmacro GetParameters
!define VERSION "0.3.4.1-alpha-dev"
!define VERSION "0.1.2.19-dev"
!define INSTALLER "tor-${VERSION}-win32.exe"
!define WEBSITE "https://www.torproject.org/"
!define LICENSE "LICENSE"
@ -29,7 +30,7 @@ VIProductVersion "${VERSION}"
VIAddVersionKey "ProductName" "The Onion Router: Tor"
VIAddVersionKey "Comments" "${WEBSITE}"
VIAddVersionKey "LegalTrademarks" "Three line BSD"
VIAddVersionKey "LegalCopyright" "©2004-2008, Roger Dingledine, Nick Mathewson. ©2009 The Tor Project, Inc. "
VIAddVersionKey "LegalCopyright" "©2004-2008, Roger Dingledine, Nick Mathewson"
VIAddVersionKey "FileDescription" "Tor is an implementation of Onion Routing. You can read more at ${WEBSITE}"
VIAddVersionKey "FileVersion" "${VERSION}"
@ -95,11 +96,6 @@ Section "Tor" Tor
Next:
${EndIf}
File /oname=$CONFIGFILE "..\src\config\torrc.sample"
; the geoip file needs to be included and stuffed into the right directory
; otherwise tor is unhappy
SetOutPath $APPDATA\Tor
Call ExtractGEOIP
SectionEnd
Section "Documents" Docs
@ -117,6 +113,7 @@ Section "Start Menu" StartMenu
${If} ${FileExists} "$INSTDIR\Documents\*.*"
Call CreateDocLinks
${EndIf}
endifdocs:
SectionEnd
Section "Desktop" Desktop
@ -147,7 +144,7 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${Tor} "The core executable and config files needed for Tor to run."
!insertmacro MUI_DESCRIPTION_TEXT ${Docs} "Documentation about Tor."
!insertmacro MUI_DESCRIPTION_TEXT ${ShortCuts} "Shortcuts to easily start Tor"
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} "Shortcuts to access Tor and its documentation from the Start Menu"
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} "Shortcuts to access Tor and it's documentation from the Start Menu"
!insertmacro MUI_DESCRIPTION_TEXT ${Desktop} "A shortcut to start Tor from the desktop"
!insertmacro MUI_DESCRIPTION_TEXT ${Startup} "Launches Tor automatically at startup in a minimized window"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
@ -159,20 +156,18 @@ Function ExtractBinaries
File "${BIN}\tor-resolve.exe"
FunctionEnd
Function ExtractGEOIP
File "${BIN}\geoip"
FunctionEnd
Function ExtractIcon
File "${BIN}\tor.ico"
FunctionEnd
Function ExtractSpecs
;File "doc\FAQ"
File "..\doc\HACKING"
File "..\doc\spec\address-spec.txt"
File "..\doc\spec\bridges-spec.txt"
File "..\doc\spec\control-spec.txt"
File "..\doc\spec\control-spec-v0.txt"
File "..\doc\spec\dir-spec.txt"
File "..\doc\spec\dir-spec-v1.txt"
File "..\doc\spec\path-spec.txt"
File "..\doc\spec\rend-spec.txt"
File "..\doc\spec\socks-extensions.txt"
@ -181,14 +176,17 @@ Function ExtractSpecs
FunctionEnd
Function ExtractHTML
File "..\doc\tor.html"
File "..\doc\torify.html"
File "..\doc\tor-resolve.html"
File "..\doc\tor-gencert.html"
File "..\doc\tor-reference.html"
FunctionEnd
Function ExtractDesignDocs
File "..\doc\design-paper\tor-design.pdf"
FunctionEnd
Function ExtractReleaseDocs
File "..\README"
File "..\AUTHORS"
File "..\ChangeLog"
File "..\LICENSE"
FunctionEnd
@ -197,6 +195,7 @@ Function ExtractDocuments
SetOutPath "$INSTDIR\Documents"
Call ExtractSpecs
Call ExtractHTML
Call ExtractDesignDocs
Call ExtractReleaseDocs
FunctionEnd
@ -210,7 +209,6 @@ Function un.InstallFiles
Delete "$INSTDIR\tor.ico"
Delete "$SMSTARTUP\Tor.lnk"
Delete "$INSTDIR\Uninstall.exe"
Delete "$INSTDIR\geoip"
FunctionEnd
Function un.InstallDirectories
@ -243,16 +241,9 @@ FunctionEnd
Function CreateDocLinks
CreateDirectory "$SMPROGRAMS\Tor\Documents"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Manual.lnk" "$INSTDIR\Documents\tor-reference.html"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Documentation.lnk" "$INSTDIR\Documents"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Specification.lnk" "$INSTDIR\Documents\tor-spec.txt"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Address Specification.lnk" "$INSTDIR\Documents\address-spec.txt"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Bridges Specification.lnk" "$INSTDIR\Documents\bridges-spec.txt"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Control Specification.lnk" "$INSTDIR\Documents\control-spec.txt"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Directory Specification.lnk" "$INSTDIR\Documents\dir-spec.txt"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Path Specification.lnk" "$INSTDIR\Documents\path-spec.txt"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Rend Specification.lnk" "$INSTDIR\Documents\rend-spec.txt"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor Version Specification.lnk" "$INSTDIR\Documents\version-spec.txt"
CreateShortCut "$SMPROGRAMS\Tor\Documents\Tor SOCKS Extensions.lnk" "$INSTDIR\Documents\socks-extensions.txt"
FunctionEnd
Function ParseCmdLine

View File

@ -1,4 +1,5 @@
#!/usr/bin/python
#$Id$
import socket
import struct

27
contrib/tor-stress Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/perl
#require 'sys/syscall.ph';
$|=1;
$total = 1;
$target = "http://www.cnn.com/";
for($i=0;$i<$total;$i++) {
print "Starting client $i\n";
$pid = fork();
if(!$pid) {
open(FD,"wget -q -O - $target|");
$c = 0;
while(<FD>) {
$c += length($_);
}
# $TIMEVAL_T = "LL";
# $now = pack($TIMEVAL_T, ());
# syscall(&SYS_gettimeofday, $now, 0) != -1 or die "gettimeofday: $!";
# @now = unpack($TIMEVAL_T, $now);
print "Client $i exiting ($c chars).\n";
exit(0);
}
# sleep(1);
}

13
contrib/tor-tsocks.conf Normal file
View File

@ -0,0 +1,13 @@
# This is the configuration for libtsocks (transparent socks) for use
# with tor, which is providing a socks server on port 9050 by default.
#
# See tsocks.conf(5) and torify(1) manpages.
server = 127.0.0.1
server_port = 9050
# We specify local as 127.0.0.0 - 127.191.255.255 because the
# Tor MAPADDRESS virtual IP range is the rest of net 127.
local = 127.0.0.0/255.128.0.0
local = 127.128.0.0/255.192.0.0

Some files were not shown because too many files have changed in this diff Show More