]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
12 years agoEnable the ntor handshake on the client side.
Nick Mathewson [Thu, 6 Dec 2012 06:53:29 +0000 (01:53 -0500)] 
Enable the ntor handshake on the client side.

"works for me"

12 years agoEnable handling of create2/extend2/created2/extended2
Nick Mathewson [Thu, 6 Dec 2012 05:28:01 +0000 (00:28 -0500)] 
Enable handling of create2/extend2/created2/extended2

12 years agoDon't check create cells too much when we're relaying them
Nick Mathewson [Thu, 6 Dec 2012 05:21:24 +0000 (00:21 -0500)] 
Don't check create cells too much when we're relaying them

We want to sanity-check our own create cells carefully, and other
people's loosely.

12 years agoImplement scheme to allow ntor requests/responses via older servers
Nick Mathewson [Thu, 6 Dec 2012 04:59:12 +0000 (23:59 -0500)] 
Implement scheme to allow ntor requests/responses via older servers

12 years agoUse created_cell_format where appropriate
Nick Mathewson [Thu, 6 Dec 2012 04:44:27 +0000 (23:44 -0500)] 
Use created_cell_format where appropriate

12 years agoUse new wrappers for making,sending,processing create/extend cells
Nick Mathewson [Thu, 6 Dec 2012 04:07:49 +0000 (23:07 -0500)] 
Use new wrappers for making,sending,processing create/extend cells

12 years agoTeach cpuworker and others about create_cell_t and friends
Nick Mathewson [Thu, 6 Dec 2012 03:34:49 +0000 (22:34 -0500)] 
Teach cpuworker and others about create_cell_t and friends

The unit of work sent to a cpuworker is now a create_cell_t; its
response is now a created_cell_t.  Several of the things that call or
get called by this chain of logic now take create_cell_t or
created_cell_t too.

Since all cpuworkers are forked or spawned by Tor, they don't need a
stable wire protocol, so we can just send structs.  This saves us some
insanity, and helps p

12 years agoCode to parse and format CREATE{,2,_FAST} cells and their allies
Nick Mathewson [Wed, 5 Dec 2012 21:47:22 +0000 (16:47 -0500)] 
Code to parse and format CREATE{,2,_FAST} cells and their allies

As elsewhere, it makes sense when adding or extending a cell type to
actually make the code to parse it into a separate tested function.

This commit doesn't actually make anything use these new functions;
that's for a later commit.

12 years agoRename handshake_digest to rend_circ_nonce
Nick Mathewson [Wed, 5 Dec 2012 02:39:54 +0000 (21:39 -0500)] 
Rename handshake_digest to rend_circ_nonce

The handshake_digest field was never meaningfully a digest *of* the
handshake, but rather is a digest *from* the handshake that we exapted
to prevent replays of ESTABLISH_INTRO cells.  The ntor handshake will
generate it as more key material rather than taking it from any part
of the circuit handshake reply..

12 years agoMassive refactoring of the various handshake types
Nick Mathewson [Wed, 5 Dec 2012 02:27:07 +0000 (21:27 -0500)] 
Massive refactoring of the various handshake types

The three handshake types are now accessed from a unified interface;
their state is abstracted from the rest of the cpath state, and so on.

12 years agoRefactor the CREATE_FAST handshake code to match the others.
Nick Mathewson [Tue, 4 Dec 2012 21:51:31 +0000 (16:51 -0500)] 
Refactor the CREATE_FAST handshake code to match the others.

12 years agoSplit onion.[ch] into onion{,_fast,_tap}.[ch]
Nick Mathewson [Tue, 4 Dec 2012 21:09:52 +0000 (16:09 -0500)] 
Split onion.[ch] into onion{,_fast,_tap}.[ch]

I'm going to want a generic "onionskin" type and set of wrappers, and
for that, it will be helpful to isolate the different circuit creation
handshakes.  Now the original handshake is in onion_tap.[ch], the
CREATE_FAST handshake is in onion_fast.[ch], and onion.[ch] now
handles the onion queue.

This commit does nothing but move code and adjust header files.

