]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
14 years agoProvide constant limits for all consensus params
Sebastian Hahn [Sat, 15 Jan 2011 18:31:23 +0000 (19:31 +0100)] 
Provide constant limits for all consensus params

This addresses Nick's concern about doing non-constant bounds checking
inside networkstatus_get_param().

14 years agoFix a typo spotted by Roger
Sebastian Hahn [Sat, 15 Jan 2011 17:32:46 +0000 (18:32 +0100)] 
Fix a typo spotted by Roger

14 years agoSanity-check consensus param values
Sebastian Hahn [Thu, 30 Dec 2010 18:54:13 +0000 (19:54 +0100)] 
Sanity-check consensus param values

We need to make sure that the worst thing that a weird consensus param
can do to us is to break our Tor (and only if the other Tors are
reliably broken in the same way) so that the majority of directory
authorities can't pull any attacks that are worse than the DoS that
they can trigger by simply shutting down.

One of these worse things was the cbtnummodes parameter, which could
lead to heap corruption on some systems if the value was sufficiently
large.

This commit fixes this particular issue and also introduces sanity
checking for all consensus parameters.

14 years agoMake get_net_param_from_list() static
Sebastian Hahn [Mon, 27 Dec 2010 17:44:42 +0000 (18:44 +0100)] 
Make get_net_param_from_list() static

