]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
9 years agoClient & HS ignore UseNTorHandshake, all non-HS handshakes use ntor
teor (Tim Wilson-Brown) [Fri, 8 Jul 2016 04:46:00 +0000 (14:46 +1000)] 
Client & HS ignore UseNTorHandshake, all non-HS handshakes use ntor

Rely on onion_populate_cpath to check that we're only using
TAP for the rare hidden service cases.

Check and log if handshakes only support TAP when they should support
ntor.

9 years agoImprove comments in circuit_get_cpath_*
teor (Tim Wilson-Brown) [Fri, 8 Jul 2016 02:30:20 +0000 (12:30 +1000)] 
Improve comments in circuit_get_cpath_*

9 years agoClient & HS make sure every hop in every non-HS path supports ntor
teor (Tim Wilson-Brown) [Thu, 7 Jul 2016 06:04:26 +0000 (16:04 +1000)] 
Client & HS make sure every hop in every non-HS path supports ntor

When a client connects to an intro point not in the client's consensus,
or a hidden service connects to a rend point not in the hidden service's
consensus, we are stuck with using TAP, because there is no ntor link
specifier.

9 years agoClients avoid choosing nodes that can't do ntor
teor (Tim Wilson-Brown) [Thu, 7 Jul 2016 02:58:47 +0000 (12:58 +1000)] 
Clients avoid choosing nodes that can't do ntor

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.

9 years agoClients no longer download descriptors for relays without ntor
teor (Tim Wilson-Brown) [Wed, 6 Jul 2016 07:32:57 +0000 (17:32 +1000)] 
Clients no longer download descriptors for relays without ntor

9 years agoRelays make sure their own descriptor has an ntor key
teor (Tim Wilson-Brown) [Wed, 6 Jul 2016 07:15:48 +0000 (17:15 +1000)] 
Relays make sure their own descriptor has an ntor key

9 years agoAuthorities reject descriptors without ntor keys
teor (Tim Wilson-Brown) [Wed, 6 Jul 2016 06:50:48 +0000 (16:50 +1000)] 
Authorities reject descriptors without ntor keys

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.

9 years agoMerge branch 'maint-0.2.8'
Nick Mathewson [Wed, 13 Jul 2016 13:19:35 +0000 (09:19 -0400)] 
Merge branch 'maint-0.2.8'

9 years agochanges file for bug18397
Nick Mathewson [Wed, 13 Jul 2016 13:19:23 +0000 (09:19 -0400)] 
changes file for bug18397

9 years agoMerge remote-tracking branch 'Jigsaw52/seccomp-fix-18397' into maint-0.2.8
Nick Mathewson [Wed, 13 Jul 2016 13:16:59 +0000 (09:16 -0400)] 
Merge remote-tracking branch 'Jigsaw52/seccomp-fix-18397' into maint-0.2.8

9 years agoAdds missing syscalls to seccomp filter.
Daniel Pinto [Fri, 8 Jul 2016 23:36:37 +0000 (00:36 +0100)] 
Adds missing syscalls to seccomp filter.

Fixes #18397 which prevented tor starting with Sandbox 1.

9 years agoFix test-network-all target in out-of-tree builds
cypherpunks [Thu, 16 Jun 2016 12:16:57 +0000 (12:16 +0000)] 
Fix test-network-all target in out-of-tree builds

The test-network-all target assumes the test-driver script lives in the
current working directory. This assumption breaks out-of-tree builds
because it actually lives in the source directory.

Automake 1.12 introduces `LOG_DRIVER` which defines the location of the
test driver script. Because Tor still supports Automake 1.11 we use the
default value of this variable directly. The default value uses the
configured shell for calling the test driver script and explicitly
prefixes the source directory.

9 years agoMerge remote-tracking branch 'sebastian/libevent2'
Nick Mathewson [Fri, 8 Jul 2016 13:57:31 +0000 (09:57 -0400)] 
Merge remote-tracking branch 'sebastian/libevent2'

9 years agoRemove already-merged changes files.
Nick Mathewson [Thu, 7 Jul 2016 17:16:44 +0000 (13:16 -0400)] 
Remove already-merged changes files.

These changes files already are merged in release-0.2.8, and
therefor will not be "new in 0.2.9.1-alpha".

9 years agoMerge branch 'maint-0.2.8'
Nick Mathewson [Thu, 7 Jul 2016 16:44:07 +0000 (12:44 -0400)] 
Merge branch 'maint-0.2.8'