12 years agoWrangle curve25519 onion keys: generate, store, load, publish, republish
Nick Mathewson [Tue, 4 Dec 2012 20:58:18 +0000 (15:58 -0500)] 
Wrangle curve25519 onion keys: generate, store, load, publish, republish

Here we try to handle curve25519 onion keys from generating them,
loading and storing them, publishing them in our descriptors, putting
them in microdescriptors, and so on.

This commit is untested and probably buggy like whoa

12 years agoMove curve25519 keypair type to src/common; give it functions
Nick Mathewson [Tue, 4 Dec 2012 20:57:16 +0000 (15:57 -0500)] 
Move curve25519 keypair type to src/common; give it functions

This patch moves curve25519_keypair_t from src/or/onion_ntor.h to
src/common/crypto_curve25519.h, and adds new functions to generate,
load, and store keypairs.

12 years agoRefactor strong os-RNG into its own function
Nick Mathewson [Tue, 4 Dec 2012 04:31:07 +0000 (23:31 -0500)] 
Refactor strong os-RNG into its own function

Previously, we only used the strong OS entropy source as part of
seeding OpenSSL's RNG.  But with curve25519, we'll have occasion to
want to generate some keys using extremely-good entopy, as well as the
means to do so.  So let's!

This patch refactors the OS-entropy wrapper into its own
crypto_strongest_rand() function, and makes our new
curve25519_secret_key_generate function try it as appropriate.

12 years agocurve25519-donna-c64: make endian-neutralness fns static
Nick Mathewson [Tue, 4 Dec 2012 03:59:33 +0000 (22:59 -0500)] 
curve25519-donna-c64: make endian-neutralness fns static

12 years agoImplementat the ntor handshake
Nick Mathewson [Tue, 4 Dec 2012 02:24:21 +0000 (21:24 -0500)] 
Implementat the ntor handshake

The ntor handshake--described in proposal 216 and in a paper by
Goldberg, Stebila, and Ustaoglu--gets us much better performance than
our current approach.

12 years agoAdd a wrapper around, and test and build support for, curve25519.
Nick Mathewson [Mon, 3 Dec 2012 20:44:21 +0000 (15:44 -0500)] 
Add a wrapper around, and test and build support for, curve25519.

We want to use donna-c64 when we have a GCC with support for
64x64->uint128_t multiplying.  If not, we want to use libnacl if we
can, unless it's giving us the unsafe "ref" implementation.  And if
that isn't going to work, we'd like to use the
portable-and-safe-but-slow 32-bit "donna" implementation.

We might need more library searching for the correct libnacl,
especially once the next libnacl release is out -- it's likely to have
bunches of better curve25519 implementations.

I also define a set of curve25519 wrapper functions, though it really
shouldn't be necessary.

We should eventually make the -donna*.c files get build with
-fomit-frame-pointer, since that can make a difference.

12 years agocurve25519-donna-c64: work on bigendian and alignment-happy systems
Nick Mathewson [Tue, 4 Dec 2012 03:17:12 +0000 (22:17 -0500)] 
curve25519-donna-c64: work on bigendian and alignment-happy systems

There was one place in curve25519-donna-c64 that was relying on
unaligned access and relying on little-endian values.  This patch
fixes that.

I've sent Adam a pull request.

12 years agoMake curve25519-donna work with our compiler warnings.
Nick Mathewson [Mon, 3 Dec 2012 19:57:35 +0000 (14:57 -0500)] 
Make curve25519-donna work with our compiler warnings.

12 years agoAdd fallback implementations for curve25519: curve25519_donna
Nick Mathewson [Mon, 3 Dec 2012 19:50:48 +0000 (14:50 -0500)] 
Add fallback implementations for curve25519: curve25519_donna

This is copied from Adam Langley's curve25519-donna package, as
of commit 09427c9cab32075c06c3487aa01628030e1c5ae7.

12 years agoAdd a data-invariant linear-search map structure
Nick Mathewson [Mon, 3 Dec 2012 18:10:33 +0000 (13:10 -0500)] 
Add a data-invariant linear-search map structure

