Commit Graph

26972 Commits

Author SHA1 Message Date
David Goulet
290007e3c4 Merge branch 'tor-gitlab/mr/239' into maint-0.3.5 2021-01-28 12:42:26 -05:00
David Goulet
a3f2bc8f13 Merge branch 'maint-0.4.3' into maint-0.4.4 2021-01-28 12:36:42 -05:00
David Goulet
f3da5f88d7 Merge branch 'maint-0.3.5' into maint-0.4.3 2021-01-28 12:36:42 -05:00
David Goulet
02bd135cb1 Merge branch 'tor-gitlab/mr/243' into maint-0.3.5 2021-01-28 12:36:35 -05:00
David Goulet
1887231afb Merge branch 'tor-gitlab/mr/256' into maint-0.4.4 2021-01-28 12:12:01 -05:00
David Goulet
5c89197c9f Merge branch 'tor-gitlab/mr/255' into maint-0.4.3 2021-01-28 12:11:33 -05:00
David Goulet
1bdccc03a9 Merge branch 'tor-gitlab/mr/254' into maint-0.3.5 2021-01-28 12:10:39 -05:00
David Goulet
6186288eb6 Merge branch 'maint-0.3.5' into maint-0.4.3 2021-01-28 12:08:20 -05:00
David Goulet
045db909c2 Merge remote-tracking branch 'tor-gitlab/mr/140' into maint-0.3.5 2021-01-28 12:08:14 -05:00
David Goulet
737cd79c42 Merge branch 'maint-0.4.3' into maint-0.4.4 2021-01-28 12:04:42 -05:00
David Goulet
a17be1b5b6 Merge branch 'maint-0.3.5' into maint-0.4.3 2021-01-28 12:04:42 -05:00
David Goulet
c6fb26695b Merge remote-tracking branch 'tor-gitlab/mr/186' into maint-0.3.5 2021-01-28 12:04:37 -05:00
Nick Mathewson
26a07287a4 Bump to 0.4.5.5-rc 2021-01-28 11:20:01 -05:00
Nick Mathewson
f8fea8b979 Bump to 0.4.4.7 2021-01-28 11:19:00 -05:00
Nick Mathewson
c3ed4b2e56 Bump to 0.4.3.8. 2021-01-28 11:18:13 -05:00
Nick Mathewson
3ebf75993f Bump to 0.3.5.13. 2021-01-28 11:17:32 -05:00
Neel Chauhan
a82b4eb305 src/core/mainloop: Put brackets around IPv6 addresses in log messages 2021-01-27 08:23:39 -08:00
David Goulet
a634f6b64c dos: Move config options within the subsystem
Closes #40261

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-27 10:37:36 -05:00
David Goulet
fd5a72078c dos: Add DoS subsystem to manager list
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-27 09:50:27 -05:00
Nick Mathewson
b019c83853 Merge branch 'maint-0.4.5' 2021-01-27 09:36:39 -05:00
Nick Mathewson
3c0d398847 Merge branch 'mr_274_squashed' into maint-0.4.5 2021-01-27 09:36:29 -05:00
David Goulet
f03047332c relay: Log if we can't find an address for configured ORPort
Everytime we try to discover an address we want to publish, emit a log notice
if we are unable to find it even though an ORPort was configured for it.

Because the function can be called quite often, we rate limit that notice to
every hour so it gets annoying just enough so the operator fixes that.

Related to #40254

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-27 09:36:17 -05:00
David Goulet
2e600019ea relay: Don't trigger an address discovery without an ORPort
We would before do an address discovery and then a lookup in the cache if not
found which is now simplified by calling relay_find_addr_to_publish() directly
which does all those combined.

Furthermore, by doing so, we won't trigger an address discovery every minute
if we have no ORPort configured for the family.

Fixes #40254

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-27 09:36:17 -05:00
David Goulet
b4220a09b7 relay: Simplify IPv6 discovery when building descriptor
Now that relay_find_addr_to_publish() checks if we actually have an ORPort, we
can simplify the descriptor building phase for IPv6.

