<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/tor-bytes/src, branch arti-v1.1.6</title>
<subtitle>mirror of https://gitlab.torproject.org/tpo/core/arti
</subtitle>
<id>http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.1.6</id>
<link rel='self' href='http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.1.6'/>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/'/>
<updated>2023-06-21T11:15:41Z</updated>
<entry>
<title>lints: Run maint/add_warning to actually apply new lints</title>
<updated>2023-06-21T11:15:41Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-06-21T10:29:46Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=161b9844dae0aaa2e63bbc77c512d061be6bb390'/>
<id>urn:sha1:161b9844dae0aaa2e63bbc77c512d061be6bb390</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-bytes: Remove use of arrayref</title>
<updated>2023-05-25T18:48:57Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-05-25T18:48:57Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=244ec5dce22179eff9f732e947ee0b2836ba9d48'/>
<id>urn:sha1:244ec5dce22179eff9f732e947ee0b2836ba9d48</id>
<content type='text'>
Part of #872: Now that const generics are in, we have better ways to
express converting slices into array-references.
</content>
</entry>
<entry>
<title>Serval rustdoc link fixes.</title>
<updated>2023-03-08T19:21:33Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-03-07T12:48:47Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=7da5d7a8d7df3428b89d0fcf6f3bef1a4850db61'/>
<id>urn:sha1:7da5d7a8d7df3428b89d0fcf6f3bef1a4850db61</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-bytes: defend against misuse of extract_n().</title>
<updated>2023-03-06T17:33:10Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-03-06T17:33:10Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=dab21bc6243a382e1881fe05e561686bf6c474a9'/>
<id>urn:sha1:dab21bc6243a382e1881fe05e561686bf6c474a9</id>
<content type='text'>
Previously, if somebody wrote this code, an attacker could easily
use it to cause an OOM panic:

```
let n = r.take_u64();
let items: Vec&lt;Foo&gt; = r.extract_n(n as usize)?;
```

The first line of defense here is not to write protocols like that:
we don't actually _have_ any 32-bit counters in our protocol
AFAICT.

The second line of defense is to pre-check `n` for reasonableness
before calling `extract_n`.

Here we add a third line of defense: whereas previously we would do
`Vec::with_capacity(n)` in `extract_n`, we now allocate an initial
capacity of `min(n, r.remaining())`.  This ensures that the size of
the allocation can't exceed the remaining length of the message,
which (for our cell types at least) should prevent it from
overflowing or running OOM.
</content>
</entry>
<entry>
<title>tor-bytes: Clarify that Cursor is not a good thing, and could be neater.</title>
<updated>2023-03-01T16:21:52Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-03-01T16:21:52Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=b36082255b47330dd1bc3b615c320869cc9bd76d'/>
<id>urn:sha1:b36082255b47330dd1bc3b615c320869cc9bd76d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>clarify results of misusing cursors</title>
<updated>2023-03-01T15:57:14Z</updated>
<author>
<name>Ian Jackson</name>
<email>iwj@torproject.org</email>
</author>
<published>2023-03-01T15:57:14Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=bab32c603844683352a230aa4c312a851262c54b'/>
<id>urn:sha1:bab32c603844683352a230aa4c312a851262c54b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-bytes: impl Readable and Writeable for CtByteArray.</title>
<updated>2023-02-28T16:23:44Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-02-28T14:43:17Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=0f88c5131f26f6f56aa0878c44127f232bd652dd'/>
<id>urn:sha1:0f88c5131f26f6f56aa0878c44127f232bd652dd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-bytes: Add cursor functionality to Reader</title>
<updated>2023-02-28T16:23:44Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-02-27T19:33:45Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=0bf1ae70ba06b512c63f73b84d1b357baa4a65d9'/>
<id>urn:sha1:0bf1ae70ba06b512c63f73b84d1b357baa4a65d9</id>
<content type='text'>
We'll use this to implement signature and MAC checking for
EstablishIntro cells.
</content>
</entry>
<entry>
<title>Change tor_bytes::Error::BadMessage to a Cow.</title>
<updated>2023-02-09T15:20:31Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-02-08T13:51:27Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=48ab7b0463aaada172a426ad4b20a63d7f44cb84'/>
<id>urn:sha1:48ab7b0463aaada172a426ad4b20a63d7f44cb84</id>
<content type='text'>
Actually, to avoid making a breaking change, I'm deprecating
BadMessage and creating a new InvalidMessage variant that takes a
Cow.  This way I don't need to track every crate that re-exposes
tor_bytes::Error and call this a breaking change in those.

Making this change will allow tor_bytes errors to be much more
helpful.
</content>
</entry>
<entry>
<title>Allow clippy::unchecked_duration_subtraction in tests</title>
<updated>2023-01-27T13:28:02Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-01-27T13:01:45Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=a6dd92843edf2bd4c58de62a0d562921e4191ada'/>
<id>urn:sha1:a6dd92843edf2bd4c58de62a0d562921e4191ada</id>
<content type='text'>
This panics on error, and we're fine with a panic on misbehavior in
tests.
</content>
</entry>
</feed>
