Commit Graph

20339 Commits

Author SHA1 Message Date
Nick Mathewson
44388757c4 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-18 08:13:48 -05:00
Nick Mathewson
c8a27d89b2 Merge branch 'maint-0.3.2' 2018-01-18 08:13:48 -05:00
Nick Mathewson
f406b9df05 Merge branch 'bug24826_031' into maint-0.3.1 2018-01-18 08:13:45 -05:00
Nick Mathewson
77026f8a87 Merge branch 'bug22798_029_squashed' 2018-01-17 13:26:41 -05:00
Nick Mathewson
959af20247 Merge branch 'maint-0.3.2' 2018-01-17 11:13:18 -05:00
Nick Mathewson
4e653ac2ca Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-17 11:12:15 -05:00
Nick Mathewson
86aa7f0a3f Merge branch 'maint-0.3.2' 2018-01-17 10:50:58 -05:00
Nick Mathewson
57eab23ea5 update comment; ignore argument on non-win 2018-01-17 10:40:00 -05:00
Nick Mathewson
1efb84215e Improve Windows performance with SIO_IDEAL_SEND_BACKLOG_QUERY.
Patch written by "Vort" on trac. Addresses ticket 22798.
2018-01-17 10:40:00 -05:00
Nick Mathewson
60dfdd9b15 Merge branch 'bug21074_029' 2018-01-17 09:07:50 -05:00
Nick Mathewson
0bfd5a6597 Add a cast to avoid a signed/unsigned comparison 2018-01-17 09:06:32 -05:00
Nick Mathewson
454d854363 Merge branch 'bug21074_029' 2018-01-16 14:13:39 -05:00
Nick Mathewson
01adeb2471 Merge branch 'stack_em_up' 2018-01-16 13:31:29 -05:00
Nick Mathewson
d8c1c70d7a Repair a crash bug in src/test/bench
This was caused because of the new KeyDirectory and CacheDirectory
options not being set. Bugfix on 0.3.3.0-alpha; not in any released
Tor.
2018-01-16 13:29:11 -05:00
Nick Mathewson
4bb831e087 Improve fragile-hardening performance of consensus_split_lines.
For whatever reason, in my testing, using memchr() here improves
performance over strchr() by a great deal.

Fixes bug 24826; bugfix on 0.3.1.1-alpha.
2018-01-16 12:42:40 -05:00
Nick Mathewson
6b2e856122 Fix a (spurious) scan-build warning in test_introduce1_validation()
Since helper_create_introduce1_cell() checks "cell" for nullness,
scan-build is concerned that test_introduce1_validation()
dereferences it without checking it.  So, add a check.

Not backporting, since this is spurious, _and_ tests-only.
2018-01-16 08:36:34 -05:00
Roger Dingledine
af8cadf3a9 Remove false positives from channel_is_client()
Fix a set of false positives where relays would consider connections
to other relays as being client-only connections (and thus e.g.
deserving different link padding schemes) if those relays fell out
of the consensus briefly.

Now we look only at the initial handshake and whether the connection
authenticated as a relay.

Fixes bug 24898; bugfix on 0.3.1.1-alpha.
2018-01-15 22:33:40 -05:00
Roger Dingledine
7ce335c921 v3 onion services now obey MAX_REND_FAILURES
New-style (v3) onion services now obey the "max rendezvous circuit
attempts" logic.

Previously they would make as many rendezvous circuit attempts as they
could fit in the MAX_REND_TIMEOUT second window before giving up.

Fixes bug 24894; bugfix on 0.3.2.1-alpha.
2018-01-15 16:41:47 -05:00
Nick Mathewson
edc87b263f Merge remote-tracking branch 'ffmancera/bug24861' 2018-01-12 13:29:53 -05:00
Fernando Fernandez Mancera
06368e5310 Fix minGW compatibility issue with zu format specifier.
Define TOR_PRIuSZ as minGW compiler doesn't support zu format specifier for
size_t type.