This also avoid triggering an IPv6 discovery if the IPv4 can't be found in the
first place.

Related to #40254

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-27 09:36:17 -05:00
David Goulet
b4f4af6ec5 relay: Skip address discovery if no ORPort is found
In other words, if we don't have an ORPort configured for a specific family
(IPv4/v6), we don't bother doing address discovery.

Related to #40254

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-27 09:36:17 -05:00
George Kadianakis
05a7624266 Merge remote-tracking branch 'tor-gitlab/mr/272' 2021-01-27 15:47:10 +02:00
George Kadianakis
dbbd603313 Merge remote-tracking branch 'tor-gitlab/mr/248' 2021-01-27 15:43:01 +02:00
George Kadianakis
a7ca089343 Merge remote-tracking branch 'tor-gitlab/mr/247' 2021-01-27 15:39:29 +02:00
Nick Mathewson
37ea6cd9eb Fix a subtle memory leak in test_exorport.c
This is a _subtle_ bug introduced by d1494d14, which resolved
connections that was allocated in the extorport/handshake test.  So
how did the connection get freed?  Our test was set up so that every
extorport connection would get the same ext_or_id.  Two connections
couldn't have the same ext_or_id, and if they did, one would get
freed.  This meant that the _next_ connection to be constructed in
the test would cause the previous connection to become closeable,
even if it hadn't been closeable before.

But when we applied d149d14, we stopped making it so our code
enforced this uniqueness, and thereby make it so we _weren't_
freeing this connection in the tests.

Closes #40260; bug not in any released version of Tor.
2021-01-26 16:58:27 -05:00
Nick Mathewson
af5250b1df bump to 0.4.5.4-rc-dev 2021-01-22 11:55:17 -05:00
Nick Mathewson
5eef63aa71 Bump to 0.4.5.4-rc 2021-01-22 09:49:09 -05:00
MarkusK
62f5114c09 Add IPv6 to mdfnet fallbackdirs 2021-01-22 07:50:47 +01:00
George Kadianakis
74cfe3611f Merge branch 'maint-0.4.5' 2021-01-22 00:21:21 +02:00
George Kadianakis
4cbd22f1a7 Merge branch 'mr/251' into maint-0.4.5 2021-01-22 00:21:09 +02:00
David Goulet
9be33755ef Merge branch 'maint-0.4.5' 2021-01-21 14:58:39 -05:00
David Goulet
c54f4b81da Merge branch 'tor-gitlab/mr/270' into maint-0.4.5 2021-01-21 14:58:31 -05:00
Roger Dingledine
633b68bfe2 log more during consensus voting process
Give more visibility to directory authority operators during the consensus
voting process.

Closes ticket 40245.
2021-01-21 13:46:56 -05:00
Roger Dingledine
9e6064ec35 dir auths write consensuses to disk after creation
This step happens after we make each consensus flavor, and before we
worry about sigs or anything. That way if Tor crashes, or if we fail to
get enough sigs, we still have a chance to know what consensus we wanted
to make.
2021-01-21 13:46:56 -05:00
Nick Mathewson
b2536c97f9 Merge branch 'maint-0.4.5' 2021-01-21 13:40:46 -05:00
Roger Dingledine
0b00f79c82 log more about testing incoming relay descriptors 2021-01-21 13:39:13 -05:00
Nick Mathewson
3d952b461d Merge remote-tracking branch 'tor-gitlab/mr/269' into maint-0.4.5 2021-01-21 13:37:21 -05:00
Nick Mathewson
2243fc3ad1 Merge branch 'maint-0.4.5' 2021-01-21 13:19:49 -05:00
Nick Mathewson
71fd30b75a Introduce a new bridge_has_invalid_transport() function.
In addition to simplifying callsites a little, this function gives
correct behavior for bridges without a configured transport.
2021-01-21 13:17:16 -05:00
Nick Mathewson
9390e2bf83 Merge remote-tracking branch 'tor-gitlab/mr/268' into maint-0.4.5 2021-01-21 13:10:16 -05:00
David Goulet
8a27860720 Merge branch 'maint-0.4.5' 2021-01-21 12:27:34 -05:00
David Goulet
7b102d53e3 Merge branch 'tor-gitlab/mr/265' into maint-0.4.5 2021-01-21 12:27:27 -05:00
David Goulet
7692f443d4 config: Remove Bridge <-> ClientTransportPlugin validation
This validation was only done if DisableNetwork was off because we would use
the global list of transports/bridges and DisableNetwork would not populate
it.

