summaryrefslogtreecommitdiff
path: root/src/or/router.c
AgeCommit message (Collapse)Author
2016-01-18Merge remote-tracking branch 'teor/bug18050' into maint-0.2.7Nick Mathewson
2016-01-18Check ORPort and DirPort reachability before publishing a relay descriptorteor (Tim Wilson-Brown)
Otherwise, relays publish a descriptor with DirPort 0 when the DirPort reachability test takes longer than the ORPort reachability test. Closes bug #18050. Reported by "starlight", patch by "teor". Bugfix on 0.1.0.1-rc, commit a1f1fa6ab on 27 Feb 2005.
2015-09-16ExitPolicyRejectPrivate rejects local IPv6 address and interface addressesteor (Tim Wilson-Brown)
ExitPolicyRejectPrivate now rejects more local addresses by default: * the relay's published IPv6 address (if any), and * any publicly routable IPv4 or IPv6 addresses on any local interfaces. This resolves a security issue for IPv6 Exits and multihomed Exits that trust connections originating from localhost. Resolves ticket 17027. Patch by "teor". Patch on 42b8fb5a1523 (11 Nov 2007), released in 0.2.0.11-alpha.
2015-08-11Split the client-only parts of init_keys() into a separate functionNick Mathewson
This should simplify the callgraph a little more.
2015-07-10Remove the HidServDirV2 and VoteOnHidServDirectoriesV2 optionsNick Mathewson
(Mark them as obsolete) Closes 16543.
2015-06-01Add a master-key-ed25519 line for convenienceNick Mathewson
2015-05-28Fix memory leak on failure to generate EI. CID 1301370.Nick Mathewson
2015-05-28Merge branch '12498_ed25519_keys_v6'Nick Mathewson
Fixed numerous conflicts, and ported code to use new base64 api.
2015-05-28Do not allocate our ed-link crosscert till after tls ctxNick Mathewson
We need this to prevent some annoying chutney crash-at-starts
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-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-28Tie key-pinning logic into directory authority operationNick Mathewson
With this patch: * Authorities load the key-pinning log at startup. * Authorities open a key-pinning log for writing at startup. * Authorities reject any router with an ed25519 key where they have previously seen that ed25519 key with a different RSA key, or vice versa. * Authorities warn about, but *do not* reject, RSA-only descriptors when the RSA key has previously gone along with an Ed25519 key. (We should make this a 'reject' too, but we can't do that until we're sure there's no legit reason to downgrade to 0.2.5.)
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 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-04-23Merge remote-tracking branch 'public/bug15745_027_03'Nick Mathewson
2015-04-23Merge branch 'feature15652_squashed'Nick Mathewson
2015-04-23Use a custom Base64 encoder with more control over the output format.Yawning Angel
2015-04-21Add crypto_rand_int_range() and use itDavid Goulet
Incidently, this fixes a bug where the maximum value was never used when only using crypto_rand_int(). For instance this example below in rendservice.c never gets to INTRO_POINT_LIFETIME_MAX_SECONDS. int intro_point_lifetime_seconds = INTRO_POINT_LIFETIME_MIN_SECONDS + crypto_rand_int(INTRO_POINT_LIFETIME_MAX_SECONDS - INTRO_POINT_LIFETIME_MIN_SECONDS); Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-02-15Refactor router_rebuild_descriptorSebastian Hahn
Allow building a router descriptor without storing it to global state. This is in preparation of a patch to export the created descriptors via the control port.
2015-01-16Merge branch 'bug8546_squashed'Nick Mathewson
Conflicts: src/or/connection.c src/or/or.h src/or/relay.c
2015-01-16Split client-specific and server-specific parts of port_cfg_tNick Mathewson
Also, apply this cocci script to transform accesses. (Plus manual migration for accesses inside smartlist_foreach loops.) @@ port_cfg_t *cfgx; @@ cfgx-> +server_cfg. \( no_advertise \| no_listen \| all_addrs \| bind_ipv4_only \| bind_ipv6_only \) @@ port_cfg_t *cfgx; @@ cfgx-> +entry_cfg. \( isolation_flags \| session_group \| socks_prefer_no_auth \| ipv4_traffic \| ipv6_traffic \| prefer_ipv6 \| cache_ipv4_answers \| cache_ipv6_answers \| use_cached_ipv4_answers \| use_cached_ipv6_answers \| prefer_ipv6_virtaddr \)
2015-01-10Merge branch 'master' of https://git.torproject.org/tor into ↵teor
bug13111-empty-key-files-fn-empty Conflicts: src/or/connection_edge.c Merged in favour of origin.
2015-01-10Merge branch 'bug14001-clang-warning' into bug13111-empty-key-files-fn-emptyteor
Conflicts: src/or/router.c Choose newer comment. Merge changes to comment and function invocation.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-23Merge remote-tracking branch 'teor/bug13718-consensus-interval'Nick Mathewson
2014-12-24Allow consensus interval of 10 seconds when testingteor
Decrease minimum consensus interval to 10 seconds when TestingTorNetwork is set. (Or 5 seconds for the first consensus.) Fix code that assumes larger interval values. This assists in quickly bootstrapping a testing Tor network. Fixes bugs 13718 & 13823.
2014-12-19Merge branch 'asn-karsten-task-13192-5-squashed'Nick Mathewson
2014-12-19Add two hidden-service related statistics.George Kadianakis
The two statistics are: 1. number of RELAY cells observed on successfully established rendezvous circuits; and 2. number of .onion addresses observed as hidden-service directory. Both statistics are accumulated over 24 hours, obfuscated by rounding up to the next multiple of a given number and adding random noise, and written to local file stats/hidserv-stats. Notably, no statistics will be gathered on clients or services, but only on relays.
2014-12-11Fix 13941: make calling log_new_relay_greeting() optional.meejah
Specifically, only if we're creating secret_id_key do we log the greeting (and then only if the key is actually created).
2014-11-08Stop failing when key files are zero-lengthteor
Instead, generate new keys, and overwrite the empty key files. Adds FN_EMPTY to file_status_t and file_status. Fixes bug 13111. Related changes due to review of FN_FILE usage: Stop generating a fresh .old RSA key file when the .old file is missing. Avoid overwriting .old key files with empty key files. Skip loading zero-length extra info store, router store, stats, state, and key files.
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-10-28Merge remote-tracking branch 'rl1987/feature10427'Nick Mathewson
2014-10-27Remove configure option to disable curve25519Sebastian Hahn
By now, support in the network is widespread and it's time to require more modern crypto on all Tor instances, whether they're clients or servers. By doing this early in 0.2.6, we can be sure that at some point all clients will have reasonable support.
2014-10-26Congratulate relay operator when OR is first startedrl1987
When Tor first generates identity keypair, emit a log message that thanks for their participation and points to new Tor relay lifecycle document.
2014-10-20Memwipe more keys after tor has finished with themteor
Ensure we securely wipe keys from memory after crypto_digest_get_digest and init_curve25519_keypair_from_file have finished using them. Fixes bug 13477.
2014-10-13Treat unparseable (micro)descriptors and extrainfos as undownloadableNick Mathewson
One pain point in evolving the Tor design and implementing has been adding code that makes clients reject directory documents that they previously would have accepted, if those descriptors actually exist. When this happened, the clients would get the document, reject it, and then decide to try downloading it again, ad infinitum. This problem becomes particularly obnoxious with authorities, since if some authorities accept a descriptor that others don't, the ones that don't accept it would go crazy trying to re-fetch it over and over. (See for example ticket #9286.) This patch tries to solve this problem by tracking, if a descriptor isn't parseable, what its digest was, and whether it is invalid because of some flaw that applies to the portion containing the digest. (This excludes RSA signature problems: RSA signatures aren't included in the digest. This means that a directory authority can still put another directory authority into a loop by mentioning a descriptor, and then serving that descriptor with an invalid RSA signatures. But that would also make the misbehaving directory authority get DoSed by the server it's attacking, so it's not much of an issue.) We already have a mechanism to mark something undownloadable with downloadstatus_mark_impossible(); we use that here for microdescriptors, extrainfos, and router descriptors. Unit tests to follow in another patch. Closes ticket #11243.
2014-09-29Avoid frequent strcmp() calls for AccountingRuleNick Mathewson
Generally, we don't like to parse the same thing over and over; it's best IMO to do it once at the start of the code.
2014-09-29Add an "AccountingRule" feature to permit limiting bw usage by read+writeNick Mathewson
Patch from "chobe". Closes ticket 961.
2014-09-22New API for policies_parse_exit_policy().rl1987
2014-09-09Remove support for naming directory authoritiesSebastian Hahn
This implements the meat of #12899. This commit should simply remove the parts of Tor dirauths used to check whether a relay was supposed to be named or not, it doesn't yet convert to a new mechanism for reject/invalid/baddir/badexiting relays.
2014-09-02Don't delay uploading a new desc if bw estimate was 0Sebastian Hahn
When a tor relay starts up and has no historical information about its bandwidth capability, it uploads a descriptor with a bw estimate of 0. It then starts its bw selftest, but has to wait 20 minutes to upload the next descriptor due to the MAX_BANDWIDTH_CHANGE_FREQ delay. This change should mean that on average, relays start seeing meaningful traffic a little quicker, since they will have a higher chance to appear in the consensus with a nonzero bw. Patch by Roger, changes file and comment by Sebastian.
2014-08-20Merge remote-tracking branch 'public/bug12728_024'Nick Mathewson
2014-08-05Correctly remove extraneous space in router family linesNick Mathewson
Fixes bug 12728; bugfix on 0.2.1.7-alpha when the SPLIT_IGNORE_SPACE option was added.
2014-07-16Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-07-09Remove executable bit from control.c, router.cNick Mathewson
Fix for 12512.
2014-06-20Authorities also advertise caches-extra-infoNick Mathewson
(Whoops, thought I had committed this before) Improvement to 11683 fix. Based on patch from Karsten.
2014-05-20Fix a sentence that I neverNick Mathewson
2014-05-17note a comment that nickm didn't finishRoger Dingledine