summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
AgeCommit message (Collapse)Author
2017-05-25Stop leaking keypin-rejected routerinfos on directory authoritiesteor
When directory authorities reject a router descriptor due to keypinning, free the router descriptor rather than leaking the memory. Fixes bug 22370; bugfix on 0.2.7.2-alpha.
2017-05-22dir auths reject 0.2.9.x for x<5, due to bug 20499Roger Dingledine
Directory authorities now reject relays running versions 0.2.9.1-alpha through 0.2.9.4-alpha, because those relays suffer from bug 20499 and don't keep their consensus cache up-to-date. Resolves ticket 20509.
2017-02-15When examining descriptors as a dirserver, reject ones with bad versionsNick Mathewson
This is an extra fix for bug 21278: it ensures that these descriptors and platforms will never be listed in a legit consensus.
2017-01-31be explicit in clear_status_flags_on_sybil that we leave BadExit aloneRoger Dingledine
2017-01-31Do not clear is_bad_exit on sybil.Nick Mathewson
But do clear is_v2_dir. Fixes bug 21108 -- bugfix on d95e7c7d67134b9b964d49cf8c2bdbf805a in 0.2.0.13-alpha.
2016-11-16don't attempt a resolve when the cached answer will doRoger Dingledine
For relays that don't know their own address, avoid attempting a local hostname resolve for each descriptor we download. Also cut down on the number of "Success: chose address 'x.x.x.x'" log lines. Fixes bugs 20423 and 20610; bugfix on 0.2.8.1-alpha.
2016-11-16refactor router_pick_published_address to have another argRoger Dingledine
no change in behavior except fewer log entries in the case where we use a cached result.
2016-10-17Write a bunch of module documentation.Nick Mathewson
This commit adds or improves the module-level documenation for: buffers.c circuitstats.c command.c connection_edge.c control.c cpuworker.c crypto_curve25519.c crypto_curve25519.h crypto_ed25519.c crypto_format.c dircollate.c dirserv.c dns.c dns_structs.h fp_pair.c geoip.c hibernate.c keypin.c ntmain.c onion.c onion_fast.c onion_ntor.c onion_tap.c periodic.c protover.c protover.h reasons.c rephist.c replaycache.c routerlist.c routerparse.c routerset.c statefile.c status.c tor_main.c workqueue.c In particular, I've tried to explain (for each documented module) what each module does, what's in it, what the big idea is, why it belongs in Tor, and who calls it. In a few cases, I've added TODO notes about refactoring opportunities. I've also renamed an argument, and fixed a few DOCDOC comments.
2016-09-26protovers: during voting, assert that we are not voting to shut down.Nick Mathewson
As a failsafe, we should make sure that no authority ever votes for a set of protocol versions that it does not itself support.
2016-09-26Rename "proto " to "pr " in consensusesNick Mathewson
2016-09-26Update prop264 implementation to split HSMid->HS{Intro,Rend}Nick Mathewson
2016-09-26Update authority votes to match updated proposal.Nick Mathewson
2016-09-26Include protocol versions in votes.Nick Mathewson
2016-09-26Include protocol version lines in votes.Nick Mathewson
2016-07-15Clients avoid choosing nodes that can't do ntorteor (Tim Wilson-Brown)
If we know a node's version, and it can't do ntor, consider it not running. If we have a node's descriptor, and it doesn't have a valid ntor key, consider it not running. Refactor these checks so they're consistent between authorities and clients.
2016-07-15Authorities reject descriptors without ntor keysteor (Tim Wilson-Brown)
Before, they checked for version 0.2.4.18-rc or later, but this would not catch relays without version lines, or buggy or malicious relays missing an ntor key.
2016-06-30fix naked memcmpsNick Mathewson
2016-06-20Make base16_decodes return number of decoded bytesnikkolasg
base16_decodes() now returns the number of decoded bytes. It's interface changes from returning a "int" to a "ssize_t". Every callsite now checks the returned value. Fixes #14013 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-11Merge branch 'bug19180_easy_squashed'Nick Mathewson
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-05-30Replace nearly all XXX0vv comments with smarter onesNick Mathewson
So, back long ago, XXX012 meant, "before Tor 0.1.2 is released, we had better revisit this comment and fix it!" But we have a huge pile of such comments accumulated for a large number of released versions! Not cool. So, here's what I tried to do: * 0.2.9 and 0.2.8 are retained, since those are not yet released. * XXX+ or XXX++ or XXX++++ or whatever means, "This one looks quite important!" * The others, after one-by-one examination, are downgraded to plain old XXX. Which doesn't mean they aren't a problem -- just that they cannot possibly be a release-blocking problem.
2016-05-30We no longer generate v0 directories. Remove the code to do soNick Mathewson
2016-05-19Merge branch 'maint-0.2.8'Nick Mathewson
2016-05-17whitespace fixesNick Mathewson
2016-05-17Remove duplicate siging_key_cert fields.Nick Mathewson
With the fix for #17150, I added a duplicate certificate here. Here I remove the original location in 0.2.8. (I wouldn't want to do that in 027, due to the amount of authority-voting-related code drift.) Closes 19073.
2016-05-17Merge branch 'maint-0.2.8'Nick Mathewson
2016-05-17Merge branch 'bug17150_027_extra' into maint-0.2.8Nick Mathewson
2016-05-17Improve API of routerinfo_incompatible_with_extrainfo()Nick Mathewson
This API change makes it so that routerinfo_incompatible...() no longer takes a routerinfo_t, so that it's obvious that it should only look at fields from the signed_descriptor_t. This change should prevent a recurrence of #17150.
2016-05-17Merge branch 'maint-0.2.8'Nick Mathewson
2016-05-17Merge remote-tracking branch 'arma/bug18616-v4' into maint-0.2.8Nick Mathewson
2016-05-16touchups and refactorings on bug 18616 branchRoger Dingledine
no behavior changes
2016-05-11Merge branch 'maint-0.2.8'Roger Dingledine
2016-05-11Merge branch 'maint-0.2.7' into maint-0.2.8Roger Dingledine
2016-05-11unbreak the build (when warnings are enabled)Roger Dingledine
2016-05-11Merge remote-tracking branch 'arma/feature18760'Nick Mathewson
2016-05-11Merge branch 'maint-0.2.8'Nick Mathewson
2016-05-11Merge branch 'maint-0.2.7' into maint-0.2.8Nick Mathewson
2016-05-11Fix out-of-bounds write during voting with duplicate ed25519 keysJohn Brooks
In dirserv_compute_performance_thresholds, we allocate arrays based on the length of 'routers', a list of routerinfo_t, but loop over the nodelist. The 'routers' list may be shorter when relays were filtered by routers_make_ed_keys_unique, leading to an out-of-bounds write on directory authorities. This bug was originally introduced in 26e89742, but it doesn't look possible to trigger until routers_make_ed_keys_unique was introduced in 13a31e72. Fixes bug 19032; bugfix on tor 0.2.8.2-alpha.
2016-04-28Decide to advertise begindir support like we decide to advertise DirPortteor (Tim Wilson-Brown)
Decide to advertise begindir support in a similar way to how we decide to advertise DirPort. Fix up the associated descriptor-building unit tests. Resolves #18616, bugfix on 0c8e042c30946faa in #12538 in 0.2.8.1-alpha.
2016-04-12encourage rejected relays to contact usRoger Dingledine
When the directory authorities refuse a bad relay's descriptor, encourage the relay operator to contact us. Many relay operators won't notice this line in their logs, but it's a win if even a few learn why we don't like what their relay was doing. Resolves ticket 18760. I didn't specify a contact mechanism (e.g. an email address), because every time we've done that in the past, a few years later we noticed that the code was pointing people to an obsolete contact address.
2016-03-24dir auths only give Guard if they're giving StableRoger Dingledine
This change allows us to simplify path selection for clients, and it should have minimal effect in practice since >99% of Guards already have the Stable flag. Implements ticket 18624.
2016-03-21Merge branch 'maint-0.2.7'Nick Mathewson
2016-03-21In routers_make_ed_keys_unique, break ties for published_onNick Mathewson
This ensures that if we can't use published_on to decide an ed,rsa mapping, we at least decide deterministically. Resolves 17668.T3
2016-03-21After we strip out duplicate entries from 'routers', don't use 'rl'.Nick Mathewson
We've got to make sure that every single subsequent calculation in dirserv_generate_networkstatus_vote_obj() are based on the list of routerinfo_t *after* we've removed possible duplicates, not before. Fortunately, none of the functions that were taking a routerlist_t as an argument were actually using any fields other than this list of routers. Resolves issue 18318.DG3.
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.
2016-02-27Update the copyright year.Nick Mathewson
2016-02-23Merge branch 'bug17795'Nick Mathewson
2016-02-10Rename crypto_digest_all, and digests_t.Nick Mathewson
They are no longer "all" digests, but only the "common" digests. Part of 17795. This is an automated patch I made with a couple of perl one-liners: perl -i -pe 's/crypto_digest_all/crypto_common_digests/g;' src/*/*.[ch] perl -i -pe 's/\bdigests_t\b/common_digests_t/g;' src/*/*.[ch]
2016-02-08fix wide lines, use more locals.Nick Mathewson
2016-02-07Using router_get_my_routerinfo()Harini Kannan