This was a problem for any user using DisableNetwork which includes Tor
Browser and thus leading to the Bug() warning.

Without a more in depth refactoring, we can't do this validation without the
global list.

The previous commit makes it that any connection to a bridge without a
transport won't happen thus we keep the security feature of not connecting to
a bridge without its corresponding transport.

Related to #40106

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-20 15:56:19 -05:00
David Goulet
09c6d03246 bridge: Don't initiate connection without a transport
Don't pick the bridge as the guard or launch descriptor fetch if no transport
is found.

Fixes #40106

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-20 15:55:50 -05:00
Alexander Færøy
c38c36e5f1 Limit the number of items in the consdiffmgr on Windows.
This patch limits the number of items in the consensus diff cache to 64
on the Windows platform. Hopefully, this will allow us to investigate a
smarter fix while avoiding the situation reported in tor#24857 where
Windows relay operators report Tor using 100% CPU.

See: tor#24857
2021-01-20 16:33:17 +00:00
Nick Mathewson
9a0a91dc23 Merge branch 'maint-0.4.5' 2021-01-19 15:21:07 -05:00
Nick Mathewson
18654b629f Merge remote-tracking branch 'tor-gitlab/mr/266' into maint-0.4.5 2021-01-19 15:20:54 -05:00
Nick Mathewson
b0af4ddc7c Merge branch 'maint-0.4.5' 2021-01-19 13:20:43 -05:00
Nick Mathewson
27ee12836d Merge remote-tracking branch 'tor-gitlab/mr/261' into maint-0.4.5 2021-01-19 13:20:31 -05:00
David Goulet
9321ddf3a1 config: Prioritize port with explicit address
When selecting the first advertised port, we always prefer the one with an
explicit address.

Closes #40246

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-19 13:07:49 -05:00
David Goulet
938623004b relay: Keep all ORPorts that are on different ports
We used to actually discard ORPorts that were the same port and same family
but they could have different address.

Instead, we need to keep all different ORPorts so we can bind a listener on
each of them. We will publish only one of these in our descriptor though.

Related to #40246

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-19 13:07:49 -05:00
Nick Mathewson
b7f886beb4 Merge remote-tracking branch 'tor-gitlab/mr/163' into maint-0.4.3 2021-01-19 12:53:44 -05:00
Nick Mathewson
faf7b550e7 Merge remote-tracking branch 'tor-gitlab/mr/143' into maint-0.3.5 2021-01-19 12:53:30 -05:00
Nick Mathewson
5f53e013cd Merge branch 'maint-0.4.5' 2021-01-19 12:49:31 -05:00
Nick Mathewson
6c1bc570cf Merge branch 'maint-0.4.4' into maint-0.4.5 2021-01-19 12:49:31 -05:00
Nick Mathewson
4c82c2d1d4 Merge branch 'maint-0.4.3' into maint-0.4.4 2021-01-19 12:49:22 -05:00
Nick Mathewson
a22bfe04bc Merge branch 'maint-0.3.5' into maint-0.4.3 2021-01-19 12:45:07 -05:00
Alexander Færøy
13cf964453 Remove unnecessary non-fatal assertion.
This patch removes a call to `tor_assert_nonfatal()` if
`extend_info_from_node()` returns NULL. This is unnecessary as we
already handle the case where `info` is NULL in the next `if (!info) {
... }` block in the code.

See: tor#32666.
2021-01-19 17:08:01 +00:00
Nick Mathewson
4961645254 Merge branch 'maint-0.4.5' 2021-01-19 12:02:28 -05:00
David Goulet
691c717187 Revert "IPv6 sybil: consider addresses in the same /64 to be equal."
This reverts commit d07f17f676.

