Commit Graph

1090 Commits

Author SHA1 Message Date
rl1987 d8e24684b6 Check for possible failures of tor_inet_ntop/tor_inet_ntoa in fmt_addr32 and tor_dup_ip 2020-05-21 13:41:15 +03:00
David Goulet ca13249dcc Merge branch 'tor-github/pr/1886' 2020-05-19 15:18:17 -04:00
Nick Mathewson 9b55a62e73 Merge branch 'maint-0.4.3' 2020-05-19 09:39:12 -04:00
Nick Mathewson 68fe8826dd Doxygen: fix unbalanced groups.
Closes ticket 34255.
2020-05-19 09:18:39 -04:00
Nick Mathewson 1557e73c82 Merge branch 'bug34130_035' 2020-05-12 12:58:19 -04:00
Daniel Pinto 2913dbd6d9 Fix crash when tor is compiled with NSS and seccomp sandbox is enabled
Adds seccomp rules for socket and getpeername used by NSS
2020-05-12 12:56:06 -04:00
Daniel Pinto cce16a939c Improve logging of included config files 2020-05-08 01:10:59 +01:00
Nick Mathewson 4a2347d290 Merge branch 'maint-0.4.3'
Amazingly, this time we had no merge conflicts with "falls through" comments.
2020-05-06 16:55:41 -04:00
Nick Mathewson c116728209 Use __attribute__((fallthrough)) rather than magic GCC comments.
GCC added an implicit-fallthrough warning a while back, where it
would complain if you had a nontrivial "case:" block that didn't end
with break, return, or something like that.  Clang recently added
the same thing.

GCC, however, would let you annotate a fall-through as intended by
any of various magic "/* fall through */" comments.  Clang, however,
only seems to like "__attribute__((fallthrough))".  Fortunately, GCC
accepts that too.

A previous commit in this branch defined a FALLTHROUGH macro to do
the right thing if GNUC is defined; here we replace all of our "fall
through" comments with uses of that macro.

This is an automated commit, made with the following perl one-liner:

  #!/usr/bin/perl -i -p
  s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;

(In order to avoid conflicts, I'm applying this script separately to
each maint branch. This is the 0.4.3 version.)
2020-05-06 16:55:25 -04:00
Nick Mathewson cc397449fc Use __attribute__((fallthrough)) rather than magic GCC comments.
GCC added an implicit-fallthrough warning a while back, where it
would complain if you had a nontrivial "case:" block that didn't end
with break, return, or something like that.  Clang recently added
the same thing.

GCC, however, would let you annotate a fall-through as intended by
any of various magic "/* fall through */" comments.  Clang, however,
only seems to like "__attribute__((fallthrough))".  Fortunately, GCC
accepts that too.

A previous commit in this branch defined a FALLTHROUGH macro to do
the right thing if GNUC is defined; here we replace all of our "fall
through" comments with uses of that macro.

This is an automated commit, made with the following perl one-liner:

  #!/usr/bin/perl -i -p
  s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
2020-05-06 16:51:11 -04:00
Nick Mathewson 82effefb69 Merge branch 'maint-0.4.3' 2020-05-06 16:47:03 -04:00
Nick Mathewson fecc5fd38d Merge branch 'maint-0.4.2' into maint-0.4.3 2020-05-06 16:47:03 -04:00
Nick Mathewson d04b708b4b Merge branch 'maint-0.4.1' into maint-0.4.2 2020-05-06 16:47:03 -04:00
Nick Mathewson 3e42464f5a Merge branch 'bug34078_prelim_035' into bug34078_prelim_041 2020-05-06 15:18:36 -04:00
Nick Mathewson 3d3641152b Remove an incorrect "Fall through" comment. 2020-05-06 15:08:02 -04:00
Nick Mathewson 8798c0a94a address.c: add a single (harmless) missing break; 2020-05-06 15:08:02 -04:00
Nick Mathewson 6c3c94357c Add a fallthrough macro.
This macro defers to __attribute__((fallthrough)) on GCC (and
clang).  Previously we had been using GCC's magic /* fallthrough */
comments, but clang very sensibly doesn't accept those.

Since not all compiler recognize it, we only define it when our
configure script detects that it works.

Part of a fix for 34078.
2020-05-06 15:08:02 -04:00
teor 6dc9930d3a Merge branch 'pr1870_squashed' 2020-04-30 22:22:09 +10:00
Neel Chauhan 7bf257b129 Define and use TOR_ADDRPORT_BUF_LEN 2020-04-30 22:21:48 +10:00
Nick Mathewson 49800cf539 Merge remote-tracking branch 'tor-github/pr/1864/head' 2020-04-29 19:16:40 -04:00
teor cd7e2fc210 net: Make all address bytes functions take uint8_t *
Part of 33817.
2020-04-30 06:54:42 +10:00
teor f62b051e87 Rename tor_addr_get_ipv6_bytes to tor_addr_copy_ipv6_bytes
This is an automated commit, generated by this command:

./scripts/maint/rename_c_identifier.py \
        tor_addr_get_ipv6_bytes tor_addr_copy_ipv6_bytes
