Commit Graph

16274 Commits

Author SHA1 Message Date
Linus Nordberg
a989dbc3dc Print the correct address family in log printout.
Look at the address family of the preferred OR port rather than the
node.ipv6_preferred flag since the logic has changed with new
ClientUseIPv6 config option.

Fixes ticket 6884.
2012-09-18 14:41:14 +02:00
Mike Perry
4bfed4378d Bug 6866: Convert pathbias asserts into log messages.
Asserts were hit by Tor2Web mode.
2012-09-17 18:25:28 -07:00
Nick Mathewson
5dfec9f833 Merge remote-tracking branch 'linus/bug6880' 2012-09-17 16:05:09 -04:00
Linus Nordberg
bee1e46bd1 Don't do reachability testing over IPv6 unless AuthDirPublishIPv6 is set.
This affects both directory authorities and bridge authoritites.
2012-09-17 22:01:58 +02:00
Robert Ransom
1e5cd1c7d6 Fix comment typo in tor_memeq 2012-09-17 11:13:09 -04:00
Nick Mathewson
757b3b259e Add unit test for crypto_pk_cmp_keys and NULL 2012-09-17 11:04:56 -04:00
Robert Ransom
cd884c764b Fix documentation for crypto_pk_cmp_keys
Now that crypto_pk_cmp_keys might return the result of tor_memcmp, there
is no guarantee that it will only return -1, 0, or 1.  (It currently does
only return -1, 0, or 1, but that's a lucky accident due to details of the
current implementation of tor_memcmp and the particular input given to it.)

Fortunately, none of crypto_pk_cmp_keys's callers rely on this behaviour,
so changing its documentation is sufficient.
2012-09-17 11:02:53 -04:00
Robert Ransom
62babcaf0a Implement and use crypto_pk_eq_keys 2012-09-17 11:02:53 -04:00
Robert Ransom
f3916a6855 Make crypto_pk_cmp_keys do something sane for NULL keys
Fixes bug 4283; bugfix on r76
(Git commit 01aadefbfc).
2012-09-17 11:02:52 -04:00
Nick Mathewson
32d9cea289 Merge remote-tracking branch 'public/bug6853' 2012-09-17 10:50:48 -04:00
Nick Mathewson
5511d21d2b Merge branch 'bug6861_typofix' 2012-09-17 10:28:35 -04:00
Nick Mathewson
96d2a21683 Avoid sign-extending when computing rend auth type.
Right-shifting negative values has implementation-defined behavior.
On all the platforms we work on right now, the behavior is to
sign-extend the input.  That isn't what we wanted in

    auth_type_val = (descriptor_cookie_tmp[16] >> 4) + 1;

Fix for 6861; bugfix on 0.2.1.5-alpha; reported pseudonymously.

The broken behavior didn't actually hurt anything, I think, since the
only way to get sign-extension to happen would be to have the top bit
of descriptor_cookie_tmp[16] set, which would make the value of
descriptor_cookie_tmp[16] >> 4 somewhere between 0b11111111 and
0b11111000 (that is, between -1 and -8).  So auth_type_val would be
between -7 and 0.  And the immediate next line does:

    if (auth_type_val < 1 || auth_type_val > 2) {

So the incorrectly computed auth_type_val would be rejected as
invalid, just as a correctly computed auth_type_val would be.

Still, this stuff shouldn't sit around the codebase.
2012-09-17 10:28:14 -04:00
Nick Mathewson
414adb237b Parse votes with >31 flags correctly
We were doing (1<<p) to generate a flag at position p, but we should
have been doing (U64_LITERAL(1)<<p).

Fixes bug 6861; bugfix on 0.2.0.3-alpha; reported pseudonymously.
2012-09-17 10:24:52 -04:00
Nick Mathewson
c3f526ed64 Merge branch '6044_nm_squashed' 2012-09-17 10:03:11 -04:00
Nick Mathewson
faab788189 changes file for 6044 2012-09-17 10:02:57 -04:00
Nick Mathewson
4b362d002c Turn the read_file_until_eof tests into a single implementation 2012-09-17 10:02:57 -04:00
meejah
d64bf286a1 Handle FIFOs in read_file_to_str
add read_file_to_str_until_eof which is used by read_file_to_str
if the file happens to be a FIFO.

change file_status() to return FN_FILE if st_mode matches S_IFIFO
(on not-windows) so that init_key_from_file() will read from a FIFO.
2012-09-17 10:02:24 -04:00
Nick Mathewson
2939cc3ba3 Note which compiler caused bug 6842 2012-09-17 09:38:48 -04:00
Roger Dingledine
2e342df7cd fold in changes files so far 2012-09-15 16:38:47 -04:00
Nick Mathewson
523b0ec288 Merge remote-tracking branch 'origin/maint-0.2.3' 2012-09-14 12:40:23 -04:00
Nick Mathewson
b1447a4312 Use file-size-fixup code on cygwin too.
We already had code on windows to fix our file sizes when we're
reading a file in text mode and its size doesn't match the size from
fstat.  But that code was only enabled when _WIN32 was defined, and
Cygwin defines __CYGWIN__ instead.

Fixes bug 6844; bugfix on 0.1.2.7-alpha.
2012-09-14 12:39:18 -04:00
Nick Mathewson
a78eeb4cbc Fix dependency checking on manpage builds
Fixes bug 6843; bugfix on 0.2.4.1-alpha.
2012-09-14 10:36:42 -04:00
Nick Mathewson
f2f720a7ef Merge branch 'split_routerlist.c_rebased' 2012-09-14 10:20:16 -04:00
Nick Mathewson
c2c6d12a81 Move functions for seeing if we know enough nodes into nodelist 2012-09-14 10:20:01 -04:00
Nick Mathewson
725d3a32bd Remove router_get_by_{nickname,hexdigest} entirely 2012-09-14 10:20:00 -04:00
Nick Mathewson
5161a52c66 Remove the old disabled router_get_by_nickname implementation 2012-09-14 10:20:00 -04:00
Nick Mathewson
ba21ebc6d8 Move many of the node_ functions from routerlist to nodelist 2012-09-14 10:20:00 -04:00
Nick Mathewson
d995dc8bac Split the routerset code out of routerlist.c 2012-09-14 10:20:00 -04:00
Nick Mathewson
286e95f0a5 Merge branch 'bug6833' 2012-09-14 10:10:23 -04:00
Nick Mathewson
68caa834f4 document why we only allow 64 flags in votes 2012-09-14 10:10:16 -04:00
Nick Mathewson
e4ce8cd969 Fix compilation with older gccs
They don't like to have #preprocessor directives inside macro arguments.

Fixes #6842; fix on 0.2.4.2-alpha.

Found by grarpamp.
2012-09-14 10:06:00 -04:00
Nick Mathewson
56bd3dd87f Remove a duplicate test in test_util_pow2 2012-09-14 10:00:47 -04:00
Nick Mathewson
6492a75b9f Merge branch 'bug6831_v2' 2012-09-14 09:54:08 -04:00
Nick Mathewson
37953497d8 Don't compute ((uint64_t)1)<<64 in round_to_power_of_2
This would be undefined behavior if it happened. (It can't actually
happen as we're using round_to_power_of_2, since we would have to
be trying to allocate exabytes of data.)

While we're at it, fix the behavior of round_to_power_of_2(0),
and document the function better.

Fix for bug 6831.
2012-09-14 09:51:24 -04:00
Roger Dingledine
9ab3b332ae Merge branch 'maint-0.2.3' 2012-09-14 02:41:13 -04:00
Robert Ransom
909691f1ae Fix man page typo 2012-09-13 23:25:03 -07:00
Nick Mathewson
abbde7b184 Merge branch 'confparse_refactor_squashed' 2012-09-13 12:25:45 -04:00
Nick Mathewson
7d11952bf4 Split the or_state_t portions of config.c into their own file 2012-09-13 12:20:26 -04:00
Nick Mathewson
2eb2536c0a Remove all remaining spurious or_options_t invocations in confparse.c 2012-09-13 12:20:25 -04:00
Nick Mathewson
7627b2c187 Split the generic config_fmt_t code into a new confparse.c file
This helps us split up one of our larger files, and sets the stage
for refactoring the configuration backend a little
2012-09-13 12:20:25 -04:00
Nick Mathewson
c8b98ba41c Reject votes (not consensuses) with >64 known-flags
Our flag voting code needs to handle unrecognized flags, so it stores
them in a 64-bit bitfield.  But we never actually checked for too many
flags, so we were potentially doing stuff like U64_LITERAL(1)<<flagnum
with flagnum >= 64.  That's undefined behavior.

Fix for bug 6833; bugfix on 0.2.0.1-alpha.
2012-09-13 11:45:05 -04:00
George Kadianakis
7072dd5dbe Add a unit test for the old crash input of tor_timegm(). 2012-09-13 18:00:06 +03:00
Nick Mathewson
582f2187a7 Merge remote-tracking branch 'origin/maint-0.2.3' 2012-09-13 10:08:51 -04:00
Nick Mathewson
1e68c213a2 mention the bug number in the 6827 changes file 2012-09-13 10:07:06 -04:00
Robert Ransom
0a6480cdd0 Avoid undefined behaviour when parsing HS protocol versions
Fixes bug 6827; bugfix on c58675ca72
(when the v2 HS desc parser was implemented).

Found by asn.
2012-09-13 07:48:21 -04:00
Nick Mathewson
be68c1fb43 Log a notice if we're running with OpenSSL before 1.0.0.
These versions have some dubious, slow crypto implementations; 1.0.0
is a great improvement, and at this point is pretty mature.
2012-09-12 19:32:24 -04:00
Nick Mathewson
feabf4148f Drop support for openssl 0.9.7
097 hasn't seen a new version since 2007; we can drop support too.

This lets us remove our built-in sha256 implementation, and some
checks for old bugs.
2012-09-12 19:25:58 -04:00
Nick Mathewson
a73dec16c5 Merge branch 'bug6815' 2012-09-12 16:28:59 -04:00
Nick Mathewson
19136f6f11 Fix a wide line 2012-09-12 16:28:46 -04:00
Nick Mathewson
79b31dd4f8 Merge remote-tracking branch 'origin/maint-0.2.3'
Use the "ours" strategy so that we retain 4aff97cfc7, which maint-0.2.3
just reverted.
2012-09-12 15:38:33 -04:00