We don't want to consider an entire routable IPv6 network as sybil if more
than 2 relays happen to be on it. For path selection it is very important but
not for selecting relays in the consensus.

Fixes #40243
2021-01-15 12:57:57 -05:00
David Goulet
f0c29f0883 relay: Don't BUG() if we can't find authority descriptor
We can end up trying to find our address from an authority while we don't have
yet its descriptor.

In this case, don't BUG() and just come back later.

Closes #40231

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-14 10:02:03 -05:00
David Goulet
743a5ef2b3 relay: Don't flag that we published if descriptor build fails
In case building the descriptor would fail, we could still flag that we did in
fact publish the descriptors leading to no more attempt at publishing it which
in turn makes the relay silent for some hours and not try to rebuild the
descriptor later.

This has been spotted with #40231 because the operator used a localhost
address for the ORPort and "AssumeReachable 1" leading to this code path where
the descriptor failed to build but all conditions to "can I publish" were met.

Related to #40231

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-14 09:42:56 -05:00
Nick Mathewson
fa8ecf8820 Better fix for #40241 (--enable-all-bugs-are-fatal and fallthrough)
This one should work on GCC _and_ on Clang.  The previous version
made Clang happier by not having unreachable "fallthrough"
statements, but made GCC sad because GCC didn't think that the
unconditional failures were really unconditional, and therefore
_wanted_ a FALLTHROUGH.

This patch adds a FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL macro that
seems to please both GCC and Clang in this case: ordinarily it is a
FALLTHROUGH, but when ALL_BUGS_ARE_FATAL is defined, it's an
abort().

Fixes bug 40241 again.  Bugfix on earlier fix for 40241, which was
merged into maint-0.3.5 and forward, and released in 0.4.5.3-rc.
2021-01-13 09:54:43 -05:00
George Kadianakis
cd1468d56b Merge branch 'maint-0.4.5' 2021-01-13 16:01:41 +02:00
George Kadianakis
c931eae981 Merge branch 'mr/252' into maint-0.4.5 2021-01-13 16:01:11 +02:00
Nick Mathewson
4d6d3b3c05 Remove BUG() when checking TOO_MANY_OUTDATED_DIRSERVERS.
Fixes bug #40234; bugfix on 0.3.2.5-alpha.
2021-01-13 16:00:54 +02:00
George Kadianakis
cc30c09f7c Merge branch 'mr/236' 2021-01-13 15:23:54 +02:00
Nick Mathewson
fb3704b459 New consensus method to find bwweightscale & maxunmeasuredbw correctly.
Our original code for parsing these parameters out of our list of
parameters pre-dated us having the
dirvote_get_intermediate_param_value() function... and it was buggy.
Specifically, it would reject any " ... K=V ..." value
where there were additional unconverted characters after the V, and
use the default value instead,

We haven't run into this yet because we've never voted for
bwweightscale to be anything besides the default 10000, or
maxunmeasuredbw to be anything besides the default 20.

This requires a new consensus method because it is a change in how
consensuses are computed.

Fixes bug 19011; bugfix on 0.2.2.10-alpha.
2021-01-13 15:23:27 +02:00
Nick Mathewson
01be7cc535 Bump to 0.4.5.3-rc-dev 2021-01-12 16:08:07 -05:00
George Kadianakis
42e95c8d85 Merge branch 'maint-0.4.5' 2021-01-12 18:05:32 +02:00
David Goulet
9b59ede8d3 Merge branch 'ticket40237_044_01' into ticket40237_045_01 2021-01-12 10:55:21 -05:00
David Goulet
b3652f2104 Merge branch 'ticket40237_043_01' into ticket40237_044_01 2021-01-12 10:54:31 -05:00
David Goulet
0485c7ddba tests: Fix unit tests after merge of #40237 2021-01-12 10:50:01 -05:00
David Goulet
60da5d6222 Merge branch 'ticket40237_035_01' into ticket40237_043_01 2021-01-12 10:46:25 -05:00
David Goulet
04b0263974 hs-v3: Require reasonably live consensus
Some days before this commit, the network experienced a DDoS on the directory
authorities that prevented them to generate a consensus for more than 5 hours
straight.

