summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch 'chan-unit-tests' into 'main'David Goulet2026-04-1410-284/+661
|\ \ \ | | | | | | | | | | | | | | | | proto: Add relay channel handshake unit tests See merge request tpo/core/arti!3853
| * | | proto: Remove unused imports in unit testsDavid Goulet2026-04-141-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
| * | | proto: Fix relay unit tests with new CreateRequestHandlerDavid Goulet2026-04-141-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The CreateRequestHandler was introduced prior to the relay handshake unit tests so fix them now that we have a way to build one. Signed-off-by: David Goulet <[email protected]>
| * | | proto: Add a test helper function for building a CircNetParametersDavid Goulet2026-04-143-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't access `NetParameters` in this crate to build from consensus default value so instead add a `defaults_for_tests()` gated function for each parameters object which puts in the defaults from the spec. We'll need CircNetParameters in order to build create request handler for unit tests hence why it is in src/circuit.rs.
| * | | proto: Move DummyChan/DummyChanProvider to relay channel.rsDavid Goulet2026-04-142-64/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the reactor.rs to channel.rs, makes more sense and we'll need it in the handshake tests. No behavior change, just code movement and a function rename. Signed-off-by: David Goulet <[email protected]>
| * | | proto: Remove re-export of MsgBuf in unit testsDavid Goulet2026-04-143-5/+3
| | | | | | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
| * | | proto: Add channel relay handshake unit testsDavid Goulet2026-04-145-182/+431
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of copying the client unit tests into the channel module, just make both current unit tests run on a client and relay handshake. This required a bit of trickery with type HandshakeConnectFn but works out in the end. It also adds the RelayMsgBuf that wraps a MsgBuf in order to implement CertifiedConn which is very relay only. Signed-off-by: David Goulet <[email protected]>
| * | | proto: Move test certs module at the topDavid Goulet2026-04-141-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just for mental sanity to have all const at the same place and easily readable. No behavior change. Signed-off-by: David Goulet <[email protected]>
| * | | proto: Move channel client handshake tests into client moduleDavid Goulet2026-04-143-218/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No behavior change. Make the const cells public as they will be useful for more upcoming unit tests especially on the relay side. Signed-off-by: David Goulet <[email protected]>
* | | | Merge branch 'create-fast' into 'main'opara2026-04-143-23/+74
|\ \ \ \ | |/ / / |/| | | | | | | | | | | arti-relay: Log the public ntor key See merge request tpo/core/arti!3882
| * | | arti-relay: improve ntor key loggingSteven Engler2026-04-141-5/+8
| | | | | | | | | | | | | | | | We only need the max, not the entire sorted list.
| * | | arti-relay: log the public ntor keySteven Engler2026-04-142-3/+33
| | | | | | | | | | | | | | | | This is useful for testing.
| * | | tor-key-forge: for `Curve25519Keypair` public key, add `inner()`Steven Engler2026-04-141-0/+10
| | | |
| * | | arti-relay: move key logging (part 3)Steven Engler2026-04-131-3/+0
| | | | | | | | | | | | | | | | Small cleanup.
| * | | arti-relay: move key logging (part 2)Steven Engler2026-04-131-21/+21
| | | | | | | | | | | | | | | | Code movement only.
| * | | arti-relay: move key logging (part 1)Steven Engler2026-04-131-0/+11
| |/ / | | | | | | | | | Set up function placeholder.
* | | Merge branch 'flowctrl-fix' into 'main'David Goulet2026-04-141-41/+73
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | tor-proto: Fix stream XON/XOFF flow control sidechannel mitigation bug Closes #2400 See merge request tpo/core/arti!3884
| * | | tor-proto: handle a div-by-zero case that should never happenSteven Engler2026-04-131-3/+7
| | | | | | | | | | | | | | | | | | | | If this is zero, then it means that the consensus had bad values. But may as well check it anyways.
| * | | tor-proto: fix flow control side channel checksSteven Engler2026-04-131-35/+47
| | | |
| * | | tor-proto: change flow control `bytes_sent_total` to `u64`Steven Engler2026-04-131-9/+9
| | | |
| * | | tor-proto: add more tests for flow controlSteven Engler2026-04-131-0/+16
| |/ /
* | | Merge branch 'parse2-fix-eh' into 'main'Ian Jackson2026-04-141-1/+1
|\ \ \ | | | | | | | | | | | | | | | | tor-netdoc: parse2: Fix error for invalid item argument See merge request tpo/core/arti!3879
| * | | tor-netdoc: parse2: Fix error for invalid item argumentIan Jackson2026-04-141-1/+1
| |/ / | | | | | | | | | When we can't parse a NormalItemArgument, that's Invalid, not Missing.
* | | tor-netdoc: impl NormalItemArgument for B16 and B16UIan Jackson2026-04-141-0/+3
| | | | | | | | | | | | | | | I also searched this file for FromStr impls and these types were the only ones that ought to be NormalItemArgument but weren't.
* | | tor-netdoc: Fix a slip in a doc commentIan Jackson2026-04-141-1/+1
| | |
* | | tor-netdoc: Explain why the macro doesn't use hex::encodeIan Jackson2026-04-141-0/+2
| | |
* | | tor-netdoc: Fix slip in semver.mdIan Jackson2026-04-141-1/+1
| | |
* | | tor-netdoc: Use Transparent and derive Hash for RsaIdentity wrappersIan Jackson2026-04-142-8/+9
| | |
* | | tor-netdoc: Use Transparent for SystemTime wrappersIan Jackson2026-04-142-4/+5
| | |
* | | tor-netdoc: Use Transparent for Curve25519PublicIan Jackson2026-04-142-1/+3
| | |
* | | tor-netdoc: types/misc.rs: Have Transparent do From and IntoIan Jackson2026-04-141-7/+19
| | | | | | | | | | | | | | | Unfortunately one derive can't invoke another, so we must open-code them, just like the other traits.
* | | tor-netdoc: types/misc.rs: Break out Transparent derive module/macroIan Jackson2026-04-141-31/+83
| | | | | | | | | | | | | | | | | | | | | Nothing derives just Transparent yet. Mostly code motion, with some additional furniture and docs. Review with git show --color-moved.
* | | tor-netdoc: types/misc.rs: Prepare message for Transparent deriveIan Jackson2026-04-141-2/+2
| | | | | | | | | | | | | | | | | | This error message is going to be used by both Transparent and BytesTransparent. Put it in the code that is going to be part of Transparent, and remove the macro name from it.
* | | tor-netdoc: types/misc.rs: Remove a stray comma in a docIan Jackson2026-04-141-1/+1
| | |
* | | tor-netdoc: types/misc.rs: Use fmt and Display aliasesIan Jackson2026-04-141-12/+12
| | | | | | | | | | | | This reduces clutter some more.
* | | tor-netdoc: types/misc.rs: Use FromStr aliasIan Jackson2026-04-141-16/+18
| | | | | | | | | | | | | | | | | | This is in the use's at the top of the file. If we `use super::*` (like we do in the newer modules): the code can get a lot more readable.
* | | tor-netdoc: Provide B16U for printing hex uppercaseIan Jackson2026-04-142-3/+32
| | | | | | | | | | | | | | | | | | | | | Test the parsing and printing success cases. Given that the parsing implementation is just a wrapper around B16's, we don't need explicit tests for that.
* | | tor-netdoc: Make B16 pub and improve its APIIan Jackson2026-04-142-15/+8
| | | | | | | | | | | | | | | Make this a public BytesTransparent newtype like B64, implementing all the same traits etc.
* | | tor-netdoc: impl Display for B16, as lowercaseIan Jackson2026-04-141-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | On reflection, and looking at the test cases, I think the name `B16` should refer to the lowercase version. I'll introduce a type for uppercase in a moment. Test the display implementation.
* | | tor-netdoc: Clean up base16 testIan Jackson2026-04-141-4/+11
| | | | | | | | | | | | | | | | | | | | | Replace the open-coded .parse() calls with a closure. This will let us test round trips, other types, etc., for each pairs of test values.
* | | tor-netdoc: Adjust API of B64Ian Jackson2026-04-142-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Firstly, make its field pub. Secondly, make the into_array method crate-private. It has a crate-specific (albeit public) error type, The same basic effect can be achieved with methods from std on arrays and slices.
* | | tor-netdoc: Use BytesTransparent for FixedB64, and make it pubIan Jackson2026-04-142-9/+5
| | | | | | | | | | | | | | | | | | Make this type public. The new macro call means this type now implements many more traits.
* | | tor-netdoc: impl many more traits for B64, by improving Bytes TransparentIan Jackson2026-04-142-1/+49
| | | | | | | | | | | | | | | I think these are all the traits that a parsing/printing newtype adapter ought to implement.
* | | tor-netdoc: types/misc.rs: Introduce BytesTransparent macro (finish macro)Ian Jackson2026-04-141-10/+14
| | | | | | | | | | | | | | | | | | | | | Actually make the macro be a proper d-d macro. Replace uses of .0 with $fname, B64 with $ftype, etc. No functional change in this commit.
* | | tor-netdoc: types/misc.rs: Introduce BytesTransparent macro (code motion)Ian Jackson2026-04-141-18/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Break various open-coded impls on B64 into this macro. That will let us reuse this code for other types, making all these bytes wrappers similar to each other. In this commit, we just move the code. The macro is wrong because it ought to refer to $ttype and so on. Review with git show --color-moved. No functional change in this commit.
* | | tor-netdoc: Move a Hash deriveIan Jackson2026-04-141-2/+2
| | | | | | | | | | | | | | | This is slightly more logical and will make the next commit slightly easier to read.
* | | tor-netdoc: Move some imports to the top of types/misc.rsIan Jackson2026-04-141-3/+3
|/ / | | | | | | This will reduce some duplication and simplify some macrology.
* | Merge branch 'id-logging' into 'main'Jim Newsome2026-04-131-2/+2
|\ \ | | | | | | | | | | | | Tweak TunnelId and TunnelScopedCircId Display impls See merge request tpo/core/arti!3875
| * | Tweak Display for TunnelScopedCircIdJim Newsome2026-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Circuit IDs (UniqId) are displayed as "Circ <x>.<y>". Prior to this MR, these TunnelScopedCircId's were displayed as "Circ <t>.<x>.<y>" where t is the integer tunnel ID. This made corresponding logs a bit confusing as to why some "Circ" identifiers had two parts and some have three, and didn't make clear that the "<x>.<y>" part of the latter were comparable with the two-part UniqIds. The previous commit effectively changes the latter to "Circ Tunnel <t>.<x>.<y>", which is still a bit confusing. This commit changes the display of TunnelScopedCircId's to "Circ <x>.<y> (Tunnel <t>)", which makes the distinction between the circuit and tunnel IDs clearer.
| * | Tunnel ID: included "Tunnel" type-specifier in DisplayJim Newsome2026-04-091-1/+1
| | | | | | | | | | | | | | | | | | This is akin to how circuit `UniqId`'s are prefixed with "Circ", and helps clarify logs where it isn't always clear from context whether a tunnel ID or circuit ID is being displayed.