Commit Graph

171 Commits

Author SHA1 Message Date
Nick Mathewson
e7565855c0 Merge branch 'ticket31578' into ticket31578_merged 2019-09-11 08:59:29 -04:00
David Goulet
796a9b37ea Merge branch 'tor-github/pr/1264' 2019-09-09 14:53:12 -04:00
Nick Mathewson
a642a4cbd7 Merge branch 'ticket30924_042_04_squashed' into ticket30924_042_04_squashed_merged 2019-09-09 11:10:53 -04:00
David Goulet
a8a1ea4e0e practracker: Make you happy funny script
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-09-09 11:06:51 -04:00
Nick Mathewson
bc4ddbf4ac New practracker exceptions for dependency violations in headers
I've done this manually, since I don't want to override the existing
exceptions in this branch.
2019-09-05 16:17:50 -04:00
Nick Mathewson
318de94e49 Fix a bug in practracker's handling of .may_include in headers
I was expecting our filter code to work in a way it didn't.  I
thought that saying that DependencyViolation applied to "*" would
hit all of the files -- but actually, "*" wasn't implemented.  I had
to say "*.c" and "*.h"
2019-09-05 16:16:20 -04:00
David Goulet
6210c75076 Merge branch 'tor-github/pr/1246' 2019-09-04 08:27:36 -04:00
Nick Mathewson
03040903e6 practracker: handle empty files.
Previously practracker would fail on a file with no lines.
2019-09-02 15:40:35 -04:00
Nick Mathewson
3a2964577e practracker: Fix indentation in util.py
This commit only changes whitespace and removes a temporary comment.
2019-09-02 15:40:35 -04:00
Nick Mathewson
651bbe8a0d Practracker: only consider files under "src/" 2019-09-02 15:40:35 -04:00
Nick Mathewson
e3f7e5e65e practracker: make filename terminology uniform
Previously we often referred to "C files" and "H files", which is
more ambiguous than ".c files" and ".h files".
2019-08-29 09:20:27 -04:00
Nick Mathewson
c710518825 Add integration tests for new practracker features
These tests check our .may_include checking, and our header file
checking.

They do not pass yet: we have a bug in our filtering code.
2019-08-26 12:28:46 -04:00
Nick Mathewson
2780cbb9cb Merge branch 'ticket30935' into ticket30935_merged 2019-08-22 17:25:35 -04:00
David Goulet
d475d7c2fb Merge branch 'tor-github/pr/1244' 2019-08-22 17:10:22 -04:00
Nick Mathewson
5b3741e05a Document new practracker violation types, and add a practracker readme
Closes ticket 31476.
2019-08-21 10:17:26 -04:00
Nick Mathewson
cc48eff2d3 Merge branch 'ticket31176' into ticket31176_merged 2019-08-21 09:46:20 -04:00
Nick Mathewson
edf5a327c5 Merge branch 'ticket30914' into ticket30914_merged 2019-08-20 13:57:05 -04:00
Nick Mathewson
29bd43ab03 Merge remote-tracking branch 'tor-github/pr/1224' 2019-08-19 11:26:58 -04:00
Nick Mathewson
e7aabfce61 Merge remote-tracking branch 'tor-github/pr/1235' 2019-08-19 11:10:21 -04:00
George Kadianakis
e411fcabd7 Merge branch 'tor-github/pr/1220' 2019-08-19 18:02:44 +03:00
George Kadianakis
b257e8e553 Merge remote-tracking branch 'mike/bug31356+logs-rebased2' into bug31356_final 2019-08-19 17:53:00 +03:00
David Goulet
81e37b81f1 practracker: Make exceptions.txt happy
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-19 09:47:52 -04:00
Mike Perry
6deba34fee Practracker 2019-08-12 14:06:08 -05:00
Neel
64d2133a61 Move the connection_edge_process_relay_cell() assignments out of if statements in circuit_receive_relay_cell() 2019-08-08 13:05:46 -04:00
Nick Mathewson
71e5af0221 pre-push hook: Only run practracker when a special file is present
Closes ticket 30979.
2019-08-08 11:36:05 -04:00
Nick Mathewson
35cfe2e776 Merge remote-tracking branch 'tor-github/pr/1208' 2019-08-07 09:49:49 -04:00
David Goulet
2b225aaa77 practracker: Make it happy after rebase
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 08:01:26 -04:00
David Goulet
c5b00c5a51 hs-v3: Add consensus parameters for DoS defenses
Part of #15516

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
George Kadianakis
d7afdb3b0f Merge branch 'tor-github/pr/1195' 2019-08-06 14:51:47 +03:00
Nick Mathewson
0f4b245b20 update exceptions file for depencency violations 2019-08-05 17:48:06 -04:00
Nick Mathewson
a5971d732e Move include-violation checking into its own function. 2019-08-05 17:48:06 -04:00
Nick Mathewson
2a3c727dfe Make includes interface more like the rest of practracker
Everything else assumes that somebody else will open the file for it.
2019-08-05 17:48:06 -04:00
Nick Mathewson
6b26281b50 practracker: a violation of a .may_include rule is now a problem.
We treat "0" as the expected number, and warn about everything
else.  The problem type is "dependency-violation".
2019-08-05 17:48:06 -04:00
Nick Mathewson
720951f056 Teach include-checker about advisory rules
A .may_includes file can be "advisory", which means that some
violations of the rules are expected.  We will track these
violations with practracker, not as automatic errors.
2019-08-05 17:04:00 -04:00
Nick Mathewson
6fb74753c2 Move checkIncludes inside practracker
Update the makefile accordingly.
2019-08-05 14:10:40 -04:00
George Kadianakis
ce477da8a7 Ignore regular cells in padding circuits.
Padding circuits were regular cells that got closed before their padding
machine could finish. This means that they can still receive regular cells from
their past life, but they have no way or reason to answer them anymore. Hence
let's ignore them before they even get to the proper subsystems.
2019-08-05 18:03:23 +03:00
Nick Mathewson
d5ccd0fa84 Add exceptions for current .h practracker problems. 2019-08-05 10:32:39 -04:00
Nick Mathewson
9a1e9b1d6c Teach practracker about .h files
I'm using 500 as a file size limit, and 15 as an include limit.
This affects comparatively few files, but I think they are the worst
ones.

Closes ticket 31175.
2019-08-05 10:31:02 -04:00
Nick Mathewson
1440c2cb34 Adjust test_practracker.sh to work on windows
The required change is to ignore trailing CRs when diffing files.
2019-08-01 15:43:54 -04:00
Nick Mathewson
fa60fee8d5 practracker: Add unit tests to test script, and test script to makefile
This makes all of the practracker tests get run by make check, and
hence by our CI.

Closes ticket 31304.
2019-08-01 14:01:43 -04:00
Nick Mathewson
5d98b54725 Port practracker unit tests to python 3 2019-08-01 14:00:48 -04:00
Nick Mathewson
e57209dc32 Regenerate the practracker exceptions.txt file 2019-08-01 10:25:42 -04:00
Nick Mathewson
a4e4896e66 practracker: restore exceptions.txt header when running --regen 2019-08-01 10:25:20 -04:00
David Goulet
c4864de573 Merge branch 'tor-github/pr/1177' 2019-08-01 10:18:10 -04:00
Nick Mathewson
19536fd18d practracker: replaces "overstrict" with "overbroad"
I had the logic reversed here.
2019-08-01 09:35:33 -04:00
Nick Mathewson
3221dc1b32 Lower check of TOR_DISABLE_PRACTRACKER
Since we sometimes call practracker directly, that's where we should
check the TOR_DISABLE_PRACTRACKER envvar.
2019-08-01 08:40:56 -04:00
Nick Mathewson
8d3f3e5d30 Practracker: add an integration test.
This test runs practracker with a set of 0 thresholds, to make sure
that it enumerates all its values right.  It tries running with an
empty exceptions file, and with an exceptions file that covers
_some_ of the data, and it makes sure that the outputs are as expected.
2019-07-30 12:14:46 -04:00
Nick Mathewson
a79e2c2975 practracker: better warning/regen handling
Now that there is only one toplevel place where we print problems,
we can redirect just that one print to a file when we are
regenerating the exceptions.txt file.  Previously we redirected
sys.stdout, which is naughty, and forced us to send warnings (and
warnings alone) to stderr.
2019-07-30 11:54:05 -04:00
Nick Mathewson
3f303c102a Practracker: new flags to control output.
These flags let you suppress the message about the number of
problems and warnings, and let you control the thresholds above
which something counts as a problem.

I need this for testing.
2019-07-30 11:49:50 -04:00
Nick Mathewson
31a0b81854 practracker: Remove problemvault global. 2019-07-30 10:17:56 -04:00