teor
f3cbc26bdd
add_c_file: Fix "control line not preceded by a blank line"
...
Fix dirauth and relay module include.am add_c_file.py
"control line not preceded by a blank line" errors.
Also remove a duplicate ADD_C_FILE: SOURCES in the relay module.
Obviously correct fixes to already-reviewed code.
2020-01-16 09:38:26 +10:00
Nick Mathewson
5e70c27e85
Merge remote-tracking branch 'tor-github/pr/1657'
2020-01-15 13:10:14 -05:00
teor
5fa7c1b13f
Merge remote-tracking branch 'tor-github/pr/1661'
2020-01-16 00:46:31 +10:00
Nick Mathewson
08bbb6b8d9
Merge branch 'ticket32892_043_01_squashed'
2020-01-14 13:31:20 -05:00
David Goulet
59dac38ebe
chan: Remove dead var cell handler from channel_t
...
The variable lenght cells are handled directly by
channel_tls_handle_var_cell() from an OR connection reading its inbuf. The
channel var cell handler (agnostic) was never used.
Closes #32892
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-01-14 13:31:08 -05:00
Nick Mathewson
165a92e33f
Replace an assertion with a check-and-log
...
We hit this assertion with bug 32868, but I'm stymied figuring out
how we wound up with a routerstatus like this. This patch is a
diagnostic to attempt to figure out what is going on, and to avoid a
crash in the meantime.
2020-01-14 13:16:39 -05:00
Nick Mathewson
c948db4252
Merge remote-tracking branch 'tor-github/pr/1636'
2020-01-14 12:46:14 -05:00
Nick Mathewson
c2dc94d8eb
Merge branch 'ticket32883'
2020-01-14 12:42:41 -05:00
Nick Mathewson
dec11793ba
Merge branch 'ticket32825_squashed'
2020-01-14 12:42:19 -05:00
Nick Mathewson
ac7d6f3c05
Rename UTIL_TEST_NO_WIN to reflect intent
...
Now that these tests are skipped on windows _and_ android, we should
name the macro that skips them after the functionality that the
tests depend on.
Closes last part of 32825.
2020-01-14 12:42:13 -05:00
Nick Mathewson
75741c6b3a
Merge remote-tracking branch 'tor-github/pr/1659'
2020-01-14 12:40:07 -05:00
Neel Chauhan
8d288eb3a7
Deprecate the ClientAutoIPv6ORPort option
2020-01-13 14:55:16 -08:00
Nick Mathewson
73ac1add3f
Split core/include.am into per-subdirectory include.am files
...
Closes ticket 32137.
2020-01-13 09:34:17 -05:00
David Goulet
bbe90e3ec1
hs-v2: Always check rend_cache validity before using it
...
When looking up an entry in the rend_cache, stop asserting that it exists but
rather confirm it exists and if not, return that no entry was found.
The reason for that is because the hs_circ_cleanup_on_free() function (which
can end up looking at the rend_cache) can be called from the
circuit_free_all() function that is called _after_ the rend cache is cleaned
up in tor_free_all().
We could fix the free all ordering but then it will just hide a future bug.
Instead, handle a missing rend_cache as a valid use case as in while we are in
the cleanup process.
As Tor becomes more modular, it is getting more and more difficult to ensure
subsystem callstack ordering thus this fix aims at making the HSv2 subsystem
more robust at being called while tor is pretty much in any kind of state.
Fixes #32847 .
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-01-13 09:25:26 -05:00
Nick Mathewson
5888db4967
Merge branch 'disable_ns_macro'
2020-01-09 16:02:41 -05:00
Nick Mathewson
93894fb770
Merge branch 'ticket22029_attempt_squashed'
2020-01-09 15:27:32 -05:00
Neel Chauhan
9129de7017
Add dirserv_load_fingerprint_file() test
2020-01-09 15:27:26 -05:00
Neel Chauhan
d0068be0dd
Allow ed25519 keys to be banned in approved-routers
2020-01-09 15:27:26 -05:00
Nick Mathewson
e28e41dd78
Fix wide lines from NS() removal fallout.
2020-01-09 11:43:49 -05:00
Nick Mathewson
42c6fc851e
Remove NS*() macros from test.h.
...
We never used them very much, and although they had potential to
clarify some of our tests, they also made some of the logic harder
for people to follow. Clang-format can't make head or tail of them,
so the time has come to say goodbye to them.
2020-01-09 11:09:31 -05:00
Nick Mathewson
23c77f79fd
Remove all usage of the NS*() macros in test*.c
...
This is an automatically generated commit, made with the following
kludgey perl script. It results in a number of wide lines, which
I'll clean up in a subsequent commit.
#/usr/bin/perl -w -i
$mod = "NS_MODULE";
$submod = "NS_SUBMODULE";
$last_was_empty = 0;
while (<>) {
s/\bASPECT\(\s*(\w+)\s*,\s*(\w+)\s*\)/$1_$2/;
if (/# *define +NS_MODULE +(\w+)/) {
$mod = $1;
next;
} elsif (/# *define +NS_SUBMODULE +(\w+)/) {
$submod = $1;
next;
}
next if (/#undef NS_(SUB)?MODULE/);
s/NS\(\s*test_main\s*\)/test_${mod}_${submod}/;
s/NS\(\s*(\w+)\s*\)/${mod}_${submod}_$1/g;
s/NS_FULL\(\\s*(\w+)\s*,\s*(\w+),\s*(\w+)\s*\)/$1_$2_$3/;
s/^(\s*)NS_MOCK\(\s*(\w+)\s*\)/$1MOCK($2,\n$1 ${mod}_${submod}_$2)/;
s/NS_UNMOCK\(\s*(\w+)\s*\)/UNMOCK($1)/;
s/TEST_CASE\(\s*(\w+)\s*\)/{ "$1", test_${mod}_$1, TT_FORK, NULL, NULL }/;
s/TEST_CASE_ASPECT\(\s*(\w+)\s*,\s*(\w+)\s*\)/{ "$1_$2", test_${mod}_$1_$2, TT_FORK, NULL, NULL }/;
s/NS_DECL\(\s*([^,]+)\s*,\s*([^,]+)\s*,\s*(\(.*)\);/static $1 ${mod}_${submod}_$2$3;\nATTR_UNUSED static int ${mod}_${submod}_$2_called = 0;/;
s/\bCALLED\(\s*(\w+)\s*\)/${mod}_${submod}_$1_called/;
if (/^$/) {
print if (! $last_was_empty);
$last_was_empty = 1;
} else {
$last_was_empty = 0;
print;
}
if (eof) {
$mod = "NS_MODULE";
$submod = "NS_SUBMODULE";
$last_was_empty = 0;
}
}
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date: Thu Jan 9 10:26:10 2020 -0500
#
# On branch disable_ns_macro
# Changes to be committed:
# modified: src/test/test_accounting.c
# modified: src/test/test_compat_libevent.c
# modified: src/test/test_dir.c
# modified: src/test/test_dir_handle_get.c
# modified: src/test/test_dns.c
# modified: src/test/test_options.c
# modified: src/test/test_procmon.c
# modified: src/test/test_rendcache.c
# modified: src/test/test_router.c
# modified: src/test/test_routerset.c
# modified: src/test/test_status.c
# modified: src/test/test_tortls.c
# modified: src/test/test_tortls_openssl.c
# modified: src/test/test_util_format.c
# modified: src/test/test_util_process.c
#
# Untracked files:
# experiments/
# locate_options.sh
# un_ns.pl
#
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date: Thu Jan 9 10:26:10 2020 -0500
#
# On branch disable_ns_macro
# Changes to be committed:
# modified: src/test/test_accounting.c
# modified: src/test/test_compat_libevent.c
# modified: src/test/test_dir.c
# modified: src/test/test_dir_handle_get.c
# modified: src/test/test_dns.c
# modified: src/test/test_options.c
# modified: src/test/test_procmon.c
# modified: src/test/test_rendcache.c
# modified: src/test/test_router.c
# modified: src/test/test_routerset.c
# modified: src/test/test_status.c
# modified: src/test/test_tortls.c
# modified: src/test/test_tortls_openssl.c
# modified: src/test/test_util_format.c
# modified: src/test/test_util_process.c
#
# Untracked files:
# experiments/
# locate_options.sh
# un_ns.pl
#
2020-01-09 11:09:22 -05:00
Nick Mathewson
c9855f23c1
Replace various NS_MODULE/SUBMODULE vals with shorter names.
...
This will help avoid wide lines in our output.
2020-01-09 11:08:18 -05:00
Nick Mathewson
e2fcfc6e52
Put all NS_DECL invocations on single lines.
...
This is going to make my script happier; these lines will soon
disappear.
2020-01-09 10:06:35 -05:00
Nick Mathewson
1ffba2f121
Always define NS_MODULE and NS_SUBMODULE when NS is used.
...
When these macros aren't defined, the expansions of the NS macros
can get particularly ugly.
2020-01-09 09:56:41 -05:00
Nick Mathewson
e45810113b
Merge branch 'pre_formatter_cleanups_squashed'
2020-01-09 07:32:39 -05:00
Nick Mathewson
3ad518cd97
process.h: include stdbool.h
...
We use bool, so we should include stdbool.
2020-01-09 07:30:35 -05:00
Nick Mathewson
ca9d605fa7
conscache.h: declare config_line_t structure.
...
This frees us from a dependency on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
09f03e6e3f
Turn authdir_mode_v3() into a non-inline function
...
This change means that authmode.h no longer needs to see
or_options_t, and frees us from an ordering dependency.
2020-01-09 07:30:35 -05:00
Nick Mathewson
2f7a2c42d2
Include ht.h in all headers that use HT_ENTRY()
...
Without this change, compilation success depends on include order in
several tricky ways.
2020-01-09 07:30:35 -05:00
Nick Mathewson
afa36682f9
consdiffmgr.h: use struct declarations for several types
...
This prevents a dependency on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
06d977b569
hs_circuitmap.h: use a struct declaration
...
This fixes a case where our compilation would depend on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
887bf05c24
routerparse.h: include parsecommon.h when exposing token table.
...
Without this include, our compilation depends more on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
774d1092fd
process.h: add a struct declaration for buf_t.
...
This lets us avoid a dependency on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
dd5dda78f6
timers.h: add declaration for timeval.
...
This frees us from some dependencies on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
25354171b5
lib/conf: include torint.h in files that use it.
...
This frees us from some dependencies on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
8d4b4aa932
control_hs.h: use a couple of struct delcarations
...
Doing this frees us from some assumptions about include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
8b7eeea39d
connection.h: new includes and struct declarations
...
Using these frees us from several dependencies on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
c4ac5adc4a
siphash.h: include stdint.
...
Doing this gives us a valid uint64_t type, freeing us from
dependencies on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
6a6486a7bf
hs_circuit: use struct declaration.
...
This frees us from a dependency on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
d7b8377c28
or_options_st.h: Add an include and a struct declaration.
...
This frees us from some dependencies on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
8bb686d8a0
Include x509.h in tortls_internal.h.
...
This gives us the definition of tor_x509_cert_impl_t, and makes us
less dependent on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
b1dceeca5a
Include sys/types.h in fdio.h, for "off_t".
...
Otherwise our compilation depends on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
7b0d8834f2
Use raw_assert in ht.h
...
Also, include torerr.h from ht.h if we are using raw_assert.
Otherwise, our includes need to be ordered so that ht.h comes after
util_log.h.
2020-01-09 07:30:35 -05:00
Nick Mathewson
73b83b8f1a
Remove extra ; from tt_assert() macro definition.
...
We were actually omitting the semicolon in a few places, leading to
confusing indentation and some cocci failures.
2020-01-09 07:30:35 -05:00
Nick Mathewson
3ce2304c6d
Use new ENABLE/DISABLE_GCC_WARNING
...
This is an automated commit, generated by:
perl -i -pe 'next if /define/; s/((?:ENABLE|DISABLE)_GCC_WARNING)\(([A-Za-z0-9_\-]+)\)/$1(\"-W$2\")/' src/*/*/*.[ch] src/*/*.[ch]
2020-01-09 07:30:35 -05:00
Nick Mathewson
792e5b2403
Replace DISABLE/ENABLE_GCC_WARNING with something that will confuse clang-format less
2020-01-09 07:30:35 -05:00
Nick Mathewson
a48cb9fa43
core/include.am: spelling fix
2020-01-08 20:50:02 -05:00
Nick Mathewson
4f02812242
It's 2020. Update the copyright dates with "make update-copyright"
2020-01-08 18:39:17 -05:00
Nick Mathewson
2d27a3ecc0
Run "make autostyle"; add an endif comment
2020-01-08 18:38:24 -05:00
teor
a58cffe195
router: Improve port search function comments
2020-01-08 17:47:08 +10:00