https://git.schokokeks.org/derivepassphrase.git/tree/0f8ad24096b08640eb38687821d09f13a656967cRecent commits to derivepassphrase.git (0f8ad24096b08640eb38687821d09f13a656967c)2024-09-22T18:36:19+02:00tag:gitlist.org,2012:commit/0f8ad24096b08640eb38687821d09f13a656967cAdd Changelog entry for the test suite SSH agent spawner2024-09-22T18:36:19+02:00Marco Riccisoftware@the13thletter.info
<pre></pre>
tag:gitlist.org,2012:commit/63b51df7a39fd642ca079ac390014d23f617b972Add test fixture for manually spawning known SSH agents2024-09-22T16:37:58+02:00Marco Riccisoftware@the13thletter.info
<pre>Include pytest fixtures to spawn known SSH agents and interface with
the running SSH agent, in an agent-agnostic way. Move the key loading
parts from the test functions into the test fixtures.
This generally makes the actual test functions somewhat cleaner and
easier to read, but because the monkeypatch fixture interferes with
these new fixtures, the net improvements to readibility are only
moderate. The test functions do however profit directly from
reduced copy-and-paste in the key loading part.
Pageant is one of the supported agents, and it behaves markedly
differently than OpenSSH's agent. In particular, Pageant does not
support adding keys with constraints or re-submitting a key it is
already holding, and *every* key type Pageant currently offers yields
a deterministic signature. Furthermore, a bug concerning output
buffering in Pageant 0.81 and lower currently makes it impossible to use
Pageant as a subprocess properly without correctly guessing the socket
address. (This has already been reported upstream.) On the other hand,
Pageant supports ed448 keys, which OpenSSH doesn't. So, implementing
support for Pageant was very valuable to highlight areas where the code
made unreasonable assumptions about SSH agent behavior, in particular
the availability and behavior of the system SSH agent service.
The new fixtures live in `tests/conftest.py`, following a relevant
pytest convention. The fixtures themselves are necessarily platform-
and runtime-dependent, so even though they are test code that should be
included in test coverage, all parts dealing with querying the system,
spawning programs, error handling related to the former and ensuring
a certain functionality is available (or skipping the test otherwise)
are excluded from test coverage. In particular, this includes the
entire fixture to ensure a running agent, and the cleanup part of the
agent with loaded keys fixture; I have however tried various
constellations by hand to ensure the code works if certain agents are
available or unavailable.
</pre>
tag:gitlist.org,2012:commit/7c1d055316e9e6a254c91e9b9f206cddbec4df8fRetire non-repeatability check for unsuitable SSH keys in the tests2024-09-21T12:17:48+02:00Marco Riccisoftware@the13thletter.info
<pre>DSA and ECDSA keys use a nonce during signing, and it is well-known that
reusing the nonce for another signature allows the private key to be
derived directly from those two signatures. Because of this, many
implementations choose the nonce via a high-quality random number
generator. This leads to DSA and ECDSA signatures being non-repeatable,
i.e. signing the same document twice leads to two different
signatures/binary strings. OpenSSH's agent behaves this way.
However, various implementations of DSA or DSA variants have attempted
to find a way to avoid the random number generator by choosing the nonce
deterministically (but still unpredictably, for an attacker): EdDSA
mandates a specific nonce as part of the specification, and RFC 6979
outlines a different deterministic nonce scheme for all (other) DSA
variants. All versions of PuTTY/Pageant use deterministic nonce
generation (a homegrown system in 0.80 and lower, RFC 6979 afterwards),
so DSA and ECDSA signatures by Pageant *are* repeatable. And there is
no reason why OpenSSH couldn't adopt RFC 6979 in the future.
Therefore, remove the check for repeatability in the tests. The `Vault`
class check for key suitability remains unchanged, because while
DSA/ECDSA keys *can* use repeatable signatures, such use is not
*guaranteed*.
</pre>
tag:gitlist.org,2012:commit/3035794147127de9be9b42cf96353e598389b71aAdd principal support for uploading SSH keys to the agent2024-09-21T12:10:20+02:00Marco Riccisoftware@the13thletter.info
<pre>Add the necessary protocol numbers to the `SSH_AGENT` and `SSH_AGENTC`
enums, and the necessary `private_key_blob` data to the
`tests.SUPPORTED_KEYS` and `tests.UNSUITABLE_KEYS` objects.
This suffices for key uploads without constraints, but adding a key
*with* constraints still requires knowledge about the encoding of the
constraints in the agent protocol.
</pre>
tag:gitlist.org,2012:commit/ddce2cbfe9821f95d24d3e2649edbac6f3801574Simplify some SSH agent key uploading tests2024-09-21T11:58:57+02:00Marco Riccisoftware@the13thletter.info
<pre>Remove unused test parameters, which were used solely for display
purposes to generate a readable test ID. Instead of this, use the `ids`
parameter of `pytest.mark.parametrize` directly.
</pre>
tag:gitlist.org,2012:commit/2bb23da7602076aa37f43c3363f6cfcee91f59bdSupport passing expected SSH agent response codes2024-09-21T11:45:20+02:00Marco Riccisoftware@the13thletter.info
<pre>This shifts the remaining error checking into the
`SSHAgentClient.request` method, most of the time. On the other hand,
this makes mocking that method somewhat more involved.
</pre>
tag:gitlist.org,2012:commit/df459996c5d005264830175d20a149002266e13eRelease 0.2.02024-09-12T13:59:16+02:00Marco Riccim@the13thletter.info
<pre></pre>
tag:gitlist.org,2012:commit/e4371b6e3217dce085a3a2abea18828a6de0a5e2Reintroduce dynamic versioning via `hatch version`2024-09-12T13:40:04+02:00Marco Riccim@the13thletter.info
<pre>When we abandoned `hatch version` in
565dd46f8506662fd4abcc8e7f9c7a99ae15958f, we had three top-level
packages sharing a version number, but `hatch version` did not support
reading or updating the version from multiple sources.
Since c4a57f311710768cb18df717a73fd48a8a3077fe however the system is
rooted in the `derivepassphrase` top-level package, and the version
number is internally copied from that package root. We are therefore
once again in the classic scenario that `hatch version` supports.
</pre>
tag:gitlist.org,2012:commit/80c2cd1295cb481f4c9fa1e2950f1dd287017f3dFix version typo in README2024-09-12T13:35:41+02:00Marco Riccim@the13thletter.info
<pre></pre>
tag:gitlist.org,2012:commit/519040a8d1d84e4061b91c2d95f74d0641e94efeFix phrasing and formatting in new changelog entries2024-09-12T13:31:26+02:00Marco Riccim@the13thletter.info
<pre></pre>