tor/src/test
David Goulet e3f3478032 guard: Ignore marked for close circuit when changing state to open
When we consider all circuits in "waiting for guard" state to be promoted to
an "open" state, we were considering all circuits, even the one marked for
close.

This ultiamtely triggers a "circuit_has_opened()" called on the circuit that
is marked for close which then leads to possible undesirable behaviors within
a subsystem.

For instance, the HS subsystem would be unable to find the authentication key
of the introduction point circuit leading to a BUG() warning and a duplicate
mark for close on the circuit.

This commit also adds a unit test to make sure we never select marked for
close circuits when upgrading its guard state from waiting for guard to open.

Fixes #30871

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-19 07:40:05 -04:00
..
fuzz Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
bench.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
bt_test.py Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
ed25519_exts_ref.py Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
ed25519_vectors.inc Don't double hash the ed25519 blind key parameter. 2017-08-08 20:29:34 -04:00
example_extrainfo.inc Add -Wmissing-variable-declarations, with attendant fixes 2016-06-11 10:11:54 -04:00
failing_routerdescs.inc Sign extrainfo documents with ed25519 2015-05-28 10:42:22 -04:00
fakechans.h Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
fuzz_static_testcases.sh Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
hs_build_address.py prop224 client-side: Start validating onion address pubkeys. 2017-09-14 09:13:11 -04:00
hs_indexes.py test: Unit test for the hs indexes 2017-09-15 12:46:26 +03:00
hs_ntor_ref.py Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
hs_test_helpers.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
hs_test_helpers.h Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
include.am Only pass -C default-linker-libraries with sanitizers 2018-10-29 10:00:23 -07:00
log_test_helpers.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
log_test_helpers.h Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
Makefile.nmake Add tests for circuitstats.c 2017-12-07 00:04:39 +00:00
ntor_ref.py Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
ope_ref.py Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
rend_test_helpers.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
rend_test_helpers.h Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
rust_supp.txt Add a leak suppression for backtrace_alloc 2018-06-20 18:02:49 -04:00
slow_ed25519.py Add a reference implementation of our ed25519 modifications 2014-09-25 15:08:32 -04:00
slownacl_curve25519.py Make the python test scripts work on python3 2014-04-27 22:54:24 -04:00
sr_commit_calc_ref.py test: Fix shared random unit test for big endian 2016-08-26 14:46:29 -04:00
sr_srv_calc_ref.py prop250: Add unit tests 2016-07-01 14:01:41 -04:00
test-child.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test-memwipe.c Merge branch 'maint-0.3.4' into maint-0.3.5 2019-02-27 09:38:04 +10:00
test-network.sh Fix everything that previously referred to src/or 2018-07-05 17:15:50 -04:00
test-timers.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test.h Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_accounting.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_addr.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_address.c Downgrade some LOG_ERR messages in the address/* tests to warnings 2019-02-26 09:53:59 +10:00
test_address_set.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_bridges.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_bt.sh Try putting ulimit -c 0 in test_bt.sh to see if it fixes bug 26787 2018-07-18 16:33:48 -04:00
test_bt_cl.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_buffers.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_bwmgt.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_cell_formats.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_cell_queue.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_channel.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_channelpadding.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_channeltls.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_checkdir.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_circuitbuild.c guard: Ignore marked for close circuit when changing state to open 2019-06-19 07:40:05 -04:00
test_circuitlist.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_circuitmux.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_circuitstats.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_circuituse.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_compat_libevent.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_config.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_connection.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_connection.h Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_conscache.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_consdiff.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_consdiffmgr.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_containers.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_controller.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_controller_events.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_crypto.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_crypto_ope.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_crypto_openssl.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_crypto_slow.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_data.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_descriptors.inc Move test_descriptors.txt to an include file 2014-07-16 22:37:00 +02:00
test_dir.c test/dir: add an extra argument to dirserv_read_measured_bandwidths() 2019-03-21 12:56:28 +10:00
test_dir_common.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_dir_common.h Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_dir_handle_get.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_dns.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_dos.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_entryconn.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_entrynodes.c Merge branch 'tor-github/pr/536' into maint-0.3.5 2019-02-14 17:39:34 +02:00
test_extorport.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_geoip.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_guardfraction.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_handles.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_helpers.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_helpers.h Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_cache.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_cell.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_client.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_common.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_config.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_control.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_descriptor.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_descriptor.inc Add unittest for #23233. 2017-08-21 19:16:30 +03:00
test_hs_intropoint.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_ntor.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_ntor.sh prop224: Add Python integration tests for HS ntor. 2017-04-13 09:22:19 -04:00
test_hs_ntor_cl.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_hs_service.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_introduce.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_key_expiration.sh test: Also avoid reading the system default torrc in integration tests 2019-04-10 19:03:43 +10:00
test_keygen.sh test: Also avoid reading the system default torrc in integration tests 2019-04-10 19:03:43 +10:00
test_keypin.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_link_handshake.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_logging.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_mainloop.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_microdesc.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_nodelist.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_ntor.sh Add more quotes in the test scripts 2015-09-24 15:25:53 -04:00
test_ntor_cl.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_oom.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_oos.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_options.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_pem.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_periodic_event.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_policy.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_procmon.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_proto_http.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_proto_misc.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_protover.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_pt.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_rebind.py Merge remote-tracking branch 'tor-github/pr/1091' into maint-0.3.5 2019-06-11 14:51:37 +10:00
test_rebind.sh Travis: Skip test_rebind on macOS builds 2019-06-10 20:49:59 +10:00
test_relay.c Merge branch 'bug23512-v4-029-fixes-keep-typedef' into bug23512-v4-034-fixes 2019-03-08 19:37:18 +10:00
test_relaycell.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_relaycrypt.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_rendcache.c test: Fix a warning underflow in rend_cache/clean 2019-02-12 09:15:41 -05:00
test_replay.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_router.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_routerkeys.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_routerlist.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_routerset.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_rust.sh Fix segfaults related to sanitizers+jemalloc 2018-10-01 22:55:59 -07:00
test_scheduler.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_shared_random.c Merge branch 'maint-0.3.4' into maint-0.3.5 2019-03-20 09:48:03 +10:00
test_slow.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_socks.c Allow empty username/password in SOCKS5 username/password auth message 2019-01-26 11:06:33 +02:00
test_status.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_storagedir.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_switch_id.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_switch_id.sh Coverage hack for test_switch_id.sh 2016-06-20 11:15:47 -04:00
test_threads.c Merge remote-tracking branch 'nickm/bug27073_029' into bug27073_034 2019-03-14 06:47:32 +10:00
test_tortls.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_tortls.h Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_tortls_openssl.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_util.c Actually I believe this should be an EINVAL. 2019-04-09 13:49:10 -04:00
test_util_format.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_util_process.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_util_slow.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_voting_schedule.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_workqueue.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_workqueue_cancel.sh Add several test scripts wrapping test_workqueue 2016-06-08 17:29:06 -04:00
test_workqueue_efd.sh Add several test scripts wrapping test_workqueue 2016-06-08 17:29:06 -04:00
test_workqueue_efd2.sh Add several test scripts wrapping test_workqueue 2016-06-08 17:29:06 -04:00
test_workqueue_pipe.sh Add several test scripts wrapping test_workqueue 2016-06-08 17:29:06 -04:00
test_workqueue_pipe2.sh Add several test scripts wrapping test_workqueue 2016-06-08 17:29:06 -04:00
test_workqueue_socketpair.sh Add several test scripts wrapping test_workqueue 2016-06-08 17:29:06 -04:00
test_x509.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
test_zero_length_keys.sh Start splitting src/or 2018-07-05 17:15:50 -04:00
testing_common.c Fail any unit test that causes an unhandled LD_BUG or LOG_ERR 2019-01-16 15:47:33 -05:00
testing_rsakeys.c Bump copyright date to 2019. 2019-01-16 12:32:32 -05:00
vote_descriptors.inc Add -Wmissing-variable-declarations, with attendant fixes 2016-06-11 10:11:54 -04:00
zero_length_keys.sh test: Also avoid reading the system default torrc in integration tests 2019-04-10 19:03:43 +10:00