aboutsummaryrefslogtreecommitdiff
path: root/src/feature
AgeCommit message (Collapse)Author
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-30relay: Refactor extend address validity functionteor
Rename the function, and give it a boolean return value. No behaviour change. Part of 33817.
2020-04-30net: Make all address bytes functions take uint8_t *teor
Part of 33817.
2020-04-29relay: Refactor choosing extend IPsteor
Flatten the logic in circuit_choose_ip_ap_for_extend(). Part of 33817.
2020-04-29relay: Refactor circuit_open_connection_for_extend()teor
Refactor circuit_open_connection_for_extend(), splitting out the IP address choice code into a new function. Adds unit tests. No behaviour changes in tor. 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-29relay/circuitbuild: Refactor open connection for extendteor
Re-use the newly created extend_info to launch the connection in circuit_open_connection_for_extend(). No behaviour change. 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: Report IPv6 addresses in a debug logteor
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-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-29relay: Refactor address checks into a functionteor
No behaviour change. Part of 33817.
2020-04-29relay: Refactor address and port checksteor
tor_addr_port_is_valid_ap(ap, 0) checks if the address or port are zero, exactly like the previous code. Preparation for 33817.
2020-04-29Run "make autostyle"teor
2020-04-29nodelist: Remove an outdated commentteor
Part of 33817.
2020-04-14Merge remote-tracking branch 'tor-github/pr/1860/head'Nick Mathewson
2020-04-13Merge branch 'maint-0.4.3'Nick Mathewson
2020-04-13Merge branch 'bug33545_043_squashed' into maint-0.4.3Nick Mathewson
2020-04-13hs-v3: Change all-zeroes hard-assert to a BUG-and-err.George Kadianakis
And also disallow all-zeroes keys from the filesystem; add a test for it too.
2020-04-13hs-v3: Don't allow registration of an all-zeroes client auth key.George Kadianakis
The client auth protocol allows attacker-controlled x25519 private keys being passed around, which allows an attacker to potentially trigger the all-zeroes assert for client_auth_sk in hs_descriptor.c:decrypt_descriptor_cookie(). We fixed that by making sure that an all-zeroes client auth key will not be used. There are no guidelines for validating x25519 private keys, and the assert was there as a sanity check for code flow issues (we don't want to enter that function with an unitialized key if client auth is being used). To avoid such crashes in the future, we also changed the assert to a BUG-and-err.
2020-04-12Fix typo in router_build_fresh_unsigned_routerinfo() commentNeel Chauhan
2020-04-09Merge remote-tracking branch 'tor-github/pr/1801/head'Nick Mathewson
2020-04-09hs-v3: Several fixes after #32542 reviewDavid Goulet
asn: Accidentally left this commit out when merging #32542, so cherry-picking it now. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-09relay: Run "make autostyle"teor
But only take the changes from the relay module. Part of 33633.
2020-04-09relay/circuitbuild: Refactor circuit_extend()teor
Make the "else" case explicit at the end of the function. Part of 33633.
2020-04-09nodelist: Make some functions mockableteor
Part of 33633.
2020-04-09relay: End circuitbuild logs with "."teor
Consistent logs make testing easier. Part of 33633.
2020-04-09relay: Check for NULL arguments in circuitbuildteor
Part of 33633.
2020-04-09relay: Make circuitbuild functions STATICteor
Allow the circuitbuild_relay functions to be accessed by the unit tests. Part of 33633.
2020-04-09relay: Remove a redundant function return valueteor
Part of 33633.
2020-04-09relay: Split out opening a connection for an extendteor
Part of 33633.
2020-04-09relay: Refactor some long lines from circuit_extend()teor
Part of 33633.
2020-04-09relay: Split link specifier checks from circuit_extend()teor
Part of 33633.
2020-04-09relay: Split state checks out of circuit_extend()teor
Part of 33633.
2020-04-09relay: Improve the comments on onionskin_answer()teor
Part of 33633.
2020-04-09relay: Protocol warn when a client gets an extendteor
circuit_extend() may be called when a client receives an extend cell, even if the relay module is disabled. Log a protocol warning when the relay module is disabled. Part of 33633.
2020-04-08fix typos from #32542Roger Dingledine
2020-04-08Merge branch 'tor-github/pr/1857'George Kadianakis
2020-04-08hs-v3: Report SOCKS ExtendedErrors when all intro timed outDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-08hs-v3: Report rendezvous circuit failure SOCKS ExtendedErrorsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-08hs-v3: Report introduction failure SOCKS ExtendedErrorsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-07hs-v3: Fix typo in log info when PublishHidServDescriptors is set to 0David Goulet
Fixes #33779 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-07Merge branch 'pr1838_squashed'teor
2020-04-01hs-v3: Move to log notice the registration of an OB instanceDavid Goulet
This is to allow a visual feedback in the logs for operators setting up Onion Balance so they can confirm they properly configured the instances. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-01Merge branch 'tor-github/pr/1844'David Goulet
2020-03-30hs-v3: Move ob_subcreds to hs_service_state_t.George Kadianakis
It's more natural there since it's runtime state.
2020-03-30hs-v3: Don't crash after SIGHUP in Onionbalance backend mode.George Kadianakis
The ob_subcreds array was not copied after SIGHUP, and that left the post-SIGHUP service with a NULL ob_subcreds pointer (until the next descriptor gets build where we regenerate ob_subcreds in hs_ob_refresh_keys()). Fixes bug #33762; not in any released tor version.
2020-03-30Merge branch 'maint-0.4.3'David Goulet
2020-03-30hs-v3: Relax severity of a log message when decoding descriptors.George Kadianakis
Make it LOG_PROTOCOL_WARN and also add the expiration timestamp in there to ease debugging in the future.