teor
d7fdab49f7
test/controller: Stop including a ".c" source file
...
Part of 32522.
2019-11-26 11:02:05 +10:00
teor
2a71a58d4f
test: Fix a python double-space
2019-11-26 11:00:39 +10:00
Nick Mathewson
31f8b4fa65
Merge branch 'stream-socks-auth' into bug19859_merged
2019-11-25 07:58:02 -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
George Kadianakis
b996d55bcd
control-port: Tests for ONION_CLIENT_AUTH_VIEW.
2019-11-18 19:19:10 +02:00
George Kadianakis
ee4b2287c6
control-port: Tests for ONION_CLIENT_AUTH_REMOVE.
2019-11-18 19:18:56 +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
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
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
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
Neel Chauhan
c8859eb754
Remove the extra whitespace around the DARWIN #defines
2019-11-15 15:05:53 -05:00
Nick Mathewson
cf79ffaf1e
Fix 32-bit warnings in test_circuitmux.c
...
Fixes bug 32496; bug not in any released Tor.
2019-11-14 11:04:10 -05:00
teor
aa3e2bbd4b
test/parseconf: Warn when the expected_log* file is missing
...
Part of 32451.
2019-11-14 12:57:59 +10:00
teor
ced434c586
test/parseconf: Update conf_examples to use expected_log
...
Part of 32451.
2019-11-14 12:57:34 +10:00
teor
c7838c71fb
test/parseconf: Add failure cases in conf_failures/
...
These failure cases can be used to test the failure behaviour
and failure logs of test_parseconf.sh.
See the README for details.
Part of 32451.
2019-11-14 11:57:50 +10:00
teor
51a6c0c8fd
test/parseconf: Stop adding newlines to *_printf
...
Cleanup after 32451.
2019-11-14 11:57:50 +10:00
teor
2c4ada729e
test/parseconf: Show tor command lines on failure
...
Part of 32451.
2019-11-14 11:57:50 +10:00
teor
a5628cf5b3
test/parseconf: Refactor and simplify, stage 2
...
Remove more duplicate code.
Eliminate some arguments.
Rewrite some comments.
Cleanup after 32451.
2019-11-14 10:55:21 +10:00
teor
39046019ec
test/parseconf: Refactor and standardise, stage 1
...
Remove duplicate code, and standardise similar behaviour.
Add some additional error checking.
Cleanup after 32451.
2019-11-14 10:55:21 +10:00
teor
b4b3060f69
test/parseconf: Rename some functions, and reformat
...
Part of 32451.
2019-11-14 10:55:21 +10:00
teor
e6ca32fae3
test/parseconf: Use consistent formatting
...
Make spacing, quotes, and env vars consistent.
Cleanup after 32451 and 32468.
2019-11-14 10:55:21 +10:00
teor
4514bfe9c2
test/parseconf: Stop ignoring --dump-config failures
...
When we added the $FILTER for Windows newlines, we made
the pipeline always exit successfully, even if tor failed.
Fixes bug 32468; bugfix on 0.4.2.1-alpha.
2019-11-14 10:55:21 +10:00
teor
7ef44100c4
test/parseconf: Standardise output messages
...
Part of 32451.
2019-11-14 10:55:21 +10:00
teor
3df6432006
test/parseconf: Add an expected_log file
...
The "expected_log" file is a set of patterns that matches the
output of "tor --verify-config". Unlike "error", it expects a
successful exit status.
Part of 32451.
2019-11-14 10:55:21 +10:00
teor
4cf5d4cb3c
test/parseconf: Rewrite the included files section
...
Part of 32451.
2019-11-14 10:55:21 +10:00
teor
735d5f5b7e
test/parseconf: Split the file list into sections
...
There are lots of different files now, so having Config and Result
sections is helpful.
Part of 32451.
2019-11-14 10:55:21 +10:00
JeremyRand
f487da518a
Bug 19859: Fix double-free in unit test
2019-11-12 17:13:04 +00:00
teor
233ccef6d8
Merge branch 'maint-0.4.2'
2019-11-12 10:10:01 +10:00
teor
9be51e8a8e
test/parseconf: Add tests for ignored options
...
These tests will also pass on 0.4.3, with the original implementation,
and with the new implementation in 32404.
Part of 32295 and 32404.
2019-11-12 10:09:40 +10:00
Nick Mathewson
7c3378fb8d
Merge remote-tracking branch 'tor-github/pr/1338'
2019-11-11 12:20:14 -05:00
liberat
4ae77e15d0
Test case for SOCKS5 RESOLVE_PTR with IPv6 address in brackets.
...
This was not supported previously, but provides symmetry with other
SOCKS requests, which also support addresses written in brackets.
2019-11-11 15:41:56 +00:00
liberat
b7c7474130
Test case for SOCKS5 RESOLVE_PTR with binary IPv6 address.
...
This tests the handling of binary v6 addresses, which works correctly
in older versions but was broken in 0.3.5.1-alpha.
2019-11-11 15:35:21 +00:00
teor
2d651f4f6a
test/parseconf: Add basic parsing tests
...
And document the "%include" behaviour.
Closes 32450.
2019-11-11 13:04:28 +10:00
Nick Mathewson
31a6a6512f
Rename probability distribution names to end with "_t".
...
I needed to do this by hand, since we also use these for function
names, variable names, macro expansion, and a little token pasting.
2019-11-07 08:56:07 -05:00
Nick Mathewson
4845ab53f0
Make all our struct names end with "_t".
...
This is an automated commit, generated by this command:
./scripts/maint/rename_c_identifier.py \
address_ttl_s address_ttl_t \
aes_cnt_cipher aes_cnt_cipher_t \
authchallenge_data_s authchallenge_data_t \
authenticate_data_s authenticate_data_t \
cached_bw_event_s cached_bw_event_t \
cbuf cbuf_t \
cell_ewma_s cell_ewma_t \
certs_data_s certs_data_t \
channel_idmap_entry_s channel_idmap_entry_t \
channel_listener_s channel_listener_t \
channel_s channel_t \
channel_tls_s channel_tls_t \
circuit_build_times_s circuit_build_times_t \
circuit_muxinfo_s circuit_muxinfo_t \
circuitmux_policy_circ_data_s circuitmux_policy_circ_data_t \
circuitmux_policy_data_s circuitmux_policy_data_t \
circuitmux_policy_s circuitmux_policy_t \
circuitmux_s circuitmux_t \
coord coord_t \
cpuworker_job_u cpuworker_job_u_t \
cv_testinfo_s cv_testinfo_t \
ddmap_entry_s ddmap_entry_t \
dircollator_s dircollator_t \
dist_ops dist_ops_t \
ecdh_work_s ecdh_work_t \
ewma_policy_circ_data_s ewma_policy_circ_data_t \
ewma_policy_data_s ewma_policy_data_t \
fp_pair_map_entry_s fp_pair_map_entry_t \
fp_pair_map_s fp_pair_map_t \
guard_selection_s guard_selection_t \
mbw_cache_entry_s mbw_cache_entry_t \
outbuf_table_ent_s outbuf_table_ent_t \
queued_event_s queued_event_t \
replyqueue_s replyqueue_t \
rsa_work_s rsa_work_t \
sandbox_cfg_elem sandbox_cfg_elem_t \
scheduler_s scheduler_t \
smp_param smp_param_t \
socket_table_ent_s socket_table_ent_t \
state_s state_t \
threadpool_s threadpool_t \
timeout_cb timeout_cb_t \
tor_libevent_cfg tor_libevent_cfg_t \
tor_threadlocal_s tor_threadlocal_t \
url_table_ent_s url_table_ent_t \
worker_state_s worker_state_t \
workerthread_s workerthread_t \
workqueue_entry_s workqueue_entry_t
2019-11-07 08:41:22 -05:00
Nick Mathewson
de7053b896
Adjustments to 32406 per review
...
When we are failing because of a lack of a _required_ engine, note
that the engine was "required".
When engines are disabled, any required engine should cause a
failure.
2019-11-07 07:42:58 -05:00
Nick Mathewson
c550990400
Add a test for 32406 (AccelName with "!").
...
This also lets us test a failing set_options().
2019-11-07 07:28:43 -05:00
Nick Mathewson
27a4438805
conf_examples test for crypto_accel
2019-11-07 07:28:43 -05:00
Nick Mathewson
280a9a4760
Move netstatus (mainloop) state fields into mainloop's state.
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