Skip to content

feat(keygen): quantumssh keygen <PATH> — RFC-0018 / ADR-0058 - #252

Merged
gonzafg2 merged 5 commits into
mainfrom
feat/keygen-adr-0058
Nov 3, 2026
Merged

gonzafg2 merged 5 commits into
mainfrom
feat/keygen-adr-0058

Conversation

@gonzafg2

@gonzafg2 gonzafg2 commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

This implements RFC-0018 as ADR-0058 decides. It is milestone M3 of docs/plans/alpha-distribution.md. quantumssh keygen <PATH> writes a new ssh-mldsa44-ed25519 host key and its .pub, so a server host no longer needs OpenSSH 10.6 to create its own host key.

$ quantumssh keygen /etc/quantumssh/ssh_host_mldsa44_ed25519_key
wrote /etc/quantumssh/ssh_host_mldsa44_ed25519_key (private, 0600)
wrote /etc/quantumssh/ssh_host_mldsa44_ed25519_key.pub (public, 0644)
SHA256:…
  • Core encoder (ADR-0058 §2). host_key::generate_host_key() makes one 68-byte draw from getrandom: the seeds, then the check word. It encodes the openssh-key-v1 container in OpenSSH's layout: an empty comment, padding 1, 2, 3, … to a multiple of 8, and 70-column PEM with padded base64.

    • Every buffer that holds the seeds is Zeroizing and sized exactly through a new Writer::with_capacity. None of them reallocates, so no unerased copy is left behind. debug_asserts check the sizes in tests.
    • An RNG error returns RngError before any byte is used.
    • The fingerprint is the function server.started uses.
  • File writer (ADR-0058 §3, crates/quantumssh/src/keygen.rs).

    • It canonicalizes the parent and opens it O_DIRECTORY|O_NOFOLLOW.
    • It applies ADR-0029's ancestor predicate through that descriptor and to every directory above it.
    • It creates both files with openat at 0600 and 0644 (O_EXCL|O_NOFOLLOW), runs fchmod, generates the key, writes and fsyncs.
    • A failure removes only the files this run created, through the directory descriptor. If private-key bytes may have reached the disk, the message says to treat the key as never used. A failed removal is its own error and names the path left behind.
  • CLI (ADR-0058 §1). keygen is recognized only as the first argument, followed by exactly one path that is not a flag. Any other shape is usage: quantumssh keygen <PATH>. It is dispatched before any configuration, logging or runtime setup, and --help gains a SUBCOMMANDS: section.

  • Interop gate (ADR-0058 §4). A new step stops the first server and runs keygen. It then checks:

    • that ssh-keygen -y reproduces the .pub byte for byte;
    • that ssh-keygen -lf prints the fingerprint keygen printed;
    • that a second server started with the key on $PORT + 1 is reached by the stock client, which sees that same fingerprint (Server host key: …).

    The rest of the gate keeps its ssh-keygen host key, so both directions stay covered.

  • Docs (RFC-0018 §9). Step 3 of docs/deployment.md now uses quantumssh keygen, and ssh-keygen 10.6 stays documented as an alternative. There is a CHANGELOG Added entry, and the --host-key help names both tools.

  • ADR-0058. Its Status is now Accepted, with this PR. One wording change matches the code: the predicate and its mode_of helper are pub inside the private config module, because clippy's redundant_pub_crate (nursery, -D warnings) rejects pub(crate) there. The visibility is the same.

No dependency is added, and Cargo.lock is unchanged.

Refs #248

