summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
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-02-22Enable ed25519 collator in voting.Nick Mathewson
Previously, I had left in some debugging code with /*XXX*/ after it, which nobody noticed. Live and learn! Next time I will use /*XXX DO NOT COMMIT*/ or something. We need to define a new consensus method for this; consensus method 21 shouldn't actually be used. Fixes bug 17702; bugfix on 0.2.7.2-alpha.
2015-08-13Fix some types on container fnsNick Mathewson
2015-05-29Fix a warning from the clangalyzer.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-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-28Refactor code that matches up routers with the same identity in votesNick Mathewson
This makes 'routerstatus collation' into a first-class concept, so we can change how that works for prop220.
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-28Include ed25519 keys in microdescriptors.Nick Mathewson
2015-04-23Use a custom Base64 encoder with more control over the output format.Yawning Angel
2015-02-18clean up comments and whitespace a bitRoger Dingledine
2015-02-18Actually free measured_guardfraction.Yawning Angel
CID 1270894
2015-02-18Merge branch 'bug9321_rerebase'Nick Mathewson
Conflicts: src/or/dirvote.h src/test/include.am src/test/test_entrynodes.c
2015-02-18Final guardfraction preparations for upstream merge.George Kadianakis
- Write a changes file. - Change some logs to lesser severities.
2015-02-18Calculate total bandwidth weights using the guardfraction bandwidths.George Kadianakis
Now use the function introduced in the previous commit, to calculate the total bandwidth weights when making the consensus.
2015-02-18Write GuardFraction information to consensus.George Kadianakis
If we've seen enough votes with guardfraction information, write down the GuardFraction string in the consensus.
2015-01-10More documentation for proposal 227 workNick Mathewson
2015-01-10Implement proposal 227-vote-on-package-fingerprints.txtNick Mathewson
This implementation includes tests and a little documentation.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-26Improve a notice message in dirvote.c. (Roger asked for this.)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-11-02Apply new calloc coccinelle patchNick Mathewson
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-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-28Stop spurious clang shallow analysis null pointer errorsteor
Avoid 4 null pointer errors under clang shallow analysis (the default when building under Xcode) by using tor_assert() to prove that the pointers aren't null. Resolves issue 13284 via minor code refactoring.
2014-09-02Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-09-02Fix a number of clang analyzer false-positivesNick Mathewson
Most of these are in somewhat non-obvious code where it is probably a good idea to initialize variables and add extra assertions anyway. Closes 13036. Patches from "teor".
2014-08-26Merge remote-tracking branch 'public/bug10163'Nick Mathewson
2014-08-25Remove the assigned-but-unused chosen_named_idx local variableNick Mathewson
It had been used in consensus method 1. But now that 13 is the minimum (see #10163), we don't need it around. Found by sysrqb.
2014-08-21Mark one use of networkstatus_check_document_signature as (void)Nick Mathewson
Also explain why we aren't checking its return value. [CID 1198197]
2014-08-21remove meaningless checks for chunks==NULL in dirserv stuffNick Mathewson
Also, make it clearer that chunks cannot be NULL [CID 1031750, 1031751]
2014-08-15Remove implementation code for all pre-13 consensus methods.Nick Mathewson
Also remove a test for the way that we generated parameter votes before consensus method 12.
2014-08-15Remove support for generating consensuses with methods <= 9.Nick Mathewson
The last patch disabled these; this one removes the code to implement them.
2014-08-15No longer advertise or negotiate any consensus method before 13.Nick Mathewson
Implements proposal 215; closes ticket 10163. Why? From proposal 215: Consensus method 1 is no longer viable for the Tor network. It doesn't result in a microdescriptor consensus, and omits other fields that clients need in order to work well. Consensus methods under 12 have security issues, since they let a single authority set a consensus parameter. ... For example, while Tor 0.2.4.x is under development, authorities should really not be running anything before Tor 0.2.3.x. Tor 0.2.3.x has supported consensus method 13 since 0.2.3.21-rc, so it's okay for 0.2.4.x to require 13 as the minimum method. We even might go back to method 12, since the worst outcome of not using 13 would be some warnings in client logs. Consensus method 12 was a security improvement, so we don't want to roll back before that.
2014-08-13Apply coccinelle script to replace malloc(a*b)->calloc(a,b)Nick Mathewson
2014-05-06Future-proof "id" lines against proposal 220.Nick Mathewson
2014-05-05Consensus method 18: Add a base64 ID digest to the microdescNick Mathewson
This is a stopgap measure to make sure that microdescriptors never collide; see bug 11743.
2013-12-17Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
Conflicts: src/or/microdesc.c Conflict because one change was on line adjacent to line where 01206893 got fixed.
2013-12-17Merge remote-tracking branch 'public/bug10409_023' into maint-0.2.4Nick Mathewson
2013-12-16Avoid free()ing from an mmap on corrupted microdesc cacheNick Mathewson
The 'body' field of a microdesc_t holds a strdup()'d value if the microdesc's saved_location field is SAVED_IN_JOURNAL or SAVED_NOWHERE, and holds a pointer to the middle of an mmap if the microdesc is SAVED_IN_CACHE. But we weren't setting that field until a while after we parsed the microdescriptor, which left an interval where microdesc_free() would try to free() the middle of the mmap(). This patch also includes a regression test. This is a fix for #10409; bugfix on 0.2.2.6-alpha.
2013-09-01Added no_tempfile parameter to write_chunks_to_file to do non-atomic writes. ↵Kevin Butler
Implements #1376.
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-07-08Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-07-08Add a comment and a check for why flag indices will be <= 63Nick Mathewson
2013-07-03FIx undefined behavior in dirvote.cNick Mathewson
Fix a bug in the voting algorithm that could yield incorrect results when a non-naming authority declared too many flags. Fixes bug 9200; bugfix on 0.2.0.3-alpha. Found by coverity scan.
2013-06-08Add support for offsetting the voting interval in order to bootstrap faster.Linus Nordberg
A new option TestingV3AuthVotingStartOffset is added which offsets the starting time of the voting interval. This is possible only when TestingTorNetwork is set. This patch makes run_scheduled_events() check for new consensus downloads every second when TestingTorNetwork, instead of every minute. This should be fine, see #8532 for reasoning. This patch also brings MIN_VOTE_SECONDS and MIN_DIST_SECONDS down from 20 to 2 seconds, unconditionally. This makes sanity checking of misconfiguration slightly less sane. Addresses #8532.
2013-05-10Merge bug5595-v2-squashed into maint-0.2.4Andrea Shepard
2013-05-09When downloading certificates, distinguish requesting by identity digest ↵Andrea Shepard
from requesting by ID digest, signing key pair; fixes bug 5595
2013-04-18Merge branch 'less_charbuf_rebased' into maint-0.2.4Nick Mathewson
Conflicts: src/or/dirserv.c src/or/dirserv.h src/test/test_dir.c
2013-04-18Remove some now-needless length definesNick Mathewson