summaryrefslogtreecommitdiff
path: root/src/feature/hs
AgeCommit message (Collapse)Author
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-24Merge branch 'ticket26744'Nick Mathewson
2018-09-21Merge remote-tracking branch 'dgoulet/ticket27774_035_03'Nick Mathewson
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-21hs-v3: Don't BUG() if the RP node_t is invalid client sideDavid Goulet
When sending the INTRODUCE1 cell, we acquire the needed data for the cell but if the RP node_t has invalid data, we'll fail the send and completely kill the SOCKS connection. Instead, close the rendezvous circuit and return a transient error meaning that Tor can recover by selecting a new rendezvous point. We'll also do the same when we are unable to encode the INTRODUCE1 cell for which at that point, we'll simply take another shot at a new rendezvous point. Fixes #27774 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-20Merge remote-tracking branch 'dgoulet/ticket27410_035_01'Nick Mathewson
2018-09-20Merge remote-tracking branch 'dgoulet/ticket27410_032_01'Nick Mathewson
2018-09-20Support 'none' in torrc for HiddenServiceExportCircuitID.Alexander Færøy
See: https://bugs.torproject.org/4700
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-19test: hs-v3 desc has arrived unit testDavid Goulet
That unit test makes sure we don't have pending SOCK request if the descriptor turns out to be unusable. Part of #27410. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-19hs-v3: Close all SOCKS request on descriptor failureDavid Goulet
Client side, when a descriptor is finally fetched and stored in the cache, we then go over all pending SOCKS request for that descriptor. If it turns out that the intro points are unusable, we close the first SOCKS request but not the others for the same .onion. This commit makes it that we'll close all SOCKS requests so we don't let hanging the other ones. It also fixes another bug which is having a SOCKS connection in RENDDESC_WAIT state but with a descriptor in the cache. At some point, tor will expire the intro failure cache which will make that descriptor usable again. When retrying all SOCKS connection (retry_all_socks_conn_waiting_for_desc()), we won't end up in the code path where we have already the descriptor for a pending request causing a BUG(). Bottom line is that we should never have pending requests (waiting for a descriptor) with that descriptor in the cache (even if unusable). Fixees #27410. Signed-off-by: David Goulet <dgoulet@torproject.org>
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-15Save original virtual port in edge conn HS ident.George Kadianakis
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: Don't assert when reading bad client-side privkeys.George Kadianakis
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: 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 client sideSuphanat Chunhapanya
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-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-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: 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-07test: HS v3 client authorization loading secret keySuphanat Chunhapanya
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-09-07hs-v3: Load client authorization secret key from fileSuphanat Chunhapanya
The new ClientOnionAuthDir option is introduced which is where tor looks to find the HS v3 client authorization files containing the client private key material. 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: Change default version from 2 to 3David Goulet
Closes #27215 Signed-off-by: David Goulet <dgoulet@torproject.org>
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-30fix wrong word in commentRoger Dingledine
2018-07-25Merge branch 'bug26627_033' into bug26627_033_merged_masterteor
2018-07-20Tweak assertion in get_time_period_length() for coverityNick Mathewson
This is another attempt to fix 1437668. The assertion here should be safe, since the rules of networkstatus_get_param() keep the value it returns in range.