9 years agoBump maint-0.2.8 to 0.2.8.5-rc-dev
Nick Mathewson [Thu, 7 Jul 2016 16:43:52 +0000 (12:43 -0400)] 
Bump maint-0.2.8 to 0.2.8.5-rc-dev

9 years agoForward-port the 0.2.8.5-rc changelog
Nick Mathewson [Thu, 7 Jul 2016 16:42:27 +0000 (12:42 -0400)] 
Forward-port the 0.2.8.5-rc changelog

9 years agotest coverage on onion_fast: 0%->100%
Nick Mathewson [Wed, 6 Jul 2016 17:43:12 +0000 (13:43 -0400)] 
test coverage on onion_fast: 0%->100%

9 years agoCapture the LOG_ERR messages in our tests that had logged errors.
Nick Mathewson [Wed, 6 Jul 2016 17:01:08 +0000 (13:01 -0400)] 
Capture the LOG_ERR messages in our tests that had logged errors.

(It's confusing for the test to write an expected error to stdout,
and then tell the user "OK".)

9 years agoWhen saving mocked log messages, always create the list.
Nick Mathewson [Wed, 6 Jul 2016 16:59:43 +0000 (12:59 -0400)] 
When saving mocked log messages, always create the list.

Otherwise, our code needs to check "list && smarlist_len(list)..."

9 years agoImprove test coverage a little on onion*.c
Nick Mathewson [Wed, 6 Jul 2016 16:37:52 +0000 (12:37 -0400)] 
Improve test coverage a little on onion*.c

9 years agoMerge branch 'maint-0.2.8'
Nick Mathewson [Wed, 6 Jul 2016 14:17:22 +0000 (10:17 -0400)] 
Merge branch 'maint-0.2.8'

9 years agoFix sign in test-timers
Nick Mathewson [Wed, 6 Jul 2016 14:07:02 +0000 (10:07 -0400)] 
Fix sign in test-timers

9 years agoWhen checking if a routerstatus is reachable, don't check the node
teor (Tim Wilson-Brown) [Wed, 6 Jul 2016 04:35:01 +0000 (14:35 +1000)] 
When checking if a routerstatus is reachable, don't check the node

This fixes #19608, allowing IPv6-only clients to use
microdescriptors, while preserving the ability of bridge clients
to have some IPv4 bridges and some IPv6 bridges.

Fix on c281c036 in 0.2.8.2-alpha.

9 years agoMerge remote-tracking branch 'teor/bug18456'
Nick Mathewson [Tue, 5 Jul 2016 23:10:08 +0000 (19:10 -0400)] 
Merge remote-tracking branch 'teor/bug18456'

9 years agoMerge remote-tracking branch 'dgoulet/sr-test-fix'
Nick Mathewson [Tue, 5 Jul 2016 21:53:13 +0000 (17:53 -0400)] 
Merge remote-tracking branch 'dgoulet/sr-test-fix'

9 years agoTest: fix shared random test checking bad errno
David Goulet [Tue, 5 Jul 2016 17:54:37 +0000 (13:54 -0400)] 
Test: fix shared random test checking bad errno

The test was checking for EISDIR which is a Linux-ism making other OSes
unhappy. Instead of checking for a negative specific errno value, just make
sure it's negative indicating an error. We don't need more for this test.

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoMerge branch 'maint-0.2.8'
Nick Mathewson [Tue, 5 Jul 2016 17:53:28 +0000 (13:53 -0400)] 
Merge branch 'maint-0.2.8'

9 years agoMerge branch 'maint-0.2.7' into maint-0.2.8
Nick Mathewson [Tue, 5 Jul 2016 17:52:18 +0000 (13:52 -0400)] 
Merge branch 'maint-0.2.7' into maint-0.2.8

9 years agoMerge branch 'maint-0.2.6' into maint-0.2.7
Nick Mathewson [Tue, 5 Jul 2016 17:52:04 +0000 (13:52 -0400)] 
Merge branch 'maint-0.2.6' into maint-0.2.7

9 years agoMerge branch 'maint-0.2.5' into maint-0.2.6
Nick Mathewson [Tue, 5 Jul 2016 17:51:51 +0000 (13:51 -0400)] 
Merge branch 'maint-0.2.5' into maint-0.2.6

9 years agoMerge branch 'maint-0.2.4' into maint-0.2.5
Nick Mathewson [Tue, 5 Jul 2016 17:51:34 +0000 (13:51 -0400)] 
Merge branch 'maint-0.2.4' into maint-0.2.5