2020-04-30 05:54:39 +10:00
teor 6c458d2d6e log/util_bug: Make IF_BUG_ONCE() support ALL_BUGS_ARE_FATAL
... and DISABLE_ASSERTS_IN_UNIT_TESTS.

Make all of tor's assertion macros support the ALL_BUGS_ARE_FATAL and
DISABLE_ASSERTS_IN_UNIT_TESTS debugging modes.

Implements these modes for IF_BUG_ONCE(). (It used to log a non-fatal
warning, regardless of the debugging mode.)

Fixes bug 33917; bugfix on 0.2.9.1-alpha.
2020-04-29 22:43:09 +10:00
teor 16f3f6a1af relay/circuitbuild: Re-use IPv6 connections for circuits
Search for existing connections using the remote IPv4 and IPv6
addresses.

Part of 33817.
2020-04-29 22:43:09 +10:00
teor a72e017e7f net: Add fmt_addrport_ap() and fmt_addr_family()
Add fmt_addrport_ap(), a macro that takes a tor_addr_port_t, and uses
it to call fmt_addrport().

Add fmt_addr_family(), a function that returns a string constant
describing the address family.

Utility functions for 33817.
2020-04-29 22:43:09 +10:00
teor e9d04b05c6 net: Remove an extra space in address.h 2020-04-29 22:43:09 +10:00
teor bd6ab90ad4 core/or: Support IPv6 EXTEND2 cells
Allow clients and relays to send dual-stack and IPv6-only EXTEND2 cells.
Parse dual-stack and IPv6-only EXTEND2 cells on relays.

Relays do not make connections or extend circuits via IPv6: that's the
next step.

Closes ticket 33901.
2020-04-29 22:43:09 +10:00
Nick Mathewson cbe9e56590 Merge remote-tracking branch 'tor-github/pr/1868/head' 2020-04-29 08:32:44 -04:00
teor 3253c357ee Run "make autostyle" 2020-04-29 22:08:33 +10:00
teor 6eec43161a rand: Clarify the crypto_rand_uint() range 2020-04-29 21:50:37 +10:00
Nick Mathewson 4dd4dbf046 Merge remote-tracking branch 'onionk/inbufoverflow1-043' into ticket33131_044 2020-04-24 08:15:53 -04:00
Nick Mathewson 25729910af Merge branch 'maint-0.4.3' 2020-04-09 08:33:36 -04:00
Nick Mathewson c4da0a5094 Add fsync to list of syscalls permitted by sandbox
(Our fix for 33087 requires this, I believe.)
2020-04-09 08:33:19 -04:00
Nick Mathewson c2aea6134a Merge remote-tracking branch 'tor-github/pr/1723/head' into maint-0.4.3 2020-04-09 08:30:14 -04:00
David Goulet 6ab11bbf30 hs-v3: Report SOCKS ExtendedErrors when all intro timed out
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-08 07:56:54 -04:00
teor 1720a2191d address: Simplify tor_addr_is_valid()
And rewrite the function comment.

Part of 33679.
2020-04-07 23:11:17 +05:30
MrSquanchee cbd3f88831 Added tests for tor_addr_is_null/valid()
Added tests for tor_addr_is_valid(),
and added tests for tor_addr_is_null(),
which is not modfied.
Ticket 33679
2020-04-07 23:11:17 +05:30
teor 065ccda4f6 Merge branch 'pr1838_squashed' 2020-04-07 17:36:17 +10:00
David Goulet 27e2989fe9 Merge branch 'tor-github/pr/1775' 2020-03-30 13:31:56 -04:00
Roger Dingledine 46f4f82ac9 correct tor_addr_family() function comment
kind of a losing game to remember to update that comment when
we add another possible family, but hey, maybe it will be a while
until we add one more.
2020-03-27 03:46:54 -04:00
Nick Mathewson 3f6e37b1bc Add a SUBSYS_DECLARE_LOCATION() to every subsystem. 2020-03-26 11:20:20 -04:00
Nick Mathewson 53d74c0954 Add a "location" field for subsystems to declare which file they are in. 2020-03-26 11:20:20 -04:00
cypherpunks 64a934ff05 buf: use BUF_MAX_LEN 2020-03-24 05:56:43 +00:00
cypherpunks 9e988406c7 net, tls: use BUF_MAX_LEN 2020-03-24 05:56:15 +00:00
cypherpunks 9ce9513898 buf: use INT_MAX - 1 in checks
No functionality change.
2020-03-24 05:55:34 +00:00
cypherpunks bb3eda8617 net, tls: use INT_MAX - 1 in checks for buf_t
No functionality change.
2020-03-24 05:54:37 +00:00
cypherpunks f46b9320ae buf: add BUF_MAX_LEN 2020-03-24 05:53:01 +00:00
George Kadianakis a4d60ff854 Merge branch 'maint-0.4.3' 2020-03-23 16:57:27 +02:00
George Kadianakis 29420ab396 Merge branch 'tor-github/pr/1788' into maint-0.4.3 2020-03-23 16:56:59 +02:00
Nick Mathewson 7059c32968 Merge branch 'maint-0.4.3' 2020-03-18 08:20:38 -04:00