Commit Graph

22315 Commits

Author SHA1 Message Date
Nick Mathewson ae5692994f Add a tor_tls_release_socket() function.
This function tells the underlying TLS object that it shouldn't
close the fd on exit.  Mostly, we hope not to have to use it, since
the NSS implementation is kludgey, but it should allow us to fix
2018-09-12 11:12:05 -04:00
Nick Mathewson bfc847255a Merge remote-tracking branch 'dgoulet/ticket27545_035_01' 2018-09-12 10:18:11 -04:00
Nick Mathewson 19dbc385d5 Merge remote-tracking branch 'tor-github/pr/298' 2018-09-12 09:38:52 -04:00
Nick Mathewson 62743912bc Merge branch 'pr278_squashed' 2018-09-12 09:06:35 -04:00
rl1987 7b27d98eae Actually, just disable test_rebind.sh on Appveyor 2018-09-12 09:06:16 -04:00
rl1987 d30e47fd4e Disable test_rebind.sh on Windows 2018-09-12 09:06:16 -04:00
rl1987 5a11670fca Update/fix CI build
Update integration test to Python 3
2018-09-12 09:06:16 -04:00
rl1987 4811869d7a Pick random ports in test_rebind.py 2018-09-12 09:06:16 -04:00
rl1987 d8157097b4 Always include socket rebinding code 2018-09-12 09:06:16 -04:00
rl1987 3f34fc921c Tweak test_rebind.py for future-proofness 2018-09-12 09:06:16 -04:00
rl1987 762c27b907 Integration test for socket rebinding
squash! Integration test for socket rebinding
2018-09-12 09:06:16 -04:00
rl1987 fbd50f5994 Avoid mentioning ticket number in comments 2018-09-12 09:06:16 -04:00
rl1987 9f5431c79f Comments/explanation for #17873 2018-09-12 09:06:16 -04:00
rl1987 74a474a2e7 Minor code cleanups 2018-09-12 09:06:16 -04:00
rl1987 27c868eff1 Log a notice *after* creating connection 2018-09-12 09:06:16 -04:00
rl1987 d548453abd Log a notice when changing to/from wildcard IP address 2018-09-12 09:06:14 -04:00
rl1987 9f7ed1d04e Always close old listeners in retry_all_listeners 2018-09-12 09:05:39 -04:00
rl1987 f04e0bd5d6 Refrain from compiling socket rebinding code on system that don't need it 2018-09-12 09:05:39 -04:00
rl1987 c99bb8b6ea Try rebinding new listener after closing old one if first bind failed with EADDRINUSE 2018-09-12 09:05:36 -04:00
Nick Mathewson 8294c40c96 Merge remote-tracking branch 'tor-github/pr/318' 2018-09-12 08:12:19 -04:00
Nick Mathewson 5a2374b074 Merge remote-tracking branch 'tor-github/pr/315' 2018-09-11 15:55:30 -04:00
Nick Mathewson 2d0a6d7691 Merge remote-tracking branch 'mikeperry/bug25505' 2018-09-11 14:32:39 -04:00
Nick Mathewson 7852499812 Merge remote-tracking branch 'tor-github/pr/312' 2018-09-11 14:05:16 -04:00
Nick Mathewson 75ad1a1f2f Merge remote-tracking branch 'onionk/doublevote1' 2018-09-11 13:16:49 -04:00
Nick Mathewson 328bcbf305 Merge remote-tracking branch 'tor-github/pr/313' 2018-09-11 12:23:21 -04:00
Nick Mathewson a7d0cbd462 Merge remote-tracking branch 'tor-github/pr/314' 2018-09-11 12:19:13 -04:00
Nick Mathewson f741505642 Merge branch 'maint-0.3.4' 2018-09-11 12:04:56 -04:00
Nick Mathewson 8a873a5695 Merge branch 'maint-0.3.3' into maint-0.3.4 2018-09-11 12:04:56 -04:00
Nick Mathewson 8afc100cb5 Merge branch 'maint-0.3.2' into maint-0.3.3 2018-09-11 12:04:56 -04:00
Nick Mathewson 3119cb5062 Merge branch 'maint-0.2.9' into maint-0.3.2 2018-09-11 12:04:55 -04:00
Suphanat Chunhapanya 57c82b74b4 hs-v3: Shuffle the list of authorized clients
This commit makes it that the authorized clients in the descriptor are in
random order instead of ordered by how they were read on disk.