9 years agowhoops. changelog file for 19271.
Nick Mathewson [Tue, 5 Jul 2016 17:51:21 +0000 (13:51 -0400)] 
whoops. changelog file for 19271.

9 years agoFix shared-random test
Nick Mathewson [Tue, 5 Jul 2016 17:31:18 +0000 (13:31 -0400)] 
Fix shared-random test

9 years agoMerge branch 'maint-0.2.8'
Nick Mathewson [Tue, 5 Jul 2016 17:06:06 +0000 (13:06 -0400)] 
Merge branch 'maint-0.2.8'

This is an "ours" merge, to avoid messing with the version.

9 years agoUpdate version to 0.2.8.5-rc. This is not yet a release.
Nick Mathewson [Tue, 5 Jul 2016 17:05:36 +0000 (13:05 -0400)] 
Update version to 0.2.8.5-rc. This is not yet a release.

9 years agoMerge branch 'maint-0.2.8'
Nick Mathewson [Tue, 5 Jul 2016 16:58:28 +0000 (12:58 -0400)] 
Merge branch 'maint-0.2.8'

9 years agoAppease lint-changes script.
Nick Mathewson [Tue, 5 Jul 2016 16:57:43 +0000 (12:57 -0400)] 
Appease lint-changes script.

9 years agoMerge branch 'maint-0.2.8'
Nick Mathewson [Tue, 5 Jul 2016 16:52:30 +0000 (12:52 -0400)] 
Merge branch 'maint-0.2.8'

9 years agoRepair unit test that assumed we have 9 dirauths.
Nick Mathewson [Tue, 5 Jul 2016 16:52:19 +0000 (12:52 -0400)] 
Repair unit test that assumed we have 9 dirauths.

9 years agoMerge branch 'maint-0.2.8'
Nick Mathewson [Tue, 5 Jul 2016 16:43:17 +0000 (12:43 -0400)] 
Merge branch 'maint-0.2.8'

9 years agoMerge remote-tracking branch 'weasel/bug19557' into maint-0.2.8
Nick Mathewson [Tue, 5 Jul 2016 16:40:25 +0000 (12:40 -0400)] 
Merge remote-tracking branch 'weasel/bug19557' into maint-0.2.8

9 years agoMerge remote-tracking branch 'weasel/bug19556' into maint-0.2.8
Nick Mathewson [Tue, 5 Jul 2016 16:39:40 +0000 (12:39 -0400)] 
Merge remote-tracking branch 'weasel/bug19556' into maint-0.2.8

9 years agoRun asciidoc in UTC timezone for build reproducibility.
intrigeri [Sun, 3 Jul 2016 18:44:13 +0000 (18:44 +0000)] 
Run asciidoc in UTC timezone for build reproducibility.

asciidoc adds a timestamp at the end of a generated HTML file.
This timestamp is based on the date of the file but it can change
depending on the TZ environment variable.

9 years agoMerge branch 'maint-0.2.8'
Nick Mathewson [Tue, 5 Jul 2016 16:23:25 +0000 (12:23 -0400)] 
Merge branch 'maint-0.2.8'

9 years agoMerge branch 'maint-0.2.7' into maint-0.2.8
Nick Mathewson [Tue, 5 Jul 2016 16:23:14 +0000 (12:23 -0400)] 
Merge branch 'maint-0.2.7' into maint-0.2.8

9 years agoMerge branch 'maint-0.2.6' into maint-0.2.7
Nick Mathewson [Tue, 5 Jul 2016 16:22:47 +0000 (12:22 -0400)] 
Merge branch 'maint-0.2.6' into maint-0.2.7

9 years agoMerge branch 'maint-0.2.5' into maint-0.2.6
Nick Mathewson [Tue, 5 Jul 2016 16:21:25 +0000 (12:21 -0400)] 
Merge branch 'maint-0.2.5' into maint-0.2.6

9 years agoMerge branch 'maint-0.2.4' into maint-0.2.5
Nick Mathewson [Tue, 5 Jul 2016 16:20:42 +0000 (12:20 -0400)] 
Merge branch 'maint-0.2.4' into maint-0.2.5

9 years agoMerge remote-tracking branch 'asn/bug19555'
Nick Mathewson [Tue, 5 Jul 2016 16:17:21 +0000 (12:17 -0400)] 
Merge remote-tracking branch 'asn/bug19555'