I'm going to use this for looking op keys server-side for ntor.

13 years agoAdd a unit test for the old KDF while we're at it
Nick Mathewson [Mon, 3 Dec 2012 17:34:05 +0000 (12:34 -0500)] 
Add a unit test for the old KDF while we're at it

13 years agoImplement HKDF from RFC5869
Nick Mathewson [Mon, 3 Dec 2012 17:20:05 +0000 (12:20 -0500)] 
Implement HKDF from RFC5869

This is a customizable extract-and-expand HMAC-KDF for deriving keys.
It derives from RFC5869, which derives its rationale from Krawczyk,
H., "Cryptographic Extraction and Key Derivation: The HKDF Scheme",
Proceedings of CRYPTO 2010, 2010, <http://eprint.iacr.org/2010/264>.

I'm also renaming the existing KDF, now that Tor has two of them.

This is the key derivation scheme specified in ntor.

There are also unit tests.

13 years agoAdd benchmark to test onionskin performance.
Nick Mathewson [Wed, 28 Nov 2012 20:39:00 +0000 (15:39 -0500)] 
Add benchmark to test onionskin performance.

13 years agoAdd a crypto_dh_dup, for benchmark support
Nick Mathewson [Wed, 28 Nov 2012 20:38:37 +0000 (15:38 -0500)] 
Add a crypto_dh_dup, for benchmark support

13 years agoMerge remote-tracking branch 'asn/bug7592_take2'
Nick Mathewson [Wed, 5 Dec 2012 02:47:45 +0000 (21:47 -0500)] 
Merge remote-tracking branch 'asn/bug7592_take2'

13 years agoReturn connection_exit_connect() if payload creation failed.
George Kadianakis [Wed, 5 Dec 2012 02:32:11 +0000 (04:32 +0200)] 
Return connection_exit_connect() if payload creation failed.

Fixes bug #7592; bugfix on 882b389668067a29bb539d0f5bd5cb2f83b93012.

The bug is not present in any released versions of Tor.

13 years agofix some typos
Roger Dingledine [Mon, 3 Dec 2012 18:33:43 +0000 (13:33 -0500)] 
fix some typos

13 years agoMerge branch 'bug7013_take2_squashed'
Nick Mathewson [Wed, 28 Nov 2012 03:18:16 +0000 (22:18 -0500)] 
Merge branch 'bug7013_take2_squashed'

13 years agoIntroduce tor_addr_port_parse() and use it to parse ServerTransportListenAddr.
George Kadianakis [Tue, 27 Nov 2012 22:24:58 +0000 (00:24 +0200)] 
Introduce tor_addr_port_parse() and use it to parse ServerTransportListenAddr.

13 years agoAdd a torrc option to specify the bind address of managed proxies.
George Kadianakis [Tue, 30 Oct 2012 02:17:13 +0000 (04:17 +0200)] 
Add a torrc option to specify the bind address of managed proxies.

13 years agoMake sure that the error in ADDRMAP events is well-formed
Nick Mathewson [Fri, 23 Nov 2012 16:36:44 +0000 (11:36 -0500)] 
Make sure that the error in ADDRMAP events is well-formed

"error=Unable to launch resolve request" is not a nice thing to tell
the controller.  Bugfix on 0.2.0.19-alpha (c11c48fc).

13 years agoMinor documentation fix
Nick Mathewson [Fri, 23 Nov 2012 15:51:11 +0000 (10:51 -0500)] 
Minor documentation fix

13 years agoNote limitation of parse_rfc_1123_time
Nick Mathewson [Fri, 23 Nov 2012 15:06:16 +0000 (10:06 -0500)] 
Note limitation of parse_rfc_1123_time

RFC1123 suggests that we should handle two-year times, and a full
range of time zones, and other stuff too.  We don't.

13 years agoIn comments and logs, say "UTC" not "GMT"
Nick Mathewson [Fri, 23 Nov 2012 15:05:16 +0000 (10:05 -0500)] 
In comments and logs, say "UTC" not "GMT"

