summaryrefslogtreecommitdiff
path: root/src/feature/hs
AgeCommit message (Collapse)Author
2020-07-09hs-v3: Remove a possible BUG() conditionDavid Goulet
When receiving an introduction NACK, the client either decides to close or re-extend the circuit to another intro point. In order to do this, the service descriptor needs to exists but it is possible that it gets removed from the cache between the establishement of the introduction circuit and the reception of the (N)ACK. For that reason, the BUG(desc == NULL) is removed because it is a possible normal use case. Tor recovers gracefully already. Fixes #34087 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-09Refactor setup_intro_circ_auth_key() to make it simpler.George Kadianakis
It now uses the 'goto err' pattern, instead of the fatal_unreached() pattern. The latter pattern is usually used when there is a loop, but there is no loop in this function so it can be simplified easily.
2020-07-09Handle a failure edge-case when a client-side intro circ opens.George Kadianakis
2020-05-28Merge branch 'tor-github/pr/1901'David Goulet
2020-05-27Add HS v3 status to the SIGUSR1 dumpstats()Neel Chauhan
2020-05-21Fix an enum comparison that was blowing up jenkins.George Kadianakis
The warning was: 11:23:10 ../tor/src/feature/hs/hs_service.c: In function 'log_cant_upload_desc': 11:23:10 ../tor/src/feature/hs/hs_service.c:3118:3: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] See #34254 for more info. I guess this means that gcc assigned an unsigned type to the `log_desc_upload_reason_t` enum and it warned if we compared it against 0... For now I think it's simpler to remove that check instead of turning the enum to a signed type, or trying to hack it some other way. From what it seems, enum is up to the compiler on whether it's signed/unsigned: https://stackoverflow.com/questions/159034/are-c-enums-signed-or-unsigned
2020-05-06Merge branch 'maint-0.4.3'Nick Mathewson
2020-05-06hs_dos.c: rewrite a comment not to say "fallthrough"Nick Mathewson
There's nothing wrong with the comment, but the script I'm about to apply wouldn't like it.
2020-05-04Merge branch 'maint-0.4.3'Nick Mathewson
2020-04-30Fix a GCC 10.0.1 compilation error.Nick Mathewson
Do not try to stuff "HS_DESC_DECODE_GENERIC_ERROR" (-1) into a socks5_reply_status_t (enum). It doesn't actually make sense, and isn't one of our documented extensions. (This can only happen on a nonfatal assertion that we haven't seen, so it probably isn't happening in practice.) Fixes another case of bug 34077; bugfix on 0.4.3.1-alpha.
2020-04-29Run "make autostyle"teor
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-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-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-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.
2020-03-30Merge branch 'tor-github/pr/1775'David Goulet
2020-03-30Use a macro to make our hs_opts checking terser.Nick Mathewson
2020-03-30Use SECTION_HEADER, not "HiddenServiceDir".Nick Mathewson
Add a nonfatal assertion about a branch that should be unreachable.
2020-03-30Derive hidden service configuration from hs_opts_t.Nick Mathewson
This simplifies our parsing code by about 150 lines, and makes the functions more straightforward.
2020-03-30Start using confmgt logic to parse HS configuration.Nick Mathewson
This patch doesn't actually use the results of the parsed object to create the service configuration: subsequent patches will do that. This patch just introduces the necessary configuration tables and starts using them to validate the configuration. As of this writing, this patch breaks tests. I'll likely fix that in a rebase later on: the current error messages for failures to parse options are a regression, so I've opened #33640 for that.
2020-03-30Use config_lines_partition() to parse hs config sections.Nick Mathewson
2020-03-19Merge branch 'tor-github/pr/1792'George Kadianakis
2020-03-19hs-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-03-19fix typo in commentRoger Dingledine
2020-03-17Merge branch 'maint-0.4.3'Nick Mathewson
2020-03-17Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
2020-03-17Merge branch 'maint-0.4.1' into maint-0.4.2Nick Mathewson
2020-03-17Merge branch 'maint-0.3.5' into maint-0.4.1Nick Mathewson
2020-03-17Fix TROVE-2020-003.George Kadianakis
Given that ed25519 public key validity checks are usually not needed and (so far) they are only necessary for onion addesses in the Tor protocol, we decided to fix this specific bug instance without modifying the rest of the codebase (see below for other fix approaches). In our minimal fix we check that the pubkey in hs_service_add_ephemeral() is valid and error out otherwise.
2020-03-17Trivial bugfixes found during TROVE investigation.George Kadianakis
2020-03-11hs-v3: Log reasons why service can't upload descriptorDavid Goulet
When a service can not upload its descriptor(s), we have no logs on why. This adds logging for each possible reason for each descriptors. That logging is emitted every second so it is rate limited for each reason and per descriptor. Closes #33400 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-03-05Merge branch 'clang_format_prep_3'Nick Mathewson
2020-02-26Run "make autostyle"Nick Mathewson
2020-02-24Merge remote-tracking branch 'tor-github/pr/1685/head'Nick Mathewson
2020-02-24Final touches to #32709 based on Nick's feedback.George Kadianakis
- Fix a bug and add unittest. - Add changes file. - Add man page entry.
2020-02-18Fix issues pointed out by Nick.George Kadianakis
- Loose the asserts on num_pkeys. - Straighten some dangling &. - Fix some unpredictable memcpys.
2020-02-12Merge remote-tracking branch 'tor-github/pr/1725' into maint-0.4.3teor