Fixes #24861 on ac9eebd.

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-12 17:44:30 +01:00
Nick Mathewson
4c651b8c04 Note contactinfo and myfamily as required in more places
Includes a sentence from cypherpunks; for ticket 24526.
2018-01-11 20:00:18 -05:00
Nick Mathewson
a3d1c38ea6 Merge branch 'bug24582' 2018-01-11 19:57:57 -05:00
Nick Mathewson
42751e2123 On shutdown, mark openssl as uninitialized.
This causes openssl to get completely reinitialized on startup,
which is probably a good idea.
2018-01-11 13:00:15 -05:00
Nick Mathewson
18ea91ee6b Make the warnings about restarting tor in-process more scary. 2018-01-11 12:46:50 -05:00
Nick Mathewson
05ac3d0458 Merge branch 'restart_nocrash' 2018-01-11 12:45:25 -05:00
Nick Mathewson
751595551a Merge branch 'simplify_transition_allowed' 2018-01-11 12:39:37 -05:00
Nick Mathewson
c349bfec36 Merge branch 'bug24526_squashed' 2018-01-11 12:33:52 -05:00
Nick Mathewson
ac0f819ce5 Note contactinfo and myfamily as required in more places
Includes a sentence from cypherpunks; for ticket 24526.
2018-01-11 12:33:30 -05:00
Nick Mathewson
e8bd806412 Add a blank line per dgoulet review. 2018-01-11 12:29:29 -05:00
Nick Mathewson
d0adf5ae95 Merge branch 'bug24584' 2018-01-11 12:28:29 -05:00
Nick Mathewson
81aec1449b Compute flavor name before dereference, to avoid a STACK warning.
(See 24423)
2018-01-11 11:31:03 -05:00
Nick Mathewson
7a60600411 Merge remote-tracking branch 'ffmancera/github/bug24573' 2018-01-11 08:31:25 -05:00
Nick Mathewson
c8c258a433 Merge branch 'bug24733_squashed_2' 2018-01-10 12:57:23 -05:00
Nick Mathewson
519fa1a3e6 Document the alignment limitation of tor_free() 2018-01-10 12:57:13 -05:00
Nick Mathewson
f71bbd20a4 Extract the raw_free() of ifc_buf into a new function.
Explain the problem more correctly.
2018-01-10 12:57:13 -05:00
teor
54899b404c Stop invoking undefined behaviour by using tor_free() on an unaligned pointer
... in get_interface_addresses_ioctl().

This pointer alignment issue exists on x86_64 macOS, but is unlikely to exist
elsewhere. (i386 macOS only requires 4-byte alignment, and other OSs have
8-byte ints.)

Fixes bug 24733; not in any released version of tor.
2018-01-10 12:57:13 -05:00
Nick Mathewson
ca1d1c382c Merge remote-tracking branch 'ffmancera/github/bug24501' 2018-01-10 12:46:39 -05:00
Nick Mathewson
d8c0c62c7b Remove needless parentheses 2018-01-10 09:39:13 -05:00
Nick Mathewson
4715d81809 Merge remote-tracking branch 'teor/Bug-23966' 2018-01-10 09:38:38 -05:00
Nick Mathewson
34c6034aa7 Increment version to 0.3.2.9-dev 2018-01-09 10:12:25 -05:00
Nick Mathewson
1f7f930f9e Increment version to 0.3.2.9 2018-01-08 11:39:24 -05:00
Nick Mathewson
9ba69be96c Merge branch 'maint-0.3.2'
There was a merge conflict on fallback_dirs.inc, which we resolve in
favor of the newly generated version for #24801.
2018-01-08 11:10:53 -05:00
Nick Mathewson
e3ab27001f Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-08 11:10:36 -05:00
Nick Mathewson
1c5c5f0e50 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-08 11:10:36 -05:00
Nick Mathewson
b85fa0bd5f Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-08 11:10:36 -05:00
Nick Mathewson
a42e52dded Add 7 other fallback dirs from teor's tests
These are from "fallback_dirs_2018_01_06_2323_UTC_44aa1adf35_AU.inc"
2018-01-08 11:03:44 -05:00
Nick Mathewson
491c09c19a Update the fallback_dirs.inc file: part 1
This takes the updated fallback_dirs_2018_01_06_CA.inc from
pastly's scan.
2018-01-08 10:57:06 -05:00
Nick Mathewson
d637468128 Merge remote-tracking branch 'arma/bug24555' 2018-01-08 10:45:40 -05:00
Nick Mathewson
748ad2124d Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-08 09:35:55 -05:00
Nick Mathewson
942fa0c4a2 Merge branch 'maint-0.3.2' 2018-01-08 09:35:55 -05:00
Nick Mathewson
a1ce1ab201 Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-08 09:34:57 -05:00
Nick Mathewson
8042c356f4 Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-08 09:34:56 -05:00
Nick Mathewson
26e28829da Merge branch 'maint-0.2.5' into maint-0.2.9 2018-01-08 09:34:56 -05:00
Fernando Fernandez Mancera
7353c9496e Add free_openssl() to crypto_openssl module.
Add free_openssl() function to free the memory allocated for OpenSSL version
management variables. It is required since OpenSSL management has been isolated
from the crypto module.

Follows #24658.

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-08 15:31:41 +01:00
Fernando Fernandez Mancera
4022277272 Refactor crypto.[ch] into smaller OpenSSL module.
Add two new files (crypto_openssl.c, crypto_openssl.h) as new module of
crypto.[ch]. This new module includes all functions and dependencies related
to OpenSSL management. Those have been removed from crypto.[ch].

All new changes related to OpenSSL management must be done in these files.