Fix for #6113.

Note that the RFC1123 times we generate still all say 'GMT'.  I'm
going to suggest this is not worth changing.

13 years agoRefer to RFC 4648 instead of the obsolete RFC 3548
Nick Mathewson [Fri, 23 Nov 2012 14:51:31 +0000 (09:51 -0500)] 
Refer to RFC 4648 instead of the obsolete RFC 3548

Affects comments only. For ticket 6849.

13 years agoforward-port the 0.2.3.25 changelog and release notes
Roger Dingledine [Tue, 20 Nov 2012 08:46:56 +0000 (03:46 -0500)] 
forward-port the 0.2.3.25 changelog and release notes

13 years agoMerge branch 'bug7493_redux'
Nick Mathewson [Sun, 18 Nov 2012 23:46:57 +0000 (18:46 -0500)] 
Merge branch 'bug7493_redux'

13 years agoInitialize ipv{4,6}_traffic_ok in entry_connection_new
Nick Mathewson [Sun, 18 Nov 2012 22:15:41 +0000 (17:15 -0500)] 
Initialize ipv{4,6}_traffic_ok in entry_connection_new

This one is necessary for sending BEGIN cells with sane flags when
self-testing a directory port.  All real entry connections were
getting their ipv{4,6}_traffic_ok flags set from their listeners, and
for begindir entry connections we didn't care, but for directory
self-testing, we had a problem.

Fixes at least one more case of 7493; if there are more lingering
cases of 7493, this might fix them too.

Bug not in any released version of Tor.

13 years agowhen counting available descs, say whether we're counting exits
Roger Dingledine [Fri, 16 Nov 2012 16:38:56 +0000 (11:38 -0500)] 
when counting available descs, say whether we're counting exits

13 years agoGive useful warning when both IPv4 and IPv6 are disabled on a socksport
Nick Mathewson [Fri, 16 Nov 2012 03:58:54 +0000 (22:58 -0500)] 
Give useful warning when both IPv4 and IPv6 are disabled on a socksport

13 years agoAllow IPv4 traffic on default and old-style-config SocksPorts.
Nick Mathewson [Fri, 16 Nov 2012 03:49:43 +0000 (22:49 -0500)] 
Allow IPv4 traffic on default and old-style-config SocksPorts.

Looks like when i was writing the code to set the ipv4_traffic flag on
port_cfg_t, I missed some cases, such as the one where the port was
set from its default value.

Fix for 7493. Bug not in any released Tor.

13 years agoMerge branch 'ipv6_exits'
Nick Mathewson [Thu, 15 Nov 2012 19:45:15 +0000 (14:45 -0500)] 
Merge branch 'ipv6_exits'

13 years agoSet IPv4/IPv6 flags correctly when being a SOCKS client
Nick Mathewson [Thu, 15 Nov 2012 18:00:19 +0000 (13:00 -0500)] 
Set IPv4/IPv6 flags correctly when being a SOCKS client

13 years agoRemove some XXXX commens in dns.c
Nick Mathewson [Thu, 15 Nov 2012 17:17:36 +0000 (12:17 -0500)] 
Remove some XXXX commens in dns.c

Previously, I was freaking out about passing an unspec address to
dns_found_answer() on an error, since I was using the address type to
determine whether the error was an error on an ipv4 address lookup or
on an ipv6 address lookup.  But now dns_found_answer() has a separate
orig_query_type argument to tell what kind of query it is, so there's
no need to freak out.

13 years agoFix up some comments in connection_edge.c
Nick Mathewson [Thu, 15 Nov 2012 17:17:30 +0000 (12:17 -0500)] 
Fix up some comments in connection_edge.c

13 years agoAdd a changes file for IPv6 exits
Nick Mathewson [Thu, 15 Nov 2012 04:35:55 +0000 (23:35 -0500)] 
Add a changes file for IPv6 exits

13 years agoAdd manual page entries for new IPv6-exits options
Nick Mathewson [Thu, 15 Nov 2012 04:35:13 +0000 (23:35 -0500)] 
Add manual page entries for new IPv6-exits options

