]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
7 years agoRevert "Change the sandbox behavior on all failed opens() to EACCES"
Nick Mathewson [Thu, 1 Feb 2018 13:39:38 +0000 (08:39 -0500)] 
Revert "Change the sandbox behavior on all failed opens() to EACCES"

This reverts commit 9a06282546418b2e9d21559d4853bcf124b953f4.

It appears that I misunderstood how the seccomp2 filter rules
interact.  It appears that `SCMP_ACT_ERRNO()` always takes
precedence over `SCMP_ACT_ALLOW()` -- I had thought instead that
earlier rules would override later ones.  But this change caused bug
25115 (not in any released Tor).

7 years agoMerge remote-tracking branch 'dgoulet/bug24469_033_01'
Nick Mathewson [Thu, 1 Feb 2018 13:22:44 +0000 (08:22 -0500)] 
Merge remote-tracking branch 'dgoulet/bug24469_033_01'

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Thu, 1 Feb 2018 13:13:35 +0000 (08:13 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2
Nick Mathewson [Thu, 1 Feb 2018 13:10:34 +0000 (08:10 -0500)] 
Merge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2

7 years agoMerge remote-tracking branch 'dgoulet/ticket24902_029_05'
Nick Mathewson [Wed, 31 Jan 2018 21:17:04 +0000 (16:17 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket24902_029_05'

7 years agochannel_tls_get_remote_addr_method now returns real_addr.
Fernando Fernandez Mancera [Mon, 22 Jan 2018 14:20:17 +0000 (15:20 +0100)] 
channel_tls_get_remote_addr_method now returns real_addr.

The accurate address of a connection is real_addr, not the addr member.
channel_tls_get_remote_addr_method() now returns real_addr instead.

Fixes #24952; bugfix on 707c1e2 in 0.2.4.11-alpha.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
7 years agocirc: Don't cannibalize a circuit if the guard state is unusable
David Goulet [Wed, 31 Jan 2018 20:23:45 +0000 (15:23 -0500)] 
circ: Don't cannibalize a circuit if the guard state is unusable

Tor preemptiely builds circuits and they can be cannibalized later in their
lifetime. A Guard node can become unusable (from our guard state) but we can
still have circuits using that node opened. It is important to not pick those
circuits for any usage through the cannibalization process.

Fixes #24469

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge remote-tracking branch 'public/bug16106_02_nm'
Nick Mathewson [Wed, 31 Jan 2018 20:51:58 +0000 (15:51 -0500)] 
Merge remote-tracking branch 'public/bug16106_02_nm'

7 years agoMerge branch 'bug23954_squashed'
Nick Mathewson [Wed, 31 Jan 2018 19:37:48 +0000 (14:37 -0500)] 
Merge branch 'bug23954_squashed'

7 years agoUse thread-safe types to store the LOG_PROTOCOL_WARN severity
Nick Mathewson [Wed, 24 Jan 2018 17:02:44 +0000 (12:02 -0500)] 
Use thread-safe types to store the LOG_PROTOCOL_WARN severity

Fixes a race condition; resolves 23954.

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 19:33:27 +0000 (14:33 -0500)] 
Merge branch 'maint-0.3.2'

"ours" merge to avoid backport of #25105

7 years agoMerge branch 'bug25105_032' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 19:33:12 +0000 (14:33 -0500)] 
Merge branch 'bug25105_032' into maint-0.3.2

7 years agoMerge branch 'bug25008'
Nick Mathewson [Wed, 31 Jan 2018 19:32:24 +0000 (14:32 -0500)] 
Merge branch 'bug25008'

7 years agons: Add a before and after consensus has changed notification
David Goulet [Wed, 31 Jan 2018 19:15:02 +0000 (14:15 -0500)] 
ns: Add a before and after consensus has changed notification

In 0.3.2.1-alpha, we've added notify_networkstatus_changed() in order to have
a way to notify other subsystems that the consensus just changed. The old and
new consensus are passed to it.

Before this patch, this was done _before_ the new consensus was set globally
(thus NOT accessible by getting the latest consensus). The scheduler
notification was assuming that it was set and select_scheduler() is looking at
the latest consensus to get the parameters it might needs. This was very wrong
because at that point it is still the old consensus set globally.

This commit changes the notify_networkstatus_changed() to be the "before"
function and adds an "after" notification from which the scheduler subsystem
is notified.

Fixes #24975

7 years agoLook at the correct protocol for supports_v3_rendezvous_point
Nick Mathewson [Wed, 31 Jan 2018 19:01:49 +0000 (14:01 -0500)] 
Look at the correct protocol for supports_v3_rendezvous_point

Fixes bug 25105; bugfix on 0.3.2.1-alpha.

(This is a backport of bbf2d9cf6bb97c3e15ada58 for 0.3.2.)

7 years agoFix a failing unit test.
Nick Mathewson [Wed, 31 Jan 2018 19:06:37 +0000 (14:06 -0500)] 
Fix a failing unit test.

When we stopped looking at the "protocols" variable directly, we
broke the hs_service/build_update_descriptors test, since it didn't
actually update any of the flags.

The fix here is to call summarize_protover_flags() from that test,
and to expose summarize_protover_flags() as "STATIC" from
routerparse.c.

7 years agoLook at the correct protocol for supports_v3_rendezvous_point
Nick Mathewson [Wed, 31 Jan 2018 19:01:49 +0000 (14:01 -0500)] 
Look at the correct protocol for supports_v3_rendezvous_point

Fixes bug 25105; bugfix on 0.3.2.1-alpha.

7 years agoRevert "ns: Call notify_networkstatus_changed() after the new consensus is set globally"
David Goulet [Wed, 31 Jan 2018 18:59:05 +0000 (13:59 -0500)] 
Revert "ns: Call notify_networkstatus_changed() after the new consensus is set globally"

This reverts commit 3a247ca92a06c864a2cb634fbe2bc23cf48fb977.

7 years agoDocument remaining cases for protocol support
Nick Mathewson [Wed, 31 Jan 2018 18:50:04 +0000 (13:50 -0500)] 
Document remaining cases for protocol support

For each support flag, document which subprotocol version it requires.

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 18:47:01 +0000 (13:47 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 18:46:58 +0000 (13:46 -0500)] 
Merge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 17:51:45 +0000 (12:51 -0500)] 
Merge branch 'maint-0.3.2'