Fixes #27545

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-11 11:23:49 -04:00
Nick Mathewson e5601f14ed Initialize 't' in ge25519_scalarmult_base_niels()
OSS-Fuzz's version of memorysanitizer can't tell that this value is
not going to be used unsafely.
2018-09-11 10:35:18 -04:00
Karsten Loesing 19429fac23 Update geoip and geoip6 to the September 6 2018 database. 2018-09-11 09:26:59 +02:00
Taylor Yu 617160895c Defer reporting directory bootstrap progress
Existing cached directory information can cause misleadingly high
bootstrap percentages.  To improve user experience, defer reporting of
directory information progress until at least one connection has
succeeded to a relay or bridge.

Closes ticket 27169.
2018-09-10 15:20:50 -05:00
rl1987 1ec54b3556 Bugfix: sizeof(socklen) doesn't make sense when calling connect()
Bugfix on 2f657a1416f2f81dd1be900269c4ae9bdb29f52d; bug not in
any Tor release.
2018-09-10 21:50:30 +03:00
Taylor Yu 687bf3ea64 Track bootstrap phase independently of progress
Track bootstrap phase (enumerated by bootstrap_status_t) independently
from the bootstrap progress (which can represent intermediate
progress).  This allows control_event_bootstrap_problem() to avoid
doing a linear search through the bootstrap progress space to find the
current bootstrap phase.
2018-09-10 13:18:32 -05:00
Taylor Yu 5733d3f71f Refactor control_event_bootstrap_core() more
Eliminate a few conditional expressions in
control_event_bootstrap_core() by overwriting the status parameter.
2018-09-10 13:18:32 -05:00
Taylor Yu 15c24d669f Refactor control_event_bootstrap() somewhat
Move the mostly-invariant part of control_event_boostrap() into a
helper control_event_bootstrap_core().  The helper doesn't modify any
state beyond doing logging and control port notifications.
2018-09-10 13:18:32 -05:00
Taylor Yu e2988e044d Deindent much of control_event_bootstrap 2018-09-10 13:18:32 -05:00
Taylor Yu eee62e13d9 Make control_event_bootstrap() return void
Simplify control_event_bootstrap() by making it return void again.  It
is currently a fairly complicated function, and it's made more
complicated by returning an int to signal whether it logged at NOTICE
or INFO.

The callers conditionally log messages at level NOTICE based on this
return value.  Change the callers to unconditionally log their verbose
human-readable messages at level INFO to keep NOTICE logs less
cluttered.

This partially reverts the changes of #14950.
2018-09-10 13:18:32 -05:00
David Goulet 7ff67d0e90 test: Fix coverity CID 1439129
One HSv3 unit test used "tor_memeq()" without checking the return value. This
commit changes that to use "tt_mem_op()" to actually make the test validate
something :).

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-10 10:28:35 -04:00
David Goulet 064d3e7497 test: Fix coverity CID 1439130
Trivial fix of removing an uneeded NULL check in an HS v3 unit test.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-10 10:22:31 -04:00
David Goulet 58d74ad943 test: Fix coverity CID 1439131
Simple uninitialized object that we could free in an HS v3 unit test.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-10 10:20:58 -04:00
George Kadianakis 34a2cbb249 Address coverity warnings (CID 1439133/1439132).
>>>>    CID 1439133:  Null pointer dereferences  (REVERSE_INULL)
>>>>    Null-checking "fields" suggests that it may be null, but it
>>>> has already been dereferenced on all paths leading to the check.

>>>>    CID 1439132:  Null pointer dereferences  (REVERSE_INULL)
>>>>    Null-checking "fields" suggests that it may be null, but it
>>>> has already been dereferenced on all paths leading to the check.
2018-09-10 16:54:19 +03:00
Nick Mathewson 96601a6805 Bump to 0.3.4.8-dev 2018-09-10 09:42:40 -04:00
Nick Mathewson 05f5f65006 Bump to 0.3.3.10-dev. 2018-09-10 09:42:12 -04:00
Nick Mathewson ec4a7641f1 Bump to 0.3.2.12-dev 2018-09-10 09:41:34 -04:00
Nick Mathewson b203dedaf5 Bump to 0.2.9.17-dev 2018-09-10 09:41:22 -04:00
rl1987 1e296bc6de Call event_set_mem_functions during initialization 2018-09-09 18:58:03 +03:00
Nick Mathewson a52d5d5309 Refactor initialization in curve25519_basepoint_spot_check
This is an attempt to work around what I think may be a bug in
OSS-Fuzz, which thinks that uninitialized data might be passed to
the curve25519 functions.
2018-09-09 10:21:13 -04:00