13 years agoAdd another missing function doc
Nick Mathewson [Thu, 15 Nov 2012 03:55:23 +0000 (22:55 -0500)] 
Add another missing function doc

13 years agoInitial support for AAAA requests on DNSPort.
Nick Mathewson [Thu, 15 Nov 2012 03:29:08 +0000 (22:29 -0500)] 
Initial support for AAAA requests on DNSPort.

This is imperfect, since it sends back whatever we would send to
a socks RESOLVE request, when in reality we should send back whatever
was asked for.

13 years agoLet tor-resolve generate PTR requests for IPv6 addresses
Nick Mathewson [Thu, 15 Nov 2012 03:20:18 +0000 (22:20 -0500)] 
Let tor-resolve generate PTR requests for IPv6 addresses

13 years agoAccept reverse resolve requests for IPv6 addresses
Nick Mathewson [Thu, 15 Nov 2012 03:20:01 +0000 (22:20 -0500)] 
Accept reverse resolve requests for IPv6 addresses

13 years agoAdd IPv6 support to tor-resolve so it can hear about IPv6 answers
Nick Mathewson [Thu, 15 Nov 2012 03:07:18 +0000 (22:07 -0500)] 
Add IPv6 support to tor-resolve so it can hear about IPv6 answers

13 years agoMake DNS resolve requests work for IPv6
Nick Mathewson [Thu, 15 Nov 2012 03:06:13 +0000 (22:06 -0500)] 
Make DNS resolve requests work for IPv6

* If there's an IPv4 and an IPv6 address, return both in the resolved
  cell.
* Treat all resolve requests as permitting IPv6, since by the spec they're
  allowed to, and by the code that won't break anything.

13 years agoFix a bug in policy_is_reject_star() that was making IPv4 exits break
Nick Mathewson [Thu, 15 Nov 2012 01:51:41 +0000 (20:51 -0500)] 
Fix a bug in policy_is_reject_star() that was making IPv4 exits break

IPv4-only exits have an implicit "reject [::]/0", which was making
policy_is_reject_star() return 1 for them, making us refuse to do
hostname lookups.

This fix chanes policy_is_reject_star() to ask about which family we meant.

13 years agoAdd some missing doxygen for ipv6 exit code
Nick Mathewson [Wed, 14 Nov 2012 20:20:28 +0000 (15:20 -0500)] 
Add some missing doxygen for ipv6 exit code

13 years agoActually send back correctly-formed IPv6 CONNECTED cells
Nick Mathewson [Wed, 14 Nov 2012 15:48:58 +0000 (10:48 -0500)] 
Actually send back correctly-formed IPv6 CONNECTED cells

We had some old code to send back connected cells for IPv6 addresses,
but it was wrong.  Fortunately, it was also unreachable.

13 years agoRemove some unused defines in dns.c
Nick Mathewson [Wed, 14 Nov 2012 15:18:33 +0000 (10:18 -0500)] 
Remove some unused defines in dns.c

13 years agoRepair DNS NEXIST hijacking workaround
Nick Mathewson [Wed, 14 Nov 2012 15:14:23 +0000 (10:14 -0500)] 
Repair DNS NEXIST hijacking workaround

The code previously detected wildcarding and replaced wildcarded
answers with DNS_STATUS_FAILED_PERMANENT.  But that status variable
was no longer used!  Remove the status variable, and instead change
the value of 'result' in evdns_callback.

Thank goodness for compiler warnings. In this case,
unused-but-set-variable.

Thanks to Linus for finding this one.

13 years agoImplement a PreferIPv6 flag for SocksPorts
Nick Mathewson [Wed, 14 Nov 2012 15:09:06 +0000 (10:09 -0500)] 
Implement a PreferIPv6 flag for SocksPorts

13 years agoDefine a wrapper for evdns_base_resolve_ipv6 for systems w/o libevent 2
Nick Mathewson [Tue, 6 Nov 2012 19:30:30 +0000 (14:30 -0500)] 
Define a wrapper for evdns_base_resolve_ipv6 for systems w/o libevent 2

