summaryrefslogtreecommitdiff
path: root/src/or/dirserv.h
AgeCommit message (Collapse)Author
2018-05-01dirvote: Move the vote creation code into dirvote.cDavid Goulet
This code is only for dirauth so this commit moves it into the module in dirvote.c. No code behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2017-12-08Merge branch 'macro_free_v2_squashed'Nick Mathewson
2017-12-08Fix wide lines introduced by previous patch.Nick Mathewson
2017-12-08Replace all FREE_AND_NULL* uses to take a type and a free function.Nick Mathewson
This commit was made mechanically by this perl script: \#!/usr/bin/perl -w -i -p next if /^#define FREE_AND_NULL/; s/\bFREE_AND_NULL\((\w+),/FREE_AND_NULL\(${1}_t, ${1}_free_,/; s/\bFREE_AND_NULL_UNMATCHED\(/FREE_AND_NULL\(/;
2017-12-08Change the free macro convention in the rest of src/or/*.hNick Mathewson
2017-10-15Add a consensus_method argument to routerstatus_format_entry()teor
And pass ROUTERSTATUS_FORMAT_NO_CONSENSUS_METHOD when it's not applicable. Preparation for #23826.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-05-04Store the sha3 of a networkstatus as part of the networkstatus_tNick Mathewson
Also store it in the cached_dir_t.
2017-05-04Add consensus_cache_entry spooling support to spooled_resource_tNick Mathewson
2017-03-28Fix i386 compilation from spooling patch. I seem to be good at breaking that.Nick Mathewson
2017-03-28Merge branch 'spooling_squashed'Nick Mathewson
2017-03-28Refactor the directory spool implementationNick Mathewson
The old implementation had duplicated code in a bunch of places, and it interspersed spool-management with resource management. The new implementation should make it easier to add new resource types and maintain the spooling code. Closing ticket 21651.
2017-03-15Run the copyright update script.Nick Mathewson
2016-12-08Propagate Ed25519 identities downwards into more functions.Nick Mathewson
Actually set ed25519 identities on channels when we set a channel's identity.
2016-09-26Include protocol versions in votes.Nick Mathewson
2016-05-30We no longer generate v0 directories. Remove the code to do soNick 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-03-21Merge branch 'maint-0.2.7'Nick Mathewson
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-02-27Update the copyright year.Nick Mathewson
2016-02-10Whitespace fixesNick 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]
2015-08-18Refactor TestingDirAuthVote* into dirserv_set_routerstatus_testingteor
Make it easier to unit test TestingDirAuthVote{Exit,Guard,HSDir} by refactoring the code which sets flags based on them into a new function dirserv_set_routerstatus_testing.
2015-07-31Improve log messages for problems about ed25519 keypinningNick Mathewson
Fixes 16286; bugfix on 0.2.7.2-alpha.
2015-02-18Merge branch 'bug9321_rerebase'Nick Mathewson
Conflicts: src/or/dirvote.h src/test/include.am src/test/test_entrynodes.c
2015-02-18Parse Guardfraction file and apply results to routerstatuses.George Kadianakis
Parse the file just before voting and apply its information to the provided vote_routerstatus_t. This follows the same logic as when dirauths parse bwauth files.
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-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-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-03-18Take out remaining V1 directory code.Karsten Loesing
2014-02-15Remove a bunch of functions that were never called.Nick Mathewson
2014-01-29Rip out all of the v2 directory code.Nick Mathewson
The remaining vestige is that we continue to publish the V2dir flag, and that, for the controller, we continue to emit v2 directory formats when requested.
2013-10-21A Bridge Authority should compute flag thresholdsMatthew Finkel
As a bridge authority, before we create our networkstatus document, we should compute the thresholds needed for the various status flags assigned to each bridge based on the status of all other bridges. We then add these thresholds to the networkstatus document for easy access. Fixes for #1117 and #9859.
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-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-18Add a quick-and-dirty-test for generate_v2_networkstatus.Nick Mathewson
It sure is a good thing we can run each test in its own process, or else the amount of setup I needed to do to make this thing work would have broken all the other tests. Test mocking would have made this easier to write too.
2013-04-18Remove some now-needless length definesNick Mathewson
2013-04-18Remove RS_ENTRY_LENNick Mathewson
Nothing uses it any longer now that we use smartlists of strings for stuff that manipulates iles of formatted routerstatuses.
2013-04-18Refactor routerstatus_format_entry to avoid character-buffersNick Mathewson
2013-04-14Rename all fields which measure bw in kb to end with _kbNick Mathewson
2013-03-18Merge remote-tracking branch 'andrea/bug8435' into maint-0.2.4Nick Mathewson
2013-03-18Add dirserv_has_measured_bw() predicate wrapper for ↵Andrea Shepard
dirserv_query_measured_bw_cache()
2013-03-07Add unit test for dirserv measured bandwidth cacheAndrea Shepard
2013-02-23Remove a bunch of unused macro definitionsNick Mathewson
2013-02-19Refactor storing of measured_bw versus Unmeasured=1.Nick Mathewson
This patch moves the measured_bw field and the has_measured_bw field into vote_routerstatus_t, since only votes have 'Measured=XX' set on their weight line. I also added a new bw_is_unmeasured flag to routerstatus_t to represent the Unmeasured=1 flag on a w line. Previously, I was using has_measured_bw for this, which was quite incorrect: has_measured_bw means that the measured_bw field is set, and it's probably a mistake to have it serve double duty as meaning that 'baandwidth' represents a measured value. While making this change,I also found a harmless but stupid bug in dirserv_read_measured_bandwidths: It assumes that it's getting a smartlist of routerstatus_t, when really it's getting a smartlist of vote_routerstatus_t. C's struct layout rules mean that we could never actually get an error because of that, but it's still quite incorrect. I fixed that, and in the process needed to add two more sorting and searching helpers. Finally, I made the Unmeasured=1 flag get parsed. We don't use it for anything yet, but someday we might. This isn't complete yet -- the new 2286 unit test doesn't build.
2013-02-04Include a flag-thresholds line in each vote to describe flag cutoffsNick Mathewson
Implements ticket 8151.
2013-01-16Update the copyright date to 201.Nick Mathewson