aboutsummaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2015-08-17Fix a stupid memory leak I introduced in 8afbc154. Bug not in any released Tor.Nick Mathewson
2015-08-17Remove redundant tor_free() in command_process_create_cell().Isis Lovecruft
* FIXES #16823: https://bugs.torproject.org/16823 If an OP were to send a CREATE_FAST cell to an OR, and that CREATE_FAST cell had unparseable key material, then tor_free() would be called on the create cell twice. This fix removes the second (conditional on the key material being bad) call to tor_free(), so that now the create cell is always freed once, regardless of the status of the key material. (This isn't actually a double-free bug, since tor_free() sets its input to NULL, and has no effect when called with input NULL.)
2015-08-17Merge remote-tracking branch 'isis/fix/circuitlist-docstring-typo'Nick Mathewson
2015-08-14Merge remote-tracking branch 'public/decouple_init_keys'Nick Mathewson
2015-08-13Fix some types on container fnsNick Mathewson
2015-08-12Fix a memory leak when adding an ri with expired ed certsNick Mathewson
Fixes bug 16539; bugfix on 0.2.7.2-alpha.
2015-08-12Decouple the backend for directory_all_unreachable to simplify our CFGNick Mathewson
See ticket 16762.
2015-08-11Split the client-only parts of init_keys() into a separate functionNick Mathewson
This should simplify the callgraph a little more.
2015-08-11Merge branch 'bug16389_027_03_squashed'Nick Mathewson
2015-08-11Expire after 5 minutes rend cache failure entriesDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Add created timestamp to a rend cache failure entryDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Use an enum for INTRO_POINT_FAILURE_*David Goulet
Safer, wiser, stronger! Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Purge client HS failure cache on NEWNYMDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Add rend failure cacheDavid Goulet
When fetching a descriptor, we know test every introduction points in it against our rend failure cache to know if we keep it or not. For this to work, now everytime an introduction points is discareded (ex: receiving a NACK), we note it down in our introduction cache. See rendcache.c for a detailed explanation of the cache's behavior. Fixes #16389 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Make HSDir depend on Running/Valid again.Nick Mathewson
When we removed Running/Valid checks from Fast and Stable in 8712, I removed them from HSDir too, which apparently wasn't a good idea. Reverts part of a65e835800b1af2c2a4c215b. Fixes bug 16524. Bugfix on 0.2.7.2-alpha.
2015-08-10Remove a 9-function strongly connected component of tor's callgraph.Nick Mathewson
microdesc_free_() called get_microdesc_cache(), which had the fun side-effect of potentially reloading the whole cache from disk. Replace it with a variant that doesn't.
2015-08-06Merge remote-tracking branch 'public/decouple-write'Nick Mathewson
2015-08-06Merge remote-tracking branch 'public/bug16286'Nick Mathewson
2015-08-06Fix misnamed parameter in or_circuit_new docstring.Isis Lovecruft
* CHANGES `p_conn` to `p_chan` in `or_circuit_new()` docstring.
2015-07-31Move formatting functions around.Nick Mathewson
The base64 and base32 functions used to be in crypto.c; crypto_format.h had no header; some general-purpose functions were in crypto_curve25519.c. This patch makes a {crypto,util}_format.[ch], and puts more functions there. Small modules are beautiful!
2015-07-31Improve log messages for problems about ed25519 keypinningNick Mathewson
Fixes 16286; bugfix on 0.2.7.2-alpha.
2015-07-30Add get_max_sockets() and remove dead codeDavid Goulet
The control port was using set_max_file_descriptors() with a limit set to 0 to query the number of maximum socket Tor can use. With the recent changes to that function, a check was introduced to make sure a user can not set a value below the amount we reserved for non socket. This commit adds get_max_sockets() that returns the value of max_sockets so we can stop using that "setter" function to get the current value. Finally, the dead code is removed that is the code that checked for limit equal to 0. From now on, set_max_file_descriptors() should never be used with a limit set to 0 for a valid use case. Fixes #16697 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-30Do not autoflush control connections as their outbufs get bigNick Mathewson
Doing this is no longer necessary, and it leads to weird recursions in our call graph. Closes ticket 16480.
2015-07-30whitespace fixNick Mathewson
2015-07-30Wrap windows-only C files in #ifdef _WIN32Nick Mathewson
This should make some scripts and IDEs happier.
2015-07-21Remove casting of void pointers when handling signals.cypherpunks
2015-07-16Merge remote-tracking branch 'public/feature_16580'Nick Mathewson
2015-07-16Merge remote-tracking branch 'public/ticket16543'Nick Mathewson
2015-07-16Merge remote-tracking branch 'sysrqb/bug15220_026_sysrqb'Nick Mathewson
2015-07-16Break some wide linesNick Mathewson
2015-07-16Fix most check-spaces issuesNick Mathewson
2015-07-15Use C99 variadic macros when not on GCC.Nick Mathewson
1) We already require C99. 2) This allows us to support MSVC again (thanks to Gisle Vanem for this part) 3) This change allows us to dump some rotten old compatibility code from log.c
2015-07-15Merge branches 'feature_16582' and 'feature_16581'Nick Mathewson
2015-07-15Don't allow INIT_ED_KEY_{NO_REPAIR,NEEDCERT} to be used together.Nick Mathewson
We haven't implemented NO_REPAIR for NEEDCERT, and we don't need it: but it's safest to stop any attempt to use it that way.
2015-07-15Add more EINVAL errno setting on key read failuresNick Mathewson
Teor found these. This is for part of #16582.
2015-07-14Add changes file for 8712; apply it to HSDir flag as well.Nick Mathewson
2015-07-14Vote for relays to be fast and stable even when they aren't currently active.Peter Retzlaff
2015-07-14Change the name for the keypinning file; delete the old one if foundNick Mathewson
This is a brute-force fix for #16580, wherein #16530 caused some routers to do bad things with the old keypinning journal.
2015-07-14Add more consistency checks in load_ed_keysNick Mathewson
Make sure that signing certs are signed by the right identity key, to prevent a recurrence of #16530. Also make sure that the master identity key we find on disk matches the one we have in RAM, if we have one. This is for #16581.
2015-07-14Do more consistency checks in ed_key_init_from_file()Nick Mathewson
When there is a signing key and the certificate lists a key, make sure that the certificate lists the same signing key. When there are public key and secret key stored in separate files, make sure they match. Use the right file name when we load an encrypted secret key and then find a problem with it. This is part of 16581.
2015-07-14If loading an ed25519 master key fails with errno != ENOENT, give up.Nick Mathewson
This implements feature 16582: if we get EMFILE or something when loading our master key, we should not at that point attempt to overwrite it.
2015-07-14Preserve errno when loading encrypted ed25519 keys.Nick Mathewson
2015-07-14Remove empty rend_service_validate_intro_early functionJohn Brooks
2015-07-14Rename ambiguous introduction point functionsJohn Brooks
Task #15824
2015-07-10Remove the HidServDirV2 and VoteOnHidServDirectoriesV2 optionsNick Mathewson
(Mark them as obsolete) Closes 16543.
2015-07-09Merge branch 'bug4862_027_04_squashed'Nick Mathewson
2015-07-09Fix comments in rendservice.cDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-09Count intro circuit and not only established onesDavid Goulet
When cleaning up extra circuits that we've opened for performance reason, we need to count all the introduction circuit and not only the established ones else we can end up with too many introduction points. This also adds the check for expiring nodes when serving an INTRODUCE cell since it's possible old clients are still using them before we have time to close them. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-09Upload descriptor when all intro points are readyDavid Goulet
To upload a HS descriptor, this commits makes it that we wait for all introduction point to be fully established. Else, the HS ends up uploading a descriptor that may contain intro points that are not yet "valid" meaning not yet established or proven to work. It could also trigger three uploads for the *same* descriptor if every intro points takes more than 30 seconds to establish because of desc_is_dirty being set at each intro established. To achieve that, n_intro_points_established varialbe is added to the rend_service_t object that is incremented when we established introduction point and decremented when we remove a valid intro point from our list. The condition to upload a descriptor also changes to test if all intro points are ready by making sure we have equal or more wanted intro points that are ready. The desc_id_dirty flag is kept to be able to still use the RendInitialPostPeriod option. This partially fixes #13483. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-09Reuse intro points that failed but are still validDavid Goulet
There is a case where if the introduction circuit fails but the node is still in the consensus, we clean up the intro point and choose an other one. This commit fixes that by trying to reuse the existing intro point with a maximum value of retry. A retry_nodes list is added to rend_services_introduce() and when we remove an invalid intro points that fits the use case mentionned before, we add the node to the retry list instead of removing it. Then, we retry on them before creating new ones. This means that the requirement to remove an intro point changes from "if no intro circuit" to "if no intro circuit then if no node OR we've reached our maximum circuit creation count". For now, the maximum retries is set to 3 which it completely arbitrary. It should also at some point be tied to the work done on detecting if our network is down or not. Fixes #8239 Signed-off-by: David Goulet <dgoulet@ev0ke.net>