summaryrefslogtreecommitdiff
path: root/crates/tor-bytes
Commit message (Collapse)AuthorAgeFilesLines
* Bump arti- and tor- crates to 0.23.0Nick Mathewson2024-09-301-3/+3
| | | | | | | | | | | | | | Per our policy, every one of these gets a minor bump. Generated with: ``` for crate in $(./maint/list_crates | grep '^\(tor\|arti\)-' ); do cargo set-version --bump minor -p $crate; done ``` (Note the use of `-` at the end end of the grep pattern to prevent matching the `arti` crate.)
* Minor bumps on non-tor/arti cratesNick Mathewson2024-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates are not in the tor/arti namespace, but we have given them MSRV bumps: ``` oneshot-fused-workaround slotmap-careful fslock-guard hashx equix caret fs-mistrust safelog test-temp-dir retry-error ``` We are counting this as a breaking change. Since all of these crates are at 0.x.x, we have indicated the breaking change with a minor version bump. This commit was generated with the following script: ``` BUMPS=" oneshot-fused-workaround slotmap-careful fslock-guard hashx equix caret fs-mistrust safelog test-temp-dir retry-error " for crate in $BUMPS; do cargo set-version --bump minor -p $crate; done ```
* Upgrade MSRV to 1.77Nick Mathewson2024-09-251-1/+1
| | | | This will allow us to upgrade to the latest version of rusqlite.
* Run fixup-features in preparation for upcoming release.Nick Mathewson2024-09-251-1/+1
|
* Bump MSRV from 1.70 to 1.75.Wesley Aptekar-Cassels2024-09-161-1/+1
|
* tor-proto: Use Reader::take_all_but().Nick Mathewson2024-09-161-13/+14
|
* tor-bytes: Add a new take_all_but method.Nick Mathewson2024-09-161-0/+73
|
* tor-bytes: Fix Truncated refs in various docs.Ian Jackson2024-09-121-4/+5
| | | | | | Use "throws" terminology to avoid having to clutter the description with Err(). Many of these doc comments contain otiose text such as "returns Ok(()) on success" but let's not deal with that now.
* tor-bytes: Rename OnIncomplete to Completeness (fmt)Ian Jackson2024-09-121-1/+1
|
* tor-bytes: Rename OnIncomplete to CompletenessIan Jackson2024-09-121-11/+20
| | | | | | | | And rename its variants and update the docs to contemplate wider use, as suggested in #1620. As discussed here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075658
* tor_bytes: Clarify a method docIan Jackson2024-09-121-2/+3
| | | | | Apropos https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075638
* tor_bytes: Rename new_truncated_for_test to new_incomplete_for_testIan Jackson2024-09-122-14/+14
| | | | No semver implications since this wasn't in the last release.
* tor-bytes: Add test case for from_possibly_incomplete_sliceIan Jackson2024-09-121-0/+8
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075486
* tor-bytes: Add note about other kinds of invalid messageIan Jackson2024-09-111-0/+11
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075485
* tor-bytes: Add imprecations about Incomplete and MissingDataIan Jackson2024-09-111-0/+17
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075483
* tor-bytes: Fix a doc comment about error reportingIan Jackson2024-09-111-1/+1
| | | | This was a leftover from before I invented Error::MissingData.
* tor-bytes: Do many missed renames of Truncated to IncompleteIan Jackson2024-09-113-9/+9
|
* tor-bytes: Add warning about sub-readers (adjust to new name)Ian Jackson2024-09-111-1/+1
| | | | | Fix semantic conflict of the suggested edit with the rename later in the branch.
* tor-bytes: Add warning about sub-readersIan Jackson2024-09-111-0/+9
| | | | | Suggestion from here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075481
* tor-bytes: Update semver.md. No compile-breaking changes, now.Ian Jackson2024-09-111-1/+2
|
* tor-bytes: Rename Truncated to Incomplete, and restore old Truncated as ↵Ian Jackson2024-09-112-5/+10
| | | | | | | | | deprecated Incomplete is a better name. This lets us use Truncated for the old, deprecated, conflation of "Incomplete" with what is now "MissingData".
* tor-bytes: Only report Truncated for errors at the outer level (fmt)Ian Jackson2024-09-111-2/+10
|
* tor-bytes: Only report Truncated for errors at the outer levelIan Jackson2024-09-112-12/+30
| | | | | | | | | | | This is item 1 from https://gitlab.torproject.org/tpo/core/arti/-/issues/1614#note_3074562 and the alternative to item 2 presented in the 2nd half of https://gitlab.torproject.org/tpo/core/arti/-/issues/1614#note_3074648 (Item 3 was done earlier, but now we change the behaviour.) Fixes #1614.
* tor-bytes: Error: provide and call Error::incomplete_error (tidy)Ian Jackson2024-09-111-4/+1
| | | | | Tidy up an error message. Now this can be on one line with variable name interpolation.
* tor-bytes: Error: provide and call Error::incomplete_error (fmt)Ian Jackson2024-09-112-8/+11
|
* tor-bytes: Error: provide and call Error::incomplete_errorIan Jackson2024-09-112-9/+21
| | | | | | | | | | | | | | | | | | | We introduce the new constructor and call it at the error generation sites. But there is still not yet any functional change. Change the type of Truncated's field to be Sensitive. The original reason for not doing this no longer applies, since we don't generally want to open-code construction of this variant. Conveniently, changing the type means we get to find all the sites where one *is* constructed and adjust them. In reader.rs and tor-proto we can just call incomplete_error. In tor-cell, there's a call site where we previously provided an underestimate, and where the Reader isn't available. We adjust that ad-hoc but this is fine because the error variant will change. (relaycell is using a Reader from from_slice.)
* tor-bytes: Add a Reader constructor for tor-socksproto's use caseIan Jackson2024-09-111-3/+23
| | | | | | | Here we add the constructor, and document it, and change the call sites. No functional change yet.
* tor-bytes: Add a test case with missing inner dataIan Jackson2024-09-111-0/+9
| | | | Some tests in other crates test this, but none in tor-bytes!
* tor-bytes: Add a Reader constructor for use in testsIan Jackson2024-09-113-17/+29
| | | | | | | | | | | | We could call from_possibly_incomplete_slice in these, but that's confusing and distracting. Here we add this constructor, and document it (in terms of the constructor to come), and change the call sites. No functional change. Doing this now will prevent unwanted changes to test behaviours when we change the behaviour of Readers made by Reader::from_slice.
* tor-bytes: derive impl PartialEq for ErrorIan Jackson2024-09-112-17/+28
| | | | | | | I just perpetrated a bug by adding a variant to this which ended up not PartialEq to itself. This open-coded match is a footgun. No functional change.
* Change tor_bytes::Readable name to `b` in many placesIan Jackson2024-09-113-142/+142
| | | | | | | | | | | | | | | The codebase uses `r` sometimes and `b` at other times. Making this consistent makes widespread changes easier, and is clearer for humans. I think `b` is better than `r` because `r` might be "return". It is indeed used that way in a couple of places in reader.rs, even. I haven't changed *everywhere*, just Readable impls (where `r` is particularly likely to be "return value") and occurrences in tor-bytes. No functional change.
* tor-bytes: Error::Truncated: mark the deficit as Sensitive (fmt)Ian Jackson2024-09-101-2/+4
|
* tor-bytes: Error::Truncated: mark the deficit as SensitiveIan Jackson2024-09-102-1/+7
| | | | | Suggested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2390#note_3072975
* tor-bytes: Add a deficit field to Error::Truncated (fmt)Ian Jackson2024-09-101-1/+3
|
* tor-bytes: Add a deficit field to Error::TruncatedIan Jackson2024-09-103-8/+15
| | | | This will allow us to fix #1592, but it doesn't do so yet.
* Introduce and use tor_bytes::Error::new_truncated_for_testIan Jackson2024-09-102-11/+26
| | | | | | | | This is going to want to do something more complicated (as described in the docs). In this commit we change all the tests that are expecting Truncated errors. That reduces noise in the next commit.
* tor-bytes: Document Readable::take_from correctness propertiesIan Jackson2024-09-101-0/+29
| | | | | | This refers to the `deficit` field in Error::Truncated, which is going to appear in a later commit. It seems kinder to my reviewer to add this doc now early in the branch.
* tor-bytes: advance: Call peek for the error checkIan Jackson2024-09-101-3/+1
| | | | | This removes one construction site of Error::Truncated. We are about to make constructing one of those more fiddly.
* Bump all the unstable tor- and arti- crates to 0.22.0.Gabriela Moldovan2024-09-031-3/+3
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.22.0 done ```
* Don't need to tell docs.rs to enable `docsrs` cfgKunal Mehta2024-08-021-1/+0
| | | | | It now does it automatically, see <https://docs.rs/about/builds#detecting-docsrs>.
* Bump versions for tor- and arti- crates to 0.21.0Nick Mathewson2024-08-011-3/+3
| | | | | | | | | | This is the result of: ``` for crate in $( ./maint/list_crates |grep '^\(tor\|arti-\)' ); do cargo set-version -p $crate 0.21.0 done ```
* Update versions of 0.x tor-* and arti-* cratesIan Jackson2024-06-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nailing-cargo -uE set-version -p arti-client 0.20.0 nailing-cargo -uE set-version -p arti-relay 0.20.0 nailing-cargo -uE set-version -p arti-rpcserver 0.20.0 nailing-cargo -uE set-version -p tor-async-utils 0.20.0 nailing-cargo -uE set-version -p tor-basic-utils 0.20.0 nailing-cargo -uE set-version -p tor-bytes 0.20.0 nailing-cargo -uE set-version -p tor-cell 0.20.0 nailing-cargo -uE set-version -p tor-cert 0.20.0 nailing-cargo -uE set-version -p tor-chanmgr 0.20.0 nailing-cargo -uE set-version -p tor-checkable 0.20.0 nailing-cargo -uE set-version -p tor-circmgr 0.20.0 nailing-cargo -uE set-version -p tor-config 0.20.0 nailing-cargo -uE set-version -p tor-consdiff 0.20.0 nailing-cargo -uE set-version -p tor-dirclient 0.20.0 nailing-cargo -uE set-version -p tor-dirmgr 0.20.0 nailing-cargo -uE set-version -p tor-error 0.20.0 nailing-cargo -uE set-version -p tor-geoip 0.20.0 nailing-cargo -uE set-version -p tor-guardmgr 0.20.0 nailing-cargo -uE set-version -p tor-hsclient 0.20.0 nailing-cargo -uE set-version -p tor-hscrypto 0.20.0 nailing-cargo -uE set-version -p tor-hsrproxy 0.20.0 nailing-cargo -uE set-version -p tor-hsservice 0.20.0 nailing-cargo -uE set-version -p tor-keymgr 0.20.0 nailing-cargo -uE set-version -p tor-linkspec 0.20.0 nailing-cargo -uE set-version -p tor-llcrypto 0.20.0 nailing-cargo -uE set-version -p tor-log-ratelim 0.20.0 nailing-cargo -uE set-version -p tor-memquota 0.20.0 nailing-cargo -uE set-version -p tor-netdir 0.20.0 nailing-cargo -uE set-version -p tor-netdoc 0.20.0 nailing-cargo -uE set-version -p tor-persist 0.20.0 nailing-cargo -uE set-version -p tor-proto 0.20.0 nailing-cargo -uE set-version -p tor-protover 0.20.0 nailing-cargo -uE set-version -p tor-ptmgr 0.20.0 nailing-cargo -uE set-version -p tor-relay-selection 0.20.0 nailing-cargo -uE set-version -p tor-rpcbase 0.20.0 nailing-cargo -uE set-version -p tor-rtcompat 0.20.0 nailing-cargo -uE set-version -p tor-rtmock 0.20.0 nailing-cargo -uE set-version -p tor-socksproto 0.20.0 nailing-cargo -uE set-version -p tor-units 0.20.0 Each of which runs a rune like cargo set-version --offline -p tor-units 0.20.0
* Bump all the unstable tor- and arti- crates to 0.19.Gabriela Moldovan2024-06-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unstable crates are: - tor-error - tor-config - tor-units - tor-geoip - tor-rtcompat - tor-rtmock - tor-log-ratelim - tor-rpcbase - tor-memquota - tor-llcrypto - tor-protover - tor-bytes - tor-hscrypto - tor-socksproto - tor-checkable - tor-cert - tor-linkspec - tor-cell - tor-proto - tor-netdoc - tor-consdiff - tor-netdir - tor-relay-selection - tor-persist - tor-chanmgr - tor-ptmgr - tor-guardmgr - tor-circmgr - tor-dirclient - tor-dirmgr - tor-keymgr - tor-hsclient - tor-hsservice - tor-hsrproxy - arti-client - arti-rpcserver - arti-hyper - tor-basic-utils - tor-async-utils Done using ``` for p in "${unstable[@]}"; do cargo set-version -p $p 0.19; done ``` where `unstable` contains the list above
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Bump versions of 0.x tor-* and arti-* cratesIan Jackson2024-04-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for p in `cat ../u`; do cargo set-version --locked --offline -p $p; done where u contains tor-basic-utils tor-async-utils tor-error tor-config tor-units tor-geoip tor-rtcompat tor-rtmock tor-log-ratelim tor-rpcbase tor-memquota tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-hyper
* Update unstable `tor/arti-*` crates to 0.17.0.Nick Mathewson2024-04-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with: ``` CRATES=" tor-basic-utils tor-async-utils tor-error tor-config tor-events tor-units tor-geoip tor-rtcompat tor-rtmock tor-log-ratelim tor-rpcbase tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-hspow tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-congestion tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-config arti-hyper arti-bench arti-testing " for crate in $CRATES; do cargo set-version -p "$crate" 0.17.0 done ```
* Run maint/add_warning.Nick Mathewson2024-03-132-0/+2
|
* tor-bytes: avoid write_zeros truncationTobias Stoeckmann2024-03-061-1/+1
| | | | | | | Use a saturating add while determining the new length. If it really ends up being usize::MAX, the resize will most likely panic. This is at least a more reliable end of processing than going on with a much smaller vector than expected.
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* tor-bytes: Remove signature dependency.Gabriela Moldovan2024-02-281-1/+0
|