]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
8 years agoMake base64_decode() check actual decoded length
Taylor Yu [Fri, 7 Apr 2017 20:01:40 +0000 (16:01 -0400)] 
Make base64_decode() check actual decoded length

base64_decode() was applying an overly conservative check on the
output buffer length that could incorrectly produce an error if the
input encoding contained padding or newlines.  Fix this by checking
the output buffer length against the actual decoded length produced
during decoding.

8 years agoMerge branch 'maint-0.3.0'
Nick Mathewson [Fri, 7 Apr 2017 18:03:40 +0000 (14:03 -0400)] 
Merge branch 'maint-0.3.0'

8 years agoMerge remote-tracking branch 'public/bug21894_029' into maint-0.3.0
Nick Mathewson [Fri, 7 Apr 2017 18:03:25 +0000 (14:03 -0400)] 
Merge remote-tracking branch 'public/bug21894_029' into maint-0.3.0

8 years agoMerge branch 'ticket21842_squashed'
Nick Mathewson [Fri, 7 Apr 2017 17:21:15 +0000 (13:21 -0400)] 
Merge branch 'ticket21842_squashed'

8 years agoRemove tor-checkkey as obsolete
Nick Mathewson [Fri, 31 Mar 2017 14:57:48 +0000 (10:57 -0400)] 
Remove tor-checkkey as obsolete

CVE-2008-0166 is long gone, and we no longer need a helper tool to
dump out public key moduli so folks can detect it.

Closes ticket 21842.

