Commit Graph

34529 Commits

Author SHA1 Message Date
Nick Mathewson
acb97cfa68 log config: Set safelogging_changed even if we aren't running Tor. 2019-11-20 09:26:47 -05:00
Nick Mathewson
89c355b386 Some tests for log changes, commit, and rollback 2019-11-20 09:26:47 -05:00
Nick Mathewson
a30d143228 Make KeyDirectory's GroupReadable behave the same as CacheDirectory's.
In #26913 we solved a bug where CacheDirectoryGroupReadable would
override DataDirectoryGroupReadable when the two directories are the
same.  We never did the same for KeyDirectory, though, because
that's a rare setting.

Now that I'm testing this code, though, fixing this issue seems
fine.  Fixes bug #27992; bugfix on 0.3.3.1-alpha.
2019-11-20 09:26:47 -05:00
Nick Mathewson
3094651fa3 New unit tests for options_create_directories(). 2019-11-20 09:26:47 -05:00
Nick Mathewson
9951afe177 parseconf test: ControlSocketsGroupWriteable without ControlSocket. 2019-11-20 09:26:47 -05:00
Nick Mathewson
cd8c96ce02 Typo fix in warning message about ControlSocket 2019-11-20 09:26:47 -05:00
Nick Mathewson
cf7580ab06 Free options objects for which validation fails.
Also free options objects when we discard them due to
TestingTorOptions.

Fixes bug 32555; bug not in any released Tor.
2019-11-20 09:14:08 -05:00
Nick Mathewson
929b46f44a Split listener configuration out of options_act_reversible() 2019-11-19 16:05:07 -05:00
Nick Mathewson
5060007f4b Split log configuration out of options_act_reversible(). 2019-11-19 16:03:32 -05:00
Nick Mathewson
20c24e72d9 options_act_reversible(): Extract more startup-only pieces.
These have to happen after opening listeners and before opening logs :/
2019-11-19 16:03:10 -05:00
Nick Mathewson
006ce47ffa Extract a function for one-time-only pre-reversible options.
These changes _only_ happen at startup, and happen before _any_
reversible option change is set.
2019-11-19 16:03:10 -05:00
Nick Mathewson
effed7fb1c Move some ControlSocket checks to options_validate_cb()
There is no reason for them be in options_act_reversible().
2019-11-19 16:03:10 -05:00
George Kadianakis
21b3303657 Rename REGISTER_SUCCESS_ALSO_DECRYPTED to REGISTER_SUCCESS_AND_DECRYPTED. 2019-11-18 19:21:45 +02:00
George Kadianakis
97fd75169d Various minor improvements after David's review.
- Fix a wrong log message
- Introduce a cap for the nickname size
- Change some 'if' statements to 'switch'.
2019-11-18 19:21:41 +02:00
George Kadianakis
ce422a9d4a hs-v3: Decrypt pending descriptors when we get new client auth creds. 2019-11-18 19:21:34 +02:00
George Kadianakis
53ac9a9a91 Add changes file for #30381. 2019-11-18 19:21:10 +02:00
George Kadianakis
b996d55bcd control-port: Tests for ONION_CLIENT_AUTH_VIEW. 2019-11-18 19:19:10 +02:00
George Kadianakis
db6a48b6bf control-port: Implement ONION_CLIENT_AUTH_VIEW. 2019-11-18 19:19:00 +02:00
George Kadianakis
ee4b2287c6 control-port: Tests for ONION_CLIENT_AUTH_REMOVE. 2019-11-18 19:18:56 +02:00
George Kadianakis
8330b4dc2a control-port: Implement ONION_CLIENT_AUTH_REMOVE. 2019-11-18 19:18:49 +02:00
George Kadianakis
46f4415022 control-port: Tests for ONION_CLIENT_AUTH_ADD. 2019-11-18 19:18:45 +02:00
George Kadianakis
00fdaaee1e control-port: Implement ONION_CLIENT_AUTH_ADD. 2019-11-18 19:16:01 +02:00
George Kadianakis
d28b6792cb Merge branch 'tor-github/pr/1423' 2019-11-18 19:06:53 +02:00
David Goulet
d60ed5a6a2 doc: Manpage entry for ExtendedErrors of prop304
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
3892ac7c71 test: Unit test for the hs cache decrypt on new auth
Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
c0dd5324b3 test: Unit test for the SOCKS5 HS client auth errors
Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
68a004d147 hs-v3: Improve documentation of hs_cache_client_descriptor_t
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
48a9f8a63f hs-v3: Function to re-parse unencrypted descriptor
We now keep descriptor that we can't decode due to missing client
authorization in the cache.

