aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_service.c
AgeCommit message (Collapse)Author
2019-01-31hs: Onion services put IPv6 addresses in service descriptorsteor
Rewrite service_intro_point_new() to take a node_t. Since node_get_link_specifier_smartlist() supports IPv6 link specifiers, this refactor adds IPv6 addresses to onion service descriptors. Part of 23576, implements 26992.
2019-01-17Fix users of base32_decode to check for expected length in return.Nick Mathewson
Also, when we log about a failure from base32_decode(), we now say that the length is wrong or that the characters were invalid: previously we would just say that there were invalid characters. Follow-up on 28913 work.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-12-05Merge branch 'maint-0.3.5'Nick Mathewson
2018-12-05Merge remote-tracking branch 'tor-github/pr/546' into maint-0.3.5Nick Mathewson
2018-11-26Test for check_network_participation_callback()Nick Mathewson
2018-11-01Improve log message in hs_service.cFernando Fernandez Mancera
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-10-30Merge branch 'tor-github/pr/438' into maint-0.3.5David Goulet
2018-10-23Func rename: Make it clear that update_all_descriptors() does intro points.George Kadianakis
With the new refresh_service_descriptor() function we had both refresh_service_descriptor() and update_service_descriptor() which is basically the same thing. This commit renames update_service_descriptor() to update_service_descriptor_intro_points() to make it clear it's not a generic refresh and it's only about intro points. Commit changes no code.
2018-10-22hs-v3: Create desc signing key cert before uploadingDavid Goulet
Before this commit, we would create the descriptor signing key certificate when first building the descriptor. In some extreme cases, it lead to the expiry of the certificate which triggers a BUG() when encoding the descriptor before uploading. Ticket #27838 details a possible scenario in which this can happen. It is an edge case where tor losts internet connectivity, notices it and closes all circuits. When it came back up, the HS subsystem noticed that it had no introduction circuits, created them and tried to upload the descriptor. However, in the meantime, if tor did lack a live consensus because it is currently seeking to download one, we would consider that we don't need to rotate the descriptors leading to using the expired signing key certificate. That being said, this commit does a bit more to make this process cleaner. There are a series of things that we need to "refresh" before uploading a descriptor: signing key cert, intro points and revision counter. A refresh function is added to deal with all mutable descriptor fields. It in turn simplified a bit the code surrounding the creation of the plaintext data. We keep creating the cert when building the descriptor in order to accomodate the unit tests. However, it is replaced every single time the descriptor is uploaded. Fixes #27838 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-10-18hs-v3: Always generate the descriptor cookieDavid Goulet
It won't be used if there are no authorized client configured. We do that so we can easily support the addition of a client with a HUP signal which allow us to avoid more complex code path to generate that cookie if we have at least one client auth and we had none before. Fixes #27995 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-25Revise things that had included router.h beforeNick Mathewson
Make them only include the headers that they needed, and sort their headers while we're at it.
2018-09-25Move key-loading and crosscert-checking out of feature/relayNick Mathewson
This is also used by onion services, so it needs to go in another module.
2018-09-21Split directory.c code into several modulesNick Mathewson
Parts of this C file naturally belong in dircache, dirclient, and dircommon: so, move them there.
2018-09-21Merge remote-tracking branch 'ahf-github/asn/bugs4700_2'Nick Mathewson
2018-09-21Split main.c into main.c and mainloop.cNick Mathewson
The main.c code is responsible for initialization and shutdown; the mainloop.c code is responsible for running the main loop of Tor. Splitting the "generic event loop" part of mainloop.c from the event-loop-specific part is not done as part of this patch.
2018-09-19Split routerlist.c into 4 separate modulesNick Mathewson
There are now separate modules for: * the list of router descriptors * the list of authorities and fallbacks * managing authority certificates * selecting random nodes
2018-09-15Change HiddenServiceExportCircuitID to take a string parameter: the protocol.Alexander Færøy
This patch changes HiddenServiceExportCircuitID so instead of being a boolean it takes a string, which is the protocol. Currently only the 'haproxy' protocol is defined. See: https://bugs.torproject.org/4700
2018-09-15Introduce per-service HiddenServiceExportCircuitID torrc option.George Kadianakis
Moves code to a function, better viewed with --color-moved.
2018-09-14Merge branch 'maint-0.3.4'Nick Mathewson
2018-09-12Merge remote-tracking branch 'dgoulet/ticket27545_035_01'Nick Mathewson
2018-09-11hs-v3: Shuffle the list of authorized clientsSuphanat Chunhapanya
This commit makes it that the authorized clients in the descriptor are in random order instead of ordered by how they were read on disk. Fixes #27545 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-10Address coverity warnings (CID 1439133/1439132).George Kadianakis
>>>> CID 1439133: Null pointer dereferences (REVERSE_INULL) >>>> Null-checking "fields" suggests that it may be null, but it >>>> has already been dereferenced on all paths leading to the check. >>>> CID 1439132: Null pointer dereferences (REVERSE_INULL) >>>> Null-checking "fields" suggests that it may be null, but it >>>> has already been dereferenced on all paths leading to the check.
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: Improve v3 client authorization loggingDavid Goulet
Part of #20700. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Log client auth load activities service sideSuphanat Chunhapanya
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07test: HS v3 client auth is config equal functionSuphanat Chunhapanya
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Republish descriptors if client auth changesSuphanat Chunhapanya
When reloading tor, check if our the configured client authorization have changed from what we previously had. If so, republish the updated descriptor. 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-09-07test: HS v3 loading client auth keys service sideSuphanat Chunhapanya
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Load all client auth keys to the serviceSuphanat Chunhapanya
This commit loads all client public keys from every file in `authorized_clients/` directory. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-28fixup! hs: Learn service version by trying to load the keysDavid Goulet
2018-08-22hs: Learn service version by trying to load the keysDavid Goulet
In order to switch the default HS version from 2 to 3, we need tor to be smart and be able to decide on the version by trying to load the service keys during configuration validation. Part of #27215 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-22key: Make ed_key_init_from_file() take an or_options_tDavid Goulet
Part of #27215, we need to call the ed_key_init_from_file function during option_validate() which is before the global_options variable is set. This commit make ed_key_init_from_file() stop using get_options() and instead now has a or_options_t parameter. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-16Merge branch 'maint-0.3.4'Nick Mathewson
2018-07-25Merge branch 'bug26627_033' into bug26627_033_merged_masterteor
2018-07-17Merge branch 'bug25552_ope_squashed'Nick Mathewson
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.