]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
14 years agoLaunch sufficient circuits to satisfy pending isolated streams
Nick Mathewson [Thu, 7 Jul 2011 14:40:23 +0000 (10:40 -0400)] 
Launch sufficient circuits to satisfy pending isolated streams

Our old "do we need to launch a circuit for stream S" logic was,
more or less, that if we had a pending circuit that could handle S,
we didn't need to launch a new one.

But now that we have streams isolated from one another, we need
something stronger here: It's possible that some pending C can
handle either S1 or S2, but not both.

This patch reuses the existing isolation logic for a simple
solution: when we decide during circuit launching that some pending
C would satisfy stream S1, we "hypothetically" mark C as though S1
had been connected to it.  Now if S2 is incompatible with S1, it
won't be something that can attach to C, and so we'll launch a new
stream.

When the circuit becomes OPEN for the first time (with no streams
attached to it), we reset the circuit's isolation status.  I'm not
too sure about this part: I wanted some way to be sure that, if all
streams that would have used a circuit die before the circuit is
done, the circuit can still get used.  But I worry that this
approach could also lead to us launching too many circuits.  Careful
thought needed here.

14 years agoImplement stream isolation
Nick Mathewson [Wed, 6 Jul 2011 21:08:24 +0000 (17:08 -0400)] 
Implement stream isolation

This is the meat of proposal 171: we change circuit_is_acceptable()
to require that the connection is compatible with every connection
that has been linked to the circuit; we update circuit_is_better to
prefer attaching streams to circuits in the way that decreases the
circuits' usefulness the least; and we update link_apconn_to_circ()
to do the appropriate bookkeeping.

14 years agoAdd a new isolation type and field: "nym epoch"
Nick Mathewson [Wed, 6 Jul 2011 20:39:54 +0000 (16:39 -0400)] 
Add a new isolation type and field: "nym epoch"

The "nym epoch" of a stream is defined as the number of times that
NEWNYM had been called before the stream was opened.  All streams
are isolated by nym epoch.

This feature should be redundant with existing signewnym stuff, but
it provides a good belt-and-suspenders way for us to avoid ever
letting any circuit type bypass signewnym.

14 years agoConst-ify a few functions
Nick Mathewson [Wed, 6 Jul 2011 20:30:02 +0000 (16:30 -0400)] 
Const-ify a few functions

14 years ago(Unused) backend logic for stream isolation
Nick Mathewson [Wed, 6 Jul 2011 20:03:47 +0000 (16:03 -0400)] 
(Unused) backend logic for stream isolation

This patch adds fields to track how streams should be isolated, and
ensures that those fields are set correctly.  It also adds fields to
track what streams can go on a circuit, and adds functions to see
whether a streams can go on a circuit and update the circuit
accordingly.  Those functions aren't yet called.

14 years agoRefactor listener_connection_t into its own type.
Nick Mathewson [Tue, 5 Jul 2011 21:11:22 +0000 (17:11 -0400)] 
Refactor listener_connection_t into its own type.

This will allow us to add more fields to listener_connection_t
without bloating the other connection types.

14 years agoParse prop171 options; refactor listener/port option code
Nick Mathewson [Thu, 30 Jun 2011 18:01:02 +0000 (14:01 -0400)] 
Parse prop171 options; refactor listener/port option code

Proposal 171 gives us a new syntax for parsing client port options.
You can now have as many FooPort options as you want (for Foo in
Socks, Trans, DNS, NATD), and they can have address:port arguments,
and you can specify the level of isolation on those ports.

Additionally, this patch refactors the client port parsing logic to
use a new type, port_cfg_t.  Previously, ports to be bound were
half-parsed in config.c, and later re-parsed in connection.c when
we're about to bind them.  Now, parsing a port means converting it
into a port_cfg_t, and binding it uses only a port_cfg_t, without
needing to parse the user-provided strings at all.

We should do a related refactoring on other port types.  For
control ports, that'll be easy enough.  For ORPort and DirPort,
we'll want to do this when we solve proposal 118 (letting servers
bind to and advertise multiple ports).

This implements tickets 3514 and 3515.

