summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2020-08-03Merge branch 'ticket40081_035' into ticket40081_044Nick Mathewson
Resolves conflicts: src/core/or/channel.c src/test/test_channel.c
2020-08-03Remove channel_is_canonical_is_reliable()Nick Mathewson
This function once served to let circuits continue to be built over version-1 link connections. But such connections are long-obsolete, and it's time to remove this check. Closes #40081.
2020-07-30Merge branch 'bug40076_043' into bug40076_044Nick Mathewson
2020-07-30Merge branch 'bug40076_042' into bug40076_043Nick Mathewson
2020-07-30Merge branch 'maint-0.4.2' into bug40076_042Nick Mathewson
2020-07-30Fix a bug in buf_move_all() when the input buffer is empty.Nick Mathewson
We found this in #40076, after we started using buf_move_all() in more places. Fixes bug #40076; bugfix on 0.3.3.1-alpha. As far as I know, the crash only affects master, but I think this warrants a backport, "just in case".
2020-07-30Add unit test for buf_move_all(), including a failing caseNick Mathewson
The failing case is #if'd out for now, but will be fixed in the next commit. Testing for a fix for #40076.
2020-07-13Bug 31812: Change http URL's to httpsJeremyRand
2020-07-09Merge remote-tracking branch 'dgoulet/ticket33796_044_01' into maint-0.4.4Nick Mathewson
2020-07-09Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
2020-07-09Merge branch 'maint-0.3.5' into maint-0.4.2Nick Mathewson
2020-07-09Merge branch 'maint-0.4.3' into maint-0.4.4Nick Mathewson
2020-07-08socks: Returns 0xF6 only if BAD_HOSTNAMEGuinness
This commit modifies the behavior of `parse_extended_address` in such a way that if it fails, it will always return a `BAD_HOSTNAME` value, which is then used to return the 0xF6 extended error code. This way, in any case that is not a valid v2 address, we return the 0xF6 error code, which is the expected behavior. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-07Revert "config: Make clients tell dual-stack exits they prefer IPv6"David Goulet
This reverts commit bf2a399fc0d90df76e091fa3259f7c1b8fb87781. Don't set by default the prefer IPv6 feature on client ports because it breaks the torsocks use case. The SOCKS resolve command is lacking a mechanism to ask for a specific address family (v4 or v6) thus prioritizing IPv6 when an IPv4 address is asked on the resolve SOCKS interface resulting in a failure. Tor Browser explicitly set PreferIPv6 so this should not affect the majority of our users. Closes #33796 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-06Run `tor_tls_cert_matches_key()` Test Suite with both OpenSSL and NSS.Alexander Færøy
This patch lifts the `tor_tls_cert_matches_key()` tests out of the OpenSSL specific TLS test suite and moves it into the generic TLS test suite that is executed for both OpenSSL and NSS. This patch is largely a code movement, but we had to rewrite parts of the test to avoid using OpenSSL specific data-types (such as `X509 *`) and replace it with the generic Tor abstraction type (`tor_x509_cert_impl_t *`). This patch is part of the fix for TROVE-2020-001. See: https://bugs.torproject.org/33119
2020-06-30Merge branch 'maint-0.3.5' into maint-0.4.2Alexander Færøy
2020-06-30Merge branch 'tor-github/pr/1793' into maint-0.3.5Alexander Færøy
2020-06-30Merge branch 'maint-0.3.5' into maint-0.4.2Alexander Færøy
2020-06-30Merge branch 'tor-github/pr/1785' into maint-0.3.5Alexander Færøy
2020-06-29Merge remote-tracking branch 'tor-github/pr/1696/head' into maint-0.4.2Nick Mathewson
2020-06-29Merge remote-tracking branch 'tor-github/pr/1829/head' into maint-0.4.3Nick Mathewson
2020-06-23Merge branch 'tor-github/pr/1937' into maint-0.4.4David Goulet
2020-06-22Consistently use 'address' in Invalid v3 address responses to ↵Miguel Jacq
ONION_CLIENT_AUTH commands
2020-06-17Spelling fix: "RECCOMEND" => "RECOMMEND".Nick Mathewson
2020-06-11Fix and update unittests.George Kadianakis
Co-authored-by: Florentin Rochet <florentin.rochet@uclouvain.be>
2020-05-28Merge branch 'tor-github/pr/1792' into maint-0.4.3George Kadianakis
2020-05-28hs-v3: Improve accessor semantic of client cached objectDavid Goulet
Add an inline helper function that indicates if the cached object contains a decrypted descriptor or not. The descriptor object is NULL if tor is unable to decrypt it (lacking client authorization) and some actions need to be done only when we have a decrypted object. This improves code semantic. Fixes #33458 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-05-19Merge branch 'tor-github/pr/1886'David Goulet
2020-05-08Improve logging of included config filesDaniel Pinto
2020-05-07Merge remote-tracking branch 'tor-github/pr/1880/head'Nick Mathewson
2020-05-06Merge branch 'maint-0.4.3'Nick Mathewson
Amazingly, this time we had no merge conflicts with "falls through" comments.
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.3 version.)
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.2 version.)
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
2020-05-05relay: Rename relay_resolve_addr.{c|h} fileDavid Goulet
New name is more accurate semantically. Closes #33789 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-05-05config: New file resolve_addr.{c|h}David Goulet
Move a series of function from config.c into that new file which is related to address resolving. Part of #33789 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-05-05relay: New file relay_resolve_addr.{c|h}David Goulet
This commit moves router_pick_published_address() and the related helper functions into the new file. The log_addr_has_changed() function has been made public in router.h so we can use it in relay_resolve_addr.c. This is a refactoring as part of Sponsor 55. Only code movement at this commit. Part of #33789 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-30relay: Refactor can extend over IPv6 checksteor
Split "can extend over IPv6" and "has advertised IPv6 ORPort" into separate functions. They currently have the same result, but this may change in 33818 with ExtendAllowIPv6Addresses. Part of 33817.
2020-04-30net: Make all address bytes functions take uint8_t *teor
Part of 33817.
2020-04-29relay: Add tests for choosing extend IPsteor
Part of 33817.
2020-04-29relay: Add IP version tests for circuit extendsteor
Add IPv4-only and IPv6-only tests for circuit_open_connection_for_extend(). Part of 33817.
2020-04-29relay: Choose between IPv4 and IPv6 extends at randomteor
When an EXTEND2 cell has an IPv4 and an IPv6 address, choose one of them uniformly at random. Part of 33817.
2020-04-29test/circuitbuild: Disable some tests when ALL_BUGS_ARE_FATALteor
Some tests use IF_BUG_ONCE(), which is fatal when ALL_BUGS_ARE_FATAL, after the fixes in 33917. Also run "make autostyle" on these changes. Part of 33817.
2020-04-29relay/circuitbuild: Re-use IPv6 connections for circuitsteor
Search for existing connections using the remote IPv4 and IPv6 addresses. Part of 33817.
2020-04-29relay/circuitbuild: Consider IPv6-only extends validteor
Allow extend cells with IPv6-only link specifiers. Warn and fail if both IPv4 and IPv6 are invalid. Also warn if the IPv4 or IPv6 addresses are unexpectedly internal, but continue with the valid address. Part of 33817.
2020-04-29test/circuitbuild: Show bad addresses in some logsteor
Disable SafeLogging for some extend tests, so we can check the actual addresses. Part of 33817.
2020-04-29relay: Log the address in circuit protocol warningsteor
Always log the address family in extend protocol warnings. If SafeLogging is 0, also log the address and port. Diagnostics for 33817.
2020-04-29test/cell_formats: Expand the IPv6-only EXTEND2 testteor
Part of 33901.
2020-04-29core/or: Support IPv6 EXTEND2 cellsteor
Allow clients and relays to send dual-stack and IPv6-only EXTEND2 cells. Parse dual-stack and IPv6-only EXTEND2 cells on relays. Relays do not make connections or extend circuits via IPv6: that's the next step. Closes ticket 33901.
2020-04-29Run "make autostyle"teor