Commit Graph

34166 Commits

Author SHA1 Message Date
Nick Mathewson
3afbb29bee subsysmgr: use IDX_NONE is an exception value, not -1. 2019-11-07 07:28:43 -05:00
Nick Mathewson
0f0a9bdf33 Stop using "config_suite_offset=-1" to indicate "no config suite."
Instead, create a separate "has_config_suite" boolean, so that only
top-level formats with config_suites need to declare an offset at
all.
2019-11-07 07:28:43 -05:00
Nick Mathewson
0d8504e70b crypto config: do not change the user's value of HardwareAccel.
We still interpret "AccelName" as turning on the "HardwareAccel"
feature, but we no longer modify the user's options here.

Fixes bug 32382; bugfix on 0.2.2.1-alpha when we added openssl
engine support.
2019-11-07 07:28:43 -05:00
Nick Mathewson
8cd3e66d93 Use new configuration architecture for crypto options
This is a comparatively simple change.
2019-11-07 07:28:43 -05:00
Nick Mathewson
b06e9d8ad5 Add testing-only functions to get the subsystem config/state indices 2019-11-07 07:28:43 -05:00
Nick Mathewson
52c0ab4af3 Add subsys functions for receiving/flushing states and options.
These functions are in the subsystem, not in the config_format_t,
since they are about how the format is _used_, not about _what it
is_.
2019-11-07 07:28:43 -05:00
Nick Mathewson
7ac4f9d5ec Give subsystems optional config formats and state formats.
The formats, when provided, are now added to the global config_mgr_t
objects.
2019-11-07 07:28:43 -05:00
Nick Mathewson
a7cfddc8d1 Make a new structure for tracking subsystem status.
We used to have only one boolean per subsystem, but we're about to
have a little more information.
2019-11-07 07:28:43 -05:00
Nick Mathewson
8638989308 Expose get_obj() functions from confmgt.c.
The subsysmgr code wants to use them.
2019-11-07 07:28:43 -05:00
Nick Mathewson
5914addcbc Teach doxygen about option-declaration code.
These settings allow doxygen to find and understand doxygen comments
in configuration definitions made using the macros in confdecl.h.
2019-11-07 07:28:43 -05:00
Nick Mathewson
1d108894e7 Define a low-level version of the confdecl table macros
This version uses the enum rather than the type definitions, to
avoid layering violations and linking problems.
2019-11-07 07:28:43 -05:00
Nick Mathewson
683d4c2bc8 Add FOO_type_defn globals so that confdecl.h can refer to them. 2019-11-07 07:28:43 -05:00
Nick Mathewson
19cac400d9 Macros for declaring configuration structs and variable-tables
In our old design, we had to declare configuration structures (like
or_options_t) and variable tables (like option_vars_) separately,
and we used some magic to enforce their consistency (see
conftesting.h).

With this design, we write a single definition for the configuration
object and its fields, and use C macros to expand it either into a
structure, or a variable table.  Since they are both made from the
same source, they can't become inconsistent.

The two designs can coexist happily, and we can migrate from one to
the other at our convenience.
2019-11-07 07:28:43 -05:00
Nick Mathewson
4541a59019 lib/cc: Define the standard C macro pasting trick in one place.
This file is a workaround for the issue that if you say `a ## b` to
create a token that is the name of a macro, the C preprocessor won't
expand that macro.  So you can't say this:

#define FOO__SQUARE(x) ((x)*(x))
#define FOO__CUBE(x)   ((x)*(x)*(x))
#define FOO(func, x)   FOO__##func(x)

Instead, the standard C trick is to add a layer of indirection:

#define PASTE(a,b)     PASTE__(a,b)
#define PASTE__(a,b)   a ## b

#define FOO__SQUARE(x) ((x)*(x))
#define FOO__CUBE(x)   ((x)*(x)*(x))
#define FOO(func, x)   PASTE(FOO__, func)(x)

We should use this kind of trick sparingly, since it gets confusing.
2019-11-07 07:28:43 -05:00
Nick Mathewson
45698e89ed Merge remote-tracking branch 'tor-github/pr/1515' 2019-11-07 07:23:09 -05:00
teor
7ee1e16c6f
scripts/git: Stop failing when upstream branches don't exist
If you add a custom remote, or a new branch, and don't fetch first,
then the script would fail when checking for unchanged branches.

Instead, skip the check: a new branch is definitely a change.
2019-11-07 12:04:51 +10:00
teor
3864536b7c
scripts/git: Remove extra printfs from a bad merge 2019-11-07 12:04:22 +10:00
teor
a0820bc00d test/parseconf: Update config parsing tests for 32410 2019-11-07 11:44:51 +10:00
teor
aaef9a2519 relay: Stop failing on startup when the relay module is disabled
When the relay module is disabled, make "ClientOnly 1" and
"DirCache 0" by default. (But keep "ClientOnly 0" and
"DirCache 1" as the defaults for the unit tests.)

And run "make autostyle".