This prepares for making the accessor method for consensus parameters
safer in the next commit.

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Sat, 15 Jan 2011 18:25:13 +0000 (13:25 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

Conflicts:
src/or/routerparse.c
src/or/test.c

14 years agoMerge branch 'bug2352_obsize' into maint-0.2.1
Nick Mathewson [Sat, 15 Jan 2011 18:15:06 +0000 (13:15 -0500)] 
Merge branch 'bug2352_obsize' into maint-0.2.1

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Sat, 15 Jan 2011 18:10:14 +0000 (13:10 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoAdd missing check for hostname answer_len in dnsserv size
Nick Mathewson [Sat, 15 Jan 2011 18:09:12 +0000 (13:09 -0500)] 
Add missing check for hostname answer_len in dnsserv size

This is checked elsewhere too, but let's be RFC-conformant.

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Sat, 15 Jan 2011 17:48:40 +0000 (12:48 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoMerge branch 'bug2332_part2' into maint-0.2.1
Nick Mathewson [Sat, 15 Jan 2011 17:43:02 +0000 (12:43 -0500)] 
Merge branch 'bug2332_part2' into maint-0.2.1

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Sat, 15 Jan 2011 17:13:50 +0000 (12:13 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoMerge branch 'bug2324_uncompress' into maint-0.2.1
Nick Mathewson [Sat, 15 Jan 2011 17:12:34 +0000 (12:12 -0500)] 
Merge branch 'bug2324_uncompress' into maint-0.2.1

14 years agoclean up message; explain a magic number in a comment
Nick Mathewson [Sat, 15 Jan 2011 17:12:10 +0000 (12:12 -0500)] 
clean up message; explain a magic number in a comment

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Sat, 15 Jan 2011 17:02:55 +0000 (12:02 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

Conflicts:
src/or/config.c
src/or/networkstatus.c
src/or/rendcommon.c
src/or/routerparse.c
src/or/test.c

14 years agomake the description of tolen_asserts more dire
Nick Mathewson [Sat, 15 Jan 2011 15:54:58 +0000 (10:54 -0500)] 
make the description of tolen_asserts more dire

We have a CVE # for this bug.

14 years agoFix a heap overflow found by debuger, and make it harder to make that mistake again
Nick Mathewson [Thu, 13 Jan 2011 19:36:41 +0000 (14:36 -0500)] 
Fix a heap overflow found by debuger, and make it harder to make that mistake again

Our public key functions assumed that they were always writing into a
large enough buffer.  In one case, they weren't.

(Incorporates fixes from sebastian)

14 years agoAlways nul-terminate the result passed to evdns_server_add_ptr_reply
Nick Mathewson [Mon, 10 Jan 2011 21:18:32 +0000 (16:18 -0500)] 
Always nul-terminate the result passed to evdns_server_add_ptr_reply

In dnsserv_resolved(), we carefully made a nul-terminated copy of the
answer in a PTR RESOLVED cell... then never used that nul-terminated
copy.  Ouch.

Surprisingly this one isn't as huge a security problem as it could be.
The only place where the input to dnsserv_resolved wasn't necessarily
nul-terminated was when it was called indirectly from relay.c with the
contents of a relay cell's payload.  If the end of the payload was
filled with junk, eventdns.c would take the strdup() of the name [This
part is bad; we might crash there if the cell is in a bad part of the
stack or the heap] and get a name of at least length
495[*]. eventdns.c then rejects any name of length over 255, so the
bogus data would be neither transmitted nor altered.

  [*] If the name was less than 495 bytes long, the client wouldn't
     actually be reading off the end of the cell.

Nonetheless this is a reasonably annoying bug.  Better fix it.

Found while looking at bug 2332, reported by doorss.  Bugfix on
0.2.0.1-alpha.

14 years agocatch another overlong malloc possibility. found by cypherpunks
Nick Mathewson [Sat, 15 Jan 2011 15:42:11 +0000 (10:42 -0500)] 
catch another overlong malloc possibility. found by cypherpunks

14 years agoFix another instance of "128" in buffers.c. More bug2330.
Nick Mathewson [Sat, 15 Jan 2011 15:23:58 +0000 (10:23 -0500)] 
Fix another instance of "128" in buffers.c.  More bug2330.

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Wed, 12 Jan 2011 19:38:11 +0000 (14:38 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoMake our replacement INT32_MAX always signed
Nick Mathewson [Wed, 12 Jan 2011 19:29:38 +0000 (14:29 -0500)] 
Make our replacement INT32_MAX always signed

The C standard says that INT32_MAX is supposed to be a signed
integer.  On platforms that have it, we get the correct
platform-defined value.  Our own replacement, however, was
unsigned.  That's going to cause a bug somewhere eventually.

14 years agoMerge remote branch 'public/bug2363' into maint-0.2.2
Nick Mathewson [Wed, 12 Jan 2011 19:00:20 +0000 (14:00 -0500)] 
Merge remote branch 'public/bug2363' into maint-0.2.2

14 years agoMerge remote branch 'sebastian/bug2337' into maint-0.2.2
Nick Mathewson [Wed, 12 Jan 2011 17:55:09 +0000 (12:55 -0500)] 
Merge remote branch 'sebastian/bug2337' into maint-0.2.2

14 years agoMerge branch 'bug2331' into maint-0.2.2
Nick Mathewson [Wed, 12 Jan 2011 17:42:40 +0000 (12:42 -0500)] 
Merge branch 'bug2331' into maint-0.2.2

14 years agoadd a missing "not" in bug2331 changelog
Nick Mathewson [Wed, 12 Jan 2011 17:42:21 +0000 (12:42 -0500)] 
add a missing "not" in bug2331 changelog

14 years agoMerge branch 'bug2346' into maint-0.2.2
Nick Mathewson [Wed, 12 Jan 2011 17:37:51 +0000 (12:37 -0500)] 
Merge branch 'bug2346' into maint-0.2.2

14 years agoExplain bug2346 fix better based on suggestions from arma
Nick Mathewson [Wed, 12 Jan 2011 17:37:42 +0000 (12:37 -0500)] 
Explain bug2346 fix better based on suggestions from arma

14 years agoFix a autoconf warning
Sebastian Hahn [Wed, 12 Jan 2011 03:02:24 +0000 (04:02 +0100)] 
Fix a autoconf warning

14 years agoPull up more data when parsing socks messages
Nick Mathewson [Mon, 10 Jan 2011 22:24:16 +0000 (17:24 -0500)] 
Pull up more data when parsing socks messages

Previously, we only looked at up to 128 bytes.  This is a bad idea
since socks messages can be at least 256+x bytes long.  Now we look at
up to 512 bytes; this should be enough for 0.2.2.x to handle all valid
SOCKS messages.  For 0.2.3.x, we can think about handling trickier
cases.

Fixes 2330.  Bugfix on 0.2.0.16-alpha.

14 years agoWait 60 minutes before retrying failed state save; bug2346
Nick Mathewson [Mon, 10 Jan 2011 21:44:42 +0000 (16:44 -0500)] 
Wait 60 minutes before retrying failed state save; bug2346

14 years agoAlways nul-terminate the result passed to evdns_server_add_ptr_reply
Nick Mathewson [Mon, 10 Jan 2011 21:18:32 +0000 (16:18 -0500)] 
Always nul-terminate the result passed to evdns_server_add_ptr_reply

In dnsserv_resolved(), we carefully made a nul-terminated copy of the
answer in a PTR RESOLVED cell... then never used that nul-terminated
copy.  Ouch.

Surprisingly this one isn't as huge a security problem as it could be.
The only place where the input to dnsserv_resolved wasn't necessarily
nul-terminated was when it was called indirectly from relay.c with the
contents of a relay cell's payload.  If the end of the payload was
filled with junk, eventdns.c would take the strdup() of the name [This
part is bad; we might crash there if the cell is in a bad part of the
stack or the heap] and get a name of at least length
495[*]. eventdns.c then rejects any name of length over 255, so the
bogus data would be neither transmitted nor altered.

  [*] If the name was less than 495 bytes long, the client wouldn't
     actually be reading off the end of the cell.

Nonetheless this is a reasonably annoying bug.  Better fix it.

Found while looking at bug 2332, reported by doorss.  Bugfix on
0.2.0.1-alpha.

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Mon, 10 Jan 2011 19:12:33 +0000 (14:12 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoImpose maximum sizes on parsed objects
Nick Mathewson [Mon, 10 Jan 2011 17:12:11 +0000 (12:12 -0500)] 
Impose maximum sizes on parsed objects

An object, you'll recall, is something between -----BEGIN----- and
-----END----- tags in a directory document.  Some of our code, as
doorss has noted in bug 2352, could assert if one of these ever
overflowed SIZE_T_CEILING but not INT_MAX.  As a solution, I'm setting
a maximum size on a single object such that neither of these limits
will ever be hit.  I'm also fixing the INT_MAX checks, just to be sure.

14 years agoAdd logic in routerparse to not read overlong private keys
Nick Mathewson [Mon, 10 Jan 2011 17:07:34 +0000 (12:07 -0500)] 
Add logic in routerparse to not read overlong private keys

I am not at all sure that it is possible to trigger a bug here,
but better safe than sorry.

14 years agoUpdate to the January 1 2011 Maxmind GeoLite Country database.
Karsten Loesing [Mon, 10 Jan 2011 09:37:54 +0000 (10:37 +0100)] 
Update to the January 1 2011 Maxmind GeoLite Country database.

14 years agoAdd missing parens to evdns_base_resolve_* macros while I am at it
Nick Mathewson [Mon, 10 Jan 2011 00:05:06 +0000 (19:05 -0500)] 
Add missing parens to evdns_base_resolve_* macros while I am at it

14 years agoFix check for failed evdns request creation
Nick Mathewson [Sun, 9 Jan 2011 23:54:45 +0000 (18:54 -0500)] 
Fix check for failed evdns request creation

When using libevent 2, we use evdns_base_resolve_*().  When not, we
fake evdns_base_resolve_*() using evdns_resolve_*().

Our old check was looking for negative values (like libevent 2
returns), but our eventdns.c code returns 1.  This code makes the
check just test for nonzero.

Note that this broken check was not for _resolve_ failures or even for
failures to _launch_ a resolve: it was for failures to _create_ or
_encode_ a resolve request.

Bug introduced in 81eee0ecfff3dac1e9438719d2f7dc0ba7e84a71; found by
lodger; uploaded to trac by rransom.  Bug 2363.  Fix on 0.2.2.6-alpha.

14 years agoDescribe tor-resolve defaults. Bug 2364.
Nick Mathewson [Sun, 9 Jan 2011 20:40:40 +0000 (15:40 -0500)] 
Describe tor-resolve defaults. Bug 2364.

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Sat, 8 Jan 2011 03:04:40 +0000 (22:04 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoRemove a loud info log message
Nick Mathewson [Sat, 8 Jan 2011 03:03:22 +0000 (22:03 -0500)] 
Remove a loud info log message

14 years agoCorrectly detect and exclude addresses outside of our virtual address range
Nick Mathewson [Fri, 7 Jan 2011 17:18:37 +0000 (12:18 -0500)] 
Correctly detect and exclude addresses outside of our virtual address range

Found by cypherpunks; fixes more of 2328.  Bug was introduced in 3623a122;
first appeared in 0.2.0.5-alpha.

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Thu, 6 Jan 2011 18:37:39 +0000 (13:37 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoMerge branch 'bug2328_021' into maint-0.2.1
Nick Mathewson [Thu, 6 Jan 2011 18:36:29 +0000 (13:36 -0500)] 
Merge branch 'bug2328_021' into maint-0.2.1

14 years agoNotice a little faster if we're running out of virtual addresses
Nick Mathewson [Thu, 6 Jan 2011 18:29:36 +0000 (13:29 -0500)] 
Notice a little faster if we're running out of virtual addresses

We were not decrementing "available" every time we did
++next_virtual_addr in addressmap_get_virtual_address: we left out the
--available when we skipped .00 and .255 addresses.

This didn't actually cause a bug in most cases, since the failure mode
was to keep looping around the virtual addresses until we found one,
or until available hit zero.  It could have given you an infinite loop
rather than a useful message, however, if you said "VirtualAddrNetwork
127.0.0.255/32" or something broken like that.

Spotted by cypherpunks

14 years agoHandle a NULL return from addressmap_get_virtual_address
Nick Mathewson [Wed, 5 Jan 2011 21:36:48 +0000 (16:36 -0500)] 
Handle a NULL return from addressmap_get_virtual_address

Fix for bug 2328; bugfix on 0.1.2.1-alpha; bug found by doorss.

14 years agoFix a double-counting bug in addrmap_get_virtual_address
Nick Mathewson [Wed, 5 Jan 2011 21:02:43 +0000 (16:02 -0500)] 
Fix a double-counting bug in addrmap_get_virtual_address

We were decrementing "available" twice for each in-use address we ran
across.  This would make us declare that we ran out of virtual
addresses when the address space was only half full.

14 years agoFix size_t vs unsigned comparison too
Nick Mathewson [Wed, 5 Jan 2011 17:49:02 +0000 (12:49 -0500)] 
Fix size_t vs unsigned comparison too

14 years agoFix a SIZE_T_CEILING check in torgzip.c; noticed by cypherpunks
Nick Mathewson [Wed, 5 Jan 2011 17:42:34 +0000 (12:42 -0500)] 
Fix a SIZE_T_CEILING check in torgzip.c; noticed by cypherpunks

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Mon, 3 Jan 2011 22:24:32 +0000 (17:24 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoNote that Tor requires Automake 1.7. Fixes bug 2305
Nick Mathewson [Mon, 3 Jan 2011 22:19:05 +0000 (17:19 -0500)] 
Note that Tor requires Automake 1.7. Fixes bug 2305

14 years agoDetect signed size_t and report an error at configure time.
Nick Mathewson [Mon, 3 Jan 2011 21:54:57 +0000 (16:54 -0500)] 
Detect signed size_t and report an error at configure time.

14 years agoFix up size and sign issues in base32 code
Nick Mathewson [Mon, 3 Jan 2011 21:16:53 +0000 (16:16 -0500)] 
Fix up size and sign issues in base32 code

Fixes bug 2331.

14 years agoDetect and disallow compression bombs
Nick Mathewson [Mon, 3 Jan 2011 20:54:23 +0000 (15:54 -0500)] 
Detect and disallow compression bombs

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Mon, 3 Jan 2011 20:31:19 +0000 (15:31 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoAvoid assertion on read_file_to_str() with size==SIZE_T_CEILING-1
Nick Mathewson [Mon, 3 Jan 2011 20:30:11 +0000 (15:30 -0500)] 
Avoid assertion on read_file_to_str() with size==SIZE_T_CEILING-1

Spotted by doors, fixes bug 2326.

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Mon, 3 Jan 2011 20:15:54 +0000 (15:15 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoCheck size against SIZE_T_CEILING in realloc too.
Nick Mathewson [Mon, 3 Jan 2011 20:15:27 +0000 (15:15 -0500)] 
Check size against SIZE_T_CEILING in realloc too.

Fixes bug 2324.

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Mon, 3 Jan 2011 18:18:33 +0000 (13:18 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoMerge remote branch 'sebastian/bug2314' into maint-0.2.2
Nick Mathewson [Mon, 3 Jan 2011 17:47:14 +0000 (12:47 -0500)] 
Merge remote branch 'sebastian/bug2314' into maint-0.2.2

14 years agoNever include pthread.h when building for Windows.
Nick Mathewson [Mon, 3 Jan 2011 17:42:19 +0000 (12:42 -0500)] 
Never include pthread.h when building for Windows.

On Windows, we never use pthreads, since it doesn't usually exist,
and when it does it tends to be a little weirdly-behaved.  But some
mingw installations have a pthreads installed, so autoconf detects
pthread.h and tells us about it.  This would make us include
pthread.h, which could make for trouble when the iffy pthread.h
tried to include config.h.

This patch changes compat.h so that we never include pthread.h on
Windows.  Fixes bug 2313; bugfix on 0.1.0.1-rc.

14 years agoFix a function formatting warning in rephist.c
Nick Mathewson [Mon, 3 Jan 2011 16:59:47 +0000 (11:59 -0500)] 
Fix a function formatting warning in rephist.c

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Mon, 3 Jan 2011 16:58:59 +0000 (11:58 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

Conflicts:
src/or/routerparse.c

14 years agofix whitespace issues
Nick Mathewson [Mon, 3 Jan 2011 16:57:42 +0000 (11:57 -0500)] 
fix whitespace issues

14 years agoBump copyright statements to 2011 (0.2.2)
Nick Mathewson [Mon, 3 Jan 2011 16:52:09 +0000 (11:52 -0500)] 
Bump copyright statements to 2011 (0.2.2)

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Mon, 3 Jan 2011 16:51:17 +0000 (11:51 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

Conflicts:
src/common/test.h
src/or/test.c

14 years agoBump copyright statements to 2011
Nick Mathewson [Mon, 3 Jan 2011 16:50:39 +0000 (11:50 -0500)] 
Bump copyright statements to 2011

14 years agoFix compile wanrings revealed by gcc 4.5 on mingw
Sebastian Hahn [Sun, 26 Dec 2010 11:13:47 +0000 (12:13 +0100)] 
Fix compile wanrings revealed by gcc 4.5 on mingw

14 years agoMerge remote branch 'public/bug2060' into maint-0.2.2
Nick Mathewson [Tue, 21 Dec 2010 20:53:03 +0000 (15:53 -0500)] 
Merge remote branch 'public/bug2060' into maint-0.2.2

14 years agoMerge remote branch 'rransom/bug2190_the_hard_way' into maint-0.2.2
Nick Mathewson [Tue, 21 Dec 2010 20:48:14 +0000 (15:48 -0500)] 
Merge remote branch 'rransom/bug2190_the_hard_way' into maint-0.2.2

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Tue, 21 Dec 2010 20:48:06 +0000 (15:48 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoMerge remote branch 'public/bug2190_021' into maint-0.2.1
Nick Mathewson [Tue, 21 Dec 2010 20:44:50 +0000 (15:44 -0500)] 
Merge remote branch 'public/bug2190_021' into maint-0.2.1

14 years agoMerge branch 'maint-0.2.1' into maint-0.2.2
Roger Dingledine [Fri, 17 Dec 2010 00:23:21 +0000 (19:23 -0500)] 
Merge branch 'maint-0.2.1' into maint-0.2.2

14 years agoput 0.2.1.28 release notes in place too
Roger Dingledine [Fri, 17 Dec 2010 00:20:18 +0000 (19:20 -0500)] 
put 0.2.1.28 release notes in place too

14 years agoMerge branch 'maint-0.2.1' into maint-0.2.2
Roger Dingledine [Thu, 16 Dec 2010 22:24:21 +0000 (17:24 -0500)] 
Merge branch 'maint-0.2.1' into maint-0.2.2

14 years agoMerge commit 'nickm/fix_security_bug_022' into maint-0.2.2
Roger Dingledine [Thu, 16 Dec 2010 22:24:11 +0000 (17:24 -0500)] 
Merge commit 'nickm/fix_security_bug_022' into maint-0.2.2

14 years agoMerge commit 'nickm/fix_security_bug_021' into maint-0.2.1
Roger Dingledine [Thu, 16 Dec 2010 21:59:12 +0000 (16:59 -0500)] 
Merge commit 'nickm/fix_security_bug_021' into maint-0.2.1

14 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Thu, 16 Dec 2010 15:05:07 +0000 (10:05 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

14 years agoChange gabelmoo's IP address and ports.
Karsten Loesing [Thu, 16 Dec 2010 12:10:19 +0000 (13:10 +0100)] 
Change gabelmoo's IP address and ports.

15 years agoMerge remote branch fix_security_bug_021 into fix_security_bug_022
Nick Mathewson [Thu, 16 Dec 2010 03:47:28 +0000 (22:47 -0500)] 
Merge remote branch fix_security_bug_021 into fix_security_bug_022

Conflicts:
src/common/memarea.c
src/or/or.h
src/or/rendclient.c

15 years agoAdd a changelog entry
Nick Mathewson [Thu, 16 Dec 2010 03:35:07 +0000 (22:35 -0500)] 
Add a changelog entry

15 years agoMake payloads into uint8_t.
Nick Mathewson [Tue, 14 Dec 2010 00:34:01 +0000 (19:34 -0500)] 
Make payloads into uint8_t.

This will avoid some signed/unsigned assignment-related bugs.

15 years agoMerge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Nick Mathewson [Tue, 14 Dec 2010 19:13:24 +0000 (14:13 -0500)] 
Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

Conflicts:
src/config/geoip

15 years agoHave all of our allocation functions and a few others check for underflow
Nick Mathewson [Mon, 13 Dec 2010 23:40:21 +0000 (18:40 -0500)] 
Have all of our allocation functions and a few others check for underflow

It's all too easy in C to convert an unsigned value to a signed one,
which will (on all modern computers) give you a huge signed value.  If
you have a size_t value of size greater than SSIZE_T_MAX, that is way
likelier to be an underflow than it is to be an actual request for
more than 2gb of memory in one go.  (There's nothing in Tor that
should be trying to allocate >2gb chunks.)

15 years agoBase SIZE_T_CEILING on SSIZE_T_MAX.
Nick Mathewson [Mon, 13 Dec 2010 23:40:15 +0000 (18:40 -0500)] 
Base SIZE_T_CEILING on SSIZE_T_MAX.

15 years agoOnly add each log message to pending_cb_messages once.
Robert Ransom [Sat, 11 Dec 2010 13:26:36 +0000 (05:26 -0800)] 
Only add each log message to pending_cb_messages once.

15 years agoDon't call flush_pending_log_callbacks while logging LD_NOCB messages.
Robert Ransom [Sat, 11 Dec 2010 12:41:35 +0000 (04:41 -0800)] 
Don't call flush_pending_log_callbacks while logging LD_NOCB messages.

Found by boboper.

15 years agoUpdate to the December 1 2010 Maxmind GeoLite Country database.
Karsten Loesing [Wed, 8 Dec 2010 16:59:40 +0000 (17:59 +0100)] 
Update to the December 1 2010 Maxmind GeoLite Country database.

15 years agoMerge branch 'bug2081_followup_022' into maint-0.2.2
Nick Mathewson [Tue, 7 Dec 2010 16:35:49 +0000 (11:35 -0500)] 
Merge branch 'bug2081_followup_022' into maint-0.2.2

15 years agoReject relay versions older than 0.2.0.26-rc
Nick Mathewson [Tue, 7 Dec 2010 16:35:32 +0000 (11:35 -0500)] 
Reject relay versions older than 0.2.0.26-rc

This was the first version to cache the correct directory information.

Fixes bug 2156.

15 years agorevise bug2081_followup changelog
Nick Mathewson [Tue, 7 Dec 2010 16:27:51 +0000 (11:27 -0500)] 
revise bug2081_followup changelog

15 years agoFix a bug in calculating wakeup time on 64-bit machines.
Nick Mathewson [Mon, 6 Dec 2010 17:01:32 +0000 (12:01 -0500)] 
Fix a bug in calculating wakeup time on 64-bit machines.

If you had TIME_MAX > INT_MAX, and your "time_to_exhaust_bw =
accountingmax/expected_bandwidth_usage * 60" calculation managed to
overflow INT_MAX, then your time_to_consider value could underflow and
wind up being rediculously low or high.  "Low" was no problem;
negative values got caught by the (time_to_consider <= 0) check.
"High", however, would get you a wakeup time somewhere in the distant
future.

The fix is to check for time_to_exhaust_bw overflowing INT_MAX, not
TIME_MAX: We don't allow any accounting interval longer than a month,
so if time_to_exhaust_bw is significantly larger than 31*24*60*60, we
can just clip it.

This is a bugfix on 0.0.9pre6, when accounting was first introduced.
It fixes bug 2146, unless there are other causes there too.  The fix
is from boboper.  (I tweaked it slightly by removing an assignment
that boboper marked as dead, and lowering a variable that no longer
needed to be function-scoped.)

15 years agoAdd a missing ! to directory_fetches_from_authorities
Nick Mathewson [Mon, 6 Dec 2010 16:36:01 +0000 (11:36 -0500)] 
Add a missing ! to directory_fetches_from_authorities

The old logic would have us fetch from authorities if we were refusing
unknown exits and our exit policy was reject*.  Instead, we want to
fetch from authorities if we're refusing unknown exits and our exit
policy is _NOT_ reject*.

Fixed by boboper.  Fixes more of 2097.  Bugfix on 0.2.2.16-alpha.

15 years agoDon't crash when accountingmax is set in non-server Tors
Nick Mathewson [Fri, 3 Dec 2010 18:37:13 +0000 (13:37 -0500)] 
Don't crash when accountingmax is set in non-server Tors

We use a hash of the identity key to seed a prng to tell when an
accounting period should end.  But thanks to the bug998 changes,
clients no longer have server-identity keys to use as a long-term seed
in accounting calculations.  In any case, their identity keys (as used
in TLS) were never never fixed.  So we can just set the wakeup time
from a random seed instead there.  Still open is whether everybody
should be random.

This patch fixes bug 2235, which was introduced in 0.2.2.18-alpha.

Diagnosed with help from boboper on irc.

15 years agoFix a harmless off-by-one error in counting controller argument lengths
Nick Mathewson [Thu, 2 Dec 2010 18:19:21 +0000 (13:19 -0500)] 
Fix a harmless off-by-one error in counting controller argument lengths

Bugfix on 0.1.1.1-alpha; found by boboper.

15 years agoSpecified grammars for orconn-status and entry-guards for Tor versions 0.1.2.2-alpha...
Poet (Tim Sally) [Wed, 1 Dec 2010 17:19:26 +0000 (11:19 -0600)] 
Specified grammars for orconn-status and entry-guards for Tor versions 0.1.2.2-alpha through 0.2.2.1-alpha with feature VERBOSE_NAMES turned off.

15 years agoCorrect information about support for guards being called helper nodes.
Poet (Tim Sally) [Wed, 1 Dec 2010 11:26:05 +0000 (05:26 -0600)] 
Correct information about support for guards being called helper nodes.

The spec stated that support for the helper-nodes command would be removed
in 0.1.3.x, however support for this command is still in Tor. Updated the spec
to reflect this and added a node that the command is deprecated.

15 years agoCorrect grammars to reflect that VERBOSE_NAMES is part of the protocol.
Poet (Tim Sally) [Wed, 1 Dec 2010 11:25:17 +0000 (05:25 -0600)] 
Correct grammars to reflect that VERBOSE_NAMES is part of the protocol.

Several updates to grammars for events and GETINFO results.  All relate
to the fact that LongName has replaced ServerID since 0.2.2.1-alpha. See
documentation of VERBOSE_NAMES for more information. The following
grammars were changed:
  * orconn-status GETINFO result
  * entry-guards GETINFO result
  * Path general token
  * OR Connection status changed event
  * New descriptors available event
In all cases a note was added about when the old grammar applies.

15 years agoSeveral changes to the way tokens describing servers are documented.
Poet (Tim Sally) [Wed, 1 Dec 2010 11:24:33 +0000 (05:24 -0600)] 
Several changes to the way tokens describing servers are documented.

(1) Made the wording of the comments consistant with token names.
Digest/Fingerprint and Name/Nickname were being used interchangeably.
Better to just use Fingerprint and Nickname becuase they are the names
of the tokens.

(2) Places the tokens currently in use before the tokens used in older
versions.  ServerSpec should be documented before ServerID.

(3) Added a note to the comments about ServerID that cross reference
the VERBOSE_FEATURE, allowing users to see when and why ServerID was
replaced with LongName.

15 years agoClarify description of FEATURES in control-spec.
Poet (Tim Sally) [Wed, 1 Dec 2010 11:21:34 +0000 (05:21 -0600)] 
Clarify description of FEATURES in control-spec.

(1) On by default is a bad way to describe features. Rather, they
are always on and should be viewed as a part of the control
protocol. Updated the wording in USEFEATURE to reflect this.

(2) Made descriptions of Tor versions consistant across all
features. There is the version in which a feature was introduced and
the version in which it became part of the protocol.

(3) Reworded the description of the VERBOSE_NAMES feature. The
previous wording describes the way things used to be first. Better to
lead with the current state of things and then describe how it differs
from old versions.

15 years agoMerge branch 'maint-0.2.1' into maint-0.2.2
Roger Dingledine [Wed, 1 Dec 2010 05:11:27 +0000 (00:11 -0500)] 
Merge branch 'maint-0.2.1' into maint-0.2.2

Conflicts:

doc/Makefile.am