Skip to content

test(interop): the OpenSSH conformance suite (ADR-0062) - #290

Merged
gonzafg2 merged 5 commits into
mainfrom
test/conformance-suite
Nov 21, 2026
Merged

gonzafg2 merged 5 commits into
mainfrom
test/conformance-suite

Conversation

@gonzafg2

Copy link
Copy Markdown
Owner

Implements ADR-0062 and accepts it. The interop gate grows from 15 checks into 43 cases, one for every behaviour that a document states and a stock OpenSSH client can reach, refusals included. It runs where the gate ran: on every PR as openssh-interop, and on every release artifact.

What changes

The suite (tests/interop/)

  • CASES.md, the catalogue. One line per case: its name, the document it checks, and what a client may lack for the case to skip.
  • cases.sh, the cases. One function each.
  • run_openssh_client.sh, the driver. It enforces the catalogue:
    • before the first case, it fails if a case has no line, a line has no case, or a line is repeated;
    • after the last, it fails unless every case reported ok, or a skip that both its line and INTEROP_ALLOW_SKIP allow;
    • a run that stops early with status 0 fails too.
  • negative_no_hybrid asserts the refusal. It used to pass on any failure, a server that was down included.
  • The client reads nothing of the account running it: -F /dev/null on every client run, and no agent (below).

The workflows

  • interop.yml: no skips allowed; only its comment changes.
  • release.yml, macOS leg: four skips allowed, because its client has no OpenSSL and no zlib, so no AES-GCM, no RSA or ECDSA, and no compression. Its no-fallback check also covers ssh-keyscan and ssh-agent, which the suite now uses.

