Nick Mathewson
a33e9f208a
Add a stack trace for help debugging one part of 17659
2015-11-27 12:11:51 -05:00
Nick Mathewson
85a48d5e47
Merge branch 'fix-policies-memory-v2-squashed'
2015-11-27 11:54:52 -05:00
cypherpunks
8ce70fcbf3
Fix memory leak in policies test
2015-11-27 11:54:47 -05:00
teor (Tim Wilson-Brown)
3f83ea84c7
Fix use-after-free of stack memory in getinfo_helper_policies
2015-11-27 11:54:47 -05:00
teor (Tim Wilson-Brown)
7a6ed3e65e
Fix use-after-free of stack memory in policies_parse_exit_policy*
...
Change the function names & comments to make the copying explicit.
2015-11-27 11:54:47 -05:00
Nick Mathewson
eedef41944
use sockaddr_storage for stack-allocated sockets in ersatz socketpair
2015-11-27 11:52:59 -05:00
Nick Mathewson
f108be7c25
Make SIZEOF_SOCKADDR return socklen_t to avoid bad compares.
2015-11-27 11:48:54 -05:00
Nick Mathewson
a45aacd2e2
Use uint16_t, not in_port_t (which does not exist on Windows). See #17638 .
2015-11-27 11:39:03 -05:00
Nick Mathewson
5665775e8c
Check magic number in connection_ap_attach_pending
2015-11-27 11:21:51 -05:00
Nick Mathewson
0c7bfb206e
improve log messages to try to track down #17659
2015-11-26 12:44:12 -05:00
teor (Tim Wilson-Brown)
fc264975b1
Unit test the full length of SHA256 and SHA512 digests
...
Bugfix on a tor version before the refactoring in git commit
cea1225199
(23 Sep 2009). Patch by "teor".
2015-11-27 02:25:31 +11:00
Nick Mathewson
09e0ae0588
Merge remote-tracking branch 'teor/rand-failure-modes-v2'
2015-11-26 10:05:38 -05:00
Nick Mathewson
0285054189
Fix buffer size in sha512 unit test
...
Nobody likes a stack overflow, even in unit tests.
Closes 17699; but not in any released tor.
2015-11-26 10:00:12 -05:00
Nick Mathewson
fe46fffd98
Fix test_tortls.c to no longer test failing crypto_rand.
...
(crypto_rand is no longer allowed to fail.)
Closes bug 17686; bug not in any released tor. (No backport, since
the tortls tests aren't in 0.2.7)
2015-11-26 09:34:44 -05:00
teor (Tim Wilson-Brown)
b0e6010861
Correctly free a smartlist in getinfo_helper_policies
2015-11-26 09:32:33 -05:00
teor (Tim Wilson-Brown)
155fa2dbdb
Add unit tests that check for common RNG failure modes
...
Check that crypto_rand doesn't return all zeroes, identical values,
or incrementing values (OpenSSL's rand_predictable feature).
2015-11-26 21:27:05 +11:00
Nick Mathewson
e5754c42d1
Merge branch 'bug17686_v2_027'
2015-11-25 22:33:49 -05:00
Nick Mathewson
1cfa2bc859
Fix documentation for crypto_rand*
2015-11-25 22:29:59 -05:00
Nick Mathewson
ddcbe26474
Now that crypto_rand() cannot fail, it should return void.
2015-11-25 22:29:59 -05:00
Nick Mathewson
10fdee6285
Add crypto-initializer functions to those whose return values must be checked
2015-11-25 22:29:59 -05:00
Nick Mathewson
dedea28c2e
Make crypto_seed_rng() and crypto_rand() less scary.
...
These functions must really never fail; so have crypto_rand() assert
that it's working okay, and have crypto_seed_rng() demand that
callers check its return value. Also have crypto_seed_rng() check
RAND_status() before returning.
2015-11-25 22:29:59 -05:00
Nick Mathewson
c875265bbb
Merge remote-tracking branch 'teor/check-crypto-errors-v2'
2015-11-25 22:28:12 -05:00
teor (Tim Wilson-Brown)
e14f9dd44f
fixup! Add controller getinfo exit-policy/reject-private
...
Stop ignoring ExitPolicyRejectPrivate in getinfo
exit-policy/reject-private. Fix a memory leak.
Set ExitPolicyRejectPrivate in the unit tests, and make a mock
function declaration static.
2015-11-25 22:26:10 -05:00
teor (Tim Wilson-Brown)
b1b8f7982e
Check the return value of HMAC in crypto.c and assert on error
...
Fixes bug #17658 ; bugfix on commit in fdbb9cdf74
(11 Oct 2011)
in tor version 0.2.3.5-alpha-dev.
2015-11-26 10:46:36 +11:00
Nick Mathewson
289b184e11
Merge branch 'bug17654_try1'
2015-11-25 12:25:44 -05:00
cypherpunks
c59c622d85
Initialize libevent before periodic events
...
The initialization of libevent interferes with other tests so we also
fork the circuit_timeout test.
2015-11-25 09:38:46 -05:00
teor (Tim Wilson-Brown)
a09e7cd31a
fixup! Block OutboundBindAddressIPv[4|6]_ and configured ports on exit relays
...
Fix unit tests for get_interface_address6_list to assume less
about the interface addresses on the system.
Instead, mock get_interface_address6_list and use the mocked
function to provide a range of address combinations.
2015-11-25 09:31:27 -05:00
Nick Mathewson
fe8eb9b366
Merge remote-tracking branch 'public/decouple_dir_request_failed'
2015-11-25 09:21:25 -05:00
Nick Mathewson
dce708d11c
Fix a logic error in connection_tls_continue_handshake().
...
(If we take the branch above this assertion, than we *didn't* have a
v1 handshake. So if we don't take the branch, we did. So if we
reach this assertion, we must be running as a server, since clients
no longer attempt v1 handshakes.)
Fix for bug 17654; bugfix on 9d019a7db7
.
Bug not in any released Tor.
2015-11-25 09:17:44 -05:00
Nick Mathewson
45caeec9a0
Merge remote-tracking branch 'teor/comments-20151123'
2015-11-25 09:08:15 -05:00
Nick Mathewson
7194d3d957
Tweak gtank's sha512 patch a little
2015-11-25 09:04:17 -05:00
Nick Mathewson
74e5385da7
Merge remote-tracking branch 'gtank/feature17663'
2015-11-25 09:00:01 -05:00
Nick Mathewson
2079ec9ee6
Merge remote-tracking branch 'teor/feature8961-replaycache-sha256'
2015-11-25 08:55:18 -05:00
Nick Mathewson
be30c61ac1
Merge branch 'maint-0.2.7'
2015-11-25 08:53:46 -05:00
George Tankersley
695412302b
implement teor's comments
2015-11-24 02:17:37 +00:00
George Tankersley
ff54cc8481
add SHA512 support to crypto
2015-11-24 01:34:28 +00:00
teor (Tim Wilson-Brown)
2e9779e5d8
Use SHA256 in the replaycache, rather than SHA1
...
This migrates away from SHA1, and provides further hash flooding
protection on top of the randomised siphash implementation.
Add unit tests to make sure that different inputs don't have the
same hash.
2015-11-24 09:08:53 +11:00
David Goulet
273b267fa2
Fix: use the right list in find_expiring_intro_point()
...
The wrong list was used when looking up expired intro points in a rend
service object causing what we think could be reachability issues and
triggering a BUG log.
Fixes #16702
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-11-23 09:02:54 -05:00
Roger Dingledine
6cdd024c94
fix two typos in comments
2015-11-23 07:40:13 -05:00
teor (Tim Wilson-Brown)
5b2adfb3d4
Fix comments to describe actual return values (crypto.c)
2015-11-23 20:31:57 +11:00
teor (Tim Wilson-Brown)
84d1373ba0
Fix typo in comment on crypto_add_spaces_to_fp
2015-11-23 18:59:11 +11:00
teor (Tim Wilson-Brown)
604d3ee48d
Comment only: crypto_seed_rng no longer has a "startup" parameter
2015-11-23 10:26:07 +11:00
Nick Mathewson
cbc1b8a4f7
fix "make check-spaces"
2015-11-20 10:52:56 -05:00
Nick Mathewson
e3cf39cefd
Fix compilation warnings
2015-11-20 10:51:19 -05:00
Nick Mathewson
35e886fe13
Merge branch 'getinfo-private-exitpolicy-v4-squashed'
2015-11-20 10:48:28 -05:00
teor (Tim Wilson-Brown)
10a6390deb
Add controller getinfo exit-policy/reject-private
...
exit-policy/reject-private lists the reject rules added by
ExitPolicyRejectPrivate. This makes it easier for stem to
display exit policies.
Add unit tests for getinfo exit-policy/*.
Completes ticket #17183 . Patch by "teor".
2015-11-20 10:48:19 -05:00
Nick Mathewson
18ee193ad1
bump version to 0.2.7-dev
2015-11-20 10:27:35 -05:00
teor (Tim Wilson-Brown)
6913bdfcc5
Refactor router_dump_exit_policy_to_string
...
Split out policy_dump_to_string to use it in getinfo_helper_policies.
2015-11-20 10:39:37 +11:00
teor (Tim Wilson-Brown)
66fac9fbad
Block OutboundBindAddressIPv[4|6]_ and configured ports on exit relays
...
Modify policies_parse_exit_policy_reject_private so it also blocks
the addresses configured for OutboundBindAddressIPv4_ and
OutboundBindAddressIPv6_, and any publicly routable port addresses
on exit relays.
Add and update unit tests for these functions.
2015-11-20 10:39:13 +11:00
teor (Tim Wilson-Brown)
e726ad4664
Add unit tests for policies_parse_exit_policy_reject_private
...
Test that policies_parse_exit_policy_reject_private rejects supplied
IPv4 and IPv6 relay addresses, and the addresses of local interfaces.
2015-11-20 10:32:51 +11:00