<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/tor-bytes/src, branch arti-v1.1.9</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.9</id>
<link rel='self' href='http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.1.9'/>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/'/>
<updated>2023-09-28T14:59:29Z</updated>
<entry>
<title>Remove direct dependency on generic-array</title>
<updated>2023-09-28T14:59:29Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-09-28T14:15:47Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=34766342614bb4ca5742ee041273e99ff690ed20'/>
<id>urn:sha1:34766342614bb4ca5742ee041273e99ff690ed20</id>
<content type='text'>
Instead of tying ourselves to a particular version of the
generic-array crate, we now always use the version re-exported by
our RustCrypto crates.  This lets us avoid the possibility of
version mismatch.

(Originally I had planned to upgrade to generic-array 1.0, but then
I found that we were not actually using it.)
</content>
</entry>
<entry>
<title>Run maint/add_warning to add lint block everywhere</title>
<updated>2023-08-23T09:34:00Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-08-22T14:28:12Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=42df88d6bf6dbb460d2e5e1cd4838aafaffbe9ac'/>
<id>urn:sha1:42df88d6bf6dbb460d2e5e1cd4838aafaffbe9ac</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-bytes: deprecate always_bug with From trait</title>
<updated>2023-08-17T11:52:29Z</updated>
<author>
<name>Emil Engler</name>
<email>me@emilengler.com</email>
</author>
<published>2023-08-17T09:45:17Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=73059827f037763bae465a972900a65221dc1f7b'/>
<id>urn:sha1:73059827f037763bae465a972900a65221dc1f7b</id>
<content type='text'>
This commit deprecates the `EncodeError::always_bug` function with a
`From&lt;EncodeError&gt; for Bug` trait, which is a more semantically correct
way to perform this action.
</content>
</entry>
<entry>
<title>Run add_warnings on all files.</title>
<updated>2023-08-04T11:45:04Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-08-04T11:45:04Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=cec6d0ce33b4b5cebbce57f55faec83397e9c953'/>
<id>urn:sha1:cec6d0ce33b4b5cebbce57f55faec83397e9c953</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Run maint/add_warning to actually apply new lint allows</title>
<updated>2023-07-10T12:49:51Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-07-10T11:19:32Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=473447a82e099fd52a674c28f5bc24b3e05208c0'/>
<id>urn:sha1:473447a82e099fd52a674c28f5bc24b3e05208c0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Run add_warning to remove `missing_panics_doc` deny.</title>
<updated>2023-07-06T18:32:23Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-07-06T18:32:23Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=03f9f9987a7ba42368d82363bef7f569e32ffe2c'/>
<id>urn:sha1:03f9f9987a7ba42368d82363bef7f569e32ffe2c</id>
<content type='text'>
Closes #950.
</content>
</entry>
<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>
</feed>
