aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
AgeCommit message (Collapse)Author
2016-03-21Fix another case of 17668: Add NoEdConsensusNick Mathewson
I had a half-built mechanism to track, during the voting process, whether the Ed25519 value (or lack thereof) reflected a true consensus among the authorities. But we never actually inserted this field in the consensus. The key idea here is that we first attempt to match up votes by pairs of <Ed,RSA>, where <Ed> can be NULL if we're told that there is no Ed key. If this succeeds, then we can treat all those votes as 'a consensus for Ed'. And we can include all other votes with a matching RSA key and no statement about Ed keys as being "also about the same relay." After that, we look for RSA keys we haven't actually found an entry for yet, and see if there are enough votes for them, NOT considering Ed keys. If there are, we match them as before, but we treat them as "not a consensus about ed". When we include an entry in a consensus, if it does not reflect a consensus about ed keys, then we include a new NoEdConsensus flag on it. This is all only for consensus method 22 or later. Also see corresponding dir-spec patch.
2016-03-21Document has_ed25519_listingNick Mathewson
2016-03-21Never vote for an ed key twice.Nick Mathewson
When generating a vote, and we have two routerinfos with the same ed key, omit the one published earlier. This was supposed to have been solved by key pinning, but when I made key pinning optional, I didn't realize that this would jump up and bite us. It is part of bug 18318, and the root cause of 17668.
2015-09-23Allow conflicts to occur in keypinning journalNick Mathewson
When we find a conflict in the keypinning journal, treat the new entry as superseding all old entries that overlap either of its keys. Also add a (not-yet-used) configuration option to disable keypinning enforcement.
2015-09-22Merge branch 'feature16769_squashed'Nick Mathewson
2015-09-22Add a --master-key optionNick Mathewson
This lets the user override the default location for the master key when used with --keygen Part of 16769.
2015-09-22Add a new --newpass option to add or remove secret key passphrases.Nick Mathewson
2015-09-22Merge branch 'feature16944_v2'Nick Mathewson
2015-09-08Add `KeepAliveIsolateSOCKSAuth` as a SOCKSPort option.Yawning Angel
This controls the circuit dirtyness reset behavior added for Tor Browser's user experience fix (#15482). Unlike previous iterations of this patch, the tunable actually works, and is documented.
2015-09-04Add "OfflineMasterKey" optionNick Mathewson
When this is set, and Tor is running as a relay, it will not generate or load its secret identity key. You can manage the secret identity key with --keygen. Implements ticket 16944.
2015-08-19Merge branch 'ed25519_keygen_squashed'Nick Mathewson
2015-08-19Checkpoint work on ed25519 keygen improvements.Nick Mathewson
Needs changes file, documentation, test integration, more tests.
2015-08-18New TestingDirAuthVote{Exit,Guard,HSDir}IsStrict flagsteor
"option to prevent guard,exit,hsdir flag assignment" "A node will never receive the corresponding flag unless that node is specified in the TestingDirAuthVote{Exit,Guard,HSDir} list, regardless of its uptime, bandwidth, exit policy, or DirPort". Patch modified by "teor": VoteOnHidServDirectoriesV2 is now obsolete, so TestingDirAuthVoteHSDir always votes on HSDirs. Closes ticket 14882. Patch by "robgjansen". Commit message and changes file by "teor" with quotes from "robgjansen".
2015-08-18Fix TestingDirAuthVoteHSDir docs: HSDir flag needs DirPortteor
Fix an error in the manual page and comments for TestingDirAuthVoteHSDir, which suggested that a HSDir required "ORPort connectivity". While this is true, it is in no way unique to the HSDir flag. Of all the flags, only HSDirs need a DirPort configured in order for the authorities to assign that particular flag. Fixed as part of 14882. Patch by "teor". Bugfix on 0.2.6.3 (f9d57473e1ff on 10 January 2015).
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-16Merge remote-tracking branch 'public/ticket16543'Nick Mathewson
2015-07-16Merge remote-tracking branch 'sysrqb/bug15220_026_sysrqb'Nick Mathewson
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-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>
2015-07-09Refactor rend_services_introduce()David Goulet
The reasoning for refactoring this function is that removing the introduction point adaptative algorithm (#4862) ended up changing quite a bit rend_services_introduce(). Also, to fix some open issues (#8239, #8864 and #13483), this work had to be done. First, this removes time_expiring variable in an intro point object and INTRO_POINT_EXPIRATION_GRACE_PERIOD trickery and use an expiring_nodes list where intro nodes that should expire are moved to that list and cleaned up only once the new descriptor is successfully uploaded. The previous scheme was adding complexity and arbitrary timing to when we expire an intro point. We keep the intro points until we are sure that the new descriptor is uploaded and thus ready to be used by clients. For this, rend_service_desc_has_uploaded() is added to notify the HS subsystem that the descriptor has been successfully uploaded. The purpose of this function is to cleanup the expiring nodes and circuits if any. Secondly, this adds the remove_invalid_intro_points() function in order to split up rend_services_introduce() a bit with an extra modification to it that fixes #8864. We do NOT close the circuit nor delete the intro point if the circuit is still alive but the node was removed from the consensus. Due to possible information leak, we let the circuit and intro point object expire instead. Finally, the whole code flow is simplified and large amount of documentation has been added to mostly explain the why of things in there. Fixes #8864 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-06-29More tweaks for windows compilation. (ick)Nick Mathewson
2015-06-29Remove checks for visual C 6.Nick Mathewson
2015-06-18Add rendcache.{c|h}David Goulet
For now, rend_cache_entry_t has been moved from or.h to rendcache.h and those files have been added to the build system. In the next commit, these will contain hidden service descriptor cache ABI and API for both client and directory side. The goal is to consolidate the descriptor caches in one location to ease development, maintenance, review and improve documentation for each cache behavior and algorithm. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-06-17Merge branch '13642_offline_master_v2_squashed'Nick Mathewson
2015-06-17Support encrypted offline master keys with a new --keygen flagNick Mathewson
When --keygen is provided, we prompt for a passphrase when we make a new master key; if it is nonempty, we store the secret key in a new crypto_pwbox. Also, if --keygen is provided and there *is* an encrypted master key, we load it and prompt for a passphrase unconditionally. We make a new signing key unconditionally when --keygen is provided. We never overwrite a master key.
2015-06-01Appease make check-spacesAndrea Shepard
2015-05-28Merge branch '12498_ed25519_keys_v6'Nick Mathewson
Fixed numerous conflicts, and ported code to use new base64 api.
2015-05-28Generate weird certificates correctlyNick Mathewson
(Our link protocol assumes that the link cert certifies the TLS key, and there is an RSA->Ed25519 crosscert)
2015-05-28# This is a combination of 2 commits.Nick Mathewson
# The first commit's message is: Regenerate ed25519 keys when they will expire soon. Also, have testing-level options to set the lifetimes and expiration-tolerances of all key types, plus a non-testing-level option to set the lifetime of any auto-generated signing key. # The 2nd commit message will be skipped: # fixup! Regenerate ed25519 keys when they will expire soon.
2015-05-28Implement ed25519 identity collation for voting.Nick Mathewson
This is a new collator type that follows proposal 220 for deciding which identities to include. The rule is (approximately): If a <ed,rsa> identity is listed by more than half of authorities, include it. And include all <rsa> votes about that node as matching. Otherwise, if an <*,rsa> or <rsa> identity is listed by more than half of the authorities, and no <ed,rsa> has been listed, include it.
2015-05-28Checkpoint some work on voting on ed25519 identitiesNick Mathewson
* Include ed25519 identities in votes * Include "no ed25519 identity" in votes * Include some commented-out code about identity voting. (This will disappear.) * Include some functions for identity voting (These will disappear.) * Enforce uniqueness in ed25519 keys within a vote
2015-05-28Sign extrainfo documents with ed25519Nick Mathewson
Extrainfo documents are now ed-signed just as are router descriptors, according to proposal 220. This patch also includes some more tests for successful/failing parsing, and fixes a crash bug in ed25519 descriptor parsing.
2015-05-28Include ed25519 keys in microdescriptors.Nick Mathewson
2015-05-28Implement proposal 228: cross-certification with onion keysNick Mathewson
Routers now use TAP and ntor onion keys to sign their identity keys, and put these signatures in their descriptors. That allows other parties to be confident that the onion keys are indeed controlled by the router that generated the descriptor.
2015-05-28Implement ed25519-signed descriptorsNick Mathewson
Now that we have ed25519 keys, we can sign descriptors with them and check those signatures as documented in proposal 220.
2015-05-28prop220: Implement certificates and key storage/creationNick Mathewson
For prop220, we have a new ed25519 certificate type. This patch implements the code to create, parse, and validate those, along with code for routers to maintain their own sets of certificates and keys. (Some parts of master identity key encryption are done, but the implementation of that isn't finished)
2015-05-20Add "HiddenServiceMaxStreams" as a per-HS tunable.Yawning Angel
When set, this limits the maximum number of simultaneous streams per rendezvous circuit on the server side of a HS, with further RELAY_BEGIN cells being silently ignored. This can be modified via "HiddenServiceMaxStreamsCloseCircuit", which if set will cause offending rendezvous circuits to be torn down instead. Addresses part of #16052.
2015-05-14Add missing descriptor ID to HS_DESC control eventDavid Goulet
For FAILED and RECEIVED action of the HS_DESC event, we now sends back the descriptor ID at the end like specified in the control-spec section 4.1.25. Fixes #15881 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-30Add a create function for rend_data_t objectDavid Goulet
Ground works for fixing #15816. This adds the rend_data_create() function in order to have a single place where we initialize that data structure. Furthermore, an array of descriptor IDs is added (one per replica) so we can keep a copy of the current id in the object. It will be used to purge the last hid serv request cache using those descriptor IDs. When they change, they will be replaced and the old ones will be purged from the cache. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-28Add "ADD_ONION"/"DEL_ONION" and "GETINFO onions/*" to the controller.Yawning Angel
These commands allow for the creation and management of ephemeral Onion ("Hidden") services that are either bound to the lifetime of the originating control connection, or optionally the lifetime of the tor instance. Implements #6411.
2015-04-23Merge remote-tracking branch 'dgoulet/bug14847_027_06'Nick Mathewson
2015-04-23Fix another signed/unsigned comparison bugNick Mathewson
2015-04-21Refactor HS descriptor fetch to support descriptor IDDavid Goulet
Big refactor of the HS client descriptor fetch functionnality. This allows to fetch an HS descriptor using only a descriptor ID. Furthermore, it's also possible to provide a list of HSDir(s) now that are used instead of the automatically choosen one. The approach taken was to add a descriptor_id field to the rend_data_t structure so it can be used, if available, by the HS client. The onion address field however has priority over it that is if both are set, the onion address is used to fetch the descriptor. A new public function is introduced called rend_client_fetch_v2_desc(...) that does NOT lookup the client cache before fetching and can take a list of HSDirs as a parameter. The HSFETCH control command now uses this new function thus making it work and final. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-20Use a random count of INTRODUCE2 for IP rotationDavid Goulet
An introduction point is currently rotated when the amount of INTRODUCE2 cells reached a fixed value of 16384. This makes it pretty easy for an attacker to inflate that number and observe when the IP rotates which leaks the popularity of the HS (amount of client that passed through the IP). This commit makes it a random count between the current value of 16384 and two times that. Fixes #15745 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-01Merge remote-tracking branch 'public/remove_old_version_checks'Nick Mathewson
2015-04-01Merge branch 'bug13736'Nick Mathewson
2015-04-01Merge remote-tracking branch 'public/bug15515_025'Nick Mathewson
2015-04-01Block multiple introductions on the same intro circuit.George Kadianakis