summaryrefslogtreecommitdiff
path: root/crates/tor-cell
Commit message (Collapse)AuthorAgeFilesLines
* Bump crate versions in preparation for Arti 1.0.0 release.Nick Mathewson2022-09-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we want to work more on ensuring that our semver stability story is solid, we are _not_ bumping arti-client to 1.0.0 right now. Here are the bumps we _are_ doing. Crates with "minor" bumps have had API breaks; crates with "patch" bumps have had new APIs added. Note that `tor-congestion` is not bumped here: it's a new crate, and hasn't been published before. ``` tor-basic-utils minor fs-mistrust minor tor-config minor tor-rtcompat minor tor-rtmock minor tor-llcrypto patch tor-bytes patch tor-linkspec minor tor-cell minor tor-proto minor tor-netdoc patch tor-netdir minor tor-persist patch tor-chanmgr minor tor-guardmgr minor tor-circmgr minor tor-dirmgr minor arti-client minor arti-hyper minor arti major arti-bench minor arti-testing minor ```
* Clean up EstablishIntro cellYuan Lyu2022-08-252-12/+230
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-242-0/+4
|
* Add semver notesIan Jackson2022-08-171-0/+2
|
* tor-cell: PaddingNegotiate::start: take IntegerMillisecondsIan Jackson2022-08-173-4/+8
|
* tor-cell: PaddingNegotiate: give better spec xrefsIan Jackson2022-08-171-0/+6
|
* channel padding: Rename low_ms and high_msIan Jackson2022-08-171-1/+5
| | | | | These have the unit in the type. Putting that in the field name too is otiose.
* tor-cell, testing: Provide PaddingNegotiate::from_rawIan Jackson2022-08-161-0/+8
| | | | | This allows test cases to describe precisely the contents of the negotiation cell ought to be generated.
* 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.
* Clarify `REASON_DONE`Emptycup2022-08-161-1/+1
|
* Implement establish rendezvous cellYuan Lyu2022-08-053-1/+80
|
* Now that versions have bumped, remove semver.md files.Nick Mathewson2022-08-011-1/+0
|
* Bump patch versions on crates that have new APIs.Nick Mathewson2022-08-011-2/+2
| | | | | | | | | | | | | | Do _not_ bump the dependency versions on crates that have had no changes since arti 0.0.5, since those crates do not depend on the new APIs. ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p tor-llcrypto --bump patch git restore crates/tor-checkable git restore crates/tor-consdiff git restore crates/tor-rtmock ```
* Bump minor versions on all crates that have had breaking changes.Nick Mathewson2022-08-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | Done with these commands: ``` cargo set-version -p fs-mistrust --bump minor cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-linkspec --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump minor cargo set-version -p tor-dirclient --bump minor cargo set-version -p tor-dirmgr --bump minor cargo set-version -p arti-client --bump minor cargo set-version -p arti --bump minor ```
* Several typo fixes from `typos`.Nick Mathewson2022-07-271-1/+1
|
* Fix compilation of EstablishInto encoding.Nick Mathewson2022-07-221-2/+3
| | | | It was based on the old `Writeable` API.
* Merge branch 'hs-cells' into 'main'eta2022-07-224-1/+89
|\ | | | | | | | | Implement ESTABLISH_INTRO relay cell See merge request tpo/core/arti!626
| * Implement ESTABLISH_INTRO relay cellYuan Lyu2022-07-184-1/+89
| |
* | Merge branch 'fallible_writers_v2' into 'main'Nick Mathewson2022-07-1911-100/+184
|\ \ | | | | | | | | | | | | | | | | | | Revise tor_bytes::Writer::write to return a Result. Closes #513 See merge request tpo/core/arti!623
| * | tor-cell: Stop using write_infallibleNick Mathewson2022-07-113-37/+69
| | | | | | | | | | | | Also, stop using "expect" and "assert!" to check for errors.
| * | tor-cell: Make encoding method signatures fallible.Nick Mathewson2022-07-1110-55/+101
| | |
| * | Convert each write_onto_infallible implementation into write_onto.Nick Mathewson2022-07-113-10/+16
| | |
| * | Rename "write" methods on tor-bytes to "write_infallible".Nick Mathewson2022-07-113-21/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This comprises four renames: ``` write_onto -> write_onto_infallible write_into -> write_into_infallible write -> write_infallible writer_and_consume -> write_and_consume_infallible. ``` The rest of this branch will be concerned with replacing these `_infallible` methods with ones that return a `Result`. This is part of #513.
* / tor-cell: Derive Eq for NtorV3ExtensionIan Jackson2022-07-181-1/+1
|/ | | | Apropos clippy complaint.
* Implement a higher-level API for the ntor v3 handshakeeta2022-07-082-0/+116
| | | | | | | | | | | | | | | | | | | This implements a higher-level API for the ntor v3 handshake, in line with that exposed by the ntor handshake. It does not, however, use the existing `ClientHandshake` trait, due to fundamental differences in the handshakes (namely, that the v3 handshake can include some additional extra extension data). Currently, the higher-level API assumes circuit extension, and copies the (undocumented!) magic verification string from c-tor that indicates this usage. A rudimentary set of functions for serializing and deserializing extensions to be sent with the handshake is also included, implementing the protocol in proposal 332 § A.2. Currently, it only implements the congestion control extensions specified in proposal 324 § 10.3. part of arti#88
* Remove semver.md files now that 0.5.0 is outNick Mathewson2022-06-241-1/+0
|
* Bump crate and dependency versions.Nick Mathewson2022-06-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were done with the following commands: ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p fs-mistrust --bump minor cargo set-version -p tor-error --bump patch cargo set-version -p tor-config --bump patch cargo set-version -p tor-units --bump patch cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-llcrypto --bump patch cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump patch cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-persist --bump patch cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump patch cargo set-version -p tor-dirclient --bump patch cargo set-version -p tor-dirmgr --bump minor cargo set-version -p arti-client --bump patch cargo set-version -p arti --bump minor cargo set-version -p arti-bench --bump minor cargo set-version -p arti-testing --bump minor ```
* Merge branch 'clippy' into 'main'Ian Jackson2022-06-241-0/+3
|\ | | | | | | | | Fix clippy nightly again See merge request tpo/core/arti!603
| * Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | | | | | Update all lint blocks
* | Fix a couple of typos in rustdoc comments.Nick Mathewson2022-06-241-1/+1
|/
* tor-cell: convert BytesErr to a struct variantNick Mathewson2022-06-224-7/+22
|
* tor-cell: error usefulness and style fixesNick Mathewson2022-06-225-17/+25
|
* Do not include error source() in display() format.Nick Mathewson2022-06-211-3/+3
| | | | | | | | | According to doc/Errors.md, and in keeping with current best practices, we should not include display an error's `source()` as part of that error's display method. Instead, we should let the caller decide to call source() and display that error in turn. Part of #323.
* Add "full" and "experimental" features to arti-client and below.Nick Mathewson2022-06-101-1/+2
| | | | | | | | | The "full" feature is a catch-all for all features, _except_: * Those that select a particular implementation (like tor-llcrypto/with-openssl) or build flag (like "static") * Those that are experimental or unstable (like "experimental-api") * Those that are testing-only.
* tor-bytes: read_nested_*: Take a closureIan Jackson2022-06-101-15/+11
| | | | | | | | | | This eliminates the possibility of writing the bug of failing to call `should_be_exhausted`. As per this discussion https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/572#note_2811464 Fixes #498
* tor-cell: udp: Remove manual length calculationsIan Jackson2022-06-092-23/+11
| | | | | This does away entirely with `wire_addr_len`, which recapitulates the length calculation.
* Merge branch 'less-servfail' into 'main'Ian Jackson2022-06-091-1/+2
|\ | | | | | | | | return nodata instead of servfail in some instances See merge request tpo/core/arti!564
| * try to differentiate transient from nontransient errortrinity-1686a2022-06-081-1/+2
| |
* | Fix a second docs linkIan Jackson2022-06-081-1/+1
| |
* | Fix a doc linkIan Jackson2022-06-081-1/+1
|/
* Merge branch 'use-testing-rng'Nick Mathewson2022-06-071-1/+2
|\
| * Use testing_rng() in tests throughout our crates.Nick Mathewson2022-06-021-1/+2
| | | | | | | | | | | | This only affects uses of thread_rng(), and affects them all more or less indiscriminately. One test does not work with ARTI_TEST_PRNG=deterministic; the next commit will fix it.
* | udp: New AddressPort used in cellsDavid Goulet2022-06-072-42/+71
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | udp: Allow empty hostname and no nul byteIan Jackson2022-06-073-34/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After changes to the prop339, the domain name in an Address can only be 255 bytes max and can NOT contain nul byte(s). Unit tests had to be modified to accept this change: - Centralise msg_ip_address - Add currently-passing tests for address length - Test counted address length longer than type wants Related to #463 Signed-off-by: David Goulet <[email protected]>
* | cell: Don't use NUL terminated string in CONNECT_UDPDavid Goulet2022-06-073-43/+41
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | cell: Move UDP to its own module and feature gate itDavid Goulet2022-06-076-314/+61
| | | | | | | | | | | | Related to #463 Signed-off-by: David Goulet <[email protected]>
* | cell: Implement DATAGRAM cell from prop339David Goulet2022-06-072-4/+67
| | | | | | | | | | | | | | | | Decoding and encoding of the DATAGRAM cell from proposal 339. Related to #463. Signed-off-by: David Goulet <[email protected]>