]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
8 years agoFix implicit conversion warnings in the period_num tests
Nick Mathewson [Mon, 24 Apr 2017 19:38:16 +0000 (15:38 -0400)] 
Fix implicit conversion warnings in the period_num tests

8 years agoRemove changes files that are already merged into 0.3.0.
Nick Mathewson [Mon, 24 Apr 2017 19:22:37 +0000 (15:22 -0400)] 
Remove changes files that are already merged into 0.3.0.

8 years agoMerge remote-tracking branch 'dgoulet/ticket21980_031_01'
Nick Mathewson [Mon, 24 Apr 2017 16:42:11 +0000 (12:42 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket21980_031_01'

8 years agoFix some leaks in the consdiffmgr tests
Nick Mathewson [Mon, 24 Apr 2017 15:45:13 +0000 (11:45 -0400)] 
Fix some leaks in the consdiffmgr tests

8 years agoFix a signed/unsigned comparison warning on 32-bit
Nick Mathewson [Mon, 24 Apr 2017 15:41:11 +0000 (11:41 -0400)] 
Fix a signed/unsigned comparison warning on 32-bit

8 years agoMerge branch 'consdiffmgr_squashed'
Nick Mathewson [Mon, 24 Apr 2017 15:02:22 +0000 (11:02 -0400)] 
Merge branch 'consdiffmgr_squashed'

8 years agoRemove a checklist item that was already tested
Nick Mathewson [Sun, 16 Apr 2017 21:13:39 +0000 (17:13 -0400)] 
Remove a checklist item that was already tested

The item referred to the cdm_ht_set_status() case where the item was
not already in the hashtable.  But that already happens naturally
when we scan the directory on startup... and we already have a test
for that.

8 years agoconsdiffmgr test: do not launch a diff task that is already pending
Nick Mathewson [Sun, 16 Apr 2017 21:07:35 +0000 (17:07 -0400)] 
consdiffmgr test: do not launch a diff task that is already pending

8 years agoconsdiffmgr: tests for consdiffmgr_validate()
Nick Mathewson [Sun, 16 Apr 2017 19:49:32 +0000 (15:49 -0400)] 
consdiffmgr: tests for consdiffmgr_validate()

8 years agoconsdiffmgr: add tests for cdm_entry_get_sha3_value
Nick Mathewson [Sun, 16 Apr 2017 19:36:20 +0000 (15:36 -0400)] 
consdiffmgr: add tests for cdm_entry_get_sha3_value

8 years agoconsdiffmgr test: add a test for updating ht on clean/rescan.
Nick Mathewson [Sun, 16 Apr 2017 16:17:08 +0000 (12:17 -0400)] 
consdiffmgr test: add a test for updating ht on clean/rescan.

This brings us back up to ~94% coverage

8 years agoExpand diff-management test to cover reloading items from disk
Nick Mathewson [Sun, 16 Apr 2017 16:01:45 +0000 (12:01 -0400)] 
Expand diff-management test to cover reloading items from disk

8 years agoFix reference leak & handle leak in consensus_diff_worker_replyfn
Nick Mathewson [Sun, 16 Apr 2017 15:52:31 +0000 (11:52 -0400)] 
Fix reference leak & handle leak in consensus_diff_worker_replyfn

Found by previous test.

8 years agoconsdiffmgr tests: add tests to validate diff lookup/application
Nick Mathewson [Sun, 16 Apr 2017 15:51:14 +0000 (11:51 -0400)] 
consdiffmgr tests: add tests to validate diff lookup/application

This commit adds some helper functions to look up the diff from one
consensus and to make sure that applying it leads to another.  Then
we add them throughout the existing test cases.  Doing this turned
up a reference-leaking bug in consensus_diff_worker_replyfn.

8 years agoconsdiffmgr: Enable in-progress test that was not previously working
Nick Mathewson [Sun, 16 Apr 2017 15:28:25 +0000 (11:28 -0400)] 
consdiffmgr: Enable in-progress test that was not previously working

Also, add a list of additional tests to write.

8 years agoAdd a hashtable to consdiffmgr to keep track of diff status
Nick Mathewson [Sat, 15 Apr 2017 17:23:10 +0000 (13:23 -0400)] 
Add a hashtable to consdiffmgr to keep track of diff status

In several places in the old code, we had problems that only an
in-memory index of diff status could solve, including:
   * Remembering which diffs were in-progress, so that we didn't
     re-launch them.
   * Remembering which diffs had failed, so that we didn't try to
     recompute them over and over.
   * Having a fast way to look up the diff from a given consensus to
     the latest consensus of a given flavor.

This patch adds a hashtable mapping from (flavor, source diff), to
solve the problem.  It maps to a cache entry handle, rather than to
a cache entry directly, so that it doesn't affect the reference
counts of the cache entries, and so that we don't otherwise need to
worry about lifetime management.

8 years agoConsdiffmgr: extract "get a sha3 digest" function.
Nick Mathewson [Sat, 15 Apr 2017 17:11:39 +0000 (13:11 -0400)] 
Consdiffmgr: extract "get a sha3 digest" function.

I'll be using this a lot in the hashtable tweaks here.

8 years agoconsdiffmgr: function to re-validate stored sha3 digests at startup
Nick Mathewson [Sat, 15 Apr 2017 15:43:53 +0000 (11:43 -0400)] 
consdiffmgr: function to re-validate stored sha3 digests at startup

8 years agoConsdiffmgr: use aggressive-release flag on consensuses
Nick Mathewson [Sat, 15 Apr 2017 15:31:09 +0000 (11:31 -0400)] 
Consdiffmgr: use aggressive-release flag on consensuses

This conscache flag tells conscache that it should munmap the
document as soon as reasonably possible, since its usage pattern is
expected to not have a lot of time-locality.

8 years agoAdd handle support to consensus_cache_entry_t
Nick Mathewson [Tue, 11 Apr 2017 19:47:21 +0000 (15:47 -0400)] 
Add handle support to consensus_cache_entry_t

This will allow us to have weak references to cache entries.

8 years agoConsdiffmgr test: Make sure that diffs are removable
Nick Mathewson [Sat, 15 Apr 2017 15:13:39 +0000 (11:13 -0400)] 
Consdiffmgr test: Make sure that diffs are removable

A diff is removable as soon as it no longer takes you to the most
recent consensus of the appropriate flavor.

8 years agoTest the easiest cases of consdiffmgr_cleanup.
Nick Mathewson [Sat, 15 Apr 2017 14:59:05 +0000 (10:59 -0400)] 
Test the easiest cases of consdiffmgr_cleanup.

One more to go: deleting the old diffs.

8 years agoconsdiffmgr non-test: check for initialization failure
Nick Mathewson [Sat, 15 Apr 2017 14:19:29 +0000 (10:19 -0400)] 
consdiffmgr non-test: check for initialization failure

Unfortunately, this test doesn't work, so I've left it
defined-out. There is currently no way in our unit tests to catch a
fatal assertion failure.

8 years agoconsdiffmgr test: survive failures to compute a diff.
Nick Mathewson [Sat, 15 Apr 2017 14:05:10 +0000 (10:05 -0400)] 
consdiffmgr test: survive failures to compute a diff.

8 years agoAnother consdiffmgr test: only generate the diffs that are needed
Nick Mathewson [Sat, 15 Apr 2017 13:58:03 +0000 (09:58 -0400)] 
Another consdiffmgr test: only generate the diffs that are needed

This test makes sure that we only generate the diffs we actually
want, rather than regenerating all the diffs every time anything
changes.

8 years agoUnit tests for consdiffmgr module
Nick Mathewson [Fri, 14 Apr 2017 16:35:02 +0000 (12:35 -0400)] 
Unit tests for consdiffmgr module

Initial tests. These just try adding a few consensuses, looking
them up, and making sure that consensus diffs are generated in a
more or less reasonable-looking way.  It's enough for 87% coverage,
but it leaves out a lot of functionality.

8 years agoMake cpuworker_queue_work function mockable.
Nick Mathewson [Fri, 14 Apr 2017 23:23:21 +0000 (19:23 -0400)] 
Make cpuworker_queue_work function mockable.

I'll be using this in the unit tests for consdiffmgr.

8 years agoAdd a "Consensus diff manager" module.
Nick Mathewson [Thu, 6 Apr 2017 18:46:45 +0000 (14:46 -0400)] 
Add a "Consensus diff manager" module.

This module's job is to remember old consensus documents, to
calculate their diffs on demand, and to .

There are some incomplete points in this code; I've marked them with
"XXXX". I intend to fix them in separate commits, since I believe
doing it in separate commits will make the branch easier to review.

8 years agoMerge branch 'consdiff_numeric_squashed'
Nick Mathewson [Mon, 24 Apr 2017 13:33:55 +0000 (09:33 -0400)] 
Merge branch 'consdiff_numeric_squashed'

8 years agoconsdiff: Reject ranges with non-numeric chars
Sebastian Hahn [Tue, 18 Apr 2017 11:43:55 +0000 (13:43 +0200)] 
consdiff: Reject ranges with non-numeric chars

Fixes bug #21964

8 years agoMerge remote-tracking branch 'dgoulet/bug22032_031_01'
Nick Mathewson [Mon, 24 Apr 2017 13:30:30 +0000 (09:30 -0400)] 
Merge remote-tracking branch 'dgoulet/bug22032_031_01'

8 years agoAdd regression test for #22304
Taylor Yu [Sat, 22 Apr 2017 00:17:27 +0000 (20:17 -0400)] 
Add regression test for #22304

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

8 years agoMerge branch 'maint-0.2.9' into maint-0.3.0
Nick Mathewson [Mon, 24 Apr 2017 13:20:26 +0000 (09:20 -0400)] 
Merge branch 'maint-0.2.9' into maint-0.3.0

8 years agocontrol: Wrong check on base16_decode return value
David Goulet [Fri, 21 Apr 2017 15:49:30 +0000 (11:49 -0400)] 
control: Wrong check on base16_decode return value

The GETINFO extra-info/digest/<digest> broke in commit 568dc27a19 that
refactored the base16_decode() API to return the decoded length.
Unfortunately, that if() condition should have checked for the correct length
instead of an error which broke the command in tor-0.2.9.1-alpha.

Fixes #22034

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs: Fix a spurious warn in rend_log_intro_limit
David Goulet [Fri, 21 Apr 2017 15:09:34 +0000 (11:09 -0400)] 
hs: Fix a spurious warn in rend_log_intro_limit

We do dump HS stats now at log info everytime the intro circuit creation retry
period limit has been reached. However, the log was upgraded to warning if we
actually were over the elapsed time (plus an extra slop).

It is actually something that will happen in tor in normal case. For instance,
if the network goes down for 10 minutes then back up again making
have_completed_a_circuit() return false which results in never updating that
retry period marker for a service.

Fixes #22032

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agomissing smartlist_free in new consdiff test
Nick Mathewson [Wed, 19 Apr 2017 02:56:34 +0000 (22:56 -0400)] 
missing smartlist_free in new consdiff test

8 years agoMerge remote-tracking branch 'asn/bug21971'
Nick Mathewson [Wed, 19 Apr 2017 01:38:28 +0000 (21:38 -0400)] 
Merge remote-tracking branch 'asn/bug21971'

8 years agoMerge remote-tracking branches 'sebastian/consdiff_add' and 'sebastian/consdiff_newline'
Nick Mathewson [Wed, 19 Apr 2017 01:31:53 +0000 (21:31 -0400)] 
Merge remote-tracking branches 'sebastian/consdiff_add' and 'sebastian/consdiff_newline'

8 years agoprop224: Add time period functions and unittests
George Kadianakis [Mon, 13 Feb 2017 13:31:34 +0000 (15:31 +0200)] 
prop224: Add time period functions and unittests

This will be used by the build blinded key functions.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoprop224 tests: Remove useless NULL check before circuit_free().
George Kadianakis [Mon, 17 Apr 2017 13:36:55 +0000 (16:36 +0300)] 
prop224 tests: Remove useless NULL check before circuit_free().

Addresses coverity issue CID 1405130.

8 years agoprop224 tests: Don't use tt_size_op to compare ssize_t.
George Kadianakis [Mon, 17 Apr 2017 13:23:58 +0000 (16:23 +0300)] 
prop224 tests: Don't use tt_size_op to compare ssize_t.

Addresses coverity CID 1405129.

8 years agoFix diff generation with line added at start
Sebastian Hahn [Mon, 17 Apr 2017 08:07:31 +0000 (10:07 +0200)] 
Fix diff generation with line added at start

The consdiff generation logic would skip over lines added at the start of the
second file, and generate a diff that it would the immediately refuse because
it couldn't be used to reproduce the second file from the first. Fixes #21996.

8 years agoDon't accept ranges for add commands in consdiff
Sebastian Hahn [Mon, 17 Apr 2017 04:46:23 +0000 (06:46 +0200)] 
Don't accept ranges for add commands in consdiff

Fixes ticket #21963

8 years agoExpand cpuworker API to allow other work types
Nick Mathewson [Thu, 6 Apr 2017 19:51:52 +0000 (15:51 -0400)] 
Expand cpuworker API to allow other work types

8 years agoAdd a config_line_prepend() function
Nick Mathewson [Thu, 6 Apr 2017 18:18:50 +0000 (14:18 -0400)] 
Add a config_line_prepend() function

8 years agoconscache.c: do not match entries that are slated for removal.
Nick Mathewson [Tue, 11 Apr 2017 19:50:06 +0000 (15:50 -0400)] 
conscache.c: do not match entries that are slated for removal.

8 years agoMerge branch 'ticket21891_031_01_squashed'
Nick Mathewson [Thu, 13 Apr 2017 20:43:13 +0000 (16:43 -0400)] 
Merge branch 'ticket21891_031_01_squashed'

8 years agohs: Make the service list pruning function public
David Goulet [Thu, 12 Jan 2017 15:46:15 +0000 (10:46 -0500)] 
hs: Make the service list pruning function public

The reason for making the temporary list public is to keep it encapsulated in
the rendservice subsystem so the prop224 code does not have direct access to
it and can only affect it through the rendservice pruning function.

It also has been modified to not take list as arguments but rather use the
global lists (main and temporary ones) because prop224 code will call it to
actually prune the rendservice's lists. The function does the needed rotation
of pointers between those lists and then prune if needed.

In order to make the unit test work and not completely horrible, there is a
"impl_" version of the function that doesn't free memory, it simply moves
pointers around. It is directly used in the unit test and two setter functions
for those lists' pointer have been added only for unit test.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agofix wide lines
Nick Mathewson [Thu, 13 Apr 2017 18:36:57 +0000 (14:36 -0400)] 
fix wide lines

8 years agoMerge branch 'ticket21889_031_01_squashed'
Nick Mathewson [Thu, 13 Apr 2017 18:23:59 +0000 (14:23 -0400)] 
Merge branch 'ticket21889_031_01_squashed'

8 years agohs: Add service-side circuitmap API.
George Kadianakis [Fri, 20 Jan 2017 11:55:06 +0000 (13:55 +0200)] 
hs: Add service-side circuitmap API.

Now we have separate getters and setters for service-side and relay-side. I
took this approach over adding arguments to the already existing methods to
have more explicit type-checking, and also because some functions would grow
too large and dirty.

This commit also fixes every callsite to use the new function names which
modifies the legacy HS (v2) and the prop224 (v3) code.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoMerge remote-tracking branch 'dgoulet/bug21155_031_02'
Nick Mathewson [Thu, 13 Apr 2017 13:56:14 +0000 (09:56 -0400)] 
Merge remote-tracking branch 'dgoulet/bug21155_031_02'

8 years agoMerge remote-tracking branch 'dgoulet/ticket21919_031_01'
Nick Mathewson [Thu, 13 Apr 2017 13:38:59 +0000 (09:38 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket21919_031_01'

8 years agoMerge branch 'asn/prop224-ntor-v2-squashed'
Nick Mathewson [Thu, 13 Apr 2017 13:22:34 +0000 (09:22 -0400)] 
Merge branch 'asn/prop224-ntor-v2-squashed'

8 years agoprop224: Add Python integration tests for HS ntor.
George Kadianakis [Tue, 14 Mar 2017 13:06:36 +0000 (15:06 +0200)] 
prop224: Add Python integration tests for HS ntor.

This test is identical to the ./src/test/test_ntor.sh integration test.

8 years agoprop224: Add basic HS ntor unittest.
George Kadianakis [Tue, 28 Feb 2017 11:50:17 +0000 (13:50 +0200)] 
prop224: Add basic HS ntor unittest.

The test checks that introduce1/rendezvous1 key material is generated
correctly both for client-side and service-side.

8 years agoprop224: Add module that performs the HS ntor handshake.
George Kadianakis [Tue, 28 Feb 2017 11:46:36 +0000 (13:46 +0200)] 
prop224: Add module that performs the HS ntor handshake.

and also does the key expansion.

8 years agohs: Make check-spaces happy after rename
David Goulet [Wed, 12 Apr 2017 11:53:05 +0000 (07:53 -0400)] 
hs: Make check-spaces happy after rename

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs: Change trunnel prop224 cell's namespace
David Goulet [Tue, 11 Apr 2017 17:46:41 +0000 (13:46 -0400)] 
hs: Change trunnel prop224 cell's namespace

One of the goals of this change is to have trunnel API/ABI being more explicit
so we namespace them with "trn_*". Furthermore, we can now create
hs_cells.[ch] without having to confuse it with trunnel which used to be
"hs_cell_*" before that change.

Here are the perl line that were used for this rename:

  perl -i -pe 's/cell_extension/trn_cell_extension/g;' src/*/*.[ch]
  perl -i -pe 's/cell_extension/trn_cell_extension/g;' src/trunnel/hs/*.trunnel
  perl -i -pe 's/hs_cell_/trn_cell_/g;' src/*/*.[ch]
  perl -i -pe 's/hs_cell_/trn_cell_/g;' src/trunnel/hs/*.trunnel

  And then "./scripts/codegen/run_trunnel.sh" with trunnel commit id
  613fb1b98e58504e2b84ef56b1602b6380629043.

Fixes #21919

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoconfig: Warn if EntryNodes and HiddenService are used together
David Goulet [Wed, 5 Apr 2017 20:47:55 +0000 (16:47 -0400)] 
config: Warn if EntryNodes and HiddenService are used together

Pinning EntryNodes along with hidden services can be possibly harmful (for
instance #14917 and #21155) so at the very least warn the operator if this is
the case.

Fixes #21155

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agoMerge remote-tracking branch 'dgoulet/bug16706_031_01'
Nick Mathewson [Mon, 10 Apr 2017 16:12:14 +0000 (12:12 -0400)] 
Merge remote-tracking branch 'dgoulet/bug16706_031_01'

8 years agoFix some no-longer-reasonable unit tests for base64_decode()
Nick Mathewson [Mon, 10 Apr 2017 16:08:31 +0000 (12:08 -0400)] 
Fix some no-longer-reasonable unit tests for base64_decode()

These tests tried to use ridiculously large buffer sizes to check
the sanity-checking in the code; but since the sanity-checking
changed, these need to change too.

8 years agochanges file for 17868
Nick Mathewson [Mon, 10 Apr 2017 15:27:41 +0000 (11:27 -0400)] 
changes file for 17868

8 years agoRemove SR_COMMIT_LEN workaround
Taylor Yu [Fri, 7 Apr 2017 22:06:13 +0000 (18:06 -0400)] 
Remove SR_COMMIT_LEN workaround

Now that base64_decode() checks the destination buffer length against
the actual number of bytes as they're produced, shared_random.c no
longer needs the "SR_COMMIT_LEN+2" workaround.

8 years agoRemove base64_decode_nopad()
Taylor Yu [Fri, 7 Apr 2017 21:54:50 +0000 (17:54 -0400)] 
Remove base64_decode_nopad()

Remove base64_decode_nopad() because it is redundant now that
base64_decode() correctly handles both padded and unpadded base64
encodings with "right-sized" output buffers.

8 years agoTest odd-sized base64 decodes
Taylor Yu [Fri, 7 Apr 2017 20:33:22 +0000 (16:33 -0400)] 
Test odd-sized base64 decodes

Test base64_decode() with odd sized decoded lengths, including
unpadded encodings and padded encodings with "right-sized" output
buffers.  Convert calls to base64_decode_nopad() to base64_decode()
because base64_decode_nopad() is redundant.

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 agohs: Move common defines to hs_common.h
David Goulet [Thu, 22 Dec 2016 22:01:07 +0000 (17:01 -0500)] 
hs: Move common defines to hs_common.h

Some of those defines will be used by the v3 HS protocol so move them to a
common header out of rendservice.c. This is also ground work for prop224
service implementation.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs: Remove redundant define of ed25519 auth key type
David Goulet [Thu, 22 Dec 2016 21:59:18 +0000 (16:59 -0500)] 
hs: Remove redundant define of ed25519 auth key type

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs: Move service check private dir to hs_common.c
David Goulet [Thu, 22 Dec 2016 21:40:21 +0000 (16:40 -0500)] 
hs: Move service check private dir to hs_common.c

Another building blocks for prop224 service work. This also makes the function
takes specific argument instead of the or_option_t object.

Signed-off-by: David Goulet <dgoulet@torproject.org>
8 years agohs: Refactor circuitmap to use circuit_t instead of or_circuit_t.
George Kadianakis [Wed, 18 Jan 2017 10:01:49 +0000 (12:01 +0200)] 
hs: Refactor circuitmap to use circuit_t instead of or_circuit_t.

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.