aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_dos.c
AgeCommit message (Collapse)Author
2020-07-17or_connection_t: replace real_addr with canonical_orport.Nick Mathewson
Instead of replacing connection_t.{addr,port} with a canonical orport, and tracking the truth in real_addr, we now leave connection_t.addr alone, and put the canonical address in canonical_orport. Closes #40042 Closes #33898
2020-07-14addr: Use tor_addr_t instead of uint32_t for IPv4David Goulet
This changes a LOT of code but in the end, behavior is the same. Unfortunately, many functions had to be changed to accomodate but in majority of cases, to become simpler. Functions are also removed specifically those that were there to convert an IPv4 as a host format to a tor_addr_t. Those are not needed anymore. The IPv4 address field has been standardized to "ipv4_addr", the ORPort to "ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport". This is related to Sponsor 55 work that adds IPv6 support for relays and this work is needed in order to have a common interface between IPv4 and IPv6. Closes #40043. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-10Make channel_get_addr_if_possible() take a const channel_t.Nick Mathewson
(There is no reason that looking up the address of a channel should ever change it.)
2020-03-17Merge remote-tracking branch 'tor-github/pr/1784'teor
2020-03-10dos: Pass transport name on new client connectionDavid Goulet
For a bridge configured with a pluggable transport, the transport name is used, with the IP address, for the GeoIP client cache entry. However, the DoS subsystem was not aware of it and always passing NULL when doing a lookup into the GeoIP cache. This resulted in bridges with a PT are never able to apply DoS defenses for newly created connections. Fixes #33491 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-12-20Replace several C identifiers.teor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ EXPOSE_CLEAN_BACKTRACE BACKTRACE_PRIVATE \ TOR_CHANNEL_INTERNAL_ CHANNEL_OBJECT_PRIVATE \ CHANNEL_PRIVATE_ CHANNEL_FILE_PRIVATE \ EXPOSE_ROUTERDESC_TOKEN_TABLE ROUTERDESC_TOKEN_TABLE_PRIVATE \ SCHEDULER_PRIVATE_ SCHEDULER_PRIVATE
2019-06-05Run "make autostyle."Nick Mathewson
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-09-27Split geoip from geoip-related stats.Nick Mathewson
This commit just moves the code to two separate files. The geoip code still has a few needless dependencies on core/* and features/*.
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-15Extract routerstatus_t into its own header.Nick Mathewson
2018-06-15Extract networkstatus_t and ..sr_info_t into their own headersNick Mathewson
2018-06-15Move or_connection_t to its own header.Nick Mathewson
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-02-09test: DoS test to make sure we exclude known relaysDavid Goulet
Part of #25193 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-06remove a redundant semicolonNick Mathewson
2018-02-02Use tt_u64_op() for uint64_t inputs.Nick Mathewson
2018-01-31test: Add unit tests for overflows and underflows in cc_stats_refill_bucketteor
Closes #25094. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31dos: Make sure cc_stats_refill_bucket can't overflow while calculatingteor
Debug log the elapsed time in cc_stats_refill_bucket Part of #25094. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31test: Remove a redundant round from test_dos_bucket_refillteor
This round is left over from the tenths of a second code. Part of #25094.
2018-01-30test: Add unit tests for the DoS subsystemGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>