What the suite found, put right first (ADR-0062 §2)

  • docs/deployment.md §3: ssh-keyscan cannot fetch the host key. It negotiates no strict-kex, so the server disconnects it with code 3. The section gives the .pub-line way to trust the key, and known_hosts_from_pub checks it.
  • Threat model §5.3.1: the budget of 12 authentication requests, the twelfth ending the connection with code 11.
  • ADR-0023, an erratum (ADR-0015): once a session is open, a forwarding channel gets code 1, not 3. The code has done this since M5 (feat(core): M5 — channel layer + single-command exec #84), before the ADR was accepted.

Governance and docs

  • ADR-0062 → Accepted, recording what the implementation found.
  • The rule of ADR-0062 §8 in CLAUDE.md (next to the fuzz-target rule) and in AGENTS.md's Code Review Rules.
  • README Phase 3 item done; CLAUDE.md, AGENTS.md, docs/infrastructure.md and the changelog describe the suite.

Two things a reviewer may want to question

  • Four skips on the macOS leg, where the draft named two. The no-OpenSSL client also lacks RSA, ECDSA and zlib. Each skip is declared in its catalogue line and in release.yml.
  • The developer's agent. On my machine, ssh_config has AddKeysToAgent yes for every host, so each local run of the old gate left its throwaway client key in my agent. 17 had piled up, and the agent reordered the keys the client offered, which broke auth_attempt_budget. I removed those 17 keys, and only those: keys with ssh-keygen's default comment and no file in ~/.ssh. The suite now isolates the client. CI was never affected.

How it was checked

Where Client Result
Gate image, aarch64, 5 runs OpenSSH_10.6p1 Debian-1 (the pin) 43 of 43, 11 to 14 s
macOS arm64, 3 runs, bash 5.3 and bash 3.2 10.6p2 43 of 43, 7 to 9 s
macOS arm64, bash 3.2 10.6p1 built as the macOS release leg builds it 39 passed, 4 skipped (the allowed ones)

The enforcement was checked by breaking it, one way at a time:

  • a missing line, a line with no case, and a repeated line;
  • an empty skip cell;
  • INTEROP_ALLOW_SKIP naming a non-case;
  • a never case that skips, and a skip the leg does not allow;
  • a case that returns 1, and a case that calls exit 0.

Each made the run fail with its own message.

Other checks:

  • shellcheck -x and actionlint are clean.
  • No Rust code changes.
  • The step's time on the PR runner is in this PR's openssh-interop run. The draft probe took 21 s; today's gate step took 3 s.
  • The release legs run only on a tag. A rehearsal-* tag on this branch would run all three before merge.

Refs #248

…n enforces

ADR-0062: the interop gate grows from 15 checks into 43 cases, one for
every behaviour that a document states and a stock OpenSSH client can
reach, refusals included.

- tests/interop/CASES.md is the catalogue: one line per case, the
  document it checks, and what a client may lack for it to skip.
- tests/interop/cases.sh holds the cases, one function each.
- run_openssh_client.sh is the driver. Before the first case it fails if
  a case has no line, a line has no case, or a line is repeated. After
  the last it fails unless every case reported ok, or a skip that both
  its line and INTEROP_ALLOW_SKIP allow. A run that stops early with
  status 0 fails too.
- negative_no_hybrid now asserts the client's "no matching key exchange
  method found", not only a non-zero exit.
- The server-initiated re-key runs under AES-GCM and reads `initiator`
  from the audit log: under ChaCha20 the client's own 1 GiB limit fires
  first.
- The client reads no ssh_config and no agent of the account that runs
  it. A developer's AddKeysToAgent otherwise left every run's throwaway
  keys in their agent, and the agent reordered the keys a client offers.
- The macOS release leg allows four skips: its client has no OpenSSL and
  no zlib, so no AES-GCM, no RSA or ECDSA, and no compression. Its
  no-fallback check now covers ssh-keyscan and ssh-agent, which the suite
  uses. The PR gate and the Linux release legs allow none.

Run locally: 43 of 43 in the gate image with OpenSSH_10.6p1 Debian-1 on
aarch64, five times, 11 to 14 s; 43 of 43 on macOS with 10.6p2, under
bash 5.3 and bash 3.2; 39 and 4 skipped with 10.6p1 built as the macOS
leg builds it.

Refs #248

Signed-off-by: Gonzalo Fleming <[email protected]>
The probe behind ADR-0062 found three behaviours that no document
stated, or stated differently from the server. ADR-0062 §2 puts the
document right before the case rests on it.

- docs/deployment.md §3: ssh-keyscan cannot fetch the host key. It does
  not negotiate strict-kex, so the server disconnects it with code 3
  before it sends one. The section says how to trust the key from its
  .pub line instead, and the case known_hosts_from_pub checks that way.
- Threat model §5.3.1: a connection has a budget of 12 authentication
  requests, and the twelfth ends it with code 11. It was in the code
  only.
- ADR-0023 takes an erratum (ADR-0015). Its table gave every non-session
  channel type code 3. Since M5 (#84), before the ADR was accepted, the
  server checks for an open channel first, so a forwarding channel
  opened during a session gets code 1. Both refuse it, and the decision
  does not change.

Refs #248

Signed-off-by: Gonzalo Fleming <[email protected]>
- ADR-0062 is Accepted, dated with this PR. Its text records what the
  implementation found: the catalogue's place and form, the client run
  with no ssh_config and no agent, four skips on the macOS leg where the
  draft named two, the times measured, and that the pinned clients gave
  the probe's results. The interactive shell on a PTY, which the draft
  left open, has its case.
- The rule of §8 goes into CLAUDE.md, next to ADR-0060 §9's rule for
  fuzz targets, and into AGENTS.md's Code Review Rules.
- CLAUDE.md, AGENTS.md and docs/infrastructure.md describe the suite
  where they described the gate.
- The README's Phase 3 item on conformance tests is done.
- The changelog has the suite and the three documents it corrected.

Refs #248

Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2 gonzafg2 added the documentation Improvements or additions to documentation label Nov 21, 2026
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T04:13:52.053192Z 21db68a 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

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: a43b856832

ℹ️ 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".

@gonzafg2

Copy link
Copy Markdown
Owner Author

@codex review

§6 said the implementing PR reports the step's time on the PR runner.
On x86_64 it took 17 seconds, up from 3, and passed all 43 cases with
none skipped (run 44864009111).

Refs #248

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

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 8e5d531007

ℹ️ 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 21, 2026

Copy link
Copy Markdown
Contributor

PR Review: test(interop): the OpenSSH conformance suite (ADR-0062) (#290)

Decision: 🟢 Approved
Iteration: First review
Lenses applied: Tests (tests/interop/), CI (.github/workflows/), ADR and documentation (docs/adr/, docs/)

Executive summary

This PR graduates the OpenSSH interop gate from 15 ad-hoc checks to a 43-case conformance suite with a machine-enforced catalogue, while fixing three documentation/ADR bugs the suite discovered. The changes consistently strengthen the fail-closed and zero-legacy posture — negative cases now assert the specific error message or disconnect code rather than accepting any failure (negative_no_hybrid is the most direct example). The catalogue enforcement (bi-directional check, skip double-gating, early-exit detection) prevents cases from silently disappearing. No high-signal findings emerged across bug, security, and CLAUDE.md compliance lenses.

Nothing reached the confidence threshold (≥ 80). Decision: 🟢 Approved

Comment thread tests/interop/cases.sh Resolved
openssh_cert_refusals passed whenever ssh exited non-zero, so a server
that was down, or any other failure, satisfied it. ADR-0062 §4 says a
refusal case asserts the refusal, and every other refusal case already
did.

Each of the three runs now shows that the client offered that
certificate (its ED25519-CERT offer in `ssh -v`) and was denied with
"Permission denied (publickey).".

Refs #248

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

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 21db68a2c0

ℹ️ 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".

@gonzafg2
gonzafg2 merged commit 736d8c9 into main Nov 21, 2026
17 checks passed
@gonzafg2
gonzafg2 deleted the test/conformance-suite branch December 1, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant