summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | tor-proto channel: Make arrangements to send PADDING_NEGOTIATEIan Jackson2022-08-162-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is actually a general facility for inserting locally-generated cells into the outgoing stream. It doesn't seem to be possible to do this without adding an additional condition check to the reactor, since we need to insert it into the right place in the stream, giving it priority over data, and only using it up if there was room in the output. We don't engage this machinery yet, because nothing sets special_outgoing.
| * | channel padding: Send padding iff requiredIan Jackson2022-08-161-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now all the information is plumbed to the right place, and we can actually decide if we're sending padding. Additionally, we conditionalise sending timing parameters on whether padding is actually enabled, so in dormant mode we do not generate updates (broadcast to all channels) just to reconfigure unused timing parameters.
| * | chanmgr configuration: Avoid sending needless initial update(s)Ian Jackson2022-08-162-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change ChannelsParams::initial_update to compare fields with their default values, and, if they're the same as the default, not to include them in the returned update. And if that update is then empty, return None. The overall effect is to avoid the call to chan.reparameterize if we're using the builtin default parameters, which is usual.
| * | chanmgr configuration: Initialise correctlyIan Jackson2022-08-161-2/+7
| | | | | | | | | | | | | | | | | | This arranges that the ChannelsParams we have retain, and which we send to every newly created channel, actually has the right parameters, even if they're not the default.
| * | chanmgr configuration: Break out parameterizeIan Jackson2022-08-161-8/+40
| | | | | | | | | | | | | | | | | | | | | We're going to want to call this at startup as well as during reconfigurations. Code motion.
| * | chanmgr configuration: Hadle lack of a NetDirIan Jackson2022-08-163-18/+11
| | | | | | | | | | | | | | | | | | Now that the code that actually handles the netdir information can cope with its lack, we can change the types of the various netdir parameters and get rid of the foolish Bugs.
| * | chanmgr padding: Support reduced and disabled padding (prep)Ian Jackson2022-08-161-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we actually honour the configuration variable. However, when it is set to None, we lack proper handling. This will be done bh turning None into 0,0 and then treating that as disabled. There is a TODO for that. Note that we *still* don't actually do or negotiate padding.
| * | chanmgr padding: Fix low vs high comparisonIan Jackson2022-08-161-3/+2
| | | | | | | | | | | | | | | Whoops. This bug was completely masked by the fact that we don't actually enable padding yet.
| * | chanmgr: Break out padding_parameters fnIan Jackson2022-08-161-33/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move some logic out of reconfigure_general into what was update_padding_parameters_from_netdir, and rename that function. We're going to want to call this twice, shortly... * Move out the PaddingParametersBuilder * Have it handle missing netdir, though we currently always pass Ok * Have it handle the error cases It still ignores the config for now. No overall functional change. "git show -b" may be a useful way to review the changes in what becomes "padding_parameters".
| * | chanmgr: Postpone padding parameters computationIan Jackson2022-08-161-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | Now that we make an extract from the incoming NetDir, we can move the padding parameters computation to after we take the lock. This will be necessary for it to be able to depend on the config and dormancy, records of which are protected by the chanmgr lock.
| * | chanmgr: Introduce NetDirExtractIan Jackson2022-08-161-16/+52
| | | | | | | | | | | | | | | This will allow the padding parameter computation to have access to the config, which is within the inner lock.
| * | chanmgr, testing: Provide config accessor for testingIan Jackson2022-08-162-0/+9
| | | | | | | | | | | | | | | The top-level global config is going to want to see whether its machinations have the right effect.
| * | channel: Use channel usage to control channel paddingIan Jackson2022-08-161-8/+111
| | | | | | | | | | | | | | | We introduce the per-channel state that is used to keep track of channel usage, and defer padding setup until it's wanted.
| * | channel: Introduce padding configIan Jackson2022-08-162-7/+19
| | | | | | | | | | | | | | | Nothing actually reads this yet, and we also want a client-global default for padding.
| * | Introduce ChannelConfigIan Jackson2022-08-1610-13/+134
| | | | | | | | | | | | | | | This commit is just the necessary plumbing. The config is currently empty. We'll add something to it, for padding control, later.
| * | tor-config: Introduce PaddingLevelIan Jackson2022-08-164-0/+116
| | | | | | | | | | | | This will be used for controlling channel padding, for now.
| * | tor-config: Introduce ReconfigureError::BugIan Jackson2022-08-161-0/+4
| | | | | | | | | | | | Reconfigurations might fail due to internal errors.
| * | channel: Provide somewhere for the frontend's mutable stateIan Jackson2022-08-161-0/+24
| | | | | | | | | | | | | | | Right now this is just furniture. We're going to put channel padding control state here.
| * | Provide ChannelUsage and plumb it all the way downIan Jackson2022-08-169-29/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Channel padding depends on what the channel is being used for. We therefore need to let the channel code know this information. The implementation of the per-channel padding control logic will be in the new note_usage function, which for now is simply a stub. A future commit will introduce a `PaddingControlState` which lives in the channel frontend; consult the doc comment for that type to see why the plumbing through the channel manager terminates in the channel frontend.
| * | chanmgr: Introduce get_or_launch_internalIan Jackson2022-08-161-0/+10
| | | | | | | | | | | | This is going to be useful in a moment.
| * | channel reparameterize: Change error typeIan Jackson2022-08-164-15/+9
| | | | | | | | | | | | This is going to be able to fail in other ways too, sadly.
| * | dormancy: Plumb through to chanmgr reconfigure_generalIan Jackson2022-08-165-19/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The chanmgr remembers the last dormancy state it was told. We invent a chanmgr-specific Dormancy which the arti-client code knows how to convert from the richer top-level dormant status. This avoids having to have everyone know all the variants of the top-level state. To call reconfigure_general, we must also obtain and plumb through a netdir. Right now we must return an internal error if there is in fact no netdir, because reconfigure_general does not yet cope with a missing netdir. Nothing actually *uses* the dormancy yet.
| * | dormancy: tor-client: Break initial dormancy out into a variableIan Jackson2022-08-161-1/+2
| | | | | | | | | | | | | | | | | | We're going to need to reuse this, so we can plumb the dormancy to more places. Breaking it out avoids having repeat the initial dormancy value in two places.
| * | chanmgr: reconfigure_general: Rename fn and change typesIan Jackson2022-08-163-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is going to become the code for controlling channels, in general. (Including padding control.) Right now it doesn't do most of the things. In this commit: * Change the prototype and the name now. * Pass `()` for the dormancy and config, adding TODOs. * Provide update_netdir method on AbstractChanMgr, and call that, rather than having the ChanMgr go directly into the channel. (That will enable us to test that `update_netdir` method with test cases that don't have a complete ChanMgr.)
| * | channel params: ChannelsParamssUpdates: provide combine()Ian Jackson2022-08-161-0/+13
| | | | | | | | | | | | | | | We're going to need this because the frontend is going to need to defer some channel padding parameters updates.
| * | channel params: Add a missing comma.Ian Jackson2022-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | Unfortunately, because we don't have derive-adhoc here yet, rustfmt didn't get to notice that this comma was needed. We are going to add field(s), so add the comma now.
| * | channel params: Rename initial_update (from total_update)Ian Jackson2022-08-162-4/+4
| | | | | | | | | | | | The semantics of this are going to become a bit more subtle.
| * | tor-proto: padding::Parameters: Provide all_zeroesIan Jackson2022-08-161-0/+10
| | | | | | | | | | | | | | | This exists so that we handle this case specially, as we will need to, and so that we can represent disablement in a Parameters.
| * | tor-proto: padding::Parameters::padding_negotiate_cellIan Jackson2022-08-161-1/+17
| | | | | | | | | | | | | | | The channel manager is going to use this as part of constructing the right cell for padding neogotiattion.
| * | tor-proto: padding::Parameters: Provide default_reduced constructorIan Jackson2022-08-161-0/+12
| | | | | | | | | | | | We're going to want this so that we can do reduced padding.
| * | chancell: PaddingNegotiate: Provide start_default and a Default implIan Jackson2022-08-161-0/+20
| | | | | | | | | | | | | | | As proposed in https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/77
| * | chancell: Introduce PaddingNegotiateCmdIan Jackson2022-08-161-5/+17
| | | | | | | | | | | | | | | This gets rid of some random hardcoded literals. We're going to want to reuse this, too.
| * | chancell: PaddingNegotiate: Provide two constructors, not oneIan Jackson2022-08-162-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | We don't really want the caller to pass ignored timeout parameters. And this makes more semantic sense. The stop constructor uses zero, which is what C Tor does. See https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/76
| * | chancell: PaddingNegotiate: Make EqIan Jackson2022-08-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This will be convenient for managing when to send these negotiation messages. While we're here, edit the comment to explain how this is (going to be) used.
| * | channel padding: Add doc commentary with the channel padding planIan Jackson2022-08-162-0/+27
| | | | | | | | | | | | | | | | | | | | | Much of this does not exist yet. It will do by the end of this branch. Expand a doc note for ChannelsParamsUpdates too.
| * | chanmgr: tests: Introduce new_test_channel_mapIan Jackson2022-08-161-6/+11
| | | | | | | | | | | | This is going to change. Centralise it first.
| * | chanmgr: tests: Introsuce new_test_abstract_chanmgrIan Jackson2022-08-161-8/+9
| | | | | | | | | | | | This is going to change. Centralise it first.
| * | channel: Centralise Channel::send_controlIan Jackson2022-08-161-14/+16
| | | | | | | | | | | | | | | | | | Replaces 4 open-coded call sites. I am going to add one more.
| * | tor-proto: padding::Parameters: use impl_standard_builderIan Jackson2022-08-163-7/+5
| | | | | | | | | | | | | | | | | | | | | This is more standard. It also provides the ::build() method. This isn't a config type, and build failures ought not to happen, so we use Bug for the error.
| * | arti-client: TorClient constructor: add a blank lineIan Jackson2022-08-161-0/+1
| |/ | | | | | | | | The rustfmt-mandated different formatting of these two very similar blocks is bad enough, without them being smooshed together.
* | Merge branch 'transient_circmgr_errors' into 'main'Nick Mathewson2022-08-162-15/+75
|\ \ | |/ |/| | | | | | | | | Mark some circuit-building errors as "transient". Closes #517 See merge request tpo/core/arti!676
| * Additionally, mark the LostUsablityRace error as a "reset".Nick Mathewson2022-08-161-1/+5
| |
| * Mark some circuit-building errors as "transient".Nick Mathewson2022-08-162-15/+71
| | | | | | | | | | | | | | | | | | | | | | | | A "transient" error is one that does not indicate a true failure, but rather an _expected_ need to retry. When we hit one of these, we do not count it against the total number of permitted failures. (We do impose a higher limit on "real failures plus transient failures", though, to prevent infinite loops in the event of a programming error. Closes #517.
* | Merge branch 'clarify' into 'main'Nick Mathewson2022-08-161-1/+1
|\ \ | | | | | | | | | | | | Clarify `REASON_DONE` See merge request tpo/core/arti!677
| * | Clarify `REASON_DONE`Emptycup2022-08-161-1/+1
|/ /
* | Merge branch 'hardening' into 'main'Nick Mathewson2022-08-157-3/+88
|\ \ | | | | | | | | | | | | | | | | | | arti: Add support for process hardening Closes #364 See merge request tpo/core/arti!672
| * | arti: Add support for process hardeningNick Mathewson2022-08-157-3/+88
| |/ | | | | | | | | | | | | | | | | | | | | | | | | This is a compile-time feature with an associated configuration flag, both enabled by default. When it's turned on, hardening prevents the arti process from dumping core or being attached to by low-privileged processes. (This is a defense-in-depth measure, not an absolute way to prevent attacks. For more information, see [`secmem_proc`](https://docs.rs/secmem-proc/0.1.1/secmem_proc/).) Closes #364.
* | Merge branch 'nightly_fix_rtt' into 'main'eta2022-08-151-1/+1
|\ \ | |/ |/| | | | | Fix nightly CI: allow print_stderr in rtt tests. See merge request tpo/core/arti!673
| * Fix nightly CI: allow print_stderr in rtt tests.Nick Mathewson2022-08-111-1/+1
| |
* | Merge branch 'tcpsteam_send' into 'main'Nick Mathewson2022-08-153-2/+3
|\ \ | | | | | | | | | | | | tor-rtcompat: Require that TcpStream be Send See merge request tpo/core/arti!675