Commit Graph

34478 Commits

Author SHA1 Message Date
Nick Mathewson
9826fb1981 Add a return type for the parsed commandline.
Previously it was stored in two outvars, but this is more
elegant. I'm going to be expanding this struct in later commits.
2019-10-17 12:01:40 -04:00
David Goulet
52bf54ecd4 hs-v3: Add a series of decoding error code
This commit introduces the hs_desc_decode_status_t enum which aims at having
more fine grained error code when decoding a descriptor.

This will be useful in later commits when we support keeping a descriptor that
can't be decrypted due to missing or bad client authorization creds.

No behavior change.

Part of #30382.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-17 11:31:03 -04:00
David Goulet
8e0d9189c5 hs-v3: Helper function to find all entry connections
No code behavior change. This removes duplicate code that was finding all
entry connections for a specific onion service identity key.

The find_entry_conns() helper function is introduced for that.

Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-17 11:31:03 -04:00
Alexander Færøy
ee8db8a2eb Add test to check if the exit callback is called in process_t upon process_exec() failures.
This patch adds a test to check for whether the exit callback is always
called when process_exec() fails, both on Windows and Unix.

See: https://bugs.torproject.org/31810
2019-10-17 16:59:43 +02:00
Alexander Færøy
cbed6ff843 Ensure that the exit callback is called if CreateProcessA() fails on Windows.
This patch fixes an issue where the exit handler is not called for the
given process_t in case CreateProcessA() fails. This could, for example,
happen if the user tries to execute a binary that does not exist.

See: https://bugs.torproject.org/31810
2019-10-17 16:59:43 +02:00
Alexander Færøy
9915b8f0bc Handle errors from execve() in the Unix process backend more gracefully.
This patch removes a call to tor_assert_unreached() after execve()
failed. This assertion leads to the child process emitting a stack trace
on its standard output, which makes the error harder for the user to
demystify, since they think it is an internal error in Tor instead of
"just" being a "no such file or directory" error.

The process will now instead output "Error from child process: X" where
X is the stringified version of the errno value.

See: https://bugs.torproject.org/31810
2019-10-17 16:39:05 +02:00
David Goulet
4a8d491322 mainloop: Disable periodic events before a destroy
When tearing down all periodic events during shutdown, disable them first so
their enable flag is updated.

This allows the tor_api.h to relaunch tor properly after a clean shutdown.

Fixes #32058

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-17 10:11:32 -04:00
Nick Mathewson
0081d6c112 Merge branch 'ticket31373_042_01_squashed' 2019-10-17 10:09:16 -04:00
David Goulet
7fcf999c63 Print summary at the end of the configure script
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-17 10:08:34 -04:00
David Goulet
84162c1d33 socks: Send back extended error code if set
This commit defines the new extended error codes. It also flags the socks
request object that it can use them.

Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-17 08:52:58 -04:00
David Goulet
78a9158bf0 socks: Add SocksPort flag ExtendedErrors
This new flag tells tor that it can send back the SOCKS5 extended error code
detailed in prop304.

Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-17 08:52:21 -04:00
Nick Mathewson
5c09230b45 hs_cache.c: fix HTML tags in doxygen comments. 2019-10-17 08:27:17 -04:00
Nick Mathewson
39cf575ed4 Merge remote-tracking branch 'tor-github/pr/1416' 2019-10-17 08:25:11 -04:00
teor
5f3233ce1a
Merge branch 'maint-0.4.2' 2019-10-17 14:52:19 +10:00
teor
8ac9af2330
Merge branch 'maint-0.4.1' into maint-0.4.2 2019-10-17 14:52:15 +10:00
teor
400e31ad19
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-10-17 14:52:06 +10:00
teor
e483257e1b
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-17 14:51:58 +10:00
teor
4b8e5ea0dc
Merge branch 'maint-0.2.9' into maint-0.3.5 2019-10-17 14:51:50 +10:00
teor
92c4dc9b14
Merge remote-tracking branch 'tor-github/pr/1373' into maint-0.4.2 2019-10-17 14:51:30 +10:00
teor
13daf339a9
Merge remote-tracking branch 'tor-github/pr/1372' into maint-0.4.1 2019-10-17 14:51:02 +10:00
teor
702aa8f775
Merge remote-tracking branch 'tor-github/pr/1370' into maint-0.3.5 2019-10-17 14:50:28 +10:00
teor
c660f47960
Merge remote-tracking branch 'tor-github/pr/1369' into maint-0.2.9 2019-10-17 14:49:52 +10:00
teor
85d0a458c2
scripts: Add git-setup-dirs.sh, which sets up maintainer git repos
git-setup-dirs.sh sets up an upstream git repository and worktrees,
so that tor maintainers can do merges.

