aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_descriptor.c
AgeCommit message (Collapse)Author
2021-06-10Merge branch 'maint-0.4.5' into maint-0.4.6Nick Mathewson
2021-06-10Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-06-10Merge branch 'maint-0.3.5' into maint-0.4.4Nick Mathewson
2021-06-10Fix TROVE-2021-006: Out-of-bounds read on v3 desc parsingGeorge Kadianakis
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2021-02-19hs-v2: Removal of service and relay supportDavid Goulet
This is unfortunately massive but both functionalities were extremely intertwined and it would have required us to actually change the HSv2 code in order to be able to split this into multiple commits. After this commit, there are still artefacts of v2 in the code but there is no more support for service, intro point and HSDir. The v2 support for rendezvous circuit is still available since that code is the same for the v3 and we will leave it in so if a client is able to rendezvous on v2 then it can still transfer traffic. Once the entire network has moved away from v2, we can remove v2 rendezvous point support. Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-06-06Make curve25519_public_to_base64 output padding optional #7869Daniel Pinto
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-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-01-21Remove a dead BUG() check.Nick Mathewson
2020-01-21Turn hs_subcredential_t into a proper struct.Nick Mathewson
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-11-18hs-v3: Keep descriptor in cache if client auth is missing or badDavid Goulet
We now keep the descriptor in the cache, obviously not decoded, if it can't be decrypted for which we believe client authorization is missing or unusable (bad). This way, it can be used later once the client authorization are added or updated. Part of #30382 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-17hs-v3: Add a series of decoding error codeDavid Goulet
This commit introduces the hs_desc_decode_status_t enum which aims at having more fine grained error code when decoding a descriptor. This will be useful in later commits when we support keeping a descriptor that can't be decrypted due to missing or bad client authorization creds. No behavior change. Part of #30382. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-16hs_descriptor.[ch]: repair doxygen comments.Nick Mathewson
These are yet more that were not made with "/**"
2019-09-23fix: Ticket #31589AmreshVenugopal
- The function `decrypt_desc_layer` has a cleaner interface. - `is_superencrypted_layer` changed from `int` -> `bool` [ticket details](https://trac.torproject.org/projects/tor/ticket/31589) add(changes/*): changes file fix(src/features/hs): is_superencrypted changed from `int` -> `bool` fix(changes/ticket31589): header add(changes/ticket31589): subsystem(onion services) to change
2019-06-05Add missing newline after decode_intro_points() closing bracketNeel Chauhan
2019-04-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-05crypto_format: Remove the return value from ed25519_signature_to_base64()teor
Also remove all checks for the return value, which were redundant anyway, because the function never failed. Part of 29660.
2019-04-05crypto_format: Remove the return value from curve25519_public_to_base64()teor
And fix the documentation on the function: it does produce trailing "="s as padding. Also remove all checks for the return value, which were redundant anyway, because the function never failed. Part of 29660.
2019-03-12hs: abolish hs_desc_link_specifier_tteor
The previous commits for 23576 confused hs_desc_link_specifier_t and link_specifier_t. Removing hs_desc_link_specifier_t fixes this confusion. Fixes bug 22781; bugfix on 0.3.2.1-alpha.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-10-26HSv3: Correctly memwipe client auth keystream.George Kadianakis
Wipe the whole thing, not just the size of the pointer.
2018-10-18Merge branch 'ticket27549_035_01_squashed'Nick Mathewson
2018-10-18hs-v3: Consolidate descriptor cookie computation codeDavid Goulet
Both client and service had their own code for this. Consolidate into one place so we avoid duplication. Closes #27549 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-10-01Move routerparse and parsecommon to their own module.Nick Mathewson
2018-09-21fixup! hs-v3: Silence some logging for client authorizationDavid Goulet
2018-09-10hs-v3: Silence some logging for client authorizationDavid Goulet
If a tor client gets a descriptor that it can't decrypt, chances are that the onion requires client authorization. If a tor client is configured with client authorization for an onion but decryption fails, it means that the configured keys aren't working anymore. In both cases, we'll log notice the former and log warn the latter and the rest of the decryption errors are now at info level. Two logs statement have been removed because it was redundant and printing the fetched descriptor in the logs when 80% of it is encrypted wat not helping. Fixes #27550 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07HSv3: Add subcredential in client auth KDF on the client-side.George Kadianakis
2018-09-07HSv3: Add subcredential in client auth KDF on the service-side.George Kadianakis
Also update some client auth test vectors that broke...
2018-09-07hs-v3: Make hs_desc_build_fake_authorized_client() return an objectDavid Goulet
Return a newly allocated fake client authorization object instead of taking the object as a parameter. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Rename client_pk to client_auth_pkSuphanat Chunhapanya
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Rename client_sk to client_auth_skSuphanat Chunhapanya
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Make all descriptor content free functions publicSuphanat Chunhapanya
Series of functions that we now need in hs_service.c. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Re-enable the decoding in the encoding functionSuphanat Chunhapanya
Previously, the validation by decoding a created descriptor was disabled because the interface had to be entirely changed and not implemented at the time. This commit re-enabled it because it is now implemented. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Decrypt the descriptor with client private keySuphanat Chunhapanya
Parse the client authorization section from the descriptor, use the client private key to decrypt the auth clients, and then use the descriptor cookie to decrypt the descriptor. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Refactor the descriptor decryption/decodingSuphanat Chunhapanya
This commit refactors the existing decryption code to make it compatible with a new logic for when the client authorization is enabled. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Refactor secret data building logicSuphanat Chunhapanya
Because this secret data building logic is not only used by the descriptor encoding process but also by the descriptor decoding, refactor the function to take both steps into account. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Encrypt the descriptor using a cookieSuphanat Chunhapanya
Previously, we encrypted the descriptor without the descriptor cookie. This commit, when the client auth is enabled, the descriptor cookie is always used. I also removed the code that is used to generate fake auth clients because it will not be used anymore. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Generate all descriptor related keysSuphanat Chunhapanya
We need to generate all the related keys when building the descriptor, so that we can encrypt the descriptor. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-05Move literally everything out of src/orNick Mathewson
This commit won't build yet -- it just puts everything in a slightly more logical place. The reasoning here is that "src/core" will hold the stuff that every (or nearly every) tor instance will need in order to do onion routing. Other features (including some necessary ones) will live in "src/feature". The "src/app" directory will hold the stuff needed to have Tor be an application you can actually run. This commit DOES NOT refactor the former contents of src/or into a logical set of acyclic libraries, or change any code at all. That will have to come in the future. We will continue to move things around and split them in the future, but I hope this lays a reasonable groundwork for doing so.