That in turn entirely disabled onion service v3, client and service side, due
to the subsystem requiring a live consensus to function properly.

We know require a reasonably live consensus which means that the HSv3
subsystem will to its job for using the best consensus tor can find. If the
entire network is using an old consensus, than this should be alright.

If the service happens to use a live consensus while a client is not, it
should still work because the client will use the current SRV it sees which
might be the previous SRV for the service for which it still publish
descriptors for.

If the service is using an old one and somehow can't get a new one while
clients are on a new one, then reachability issues might arise. However, this
is a situation we already have at the moment since the service will simply not
work if it doesn't have a live consensus while a client has one.

Fixes #40237

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-12 09:46:35 -05:00
Nick Mathewson
ca6ccd372f Reject obsolete router/extrainfo descs more quietly.
Thanks to proposal 315 / ticket #30132, more fields are now
required in these documents.  But ancient Tors that try to upload
obsolete documents were causing the authorities to log warnings
about missing fields, and to do so very spammily.

We now detect the missing fields before tokenizing, and log at
debug.  This is a bit of ugliness, but it's probably a safer choice
than making _all_ unparseable-desc warnings into debug-level logs.

I'm looking at identity-ed25519 in extrainfos and proto in
routerdescs because they were (I believe) the latest-added fields in
Tor's history: any Tor that lacks them will also lack the other
newly required fields.

Fixes bug #40238; bugfix on 0.4.5.1-alpha.
2021-01-11 14:50:40 -05:00
Nick Mathewson
9c268b66ba Merge branch 'maint-0.4.5' 2021-01-11 14:46:13 -05:00
Nick Mathewson
5a822b462a Merge branch 'maint-0.4.3' into maint-0.4.4 2021-01-11 14:37:29 -05:00
Nick Mathewson
d1f4741606 Merge branch 'maint-0.4.4' into maint-0.4.5 2021-01-11 14:37:29 -05:00
Nick Mathewson
4b39f46a61 Merge branch 'maint-0.3.5' into maint-0.4.3 2021-01-11 14:37:28 -05:00
Nick Mathewson
ccdbbae4ec Fix warnings in current debian-hardened CI.
We're getting "fallback annotation annotation in unreachable code"
warnings when we build with ALL_BUGS_ARE_FATAL. This patch fixes
that.

Fixes bug 40241.  Bugfix on 0.3.5.4-alpha.
2021-01-11 14:25:56 -05:00
Nick Mathewson
edc9fda4f5 Increment version to 0.4.5.3-rc 2021-01-11 12:48:00 -05:00
Roger Dingledine
ee0a27293e fix typos and whitespace 2021-01-10 13:29:50 -05:00
Neel Chauhan
3d993d4d85 Do not require a valid torrc for 2021-01-06 10:41:27 -08:00
Neel Chauhan
1811bded77 Downgrade the severity of a few rendezvous circuit-related warnings. 2020-12-24 11:32:03 -08:00
David Goulet
e7da681034 Merge branch 'maint-0.4.5' 2020-12-21 14:55:44 -05:00
David Goulet
aae9a05a01 relay: Log address suggested by directory authorities
If we get an address suggestion from a directory authority and we have no
address configured or discovered, log it at notice level so the operator can
learn what address will be used by Tor.

Fixes #40201

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-21 14:41:52 -05:00
Nick Mathewson
ad00da663e Merge branch 'mr_240_squashed' into maint-0.4.5 2020-12-21 13:25:52 -05:00
Nick Mathewson
cce7d1edaf Merge branch 'mr_240_squashed' 2020-12-21 13:23:42 -05:00
David Goulet
f4cbcde2da test: Fix memleak in test/load_stats_file
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-21 13:18:20 -05:00
Karsten Loesing
5dd6304f36 Fix timestamp parser in new load_stats_file.
The previous parser only considered stats files _starting_ with the
timestamp tag, not stats files having the timestamp tag in a later
position. While this applies to all current stats files, a future
stats file might look differently. Better to fix the function now than
be surprised in another 9 years from now.

