https://git.schokokeks.org/derivepassphrase.git/tree/b725e5f10e6031cf0781c8593fe854b2046a3bae Recent commits to derivepassphrase.git (b725e5f10e6031cf0781c8593fe854b2046a3bae) 2024-11-27T20:23:06+01:00 tag:gitlist.org,2012:commit/b725e5f10e6031cf0781c8593fe854b2046a3bae Add missing tests for `SSHAgentClient.query_extensions` runtime errors 2024-11-27T20:23:06+01:00 Marco Ricci software@the13thletter.info <pre>Currently, this is still a white-box, maliciously compliant design that relies heavily on implementation details of the function under test. That said, the failure cases being triggered here are all SSH agent protocol violations, which would otherwise be difficult to trigger in "real" SSH agents. &lt;/pre&gt; tag:gitlist.org,2012:commit/70535b833256e31c5913e3decffc1706bb4ecd38 Retire the use of symlinks for the README and the changelog 2024-11-27T18:21:17+01:00 Marco Ricci software@the13thletter.info <pre>Symlinks interact very poorly with online git repository viewers, and while they are offline viewable on Unixish systems, readers only see the source view, not the rendered view. For the documentation frontpage `docs/index.md`, use the Snippets extension (Material for MkDocs/Python-Markdownx) to include the contents of `README.md`. This will allow future customization of the frontpage by either appending further content or only embedding parts of the README. For the changelog, because we use `scriv` to maintain it semi-automatically and thus want the changelog snippets to stay out of the top-level directory, we do not want `docs/changelog.md` to symlink to or to snippet-include the top-level `CHANGELOG.md`. Instead, we let `CHANGELOG.md` point to the `docs` directory (in prose), and purge the symlinks to the SVG badges. The original intent was to make the changelog renderable at the top-level, without the MkDocs machinery, but this is only really feasible if the changelog is handwritten, which hasn't been the case anymore for quite some time already. &lt;/pre&gt; tag:gitlist.org,2012:commit/adfb4e89b0a8b7e92e7b777c36fd68d51057f231 Use canonical test keys in all SSH agent key listings 2024-11-27T15:10:52+01:00 Marco Ricci software@the13thletter.info <pre>For all documentation, whenever a formatted key listing of suitable keys is presented, use the test keys from the test suite if possible. Also, correct a typo. &lt;/pre&gt; tag:gitlist.org,2012:commit/54f1edfb13a587ccccba30254a52b75d7387d4ad Unmark icon- and badge-type external links as external 2024-11-27T14:16:59+01:00 Marco Ricci software@the13thletter.info <pre>Icon-/badge-only external links lose their visual succintness if they include the external link marker afterwards. Also use this opportunity to rewrite the external links CSS selectors using the `:is` and `:has` pseudo-classes, which leads to much less code repetition. Supposedly, every major browser has had a release with `:has` support since December 2023, so browser compatibility shouldn't be a major issue. &lt;/pre&gt; tag:gitlist.org,2012:commit/5959cb77d6074f26c59cfe5342592aef52c94aee Document that `is_suitable_ssh_key` now takes an optional agent client in the changelog 2024-11-27T13:29:15+01:00 Marco Ricci software@the13thletter.info <pre>&lt;/pre&gt; tag:gitlist.org,2012:commit/da7fed85c9fe23df9a0bba7da52389d0fdcb402f Add an ecdsa-sha2-nistp521 SSH test key 2024-11-27T00:09:55+01:00 Marco Ricci software@the13thletter.info <pre>This case was apparently forgotten when adding the 256- and 384-bit keys. &lt;/pre&gt; tag:gitlist.org,2012:commit/df33a1594cc2496e3858f3818cdab0f807d9ed88 Publish polished `is_suitable_ssh_key` and `has_deterministic_dsa_signatures` interfaces 2024-11-26T23:28:43+01:00 Marco Ricci software@the13thletter.info <pre>The `has_deterministic_signatures` function internally only ever checked whether DSA signatures were known deterministic, because currently, signature schemes are either deterministic by design or they are DSA-like and can be derandomized via RFC 6979 or a similar procedure. There's no guarantee this dichotomy will stay this way in the future. Thus it is better to rename the function to match what it actually tests: Does this agent use deterministic DSA and ECDSA signatures? We do just that. In a similar vein, the `Vault._is_suitable_ssh_key` only really checks if the key type is known deterministic, not whether the key is suitable; the latter depends on the SSH agent, and requires a call to the old `has_deterministic_signatures` function. We could of course analogously rename `_is_suitable_ssh_key` into `is_known_deterministic_key_type` or similar, but this feels too much like exposing implementation details to the API user. It seems better to expose a `Vault.is_suitable_ssh_key` method that actually does what it advertises: check whether a key type is known deterministic under a given SSH agent, or under all SSH agents in general. So we do just that. Finally, we clean up some inconsistencies in the `query_extensions` docstring, and some missing SSH agent clients not passed on to the calls to the `Vault.phrase_from_key` function in the tests. &lt;/pre&gt; tag:gitlist.org,2012:commit/fdbea449cda2a00785dd803c43cf9dbec2995ba1 Let the `running_ssh_agent` test fixture report the agent type 2024-11-26T14:26:21+01:00 Marco Ricci software@the13thletter.info <pre>In the current test scenario, where multiple SSH agents are spawned if possible, it is highly unhelpful to know *that* a running SSH agent failed, but not *which* agent did. For debugging purposes, it is better if the `running_ssh_agent` test fixture reports not only the agent's socket, but also its type. It is sufficient to have the type passed as a fixture output/test function input, because `pytest` will then pretty-print it when a test function fails. &lt;/pre&gt; tag:gitlist.org,2012:commit/8a56dbdafab38d5493e1aee317f9fe7ec480c156 Decouple deterministic signatures from general SSH agent detection 2024-11-26T14:12:53+01:00 Marco Ricci software@the13thletter.info <pre>Instead of tying deterministic signatures directly to the detection of Pageant specifically, add a general mechanism for attempting to infer the connected SSH agent from its reported list of extensions. This moves the question of *how* we detect certain SSH agents out of the deterministic signature checking function. Alas, OpenSSH does not support the extension query message we issue, despite them supporting the extension system in general *and* stewarding the SSH agent protocol specification which defines this message normatively. So our implementation must tolerate a moderate level of spec violation. &lt;/pre&gt; tag:gitlist.org,2012:commit/b5cb2824fdb57c10cc1021ebe284d33426824a28 Fix test suite to actually test deterministic signature support 2024-11-26T14:03:34+01:00 Marco Ricci software@the13thletter.info <pre>So far, the test suite was silently passing for me, because it requires either a patched version or a not-yet-released version of PuTTY to actually run the tests against Pageant (which is the main beneficiary of deterministic signature detection). Actually plugging in a suitable patched Pageant version revealed a couple of key places where we silently assume that the key type alone determines its suitability for `derivepassphrase`. This commit rectifies that. &lt;/pre&gt;