summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src
Commit message (Collapse)AuthorAgeFilesLines
* fix clippy::needless_borrowtrinity-1686a2022-09-101-1/+1
|
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-242-0/+2
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* channel padding: Only do anything with link protocol 5Ian Jackson2022-08-171-0/+7
| | | | | | | Or rather, if we *didn't* negotiate 4, which is too old. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2828354
* channel padding: Properly advertise link protocol 5Ian Jackson2022-08-171-3/+2
| | | | | | | | | We already actually send and negotiate the padding, since !657, but we ought to negotiate a protocol version where that's not a violation! As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2828354
* channel padding: Move initial config of ChannelPaddingInstructionsIan Jackson2022-08-171-6/+5
| | | | | | | | | | | | | Making ChannelPaddingInstructions::default() accurately reflect the initial state of the reactor's padding timer simplifies the code somewhat. (When padding is wanted, parameters are computed and inserted explicitly, so the only change is that if we start out dormant, we defer setting the timer parameters until necessary.) As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827249
* channel padding: Parameters: default_padding replaces Default implIan Jackson2022-08-172-1/+7
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827249
* channel reactor: Add some commented-out debug for paddingIan Jackson2022-08-171-1/+5
|
* channel padding: Correctly always send the timer parametersIan Jackson2022-08-171-1/+8
| | | | Fixes "chanmgr configuration: Avoid sending needless initial update(s)"
* channel padding: Abolish ARTI_EXPERIMENTAL_CHANNEL_PADDING env varIan Jackson2022-08-171-8/+0
| | | | This was for testing and is no longer needed.
* channel engage_padding_activities: swap docs to tor0protoIan Jackson2022-08-171-1/+11
| | | | This allow us to make a working cross-reference.
* channel fake_channel_details: Use precise cfgIan Jackson2022-08-171-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826169
* ChannelPaddingInstructions: Update and expand docsIan Jackson2022-08-172-11/+41
|
* ChannelPaddingInstructions: Rename `params` field to `insns`Ian Jackson2022-08-171-6/+6
|
* Rename ChannelsParams types to ChannelPaddingInstructions (fmt)Ian Jackson2022-08-171-1/+4
| | | | Run rustfmt; no other changes.
* Rename ChannelsParams types to ChannelPaddingInstructionsIan Jackson2022-08-174-43/+43
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826167 This makes some lines too long; I will run rustfmt in a separate commit for clarity.
* Rename PaddingParameters::all_zeroes constructor to disabledIan Jackson2022-08-171-4/+2
|
* Channel: Make mutable() and engage_padding_activities infallibleIan Jackson2022-08-171-6/+5
| | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826151 This gets rid of quite some Bug error paths.
* Move ChannelUsage from tor_proto to tor_chanmgrIan Jackson2022-08-171-55/+26
| | | | | | | | | | | Replace Channel::note_usage with Channel::engage_padding_activities, which unconditionally causes the channel to (start to) do netflow padding things. The condition now lives in chanmgr. Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826094
* tor-cell: PaddingNegotiate::default_reducedIan Jackson2022-08-171-10/+0
| | | | | | | | | | | Get rid of unneeded constructor. We never need to use hardcoded reduced padding parameters during negotiation cell construction. If we are using reduced padding parameters, the layers which decide this have netparams to use. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826092
* tor-cell: PaddingNegotiate::start: take IntegerMillisecondsIan Jackson2022-08-171-2/+1
|
* channel: Clarify (and in some places replace) "frontend" terminologyIan Jackson2022-08-173-7/+10
|
* tor-proto channel padding: Document PADDING_NEGOTIATE overwritingIan Jackson2022-08-171-0/+3
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2825979
* chanmgr ChannelUsage: Fix and clarify docsIan Jackson2022-08-171-2/+3
|
* channel padding: Rename low_ms and high_msIan Jackson2022-08-171-13/+13
| | | | | These have the unit in the type. Putting that in the field name too is otiose.
* tor-proto, testing: Provide accessors for ChannelsParamsUpdatesIan Jackson2022-08-161-0/+11
|
* tor-proto, testing: Provide new_fake_channelIan Jackson2022-08-161-0/+22
| | | | To test the padding control we will want this.
* tor-proto, testing: Make fake_channel_details availableIan Jackson2022-08-161-16/+18
| | | | Now it's not just cfg(test), but feature testing.
* tor-proto: Make "testing" feature that exports some thingsIan Jackson2022-08-163-5/+23
| | | | | We are going to want this for through-the-layers padding control testing.
* channel padding: Send negotiation cellsIan Jackson2022-08-163-4/+17
|
* 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.
* chanmgr configuration: Avoid sending needless initial update(s)Ian Jackson2022-08-161-5/+6
| | | | | | | | | | | 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.
* 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: 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-161-0/+27
| | | | | | | | | | | | | 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.
* channel reparameterize: Change error typeIan Jackson2022-08-161-5/+3
| | | | This is going to be able to fail in other ways too, sadly.
* 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-161-3/+3
| | | | 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.
* 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.
* 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-161-7/+3
| | | | | | | 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.
* tor-proto: Add a comment about the tor-proto layer.Nick Mathewson2022-08-101-0/+18
| | | | | | | | | We want to clarify that the tor-proto crate should only know _how_ its objects behave, not _why they behave that way_. (In other words, we can have a "padding strategy" setting on a channel, but not a "general usage" setting.) Closes #531.
* Clarify that tor-proto _does_ create timers.Nick Mathewson2022-08-101-4/+2
|
* Merge branch 'main' into 'linkspec_refactor_v3'Nick Mathewson2022-08-108-79/+91
|\ | | | | | | # Conflicts: # crates/tor-netdir/semver.md
| * Merge branch 'zeroize' into 'main'Nick Mathewson2022-08-048-78/+90
| |\ | | | | | | | | | | | | | | | | | | Revise our handling of the zeroize trait Closes #254 See merge request tpo/core/arti!655
| | * tor-proto: Use correct SecretBuf in handshakes.Nick Mathewson2022-08-014-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | Everything that is a secret encryption key, or an input that is used to produce a secret encryption key, has to get zeroized. And that's all! Closes #254.