8 years agoMerge remote-tracking branch 'dgoulet/ticket21893_031_01'
Nick Mathewson [Fri, 7 Apr 2017 15:04:06 +0000 (11:04 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket21893_031_01'

8 years agoNever read off the end of a buffer in base32_encode()
Nick Mathewson [Fri, 7 Apr 2017 14:47:16 +0000 (10:47 -0400)] 
Never read off the end of a buffer in base32_encode()

When we "fixed" #18280 in 4e4a7d2b0c199227252a742541461ec4cc35d358
in 0291 it appears that we introduced a bug: The base32_encode
function can read off the end of the input buffer, if the input
buffer size modulo 5 is not equal to 0 or 3.

This is not completely horrible, for two reasons:
   * The extra bits that are read are never actually used: so this
     is only a crash when asan is enabled, in the worst case.  Not a
     data leak.

   * The input sizes passed to base32_encode are only ever multiples
      of 5. They are all either DIGEST_LEN (20), REND_SERVICE_ID_LEN
      (10), sizeof(rand_bytes) in addressmap.c (10), or an input in
      crypto.c that is forced to a multiple of 5.

So this bug can't actually trigger in today's Tor.

Closes bug 21894; bugfix on 0.2.9.1-alpha.

8 years agoComment fix. (Catalyst spotted this)
Nick Mathewson [Fri, 7 Apr 2017 14:00:08 +0000 (10:00 -0400)] 
Comment fix. (Catalyst spotted this)

8 years agoMerge branch 'isolate_openssl'
Nick Mathewson [Fri, 7 Apr 2017 13:58:21 +0000 (09:58 -0400)] 
Merge branch 'isolate_openssl'

8 years agoUse DIGEST512_LEN macro in crypto_hash_sha512.h in ref10
Nick Mathewson [Fri, 7 Apr 2017 13:58:04 +0000 (09:58 -0400)] 
Use DIGEST512_LEN macro in crypto_hash_sha512.h in ref10

8 years agoMake the warnings about terminating nuls a bit stronger
Nick Mathewson [Fri, 7 Apr 2017 13:51:08 +0000 (09:51 -0400)] 
Make the warnings about terminating nuls a bit stronger

It looks like 32_encoded_size/64_encode_size APIs are inconsistent
not only in the number of "d"s they have, but also in whether they
count the terminating NUL.  Taylor noted this in 86477f4e3fedb316,
but I think we should note the inconsistently more loudly in order
to avoid trouble.

(I ran into trouble with this when writing 30b13fd82e243713c6a0d.)

8 years agoMerge remote-tracking branch 'argonblue/baseXXlen'
Nick Mathewson [Fri, 7 Apr 2017 13:48:18 +0000 (09:48 -0400)] 
Merge remote-tracking branch 'argonblue/baseXXlen'

8 years agoAdd test for expected output from encode{,d}_length functions
Nick Mathewson [Fri, 7 Apr 2017 13:47:29 +0000 (09:47 -0400)] 
Add test for expected output from encode{,d}_length functions

8 years agoprop224: Flag router with HSIntro/HSDir using protover
David Goulet [Tue, 14 Feb 2017 15:45:19 +0000 (10:45 -0500)] 
prop224: Flag router with HSIntro/HSDir using protover

Note down in the routerstatus_t of a node if the router supports the HSIntro=4
version for the ed25519 authentication key and HSDir=2 version for the v3
descriptor supports.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoUse macros for base64 lengths in shared_random.h
Taylor Yu [Thu, 6 Apr 2017 18:49:40 +0000 (14:49 -0400)] 
Use macros for base64 lengths in shared_random.h

Fixes #19564.

8 years agoUse baseXX length macros in baseXX_encode()
Taylor Yu [Thu, 6 Apr 2017 19:17:28 +0000 (15:17 -0400)] 
Use baseXX length macros in baseXX_encode()

Use the new baseXX length macros to clean up the length checks in the
baseXX_encode() functions.

8 years agoAdd macros for baseXX encoding lengths
Taylor Yu [Thu, 6 Apr 2017 17:54:27 +0000 (13:54 -0400)] 
Add macros for baseXX encoding lengths

8 years agoMake CEIL_DIV() slightly more overflow-safe
Taylor Yu [Wed, 5 Apr 2017 18:52:48 +0000 (14:52 -0400)] 
Make CEIL_DIV() slightly more overflow-safe

8 years agochanges file for 21873
Nick Mathewson [Thu, 6 Apr 2017 15:57:56 +0000 (11:57 -0400)] 
changes file for 21873

8 years agoMerge remote-tracking branch 'arthuredelstein/21873'
Nick Mathewson [Thu, 6 Apr 2017 15:57:14 +0000 (11:57 -0400)] 
Merge remote-tracking branch 'arthuredelstein/21873'

8 years agoMerge branch 'storage_labeled_squashed'
Nick Mathewson [Thu, 6 Apr 2017 15:49:00 +0000 (11:49 -0400)] 
Merge branch 'storage_labeled_squashed'

8 years agoExplain config_line_find() behavior on duplicates.
Nick Mathewson [Thu, 6 Apr 2017 12:53:26 +0000 (08:53 -0400)] 
Explain config_line_find() behavior on duplicates.

8 years agoAdd an assertion to config_line_append().
Nick Mathewson [Thu, 6 Apr 2017 12:50:22 +0000 (08:50 -0400)] 
Add an assertion to config_line_append().

8 years agoAdditional unit tests to improve conscache coverage
Nick Mathewson [Wed, 5 Apr 2017 13:32:25 +0000 (09:32 -0400)] 
Additional unit tests to improve conscache coverage

8 years agoTests for cleanup and reference counting on conscache
Nick Mathewson [Wed, 5 Apr 2017 12:37:33 +0000 (08:37 -0400)] 
Tests for cleanup and reference counting on conscache

8 years agoTests for simple cases of conscache code.
Nick Mathewson [Tue, 4 Apr 2017 17:51:34 +0000 (13:51 -0400)] 
Tests for simple cases of conscache code.

8 years agoAdd a 'consensus cache' type on top of storagedir.
Nick Mathewson [Tue, 4 Apr 2017 13:35:39 +0000 (09:35 -0400)] 
Add a 'consensus cache' type on top of storagedir.

Every file in the cache is labeled.  The labels are held in memory;
the bodies are mapped on demand.

8 years agoUnit tests for labelled storagedir entries
Nick Mathewson [Mon, 3 Apr 2017 19:58:35 +0000 (15:58 -0400)] 
Unit tests for labelled storagedir entries

8 years agoAdd some "labeled storagedir" abstractions.
Nick Mathewson [Wed, 29 Mar 2017 10:55:09 +0000 (12:55 +0200)] 
Add some "labeled storagedir" abstractions.

These add a tiny bit of structure on top of the regular storagedir
abstractions in order to store key-value lists at the head of each
document.

8 years agoMerge branch 'maint-0.3.0'
Nick Mathewson [Thu, 6 Apr 2017 12:32:12 +0000 (08:32 -0400)] 
Merge branch 'maint-0.3.0'

8 years agoMerge branch 'maint-0.2.9' into maint-0.3.0
Nick Mathewson [Thu, 6 Apr 2017 12:32:04 +0000 (08:32 -0400)] 
Merge branch 'maint-0.2.9' into maint-0.3.0

8 years agoMerge branch 'maint-0.2.8' into maint-0.2.9
Nick Mathewson [Thu, 6 Apr 2017 12:31:54 +0000 (08:31 -0400)] 
Merge branch 'maint-0.2.8' into maint-0.2.9

8 years agoMerge branch 'maint-0.2.7-redux' into maint-0.2.8
Nick Mathewson [Thu, 6 Apr 2017 12:31:32 +0000 (08:31 -0400)] 
Merge branch 'maint-0.2.7-redux' into maint-0.2.8

8 years agoMerge branch 'maint-0.2.6' into maint-0.2.7-redux
Nick Mathewson [Thu, 6 Apr 2017 12:31:23 +0000 (08:31 -0400)] 
Merge branch 'maint-0.2.6' into maint-0.2.7-redux

8 years agoMerge branch 'maint-0.2.5' into maint-0.2.6
Nick Mathewson [Thu, 6 Apr 2017 12:31:18 +0000 (08:31 -0400)] 
Merge branch 'maint-0.2.5' into maint-0.2.6

8 years agoMerge branch 'maint-0.2.4' into maint-0.2.5
Nick Mathewson [Thu, 6 Apr 2017 12:31:12 +0000 (08:31 -0400)] 
Merge branch 'maint-0.2.4' into maint-0.2.5

8 years agoUpdate geoip and geoip6 to the April 4 2017 database.
Karsten Loesing [Thu, 6 Apr 2017 08:52:39 +0000 (10:52 +0200)] 
Update geoip and geoip6 to the April 4 2017 database.

8 years agoBug 21873: Clarify KeepAliveIsolateSOCKSAuth behavior
Arthur Edelstein [Thu, 6 Apr 2017 00:19:25 +0000 (17:19 -0700)] 
Bug 21873: Clarify KeepAliveIsolateSOCKSAuth behavior

8 years agoMerge branch 'maint-0.3.0'
Nick Mathewson [Wed, 5 Apr 2017 14:04:42 +0000 (10:04 -0400)] 
Merge branch 'maint-0.3.0'

"ours" merge to avoid the version bump.

8 years agoforward-port the 0.3.0.5-rc changelog
Nick Mathewson [Wed, 5 Apr 2017 14:04:38 +0000 (10:04 -0400)] 
forward-port the 0.3.0.5-rc changelog

8 years agobump to 0.3.0.5-rc-dev
Nick Mathewson [Wed, 5 Apr 2017 14:03:09 +0000 (10:03 -0400)] 
bump to 0.3.0.5-rc-dev

8 years agoMove config line parsing function to confline.c
Nick Mathewson [Fri, 31 Mar 2017 14:27:40 +0000 (10:27 -0400)] 
Move config line parsing function to confline.c

8 years agoMove config_line_t functions from confparse.c into common.
Nick Mathewson [Fri, 31 Mar 2017 14:24:38 +0000 (10:24 -0400)] 
Move config_line_t functions from confparse.c into common.

I'm doing this to storagedir to used config_line_t.

8 years agoMerge branch 'maint-0.3.0'
Nick Mathewson [Tue, 4 Apr 2017 13:43:23 +0000 (09:43 -0400)] 
Merge branch 'maint-0.3.0'

8 years agohs: Expose hs_service.c functions for unit tests
David Goulet [Tue, 4 Apr 2017 12:35:31 +0000 (08:35 -0400)] 
hs: Expose hs_service.c functions for unit tests

In order to avoid src/or/hs_service.o to contain no symbols and thus making
clang throw a warning, the functions are now exposed not just to unit tests.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoCapture expected log in test_circuitbuild.c
Taylor Yu [Mon, 3 Apr 2017 19:00:33 +0000 (15:00 -0400)] 
Capture expected log in test_circuitbuild.c

Capture the warning for the unhandled circuit purpose test case, both
to clean up the test log and to confirm that it gets logged.

8 years agoMerge branch 'bug13790_rebased'
Nick Mathewson [Mon, 3 Apr 2017 15:58:37 +0000 (11:58 -0400)] 
Merge branch 'bug13790_rebased'

8 years agoTest unhandled purpose in route_len_for_purpose()
Taylor Yu [Tue, 28 Mar 2017 21:35:25 +0000 (17:35 -0400)] 
Test unhandled purpose in route_len_for_purpose()

Check that route_len_for_purpose() (helper for new_route_len())
correctly fails a non-fatal bug assertion if it encounters an
unhandled circuit purpose when it is called with exit node info.

8 years agoRefactor and comment new_route_len()
Taylor Yu [Tue, 28 Mar 2017 21:35:11 +0000 (17:35 -0400)] 
Refactor and comment new_route_len()

Add a new helper function route_len_for_purpose(), which explicitly
lists all of the known circuit purposes for a circuit with a chosen
exit node (unlike previously, where the default route length for a
chosen exit was DEFAULT_ROUTE_LEN + 1 except for two purposes).  Add a
non-fatal assertion for unhandled purposes that conservatively returns
DEFAULT_ROUTE_LEN + 1.

Add copious comments documenting which circuits need an extra hop and
why.

Thanks to nickm and dgoulet for providing background information.

8 years agoAdd tests for new_route_len()
Taylor Yu [Tue, 28 Mar 2017 21:34:54 +0000 (17:34 -0400)] 
Add tests for new_route_len()

8 years agoAdd a release checklist step to highlight changes
Sebastian Hahn [Sun, 26 Mar 2017 00:09:37 +0000 (01:09 +0100)] 
Add a release checklist step to highlight changes

In an effort to better communicate with our users that they might need
to take certain actions when upgrading, we should extract from the
changelog the items that require some action (example: the new version
automatically generates keys, if you want them to be offline - make sure
to create them before upgrading).

8 years agoMerge branch 'maint-0.3.0'
Nick Mathewson [Mon, 3 Apr 2017 13:38:27 +0000 (09:38 -0400)] 
Merge branch 'maint-0.3.0'

("Ours" merge to avoid version bump.)

8 years agoversion bump
Nick Mathewson [Mon, 3 Apr 2017 13:36:42 +0000 (09:36 -0400)] 
version bump

8 years agoMerge branch 'maint-0.3.0'
Nick Mathewson [Mon, 3 Apr 2017 13:29:18 +0000 (09:29 -0400)] 
Merge branch 'maint-0.3.0'

8 years agoMerge remote-tracking branch 'teor/bug21596_030' into maint-0.3.0
Nick Mathewson [Mon, 3 Apr 2017 13:28:33 +0000 (09:28 -0400)] 
Merge remote-tracking branch 'teor/bug21596_030' into maint-0.3.0

8 years agoMerge remote-tracking branch 'public/bug21415_testfix_030' into maint-0.3.0
Nick Mathewson [Mon, 3 Apr 2017 13:27:40 +0000 (09:27 -0400)] 
Merge remote-tracking branch 'public/bug21415_testfix_030' into maint-0.3.0

8 years agoChanges file for openssl header isolation.
Nick Mathewson [Fri, 31 Mar 2017 14:12:25 +0000 (10:12 -0400)] 
Changes file for openssl header isolation.

8 years agoMove "change cert expiration and re-sign" fn into tortls.c
Nick Mathewson [Fri, 31 Mar 2017 14:04:10 +0000 (10:04 -0400)] 
Move "change cert expiration and re-sign" fn into tortls.c

This lets test_link_handshake stop including openssl headers.

8 years agoMark many private tortls.h APIs as openssl-only.
Nick Mathewson [Fri, 31 Mar 2017 13:50:31 +0000 (09:50 -0400)] 
Mark many private tortls.h APIs as openssl-only.

This change lets us remove the openssl/ssl.h include from
test_link_handshake.c.

8 years agoChange many tortls.h declarations of private APIs to use structs
Nick Mathewson [Fri, 31 Mar 2017 13:44:36 +0000 (09:44 -0400)] 
Change many tortls.h declarations of private APIs to use structs

This change makes it so those those APIs will not require prior
inclusion of openssl headers.  I've left some APIs alone-- those
will change to be extra-private.

8 years agoRemove some now-needless openssl includes from src/test.
Nick Mathewson [Sat, 25 Mar 2017 11:19:14 +0000 (12:19 +0100)] 
Remove some now-needless openssl includes from src/test.

It would appear that these includes weren't actually used.

8 years agoRemove openssl/evp.h dependency from test_crypto.c
Nick Mathewson [Sat, 25 Mar 2017 11:13:31 +0000 (12:13 +0100)] 
Remove openssl/evp.h dependency from test_crypto.c

8 years agoRemove crypto/rand include from test_crypto.c
Nick Mathewson [Sat, 25 Mar 2017 11:04:11 +0000 (12:04 +0100)] 
Remove crypto/rand include from test_crypto.c

Create a new test_crypto_openssl to test openssl-only crypto.c
functionality.

8 years agoMake our ed25519 implementations no longer use openssl directly.
Nick Mathewson [Sat, 25 Mar 2017 10:49:41 +0000 (11:49 +0100)] 
Make our ed25519 implementations no longer use openssl directly.

8 years agoMake crypto_ed25519.c no longer depend on openssl
Nick Mathewson [Sat, 25 Mar 2017 10:34:22 +0000 (11:34 +0100)] 
Make crypto_ed25519.c no longer depend on openssl

Now it calls through our own crypto API.

8 years agoIsolate dmalloc/openssl bridge code to crypto.c
Nick Mathewson [Sat, 25 Mar 2017 10:27:50 +0000 (11:27 +0100)] 
Isolate dmalloc/openssl bridge code to crypto.c

This makes it so main.c, and the rest of src/or, no longer need to
include any openssl headers.

8 years agoFix utimbuf initialization in storagedir/cleaning test
Nick Mathewson [Wed, 29 Mar 2017 07:10:35 +0000 (09:10 +0200)] 
Fix utimbuf initialization in storagedir/cleaning test

8 years agoFix another 32-bit warning in the spooling code
Nick Mathewson [Wed, 29 Mar 2017 07:07:51 +0000 (09:07 +0200)] 
Fix another 32-bit warning in the spooling code

8 years agoFix i386 compilation from spooling patch. I seem to be good at breaking that.
Nick Mathewson [Tue, 28 Mar 2017 19:41:59 +0000 (21:41 +0200)] 
Fix i386 compilation from spooling patch. I seem to be good at breaking that.

8 years agoMerge branch 'spooling_squashed'
Nick Mathewson [Tue, 28 Mar 2017 17:55:18 +0000 (19:55 +0200)] 
Merge branch 'spooling_squashed'

8 years agoAdd nonfatal asserts for return val of dirserv_flushed_some
Nick Mathewson [Fri, 17 Mar 2017 15:34:41 +0000 (11:34 -0400)] 
Add nonfatal asserts for return val of dirserv_flushed_some

8 years agoImprove documentation for connection_dirserv_flushed_some.
Nick Mathewson [Fri, 17 Mar 2017 15:31:21 +0000 (11:31 -0400)] 
Improve documentation for connection_dirserv_flushed_some.

8 years agoRefactor the directory spool implementation
Nick Mathewson [Mon, 13 Mar 2017 19:38:20 +0000 (15:38 -0400)] 
Refactor the directory spool implementation

The old implementation had duplicated code in a bunch of places, and
it interspersed spool-management with resource management.  The new
implementation should make it easier to add new resource types and
maintain the spooling code.

Closing ticket 21651.

8 years agoMerge remote-tracking branch 'origin/maint-0.3.0'
Nick Mathewson [Mon, 27 Mar 2017 13:44:31 +0000 (15:44 +0200)] 
Merge remote-tracking branch 'origin/maint-0.3.0'

8 years agoFix max sampled size logic when in bridge mode.
George Kadianakis [Mon, 27 Mar 2017 13:08:18 +0000 (15:08 +0200)] 
Fix max sampled size logic when in bridge mode.

When calculating max sampled size, Tor would only count the number of
bridges in torrc, without considering that our state file might already
have sampled bridges in it. This caused problems when people swap
bridges, since the following error would trigger:

         [warn] Not expanding the guard sample any further; just hit the
                maximum sample threshold of 1

8 years agoStoragedir test fix: save strings in binary mode to preserve length
Nick Mathewson [Mon, 27 Mar 2017 13:27:52 +0000 (15:27 +0200)] 
Storagedir test fix: save strings in binary mode to preserve length

8 years agoMerge remote-tracking branch 'ahf/bugs/21757'
Nick Mathewson [Mon, 27 Mar 2017 13:02:48 +0000 (15:02 +0200)] 
Merge remote-tracking branch 'ahf/bugs/21757'

8 years agochanges file for 21788
Nick Mathewson [Mon, 27 Mar 2017 09:01:50 +0000 (11:01 +0200)] 
changes file for 21788

8 years agoMerge remote-tracking branch 'jigsaw52/fix_leak_21788'
Nick Mathewson [Mon, 27 Mar 2017 09:01:01 +0000 (11:01 +0200)] 
Merge remote-tracking branch 'jigsaw52/fix_leak_21788'

8 years agoCheck and cast st_size to size_t in storagedir code
Nick Mathewson [Mon, 27 Mar 2017 08:40:15 +0000 (10:40 +0200)] 
Check and cast st_size to size_t in storagedir code

This prevents an i386 compilation warning and fixes bug 21828. Bug not
in any released Tor.

8 years agoMerge remote-tracking branch 'origin/maint-0.3.0'
Nick Mathewson [Sun, 26 Mar 2017 10:30:45 +0000 (12:30 +0200)] 
Merge remote-tracking branch 'origin/maint-0.3.0'

8 years agoTweak test_entrynodes comment
Nick Mathewson [Sun, 26 Mar 2017 10:30:00 +0000 (12:30 +0200)] 
Tweak test_entrynodes comment

8 years agoMerge branch 'ticket21799' into maint-0.3.0
Nick Mathewson [Sun, 26 Mar 2017 10:28:58 +0000 (12:28 +0200)] 
Merge branch 'ticket21799' into maint-0.3.0

8 years agoAdd calltool cache files to gitignore
Nick Mathewson [Sun, 26 Mar 2017 10:28:00 +0000 (12:28 +0200)] 
Add calltool cache files to gitignore

8 years agoUse update_approx_time() to run a test 100 days in the past.
Nick Mathewson [Thu, 23 Mar 2017 09:44:43 +0000 (10:44 +0100)] 
Use update_approx_time() to run a test 100 days in the past.

Fixes bug21799.

8 years agoFix very small memory leak #21788
Daniel Pinto [Mon, 20 Mar 2017 01:03:05 +0000 (01:03 +0000)] 
Fix very small memory leak #21788

Leak caused by clean_up_backtrace_handler not being called
on shutdown.

8 years ago21151: document datadir default decently.
Nick Mathewson [Fri, 17 Mar 2017 16:10:43 +0000 (12:10 -0400)] 
21151: document datadir default decently.

8 years agoMerge branch 'ahf_bugs_21641_squashed'
Nick Mathewson [Fri, 17 Mar 2017 15:16:24 +0000 (11:16 -0400)] 
Merge branch 'ahf_bugs_21641_squashed'

8 years agoCheck onion key consensus parameters every hour.
Alexander Færøy [Fri, 17 Mar 2017 04:27:31 +0000 (05:27 +0100)] 
Check onion key consensus parameters every hour.

This patch changes the way we decide when to check for whether it's time
to rotate and/or expiry our onion keys. Due to proposal #274 we can now
have the keys rotate at different frequencies than before and we thus
do the check once an hour when our Tor daemon is running in server mode.

This should allow us to quickly notice if the network consensus
parameter have changed while we are running instead of having to wait
until the current parameters timeout value have passed.

See: See: https://bugs.torproject.org/21641

8 years agoAdd periodic timer for expiring old onion keys.
Alexander Færøy [Fri, 10 Mar 2017 12:00:20 +0000 (13:00 +0100)] 
Add periodic timer for expiring old onion keys.

This patch adds a new timer that is executed when it is time to expire
our current set of old onion keys. Because of proposal #274 this can no
longer be assumed to be at the same time we rotate our onion keys since
they will be updated less frequently.

See: https://bugs.torproject.org/21641

8 years agoAdd API to query the current onion key grace period.
Alexander Færøy [Fri, 10 Mar 2017 11:56:36 +0000 (12:56 +0100)] 
Add API to query the current onion key grace period.

This patch adds an API to get the current grace period, in days, defined
as the consensus parameter "onion-key-grace-period-days".

As per proposal #274 the values for "onion-key-grace-period-days" is a
default value of 7 days, a minimum value of 1 day, and a maximum value
defined by other consensus parameter "onion-key-rotation-days" also
defined in days.

See: https://bugs.torproject.org/21641

8 years agoMake MIN_ONION_KEY_LIFETIME a consensus parameter defined value.
Alexander Færøy [Fri, 10 Mar 2017 11:18:52 +0000 (12:18 +0100)] 
Make MIN_ONION_KEY_LIFETIME a consensus parameter defined value.

This patch turns `MIN_ONION_KEY_LIFETIME` into a new function
`get_onion_key_lifetime()` which gets its value from a network consensus
parameter named "onion-key-rotation-days". This allows us to tune the
value at a later point in time with no code modifications.

We also bump the default onion key lifetime from 7 to 28 days as per
proposal #274.

See: https://bugs.torproject.org/21641

8 years agoSplit strings at newline in tor_get_lines_from_handle().
Alexander Færøy [Fri, 17 Mar 2017 03:18:31 +0000 (04:18 +0100)] 
Split strings at newline in tor_get_lines_from_handle().

This patch fixes a regression described in bug #21757 that first
appeared after commit 6e78ede73f which was an attempt to fix bug #21654.

When switching from buffered I/O to direct file descriptor I/O our
output strings from get_string_from_pipe() might contain newline
characters (\n). In this patch we modify tor_get_lines_from_handle() to
ensure that the function splits the newly read string at the newline
character and thus might return multiple lines from a single call to
get_string_from_pipe().

Additionally, we add a test case to test_util_string_from_pipe() to
ensure that get_string_from_pipe() correctly returns multiple lines in a
single call.

See: https://bugs.torproject.org/21757
See: https://bugs.torproject.org/21654

8 years agoGenerate src/test/fuzz/include.am from a script
Nick Mathewson [Thu, 16 Mar 2017 21:14:10 +0000 (17:14 -0400)] 
Generate src/test/fuzz/include.am from a script

It was very error-prone to maintain this by hand.

8 years agoMerge branch 'storagedir_squashed'
Nick Mathewson [Thu, 16 Mar 2017 20:03:13 +0000 (16:03 -0400)] 
Merge branch 'storagedir_squashed'

8 years agoDefine a "storagedir" abstraction to hold numerous similar files
Nick Mathewson [Fri, 10 Mar 2017 18:22:01 +0000 (13:22 -0500)] 
Define a "storagedir" abstraction to hold numerous similar files

We could use one of these for holding "junk" descriptors and
unparseable things -- but we'll _need_ it for having cached
consensuses and diffs between them.

8 years agoNow, resolve a new 64-bit warning in compat_threads.c
Nick Mathewson [Thu, 16 Mar 2017 19:34:57 +0000 (15:34 -0400)] 
Now, resolve a new 64-bit warning in compat_threads.c

8 years agoconsdiff: Fix 32-bit compilation.
Nick Mathewson [Thu, 16 Mar 2017 19:14:16 +0000 (15:14 -0400)] 
consdiff: Fix 32-bit compilation.

Thanks, jenkins!

8 years agochanges file for consdiff backend
Nick Mathewson [Thu, 16 Mar 2017 19:01:00 +0000 (15:01 -0400)] 
changes file for consdiff backend

8 years agoMerge branch 'prop140_21643_diff_only_squashed'
Nick Mathewson [Thu, 16 Mar 2017 18:58:43 +0000 (14:58 -0400)] 
Merge branch 'prop140_21643_diff_only_squashed'