7 years agohs-v3: Remove a BUG() when storing a descriptor in the client cache
David Goulet [Wed, 31 Jan 2018 15:58:11 +0000 (10:58 -0500)] 
hs-v3: Remove a BUG() when storing a descriptor in the client cache

It is possible in normal circumstances that  a client fetches a descriptor
that has a lower revision counter than the one in its cache. This can happen
due to HSDir desync.

Fixes #24976

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agons: Call notify_networkstatus_changed() after the new consensus is set globally
David Goulet [Wed, 31 Jan 2018 16:08:33 +0000 (11:08 -0500)] 
ns: Call notify_networkstatus_changed() after the new consensus is set globally

In 0.3.2.1-alpha, we've added this function in order to have a way to notify
other subsystems that the consensus just changed. The old consensus and the
new one are passed to it.

Before this patch, this was done _before_ the new consensus was set globally
(thus NOT accessible by getting the latest consensus). The scheduler
notification was assuming that it was set and select_scheduler() is looking at
the latest consensus to get the parameters it might needs. This was very wrong
because at that point it is still the old consensus set globally.

With this commit, notify_networkstatus_changed() has been moved _after_ the
new consensus is set globally. The main obvious reasons is to fix the bug
described above and in #24975. The other reason is that this notify function
doesn't return anything which could be allowing the possibility of refusing to
set the new consensus on error. In other words, the new consensus is set right
after the notification whatever happens.