This new function is used when new client authorization are added and to tell
the client cache to retry decoding.

Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
fbc18c8989 hs-v3: Refactor descriptor dir fetch done code
This commit extract most of the code that dirclient.c had to handle the end of
a descriptor directory requests (fetch). It is moved into hs_client.c in order
to have one single point of entry and the rest is fully handled by the HS
subsystem.

As part of #30382, depending on how the descriptor ended up stored (decoded or
not), different SOCKS error code can be returned.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
80f241907c hs-v3: Set extended error if .onion is invalid
In order to achieve this, the parse_extended_hostname() had to be refactored
to return either success or failure and setting the hostname type in the given
parameter.

The reason for that is so it can detect invalid onion addresses that is having
a ".onion", the right length but just not passing validation.

That way, we can send back the prop304 ExtendedError "X'F1' Onion Service
Descriptor Is Invalid" to notify the SOCKS connection of the invalid onion
address.

Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
542402cd60 hs-v3: Set extended error when missing/bad client auth
Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
fb1d212021 hs-v3: Set extended error when descriptor is not found
Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
7bba8bf72f hs-v3: Return descriptor decoding status when storing as client
This will allow us to callback into the HS subsytem depending on the decoding
status and return an extended SOCKS5 error code depending on the decoding
issue.

This is how we'll be able to tell the SocksPort connection if we are missing
or have bad client authorization for a service.

Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
David Goulet
96a53221b0 hs-v3: Keep descriptor in cache if client auth is missing or bad
We now keep the descriptor in the cache, obviously not decoded, if it can't be
decrypted for which we believe client authorization is missing or unusable
(bad).

This way, it can be used later once the client authorization are added or
updated.

Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-18 19:06:43 +02:00
teor
c34fb3413d
Merge remote-tracking branch 'tor-github/pr/1517' 2019-11-18 11:21:37 +10:00
Nick Mathewson
183f89ccac Merge remote-tracking branch 'tor-github/pr/1545' 2019-11-16 15:30:00 -05:00
Nick Mathewson
b0c1634ce9 Merge remote-tracking branch 'tor-github/pr/1544' 2019-11-16 15:29:14 -05:00
Nick Mathewson
59ba61a690 Make structs declared by tor_queues.h macros also follow naming rules 2019-11-16 15:27:08 -05:00
Nick Mathewson
cc271afeda map.h: replace maptype with mapname_t
This change makes our macro bodies consistent with our naming
expectations for structs and types outside macro bodies.
2019-11-16 15:20:47 -05:00
Nick Mathewson
0c80c2e45f handles.h: replace structname with structname_t
This change makes our macro bodies consistent with our naming
expectations for structs and types outside macro bodies.
2019-11-16 15:20:32 -05:00
Nick Mathewson
5a1a60e65e Revise struct names in examples in comments to end with _t 2019-11-16 15:12:35 -05:00
Nick Mathewson
d700dc7801 Topic documentation on our publish-subscribe architecture. 2019-11-16 14:31:49 -05:00
Nick Mathewson
0e4e96b9bf High-level documentation of configuration in Tor.
Closes ticket 32209.
2019-11-15 16:25:00 -05:00
Neel Chauhan
c8859eb754 Remove the extra whitespace around the DARWIN #defines 2019-11-15 15:05:53 -05:00
Neel Chauhan
4874b00065 Remove the extra whitespace in the lines_eq() if statement in consdiff_gen_diff() 2019-11-15 14:56:47 -05:00
Nick Mathewson
8b91680d5c Doxygen: rename all .dox files to end with .md
Using a standard ending here will let other tools that expect
markdown understand our output here.

This commit was automatically generated with:

   for fn in $(find src -name '*.dox'); do \
      git mv "$fn" "${fn%.dox}.md"; \
   done
2019-11-15 09:28:12 -05:00
Nick Mathewson
3a7369d0cf Doxygen: remove /** and **/ from all .dox files
This is an automatically generated commit, made with:

find src -name '*.dox' | \
   xargs  perl -i -ne 'print unless (m#^\s*/?\*\*/?\s*$#);'
2019-11-15 09:23:51 -05:00
Nick Mathewson
625ad65382 Doxygen: expect .md files, not .dox files
Also, I have to add src/rust/registry to the excluded paths, since
it includes .md files that Doxygen can't handle.
2019-11-15 09:23:10 -05:00
Nick Mathewson
108d2967a7 Process "dox" files as regular markdown. 2019-11-15 09:20:51 -05:00
Nick Mathewson
97b5ff2b1d Merge branch 'ticket32211' 2019-11-15 09:10:11 -05:00