summaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2017-04-18Merge remote-tracking branches 'sebastian/consdiff_add' and ↵Nick Mathewson
'sebastian/consdiff_newline'
2017-04-17Fix diff generation with line added at startSebastian Hahn
The consdiff generation logic would skip over lines added at the start of the second file, and generate a diff that it would the immediately refuse because it couldn't be used to reproduce the second file from the first. Fixes #21996.
2017-04-17Don't accept ranges for add commands in consdiffSebastian Hahn
Fixes ticket #21963
2017-04-13Merge branch 'ticket21891_031_01_squashed'Nick Mathewson
2017-04-13hs: Make the service list pruning function publicDavid Goulet
The reason for making the temporary list public is to keep it encapsulated in the rendservice subsystem so the prop224 code does not have direct access to it and can only affect it through the rendservice pruning function. It also has been modified to not take list as arguments but rather use the global lists (main and temporary ones) because prop224 code will call it to actually prune the rendservice's lists. The function does the needed rotation of pointers between those lists and then prune if needed. In order to make the unit test work and not completely horrible, there is a "impl_" version of the function that doesn't free memory, it simply moves pointers around. It is directly used in the unit test and two setter functions for those lists' pointer have been added only for unit test. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-13Merge branch 'ticket21889_031_01_squashed'Nick Mathewson
2017-04-13hs: Add service-side circuitmap API.George Kadianakis
Now we have separate getters and setters for service-side and relay-side. I took this approach over adding arguments to the already existing methods to have more explicit type-checking, and also because some functions would grow too large and dirty. This commit also fixes every callsite to use the new function names which modifies the legacy HS (v2) and the prop224 (v3) code. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-13Merge remote-tracking branch 'dgoulet/bug21155_031_02'Nick Mathewson
2017-04-13Merge remote-tracking branch 'dgoulet/ticket21919_031_01'Nick Mathewson
2017-04-13Merge branch 'asn/prop224-ntor-v2-squashed'Nick Mathewson
2017-04-13prop224: Add module that performs the HS ntor handshake.George Kadianakis
and also does the key expansion.
2017-04-12hs: Make check-spaces happy after renameDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-11hs: Change trunnel prop224 cell's namespaceDavid Goulet
One of the goals of this change is to have trunnel API/ABI being more explicit so we namespace them with "trn_*". Furthermore, we can now create hs_cells.[ch] without having to confuse it with trunnel which used to be "hs_cell_*" before that change. Here are the perl line that were used for this rename: perl -i -pe 's/cell_extension/trn_cell_extension/g;' src/*/*.[ch] perl -i -pe 's/cell_extension/trn_cell_extension/g;' src/trunnel/hs/*.trunnel perl -i -pe 's/hs_cell_/trn_cell_/g;' src/*/*.[ch] perl -i -pe 's/hs_cell_/trn_cell_/g;' src/trunnel/hs/*.trunnel And then "./scripts/codegen/run_trunnel.sh" with trunnel commit id 613fb1b98e58504e2b84ef56b1602b6380629043. Fixes #21919 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-10config: Warn if EntryNodes and HiddenService are used togetherDavid Goulet
Pinning EntryNodes along with hidden services can be possibly harmful (for instance #14917 and #21155) so at the very least warn the operator if this is the case. Fixes #21155 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-10Merge remote-tracking branch 'dgoulet/bug16706_031_01'Nick Mathewson
2017-04-07Remove SR_COMMIT_LEN workaroundTaylor Yu
Now that base64_decode() checks the destination buffer length against the actual number of bytes as they're produced, shared_random.c no longer needs the "SR_COMMIT_LEN+2" workaround.
2017-04-07Merge remote-tracking branch 'dgoulet/ticket21893_031_01'Nick Mathewson
2017-04-07Merge branch 'isolate_openssl'Nick Mathewson
2017-04-07prop224: Flag router with HSIntro/HSDir using protoverDavid Goulet
Note down in the routerstatus_t of a node if the router supports the HSIntro=4 version for the ed25519 authentication key and HSDir=2 version for the v3 descriptor supports. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-07hs: Move common defines to hs_common.hDavid Goulet
Some of those defines will be used by the v3 HS protocol so move them to a common header out of rendservice.c. This is also ground work for prop224 service implementation. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-07hs: Remove redundant define of ed25519 auth key typeDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-07hs: Move service check private dir to hs_common.cDavid Goulet
Another building blocks for prop224 service work. This also makes the function takes specific argument instead of the or_option_t object. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-07hs: Refactor circuitmap to use circuit_t instead of or_circuit_t.George Kadianakis
2017-04-06Use macros for base64 lengths in shared_random.hTaylor Yu
Fixes #19564.
2017-04-06Tests for simple cases of conscache code.Nick Mathewson
2017-04-06Add a 'consensus cache' type on top of storagedir.Nick Mathewson
Every file in the cache is labeled. The labels are held in memory; the bodies are mapped on demand.
2017-04-05cell: Do not warn on hidden service invalid portDavid Goulet
When a client tried to connect to an invalid port of an hidden service, a warning was printed: [warn] connection_edge_process_relay_cell (at origin) failed. This is because the connection subsystem wants to close the circuit because the port can't be found and then returns a negative reason to achieve that. However, that specific situation triggered a warning. This commit prevents it for the specific case of an invalid hidden service port. Fixes #16706 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-04Move config_line_t functions from confparse.c into common.Nick Mathewson
I'm doing this to storagedir to used config_line_t.
2017-04-04Merge branch 'maint-0.3.0'Nick Mathewson
2017-04-04hs: Expose hs_service.c functions for unit testsDavid Goulet
In order to avoid src/or/hs_service.o to contain no symbols and thus making clang throw a warning, the functions are now exposed not just to unit tests. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-03Merge branch 'bug13790_rebased'Nick Mathewson
2017-04-03Refactor and comment new_route_len()Taylor Yu
Add a new helper function route_len_for_purpose(), which explicitly lists all of the known circuit purposes for a circuit with a chosen exit node (unlike previously, where the default route length for a chosen exit was DEFAULT_ROUTE_LEN + 1 except for two purposes). Add a non-fatal assertion for unhandled purposes that conservatively returns DEFAULT_ROUTE_LEN + 1. Add copious comments documenting which circuits need an extra hop and why. Thanks to nickm and dgoulet for providing background information.
2017-04-03Add tests for new_route_len()Taylor Yu
2017-04-03Merge remote-tracking branch 'teor/bug21596_030' into maint-0.3.0Nick Mathewson
2017-04-03Merge remote-tracking branch 'public/bug21415_testfix_030' into maint-0.3.0Nick Mathewson
2017-03-31Isolate dmalloc/openssl bridge code to crypto.cNick Mathewson
This makes it so main.c, and the rest of src/or, no longer need to include any openssl headers.
2017-03-29Fix another 32-bit warning in the spooling codeNick Mathewson
2017-03-28Fix i386 compilation from spooling patch. I seem to be good at breaking that.Nick Mathewson
2017-03-28Merge branch 'spooling_squashed'Nick Mathewson
2017-03-28Add nonfatal asserts for return val of dirserv_flushed_someNick Mathewson
2017-03-28Improve documentation for connection_dirserv_flushed_some.Nick Mathewson
2017-03-28Refactor the directory spool implementationNick Mathewson
The old implementation had duplicated code in a bunch of places, and it interspersed spool-management with resource management. The new implementation should make it easier to add new resource types and maintain the spooling code. Closing ticket 21651.
2017-03-27Merge remote-tracking branch 'origin/maint-0.3.0'Nick Mathewson
2017-03-27Fix max sampled size logic when in bridge mode.George Kadianakis
When calculating max sampled size, Tor would only count the number of bridges in torrc, without considering that our state file might already have sampled bridges in it. This caused problems when people swap bridges, since the following error would trigger: [warn] Not expanding the guard sample any further; just hit the maximum sample threshold of 1
2017-03-20Fix very small memory leak #21788Daniel Pinto
Leak caused by clean_up_backtrace_handler not being called on shutdown.
2017-03-17Merge branch 'ahf_bugs_21641_squashed'Nick Mathewson
2017-03-17Check onion key consensus parameters every hour.Alexander Færøy
This patch changes the way we decide when to check for whether it's time to rotate and/or expiry our onion keys. Due to proposal #274 we can now have the keys rotate at different frequencies than before and we thus do the check once an hour when our Tor daemon is running in server mode. This should allow us to quickly notice if the network consensus parameter have changed while we are running instead of having to wait until the current parameters timeout value have passed. See: See: https://bugs.torproject.org/21641
2017-03-17Add periodic timer for expiring old onion keys.Alexander Færøy
This patch adds a new timer that is executed when it is time to expire our current set of old onion keys. Because of proposal #274 this can no longer be assumed to be at the same time we rotate our onion keys since they will be updated less frequently. See: https://bugs.torproject.org/21641
2017-03-17Add API to query the current onion key grace period.Alexander Færøy
This patch adds an API to get the current grace period, in days, defined as the consensus parameter "onion-key-grace-period-days". As per proposal #274 the values for "onion-key-grace-period-days" is a default value of 7 days, a minimum value of 1 day, and a maximum value defined by other consensus parameter "onion-key-rotation-days" also defined in days. See: https://bugs.torproject.org/21641
2017-03-17Make MIN_ONION_KEY_LIFETIME a consensus parameter defined value.Alexander Færøy
This patch turns `MIN_ONION_KEY_LIFETIME` into a new function `get_onion_key_lifetime()` which gets its value from a network consensus parameter named "onion-key-rotation-days". This allows us to tune the value at a later point in time with no code modifications. We also bump the default onion key lifetime from 7 to 28 days as per proposal #274. See: https://bugs.torproject.org/21641