Test plan

  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace: 331 tests, including the new ones:
    • core: the round trip through HostKey::from_openssh_pem, pad_to_block for every residue, the draw layout, the empty comment, the padding bytes, and a failing RNG;
    • binary unit: split and a failing generator, which leaves no file and says no key was written;
    • binary integration (tests/keygen.rs): success with modes 0600/0644, a bare file name, umask 077, an existing key, an existing .pub only (the operator's file is left as it was), a symlink leaf, a parent symlinked to a 0777 directory, a group-writable ancestor, every usage-error shape, and the help text.
  • cargo build --workspace --release
  • tests/interop/run_openssh_client.sh on macOS arm64 with the OpenSSH 10.6p1 client from Homebrew: INTEROP PASS, including keygen_read_by_ssh_keygen and keygen_host_key_serves
  • The openssh-interop CI gate in the pinned Debian forky container (10.6p1)
  • Reviewers: Claude Code Review, Codex, opencode

https://claude.ai/code/session_01QpBZ4pLj7mjenN8SXpJehu

…5519 host key

RFC-0018 and ADR-0058. A server host no longer needs OpenSSH 10.6 to
create its own host key.

- Core: `host_key::generate_host_key()` makes one 68-byte draw from
  getrandom (the seeds, then the check word) and encodes the
  openssh-key-v1 container in OpenSSH's layout: empty comment, padding
  1, 2, 3, ... to a multiple of 8, 70-column PEM. Every buffer that holds
  the seeds is Zeroizing and sized exactly, through the new
  `Writer::with_capacity`, so none reallocates. An RNG error returns
  `RngError` before any byte is used.
- Binary: `keygen.rs` canonicalizes the parent, opens it O_DIRECTORY |
  O_NOFOLLOW, applies ADR-0029's ancestor predicate through the
  descriptor and to every directory above it, then creates both files
  with openat at 0600 and 0644 (O_EXCL | O_NOFOLLOW), runs fchmod,
  generates, writes and fsyncs. A failure removes only the files this run
  created, through the directory descriptor.
- CLI: `keygen` is recognized only as the first argument, followed by
  exactly one non-flag path, and is dispatched before any configuration,
  logging or runtime setup. `--help` lists it.
- Tests: core unit tests for the round trip, padding, comment, draw
  layout and RNG failure; binary integration tests for success, a bare
  file name, umask 077, every refusal and every usage error; an
  in-process test with a failing generator.
- Interop gate: a new step stops the first server, checks that
  `ssh-keygen -y` reproduces the .pub byte for byte and `ssh-keygen -lf`
  the printed fingerprint, then starts a second server with the key and
  checks the client sees that fingerprint.
- Docs: deployment.md step 3 uses `quantumssh keygen`, and ssh-keygen
  10.6 stays documented as an alternative; CHANGELOG entry; ADR-0058
  wording on the predicate's visibility matches the code (clippy's
  redundant_pub_crate requires `pub` inside the private module).

No dependency is added.

Refs #248

Claude-Session: https://claude.ai/code/session_01QpBZ4pLj7mjenN8SXpJehu
Signed-off-by: Gonzalo Fleming <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T21:16:49.922238Z 106caaa Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

/oc

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 7e0a8e2008

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@claude

claude Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

1 similar comment
@claude

claude Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