This commit also adds a test case for such future stats, and it fixes
stats file paths in newly added unit tests.
2020-12-21 13:18:20 -05:00
David Goulet
c934fced31 relay: Report the entire content of a stats file
It turns out that 9 years ago, we stopped appending data into stats file and
rather overwrite everytime we have new stats (see commit
a6a127c833)

The load_stats_file() function was still thinking that we could have the same
line many times in the file which turns out to be false since 9 years ago.
However, that did not cause problem until IPv6 connection stats came along
which introduced a new line in conn-stats: "ipv6-conn-bi-direct ...".

Before, that file contained a single line starting with the tag
"conn-bi-direct".  That very tag appears also in the IPv6 tag (see above) so
the load_stats_file() function would consider that the IPv6 line as the last
tag to be appeneded to the file and fail to report the line above (for IPv4).
It would actually truncate the IPv6 line and report it (removing the "ipv6-"
part).

In other words, "conn-bi-direct" was not reported and instead
"ipv6-conn-bi-direct" was used without the "ipv6-" part.

This commit refactors the entire function so that now it looks for a
"timestamp tag" to validate and then if everything is fine, returns the entire
content of the file. The refactor simplifies the function, adds logging in
case of failures and modernize it in terms of coding standard.

Unit tests are also added that makes sure the loaded content matches the
entire file if timestamp validation passes.

Fixes #40226

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-21 13:18:20 -05:00
Alexander Færøy
db5f7b4250 Merge remote-tracking branch 'tor-gitlab/mr/211' 2020-12-18 14:22:23 +00:00
Alexander Færøy
b645fbdb54 Merge remote-tracking branch 'tor-gitlab/mr/207' 2020-12-18 14:19:24 +00:00
David Goulet
5527aef56f Merge branch 'maint-0.4.5' 2020-12-17 08:25:29 -05:00
David Goulet
d45354d5ea Merge branch 'tor-gitlab/mr/243' into maint-0.4.5 2020-12-17 08:25:18 -05:00
George Kadianakis
d89974c5c6 Fix Keccak undefined behavior on exotic platforms.
Bug reported and diagnosed in:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975977

Fixes bug #40210.
2020-12-17 13:49:17 +02:00
Alexander Færøy
0bd4cd8101 Merge remote-tracking branch 'tor-gitlab/mr/230' 2020-12-16 20:55:03 +00:00
Alexander Færøy
66597b9291 Merge branch 'maint-0.4.5' 2020-12-16 20:39:01 +00:00
Alexander Færøy
5a2d01ae57 Merge branch 'tor-gitlab/mr/234' into maint-0.4.5 2020-12-16 20:38:23 +00:00
David Goulet
ee6ad0e592 config: Catch missing Bridge for ClientTransportPlugin
When making sure we have a Bridge line with a ClientTransportPlugin, we
now check in the managed proxy list and so we can catch any missing
ClientTransportPlugin for a Bridge line.

Fixes #40106

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-16 20:37:57 +00:00
David Goulet
1430d5ff63 Merge branch 'maint-0.4.5' 2020-12-15 11:58:22 -05:00
David Goulet
4a77aa6e82 Merge branch 'tor-gitlab/mr/239' into maint-0.4.5 2020-12-15 11:58:13 -05:00
George Kadianakis
c731a4efec Merge remote-tracking branch 'tor-gitlab/mr/205' into maint-0.4.5 2020-12-15 16:28:49 +02:00
George Kadianakis
c05ae61f26 Merge remote-tracking branch 'tor-gitlab/mr/205' 2020-12-15 16:28:04 +02:00
Nick Mathewson
c4fe66e342 Socks5: handle truncated client requests correctly
Previously, our code would send back an error if the socks5 request
parser said anything but DONE.  But there are other non-error cases,
like TRUNCATED: we shouldn't send back errors for them.

