]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
10 years agoRename cast_double_to_int64 to clamp_double_to_int64
Nick Mathewson [Thu, 9 Jul 2015 20:54:17 +0000 (16:54 -0400)] 
Rename cast_double_to_int64 to clamp_double_to_int64

10 years agoMake round_to_next_multiple_of always round upwards.
Nick Mathewson [Thu, 12 Nov 2015 16:32:14 +0000 (11:32 -0500)] 
Make round_to_next_multiple_of always round upwards.

Yes, even if it has to return a non-multiple.  This prevents us from
ever having a bug where we try to use it for allocation, and under-allocate.

10 years agoRemove test for strclear as it no longer exists in the codebase
teor [Wed, 6 May 2015 08:27:26 +0000 (18:27 +1000)] 
Remove test for strclear as it no longer exists in the codebase

10 years agoUse standard float.h header and resolve undefined left shift behaviour
teor [Fri, 27 Mar 2015 09:37:07 +0000 (20:37 +1100)] 
Use standard float.h header and resolve undefined left shift behaviour

10 years agoAdd unit tests for cast_double_to_int64().
teor [Wed, 6 May 2015 08:08:18 +0000 (18:08 +1000)] 
Add unit tests for cast_double_to_int64().

10 years agoAdd an util function to cast double to int64_t
David Goulet [Mon, 16 Feb 2015 20:55:30 +0000 (15:55 -0500)] 
Add an util function to cast double to int64_t

Use it in the sample_laplace_distribution function to make sure we return
the correct converted value after math operations are done on the input
values.

Thanks to Yawning for proposing a solution.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoTweak teor's and dgoulet's #13192 patches.
Karsten Loesing [Fri, 13 Feb 2015 10:32:35 +0000 (11:32 +0100)] 
Tweak teor's and dgoulet's #13192 patches.

 - Rewrite changes file.
 - Avoid float comparison with == and use <= instead.
 - Add teor's tor_llround(trunc(...)) back to silence clang warnings.
 - Replace tt_assert() with tt_i64_op() and friends.
 - Fix whitespace and a comment.

10 years agoFix hs stats comments to be more accurate
David Goulet [Thu, 12 Feb 2015 16:39:49 +0000 (11:39 -0500)] 
Fix hs stats comments to be more accurate

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoTest: change INT64_MAX to DBL_MAX in laplace test
David Goulet [Thu, 12 Feb 2015 16:36:35 +0000 (11:36 -0500)] 
Test: change INT64_MAX to DBL_MAX in laplace test

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoTest: remove edge cases that assert in laplace test
David Goulet [Thu, 12 Feb 2015 16:31:08 +0000 (11:31 -0500)] 
Test: remove edge cases that assert in laplace test

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoHandle edge cases in the round_*_to_next_multiple_of functions
teor [Thu, 25 Dec 2014 09:52:10 +0000 (20:52 +1100)] 
Handle edge cases in the round_*_to_next_multiple_of functions

Consistently check for overflow in round_*_to_next_multiple_of.

Check all round_*_to_next_multiple_of functions with expected values.
Check all round_*_to_next_multiple_of functions with maximal values.

Related to HS stats in #13192.

10 years agoHandle edge cases in laplace functions
teor [Thu, 25 Dec 2014 09:30:18 +0000 (20:30 +1100)] 
Handle edge cases in laplace functions

Avoid division by zero.
Avoid taking the log of zero.
Silence clang type conversion warnings using round and trunc.
The existing values returned by the laplace functions do not change.

Add tests for laplace edge cases.
These changes pass the existing unit tests without modification.

Related to HS stats in #13192.

10 years agoMerge branch 'feature3523_027'
Nick Mathewson [Mon, 4 May 2015 15:41:50 +0000 (11:41 -0400)] 
Merge branch 'feature3523_027'

10 years agoAdd "+HSPOST" and related "HS_DESC" event flags to the controller.
Donncha O'Cearbhaill [Sun, 22 Mar 2015 13:31:53 +0000 (13:31 +0000)] 
Add "+HSPOST" and related "HS_DESC" event flags to the controller.

"+HSPOST" and the related event changes allow the uploading of HS
descriptors via the control port, and more comprehensive event
monitoring of HS descriptor upload status.