9 years agoMerge remote-tracking branch 'dgoulet/bug19567_029_01'
Nick Mathewson [Tue, 5 Jul 2016 16:14:04 +0000 (12:14 -0400)] 
Merge remote-tracking branch 'dgoulet/bug19567_029_01'

9 years agoMerge remote-tracking branch 'asn/bug19551'
Nick Mathewson [Tue, 5 Jul 2016 16:12:09 +0000 (12:12 -0400)] 
Merge remote-tracking branch 'asn/bug19551'

9 years agoGrammar.
Nick Mathewson [Tue, 5 Jul 2016 16:10:12 +0000 (12:10 -0400)] 
Grammar.

I grepped and hand-inspected the "it's" instances, to see if any
were supposed to be possessive.  While doing that, I found a
"the the", so I grepped to see if there were any more.

9 years agoRemove src/or/eventdns_tor.h based on cypherpunk's review
Sebastian Hahn [Mon, 4 Jul 2016 19:39:43 +0000 (21:39 +0200)] 
Remove src/or/eventdns_tor.h based on cypherpunk's review

9 years agosr: add the base16 RSA identity digest to commit
David Goulet [Mon, 4 Jul 2016 16:05:48 +0000 (12:05 -0400)] 
sr: add the base16 RSA identity digest to commit

Keep the base16 representation of the RSA identity digest in the commit object
so we can use it without using hex_str() or dynamically encoding it everytime
we need it. It's used extensively in the logs for instance.

Fixes #19561

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agosr: Fix comment in shared_random.h
David Goulet [Mon, 4 Jul 2016 15:44:10 +0000 (11:44 -0400)] 
sr: Fix comment in shared_random.h

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agotest: Fix shared random buffer overrun
David Goulet [Mon, 4 Jul 2016 15:40:06 +0000 (11:40 -0400)] 
test: Fix shared random buffer overrun

Encoded commit has an extra byte at the end for the NUL terminated byte and
the test was overrunning the payload buffer by one byte.

Found by Coverity issue 1362984.

Fixes #19567

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoAdd changes file for libevent version requirement
Sebastian Hahn [Mon, 4 Jul 2016 15:35:11 +0000 (17:35 +0200)] 
Add changes file for libevent version requirement

9 years agosr: Remove useless code in disk_state_update()
David Goulet [Mon, 4 Jul 2016 15:33:41 +0000 (11:33 -0400)] 
sr: Remove useless code in disk_state_update()

This patch also updates a comment in the same function for accuracy.

Found by Coverity issue 1362985. Partily fixes #19567.

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoprop250: Fix voting_schedule_t memleak in sr_state_update().
George Kadianakis [Mon, 4 Jul 2016 09:36:53 +0000 (12:36 +0300)] 
prop250: Fix voting_schedule_t memleak in sr_state_update().

9 years agoprop250: Plug TorVersion memleak in disk_state_reset().
George Kadianakis [Mon, 4 Jul 2016 09:28:28 +0000 (12:28 +0300)] 
prop250: Plug TorVersion memleak in disk_state_reset().

9 years agoAddress review comments from cypherpunks
Sebastian Hahn [Mon, 4 Jul 2016 14:27:46 +0000 (16:27 +0200)] 
Address review comments from cypherpunks

9 years agoRaise libevent dependency to 2.0.10-stable or newer
Sebastian Hahn [Sun, 3 Jul 2016 17:42:36 +0000 (19:42 +0200)] 
Raise libevent dependency to 2.0.10-stable or newer

Only some very ancient distributions don't ship with Libevent 2 anymore,
even the oldest supported Ubuntu LTS version has it. This allows us to
get rid of a lot of compat code.

9 years agoRemove two wrong comments
Sebastian Hahn [Mon, 4 Jul 2016 07:57:36 +0000 (09:57 +0200)] 
Remove two wrong comments

9 years agoRemove urras as a default trusted directory authority
Sebastian Hahn [Sun, 3 Jul 2016 19:56:39 +0000 (21:56 +0200)] 
Remove urras as a default trusted directory authority

It had been a directory authority since 0.2.1.20.

9 years agosandboxing: allow writing to stats/hidserv-stats
Peter Palfrader [Sun, 3 Jul 2016 16:03:26 +0000 (18:03 +0200)] 
sandboxing: allow writing to stats/hidserv-stats

Our sandboxing code would not allow us to write to stats/hidserv-stats,
causing tor to abort while trying to write stats.  This was previously
masked by bug#19556.

