<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/tor-keymgr/src, branch arti-v1.2.7</title>
<subtitle>mirror of https://gitlab.torproject.org/tpo/core/arti
</subtitle>
<id>http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.2.7</id>
<link rel='self' href='http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.2.7'/>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/'/>
<updated>2024-09-03T08:09:02Z</updated>
<entry>
<title>Fix typos</title>
<updated>2024-09-03T08:09:02Z</updated>
<author>
<name>Dimitris Apostolou</name>
<email>dimitris.apostolou@icloud.com</email>
</author>
<published>2024-09-03T08:09:02Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=676f913463b7d84f34dd6101b99d03ef79cf57ad'/>
<id>urn:sha1:676f913463b7d84f34dd6101b99d03ef79cf57ad</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-keymgr: Remove unnecessary io::Error handling.</title>
<updated>2024-08-08T10:06:48Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-08-08T09:48:33Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=e060d5bb70d3cdd0ffbb7cbbfeff3b38ed02bd26'/>
<id>urn:sha1:e060d5bb70d3cdd0ffbb7cbbfeff3b38ed02bd26</id>
<content type='text'>
`fs-mistrust` always maps `io::ErrorKind::NotFound` to
`fs_mistrust::Error::NotFound`, so these `io::ErrorKind::NotFound`
branches were unreachable.
</content>
</entry>
<entry>
<title>tor-keymgr: Use CheckedDir::metadata() instead of PathBuf::try_exists().</title>
<updated>2024-08-08T10:06:48Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-08-07T15:31:10Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=cfa23cf3cf6e5c448a5f35ecfaffb111cc81a01b'/>
<id>urn:sha1:cfa23cf3cf6e5c448a5f35ecfaffb111cc81a01b</id>
<content type='text'>
We now use `CheckedDir::metadata()` to check if the path exists and is
of the correct type.
</content>
</entry>
<entry>
<title>tor-keymgr: Use the new relative path wrapper (fmt).</title>
<updated>2024-08-08T10:01:03Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-08-01T17:25:15Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=f05ed2f43a0b1007227deffdb5dda70bb8047a5f'/>
<id>urn:sha1:f05ed2f43a0b1007227deffdb5dda70bb8047a5f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-keymgr: Use the new relative path wrapper.</title>
<updated>2024-08-08T10:01:03Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-08-01T17:20:19Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=19d734f04803c4186d466c1be110f962644ae4a6'/>
<id>urn:sha1:19d734f04803c4186d466c1be110f962644ae4a6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-keymgr: Add new rel_path module with helpers for handling relative paths.</title>
<updated>2024-08-08T10:01:03Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-08-01T17:19:00Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=0fbe8a88ed5e65f921ba009165fbb92f4705bb97'/>
<id>urn:sha1:0fbe8a88ed5e65f921ba009165fbb92f4705bb97</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-keymgr: Add private RelKeyPath type for relative paths.</title>
<updated>2024-08-08T09:53:29Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-07-30T11:27:59Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=619b6ca22b8b42c106b34402a6a6b049808271a4'/>
<id>urn:sha1:619b6ca22b8b42c106b34402a6a6b049808271a4</id>
<content type='text'>
This makes `rel_path` return a `RelKeyPath` instead of a `PathBuf` to
prevent the accidental misuse of relative key paths (like the one
from #1492).

Closes #1494
</content>
</entry>
<entry>
<title>tor-keymgr: Use Path::try_exists() instead of Path::exists().</title>
<updated>2024-07-30T14:20:24Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-07-30T14:14:47Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=761d33b6ef9413bc05b4d48104f597f69ebc9305'/>
<id>urn:sha1:761d33b6ef9413bc05b4d48104f597f69ebc9305</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix new "clippy::needless-maybe-sized" warning on nightly</title>
<updated>2024-07-28T21:48:35Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-28T21:34:18Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=1b6394cec9653937b404b93ed510e90b2eff9ae7'/>
<id>urn:sha1:1b6394cec9653937b404b93ed510e90b2eff9ae7</id>
<content type='text'>
This warning complains when we say `where T: SomeTrait + ?Sized`
when `SomeTrait` is inherently Sized.
</content>
</entry>
<entry>
<title>tor-keymgr: Fix ArtiNativeKeystore::contains() bug.</title>
<updated>2024-07-17T15:55:13Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-07-17T15:13:46Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=a48804f9a0770ab54a117a35c6ffdf4df9387950'/>
<id>urn:sha1:a48804f9a0770ab54a117a35c6ffdf4df9387950</id>
<content type='text'>
This fixes a bug in `ArtiNativeKeystore`'s `Keystore::contains()`
implementation: previously, it called Path::exists() on the relative
path (built by concatenating the key specifier and the extension), so
unless your current directory happened to be the root of the keystore,
`contains()` would always return `false`.

`KeyMgr::generate` uses `Keystore::contains()` under the hood, so it
was affected by this bug too: if called `overwrite = false`, it would
misbehave and overwrite any existing keys.

Internally, we call `KeyMgr::generate` in a couple of places:
  * `tor-hsservice/src/lib.rs`, to generate the `hsid` if it doesn't
    already exist. This callsite is not affected by the bug, because
    `KeyMgr::generate` is only called if `KeyMgr::get` returns `None`
  * `tor-hsservice/src/ipt_mgr.rs`, to generate `KS_hss_ntor` and
    `KS_hs_ipt_sid` keys for intro point establishment. This callsite is
    also not affected (because it too calls `get()` before attempting to
    `generate()`)

The bug affects any downstream users that use `KeyMgr::generate`
with a key manager backed by `ArtiNativeKeystore`.

------
`KeyMgr::get_or_generate` is not affected, even though it calls
`Keymgr::generate` (it performs a separate extra check before calling
`generate()`). (Both suffer from a known TOCTOU race, but that's a
separate matter.) As an aside, I'd like to somehow unify
`KeyMgr::get_or_generate` and `KeyMgr::get` (I've had some attempts in
the past but ended up abandoning them because the result was more
unergonomic than the existing APIs).

Part of #1492
</content>
</entry>
</feed>