10 years agoMake `GETINFO hs/client/desc/id/<identifier>` actually work (#14845).
Yawning Angel [Sat, 2 May 2015 11:45:46 +0000 (11:45 +0000)] 
Make `GETINFO hs/client/desc/id/<identifier>` actually work (#14845).

Not in any released version of tor.

10 years agoreformat 0.2.7.1-alpha changelog
Nick Mathewson [Thu, 30 Apr 2015 19:30:20 +0000 (15:30 -0400)] 
reformat 0.2.7.1-alpha changelog

10 years agoMove changes entries into changelog for 0.2.7.1-alpha
Nick Mathewson [Thu, 30 Apr 2015 19:29:56 +0000 (15:29 -0400)] 
Move changes entries into changelog for 0.2.7.1-alpha

10 years agoMake lintChanges happy
Nick Mathewson [Thu, 30 Apr 2015 19:11:19 +0000 (15:11 -0400)] 
Make lintChanges happy

10 years agoremove changes files for already-moved things
Nick Mathewson [Thu, 30 Apr 2015 19:04:41 +0000 (15:04 -0400)] 
remove changes files for already-moved things

10 years agowhitespace fixes
Nick Mathewson [Thu, 30 Apr 2015 17:38:39 +0000 (13:38 -0400)] 
whitespace fixes

10 years agocompilation fix: signed/unsigned comparison
Nick Mathewson [Thu, 30 Apr 2015 17:36:45 +0000 (13:36 -0400)] 
compilation fix: signed/unsigned comparison

10 years agoMerge branch 'bug15814_027_04'
Nick Mathewson [Thu, 30 Apr 2015 17:32:52 +0000 (13:32 -0400)] 
Merge branch 'bug15814_027_04'

10 years agoUpdate descriptor ID when it changes in rend_data
David Goulet [Tue, 28 Apr 2015 14:22:14 +0000 (10:22 -0400)] 
Update descriptor ID when it changes in rend_data

When we have a new descriptor ID for an onion address request, change it in
the rend_data_t object and purge the old one from the last hid serv request
cache.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoUse descriptor ID when purging last hid fetch cache
David Goulet [Mon, 27 Apr 2015 20:21:47 +0000 (16:21 -0400)] 
Use descriptor ID when purging last hid fetch cache

Stop using an onion address since it's not indexed with that anymore in the
last hid serv request cache. Instead use a base32 encoded descriptor ID
contained in the rend_data_t object.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoUse rend_data_client/service_create() in code
David Goulet [Mon, 27 Apr 2015 19:08:31 +0000 (15:08 -0400)] 
Use rend_data_client/service_create() in code

Every callsite that use to allocate a rend_data_t object now use the
rend_data_client/service_create() function.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoAdd a create function for rend_data_t object
David Goulet [Tue, 28 Apr 2015 15:01:58 +0000 (11:01 -0400)] 
Add a create function for rend_data_t object

Ground works for fixing #15816. This adds the rend_data_create() function in
order to have a single place where we initialize that data structure.

Furthermore, an array of descriptor IDs is added (one per replica) so we can
keep a copy of the current id in the object. It will be used to purge the
last hid serv request cache using those descriptor IDs. When they change,
they will be replaced and the old ones will be purged from the cache.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoAdd missing newline in memwipe test.
cypherpunks [Fri, 24 Apr 2015 08:19:22 +0000 (10:19 +0200)] 
Add missing newline in memwipe test.

10 years agoMerge remote-tracking branch 'origin/maint-0.2.6'
Nick Mathewson [Tue, 28 Apr 2015 18:46:53 +0000 (14:46 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.6'

10 years agoRevert "Remove obsolete workaround in dirserv_thinks_router_is_hs_dir()"
David Goulet [Tue, 28 Apr 2015 18:22:49 +0000 (14:22 -0400)] 
Revert "Remove obsolete workaround in dirserv_thinks_router_is_hs_dir()"

Fixes #15850, part of #15801. Change file is added by this commit. The
original comment in the reverted commit is removed because right now we
*need* a DirPort until #15849 is implemented so no doubt nor confusion there
anymore.

This reverts commit 80bed1ac96a3035f8c55ddced5528f0d7d16d386.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoFix another test failure
Nick Mathewson [Tue, 28 Apr 2015 14:47:37 +0000 (10:47 -0400)] 
Fix another test failure

We need the test scripts to become +x *after* they are created.

10 years agoMerge branch 'feature6411_v4'
Nick Mathewson [Tue, 28 Apr 2015 14:19:16 +0000 (10:19 -0400)] 
Merge branch 'feature6411_v4'

10 years agoAdd "ADD_ONION"/"DEL_ONION" and "GETINFO onions/*" to the controller.
Yawning Angel [Sat, 25 Apr 2015 08:23:15 +0000 (08:23 +0000)] 
Add "ADD_ONION"/"DEL_ONION" and "GETINFO onions/*" to the controller.

These commands allow for the creation and management of ephemeral
Onion ("Hidden") services that are either bound to the lifetime of
the originating control connection, or optionally the lifetime of
the tor instance.

Implements #6411.

10 years agoMerge remote-tracking branch 'origin/maint-0.2.6'
Nick Mathewson [Mon, 27 Apr 2015 18:18:31 +0000 (14:18 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.6'

10 years agoMerge remote-tracking branch 'origin/maint-0.2.5' into maint-0.2.6
Nick Mathewson [Mon, 27 Apr 2015 18:18:16 +0000 (14:18 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.5' into maint-0.2.6

10 years agoMerge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5
Nick Mathewson [Mon, 27 Apr 2015 18:16:55 +0000 (14:16 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5

10 years agoMerge remote-tracking branch 'karsten/geoip6-apr2015' into maint-0.2.4
Nick Mathewson [Mon, 27 Apr 2015 18:15:58 +0000 (14:15 -0400)] 
Merge remote-tracking branch 'karsten/geoip6-apr2015' into maint-0.2.4

10 years agoMerge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4
Nick Mathewson [Mon, 27 Apr 2015 18:15:44 +0000 (14:15 -0400)] 
Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4

10 years agoMark set-test-permissions as .PHONY; use u+x only
Nick Mathewson [Fri, 24 Apr 2015 20:10:34 +0000 (16:10 -0400)] 
Mark set-test-permissions as .PHONY; use u+x only

10 years agoRevert "Add +x to these .in files; see if it helps"
Nick Mathewson [Fri, 24 Apr 2015 20:05:41 +0000 (16:05 -0400)] 
Revert "Add +x to these .in files; see if it helps"

This reverts commit ecf98313d673f010b52f8d29c352cd9b8f145734.

It didn't help.

10 years agoUpdate geoip6 to the April 8 2015 database.
Karsten Loesing [Fri, 24 Apr 2015 15:51:36 +0000 (17:51 +0200)] 
Update geoip6 to the April 8 2015 database.

10 years agoUpdate geoip to the April 8 2015 database.
Karsten Loesing [Fri, 24 Apr 2015 15:49:45 +0000 (17:49 +0200)] 
Update geoip to the April 8 2015 database.

10 years agoKludge include.am to work with automake <1.12
Nick Mathewson [Fri, 24 Apr 2015 12:41:53 +0000 (08:41 -0400)] 
Kludge include.am to work with automake <1.12

The SH_LOG_COMPILER feature doesn't work with older automakes, and
those are still in use in many environments we want to support
development on, like Debian Stable.

Instead, use autoconf substitution to fill out the shebang lines on
the shell scripts, and an intermediate make target to make them
executable.

This is a bugfix on the patches for #15344.  Bug not in any released
tor.

10 years agoAdd +x to these .in files; see if it helps
Nick Mathewson [Thu, 23 Apr 2015 20:15:21 +0000 (16:15 -0400)] 
Add +x to these .in files; see if it helps

10 years agoMake a return value explicitly ignored.
Nick Mathewson [Thu, 23 Apr 2015 17:04:37 +0000 (13:04 -0400)] 
Make a return value explicitly ignored.

This might make coverity happy

10 years agochanges for 14847
Nick Mathewson [Thu, 23 Apr 2015 16:27:27 +0000 (12:27 -0400)] 
changes for 14847

10 years agoMerge remote-tracking branch 'dgoulet/bug14847_027_06'
Nick Mathewson [Thu, 23 Apr 2015 16:24:35 +0000 (12:24 -0400)] 
Merge remote-tracking branch 'dgoulet/bug14847_027_06'

10 years agoFix some RNG function issues
Nick Mathewson [Thu, 23 Apr 2015 15:13:51 +0000 (11:13 -0400)] 
Fix some RNG function issues

10 years agoMerge remote-tracking branch 'teor/longest-policy-comment'
Nick Mathewson [Thu, 23 Apr 2015 15:05:24 +0000 (11:05 -0400)] 
Merge remote-tracking branch 'teor/longest-policy-comment'

10 years agoMerge remote-tracking branch 'public/remove_old_libevent_autoconf_stuff'
Nick Mathewson [Thu, 23 Apr 2015 14:27:01 +0000 (10:27 -0400)] 
Merge remote-tracking branch 'public/remove_old_libevent_autoconf_stuff'

10 years agoFix crash-test for assertion failure
Nick Mathewson [Thu, 23 Apr 2015 14:25:16 +0000 (10:25 -0400)] 
Fix crash-test for assertion failure

When we made assertions not get compiled in for the coverage case, we
missed one case where, for our tests, we really DO want to have an
assertion fail: the backtrace test.

Bugfix on 1228dd293b60a8eaab03472fa29428c5e2752c44; bug not in any
released tor

10 years agoAdd changes file for 15344.
cypherpunks [Wed, 18 Mar 2015 15:45:48 +0000 (16:45 +0100)] 
Add changes file for 15344.

10 years agoCorrect "longest possible policy" comment in router policy
teor [Thu, 23 Apr 2015 13:51:59 +0000 (23:51 +1000)] 
Correct "longest possible policy" comment in router policy

The "longest possible policy" comment in
router_parse_addr_policy_item_from_string() used an example policy
that was actually shorter than the maximum length.

This comment was amended, and expanded to count the maximum number of
characters.

Comment change only.

10 years agoIntegrate backtrace test into the automake test suite.
cypherpunks [Thu, 5 Mar 2015 10:05:17 +0000 (11:05 +0100)] 
Integrate backtrace test into the automake test suite.

For this to work bt_test.py now returns an exit code indicating success or
failure. Additionally, check-local and its specific dependencies are now
obsolete so they are removed.

10 years agoIntegrate ntor test into the automake test suite.
cypherpunks [Thu, 5 Mar 2015 09:43:12 +0000 (10:43 +0100)] 
Integrate ntor test into the automake test suite.

10 years agoIntegrate zero_length_keys test into the automake test suite.
cypherpunks [Thu, 5 Mar 2015 08:03:06 +0000 (09:03 +0100)] 
Integrate zero_length_keys test into the automake test suite.

The zero length keys test now requires the path to the Tor binary as the first
parameter to ensure the correct Tor binary is used without hard coding a path.

The wrapper script calls the zero length keys test for each test separately to
ensure the correct shell is used (as configured by autoconf). Another solution
would have been to place the tests into separate functions so multiple tests
could be run internally. This would have made a diff of considerable size and
frankly it is outside the scope of this fix.

10 years agoMerge remote-tracking branch 'public/bug15546'
Nick Mathewson [Thu, 23 Apr 2015 13:50:29 +0000 (09:50 -0400)] 
Merge remote-tracking branch 'public/bug15546'

10 years agowhitespace fixes
Nick Mathewson [Thu, 23 Apr 2015 13:36:43 +0000 (09:36 -0400)] 
whitespace fixes

10 years agoMerge remote-tracking branch 'andrea/ticket14840'
Nick Mathewson [Thu, 23 Apr 2015 13:34:00 +0000 (09:34 -0400)] 
Merge remote-tracking branch 'andrea/ticket14840'

10 years agochanges file for 14845
Nick Mathewson [Thu, 23 Apr 2015 13:27:59 +0000 (09:27 -0400)] 
changes file for 14845

10 years agoAvoid memory leak in error messages in control.c (not in any tor)
Nick Mathewson [Thu, 23 Apr 2015 13:26:31 +0000 (09:26 -0400)] 
Avoid memory leak in error messages in control.c (not in any tor)

10 years agoMerge remote-tracking branch 'dgoulet/bug14845_026_01'
Nick Mathewson [Thu, 23 Apr 2015 13:25:00 +0000 (09:25 -0400)] 
Merge remote-tracking branch 'dgoulet/bug14845_026_01'

10 years agoMerge remote-tracking branch 'teor/bug-15642-v3-fallback-unit-tests'
Nick Mathewson [Thu, 23 Apr 2015 13:22:16 +0000 (09:22 -0400)] 
Merge remote-tracking branch 'teor/bug-15642-v3-fallback-unit-tests'

10 years agoFix another signed/unsigned comparison bug
Nick Mathewson [Thu, 23 Apr 2015 13:21:44 +0000 (09:21 -0400)] 
Fix another signed/unsigned comparison bug

10 years agoFix some conversion problems
Nick Mathewson [Thu, 23 Apr 2015 13:16:42 +0000 (09:16 -0400)] 
Fix some conversion problems

10 years agoMerge remote-tracking branch 'public/bug15745_027_03'
Nick Mathewson [Thu, 23 Apr 2015 13:10:35 +0000 (09:10 -0400)] 
Merge remote-tracking branch 'public/bug15745_027_03'

10 years agoMerge branch 'feature15652_squashed'
Nick Mathewson [Thu, 23 Apr 2015 13:09:33 +0000 (09:09 -0400)] 
Merge branch 'feature15652_squashed'

10 years agoFix some implicit conversion warnings
Nick Mathewson [Thu, 23 Apr 2015 13:09:20 +0000 (09:09 -0400)] 
Fix some implicit conversion warnings

10 years agoUse a custom Base64 encoder with more control over the output format.
Yawning Angel [Fri, 10 Apr 2015 11:25:08 +0000 (11:25 +0000)] 
Use a custom Base64 encoder with more control over the output format.

10 years agoMerge remote-tracking branch 'teor/bug-15771-reachability'
Nick Mathewson [Thu, 23 Apr 2015 13:04:53 +0000 (09:04 -0400)] 
Merge remote-tracking branch 'teor/bug-15771-reachability'

10 years agoMerge remote-tracking branch 'yawning/bug15759'
Nick Mathewson [Thu, 23 Apr 2015 13:02:55 +0000 (09:02 -0400)] 
Merge remote-tracking branch 'yawning/bug15759'

10 years agoUnit tests for consider_adding_dir_servers() as modified in #15642
teor [Wed, 15 Apr 2015 09:02:29 +0000 (19:02 +1000)] 
Unit tests for consider_adding_dir_servers() as modified in #15642

Unit tests for the 10 valid combinations of set/NULL config options
DirAuthorities, AlternateBridgeAuthority, AlternateDirAuthority,
and FallbackDir.

Add assertion in consider_adding_dir_servers() for checks in
validate_dir_servers():
"You cannot set both DirAuthority and Alternate*Authority."

10 years agoDisable default fallback directories when other directories are set
teor [Thu, 9 Apr 2015 06:37:33 +0000 (16:37 +1000)] 
Disable default fallback directories when other directories are set

Only add the default fallback directories when the DirAuthorities,
AlternateDirAuthority, and FallbackDir directory config options
are set to their defaults.

The default fallback directory list is currently empty, this fix will
only change tor's behaviour when it has default fallback directories.

Fixes bug 15642; bugfix on 90f6071d8dc0 in 0.2.4.7-alpha. Patch by "teor".

10 years agoReachability should check ExtendAllowPrivateAddresses not TestingTorNetwork
teor [Wed, 22 Apr 2015 13:54:21 +0000 (23:54 +1000)] 
Reachability should check ExtendAllowPrivateAddresses not TestingTorNetwork

When self-testing reachability, use ExtendAllowPrivateAddresses
to determine if local/private addresses imply reachability.

The previous fix used TestingTorNetwork, which implies
ExtendAllowPrivateAddresses, but this excluded rare configs where
ExtendAllowPrivateAddresses is set but TestingTorNetwork is not.

Fixes bug 15771; bugfix on 0.2.6.1-alpha, bug #13924.
Patch by "teor", issue discovered by CJ Ess.

10 years agoNew email for Lukas Fleischer
Nick Mathewson [Wed, 22 Apr 2015 13:49:23 +0000 (09:49 -0400)] 
New email for Lukas Fleischer

10 years agoAdd function to validate HS descriptor ID
David Goulet [Tue, 21 Apr 2015 18:04:39 +0000 (14:04 -0400)] 
Add function to validate HS descriptor ID

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoMultiple fixes for the HSFETCH command
David Goulet [Mon, 23 Mar 2015 17:07:51 +0000 (13:07 -0400)] 
Multiple fixes for the HSFETCH command

Ref:
https://trac.torproject.org/projects/tor/ticket/14847?replyto=31#comment:31

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoUse rend_valid_service_id() in the HSFETCH command
David Goulet [Mon, 23 Mar 2015 17:13:57 +0000 (13:13 -0400)] 
Use rend_valid_service_id() in the HSFETCH command

Also, fix a small typo in a comment.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoTest: fix HSFETCH control command with latest change
David Goulet [Sun, 15 Mar 2015 14:35:31 +0000 (10:35 -0400)] 
Test: fix HSFETCH control command with latest change

The expected message of the command now expects "650+" and "650 OK".

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoControl: make HSFETCH command use LongName
David Goulet [Sun, 15 Mar 2015 14:29:02 +0000 (10:29 -0400)] 
Control: make HSFETCH command use LongName

The "SERVER=" option now supports LongName described in the control-spec.txt

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoControl: add + and 650 OK to HS_DESC_CONTENT event
David Goulet [Sun, 15 Mar 2015 14:20:11 +0000 (10:20 -0400)] 
Control: add + and 650 OK to HS_DESC_CONTENT event

The HS_DESC_CONTENT event results in multiple line thus must be prefixed
with a "650+" and ending with "650 OK".

Reported-by: Damian Johnson <atagar@torproject.org>
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoControl: unbolt rend_data from HS desc event
David Goulet [Wed, 11 Mar 2015 18:52:28 +0000 (14:52 -0400)] 
Control: unbolt rend_data from HS desc event

The HS_DESC event was using rend_data_t from the dir connection to reply the
onion address and authentication type. With the new HSFETCH command, it's
now possible to fetch a descriptor only using the descriptor id thus
resulting in not having an onion address in any HS_DESC event.

This patch removes rend_query from the hs desc control functions and replace
it by an onion address string and an auth type.

On a successful fetch, the service id is taken from the fetched descriptor.
For that, an extra parameter is added to "store as a client" function that
contains the cache entry stored.

This will make the control event functions scale more easily over time if
other values not present in rend_data_t are needed since the rend_data from
the dir connection might not contained everything we need.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoRefactor HS descriptor fetch to support descriptor ID
David Goulet [Tue, 10 Mar 2015 20:46:56 +0000 (16:46 -0400)] 
Refactor HS descriptor fetch to support descriptor ID

Big refactor of the HS client descriptor fetch functionnality. This allows
to fetch an HS descriptor using only a descriptor ID. Furthermore, it's also
possible to provide a list of HSDir(s) now that are used instead of the
automatically choosen one.

The approach taken was to add a descriptor_id field to the rend_data_t
structure so it can be used, if available, by the HS client. The onion
address field however has priority over it that is if both are set, the
onion address is used to fetch the descriptor.

A new public function is introduced called rend_client_fetch_v2_desc(...)
that does NOT lookup the client cache before fetching and can take a list of
HSDirs as a parameter.

The HSFETCH control command now uses this new function thus making it work
and final.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoControl: add HS_DESC_CONTENT event
David Goulet [Tue, 24 Feb 2015 21:17:14 +0000 (16:17 -0500)] 
Control: add HS_DESC_CONTENT event

As defined in section 4.1.26 in the control-spec.txt, this new event replies
the content of a successfully fetched HS descriptor. This also adds a unit
test for the controller event.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoControl: groud work for the HSFETCH command
David Goulet [Thu, 19 Feb 2015 19:53:41 +0000 (14:53 -0500)] 
Control: groud work for the HSFETCH command

This adds the command on the controller side that parses and validate
arguments but does nothing for now. The HS desriptor fetch must be
modularized a bit more before we can use the command.

See control-spec.txt section 3.26 for more information on this command.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoRemove onion address usage in lookup_last_hid_serv_request
David Goulet [Wed, 11 Mar 2015 17:43:07 +0000 (13:43 -0400)] 
Remove onion address usage in lookup_last_hid_serv_request

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoUse correct severity in the get_if_addrs tests.
Yawning Angel [Tue, 21 Apr 2015 16:42:07 +0000 (16:42 +0000)] 
Use correct severity in the get_if_addrs tests.

10 years agoAdd test for random-int-in-range
Nick Mathewson [Tue, 21 Apr 2015 15:41:31 +0000 (11:41 -0400)] 
Add test for random-int-in-range

10 years agoMake the crypto_rand_int_range return value right-exclusive.
Nick Mathewson [Tue, 21 Apr 2015 15:30:21 +0000 (11:30 -0400)] 
Make the crypto_rand_int_range return value right-exclusive.

10 years agoAdd crypto_rand_int_range() and use it
David Goulet [Tue, 21 Apr 2015 14:17:12 +0000 (10:17 -0400)] 
Add crypto_rand_int_range() and use it

Incidently, this fixes a bug where the maximum value was never used when
only using crypto_rand_int(). For instance this example below in
rendservice.c never gets to INTRO_POINT_LIFETIME_MAX_SECONDS.

  int intro_point_lifetime_seconds =
    INTRO_POINT_LIFETIME_MIN_SECONDS +
    crypto_rand_int(INTRO_POINT_LIFETIME_MAX_SECONDS -
                    INTRO_POINT_LIFETIME_MIN_SECONDS);

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoUse a random count of INTRODUCE2 for IP rotation
David Goulet [Mon, 20 Apr 2015 19:51:06 +0000 (15:51 -0400)] 
Use a random count of INTRODUCE2 for IP rotation

An introduction point is currently rotated when the amount of INTRODUCE2
cells reached a fixed value of 16384. This makes it pretty easy for an
attacker to inflate that number and observe when the IP rotates which leaks
the popularity of the HS (amount of client that passed through the IP).

This commit makes it a random count between the current value of 16384 and
two times that.

Fixes #15745

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
10 years agoChanges file for ticket 14840
Andrea Shepard [Fri, 17 Apr 2015 22:41:50 +0000 (22:41 +0000)] 
Changes file for ticket 14840

10 years agoAdd default DirAuthority lines to output of getinfo_helper_config(config/defaults...
Andrea Shepard [Fri, 17 Apr 2015 22:40:08 +0000 (22:40 +0000)] 
Add default DirAuthority lines to output of getinfo_helper_config(config/defaults) if not already present

10 years agoMove list of default directory authorities to file scope
Andrea Shepard [Fri, 17 Apr 2015 06:33:17 +0000 (06:33 +0000)] 
Move list of default directory authorities to file scope

10 years agocode style fixes
Nick Mathewson [Thu, 16 Apr 2015 15:17:16 +0000 (11:17 -0400)] 
code style fixes

10 years agoFix missing-initializer warning
Nick Mathewson [Thu, 16 Apr 2015 15:16:20 +0000 (11:16 -0400)] 
Fix missing-initializer warning

10 years agoMerge remote-tracking branch 'arma/ticket8766'
Nick Mathewson [Thu, 16 Apr 2015 15:15:29 +0000 (11:15 -0400)] 
Merge remote-tracking branch 'arma/ticket8766'

10 years agoFix indentation on a block
Nick Mathewson [Wed, 15 Apr 2015 15:05:09 +0000 (11:05 -0400)] 
Fix indentation on a block

10 years agoRemove spurious warn
Nick Mathewson [Wed, 15 Apr 2015 15:04:17 +0000 (11:04 -0400)] 
Remove spurious warn

10 years agoMerge remote-tracking branch 'sebastian/bug14784'
Nick Mathewson [Wed, 15 Apr 2015 15:10:37 +0000 (11:10 -0400)] 
Merge remote-tracking branch 'sebastian/bug14784'

10 years agoStop modifying const argument in handle_control_postdescriptor
Nick Mathewson [Wed, 15 Apr 2015 14:47:50 +0000 (10:47 -0400)] 
Stop modifying const argument in handle_control_postdescriptor

Fixes 15546.