13 years agoMake address_is_invalid_destination recognize ipv6 addrs as valid.
Nick Mathewson [Tue, 6 Nov 2012 18:35:31 +0000 (13:35 -0500)] 
Make address_is_invalid_destination recognize ipv6 addrs as valid.

13 years agoActually generate microdescriptors with p6 lines.
Nick Mathewson [Tue, 6 Nov 2012 17:12:59 +0000 (12:12 -0500)] 
Actually generate microdescriptors with p6 lines.

13 years agoRemove a since-fixed XXX; improve a doxygen comment
Nick Mathewson [Tue, 6 Nov 2012 17:12:47 +0000 (12:12 -0500)] 
Remove a since-fixed XXX; improve a doxygen comment

13 years agoActually advertise IPv6 exit policies.
Nick Mathewson [Tue, 6 Nov 2012 16:29:41 +0000 (11:29 -0500)] 
Actually advertise IPv6 exit policies.

I have a theory that my tests will work better if the code I'm testing
isn't disabled.

13 years agoRevise the DNS subsystem to handle IPv6 exits.
Nick Mathewson [Mon, 5 Nov 2012 18:26:29 +0000 (13:26 -0500)] 
Revise the DNS subsystem to handle IPv6 exits.

Now, every cached_resolve_t can remember an IPv4 result *and* an IPv6
result.  As a light protection against timing-based distinguishers for
IPv6 users (and against complexity!), every forward request generates
an IPv4 *and* an IPv6 request, assuming that we're an IPv6 exit.  Once
we have answers or errors for both, we act accordingly.

This patch additionally makes some useful refactorings in the dns.c
code, though there is quite a bit more of useful refactoring that could
be done.

Additionally, have a new interface for the argument passed to the
evdns_callback function.  Previously, it was just the original address
we were resolving.  But it turns out that, on error, evdns doesn't
tell you the type of the query, so on a failure we didn't know whether
IPv4 or IPv6 queries were failing.

The new convention is to have the first byte of that argument include
the query type.  I've refactored the code a bit to make that simpler.

13 years agoChange signature of router_compare_to_my_exit_policy so dns can use it
Nick Mathewson [Mon, 5 Nov 2012 18:11:53 +0000 (13:11 -0500)] 
Change signature of router_compare_to_my_exit_policy so dns can use it

Also, fix the function so it actually looks at our ipv6 exit policy.

13 years agoWhitespace cleanup
Nick Mathewson [Thu, 1 Nov 2012 02:46:07 +0000 (22:46 -0400)] 
Whitespace cleanup

13 years agoReindent a block in dns.c
Nick Mathewson [Thu, 1 Nov 2012 02:43:56 +0000 (22:43 -0400)] 
Reindent a block in dns.c

13 years agoActually send BEGIN cell flags
Nick Mathewson [Thu, 1 Nov 2012 02:41:20 +0000 (22:41 -0400)] 
Actually send BEGIN cell flags

This uses advertised IPv6 ports as an implicit version check.

13 years agoWhen asking for a specific address type, others aren't acceptable
Nick Mathewson [Thu, 1 Nov 2012 02:40:55 +0000 (22:40 -0400)] 
When asking for a specific address type, others aren't acceptable

13 years agoI think it is correct to decorate these addresses.
Nick Mathewson [Thu, 1 Nov 2012 02:18:55 +0000 (22:18 -0400)] 
I think it is correct to decorate these addresses.

13 years agoBetter checking of exit policies for connections by hostname
Nick Mathewson [Thu, 1 Nov 2012 02:04:25 +0000 (22:04 -0400)] 
Better checking of exit policies for connections by hostname

13 years agoOnly send begin cell flags when we have some to send
Nick Mathewson [Thu, 1 Nov 2012 02:04:09 +0000 (22:04 -0400)] 
Only send begin cell flags when we have some to send

13 years agoNever support IPv6 traffic on a SOCKS4 connection.
Nick Mathewson [Thu, 1 Nov 2012 02:03:54 +0000 (22:03 -0400)] 
Never support IPv6 traffic on a SOCKS4 connection.