It does no harm or change in behavior to set the new consensus first and then
notify the subsystems. The two functions currently used are for the control
port using the old and new consensus and sending the diff. The second is the
scheduler that needs the new consensus to be set globally before being called.

Of course, the function has been documented accordinly to clearly state it is
done _after_ the new consensus is set.

Fixes #24975

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 15:06:49 +0000 (10:06 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 15:06:49 +0000 (10:06 -0500)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoBut in most Earth cultures, there are 60s in a minute.
Nick Mathewson [Wed, 31 Jan 2018 15:06:43 +0000 (10:06 -0500)] 
But in most Earth cultures, there are 60s in a minute.

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 15:01:13 +0000 (10:01 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 15:01:13 +0000 (10:01 -0500)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoadd a rate-limit.
Nick Mathewson [Wed, 31 Jan 2018 15:01:10 +0000 (10:01 -0500)] 
add a rate-limit.

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 14:50:24 +0000 (09:50 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 14:50:24 +0000 (09:50 -0500)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoMerge branch 'bug24927'
Nick Mathewson [Wed, 31 Jan 2018 14:47:36 +0000 (09:47 -0500)] 
Merge branch 'bug24927'

7 years agoMerge remote-tracking branch 'public/ticket24849_032'
Nick Mathewson [Wed, 31 Jan 2018 14:38:24 +0000 (09:38 -0500)] 
Merge remote-tracking branch 'public/ticket24849_032'

7 years agoMerge remote-tracking branch 'dgoulet/ticket24902_029_05'
Nick Mathewson [Wed, 31 Jan 2018 14:35:07 +0000 (09:35 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket24902_029_05'

7 years agotest: Add unit tests for overflows and underflows in cc_stats_refill_bucket
teor [Wed, 31 Jan 2018 00:22:20 +0000 (11:22 +1100)] 
test: Add unit tests for overflows and underflows in cc_stats_refill_bucket

Closes #25094.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Make sure cc_stats_refill_bucket can't overflow while calculating
teor [Wed, 31 Jan 2018 00:13:17 +0000 (11:13 +1100)] 
dos: Make sure cc_stats_refill_bucket can't overflow while calculating

Debug log the elapsed time in cc_stats_refill_bucket

Part of #25094.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 14:19:55 +0000 (09:19 -0500)] 
Merge branch 'maint-0.3.2'

7 years agotest: Remove a redundant round from test_dos_bucket_refill
teor [Wed, 31 Jan 2018 00:11:08 +0000 (11:11 +1100)] 
test: Remove a redundant round from test_dos_bucket_refill

This round is left over from the tenths of a second code.

Part of #25094.

7 years agoremove a redundant semicolon
Nick Mathewson [Tue, 30 Jan 2018 23:11:16 +0000 (18:11 -0500)] 
remove a redundant semicolon

7 years agoMerge branch 'ticket24902_029_05' into ticket24902_033_02
David Goulet [Tue, 30 Jan 2018 14:33:12 +0000 (09:33 -0500)] 
Merge branch 'ticket24902_029_05' into ticket24902_033_02

7 years agodos: Add changes file for ticket 24902
David Goulet [Tue, 30 Jan 2018 14:15:33 +0000 (09:15 -0500)] 
dos: Add changes file for ticket 24902

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Make circuit rate limit per second, not tenths anymore
David Goulet [Mon, 29 Jan 2018 16:50:11 +0000 (11:50 -0500)] 
dos: Make circuit rate limit per second, not tenths anymore

Because this touches too many commits at once, it is made into one single
commit.

Remove the use of "tenths" for the circuit rate to simplify things. We can
only refill the buckets at best once every second because of the use of
approx_time() and our token system is set to be 1 token = 1 circuit so make
the rate a flat integer of circuit per second.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Man page entry for DoS mitigation
David Goulet [Fri, 26 Jan 2018 14:00:17 +0000 (09:00 -0500)] 
dos: Man page entry for DoS mitigation

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agotest: Add unit tests for the DoS subsystem
George Kadianakis [Thu, 25 Jan 2018 21:38:59 +0000 (16:38 -0500)] 
test: Add unit tests for the DoS subsystem

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Clear connection tracked flag if geoip entry is removed
David Goulet [Thu, 25 Jan 2018 14:44:21 +0000 (09:44 -0500)] 
dos: Clear connection tracked flag if geoip entry is removed

Imagine this scenario. We had 10 connections over the 24h lifetime of a geoip
cache entry. The lifetime of the entry has been reached so it is about to get
freed but 2 connections remain for it. After the free, a third connection
comes in thus making us create a new geoip entry for that address matching the
2 previous ones that are still alive. If they end up being closed, we'll have
a concurrent count desynch from what the reality is.

To mitigate this probably very rare scenario in practice, when we free a geoip
entry and it has a concurrent count above 0, we'll go over all connections
matching the address and clear out the tracked flag. So once they are closed,
we don't try to decrement the count.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Add a heartbeat log
David Goulet [Thu, 25 Jan 2018 21:36:05 +0000 (16:36 -0500)] 
dos: Add a heartbeat log

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Add the DoSRefuseSingleHopClientRendezvous option
David Goulet [Thu, 25 Jan 2018 21:32:28 +0000 (16:32 -0500)] 
dos: Add the DoSRefuseSingleHopClientRendezvous option

This option refuses any ESTABLISH_RENDEZVOUS cell arriving from a client
connection. Its default value is "auto" for which we can turn it on or off
with a consensus parameter. Default value is 0.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Add the connection DoS mitigation subsystem
David Goulet [Thu, 25 Jan 2018 21:28:54 +0000 (16:28 -0500)] 
dos: Add the connection DoS mitigation subsystem

Defend against an address that has reached the concurrent connection count
threshold.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Apply defense for circuit creation DoS
David Goulet [Thu, 25 Jan 2018 21:20:52 +0000 (16:20 -0500)] 
dos: Apply defense for circuit creation DoS

If the client address was detected as malicious, apply a defense which is at
this commit to return a DESTROY cell.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Detect circuit creation denial of service
David Goulet [Thu, 25 Jan 2018 21:14:40 +0000 (16:14 -0500)] 
dos: Detect circuit creation denial of service

Add a function that notifies the DoS subsystem that a new CREATE cell has
arrived. The statistics are updated accordingly and the IP address can also be
marked as malicious if it is above threshold.

At this commit, no defense is applied, just detection with a circuit creation
token bucket system.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Track new and closed OR client connections
David Goulet [Thu, 25 Jan 2018 21:05:59 +0000 (16:05 -0500)] 
dos: Track new and closed OR client connections

Implement a basic connection tracking that counts the number of concurrent
connections when they open and close.

This commit also adds the circuit creation mitigation data structure that will
be needed at later commit to keep track of the circuit rate.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agogeoip: Remember client stats if DoS mitigation is enabled
David Goulet [Fri, 19 Jan 2018 18:15:07 +0000 (13:15 -0500)] 
geoip: Remember client stats if DoS mitigation is enabled

Make the geoip cache track client address if the DoS subsystem is enabled.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Initial code of Denial of Service mitigation
David Goulet [Thu, 25 Jan 2018 20:54:58 +0000 (15:54 -0500)] 
dos: Initial code of Denial of Service mitigation

This commit introduces the src/or/dos.{c|h} files that contains the code for
the Denial of Service mitigation subsystem. It currently contains basic
functions to initialize and free the subsystem. They are used at this commit.

The torrc options and consensus parameters are defined at this commit and
getters are implemented.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMake more notes about important stuff in ReleasingTor.md
Nick Mathewson [Fri, 26 Jan 2018 19:39:08 +0000 (14:39 -0500)] 
Make more notes about important stuff in ReleasingTor.md

7 years agoReleasingTor.md: check for recommendation, listing on dl page
Nick Mathewson [Fri, 26 Jan 2018 19:34:25 +0000 (14:34 -0500)] 
ReleasingTor.md: check for recommendation, listing on dl page

Closes ticket 23118.

7 years agoImprove log when unable to add sigs to pending consensus
Nick Mathewson [Fri, 26 Jan 2018 19:19:59 +0000 (14:19 -0500)] 
Improve log when unable to add sigs to pending consensus

Closes ticket 24849.

7 years agoWhen a tor_cert_T check fails, log the reason why.
Nick Mathewson [Fri, 26 Jan 2018 18:55:25 +0000 (13:55 -0500)] 
When a tor_cert_T check fails, log the reason why.

Diagnostic attempt for 24972.

7 years agoRemove a needless (always-true) check.
Nick Mathewson [Fri, 26 Jan 2018 18:35:00 +0000 (13:35 -0500)] 
Remove a needless (always-true) check.

Also add an assertion and rename a variable.

Closes ticekt 24927.

7 years agoIf out-of-disk when saving a consensus cache entry, don't BUG.
Nick Mathewson [Fri, 26 Jan 2018 18:14:14 +0000 (13:14 -0500)] 
If out-of-disk when saving a consensus cache entry, don't BUG.

Just warn instead.

Fixes bug 24859.

7 years agoChange the sandbox behavior on all failed opens() to EACCES
Nick Mathewson [Fri, 26 Jan 2018 17:18:43 +0000 (12:18 -0500)] 
Change the sandbox behavior on all failed opens() to EACCES

Previously, most disallowed open(O_RDONLY) attempts would EACCES,
but others would fail with a crash.

7 years agogeoip: Add a lookup function for client map entry
David Goulet [Thu, 25 Jan 2018 20:44:48 +0000 (15:44 -0500)] 
geoip: Add a lookup function for client map entry

The upcoming DoS mitigation subsytem needs to keep information on a per-IP
basis which is also what the geoip clientmap does.

For another subsystem to access that clientmap, this commit adds a lookup
function that returns the entry. For this, the clientmap_entry_t had to be
moved to the header file.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge remote-tracking branch 'ahf-oniongit/bugs/25026'
Nick Mathewson [Thu, 25 Jan 2018 18:57:37 +0000 (13:57 -0500)] 
Merge remote-tracking branch 'ahf-oniongit/bugs/25026'

7 years agoBump version to 0.3.3.1-alpha-dev
Nick Mathewson [Thu, 25 Jan 2018 18:50:55 +0000 (13:50 -0500)] 
Bump version to 0.3.3.1-alpha-dev

7 years agoReflow changelog tor-0.3.3.1-alpha
Nick Mathewson [Thu, 25 Jan 2018 18:27:49 +0000 (13:27 -0500)] 
Reflow changelog

7 years agoWe do not put a colon here.
Nick Mathewson [Thu, 25 Jan 2018 16:55:49 +0000 (11:55 -0500)] 
We do not put a colon here.

7 years agobump version to 0.3.3.1-alpha
Nick Mathewson [Thu, 25 Jan 2018 16:48:42 +0000 (11:48 -0500)] 
bump version to 0.3.3.1-alpha

7 years agoProofreading step by seborn (thx)
Nick Mathewson [Thu, 25 Jan 2018 16:37:01 +0000 (11:37 -0500)] 
Proofreading step by seborn (thx)

7 years agofinish writing the blurb
Nick Mathewson [Thu, 25 Jan 2018 16:05:25 +0000 (11:05 -0500)] 
finish writing the blurb

7 years agoMore editing on the ChangeLog
Nick Mathewson [Thu, 25 Jan 2018 16:00:30 +0000 (11:00 -0500)] 
More editing on the ChangeLog

7 years agoUpdate HiddenServiceVersion man-page entry to only accept either 2 or 3.
Alexander Færøy [Thu, 25 Jan 2018 15:49:12 +0000 (16:49 +0100)] 
Update HiddenServiceVersion man-page entry to only accept either 2 or 3.

This patch updates the HiddenServiceVersion man-page entry to only
accept either 2 or 3 as argument and not a list of multiple versions.

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

7 years agospellcheck the changelog
Nick Mathewson [Thu, 25 Jan 2018 15:05:51 +0000 (10:05 -0500)] 
spellcheck the changelog

7 years agore-sort and re-flow the changelog
Nick Mathewson [Thu, 25 Jan 2018 15:02:52 +0000 (10:02 -0500)] 
re-sort and re-flow the changelog

7 years agoLight changelog relabeling and editing
Nick Mathewson [Thu, 25 Jan 2018 15:02:34 +0000 (10:02 -0500)] 
Light changelog relabeling and editing

7 years agoStart on a changelog for 0.3.1.1-alpha
Nick Mathewson [Wed, 24 Jan 2018 22:08:13 +0000 (17:08 -0500)] 
Start on a changelog for 0.3.1.1-alpha

7 years agoRemove changes files that also appeared in 0.3.2.9
Nick Mathewson [Wed, 24 Jan 2018 22:01:44 +0000 (17:01 -0500)] 
Remove changes files that also appeared in 0.3.2.9

7 years agoAlways look at the subprotocol versions summary flags
Nick Mathewson [Wed, 24 Jan 2018 18:52:51 +0000 (13:52 -0500)] 
Always look at the subprotocol versions summary flags

Previously, we wouldn't do this when running with a routerinfo_t in
some cases, leading to many needless calls to the protover module.

This change also cleans up the code in nodelist.c a bit.

Fixes bug 25008; bugfix on 0.2.9.4-alpha.

7 years agoAlso cache the protover summary in the routerinfo_t, if we're using that
Nick Mathewson [Wed, 24 Jan 2018 18:49:15 +0000 (13:49 -0500)] 
Also cache the protover summary in the routerinfo_t, if we're using that

7 years agoExtract code to summarize protocol versions into new function
Nick Mathewson [Wed, 24 Jan 2018 18:38:01 +0000 (13:38 -0500)] 
Extract code to summarize protocol versions into new function

This will let us put this summary into routerinfo_t too.

No behavior change.

7 years agoExtract protover summary flags into a new structure
Nick Mathewson [Wed, 24 Jan 2018 18:26:50 +0000 (13:26 -0500)] 
Extract protover summary flags into a new structure

This will let us use them on routerinfo_t as well as on
routerstatus_t, and save some time on relays.

No behavioral changes here.

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 24 Jan 2018 17:09:07 +0000 (12:09 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoFix a memory leak in build_unopened_fourhop
Nick Mathewson [Wed, 24 Jan 2018 17:08:39 +0000 (12:08 -0500)] 
Fix a memory leak in build_unopened_fourhop

This is a unit-test-only leak, but let's fix it anyway so it doesn't
hide real bugs.

Bug not in any released version of Tor.

7 years agoFix a memory leak in scheduler/loop_kist
Nick Mathewson [Wed, 24 Jan 2018 17:07:45 +0000 (12:07 -0500)] 
Fix a memory leak in scheduler/loop_kist

Fixes bug 25005.

7 years agoAdd missing static keywords
Taylor Yu [Tue, 23 Jan 2018 21:57:35 +0000 (15:57 -0600)] 
Add missing static keywords

crypto_openssl_header_version_str and crypto_openssl_version_str in
crypto_openssl_mgt.c should be static.

7 years agoopenssl_mutexes code belongs in openssl_mgt.c
Nick Mathewson [Tue, 23 Jan 2018 19:43:06 +0000 (14:43 -0500)] 
openssl_mutexes code belongs in openssl_mgt.c

7 years agoadd a missing "compat_openssl.h"
Nick Mathewson [Tue, 23 Jan 2018 19:41:46 +0000 (14:41 -0500)] 
add a missing "compat_openssl.h"

7 years agoperhaps this was the missing include?
Nick Mathewson [Tue, 23 Jan 2018 19:19:25 +0000 (14:19 -0500)] 
perhaps this was the missing include?

7 years agoAdd a missing include for openssl 1.0.2
Nick Mathewson [Tue, 23 Jan 2018 19:16:53 +0000 (14:16 -0500)] 
Add a missing include for openssl 1.0.2

7 years agoMerge remote-tracking branch 'mikeperry/bug24946'
Nick Mathewson [Tue, 23 Jan 2018 19:08:47 +0000 (14:08 -0500)] 
Merge remote-tracking branch 'mikeperry/bug24946'

7 years agoMerge remote-tracking branch 'asn/bug24896'
Nick Mathewson [Tue, 23 Jan 2018 19:06:27 +0000 (14:06 -0500)] 
Merge remote-tracking branch 'asn/bug24896'

7 years agoMerge remote-tracking branch 'ffmancera/bug24658-openssl'
Nick Mathewson [Tue, 23 Jan 2018 19:02:45 +0000 (14:02 -0500)] 
Merge remote-tracking branch 'ffmancera/bug24658-openssl'

7 years agoAdd onion service activity information to our heartbeat logs.
George Kadianakis [Tue, 23 Jan 2018 10:31:06 +0000 (12:31 +0200)] 
Add onion service activity information to our heartbeat logs.

7 years agoMove the openssl namespace back into .c files.
Fernando Fernandez Mancera [Mon, 22 Jan 2018 15:48:33 +0000 (16:48 +0100)] 
Move the openssl namespace back into .c files.

As we're trying not to have all the other modules in Tor, we moved the openssl
namespace includes back into crypto.c and crypto_openssl_mgt.c files.

Follows #24658.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
7 years agoBug 24946: Fix a warning message caused by a missed purpose check.
Mike Perry [Sat, 20 Jan 2018 03:16:24 +0000 (03:16 +0000)] 
Bug 24946: Fix a warning message caused by a missed purpose check.

Also fix three other checks (found by inspection of all
CIRCUIT_PURPOSE_C_GENERAL occurrences).

7 years agooxford comma for-the-win
Roger Dingledine [Fri, 19 Jan 2018 23:42:53 +0000 (18:42 -0500)] 
oxford comma for-the-win

7 years agoAdd a "falls through" comment to make gcc happy.
Nick Mathewson [Fri, 19 Jan 2018 22:29:36 +0000 (17:29 -0500)] 
Add a "falls through" comment to make gcc happy.

7 years agoMerge remote-tracking branch 'mikeperry/bug23101-mergeready-squashed'
Nick Mathewson [Fri, 19 Jan 2018 22:28:10 +0000 (17:28 -0500)] 
Merge remote-tracking branch 'mikeperry/bug23101-mergeready-squashed'

7 years agoBug 23101: Pre-build HS-specific circuits (instead of general).
Mike Perry [Fri, 22 Dec 2017 06:35:29 +0000 (06:35 +0000)] 
Bug 23101: Pre-build HS-specific circuits (instead of general).

Prebuilt circs are 4 hops, since only server side HSDIR and intro circs
are 3 hops, and it is OK if those sometimes take longer to build.

7 years agoAdd new circuit purposes for hsdir activity.
Mike Perry [Sat, 2 Dec 2017 02:28:16 +0000 (02:28 +0000)] 
Add new circuit purposes for hsdir activity.

This lets us control their path len and usage.

7 years agoImplement layer 2 and layer 3 guard pinning via torrc.
Mike Perry [Fri, 22 Dec 2017 05:43:44 +0000 (05:43 +0000)] 
Implement layer 2 and layer 3 guard pinning via torrc.

Block circuit canibalization when HSRendezvousMiddleNodes is active.
Also make it apply to all HS circuits, not just rends.