9 years agoNote which bug this fixes in the changes entry
Peter Palfrader [Sun, 3 Jul 2016 16:04:33 +0000 (18:04 +0200)] 
Note which bug this fixes in the changes entry

9 years agosandboxing: allow open() of stats dir
Peter Palfrader [Sun, 3 Jul 2016 15:47:45 +0000 (17:47 +0200)] 
sandboxing: allow open() of stats dir

When sandboxing is enabled, we could not write any stats to disk.
check_or_create_data_subdir("stats"), which prepares the private stats
directory, calls check_private_dir(), which also opens and not just stats() the
directory.  Therefore, we need to also allow open() for the stats dir in our
sandboxing setup.

9 years agoRemove HAVE_EVENT_H from winconfig
Sebastian Hahn [Sun, 3 Jul 2016 02:34:38 +0000 (04:34 +0200)] 
Remove HAVE_EVENT_H from winconfig

This was accidentally left in in f25e2167f556.

9 years agoRemove HAVE_EVENT_* defines from winconfig
Sebastian Hahn [Sun, 3 Jul 2016 02:32:54 +0000 (04:32 +0200)] 
Remove HAVE_EVENT_* defines from winconfig

They were accidentally left sitting around in 517e0f965.

9 years agoFix edge case fail of shared random unittest.
George Kadianakis [Fri, 1 Jul 2016 23:49:59 +0000 (02:49 +0300)] 
Fix edge case fail of shared random unittest.

The test_state_update() test would fail if you run it between 23:30 and
00:00UTC in the following line because n_protocol_runs was 2:

  tt_u64_op(state->n_protocol_runs, ==, 1);

The problem is that when you launch the test at 23:30UTC (reveal phase),
sr_state_update() gets called from sr_state_init() and it will prepare
the state for the voting round at 00:00UTC (commit phase). Since we
transition from reveal to commit phase, this would trigger a phase
transition and increment the n_protocol_runs counter.

The solution is to initialize the n_protocol_runs to 0 explicitly in the
beginning of the test, as we do for n_reveal_rounds, n_commit_rounds etc.

9 years agoKeep make check-spaces happy
Andrea Shepard [Fri, 1 Jul 2016 21:52:32 +0000 (21:52 +0000)] 
Keep make check-spaces happy

9 years agoWindows open() returns eacces when eisdir would be sane
Nick Mathewson [Fri, 1 Jul 2016 20:23:06 +0000 (16:23 -0400)] 
Windows open() returns eacces when eisdir would be sane

9 years agoFix i386 conversion warnings
Nick Mathewson [Fri, 1 Jul 2016 19:52:57 +0000 (15:52 -0400)] 
Fix i386 conversion warnings

9 years agoFix a -Wmissing-variable-declarations warning
Nick Mathewson [Fri, 1 Jul 2016 19:30:12 +0000 (15:30 -0400)] 
Fix a -Wmissing-variable-declarations warning

