<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/tor-keymgr/src/keystore, branch arti-v1.2.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.2.6</id>
<link rel='self' href='http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.2.6'/>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/'/>
<updated>2024-07-30T14:20:24Z</updated>
<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>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>
<entry>
<title>tor-keymgr: Rename function to clarify it returns a relative path (fmt).</title>
<updated>2024-07-17T15:05:43Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-07-17T15:05:43Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=415e6e86e73ca1bf6c847d0bd488a091f9a18f3d'/>
<id>urn:sha1:415e6e86e73ca1bf6c847d0bd488a091f9a18f3d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-keymgr: Rename function to clarify it returns a relative path.</title>
<updated>2024-07-17T15:05:10Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-07-17T15:05:10Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=e259e166c51e4e633eb52d45fe62bb53c3e2403f'/>
<id>urn:sha1:e259e166c51e4e633eb52d45fe62bb53c3e2403f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-keymgr: Add test for ArtiNativeKeystore::contains.</title>
<updated>2024-07-17T15:01:02Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-07-17T15:01:02Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=87145fb76f09391a452ddbb0c8d0f897109ca9e3'/>
<id>urn:sha1:87145fb76f09391a452ddbb0c8d0f897109ca9e3</id>
<content type='text'>
This new assertion fails, because the implementation of
`ArtiNativeKeystore::contains()` is buggy: it calls Path::exists() on
the relative path built by concatenating the key specifier and the
extension (so unless your current directory happens to be the root of
the keystore, contains() is always going to return false).

Part of #1492
</content>
</entry>
<entry>
<title>tor-keymgr: Correct message for mistrust error</title>
<updated>2024-07-10T10:50:44Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2024-07-09T13:47:01Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=e0f844d704e20f5d0ab6f4db32760889012cd870'/>
<id>urn:sha1:e0f844d704e20f5d0ab6f4db32760889012cd870</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-keymgr: Add script for generating test key files.</title>
<updated>2024-05-15T11:00:12Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-05-01T12:57:00Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=2828a5ab2e667bd3d8c8333fd26999a999d3a0d7'/>
<id>urn:sha1:2828a5ab2e667bd3d8c8333fd26999a999d3a0d7</id>
<content type='text'>
`tor-keymgr/testdata` contains a bunch of OpenSSH keys used for testing.
I meant to share the script I generated them with, but somehow never got
around to it.

Note: the OpenSSH keys generated by this script are going to look
slightly different than the ones that are checked into the repo. This is
because some of those original key files were generated ad-hoc (I
manually modified them a while ago, but I forgot exactly how
</content>
</entry>
<entry>
<title>Revert "tor-keymgr: Fix now-failing test."</title>
<updated>2024-05-08T18:08:24Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-05-08T18:07:36Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=04d527bbd66545e6b0178951c4d041287cdb12bb'/>
<id>urn:sha1:04d527bbd66545e6b0178951c4d041287cdb12bb</id>
<content type='text'>
This reverts commit 9ea35caeb1ed23fd029627d04819debc41d85c77.
</content>
</entry>
<entry>
<title>tor-keymgr: Validate the KeyType when inserting into the ephemeral keystore.</title>
<updated>2024-05-08T18:08:24Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-05-08T18:06:22Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=4401bfb74d0dde20fd8e3ce2fb5b4cb4d2182147'/>
<id>urn:sha1:4401bfb74d0dde20fd8e3ce2fb5b4cb4d2182147</id>
<content type='text'>
Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2131#note_3028014
</content>
</entry>
<entry>
<title>tor-keymgr: Make SshKeyData an opaque type.</title>
<updated>2024-05-07T18:43:35Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2024-05-07T18:40:34Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=dfb63f8eb8453ae417d2381859cfe7bd213651e5'/>
<id>urn:sha1:dfb63f8eb8453ae417d2381859cfe7bd213651e5</id>
<content type='text'>
This helps prevent external users from creating `SshKeyData` out of
unsupported types of `ssh_key::public::KeyData` and
`ssh_key::private::KeypairData`.
</content>
</entry>
</feed>