This patch lowers the responsibility for setting the error message
into the parsing code, since the actual type of the error message
will depend on what problem was encountered.

Fixes bug 40190; bugfix on 0.3.5.1-alpha.
2020-12-14 10:14:03 -05:00
George Kadianakis
04b271af9f Merge remote-tracking branch 'tor-gitlab/mr/232' 2020-12-11 15:56:13 +02:00
Nick Mathewson
ce1c3c6898 Fix a typo in coverage builds.
We should be using TOR_STATIC_LDFLAGS, not TOR_STATIC_LDFALGS.

Bug not in any released version of Tor.
2020-12-09 13:31:34 -05:00
Nick Mathewson
2bfb76b927 Merge branch 'mr_224_squashed' 2020-12-09 10:03:45 -05:00
Alexander Færøy
ed3f46a385 Announce URL to bridge status page when starting Tor as a bridge relay.
This patch makes Tor announce the relay specific bridge status page URL
when Tor is starting up before bootstrap occours.

See: tor#30477
2020-12-09 10:03:11 -05:00
Daniel Pinto
bd0046c9ec Avoid sandbox bug warning when unglobbing patterns #40094
Adds a more user-friendly error message when the configuration is
reloaded and a new %include is added that makes its unglobbing
access files/folders not allowed by the seccomp sandbox.
2020-12-08 15:00:43 -05:00
Nick Mathewson
baef0843a4 Fix a couple of documentation comments related to #40094 2020-12-08 14:59:28 -05:00
David Goulet
6e83a52077 Merge branch 'maint-0.4.5' 2020-12-08 14:51:43 -05:00
David Goulet
e74f168bb4 relay: Avoid log reachability test for bandwidth test circuit
Fixes #40205

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-08 14:51:31 -05:00
Neel Chauhan
8a2910461b Reinstate add_onion_helper_add_service() test, validate auth clients before adding them 2020-12-08 11:24:27 -08:00
Neel Chauhan
65d60a16d9 Remove unused NULL check in hs_service_add_ephemeral(), mention we take ownership of auth_clients_v3 2020-12-08 10:47:05 -08:00
George Kadianakis
f280c171e2 Merge branch 'mr/233' 2020-12-08 16:54:18 +02:00
Nick Mathewson
558aaf1c32 Command-line arguments: be better at detecting absent optional args.
Previously, "--list-fingerprint --quiet" was an error.  Now, the
handler for optional arguments to "--list-fingerprint" can tell that
"--quiet" is a flag, not an argument.

This only affects flags that take an _optional_ argument, so you can
still put your torrc file in a location starting with "-".

Closes #40223.
2020-12-08 16:53:57 +02:00
David Goulet
2d0a7f2e89 Merge branch 'maint-0.4.5' 2020-12-08 09:15:06 -05:00
David Goulet
c618c4f279 configure: Fix the --enable-static-tor switch
The "-static" compile flag was set globally which means that all autoconf test
were attempting to be built statically and lead to failures of detecting
OpenSSL libraries and others.

This commit adds this flag only to the "tor" binary build.

There is also a fix on where to find libevent.a since it is using libtool, it
is in .libs/.

At this commit, there are still warnings being emitted that informs the user
that the built binary must still be linked dynamically with glibc.

Fixes #40111

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-08 09:14:49 -05:00
Nick Mathewson
a09eb66cc7 Merge remote-tracking branch 'tor-gitlab/mr/219' 2020-12-08 08:19:37 -05:00
Neel Chauhan
599af15159 Fix formatting in comment in parse_port_config() 2020-12-03 20:50:18 -08:00
Neel Chauhan
7d54734900 More logic corrections 2020-12-03 17:40:55 -08:00
Nick Mathewson
6c602026e8 Detect extra bytes in HAProxy inbuf when transitioning to OR handshake
This shouldn't be possible, but let's add it for defense-in-depth.