PR Review: feat(keygen): quantumssh keygen <PATH> — RFC-0018 / ADR-0058 (#252)

Decision: 🟡 Minor changes
Iteration: First review — the only earlier comment is Codex's review-status summary (still marked running, with no findings recorded).
Lenses applied: Rust under crates/ (tests and encoder/file writer); design decision (docs/adr/0058, docs/rfcs/0018); CI/interop (tests/interop/run_openssh_client.sh).

Executive summary

The PR implements RFC-0018/ADR-0058 end to end: a core openssh-key-v1 encoder, a descriptor-based file writer with O_EXCL | O_NOFOLLOW and clean-up, CLI dispatch before server setup, unit/integration tests, and an interop round trip with ssh-keygen 10.6. On static review the production path matches the RFC/ADR and the hard rules: no first-party unsafe, no new dependency, no legacy primitive, and the key-material buffers are zeroizing on the normal path. The one issue is test setup that can make the new suite fail under a common umask 002; I could not execute cargo, clippy, or the OpenSSH interop in this read-only environment, so CI execution is not independently verified.

New findings

🟡 Important (should be resolved)

[crates/quantumssh/tests/keygen.rs:16-23] and [crates/quantumssh/src/keygen.rs:252-259] — test-environment robustness (confidence: 82)

Problem: Both tree() helpers create the test directory with create_dir_all and then chmod only the leaf. The intermediate target/keygen-tests / target/keygen-unit-tests is left with the process umask. Under umask 002 it is 0775, so keygen's ADR-0029 ancestor check (crates/quantumssh/src/keygen.rs:118-123, predicate at crates/quantumssh/src/config.rs:260,287) refuses the directory before writing anything. Success-path tests such as writes_the_pair_with_its_modes and a_bare_file_name_is_written_in_the_working_directory, and the unit test a_failing_rng_leaves_no_file, then fail with “group/world-writable ancestor directory” on a fresh run. The interop script already guards this exact case with chmod go-w target (tests/interop/run_openssh_client.sh:24-26); the new tests do not.

Fix: Make the test tree’s whole ancestor chain safe before invoking keygen: create it with std::fs::DirBuilder + DirBuilderExt::mode(0o700), and chmod go-w any pre-existing shared parent (target, target/keygen-tests, target/keygen-unit-tests) as the interop script does. Optionally add a test that runs a success case under umask 002 to lock the behaviour.

Anchor: ADR-0058 §3 (the parent and every ancestor must pass ADR-0029’s predicate), ADR-0029; CLAUDE.md “Key commands” (the validation loop must pass on every PR); the interop script’s own umask guard.

Decision: 🟡 Minor changes


opencode v2.2.3 · opencode-go/deepseek-v4.1-flash · github run

Answers opencode on #252. Both tree() helpers left target/ and the shared test base with the process umask. Under umask 002 they are 0775, and keygen's ancestor check refuses them, so the success-path tests failed on a fresh run. The helpers now drop the group and world write bits from those directories, as the interop script does for target/. Reproduced by making target/ and the bases group-writable: 6 of 10 integration tests failed before, all pass after.

Refs #248

Claude-Session: https://claude.ai/code/session_01QpBZ4pLj7mjenN8SXpJehu
Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Answer to the opencode review (🟡 Minor changes, first iteration):

Finding Verdict Action
tests/keygen.rs and src/keygen.rs tree() leave target/ and the shared test base with the process umask, so under umask 002 the ancestor check refuses them Agreed Fixed in 1d2197e. Both helpers now drop the group and world write bits from target/ and the test base, as run_openssh_client.sh does for target/. Reproduced first: with those directories made group-writable, 6 of the 10 integration tests failed. After the fix, all 10 integration tests and both unit tests pass in the same state, and the directories end up 0755.

The optional test of a success case under umask 002 is not added. The umask is per process and the tests run in parallel threads, so setting it would affect every other test. The reproduction above is the check for this case.

The older audit_log.rs and systemd.rs helpers make the same assumption. That is out of scope here and can go in a follow-up.

@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

/oc

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 1d2197ee61

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

PR Review: feat(keygen): quantumssh keygen <PATH> — RFC-0018 / ADR-0058 (#252)

Decision: 🟡 Minor changes
Iteration: Review #2 (1 resolved, 0 open)
Lenses applied: Rust under crates/, design decision (docs/adr/0058, docs/rfcs/0018, docs/deployment.md), CI/interop (tests/interop/run_openssh_client.sh)

Executive summary

The PR implements RFC-0018/ADR-0058 end to end: a pure openssh-key-v1 encoder, a descriptor-relative file writer with O_EXCL | O_NOFOLLOW and run-scoped cleanup, CLI dispatch before configuration/logging/runtime, unit and integration tests, and an ssh-keygen 10.6 round trip in the interop gate. On static review the implementation holds the hard rules: no first-party unsafe, no new dependency, no new legacy primitive, PQ-only host-key type, fail-closed RNG with no implicit generation, and exact-capacity Zeroizing buffers on the new encoder. The only reportable gap is the new rotation guidance in docs/deployment.md, which does not account for the .pub file that also blocks keygen; no Rust or CI finding reaches the report threshold. cargo, clippy and the interop gate are not executable in this environment, so CI results are not independently confirmed.

Previous issues

# Issue Status Notes
1 Both tree() helpers left target/ and the shared test base at the process umask, so under umask 002 the ancestor check refused the success-path tests ✅ Fixed in 1d2197e: both helpers now clear group/world write bits on target/ and the base (tests/keygen.rs:19-31, src/keygen.rs:255-269). Verified statically against the current code.

New findings

🟡 Important (should be resolved)

docs/deployment.md:81-82 — documentation / host-key rotation (confidence: 84)

Problem: The new rotation sentence says only "move the old one aside", but keygen opens both <PATH> and <PATH>.pub with O_EXCL (src/keygen.rs:141-142, :192-200). An operator who moves only the private key aside leaves the old .pub and the next run fails with hk.pub: already exists — the exact case proven by tests/keygen.rs:153-159. The sentence also never says to destroy the old private key once the new fingerprint is published, which is the point of rotating after a suspected compromise.

Fix:

- It never replaces a file, so rotation is manual: move **both**
  `<PATH>` and `<PATH>.pub` aside (or delete them), run
  `quantumssh keygen` again, `chown` the key, publish the new
  fingerprint, and restart. After clients have verified the new
  fingerprint, destroy the old private key; keep it only as an
  access-controlled rollback copy if you need one.

Anchor: threat model §5.5.3 ("Operators must have a documented rotation procedure"); RFC-0018 §3/Guide ("If either file exists, it exits non-zero"); ADR-0058 §3 steps 4-5 (the .pub is O_EXCL too and an operator's existing .pub is deliberately left alone).

💡 Suggestions

  • tests/interop/run_openssh_client.sh:216: KG_PORT=$((PORT + 1)) does unvalidated bash arithmetic on the documented QUANTUMSSH_PORT override. QUANTUMSSH_PORT=08 aborts the script as invalid octal, and 65535 yields 65536, which SocketAddr rejects, so the gate waits out wait_listening and fails. Normalise once after line 19 (PORT=$((10#$PORT)) after a ^[0-9]+$ check, bound 1..65534) or let the second server bind port 0. Anchor: the script's line 15/19 env contract; ADR-0058 §4's $PORT + 1 step.

opencode v2.2.3 · opencode-go/deepseek-v4.1-flash · github run

…port arithmetic in base 10

Answers opencode review #2 on #252. keygen refuses an existing .pub as well as an existing key, so the rotation step now moves both aside, repeats the chown, publishes the new fingerprint and destroys the old private key once clients have the new one. KG_PORT is computed in base 10, so a QUANTUMSSH_PORT with a leading zero is not read as octal.

Refs #248

Claude-Session: https://claude.ai/code/session_01QpBZ4pLj7mjenN8SXpJehu
Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Answer to opencode review #2 (🟡 Minor changes):

Finding Verdict Action
docs/deployment.md: rotation says to move only the key aside, but keygen also refuses an existing .pub; the step also never says to destroy the old key Agreed Fixed in b1f39c0. The step now moves both files aside, runs keygen and the chown again, publishes the new fingerprint and restarts. It then says to destroy the old private key once clients have the new fingerprint.
💡 KG_PORT=$((PORT + 1)): QUANTUMSSH_PORT=08 is read as octal and aborts the script Agreed, partly Fixed in b1f39c0 with $((10#$PORT + 1)). The 65535 edge is not handled. There the second server fails to bind and the gate fails with server never listened on port 65536 and that server's log, a loud and specific failure. CI uses the default port.

The gate passes again locally after the change (keygen_read_by_ssh_keygen, keygen_host_key_serves, INTEROP PASS).

@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

/oc

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: b1f39c06f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

PR Review: feat(keygen): quantumssh keygen <PATH> — RFC-0018 / ADR-0058 (#252)

Decision: 🟡 Minor changes
Iteration: Review #3 (3 resolved, 0 open from previous reviews; 1 new finding)
Lenses applied: design/docs (RFC-0018, ADR-0058, deployment rotation), Rust under crates/, CI/interop

Executive summary

The PR implements RFC-0018/ADR-0058 end to end: a pure openssh-key-v1 encoder in quantumssh-core, a descriptor-relative file writer with O_EXCL | O_NOFOLLOW, CLI dispatch before server setup, unit/integration tests, and an ssh-keygen 10.6 round trip in the interop gate. The new Rust path holds the hard rules: no first-party unsafe, no new dependency, no legacy primitive, fail-closed RNG, and exact-capacity Zeroizing buffers for every seed-bearing encoder layer. The one reportable gap is in the newly added host-key rotation guidance, which does not tell clients to remove the old known_hosts entry; cargo, clippy and the OpenSSH interop were not executable in this read-only environment, so CI execution is not independently confirmed.

Previous issues

# Issue Status Notes
1 Both tree() helpers left target/ and the shared test bases at the process umask, so under umask 002 the ancestor check refused the success-path tests ✅ Fixed in 1d2197ee6125e4c7ce50cc931457167b5631088c; both helpers now clear group/world write bits on target/ and the base (tests/keygen.rs:19-31, src/keygen.rs:255-269).
2 Rotation guidance moved only the key aside, but keygen also refuses an existing .pub; it never said to destroy the old key ✅ Fixed in b1f39c06f8307b81ee67f1ed936582931cc82e16; the bullet now moves both files, repeats the chown, publishes the new fingerprint, and destroys the old private key (docs/deployment.md:81-84).
3 KG_PORT=$((PORT + 1)) read a leading-zero QUANTUMSSH_PORT as octal and aborted the script ✅ Fixed in b1f39c06f8307b81ee67f1ed936582931cc82e16 with $((10#$PORT + 1)) (run_openssh_client.sh:216); the 65535 edge remains, but it fails loudly and is not the reported defect.

New findings

🟡 Important (should be resolved)

docs/deployment.md:81-84 — operational rotation guidance (confidence: 83)

Problem: The new rotation bullet tells the operator to move both key files aside, run keygen and the chown, publish the new fingerprint and restart, then destroy the old private key. It never tells clients to remove the old host-key entry from known_hosts. With OpenSSH's default host-key checking, the client aborts with REMOTE HOST IDENTIFICATION HAS CHANGED / Host key verification failed; publishing the new fingerprint does not clear the stale same-type entry. An operator following the guide will strand existing clients, and the obvious workaround (StrictHostKeyChecking=no) weakens the check the guide relies on. The guide already documents the required ssh-keygen -R step for the Ed25519 → composite cutover at lines 200-206, but that paragraph is scoped to the algorithm switch, not to a later same-algorithm rotation.

Fix: Add the client-side step to the rotation bullet, e.g. after "publish the new fingerprint and restart": have clients run ssh-keygen -R <host> — or ssh-keygen -R '[<host>]:2222' for another port — and verify the published fingerprint on first connection before the old private key is destroyed. Cross-reference the existing client-side paragraph at docs/deployment.md:200-206.

Anchor: docs/threat-model.md §5.5.3 ("Operators must have a documented rotation procedure"); RFC-0012 "What changes for an existing test deployment"; the guide's own client-side procedure at docs/deployment.md:200-206.


opencode v2.2.3 · opencode-go/deepseek-v4.1-flash · github run

…entry

Answers opencode review #3 on #252. After a rotation, OpenSSH's default host-key checking refuses the host until the client removes the old entry, so the rotation step now points at step 5's ssh-keygen -R and asks clients to check the new fingerprint.

Refs #248

Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Answer to opencode review #3 (🟡 Minor changes):

Finding Verdict Action
docs/deployment.md: the rotation step never tells clients to remove the old known_hosts entry, so OpenSSH refuses the host after a rotation Agreed Fixed in 106caaa. After the restart, each client removes the old entry with ssh-keygen -R, pointing at step 5's commands for port 22 and other ports, and checks the new fingerprint on its next connection. The step names OpenSSH's "REMOTE HOST IDENTIFICATION HAS CHANGED" refusal so the operator recognizes it. Destroying the old private key stays last.

@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

/oc

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 106caaac31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@claude

claude Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

PR Review: feat(keygen): quantumssh keygen <PATH> — RFC-0018 / ADR-0058 (#252)

Decision: 🟢 Approved
Iteration: Review #3 (0 open from prior reviews; prior two reviews pre-dated commit 106caaa)
Lenses applied: Rust under crates/, design decision (docs/adr/0058), CI (tests/interop/)

Executive summary

This PR adds a quantumssh keygen <PATH> subcommand (RFC-0018 / ADR-0058) that generates an ssh-mldsa44-ed25519 composite host key pair in the openssh-key-v1 format. The implementation is careful: seed material is Zeroizing throughout, the custom Debug impl deliberately omits key bytes, file creation uses openat with O_EXCL|O_NOFOLLOW at mode 0600/0644 (with fchmod to strip any umask), and the interop gate confirms round-trip compatibility with ssh-keygen -y and -lf. No new dependencies are introduced and Cargo.lock is unchanged.

The latest commit (106caaa, documentation) updates the docs/deployment.md rotation procedure to match the new subcommand; it is in scope for this review.

Previous issues

The two prior Claude reviews raised no findings. 106caaa was not covered by either.

New findings

No findings at or above the 80-confidence threshold.

No unsafe added. Key material is zeroized on all paths including error paths. ADR-0058 edit is permissible (it was Proposed, not Accepted, before this PR). All commit messages follow Conventional Commits. No legacy crypto introduced.

Decision: 🟢 Approved

@gonzafg2
gonzafg2 merged commit 2aa2576 into main Nov 3, 2026
14 checks passed
@gonzafg2
gonzafg2 deleted the feat/keygen-adr-0058 branch November 3, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant