Commit Graph

268 Commits

Author SHA1 Message Date
Alexander Færøy
4f4728a004 Merge branch 'maint-0.4.4' into maint-0.4.5 2021-02-05 17:40:25 +00:00
Alexander Færøy
aa1a053d55 Fix CI build: practracker error in connection_edge.c, take two.
This was a bad copy and paste error from the previous commit which
generated a duplicated entry error from practracker.

Unreviewed build fix.

See: tor#40275.
2021-02-05 17:39:21 +00:00
Alexander Færøy
3496804827 Merge branch 'maint-0.4.4' into maint-0.4.5 2021-02-05 17:17:05 +00:00
Alexander Færøy
62b98716ff Fix CI build: practracker error in connection_edge.c.
We solve this error by allowing the connection_exit_connect() function
to be 130 lines long.

Unreviewed build fix commit.

See: tor#40275.
2021-02-05 17:16:05 +00:00
Alexander Færøy
5f61e19d8a Expose TOR_PT_OUTBOUND_BIND_ADDRESS_{V4,V6} to Pluggable Transports.
This patch adds support for exposing the environment variables
`TOR_PT_OUTBOUND_BIND_ADDRESS_V4` and `TOR_PT_OUTBOUND_BIND_ADDRESS_V6` to
Pluggable Transport proccesses. These two values will contain the IPv4
and IPv6 address that the user have specified in torrc that they wish
the PT to use for all outgoing IP packets.

It is important to note here that it is up to the indvidual Pluggable
Transport if they are willing to honor these values or ignore them
completely.

One can test this feature using the following dummy PT written in POSIX
shell script:

    #!/bin/sh

    echo "LOG SEVERITY=warning MESSAGE=\"Value for IPv4: ${TOR_PT_OUTBOUND_BIND_ADDRESS_V4}\""
    echo "LOG SEVERITY=warning MESSAGE=\"Value for IPv6: ${TOR_PT_OUTBOUND_BIND_ADDRESS_V6}\""

    while true ; do
        sleep 1
    done

with the following entries in your torrc:

    OutboundBindAddressPT 203.0.113.4
    OutboundBindAddress 203.0.113.5
    OutboundBindAddressPT 2001:db8::4
    OutboundBindAddress 2001:db8::5

See: https://bugs.torproject.org/5304
2020-10-06 09:30:11 -04:00
vnepveu
43672f9fca Implement IPv6 sybil protection.
[This is a squashed patch for ticket 7193, based on taking a "git
   diff" for the original branch, then applying it with "git apply
   -3".  I earlier attempted to squash the branch with "git rebase",
   but there were too many conflicts. --nickm]
2020-09-23 11:30:15 -04:00
Daniel Pinto
ebaa1a1d23 Make options_init_from_torrc smaller #40102
Split implementation of several command line options from
options_init_from_torrc into smaller isolated functions.
2020-08-14 16:01:02 +01:00
Daniel Pinto
ccdd0d801a Minor style improvements. #30045 2020-08-03 20:08:17 +01:00
Daniel Pinto
1474ab3395 Add --format argument to --key-expiration option. #30045 2020-08-01 01:08:37 +01:00
Daniel Pinto
29307c0625 Add running glibc version to the log. #40047
Also adds the compiled and running glibc version when using the
--library-versions flag.
2020-07-17 18:45:57 +01:00
David Goulet
d80c34d214 trace: Move LTTng specific declartion to .inc file
LTTng tracepoint probe declaration is not really following a C standard that
coccinelle and checkSpace.pl likes.

Move everything to a .inc file and standardize the trace_probes_circuit.h
header to include that LTTng specific file if the instrumentation was enabled
at configure time.

Part of #32910

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:18:33 -04:00
David Goulet
bf0e2ae0d0 trace: Add single tracepoint in circuit subsystem
This is the very first tracepoint in tor. It is in the circuit subsystem for
when a new circuit opens.

LTTng instrumentation requires lot more around a tracepoint than USDT thus
this commit only adds one tracepoint in order to outline a base to add more
tracepoints later.

The idea is that we separate subsystem into what LTTng defines as "providers"
so the circuit provider contains the tracepoint definitions for the circuit
subsystem.

Signed-off-by: David Goulet <dgoulet@torproject.org>

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:08 -04:00
George Kadianakis
3bb9b7e743 Merge branch 'tor-github/pr/1934' 2020-07-03 10:50:47 +03:00
Nick Mathewson
8f362b7bce Extract extend_info manipulation functions into a new file. 2020-07-02 09:51:03 -04:00
David Goulet
6da8c0b4fa addr: Rename resolve_my_address to be v4 specific
Part of #33233

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-06-23 09:25:36 -04:00
Mike Perry
c047c6d5b8 practracker FTL!
Faster Than Light!
2020-06-16 13:44:10 -05:00
George Kadianakis
3cb77a9cca Merge branch 'maint-0.4.4' 2020-06-11 17:29:54 +03:00
George Kadianakis
52edea121e Fold in a changes file and update exceptions.txt.
Co-authored-by: Florentin Rochet <florentin.rochet@uclouvain.be>
2020-06-11 16:13:25 +03:00
Nick Mathewson
fc16dbf7aa Remove "enable_practracker_in_hooks" for 0.4.4. 2020-06-09 15:47:25 -04:00
Nick Mathewson
354f085e5f Merge remote-tracking branch 'tor-github/pr/1888/head' 2020-06-09 15:44:58 -04:00
teor
8ec4d9cc3c practracker: Accept extra file lines, enforce a smaller function
Accept extra lines in nodelist and routerlist due to extra features, and
due to refactors that simplify some functions.

Most of the refactor eliminated duplicate code in smaller functions, so
there's only one large function that got smaller.

Part of 34200.
2020-05-18 21:53:52 +10:00
teor
de979dd7bd practracker: Allow a few extra lines in circuituse
Part of 33222.
2020-05-13 20:08:29 +10:00
teor
b64972edcd practracker: Accept extra or.h lines 2020-05-11 14:39:42 +10:00
teor
24099680f1 Appease practracker: wrapping costs lines 2020-05-07 20:19:19 +10:00
David Goulet
a25f167072 config: New file resolve_addr.{c|h}
Move a series of function from config.c into that new file which is related to
address resolving.

Part of #33789

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-05-05 14:24:04 -04:00
teor
a202f03c64 practracker: Accept some wrapped long lines
Part of 33222.
2020-04-30 15:15:53 +10:00
teor
efcae919ae
practracker: Accept the connection buf refactor
Accept a few extra lines from the connection_buf_read_from_socket()
refactor.

Cleanup after 33131.
2020-04-30 13:55:26 +10:00
teor
ed4420b4b8 practracker: Allow an extra line in tor_addr_parse_mask_ports()
We added a cast, and wrapped a line.
2020-04-30 06:54:42 +10:00
teor
f5c34d340d
Run practracker regen
Lock-in improvements.
Accept some small function size increases.
Allow a small amount of extra file size increase.
2020-04-14 15:42:52 +10:00
Nick Mathewson
80031db32a Merge remote-tracking branch 'tor-github/pr/1801/head' 2020-04-09 11:50:20 -04:00
teor
75aba30abf relay: Run practracker --regen
Lock in some file and function size improvements.

Accept some small file size and dependency increases.

Part of 33633.
2020-04-09 11:00:04 +10:00
Nick Mathewson
ea9ff58921
Try rewriting normalize_srcdir to normalize harder. 2020-04-07 17:36:05 +10:00
Nick Mathewson
d3db84c1e7
Make check_subsystem_order work in distcheck builds. 2020-04-07 17:36:02 +10:00
Nick Mathewson
5f49695f94
Make check_subsystem_order work in out-of-tree builds. 2020-04-07 17:35:58 +10:00
Nick Mathewson
978b7ef45c Teach --check-subsystem-order to take input from stdin 2020-03-26 12:30:30 -04:00
Nick Mathewson
a40d539f7c Extend includes.py to compare topology with subsystem init order. 2020-03-26 12:17:53 -04:00
teor
a34a88c6f1
practracker: Accept changes
Accept a smaller file and function.
Let router.c grow slightly without warning.
Accept an extra comment line.

Cleanup after 32588.
2020-03-21 04:10:24 +10:00
teor
5d53b2317f
practracker: Accept larger dirvote file
Due to improved function comments.
2020-03-21 02:48:51 +10:00
teor
78b2984ac9
practracker: Regenerate exceptions file
Accept the current state of the tor codebase, including all the
files and functions that have increased technical debt over the
last few months.

Accepts all the current practracker warnings, so that reviewers
can focus on new warnings.

Closes ticket 33635.
2020-03-19 16:59:52 +10:00
teor
c86d08e3e6
Run "practracker.py --regen-overbroad"
We've successfully resolved a bunch of technical debt over the last
few months. Let's remove the allowances for that debt from the
practracker exceptions.
2020-03-17 23:02:16 +10:00
David Goulet
df3f2bd9aa hs-v3: Log reasons why service can't upload descriptor
When a service can not upload its descriptor(s), we have no logs on why. This
adds logging for each possible reason for each descriptors.

That logging is emitted every second so it is rate limited for each reason and
per descriptor.

Closes #33400

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-03-11 15:32:11 +02:00
Nick Mathewson
caa392a73a Merge remote-tracking branch 'tor-github/pr/1685/head' 2020-02-24 07:45:20 -05:00
Nick Mathewson
7ba7f9c0de Merge branch 'maint-0.4.3' 2020-02-20 10:44:43 -05:00
Nick Mathewson
7b42502869 Merge remote-tracking branch 'tor-github/pr/1757/head' into maint-0.4.3 2020-02-20 10:44:36 -05:00
Nick Mathewson
66bbdadbbe Merge branch 'extract_routerkeys_squashed' 2020-02-20 10:41:12 -05:00
Nick Mathewson
1d068625dd Move relay_handshake.[ch] into src/feature/relay, and make it optional 2020-02-20 10:41:06 -05:00
Nick Mathewson
09fb7987c5 Merge branch 'maint-0.4.3' 2020-02-20 08:50:18 -05:00
Nick Mathewson
dd4fa9b468 Extract relay-only handshake code into its own file.
This is not the only relay-only handshake code, but it is most of
such code that is in connection_or.c.
2020-02-19 19:11:57 -05:00
teor
57ff8d4a53
practracker: Read unicode files when using Python 2
Allow the "practracker" coding best practices checking script to read
unicode files, when using Python 2.

We made the script use unicode literals in 0.4.3.1-alpha, but didn't
change the codec for opening files.

Fixes bug 33374; bugfix on 0.4.3.1-alpha.
2020-02-19 08:22:01 +10:00
teor
d8cbb2965e
Run "practracker --regen-overbroad"
Closes ticket 33373.
2020-02-19 08:13:02 +10:00