Closes ticket 29603.
2019-10-17 14:47:48 +10:00
teor
e6bb23434e Merge remote-tracking branch 'tor-github/pr/1419'
Obviously correct fixes to code that's already been reviewed.
2019-10-17 13:47:42 +10:00
Nick Mathewson
2c97cf3add Merge remote-tracking branch 'tor-github/pr/1329' 2019-10-16 12:31:47 -04:00
Nick Mathewson
3430b487d6 hs_cell.[ch]: repair doxygen. 2019-10-16 12:08:38 -04:00
Alexander Færøy
8162859ef7 Add changes file for #31147
See: https://bugs.torproject.org/31147
2019-10-16 18:07:28 +02:00
Nick Mathewson
6a2057a9f2 or_options_st.h: repair some doxygen comments. 2019-10-16 12:05:17 -04:00
Nick Mathewson
18ea8855f2 shared_random.[ch]: repair doxygen comments 2019-10-16 12:04:53 -04:00
Nick Mathewson
17b88241db hs_cache.[ch]: repair doxygen comments. 2019-10-16 11:57:44 -04:00
Tobias Stoeckmann
d91ad5112e Check tor_vasprintf for error return values.
In case of error, a negative value will be returned or NULL written into
first supplied argument.

This patch uses both cases to comply with style in the specific files.

A tor_vasprintf error in process_vprintf would lead to a NULL dereference
later on in buf_add, because the return value -1 casted to size_t would
pass an assertion check inside of buf_add.

On the other hand, common systems will fail on such an operation, so it
is not a huge difference to a simple assertion. Yet it is better to
properly fail instead of relying on such behaviour on all systems.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-10-16 17:56:12 +02:00
Nick Mathewson
1b66668e26 hs_client.[ch]: fix doxygen comments by using /**. 2019-10-16 11:51:47 -04:00
Nick Mathewson
06367299c2 shared_random_state.[ch]: Repair a bunch of doxygen comments
These need to start with /**, not /*.
2019-10-16 11:44:30 -04:00
Nick Mathewson
123fe6bdc5 hs_common.[ch]: repair doxygen comments by replacing /* with /** 2019-10-16 11:39:10 -04:00
Nick Mathewson
2127d797e9 hs_descriptor.[ch]: repair doxygen comments.
These are yet more that were not made with "/**"
2019-10-16 11:33:03 -04:00
Nick Mathewson
ca26ea03fc hs_service.c: repair doxygen comments 2019-10-16 11:26:20 -04:00
Nick Mathewson
0e9e5c37b7 hs_service.h: repair doxygen comments. 2019-10-16 11:18:43 -04:00
Nick Mathewson
ba44423cfc address_set.c: doxygen comment repair. 2019-10-16 11:15:25 -04:00
Nick Mathewson
a54c98007a channel.h: fix various doxygen warnings
There were a bunch of items where the doxygen comments were
formatted incorrectly (with /* instead of /**)
2019-10-16 11:11:43 -04:00
Nick Mathewson
ce0739314b voting_schedule: fix doxygen comments to use /**
Previously some of the comments here used /*.
2019-10-16 11:08:34 -04:00
Nick Mathewson
85accdf00a Tell doxygen not to pay attention to __attribute__. 2019-10-16 11:02:49 -04:00
Nick Mathewson
2329f8a28c Teach Doxygen to handle MOCK_{DECL,IMPL} 2019-10-16 10:59:29 -04:00
Nick Mathewson
87afe5c260 Rename authcert_members.i to .h, and have it define a macro.
Including a file in the middle of a declaration seems to confuse
Doxygen, and Coccinelle doesn't much like it either.l
2019-10-16 10:53:01 -04:00
Nick Mathewson
911adb4d2b Make doc/doxygen before running doxygen.
This makes out-of-tree doxygen builds work.

Closes ticket 32113.
2019-10-16 10:31:44 -04:00
Nick Mathewson
8413eec2c7 Merge branch 'ticket32099' 2019-10-16 10:28:03 -04:00
Nick Mathewson
bcbf3b7479 Merge branch 'ticket32110' 2019-10-16 10:14:51 -04:00
Nick Mathewson
593acfabb3 Doxygen: stop producing LaTeX.
Running doxygen with latex gave us all manner of unicode issues,
slowed down the "make doxygen" target by a lot, and added several
latex dependencies... all to produce a 4000-page reference manual
which is probably not what anybody wanted.

Closes ticket 32099.
2019-10-16 09:56:31 -04:00
Nick Mathewson
08fd551e9f Regenerate practracker exceptions file for 0.4.3 progress. 2019-10-16 09:15:00 -04:00
Nick Mathewson
8ce17e0b35 practracker: add a missing #. 2019-10-16 09:15:00 -04:00
Nick Mathewson
033d76b0e0 Doxygen: update doxyfile to a more recent version.
I have left the settings at their old values, except when they
referred to nonexistent files.

Closes ticket 32110
2019-10-16 09:07:21 -04:00