13 years agoAdd a function to set a tor_addr_t to a null address
Nick Mathewson [Thu, 1 Nov 2012 00:50:56 +0000 (20:50 -0400)] 
Add a function to set a tor_addr_t to a null address

13 years agoGet the client side of receiving an IPv6 address to work
Nick Mathewson [Wed, 31 Oct 2012 22:27:48 +0000 (18:27 -0400)] 
Get the client side of receiving an IPv6 address to work

This makes it so we can handle getting an IPv6 in the 3 different
formats we specified it for in RESOLVED cells,
END_STREAM_REASON_EXITPOLICY cells, and CONNECTED cells.

We don't cache IPv6 addresses yet, since proposal 205 isn't
implemented.

There's a refactored function for parsing connected cells; it has unit
tests.

13 years agoReject IPv4 or IPv6 addresses from the user depending on SOCKS settings
Nick Mathewson [Wed, 31 Oct 2012 15:26:00 +0000 (11:26 -0400)] 
Reject IPv4 or IPv6 addresses from the user depending on SOCKS settings

13 years agoRename ipv{4,6}_only to bind_ipv{4,6}_only
Nick Mathewson [Wed, 31 Oct 2012 15:12:28 +0000 (11:12 -0400)] 
Rename ipv{4,6}_only to bind_ipv{4,6}_only

This is to avoid confusion with the ipv{4,6}_traffic flags.

13 years agoAdd {No,}IPv{4,6}Traffic options to SOCKSPort
Nick Mathewson [Wed, 31 Oct 2012 15:08:38 +0000 (11:08 -0400)] 
Add {No,}IPv{4,6}Traffic options to SOCKSPort

These options are for telling the SOCKSPort that it should allow or
not allow connections to IPv4/IPv6 addresses.

These aren't implemented yet; this is just the code to read the
options and get them into the entrey_connection_t.

13 years agoMake DNS callback pass IPv6 answers to dns_answer_found
Nick Mathewson [Sat, 27 Oct 2012 20:34:49 +0000 (16:34 -0400)] 
Make DNS callback pass IPv6 answers to dns_answer_found

Also, count ipv6 timeouts vs others.  If we have too many ipv6
requests time out, then we could be degrading performance because of a
broken DNS server that ignores AAAA requests.  Other cases in which
we never learn an AAAA address aren't so bad, since they don't slow
A (ipv4) answers down very much.

13 years agoMake dns wildcarding checks work for ipv6
Nick Mathewson [Sat, 27 Oct 2012 20:07:25 +0000 (16:07 -0400)] 
Make dns wildcarding checks work for ipv6

13 years agoAdd an IPv6Exit configuration option
Nick Mathewson [Thu, 25 Oct 2012 04:20:41 +0000 (00:20 -0400)] 
Add an IPv6Exit configuration option

Don't advertise an IPv6 exit policy, or accept IPv6 exit requests,
if IPv6Exit is not true.

13 years agoSimplest version of server-side IPv6 support (no dns)
Nick Mathewson [Thu, 25 Oct 2012 03:45:24 +0000 (23:45 -0400)] 
Simplest version of server-side IPv6 support (no dns)

This is a relatively simple set of changes: we mostly need to
remove a few "but not for IPv6" changes.  We also needed to tweak
the handling of DNS code to generate RESOLVED cells that could get
an IPv6 answer in return.

13 years agoRecord, send, and receive flags in BEGIN cells
Nick Mathewson [Thu, 25 Oct 2012 03:39:28 +0000 (23:39 -0400)] 
Record, send, and receive flags in BEGIN cells

13 years agoAdd IPv6 support to compare_to_addr_to_node_policy
Nick Mathewson [Thu, 25 Oct 2012 03:05:44 +0000 (23:05 -0400)] 
Add IPv6 support to compare_to_addr_to_node_policy

13 years agoAuthorities put p6 lines into microdescriptors.
Nick Mathewson [Thu, 25 Oct 2012 02:34:55 +0000 (22:34 -0400)] 
Authorities put p6 lines into microdescriptors.

