aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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 changes fileDavid Goulet
Fixes #16943 Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.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-06-20prop250: Add memory and disk state in new filesDavid Goulet
This commit introduces two new files with their header. "shared_random.c" contains basic functions to initialize the state and allow commit decoding for the disk state to be able to parse them from disk. "shared_random_state.c" contains everything that has to do with the state for both our memory and disk. Lots of helper functions as well as a mechanism to query the state in a synchronized way. Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-06-20Add tor_htonll/ntohll functionsDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-06-20util: zero target buffer of base*_encode/decodeDavid Goulet
Make sure to memset(0) the destination buffer so we don't leave any uninitialized data. Fixes #19462 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-20mark sanitize_blacklist.txt as obsoleteNick Mathewson
2016-06-20Patch from dgoulet: fix a base16 problem that manifested w stemNick Mathewson
2016-06-20Coverage hack for test_switch_id.shNick Mathewson
This hack provides a way to make sure we can see coverage from test-switch-id. If you set OVERRIDE_GCDA_PERMISSIONS_HACK, we temporarily make the .gcda files mode 0666 before we run the test scripts, and then we set them to 0644 again afterwards. That's necessary because the test_switch_id.sh script does a setuid() to 'nobody' part way through, and drops the ability to change its mind back.
2016-06-20Small coverage improvements on compat.cNick Mathewson
2016-06-20compat.c coverage: simplify under-tested alloc_getcwd.Nick Mathewson
Yes, HURD lacks PATH_MAX. But we already limited the maximum buffer to 4096, so why not just use that?
2016-06-20More coverage in backtrace.cNick Mathewson
2016-06-20Merge remote-tracking branch 'dgoulet/bug19465_029_01'Nick Mathewson
2016-06-20Fix unit test crash on 32-bit.Nick Mathewson
2016-06-20test: Increase offset to rendcache descriptor timeDavid Goulet
Slow system can sometime take more than 10 seconds to reach the test callsite resulting in the unit test failing when using time in the future or in the past. Fixes #19465 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-20Merge branch 'bug14013_029_01_squashed'Nick 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-19Changes file for 19063; use the BUG macroNick Mathewson
2016-06-19Fix #19063: Add check in utility macroU+039b
2016-06-19Merge branch 'zlib_coverage_squashed'Nick Mathewson
2016-06-19Unindent blockNick Mathewson
2016-06-19Mark some torgzip lines as unreachable/untestable.Nick Mathewson
2016-06-19Remove a ridiculous realloc call from torgzip.cNick Mathewson
realloc()ing a thing in order to try to save memory on it just doesn't make sense with today's allocators. Instead, let's use the fact that whenever we decompress something, either it isn't too big, or we chop it up, or we reallocate it.
2016-06-19Remove support for zlib <= 1.1Nick Mathewson
zlib 1.2 came out in 2003; earlier versions should be dead by now. Our workaround code was only preventing us from using the gzip encoding (if we decide to do so), and having some dead code linger around in torgzip.c
2016-06-19Merge remote-tracking branch 'public/thread_coverage'Nick Mathewson
2016-06-19Fix spelling of --enable-tor2web-mode in manpageNick Mathewson
Fixes bug 19153; patch from "U+039b", who is apparently an uppercase lambda?
2016-06-18Keep make check-spaces happyAndrea Shepard
2016-06-17Merge branch 'bug18280_029_03_nm_squashed'Nick Mathewson
2016-06-17test: Add base32_encode/decode unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-06-17Fix base32 API to take any source length in bytesDavid Goulet
Fixes #18280 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-06-17Use the Autoconf macro AC_USE_SYSTEM_EXTENSIONScypherpunks
The Autoconf macro AC_USE_SYSTEM_EXTENSIONS defines preprocessor macros which turn on extensions to C and POSIX. The macro also makes it easier for developers to use the extensions without needing (or forgetting) to define them manually. The macro can be safely used because it was introduced in Autoconf 2.60 and Tor requires Autoconf 2.63 and above.
2016-06-17Merge remote-tracking branch 'dgoulet/bug18604_029_01'Nick Mathewson
2016-06-16Mark an abort() as unreachable.Nick Mathewson