Commit Graph

20276 Commits

Author SHA1 Message Date
Nick Mathewson
0694263b75 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.
2015-11-12 11:32:14 -05:00
teor
75fc4d5511 Remove test for strclear as it no longer exists in the codebase 2015-05-06 18:27:26 +10:00
teor
e60c612447 Use standard float.h header and resolve undefined left shift behaviour 2015-05-06 18:09:10 +10:00
teor
0fcd150959 Add unit tests for cast_double_to_int64(). 2015-05-06 18:08:18 +10:00
David Goulet
8acccdbeac 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>
2015-05-06 18:05:16 +10:00
Karsten Loesing
dad5eb7e1f 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.
2015-05-06 18:05:16 +10:00
David Goulet
b3832e0b7f Fix hs stats comments to be more accurate
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-05-06 18:05:16 +10:00
David Goulet
dcf0f808c0 Test: change INT64_MAX to DBL_MAX in laplace test
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-05-06 18:05:15 +10:00
David Goulet
aecc354ee7 Test: remove edge cases that assert in laplace test
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-05-06 18:05:15 +10:00
teor
09cac24373 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.
2015-05-06 18:05:15 +10:00
teor
6d54bdbdcf 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.
2015-05-06 18:05:15 +10:00
Nick Mathewson
e8db9d0c94 Merge branch 'feature3523_027' 2015-05-04 11:41:50 -04:00
Donncha O'Cearbhaill
841c4aa715 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.
2015-05-04 11:41:28 -04:00
Yawning Angel
d4729524d1 Make GETINFO hs/client/desc/id/<identifier> actually work (#14845).
Not in any released version of tor.
2015-05-02 11:45:46 +00:00
Nick Mathewson
411049d0d4 reformat 0.2.7.1-alpha changelog 2015-04-30 15:30:20 -04:00
Nick Mathewson
ef7ef4abb4 Move changes entries into changelog for 0.2.7.1-alpha 2015-04-30 15:29:56 -04:00
Nick Mathewson
174598f3ef Make lintChanges happy 2015-04-30 15:11:19 -04:00
Nick Mathewson
1640944948 remove changes files for already-moved things 2015-04-30 15:04:41 -04:00
Nick Mathewson
e8814816c7 whitespace fixes 2015-04-30 13:38:39 -04:00
Nick Mathewson
e9308a8341 compilation fix: signed/unsigned comparison 2015-04-30 13:36:45 -04:00
Nick Mathewson
41efe22c03 Merge branch 'bug15814_027_04' 2015-04-30 13:32:52 -04:00
David Goulet
a9b9f6d90f 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>
2015-04-30 12:35:21 -04:00
David Goulet
d33327ec22 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>
2015-04-30 12:35:21 -04:00
David Goulet
9a364026d3 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>
2015-04-30 12:35:21 -04:00
David Goulet
e6a581f126 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>
2015-04-30 12:35:20 -04:00
cypherpunks
26e0f8635a Add missing newline in memwipe test. 2015-04-30 12:15:34 -04:00
Nick Mathewson
7286a27cfc Merge remote-tracking branch 'origin/maint-0.2.6' 2015-04-28 14:46:53 -04:00
David Goulet
26c344a563 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 80bed1ac96.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-28 14:30:07 -04:00
Nick Mathewson
6ed5733169 Fix another test failure
We need the test scripts to become +x *after* they are created.
2015-04-28 10:47:37 -04:00
Nick Mathewson
24f170a11f Merge branch 'feature6411_v4' 2015-04-28 10:19:16 -04:00
Yawning Angel
915c7438a7 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.
2015-04-28 10:19:08 -04:00
Nick Mathewson
028cac97c1 Merge remote-tracking branch 'origin/maint-0.2.6' 2015-04-27 14:18:31 -04:00
Nick Mathewson
0ac748353a Merge remote-tracking branch 'origin/maint-0.2.5' into maint-0.2.6 2015-04-27 14:18:16 -04:00
Nick Mathewson
6c7720ed49 Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5 2015-04-27 14:16:55 -04:00
Nick Mathewson
efae1bcef6 Merge remote-tracking branch 'karsten/geoip6-apr2015' into maint-0.2.4 2015-04-27 14:15:58 -04:00
Nick Mathewson
609cdec112 Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4 2015-04-27 14:15:44 -04:00
Nick Mathewson
63a90f2df4 Mark set-test-permissions as .PHONY; use u+x only 2015-04-24 16:10:34 -04:00
Nick Mathewson
f6167f51ac Revert "Add +x to these .in files; see if it helps"
This reverts commit ecf98313d6.

It didn't help.
2015-04-24 16:05:41 -04:00
Karsten Loesing
b5f6495876 Update geoip6 to the April 8 2015 database. 2015-04-24 17:51:36 +02:00
Karsten Loesing
bcc0a48cfe Update geoip to the April 8 2015 database. 2015-04-24 17:49:45 +02:00
Nick Mathewson
d579d751dc 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.
2015-04-24 08:41:53 -04:00
Nick Mathewson
ecf98313d6 Add +x to these .in files; see if it helps 2015-04-23 16:15:21 -04:00
Nick Mathewson
b64eb6c47c Make a return value explicitly ignored.
This might make coverity happy
2015-04-23 13:05:06 -04:00
Nick Mathewson
01fa3566d5 changes for 14847 2015-04-23 12:27:27 -04:00
Nick Mathewson
54000d7ad9 Merge remote-tracking branch 'dgoulet/bug14847_027_06' 2015-04-23 12:24:35 -04:00
Nick Mathewson
9a81ed1d23 Fix some RNG function issues 2015-04-23 11:13:51 -04:00
Nick Mathewson
85eadb733f Merge remote-tracking branch 'teor/longest-policy-comment' 2015-04-23 11:05:24 -04:00
Nick Mathewson
c366e1fa32 Merge remote-tracking branch 'public/remove_old_libevent_autoconf_stuff' 2015-04-23 10:27:01 -04:00
Nick Mathewson
9b6e57290f 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
2015-04-23 10:25:16 -04:00
cypherpunks
d54b17f479 Add changes file for 15344. 2015-04-23 10:00:00 -04:00