Nick Mathewson
8da24c99bd
Split bridge functions into a new module.
...
This patch is just:
* Code movement
* Adding headers here and there as needed
* Adding a bridges_free_all() with a call to it.
It breaks compilation, since the bridge code needed to make exactly
2 calls into entrynodes.c internals. I'll fix those in the next
commit.
2016-11-30 14:42:52 -05:00
Nick Mathewson
dd6def5daf
Initial code to parse/encode/sample prop271 guards
...
The encoding code is very straightforward. The decoding code is a
bit tricky, but clean-ish. The sampling code is untested and
probably needs more work.
2016-11-30 14:42:52 -05:00
Nick Mathewson
539eba0a4b
Teach parse_iso_time about the spaceless variant.
...
(We previously added support for generating the spaceless
2016-11-14T19:58:12 variant, but not for actually parsing it.)
2016-11-30 14:42:52 -05:00
Nick Mathewson
df8256a931
Add the prop271 fields to entry_guard_t. Not used yet.
2016-11-30 14:42:52 -05:00
Nick Mathewson
043e9b0151
Whitespace fixes from previous mechanical search-and-replaces
2016-11-30 14:42:52 -05:00
Nick Mathewson
f66f9c82e9
Make entry_guard_t opaque to circpathbias.c
...
This was a relatively mechanical change. First, I added an accessor
function for the pathbias-state field of a guard. Then I did a
search-and-replace in circpathbias.c to replace "guard->pb." with
"pb->". Finally, I made sure that "pb" was declared whenever it was
needed.
2016-11-30 14:42:52 -05:00
Nick Mathewson
62477906e9
Fix remaining case of circpathbias inspecting entryguard internals
2016-11-30 14:42:52 -05:00
Nick Mathewson
823357dbe4
Add an entry_guard_describe() function
...
This function helpfully removes all but one remaining use of
an entry_guard_t private field in pathbias.c
2016-11-30 14:42:52 -05:00
Nick Mathewson
be447bc770
Move path-bias fields into a separate structure
...
(Other than the field movement, the code changes here are just
search-and-replace)
2016-11-30 14:42:52 -05:00
Nick Mathewson
22f2f13f81
prop271: make entry_guard_t mostly-private
...
The entry_guard_t structure should really be opaque, so that we
can change its contents and have the rest of Tor not care.
This commit makes it "mostly opaque" -- circpathbias.c can still see
inside it. (I'm making circpathbias.c exempt since it's the only
part of Tor outside of entrynodes.c that made serious use of
entry_guard_t internals.)
2016-11-30 14:42:52 -05:00
teor
04f7944891
Stop discarding downloaded full descriptors when using microdescs for circuits
...
This affects clients with FetchUselessDescriptors 1.
It might also cause subtle bugs on directory mirrors and authorities,
causing them to consider all full descriptors as failed or old.
2016-11-30 12:20:28 +11:00
teor
e061cf4d1d
Remove an unneccessary FetchUselessDescriptors check in client_would_use_router
2016-11-30 11:43:04 +11:00
teor
65d793fab2
Fetch unknown certificates if FetchUselessDescriptors is true
2016-11-30 11:07:48 +11:00
teor
e5c608e535
Stop discarding consensus flavors and descriptors we wanted to fetch
...
Instead, fetch and store consensus flavors and descriptors we wanted to
fetch.
And serve them if we are a directory cache (or authority).
2016-11-30 11:06:36 +11:00
s7r
215cc0d527
Improve log messages related to identity key
...
Improve the messages logged when Tor wants or needs to load the master ed25519 identity key so the user is explicitly informed when further action is required or not. Fixes ticket #20650 .
2016-11-27 13:07:43 +00:00
Chelsea H. Komlo
9d9110f65d
crypto_digest256 returns expected error value of -1
2016-11-24 12:13:07 -05:00
Chelsea H. Komlo
276d07a88a
crypto_digest returns expected error value of -1
2016-11-24 10:01:03 -05:00
Chelsea H. Komlo
2331e70d2d
fix up spacing/style in needs_circuits_for_build
2016-11-24 09:33:40 -05:00
Chelsea H. Komlo
f83ed31089
adding better comments for defines
2016-11-24 09:33:38 -05:00
Chelsea H. Komlo
b252773fe9
re-add check for if circuit is an origin circuit
2016-11-24 09:33:32 -05:00
Chelsea H. Komlo
118bba7622
Refactor to remove unnecessary check in circuit_is_available_for_use
2016-11-24 08:12:33 -05:00
Chelsea H. Komlo
cfb8363da9
extract magic numbers in circuituse.c
2016-11-24 08:12:32 -05:00
Chelsea H. Komlo
afb6ae7b0f
Refactor circuit_predict_and_launch_new
2016-11-24 08:12:30 -05:00
Nick Mathewson
c35d481f56
Merge branch 'maint-0.2.9'
2016-11-21 12:44:21 -05:00
teor
1d1d37bbc6
Refactor rend_service_check_dir_and_add
...
Make the function flatter, and prepare for #20559 .
No behaviour change.
2016-11-18 13:35:54 +11:00
teor
8bdedab8da
Refactor duplicate code out of rend_config_services
...
Put that code in rend_service_check_dir_and_add.
No behaviour change.
This is a defence in depth measure against similar bugs to 20529.
2016-11-18 13:35:09 +11:00
teor
98057d274c
Create HS directories in rend_config_services, then check before use
...
(We only create HS directories if we are acting on the config.)
Log a BUG warning if the directories aren't present immediately before they
are used, then fail.
2016-11-18 13:34:24 +11:00
Nick Mathewson
ded58777c5
Merge remote-tracking branch 'dgoulet/bug20629_030_01'
2016-11-17 20:12:13 -05:00
Nick Mathewson
b5d738e481
Merge remote-tracking branch 'public/bug20558'
2016-11-17 20:10:40 -05:00
Nick Mathewson
a742637f5a
Merge remote-tracking branch 'public/bug20630'
2016-11-17 20:09:44 -05:00
Ivan Markin
fe711c2944
Fix and simplify error handling code in rend_service_parse_port_config()
2016-11-17 20:06:37 -05:00
Ivan Markin
a847e16cbb
Fix comment for rend_service_parse_port_config()
2016-11-17 20:05:19 -05:00
Roger Dingledine
f12aad7f09
don't attempt a resolve when the cached answer will do
...
For relays that don't know their own address, avoid attempting
a local hostname resolve for each descriptor we download. Also cut
down on the number of "Success: chose address 'x.x.x.x'" log lines.
Fixes bugs 20423 and 20610; bugfix on 0.2.8.1-alpha.
2016-11-16 16:22:11 -05:00
Roger Dingledine
3bb40b213b
refactor router_pick_published_address to have another arg
...
no change in behavior except fewer log entries in the case where we use
a cached result.
2016-11-16 16:13:03 -05:00
Nick Mathewson
307d244640
Fix a "shouldn't have reached this" warning in connection_edge.c
...
This was bug 20630; bugfix on f3e158ed
where I thought I was
committing a documentation-only fix but instead messed up the
control flow too.
2016-11-14 09:16:57 -05:00
Nick Mathewson
e054211237
Migrate extend2/create2 cell encoding to Trunnel
...
(Not extended2/created2; that's too simple.)
Incidentally, add ed25519 identities to the mix when we have them.
2016-11-11 15:29:13 -05:00
David Goulet
c82881a235
hs: Remove pointless NULL check found by Coverity
...
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-10 12:32:18 -05:00
David Goulet
a3bbb9ce77
fixup! Move encode_cert to torcert.c and rename it to tor_cert_encode_ed22519()
2016-11-10 11:00:59 -05:00
Neel Chauhan
9f74f8f732
Move encode_cert to torcert.c and rename it to tor_cert_encode_ed22519()
...
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-10 11:00:50 -05:00
Nick Mathewson
b5e75ae7dd
Add an ed25519 identity to extend_info
2016-11-10 09:43:27 -05:00
Nick Mathewson
8406677a5e
Accessor functions to get a node's ID keys.
2016-11-10 09:43:27 -05:00
Nick Mathewson
5e16c3f5fa
Merge remote-tracking branch 'dgoulet/bug20567_030_01'
2016-11-10 09:27:45 -05:00
Nick Mathewson
b6164e1604
Merge remote-tracking branch 'public/feature20552'
2016-11-10 09:25:11 -05:00
Nick Mathewson
217b895831
Merge remote-tracking branch 'dgoulet/ticket19642_030_01'
2016-11-10 09:16:00 -05:00
Matt Nordhoff
7dee70c3e1
Add "TByte" and "TBytes" units; also add "TBits" to man page
2016-11-10 09:13:27 -05:00
Nick Mathewson
0f4f63b7b8
Merge branch 'maint-0.2.9'
2016-11-10 09:11:35 -05:00
rubiate
d46c1b49a4
Do not serve a consensus if it is too old
...
Closes ticket 20511.
2016-11-10 10:16:18 +13:00
teor
0ec94588ab
Stop logging single onion and Tor2web long-term one-hop circuits
...
Single onion services and Tor2web deliberately create long-term one-hop
circuits to their intro and rend points, respectively.
These log messages are intended to diagnose issue 8387, which relates to
circuits hanging around forever for no reason.
Fixes bug 20613; bugfix on 0.2.9.1-alpha. Reported by "pastly".
2016-11-09 11:23:51 +11:00
teor
5dca9487c4
Call get_options() once at the top of circuit_log_ancient_one_hop_circuits()
...
Refactoring, no behaviour change.
2016-11-09 11:15:48 +11:00
Nick Mathewson
c58592e658
Merge branch 'maint-0.2.9'
2016-11-08 18:51:19 -05:00