14 years agoMerge remote-tracking branch 'public/bug3560'
Nick Mathewson [Mon, 18 Jul 2011 21:57:06 +0000 (17:57 -0400)] 
Merge remote-tracking branch 'public/bug3560'

14 years agoBump version to 0.2.3.2-alpha-dev
Nick Mathewson [Mon, 18 Jul 2011 21:56:47 +0000 (17:56 -0400)] 
Bump version to 0.2.3.2-alpha-dev

14 years agofinish the changelog tor-0.2.3.2-alpha
Roger Dingledine [Mon, 18 Jul 2011 17:39:01 +0000 (13:39 -0400)] 
finish the changelog

14 years agobump to 0.2.3.2-alpha
Roger Dingledine [Mon, 18 Jul 2011 17:20:54 +0000 (13:20 -0400)] 
bump to 0.2.3.2-alpha

14 years agostart folding in the 0.2.3.2-alpha changelog entries
Roger Dingledine [Mon, 18 Jul 2011 17:18:46 +0000 (13:18 -0400)] 
start folding in the 0.2.3.2-alpha changelog entries

14 years agoEnhance findMergedChanges to allow looking at non-release targets
Nick Mathewson [Mon, 18 Jul 2011 16:43:39 +0000 (12:43 -0400)] 
Enhance findMergedChanges to allow looking at non-release targets

14 years agoRemove changes files already merged in 0.2.2.30-rc
Nick Mathewson [Mon, 18 Jul 2011 16:43:16 +0000 (12:43 -0400)] 
Remove changes files already merged in 0.2.2.30-rc

14 years agoforward-port the 0.2.2.30-rc changelog
Roger Dingledine [Mon, 18 Jul 2011 16:16:11 +0000 (12:16 -0400)] 
forward-port the 0.2.2.30-rc changelog

14 years agoBetter messages when we're stalled because of microdescriptors
Nick Mathewson [Fri, 15 Jul 2011 23:38:27 +0000 (19:38 -0400)] 
Better messages when we're stalled because of microdescriptors

It's a little confusing for me to say "only X/Y descriptors" when
I have microdescriptors enabled.  So, let's fix that.

14 years agoFix bug in upload/download of hsdesc with microdescs
Nick Mathewson [Fri, 15 Jul 2011 22:53:29 +0000 (18:53 -0400)] 
Fix bug in upload/download of hsdesc with microdescs

Previously we were using router_get_by_id(foo) to test "do we have a
descriptor that will let us make an anonymous circuit to foo".  But
that isn't right for microdescs: we should have been using node_t.

Fixes bug 3601; bugfix on 0.2.3.1-alpha.

14 years agoMerge remote-tracking branch 'sebastian/compile_warning'
Nick Mathewson [Fri, 15 Jul 2011 21:54:49 +0000 (17:54 -0400)] 
Merge remote-tracking branch 'sebastian/compile_warning'

14 years agoFix a wide line. "Tradition!"
Nick Mathewson [Fri, 15 Jul 2011 21:53:13 +0000 (17:53 -0400)] 
Fix a wide line.  "Tradition!"

14 years agoFix a compile warning on OS X 10.6
Sebastian Hahn [Fri, 15 Jul 2011 21:12:43 +0000 (23:12 +0200)] 
Fix a compile warning on OS X 10.6

14 years agoRemove compare_addr_to_node_policy
Nick Mathewson [Fri, 15 Jul 2011 16:58:13 +0000 (12:58 -0400)] 
Remove compare_addr_to_node_policy

Instead, use compare_tor_addr_to_node_policy everywhere.

One advantage of this is that compare_tor_addr_to_node_policy can
better distinguish 0.0.0.0 from "unknown", which caused a nasty bug
with microdesc users.

14 years agoTreat null address as "unknown", not "rejected" in md policy
Nick Mathewson [Fri, 15 Jul 2011 16:44:51 +0000 (12:44 -0400)] 
Treat null address as "unknown", not "rejected" in md policy

Previously, we had an issue where we'd treat an unknown address as
0, which turned into "0.0.0.0", which looked like a rejected
address.  This meant in practice that as soon as we started doing
comparisons of unknown uint32 addresses to short policies, we'd get
'rejected' right away.  Because of the circumstances under which
this would be called, it would only happen when we had local DNS
cached entries and we were looking to launch new circuits.

