aboutsummaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2016-07-01Merge remote-tracking branch 'dgoulet/ticket16943_029_05-squashed'Nick Mathewson
Trivial Conflicts: src/or/or.h src/or/routerparse.c
2016-07-01prop250: Add a DEL state action and return const SRVsDavid Goulet
The *get* state query functions for the SRVs now only return const pointers and the DEL action needs to be used to delete the SRVs from the state. Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Use the new dirvote_get_intermediate_param_value for ↵David Goulet
AuthDirNumSRVAgreements Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01Refactor parameter computation and add a helper functionNick Mathewson
This patch makes us retain the intermediate list of K=V entries for the duration of computing our vote, and lets us use that list with a new function in order to look up parameters before the consensus is published. We can't actually use this function yet because of #19011: our existing code to do this doesn't actually work, and we'll need a new consensus method to start using it. Closes ticket #19012.
2016-07-01prop250: Fix format string encoding in log statementDavid Goulet
Commit and reveal length macro changed from int to unsigned long int (size_t) because of the sizeof(). Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Change reveal_num to uint64_t and version to uint32_tDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Don't use {0} to init static struct -- causes warning on clang.George Kadianakis
See ticket #19132 for the clang/llvm warning. Since voting_schedule is a global static struct, it will be initialized to zero even without explicitly initializing it with {0}. This is what the C spec says: If an object that has automatic storage duration is not initialized explicitly, its value is indeterminate. If an object that has static storage duration is not initialized explicitly, then: — if it has pointer type, it is initialized to a null pointer; — if it has arithmetic type, it is initialized to (positive or unsigned) zero; — if it is an aggregate, every member is initialized (recursively) according to these rules; — if it is a union, the first named member is initialized (recursively) according to these rules.
2016-07-01prop250: Silence a logging message.George Kadianakis
LOG_NOTICE is a bit too much for that one.
2016-07-01prop250: Don't reject votes containing commits of unknown dirauths.George Kadianakis
Instead just ignore those commits. Squash this commit with 33b2ade.
2016-07-01prop250: Pass the dst length to sr_srv_encode()David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Fix unit tests about the RSA fingerprint checkDavid Goulet
Code has been changed so every RSA fingerprint for a commit in our state is validated before being used. This fixes the unit tests by mocking one of the key function and updating the hardcoded state string. Also, fix a time parsing overflow on platforms with 32bit time_t Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-07-01prop250: Sort commits in lexicographical order in votesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Improve log messagesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Sort smartlist before you get most frequent SRV.George Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Only trust known authority when computing SRVDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Add version to Commit line in vote and stateDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Add a valid flag to sr_commit_tDavid Goulet
We assert on it using the ASSERT_COMMIT_VALID() macro in critical places where we use them expecting a commit to be valid. Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Use RSA identity digest instead of fingerprintDavid Goulet
The prop250 code used the RSA identity key fingerprint to index commit in a digestmap instead of using the digest. To behavior change except the fact that we are actually using digestmap correctly. Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: change time_t to uint64_tDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-07-01prop250: Add unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-07-01prop250: Initialize the SR subsystem and us it!David Goulet
This commit makes it that tor now uses the shared random protocol by initializing the subsystem. Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-07-01prop250: Parse votes and consensusDavid Goulet
One of the last piece that parses the votes and consensus in order to update our state and make decision for the SR values. We need to inform the SR subsystem when we set the current consensus because this can be called when loaded from file or downloaded from other authorities or computed. The voting schedule is used for the SR timings since we are bound to the voting system. Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-07-01prop250: Put commits and SRVs in votes/consensusDavid Goulet
This commit adds the commit(s) line in the vote as well as the SR values. It also has the mechanism to add the majority SRVs in the consensus. Signed-off-by: George Kadianakis <desnacked@riseup.net> Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01prop250: Add commit and SR values generation codeDavid Goulet
This adds the logic of commit and SR values generation. Furthermore, the concept of a protocol run is added that is commit is generated at the right time as well as SR values which are also rotated before a new protocol run. Signed-off-by: George Kadianakis <desnacked@riseup.net> Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-07-01Fix a missing break; in dump_desc_init()Nick Mathewson
Found by coverity scan; this is CID 1362983
2016-07-01Merge remote-tracking branch 'teor/bug19530-v2'Nick Mathewson
2016-07-01Merge branch 'maint-0.2.8'Nick Mathewson
2016-07-01When tor can't find a directory, log lessteor (Tim Wilson-Brown)
2016-07-01Make authority_certs_fetch_missing support bridge hintsteor (Tim Wilson-Brown)
This also fixes an issue where bridge clients may have found a routerstatus for a directory mirror, and connected to it directly.
2016-07-01Refactor duplicate code in authority_certs_fetch_missingteor (Tim Wilson-Brown)
2016-07-01Call purpose_needs_anonymity in authority_certs_fetch_missingteor (Tim Wilson-Brown)
2016-07-01Hex-encode raw digest before printing in authority_certs_fetch_missingteor (Tim Wilson-Brown)
2016-07-01Refactor authority_certs_fetch_missing to call get_options onceteor (Tim Wilson-Brown)
2016-06-30Set binary mode when checking malformed descriptor.Nick Mathewson
2016-06-30fix naked memcmpsNick Mathewson
2016-06-30Fix more naked strdup/malloc/free instancesNick Mathewson
2016-06-30Try to fix warnings when size_t is smaller than st.st_size.Nick Mathewson
2016-06-30fix a syntax warningNick Mathewson
2016-06-30Fix three -Wtautological-constant-out-of-range-compare warnings.Nick Mathewson
2016-06-30Fix -Wextra-semi warningNick Mathewson
2016-06-30Fix a 32-bit compilation failureNick Mathewson
2016-06-30A little more specificity in documentation for getinfo download/ stuffNick Mathewson
Also, a const.
2016-06-30Merge remote-tracking branch 'andrea/ticket19323_squashed'Nick Mathewson
2016-06-30Merge remote-tracking branch 'andrea/bug18322_v3_squashed'Nick Mathewson
2016-06-30Also check if the sandbox is configured as well as if it's active; ↵Andrea Shepard
sandbox_init() runs rather late in the startup process
2016-06-30Do sandbox_is_active() check before reconstructing dump_desc() FIFO on ↵Andrea Shepard
startup too
2016-06-30Add unit test for dump_desc_populate_fifo_from_directory()Andrea Shepard
2016-06-30Make things mockable for dump_desc_populate_fifo_from_directory() unit testAndrea Shepard
2016-06-30Unit test for dump_desc_populate_one_file()Andrea Shepard
2016-06-30Reload unparseable descriptor dump FIFO state from on-disk dumped ↵Andrea Shepard
descriptors at startup