Closes #40017.
2020-12-02 10:07:26 -05:00
Daniel Pinto
328f38a59f Use atomic ops to access lock_owner in WIN32 tor_mutex_t #17927 2020-11-30 02:54:13 +00:00
Samanta Navarro
2a06b7c3b8 Support Python 3.8 in hs_build_address.py
The Python code is such a nice addition to the documentation and the C
code for better understanding of onion v3 address generation. Straight
to the point and easy to understand.

Unfortunately it did not work with my distribution's Python version. I
have adjusted the code to support Python 3.8 (tested with 3.8.6) and
to still be compatible with Python 2.
2020-11-28 11:38:43 +00:00
Alexander Færøy
7640631539 Fix build on 32-bit Windows.
Currently Tor fails with the following error:

    src/test/test_stats.c: In function ‘test_rephist_v3_onions’:
    src/test/test_stats.c:527:22: error: overflow in implicit constant conversion [-Werror=overflow]
       update_approx_time(10101010101);

This patch changes the constant passed to update_approx_time() to avoid
the overflow in the implicit conversion.

See: tor#40199
2020-11-25 17:16:24 +00:00
Neel Chauhan
be6db23d1d Some test and logic corrections 2020-11-24 20:47:31 -08:00
David Goulet
fd80979786 Merge branch 'tor-gitlab/mr/221' 2020-11-24 10:26:17 -05:00
Roger Dingledine
4f1e38ec8e fix two trivial comment mistakes 2020-11-23 14:08:42 -05:00
Nick Mathewson
2f87b2ab75 bump to 0.4.5.2-alpha-dev 2020-11-23 14:03:53 -05:00
George Kadianakis
eaf814bd50 Constify result of CONST_TO_OR_CIRCUIT. 2020-11-23 13:35:26 +02:00
George Kadianakis
0bd12cfe99 Revert HSv3 stats string formatting to its old %u self.
The rest of rephist.c is doing the same kind of unsigned casting. For example
see rep_hist_format_buffer_stats() and rep_hist_format_exit_stats().

The previous switch to %ld made Appveyor fail:
    https://ci.appveyor.com/project/torproject/tor/builds/36118502
2020-11-23 13:35:26 +02:00
Nick Mathewson
73fb44dcba Bump to 0.4.5.2-alpha. 2020-11-21 15:09:08 -05:00
Neel Chauhan
0522f0e507 Fix ControlSocketsGroupWritable typo 2020-11-21 11:12:07 -08:00
Neel Chauhan
157fe4597e Add tests for bug #40084 2020-11-19 12:00:56 -08:00
Alexander Færøy
9bc0306b8c Merge branch 'maint-0.4.5' 2020-11-19 17:44:00 +00:00
Alexander Færøy
b274e46309 Merge branch 'maint-0.4.4' into maint-0.4.5 2020-11-19 17:44:00 +00:00
Alexander Færøy
77bb4b0838 Merge branch 'maint-0.4.3' into maint-0.4.4 2020-11-19 17:43:59 +00:00
Alexander Færøy
2e7cbd7a9c Merge remote-tracking branch 'tor-gitlab/mr/196' into maint-0.4.3 2020-11-19 17:43:44 +00:00
Alexander Færøy
6ce2550468 Merge branch 'maint-0.4.5' 2020-11-19 17:41:05 +00:00
Nick Mathewson
c4e0b28ecb Merge remote-tracking branch 'tor-gitlab/mr/214' into master 2020-11-19 10:42:04 -05:00
David Goulet
ea52705e4b config: Bridge line with a transport must have a ClientTransportPlugin
Fixes #25528

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-18 11:31:37 -05:00
George Kadianakis
34feedea60 Merge remote-tracking branch 'tor-gitlab/mr/216' 2020-11-18 12:37:02 +02:00
David Goulet
16351d655d sendme: Turn log warning into debug
When sending the stream level SENDME, it is possible the cirucit was marked
for close or any other failures that can occur. These events can occur
naturally.

Fixes #40142

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-17 13:23:34 -05:00
David Goulet
0921fdf633 Merge branch 'maint-0.4.5' into master 2020-11-17 12:25:56 -05:00