14 years agoRemove compare_addr_to_addr_policy
Nick Mathewson [Fri, 15 Jul 2011 16:31:09 +0000 (12:31 -0400)] 
Remove compare_addr_to_addr_policy

Nothing used it but the unit tests; everything else knows to use
compare_tor_addr_to_addr_policy instead.

14 years agoMake WIN32_WINNT defines conditional
Nick Mathewson [Fri, 15 Jul 2011 14:03:59 +0000 (10:03 -0400)] 
Make WIN32_WINNT defines conditional

Requested by Gisle Vanem on tor-dev.  I'm not quite sure this is the
right solution, but it's probably harmless.

14 years agoMerge remote-tracking branch 'origin/maint-0.2.2'
Nick Mathewson [Thu, 14 Jul 2011 21:22:23 +0000 (17:22 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.2'

Conflicts:
src/or/control.c

14 years agoMerge branch 'bug3577' into maint-0.2.2
Nick Mathewson [Thu, 14 Jul 2011 21:20:01 +0000 (17:20 -0400)] 
Merge branch 'bug3577' into maint-0.2.2

14 years agoImprove error msg on failed getinfo fingerprint
Nick Mathewson [Thu, 14 Jul 2011 21:19:52 +0000 (17:19 -0400)] 
Improve error msg on failed getinfo fingerprint

14 years agoOnly download microdesc consensus from caches that support it
Nick Mathewson [Thu, 14 Jul 2011 18:19:18 +0000 (14:19 -0400)] 
Only download microdesc consensus from caches that support it

Bugfix on 0.2.3.1-alpha; found by arma; never got a bug number.

14 years agoMerge remote-tracking branch 'origin/maint-0.2.2'
Nick Mathewson [Thu, 14 Jul 2011 13:51:58 +0000 (09:51 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.2'

14 years agoUpdate HACKING with some more release instructions
Sebastian Hahn [Thu, 14 Jul 2011 11:03:55 +0000 (13:03 +0200)] 
Update HACKING with some more release instructions

14 years agoChange GETINFO fingerprint to look at server_mode, not my_descriptor
Nick Mathewson [Wed, 13 Jul 2011 16:44:41 +0000 (12:44 -0400)] 
Change GETINFO fingerprint to look at server_mode, not my_descriptor

It's possible for us to be a server and have a fingerprint without
having yet generated a descriptor.

Fixes bug 3577; bugfix on 0.2.0.1-alpha

14 years agoResolve a warning from the bug1666 branch
Nick Mathewson [Wed, 13 Jul 2011 16:13:12 +0000 (12:13 -0400)] 
Resolve a warning from the bug1666 branch

14 years agoMerge remote-tracking branch 'public/bug1666'
Nick Mathewson [Wed, 13 Jul 2011 16:12:16 +0000 (12:12 -0400)] 
Merge remote-tracking branch 'public/bug1666'

Conflicts:
doc/spec/socks-extensions.txt
src/or/buffers.c
src/or/config.c
src/or/connection_edge.c

14 years agoAvoid warning in broken_state_count_compare
Nick Mathewson [Tue, 12 Jul 2011 15:23:55 +0000 (11:23 -0400)] 
Avoid warning in broken_state_count_compare

14 years agoAdd more error checks to socks parsing code
Nick Mathewson [Tue, 12 Jul 2011 14:51:31 +0000 (10:51 -0400)] 
Add more error checks to socks parsing code

Suggested by Linus to avoid uninitialized reads or infinite loops if
it turns out our code is buggier than we had thought.

14 years agoMerge branch 'bug2798'
Nick Mathewson [Mon, 11 Jul 2011 21:04:21 +0000 (17:04 -0400)] 
Merge branch 'bug2798'

14 years agoTweaks to bug2798 based on comments by arma
Nick Mathewson [Mon, 11 Jul 2011 21:02:03 +0000 (17:02 -0400)] 
Tweaks to bug2798 based on comments by arma

14 years agoTurn on microdescriptors for clients
Nick Mathewson [Mon, 11 Jul 2011 20:54:43 +0000 (16:54 -0400)] 
Turn on microdescriptors for clients

14 years agoMerge remote-tracking branch 'rransom-tor/bug3427'
Nick Mathewson [Mon, 11 Jul 2011 20:32:58 +0000 (16:32 -0400)] 
Merge remote-tracking branch 'rransom-tor/bug3427'

14 years agoMerge branch 'bug2616'
Nick Mathewson [Mon, 11 Jul 2011 20:22:12 +0000 (16:22 -0400)] 
Merge branch 'bug2616'

14 years agoMerge branch 'feature3116_squashed'
Nick Mathewson [Mon, 11 Jul 2011 20:16:11 +0000 (16:16 -0400)] 
Merge branch 'feature3116_squashed'

14 years agoDisable recording new broken conns when we have bootstrapped
Nick Mathewson [Mon, 11 Jul 2011 20:10:24 +0000 (16:10 -0400)] 
Disable recording new broken conns when we have bootstrapped

Rationale: right now there seems to be no way for our bootstrap
status to dip under 100% once it has reached 100%.  Thus, recording
broken connections after that point is useless, and wastes memory.

If at some point in the future we allow our bootstrap level to go
backwards, then we should change this rule so that we disable
recording broken connection states _as long as_ the bootstrap status
is 100%.

14 years agoClear broken connection map on successful bootstrap
Nick Mathewson [Tue, 28 Jun 2011 19:10:38 +0000 (15:10 -0400)] 
Clear broken connection map on successful bootstrap

14 years agoDocument feature3116 fns and improve output
Nick Mathewson [Tue, 28 Jun 2011 19:06:56 +0000 (15:06 -0400)] 
Document feature3116 fns and improve output

- We were reporting the _bottom_ N failing states, not the top N.
- With bufferevents enabled, we logged all TLS states as being "in
  bufferevent", which isn't actually informative.
- When we had nothing to report, we reported nothing too loudly.
- Also, we needed documentation.

14 years agoReport the states of failed TLS connections from bootstrap_problem
Nick Mathewson [Tue, 28 Jun 2011 18:29:29 +0000 (14:29 -0400)] 
Report the states of failed TLS connections from bootstrap_problem

14 years agoLimit the number of different handshake reasons to report
Nick Mathewson [Tue, 28 Jun 2011 18:23:28 +0000 (14:23 -0400)] 
Limit the number of different handshake reasons to report

If connections failed in more than 10 different states, let's just
report the top ten states.

14 years agoRecord the states of failing OR connections
Nick Mathewson [Wed, 22 Jun 2011 19:29:30 +0000 (15:29 -0400)] 
Record the states of failing OR connections

This code lets us record the state of any outgoing OR connection
that fails before it becomes open, so we can notice if they're all
dying in the same SSL state or the same OR handshake state.

More work is still needed:
  - We need documentation
  - We need to actually call the code that reports the failure when
    we realize that we're having a hard time connecting out or
    making circuits.
  - We need to periodically clear out all this data -- perhaps,
    whenever we build a circuit successfully?
  - We'll eventually want to expose it to controllers, perhaps.

Partial implementation of feature 3116.

14 years agoMake a function static
Nick Mathewson [Wed, 22 Jun 2011 18:08:30 +0000 (14:08 -0400)] 
Make a function static

Now that connection_dir_about_to_close() is in directory.c, there's
no reason to expose connection_dir_request_failed().

14 years agoSplit connection_about_to_close_connection into separate functions
Nick Mathewson [Wed, 22 Jun 2011 17:57:19 +0000 (13:57 -0400)] 
Split connection_about_to_close_connection into separate functions

This patch does NOTHING but:
  - move code
  - add declarations and includes as needed to make the new code
    work
  - declare the new functions.

14 years agotypo in feature2841; spotted by asn
Nick Mathewson [Mon, 11 Jul 2011 20:12:35 +0000 (16:12 -0400)] 
typo in feature2841; spotted by asn

14 years agoChanges file for feature2841.
Nick Mathewson [Mon, 11 Jul 2011 20:01:45 +0000 (16:01 -0400)] 
Changes file for feature2841.

14 years agoFix compilation from 2841 branch
Nick Mathewson [Mon, 11 Jul 2011 19:59:03 +0000 (15:59 -0400)] 
Fix compilation from 2841 branch

14 years agoMerge remote-tracking branch 'public/bug2841'
Nick Mathewson [Mon, 11 Jul 2011 19:57:12 +0000 (15:57 -0400)] 
Merge remote-tracking branch 'public/bug2841'

Conflicts:
src/or/config.c

14 years agoFix cut'n'paste bug in comment.
Linus Nordberg [Mon, 11 Jul 2011 18:51:26 +0000 (20:51 +0200)] 
Fix cut'n'paste bug in comment.

14 years agoRename and tweak nodelist_add_node_family() to add node
Nick Mathewson [Mon, 11 Jul 2011 15:21:47 +0000 (11:21 -0400)] 
Rename and tweak nodelist_add_node_family() to add node

It's very easy for nodelist_add_node_family(sl,node) to accidentally
add 'node', and kind of hard to make sure that it omits it.  Instead
of taking pains to leave 'node' out, let's instead make sure that we
always include it.

I also rename the function to nodelist_add_node_and_family, and
audit its users so that they don't add the node itself any longer,
since the function will take care of that for them.

Resolves bug 2616, which was not actually a bug.

14 years agoRevise code for adding EntryNodes to guards.
Nick Mathewson [Mon, 11 Jul 2011 14:48:46 +0000 (10:48 -0400)] 
Revise code for adding EntryNodes to guards.

Previously, we'd just take all the nodes in EntryNodes, see which
ones were already in the guard list, and add the ones that weren't.
There were some problems there, though:

   * We'd add _every_ entry in EntryNodes, and add them in the order
     they appeared in the routerlist.  This wasn't a problem
     until we added the ability to give country-code or IP-range
     entries in the EntryNodes set, but now that we did, it is.

     (Fix: We now shuffle the entry nodes before adding them; only
     add up to 10*NumEntryGuards)

   * We didn't screen EntryNodes for the Guard flag.  That's okay
     if the user has specified two or three entry nodes manually,
     but if they have listed a whole subcontinent, we should
     restrict ourselves to the entries that are currently guards.

     (Fix: separate out the new guard from the new non-guard nodes,
     and add the Guards first.)

   * We'd prepend new EntryNodes _before_ the already configured
     EntryNodes.  This could lead to churn.

     (Fix: don't prepend these.)

This patch also pre-screens EntryNodes entries for
reachableaddresses/excludenodes, even though we check for that
later.  This is important now, since we cap the number of entries
we'll add.

14 years agoLook at the right consensus in router_add_to_routerlist()
Nick Mathewson [Mon, 11 Jul 2011 14:02:24 +0000 (10:02 -0400)] 
Look at the right consensus in router_add_to_routerlist()

Just looking at the "latest" consensus could give us a microdesc
consensus, if microdescs were enabled. That would make us decide
that every routerdesc was unlisted in the latest consensus and drop
them all: Ouch.

Fixes bug 3113; bugfix on 0.2.3.1-alpha.

14 years agoMerge branch 'bug2797'
Nick Mathewson [Mon, 11 Jul 2011 13:48:38 +0000 (09:48 -0400)] 
Merge branch 'bug2797'

14 years agoRemove a redundant condition in compare_addr_to_node_policy
Nick Mathewson [Fri, 8 Jul 2011 18:11:49 +0000 (14:11 -0400)] 
Remove a redundant condition in compare_addr_to_node_policy

A && A == A.

Found by frosty_un

14 years agoMake nodelist_purge avoid orphaned microdescs in rs-less nodes
Nick Mathewson [Thu, 7 Jul 2011 19:17:50 +0000 (15:17 -0400)] 
Make nodelist_purge avoid orphaned microdescs in rs-less nodes

We have an invariant that a node_t should have an md only if it has
a routerstatus.  nodelist_purge tried to preserve this by removing
all nodes without a routerstatus or a routerinfo.  But this left
nodes with a routerinfo and a microdesc untouched, even if they had
a routerstatus.

Bug found by frosty_un.

14 years agoMerge branch 'maint-0.2.2'
Roger Dingledine [Thu, 7 Jul 2011 17:31:08 +0000 (13:31 -0400)] 
Merge branch 'maint-0.2.2'

14 years agoMerge branch 'maint-0.2.1' into maint-0.2.2
Roger Dingledine [Thu, 7 Jul 2011 17:29:02 +0000 (13:29 -0400)] 
Merge branch 'maint-0.2.1' into maint-0.2.2

14 years agoupdate to the july 2011 geoip db
Roger Dingledine [Thu, 7 Jul 2011 17:28:36 +0000 (13:28 -0400)] 
update to the july 2011 geoip db

14 years agoKill redundant checks around routerset_contains_*()
Nick Mathewson [Thu, 7 Jul 2011 15:52:13 +0000 (11:52 -0400)] 
Kill redundant checks around routerset_contains_*()

All of the routerset_contains*() functions return 0 if their
routerset_t argument is NULL.  Therefore, there's no point in
doing "if (ExcludeNodes && routerset_contains*(ExcludeNodes...))",
for example.

This patch fixes every instance of
         if (X && routerstatus_contains*(X,...))

Note that there are other patterns that _aren't_ redundant.  For
example, we *don't* want to change:
        if (EntryNodes && !routerstatus_contains(EntryNodes,...))

Fixes #2797.  No bug here; just needless code.

14 years agoMerge remote-tracking branch 'public/bug3153'
Nick Mathewson [Thu, 7 Jul 2011 15:14:04 +0000 (11:14 -0400)] 
Merge remote-tracking branch 'public/bug3153'

Conflicts:
src/or/nodelist.c

14 years agoMerge branch 'bug3263'
Nick Mathewson [Thu, 7 Jul 2011 15:08:03 +0000 (11:08 -0400)] 
Merge branch 'bug3263'

14 years agoHave transitions in public_server_mode count as affects_descriptor
Nick Mathewson [Thu, 7 Jul 2011 15:05:06 +0000 (11:05 -0400)] 
Have transitions in public_server_mode count as affects_descriptor

Previously, we'd get a new descriptor for free when
public_server_mode() changed, since it would count as
affects_workers, which would call init_keys(), which would make us
regenerate a new descriptor.  But now that we fixed bug 3263,
init_keys() is no longer necessarily a new descriptor, and so we
need to make sure that public_server_mode() counts as a descriptor
transition.

14 years agooops; wrong bug number.
Nick Mathewson [Thu, 7 Jul 2011 15:01:41 +0000 (11:01 -0400)] 
oops; wrong bug number.

14 years agoRemove unused var in write_to_evbuffer_zlib
Nick Mathewson [Thu, 7 Jul 2011 15:00:51 +0000 (11:00 -0400)] 
Remove unused var in write_to_evbuffer_zlib

14 years agoAvoid double-free in bufferevent read/write cbs
Nick Mathewson [Thu, 7 Jul 2011 15:00:21 +0000 (11:00 -0400)] 
Avoid double-free in bufferevent read/write cbs

Fixes bug 3404; bugfix on 0.2.3.1-alpha.

14 years agoMerge remote-tracking branch 'origin/maint-0.2.2'
Nick Mathewson [Thu, 7 Jul 2011 13:56:01 +0000 (09:56 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.2'

14 years agoCorrectly send a SUCCEEDED event for rdns requests
Sebastian Hahn [Thu, 7 Jul 2011 03:27:20 +0000 (05:27 +0200)] 
Correctly send a SUCCEEDED event for rdns requests

The issue was that we overlooked the possibility of reverse DNS success
at the end of connection_ap_handshake_socks_resolved(). Issue discovered
by katmagic, thanks!

14 years agoMerge remote-tracking branch 'origin/maint-0.2.2'
Nick Mathewson [Wed, 6 Jul 2011 14:56:47 +0000 (10:56 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.2'

14 years agoFix weird formatting of html manpage
Sebastian Hahn [Wed, 6 Jul 2011 08:38:01 +0000 (10:38 +0200)] 
Fix weird formatting of html manpage

Asciidoc was inserting <pre> tags for paragraphs that started with a
'+' at the beginning of the line. Instead, we need a space in front of
the plus.

14 years agoMerge branch 'maint-0.2.2'
Roger Dingledine [Wed, 6 Jul 2011 04:49:11 +0000 (00:49 -0400)] 
Merge branch 'maint-0.2.2'

14 years agoappease check-spaces
Roger Dingledine [Wed, 6 Jul 2011 04:48:22 +0000 (00:48 -0400)] 
appease check-spaces

14 years agoMerge remote-tracking branch 'origin/maint-0.2.2'
Nick Mathewson [Tue, 5 Jul 2011 20:01:12 +0000 (16:01 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.2'

14 years agoMerge remote-tracking branch 'rransom-tor/bug3465-023-v2'
Nick Mathewson [Tue, 5 Jul 2011 20:01:07 +0000 (16:01 -0400)] 
Merge remote-tracking branch 'rransom-tor/bug3465-023-v2'

14 years agoMerge remote-tracking branch 'rransom-tor/bug3465-022' into maint-0.2.2
Nick Mathewson [Tue, 5 Jul 2011 19:52:11 +0000 (15:52 -0400)] 
Merge remote-tracking branch 'rransom-tor/bug3465-022' into maint-0.2.2

14 years agoRefactor the interfaces of transport/proxy lookup fns
Nick Mathewson [Sun, 3 Jul 2011 04:13:41 +0000 (00:13 -0400)] 
Refactor the interfaces of transport/proxy lookup fns

Returning a tristate is needless here; we can just use the yielded
transport/proxy_type field to tell whether there's a proxy, and have
the return indicate success/failure.

Also, store the proxy_type in the or_connection_t rather than letting
it get out of sync if a configuration reload happens between launching
the or_connection and deciding what to say with it.

14 years agoFuture-proof and user-proof parse_bridge_line
Nick Mathewson [Sun, 3 Jul 2011 03:38:00 +0000 (23:38 -0400)] 
Future-proof and user-proof parse_bridge_line

14 years agoSimplify parse_client_transport_line
Nick Mathewson [Sun, 3 Jul 2011 03:32:17 +0000 (23:32 -0400)] 
Simplify parse_client_transport_line

14 years agoStyle and grammar tweaks on 2841 branch
Nick Mathewson [Sun, 3 Jul 2011 03:23:07 +0000 (23:23 -0400)] 
Style and grammar tweaks on 2841 branch

14 years agoSmall tweaks to 2841 code
Nick Mathewson [Sun, 3 Jul 2011 03:12:32 +0000 (23:12 -0400)] 
Small tweaks to 2841 code

    - const-ify some transport_t pointers
    - Remove a vestigial argument to parse_bridge_line
    - Make it compile without warnings on my laptop with
      --enable-gcc-warnings

14 years agoMerge branch 'cov217_master'
Nick Mathewson [Fri, 1 Jul 2011 16:57:21 +0000 (12:57 -0400)] 
Merge branch 'cov217_master'

14 years agoMerge remote-tracking branch 'origin/maint-0.2.2'
Nick Mathewson [Fri, 1 Jul 2011 16:56:40 +0000 (12:56 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.2'

14 years agoMerge branch 'cov217_022_squashed' into maint-0.2.2
Nick Mathewson [Fri, 1 Jul 2011 16:56:14 +0000 (12:56 -0400)] 
Merge branch 'cov217_022_squashed' into maint-0.2.2

14 years agoUse strlcpy when copying node IDs into measured_bw_line_t
Nick Mathewson [Fri, 1 Jul 2011 16:14:44 +0000 (12:14 -0400)] 
Use strlcpy when copying node IDs into measured_bw_line_t

We were using strncpy before, which isn't our style for stuff like
this.

This isn't a bug, though: before calling strncpy, we were checking
that strlen(src) was indeed == HEX_DIGEST_LEN, which is less than
sizeof(dst), so there was no way we could fail to NUL-terminate.
Still, strncpy(a,b,sizeof(a)) is an idiom that we ought to squash
everyplace.

Fixes CID #427.

14 years agoMerge branch 'cid30_changelog' into maint-0.2.2
Nick Mathewson [Fri, 1 Jul 2011 16:55:27 +0000 (12:55 -0400)] 
Merge branch 'cid30_changelog' into maint-0.2.2

14 years agoMerge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Fri, 1 Jul 2011 16:55:23 +0000 (12:55 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoMerge branches 'cov217_021' and 'cid_450' into maint-0.2.1
Nick Mathewson [Fri, 1 Jul 2011 16:54:51 +0000 (12:54 -0400)] 
Merge branches 'cov217_021' and 'cid_450' into maint-0.2.1

14 years agoUse strlcpy in create_unix_sockaddr()
Nick Mathewson [Fri, 1 Jul 2011 16:06:54 +0000 (12:06 -0400)] 
Use strlcpy in create_unix_sockaddr()

Using strncpy meant that if listenaddress were ever >=
sizeof(sockaddr_un.sun_path), we would fail to nul-terminate
sun_path.  This isn't a big deal: we never read sun_path, and the
kernel is smart enough to reject the sockaddr_un if it isn't
nul-terminated.  Nonetheless, it's a dumb failure mode.  Instead, we
should reject addresses that don't fit in sockaddr_un.sun_path.

Coverity found this; it's CID 428.  Bugfix on 0.2.0.3-alpha.

14 years agoFix a rare memory leak in rend_cache_store
Nick Mathewson [Fri, 1 Jul 2011 15:52:39 +0000 (11:52 -0400)] 
Fix a rare memory leak in rend_cache_store

When we rejected a descriptor for not being the one we wanted, we
were letting the parsed descriptor go out of scope.

Found by Coverity; CID # 30.

Bugfix on 0.2.1.26.

(No changes file yet, since this is not in any 0.2.1.x release.)

14 years agoAdd a changelog entry for cid30 fix.
Nick Mathewson [Fri, 1 Jul 2011 16:46:26 +0000 (12:46 -0400)] 
Add a changelog entry for cid30 fix.

14 years agoFix insanely large stack_allocation in log_credential_status
Nick Mathewson [Fri, 1 Jul 2011 16:36:33 +0000 (12:36 -0400)] 
Fix insanely large stack_allocation in log_credential_status

I'm not one to insist on C's miserly stack limits, but allocating a
256K array on the stack is too much even for me.

Bugfix on 0.2.1.7-alpha.  Found by coverity.  Fixes CID # 450.

14 years agoCheck return value of crypto_global_init in test.c
Nick Mathewson [Fri, 1 Jul 2011 15:56:09 +0000 (11:56 -0400)] 
Check return value of crypto_global_init in test.c

This will let the unit tests fail in a less mystifying way if the
crypto subsystem is b0rken, and will also make Coverity happier.

CID # 429.

14 years agoDefensive programming: don't crash with broken node_t
Nick Mathewson [Fri, 1 Jul 2011 15:43:34 +0000 (11:43 -0400)] 
Defensive programming: don't crash with broken node_t

Every node_t has either a routerinfo_t or a routerstatus_t, so every
node_t *should* have a nickname.  Nonetheless, let's make sure in
hex_digest_nickname_matches().

Should quiet CID 434.

14 years agoDon't shadow parameters with local variables
Nick Mathewson [Fri, 1 Jul 2011 15:33:07 +0000 (11:33 -0400)] 
Don't shadow parameters with local variables

This is a little error-prone when the local has a different type
from the parameter, and is very error-prone with both have the same
type.  Let's not do this.

Fixes CID #437,438,439,440,441.

14 years agoReplace 4 more sscanf()s with tor_sscanf()
Nick Mathewson [Fri, 1 Jul 2011 15:26:30 +0000 (11:26 -0400)] 
Replace 4 more sscanf()s with tor_sscanf()

For some inexplicable reason, Coverity departs from its usual
standards of avoiding false positives here, and warns about all
sscanf usage, even when the formatting strings are totally safe.

Addresses CID # 447, 446.

14 years agoReplace a "const const" with a "const"
Nick Mathewson [Fri, 1 Jul 2011 15:11:35 +0000 (11:11 -0400)] 
Replace a "const const" with a "const"

Looks like this squeaked in while I was doing a search-and-replace
to constify things.  Coverity CID 483.