Commit Graph

25452 Commits

Author SHA1 Message Date
Nick Mathewson
7036ed3471 Fix a couple more long warning lines
These are not a problem with 2-space indentation, but cocci will
start getting confused when clang-format wraps them with 4-space
indentation.
2020-02-06 16:25:56 -05:00
Nick Mathewson
6076adde25 circuitbuild: expect bug message that clang-format will generate.
clang-format wants to put no space here, so we need to tell the test
to expect a lack of a space.
2020-02-06 15:34:06 -05:00
Nick Mathewson
99a5aecbc7 Wrap columnar tables in "clang-format off/on"
These tables have aligned comments, so we don't want clang-format to
mess with them.
2020-02-06 14:54:04 -05:00
Nick Mathewson
06a6130666 Use parentheses to avoid mis-indentations of stringified macro args
clang-format sometimes thinks that "#name" should be written as
"#     name" if it appears at the start of a line.  Using () appears
to suppress this, while confusing Coccinelle.
2020-02-06 14:54:04 -05:00
Nick Mathewson
6104c407e0 maps: do not include _ as part of expected prefix in macros.
Doing this makes our macro usage a little clear IMO, and also avoids
having to use an unadorned "new" within a macro.  (Clang-format
seems to think that "new" means we're doing C++, and so it generates
some output that checkSpace.pl doesn't care for.)
2020-02-06 14:54:04 -05:00
Nick Mathewson
87b71a692a Remove senseless CHECK_PRINTF()s from util_bug.c
These belong in util_bug.h (and they already are there).

Their presence made clang-format misindent these functions in a way
that checkSpace.pl dislikes.
2020-02-06 14:54:04 -05:00
Nick Mathewson
efa5020a9c log_test_helpers: remove semicolons from end of macros
We want our code to require semicolons after use of these macros,
so that our code formatters and/or analysis tools don't get
confused.
2020-02-06 14:54:04 -05:00
Nick Mathewson
60f01da78e Use smaller CPP error messages
Clang-format wants to split these messages across multiple lines,
which confuses the heck out of coccinelle.
2020-02-06 14:54:04 -05:00
Nick Mathewson
e9b663beaf onion_queue.c: use TAILQ_HEAD less confusingly.
When we use macro inline, clang-format likes to break it in the
middle, which makes checkSpace get confused.
2020-02-06 14:33:05 -05:00
Nick Mathewson
9feeb4cf97 prob_distr: use "clang-format off" to avoid wide lines for URLs 2020-02-06 14:33:05 -05:00
Nick Mathewson
98fdc3e41a Use a compile-time assert in control_events.h
(The original idiom here led clang-format to generating a too-wide line.)
2020-02-06 14:33:05 -05:00
Nick Mathewson
21f45197a2 Merge branch 'bug33103' 2020-02-06 08:28:25 -05:00
David Goulet
a8456d2a11 test: Missing hs_init() in some hs_control tests
Without the hs_init(), the caches are not initialized and the previous commit
was causing an assert due to the missing caches.

But regardless of that, those tests were not initializing but were calling
hs_free_all().

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-06 12:54:54 +02:00
David Goulet
9278a24729 hs-v3: Remove descriptor when we remove client authorization
When the ONION_CLIENT_AUTH_REMOVE command is given to tor, now also remove the
descriptor associated with the client authorization credentials.

Fixes #33148

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-06 12:54:54 +02:00
Nick Mathewson
56c54a66bd Fix a memory leak in handling GETINFO.
Fixes bug 33103; bugfix on 0.4.3.1-alpha.
2020-02-05 19:18:32 -05:00
George Kadianakis
2a5e641cfe Merge branch 'tor-github/pr/1704' 2020-02-04 13:09:41 +01:00
George Kadianakis
6c749bf38c Merge branch 'tor-github/pr/1700' 2020-02-04 13:06:00 +01:00
teor
ff52051754
address: Fix comments in address.h
And improve inline function spacing, and function declaration
spacing.

Comment-only change.
2020-02-04 14:36:04 +10:00
David Goulet
08f31e405d hs-v3: Purge ephemeral client auth on NEWNYM
Fixes #33139.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-03 11:58:43 -05:00
David Goulet
1bf377f4b6 Merge branch 'tor-github/pr/1687' 2020-01-30 14:06:09 -05:00
David Goulet
f07d8a1a92 Merge branch 'tor-github/pr/1692' 2020-01-30 13:53:32 -05:00
David Goulet
a1dec44723 Merge branch 'tor-github/pr/1697' 2020-01-30 13:48:36 -05:00
David Goulet
e4245e2a6b hs-v2: Turn logs into protocol warning
All of those can be triggered remotely so change them to protocol warnings.

Fixes #32706

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-01-30 11:14:50 -05:00
Nick Mathewson
af76b9dcc6 Merge branch 'bug32673_035' 2020-01-30 09:58:23 -05:00
Nick Mathewson
9ea0c0bfcd Merge branch 'bug33093_logging_035' 2020-01-30 09:55:40 -05:00
Nick Mathewson
2a1f8ea2e7 Do not set "once" when calling tor_bug_occurred_ from BUG().
The "once" flag makes tor_bug_occurred_() say that future instances
of the warning will be suppressed -- but that's not something that
BUG() does.  Fixes bug 33095; bugfix on 0.4.1.1-alpha.
2020-01-30 09:43:34 -05:00
Nick Mathewson
ec7f99e6ef bump to 0.4.1.8 2020-01-29 19:42:24 -05:00
teor
6b392c333a
Merge branch 'maint-0.4.0' into maint-0.4.1 2020-01-30 07:55:05 +10:00
teor
65825018c7
Merge branch 'maint-0.3.5' into maint-0.4.0 2020-01-30 07:54:58 +10:00
teor
9b0b2aef80
Merge remote-tracking branch 'tor-github/pr/1634' into maint-0.4.1 2020-01-30 07:54:39 +10:00
teor
41d52e9cd8
Merge remote-tracking branch 'tor-github/pr/1614' into maint-0.3.5 2020-01-30 07:53:53 +10:00
Nick Mathewson
2985a6018f buf_read_from_tls: Return ERROR_MISC, not WANTWRITE, on BUG().
Fixes bug 32673; bugfix on 0.3.0.4-alpha.  We introduced these
checks in ee5471f9aa to help diagnose 21369, but we used "-1"
when "TOR_TLS_ERROR_MISC" would have been correct.  Found by opara.

I don't think that this is actually getting triggered in the wild,
but if it were, it could cause nasty behavior: spurious
WANTREAD/WANTWRITE returns have a way of turning into CPU-eating
busy-loops.
2020-01-29 08:50:03 -05:00
Nick Mathewson
1f163fcbde Change BUG() messages in buf_flush_to_tls() to IF_BUG_ONCE()
We introduced these BUG() checks in b0ddaac074 to prevent a
recurrence of bug 23690.  But there's a report of the BUG() message
getting triggered and filling up the disk.  Let's change it to
IF_BUG_ONCE().

Fixes bug 33093; bugfix on 0.3.2.2-alpha.
2020-01-29 08:31:22 -05:00
teor
c8ba2c4730
mainloop: Simplify ip_address_changed()
Simplify ip_address_changed() by removing redundant checks
(all exits are relays, and need to rebuild their descriptor when their
IP addresses change).

Rewrite the function comment, and rename the argument, so the function
is easier to understand and use.

Closes 33091.
2020-01-29 18:23:38 +10:00
teor
d873674fb3
connection: Improve function comments
Improve the function comments on connection_finished_connecting(),
to describe what the function actually does.

Part of 33091.
2020-01-29 18:22:21 +10:00
cclauss
3208a74f90 Use print() function in both Python 2 and Python 3 2020-01-28 01:38:54 +01:00
Taylor Yu
76a8a734c9 tests for ticket 33039 2020-01-24 12:20:52 -06:00
Taylor Yu
f7a2b98674 fix leak in GETCONF
Fix a memory leak introduced by refactoring of control reply
formatting code.  Fixes bug 33039; bugfix on 0.4.3.1-alpha.
2020-01-24 12:20:47 -06:00
Nick Mathewson
e34d963c44 Bump to 0.4.3.1-alpha-dev 2020-01-22 20:30:46 -05:00
David Goulet
21d0d81d82 Merge branch 'tor-github/pr/1677' 2020-01-22 14:32:30 -05:00
Alexander Færøy
35721b38e4 Lower log level of standard error messages from PT's.
This patch lowers the log level of error messages from PT processes from
warning to debug.

See: https://bugs.torproject.org/33005
2020-01-22 14:32:13 -05:00
teor
08efb28743
dir_connection_t: Explain dirconn_direct better
Direct connections can use a DirPort or ORPort.
Indirect connections must use a multi-hop Tor circuit.

Comment-only changes.
2020-01-22 09:27:40 +10:00
Nick Mathewson
e144134294 Bump to 0.4.3.1-alpha 2020-01-21 12:33:05 -05:00
David Goulet
ff93133403 Merge branch 'tor-github/pr/1675' 2020-01-20 10:47:49 -05:00
David Goulet
ca8b90a843 Merge branch 'tor-github/pr/1668' 2020-01-20 10:44:03 -05:00
teor
bf2a399fc0
config: Make clients tell dual-stack exits they prefer IPv6
Make Tor clients tell dual-stack exits that they prefer IPv6
connections.

This change is equivalent to setting the PreferIPv6 flag on
SOCKSPorts (and most other listener ports). Tor Browser has
been setting this flag for some time, and we want to remove a
client distinguisher at exits.

Also update the man page, putting all the IP flags in their
non-default forms.

Closes ticket 32637.
2020-01-20 16:36:58 +10:00
teor
b23b8fa4a1
Merge remote-tracking branch 'tor-github/pr/1673' 2020-01-20 15:52:40 +10:00
teor
af30be9515
test/nodelist: Remove ROUTERSTATUS_FORMAT_NO_CONSENSUS_METHOD
When we removed obsolete consensus methods in 32695, we also
removed ROUTERSTATUS_FORMAT_NO_CONSENSUS_METHOD, so we need to
remove it from the routerstatus format tests.

Part of 20218.
2020-01-20 15:51:30 +10:00
teor
3851128e88
Merge branch 'ticket20218_rebased_squashed' into ticket20218_merged
* ticket 32695 removed networkstatus_consensus_has_ipv6(),
  keep that change in master.
* ticket 20218 modifies the function name and comment for
  routerstatus_has_visibly_changed(), keep that change
  in ticket20218_rebased_squashed.
2020-01-20 15:50:54 +10:00
Nick Mathewson
4541289f2a
Rename test to match new identifier. 2020-01-20 15:48:52 +10:00