9 years agoMerge remote-tracking branch 'dgoulet/ticket16943_029_05-squashed'
Nick Mathewson [Fri, 1 Jul 2016 19:29:05 +0000 (15:29 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket16943_029_05-squashed'

Trivial Conflicts:
src/or/or.h
src/or/routerparse.c

9 years agoprop250: Add a DEL state action and return const SRVs
David Goulet [Wed, 29 Jun 2016 19:32:51 +0000 (15:32 -0400)] 
prop250: Add a DEL state action and return const SRVs

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>
9 years agoprop250: Use the new dirvote_get_intermediate_param_value for AuthDirNumSRVAgreements
David Goulet [Thu, 26 May 2016 19:26:09 +0000 (15:26 -0400)] 
prop250: Use the new dirvote_get_intermediate_param_value for AuthDirNumSRVAgreements

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoRefactor parameter computation and add a helper function
Nick Mathewson [Tue, 10 May 2016 00:10:43 +0000 (20:10 -0400)] 
Refactor parameter computation and add a helper function

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.

9 years agoprop250: Fix format string encoding in log statement
David Goulet [Thu, 26 May 2016 16:30:00 +0000 (12:30 -0400)] 
prop250: Fix format string encoding in log statement

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>
9 years agoprop250: Change reveal_num to uint64_t and version to uint32_t
David Goulet [Thu, 26 May 2016 16:25:01 +0000 (12:25 -0400)] 
prop250: Change reveal_num to uint64_t and version to uint32_t

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoprop250: Don't use {0} to init static struct -- causes warning on clang.
George Kadianakis [Wed, 25 May 2016 09:28:40 +0000 (12:28 +0300)] 
prop250: Don't use {0} to init static struct -- causes warning on clang.

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.

9 years agoprop250: Silence a logging message.
George Kadianakis [Tue, 24 May 2016 10:58:20 +0000 (13:58 +0300)] 
prop250: Silence a logging message.

LOG_NOTICE is a bit too much for that one.

9 years agoprop250: Don't reject votes containing commits of unknown dirauths.
George Kadianakis [Tue, 24 May 2016 10:56:39 +0000 (13:56 +0300)] 
prop250: Don't reject votes containing commits of unknown dirauths.

Instead just ignore those commits.

Squash this commit with 33b2ade.

9 years agoprop250: Pass the dst length to sr_srv_encode()
David Goulet [Tue, 17 May 2016 20:10:20 +0000 (16:10 -0400)] 
prop250: Pass the dst length to sr_srv_encode()

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoprop250: Fix unit tests about the RSA fingerprint check
David Goulet [Thu, 12 May 2016 17:30:07 +0000 (13:30 -0400)] 
prop250: Fix unit tests about the RSA fingerprint check

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>
9 years agoprop250: Sort commits in lexicographical order in votes
David Goulet [Tue, 17 May 2016 19:13:13 +0000 (15:13 -0400)] 
prop250: Sort commits in lexicographical order in votes

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoprop250: Improve log messages
David Goulet [Tue, 17 May 2016 19:05:32 +0000 (15:05 -0400)] 
prop250: Improve log messages

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoprop250: Sort smartlist before you get most frequent SRV.
George Kadianakis [Fri, 13 May 2016 17:42:33 +0000 (13:42 -0400)] 
prop250: Sort smartlist before you get most frequent SRV.

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoprop250: Only trust known authority when computing SRV
David Goulet [Wed, 11 May 2016 20:02:18 +0000 (16:02 -0400)] 
prop250: Only trust known authority when computing SRV

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoprop250: Add version to Commit line in vote and state
David Goulet [Wed, 11 May 2016 14:21:34 +0000 (10:21 -0400)] 
prop250: Add version to Commit line in vote and state

Signed-off-by: David Goulet <dgoulet@torproject.org>
9 years agoprop250: Add a valid flag to sr_commit_t
David Goulet [Tue, 10 May 2016 15:37:28 +0000 (11:37 -0400)] 
prop250: Add a valid flag to sr_commit_t

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>
9 years agoprop250: Use RSA identity digest instead of fingerprint
David Goulet [Mon, 9 May 2016 22:58:19 +0000 (18:58 -0400)] 
prop250: Use RSA identity digest instead of fingerprint

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>
9 years agoprop250: change time_t to uint64_t
David Goulet [Mon, 9 May 2016 20:51:32 +0000 (16:51 -0400)] 
prop250: change time_t to uint64_t

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
9 years agoprop250: Add changes file
David Goulet [Tue, 3 May 2016 15:47:13 +0000 (11:47 -0400)] 
prop250: Add changes file

Fixes #16943

Signed-off-by: David Goulet <dgoulet@torproject.org>
Signed-off-by: George Kadianakis <desnacked@riseup.net>
9 years agoprop250: Add unit tests
David Goulet [Tue, 3 May 2016 15:42:50 +0000 (11:42 -0400)] 
prop250: Add unit tests

Signed-off-by: David Goulet <dgoulet@torproject.org>
Signed-off-by: George Kadianakis <desnacked@riseup.net>
9 years agoprop250: Initialize the SR subsystem and us it!
David Goulet [Tue, 3 May 2016 15:44:26 +0000 (11:44 -0400)] 
prop250: Initialize the SR subsystem and us it!

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>
9 years agoprop250: Parse votes and consensus
David Goulet [Tue, 3 May 2016 15:36:09 +0000 (11:36 -0400)] 
prop250: Parse votes and consensus

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>
9 years agoprop250: Put commits and SRVs in votes/consensus
David Goulet [Tue, 3 May 2016 15:21:17 +0000 (11:21 -0400)] 
prop250: Put commits and SRVs in votes/consensus

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>
9 years agoprop250: Add commit and SR values generation code
David Goulet [Tue, 3 May 2016 14:57:49 +0000 (10:57 -0400)] 
prop250: Add commit and SR values generation code

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>