13 years agoParse IPv6 policy summaries from router descriptors and microdescs
Nick Mathewson [Thu, 25 Oct 2012 01:59:55 +0000 (21:59 -0400)] 
Parse IPv6 policy summaries from router descriptors and microdescs

13 years agoBetter policy support for IPv6
Nick Mathewson [Wed, 24 Oct 2012 19:03:29 +0000 (15:03 -0400)] 
Better policy support for IPv6

Now, "accept *:80" means "accept all addresses on port 80", and not
just IPv4.  For just v4, say "accept *4:80"; for just v6 say "accept
*6:80".

We can parse these policies from torrc just fine, and we should be
successfully keeping them out of descriptors for now.

We also now include appropriate IPv6 addresses in "reject private:*"

13 years agoAdd a new family-specific syntax for tor_addr_parse_mask_ports
Nick Mathewson [Wed, 24 Oct 2012 16:33:18 +0000 (12:33 -0400)] 
Add a new family-specific syntax for tor_addr_parse_mask_ports

By default, "*" means "All IPv4 addresses" with
tor_addr_parse_mask_ports, so I won't break anything.  But if the new
EXTENDED_STAR flag is provided, then * means "any address", *4 means
"any IPv4 address" (that is, 0.0.0.0/0), and "*6" means "any IPv6
address" (that is, [::]/0).

This is going to let us have a syntax for specifying exit policies in
torrc that won't drive people mad.

Also, add a bunch of unit tests for tor_addr_parse_mask_ports to test
these new features, and to increase coverage.

13 years agoRefactor begin cell parsing into its own function, with tests.
Nick Mathewson [Mon, 22 Oct 2012 15:28:37 +0000 (11:28 -0400)] 
Refactor begin cell parsing into its own function, with tests.

Add 'flags' argument to begin cells, per proposal 208.

13 years agoRefactor client_dns_set_{reverse_,}addressmap() to take a circ
Nick Mathewson [Sun, 28 Oct 2012 21:13:37 +0000 (17:13 -0400)] 
Refactor client_dns_set_{reverse_,}addressmap() to take a circ

We'd like these functions to be circuit-relative so that we can
implement a per-circuit DNS cache and per-circuit DNS cache rules for
proposal 205 or its successors.  I'm doing this now, as a part of the
IPv6 exits code, since there are about to be a few more instances
of code using this.

13 years agoMove address map into its own file.
Nick Mathewson [Sun, 28 Oct 2012 20:13:58 +0000 (16:13 -0400)] 
Move address map into its own file.

13 years agoMerge branch 'bug7267' of ssh://git-rw.torproject.org/user/andrea/tor
Andrea Shepard [Wed, 14 Nov 2012 02:54:24 +0000 (18:54 -0800)] 
Merge branch 'bug7267' of ssh://git-rw.torproject.org/user/andrea/tor

13 years agoAdd comment explaining different channel close functions
Andrea Shepard [Wed, 14 Nov 2012 02:50:37 +0000 (18:50 -0800)] 
Add comment explaining different channel close functions

13 years agoMerge remote-tracking branch 'public/bug7059'
Nick Mathewson [Wed, 14 Nov 2012 02:50:07 +0000 (21:50 -0500)] 
Merge remote-tracking branch 'public/bug7059'

13 years agoActually distribute the geoip6 file.
Nick Mathewson [Wed, 14 Nov 2012 02:24:28 +0000 (21:24 -0500)] 
Actually distribute the geoip6 file.

Fixes a bug (with no ticket) on 0.2.4.6-alpha.

13 years agoAdd changes file for bug 7267
Andrea Shepard [Tue, 13 Nov 2012 21:46:36 +0000 (13:46 -0800)] 
Add changes file for bug 7267

13 years agoCall channel_mark_for_close() properly in hibernate_go_dormant()
Andrea Shepard [Tue, 13 Nov 2012 21:45:00 +0000 (13:45 -0800)] 
Call channel_mark_for_close() properly in hibernate_go_dormant()