Follows #24658

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-08 14:02:17 +01:00
Karsten Loesing
8efbeb0982 Update geoip and geoip6 to the January 5 2018 database. 2018-01-08 11:36:38 +01:00
Roger Dingledine
40cd992abb avoid calling format_iso_time() with TIME_MAX
If we tried to move a descriptor from routerlist->old_routers
back into the current routerlist, we were preparing a buffer with
format_iso_time() on ri->cert_expiration_time, and doing it preemptively
since router_add_to_routerlist() might free ri so we wouldn't be able
to get at it later in the function.

But if the descriptor we're moving doesn't have any ed signature, then
its cert will be marked to expire at TIME_MAX, and handing TIME_MAX
to format_iso_time() generates this log warning:

correct_tm(): Bug: gmtime(9223372036854775807) failed with error Value too large for defined data type: Rounding down to 2037

The fix is to preemptively remember the expiry time, but only prepare
the buffer if we know we're going to need it.

Bugfix on commit a1b0a0b9, which came about as part of a fix for bug
20020, and which is not yet in any released version of Tor (hence no
changes file).
2018-01-07 02:15:18 -05:00
Roger Dingledine
44aa1adf35 make a comment a bit more useful 2018-01-06 15:03:35 -05:00
Roger Dingledine
94ec5af5fe whitespace and typo fixes 2018-01-06 15:02:12 -05:00
Roger Dingledine
4f83d6d6ad Merge branch 'maint-0.3.2' 2018-01-05 18:44:08 -05:00
Roger Dingledine
5f2c7a8567 remove redundant "implement this" from log message 2018-01-05 18:23:07 -05:00
Nick Mathewson
143da73165 Merge remote-tracking branch 'teor/fallback-code-2018-01' 2018-01-05 16:47:28 -05:00
Nick Mathewson
0b6fe3c123 Merge branch 'maint-0.3.2' 2018-01-05 16:41:35 -05:00
Nick Mathewson
48d94e290d Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-05 16:41:34 -05:00
Nick Mathewson
16fd975a82 Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-05 16:41:34 -05:00
Nick Mathewson
3618bd6166 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-05 16:41:34 -05:00
Nick Mathewson
c52d4d9e34 Merge branch 'teor_ticket24681_028' into maint-0.2.9 2018-01-05 16:41:31 -05:00
Nick Mathewson
94d5523c7f fix a wide line 2018-01-05 11:28:23 -05:00
Nick Mathewson
2d92f4c19a Don't keep options in a local in run_main_loop_once.
The options value can change between the get_options() and its
second use, based on setconf callbacks in the event loop.
2018-01-05 09:24:34 -05:00
teor
ca1f808d93
Add a timestamp to the header of the current fallback list
This timestamp is based on the time that list was first committed.

Part of 24725.
2018-01-05 13:27:51 +11:00
teor
70490df76a
Remove an incorrect C comment in the current fallback list
Follow-up to #24725
2018-01-05 13:27:43 +11:00
teor
c8c0e9167d
Add delimiters at the end of every fallback entry in the current list
Using this script:
sed -i.bak $'s|^,$|/* ===== */\\\n,|' src/or/fallback_dirs.inc
(Due to embedded newlines, this script only works in bash.)

And manually add a delimiter to the end of the header, and the start of
the fallback list.

This allows us to check that the code compiles, and the unit tests pass.
And it allows downstream users stem and atlas to adapt to the new format.

The upcoming fallback rebuild will automatically generate this new format.

Follow-up to 24725.
2018-01-05 13:27:36 +11:00
teor
20b96cee64
Update the version header in the current fallback file to 2.0.0
The upcoming fallback rebuild will automatically generate this new format.

Follow-up to 24725, due to breaking changes in 24679, 24600, and 22759.
2018-01-05 13:27:25 +11:00
teor
c1be0cfdb4
Add all-zero extrainfo cache flags to the current fallback file
Using this script:
sed -i.bak $'s|^,$|/* extrainfo=0 */\\\n,|' src/or/fallback_dirs.inc
(Due to embedded newlines, this script only works in bash.)

This allows us to check that the code compiles, and the unit tests pass.
And it allows downstream users stem and atlas to adapt to the new format.

The upcoming fallback rebuild will automatically generate this new format,
with actual relay extrainfo cache flags.

Follow-up to 22759.
2018-01-05 13:27:18 +11:00
teor
067617608c
Add blank nicknames to the current fallback file
Using this script:
sed -i.bak $'s|^,$|/* nickname= */\\\n,|' src/or/fallback_dirs.inc
(Due to embedded newlines, this script only works in bash.)

This allows us to check that the code compiles, and the unit tests pass.
And it allows downstream users stem and atlas to adapt to the new format.

The upcoming fallback rebuild will automatically generate this new format,
with actual relay nicknames.