Part of ticket 32410.
2019-11-07 11:43:41 +10:00
teor
57f43bcb03 Run "make autostyle" 2019-11-07 10:56:17 +10:00
teor
e466c84ed3
Merge branch 'maint-0.4.2' 2019-11-07 10:51:48 +10:00
teor
1f3bf10d3f
Merge remote-tracking branch 'tor-github/pr/1513' into maint-0.4.2 2019-11-07 10:51:22 +10:00
teor
10982d5997
Merge remote-tracking branch 'tor-github/pr/1512' 2019-11-07 10:35:50 +10:00
Nick Mathewson
aebde73629 Merge branch 'ticket32386' 2019-11-06 18:29:16 -05:00
Nick Mathewson
58d7f9e68b Remove Makefile from doc/HACKING/design 2019-11-06 15:47:29 -05:00
Nick Mathewson
83cab05398 Remove 00-overview.md as already subsumed by doxygen 2019-11-06 15:47:00 -05:00
Nick Mathewson
9687efb386 Add a bunch of doxygen for things in src/lib. 2019-11-06 14:40:20 -05:00
Nick Mathewson
b994397f1a entrynodes.h: make a comment into doxygen. 2019-11-06 13:08:04 -05:00
Nick Mathewson
9663ac0027 int_type_params_t: add documentation. 2019-11-06 13:07:13 -05:00
Nick Mathewson
88796637e5 dispatch_cfg_st.h: make comments into doxygen. 2019-11-06 13:05:36 -05:00
Nick Mathewson
c6c02658cf hs_ident.c: make comments into doxygen. 2019-11-06 13:05:13 -05:00
Nick Mathewson
92b3f60ebc hs_ident.h: make comments into doxygen. 2019-11-06 13:03:40 -05:00
Nick Mathewson
2ab5b7520e Add missing **/ to core_or.dox 2019-11-06 12:56:02 -05:00
Nick Mathewson
3ae87c3c7f Turn the "dataflow" document into a doxygen page. 2019-11-06 12:50:57 -05:00
Nick Mathewson
4d70e725d1 Do not try to shut down the event loop when it is not initialized.
Doing so caused us to crash in some unusual circumstances, such as
using --verify-config to verify a configuration that failed during
the options_act() stage.

Fixes bug 32407; bugfix on 0.3.3.1-alpha.
2019-11-06 11:33:23 -05:00
David Goulet
65013a6924 changes: Add file for ticket #31371
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-06 10:27:34 -05:00
David Goulet
49cb7d6ec4 Merge branch 'tor-github/pr/1491' 2019-11-06 10:23:33 -05:00
Nick Mathewson
059a5795d3 Merge branch 'maint-0.4.2' 2019-11-06 08:57:21 -05:00
Nick Mathewson
8f6dc54e3c Merge remote-tracking branch 'tor-github/pr/1495' into maint-0.4.2 2019-11-06 08:57:14 -05:00
Nick Mathewson
1ee17dc07a OwningControllerFD should be immutable, not OwningControllerProcess.
This is a mistake I made when marking options as immutable.

Fixes bug 32399.  Bug not in any released Tor.
2019-11-06 08:37:32 -05:00
David Goulet
1407e2b169 test: Fix DoS heartbeat unit test after adding INTRO2
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-06 08:09:35 -05:00
teor
22482fd454
test/parseconf: Add support for optional library variants
test_parseconf.sh now supports:
* {error,expected}{,_lzma,_nss,_zstd}{,_no_dirauth,_no_relay_dirauth}
Or any combination of two or more optional libraries.

Closes ticket 32397.
2019-11-06 21:36:42 +10:00
teor
85e566a6a0
Merge branch 'maint-0.4.2' 2019-11-06 21:30:44 +10:00
teor
89f52f36e0
Merge remote-tracking branch 'tor-github/pr/1510' 2019-11-06 21:29:18 +10:00
teor
c3a1e15a5e
Merge remote-tracking branch 'tor-github/pr/1509' into maint-0.4.2 2019-11-06 21:28:28 +10:00
teor
23ff60c150
Merge branch 'maint-0.4.2' 2019-11-06 17:04:52 +10:00
teor
e6b5a1ff93
shellcheck: Fix minor issues in some scripts
Fix minor issues in git-push-all.sh, git-setup-dirs.sh and
test_parseconf.sh.

Fixes bug 32402; not in any released version of tor.
Obviously correct changes to already reviewed code.
2019-11-06 16:21:01 +10:00
teor
f7b45975bf
Merge branch 'bug32402_042' into bug32402_master
Merge changes from master with shellcheck fixes.
2019-11-06 16:14:06 +10:00
teor
7f23d47f72
shellcheck: Fix issues in the git-*.sh scripts
Fixes bug 32402; bugfix on 0.4.2.1-alpha.
Obviously correct changes to already reviewed code.
2019-11-06 16:09:31 +10:00
teor
57baea701f
shellcheck: Start checking most scripts for errors
This check was accidentally disabled by a bad find command.

Fixes bug 32402; bugfix on 0.4.2.1-alpha.
Obviously correct changes to already reviewed code.
2019-11-06 15:49:50 +10:00