Follow-up to 24600.
2018-01-05 13:27:10 +11:00
teor
384a450a47
Remove weights from the current fallback file
Using this script:
sed -i.bak 's/" weight=10",/,/' src/or/fallback_dirs.inc

This allows us to check that the code compiles, and the unit tests pass.
And it allows downstream users stem and atlas to adapt to the new format.

The upcoming fallback rebuild will automatically generate this new format.

Follow-up to 24679.
2018-01-05 13:27:03 +11:00
teor
0e6fdbea8d
Add a version 1.0.0 header to the current fallback file
The upcoming fallback rebuild will automatically generate this new format,
with version 2.0.0.

Follow-up to 24725.
2018-01-05 13:26:48 +11:00
Nick Mathewson
68ca6d2e19 Don't treat a setrlimit failure as fatal.
Fixes bug 21074; bugfix on 4689243242 in 0.0.9rc5 when we
started doing setrlimit() in the first place.
2018-01-04 13:21:29 -05:00
Nick Mathewson
1dab8bae21 smartlist.rs: The libc::c_char type is not the same as i8.
The code had been using c_char and i8 interchangeably, but it turns
out that c_char is only i8 on platforms where "char" is signed. On
other platforms, c_char is u8.

Fixes bug 24794; bug not on any released Tor.
2018-01-04 12:21:55 -05:00
Nick Mathewson
e0ccec219b Merge remote-tracking branch 'frewsxcv/frewsxcv-protover-heap' 2018-01-04 11:05:53 -05:00
Nick Mathewson
943134e886 Merge remote-tracking branch 'pastly2/ticket24531_033_01' 2018-01-03 11:56:35 -05:00
Nick Mathewson
b56ce79e63 In networkstatus_consensus_has_ipv6 test, use approx_time()
This may (or may not) fix up some reliability issues we've been
seeing with this test on windows.
2018-01-03 10:57:44 -05:00
Nick Mathewson
6b3c07648c Merge branch 'maint-0.3.2' 2018-01-03 10:09:20 -05:00
Nick Mathewson
1bc95633fb Fix some shadowed-global warnings.
These are all about local variables shadowing global
functions. That isn't normally a problem, but at least one
compiler we care about seems to treat this as a case of -Wshadow
violation, so let's fix it.

Fixes bug 24634; bugfix on 0.3.2.1-alpha.
2018-01-03 09:13:00 -05:00
Nick Mathewson
b62b40a572 Merge branch 'maint-0.3.2' 2018-01-03 09:00:00 -05:00
Nick Mathewson
451c852a0f Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-03 09:00:00 -05:00
Nick Mathewson
c1d98c75e3 Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-03 08:59:59 -05:00
Nick Mathewson
bbc9ff160e Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-03 08:59:59 -05:00
Nick Mathewson
c9b3f6352f Merge branch 'bug24633_029' into maint-0.2.9 2018-01-03 08:59:52 -05:00
Nick Mathewson
bd9739bae6 Merge branch 'maint-0.3.2' 2018-01-02 14:42:31 -05:00
Nick Mathewson
2aa1767b25 Merge remote-tracking branch 'teor/bug24703_032' into maint-0.3.2 2018-01-02 14:42:27 -05:00
Nick Mathewson
fb5877b972 Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-02 10:10:28 -05:00
Nick Mathewson
8a7767603a Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-02 10:10:28 -05:00
Nick Mathewson
bc5ef83f8f Merge branch 'maint-0.3.2' 2018-01-02 10:10:28 -05:00
Nick Mathewson
707076002d Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-02 10:10:28 -05:00
Nick Mathewson
6e5e4f92ab Merge remote-tracking branch 'teor/bug24736_028' into maint-0.2.9 2018-01-02 10:09:44 -05:00
Nick Mathewson
d53f779853 Merge remote-tracking branch 'teor/ticket24001' 2018-01-02 10:07:13 -05:00
Fernando Fernandez Mancera
525c1c493e Set IPv6 preferences for bridges even if there is no ri.
Tor now sets IPv6 preferences on rewrite_node_address_for_bridge() even if
there is only ri or rs. It always warns about them.

Also Tor now sets the IPv6 address in rs as well as it sets the one in ri.

Fixes #24572 on 9e9edf7 in 0.2.4.5-alpha.
Fixes #24573 on c213f27 in 0.2.8.2-alpha.

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-02 15:28:15 +01:00
teor
d99ccf090f
Stop trying to remove NULL filenames on shutdown
Fixes bug 24762; bugfix on master.
(Not in any released version of Tor.)
2017-12-30 17:19:42 +11:00
ArunaMaurya221B
01efbe3bd3 node_has_curve25519_onion_key() is refactored and duplicate code removed 2017-12-29 20:11:06 +05:30