Repository navigation
docs(adr): draft ADR-0021 — Phase 1 KEXINIT negotiation profile - #46
Conversation
Assembles the complete ten-name-list SSH_MSG_KEXINIT profile that RFC-0003's greenfield transport advertises: mlkem768x25519-sha256 as the only key exchange, ssh-ed25519 host keys, chacha20-poly1305 + aes256-gcm AEAD ciphers, no compression, strict-kex required, and SSH_DISCONNECT_KEY_EXCHANGE_FAILED on a non-hybrid client. Settles two fine points: (1) because both ciphers are AEAD the MAC name-list is never exercised, so [email protected] is nominal and the `hmac` crate is omitted from the Phase 1 Cargo.toml until a non-AEAD cipher is ever introduced; (2) ext-info-s is honoured minimally with server-sig-algs = ssh-ed25519 for clean OpenSSH interop. Refines RFC-0003's primitive-crate list (which named `hmac`) at the operational level; enforced end-to-end by ADR-0020's interop gate. Signed-off-by: Gonzalo Fleming <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds a new ADR (0021) that centralizes and fixes the Phase 1 SSH_MSG_KEXINIT negotiation profile as the single authoritative reference for the project’s on-the-wire cryptographic posture.
Changes:
- Introduces ADR-0021 describing the complete ten name-lists for Phase 1 KEXINIT, including required strict-kex behavior and explicit failure semantics.
- Documents AEAD-only cipher posture, nominal MAC list handling, and the resulting Phase 1 dependency implications (e.g., omitting
hmac). - Specifies minimal
ext-info-shandling to support clean OpenSSH interop expectations referenced by ADR-0020.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Three precision/consistency fixes from the PR #46 review: 1. Related header — `transport.rs`/`kex.rs` were referenced as if they already exist. Reworded as "Planned implementation (TBD)" since the first crate has not landed. 2. Context — "mac_algorithms negotiation skipped entirely" could read as "the field is not sent". Clarified: the MAC name-lists ARE sent in KEXINIT; under an AEAD cipher the negotiation result is discarded (no MAC computed or applied). 3. Links — "Code that implements this decision" pointed at non-existent paths. Aligned with ADR-0020's "Implementation: TBD" pattern. No change to the decision itself. Signed-off-by: Gonzalo Fleming <[email protected]>
gonzafg2
left a comment
There was a problem hiding this comment.
Code review — perfil de negociación KEXINIT
El ADR está bien armado como assembly y la mayoría de sus referencias cruzadas verifican. Encontré 15 hallazgos (comentarios inline): 4 de severidad alta — errores de protocolo que, hard-codeados tal cual en kex.rs, rompen interop real o abren la clase de bug accept-and-branch (líneas 18, 58, 59, 60) —, 6 medios (consistencia con RFC-0003 / threat model / CLAUDE.md y semántica de specs) y 5 menores (claridad y mantenibilidad de un documento que será inmutable). Todos los hallazgos de protocolo fueron verificados contra las fuentes primarias: RFC 4253, RFC 8308, OpenSSH PROTOCOL (§1.9/1.10 strict-kex, §1.6 AES-GCM), draft-miller-sshm-aes-gcm, draft-ietf-sshm-chacha20-poly1305 y kex.c de openssh-portable.
Sobre los dos puntos que flaggeaste en la descripción:
- Omisión del crate
hmac: el lane ADR es correcto —docs/rfcs/README.mdruta las decisiones subsidiarias de dependencias a ADRs, y reducir la base de confianza no gatilla ningún trigger RFC. Lo que sí encontré en ese cluster es otra cosa: el nombre del MAC cambia respecto del RFC-0003 aceptado (HMAC-SHA2-512-ETM en rfcs/0003:86, texto vigente de «What does not change») y ese delta no está declarado en ninguna parte (comentario en línea 42). - Scope de
ext-info-s: el problema resultó ser más profundo que el de fase — la semántica está invertida respecto de RFC 8308 (comentario en línea 59). Mi sugerencia: dropearext-info-sde la lista KEX y gatear el envío deSSH_MSG_EXT_INFOen elext-info-cdel cliente, que es lo que realmente lo habilita; eso además reduce el scope que te preocupaba.
Verificado y descartado (no hace falta tocar): draft-ietf-sshm-mlkem-hybrid-kex-10 es la revisión vigente; el claim del default KEX de OpenSSH 10.x es verbatim de sus release notes; «small attack surface» es el título exacto del compromiso #4 en README.md:48; el issue #42 sí cubre ML-KEM-1024 y la política de ciphers; reason code 3, secciones del threat model, nombres de archivos ADR/RFC y los IDs de test de ADR-0020 coinciden.
- State the RFC 4253 §7.1 selection rule correctly (client's list wins) - Drop ext-info-s; gate the EXT_INFO send on the client's ext-info-c - Exclude marker pseudo-algorithms from selection and the failure check - Scope kex-strict-c to the initial KEXINIT; reset both sequence numbers after every NEWKEYS; add the unexpected-packet rule - Fix the disconnect reason code for the strict-kex rejection path - Align the nominal MAC with RFC-0003 ([email protected]) - State MAC-under-AEAD as skip-and-ignore, never a connection failure; extend the explicit-failure rule to host-key and cipher lists - Carry the threat-model §5.2 invariants (hybrid-half abort, KEXINIT binding + mutation test) - Tighten claims and future references (ADR-0020 scope, kex module TBD, supersede-not-touch, RFC-gated lane for a non-AEAD cipher) Signed-off-by: Gonzalo Fleming <[email protected]>
…gs (#56) The plugin's command is explicit (step 7): 'If --comment argument was NOT provided, stop here. Do not post any GitHub comments.' Our prompt never passed it, so every review ran to completion and printed its findings only to the job log — confirmed by the PR #46 run transcript (run 27358953209), which ends with 'No --comment flag provided — no GitHub comments posted' right after compiling four findings. Companion to #55: that PR mounted the github_inline_comment MCP server the posting step needs; this one flips the plugin's own posting switch. Signed-off-by: Gonzalo Fleming <[email protected]>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
…time exclusion Two refinements from the CI reviewer's transcript (run 27358953209): - State explicitly that a first_kex_packet_follows guessed packet is announced by the flag and therefore not an 'unexpected packet' under the strict-kex termination rule — two reviewer runs read the previous wording in opposite ways, so the ambiguity was real even though the behaviour (OpenSSH skips the wrong guess with strict kex active) was correct as written. - Carry MANIFIESTO #3's 'compiled out, not merely configured off' obligation as an explicit binding decision: the advertised name-lists are the complete compiled-in algorithm set. Signed-off-by: Gonzalo Fleming <[email protected]>
Summary
Adds ADR-0021, which assembles the complete ten-name-list
SSH_MSG_KEXINITprofile that RFC-0003's greenfield transport advertises in Phase 1. This is the single authoritative reference thekexmodule (TBD) and the ADR-0020 interop assertions point at, instead of the profile being scattered across RFC-0003, the README, and the threat model.Motivation
RFC-0003 chose the stack; the README and threat model §6.1 state pieces of the wire posture; but nothing assembled the exact strings, order, and failure behaviour an implementer must hard-code. ADR-0021 does that. It re-opens no algorithm choice — it fixes the operational detail.
The profile, in brief:
kex_algorithmsmlkem768x25519-sha256,[email protected]server_host_key_algorithmsssh-ed25519encryption_*(both)[email protected],[email protected]mac_*(both)[email protected](nominal only)compression_*(both)nonelanguages_*(both)Non-hybrid client →
SSH_DISCONNECT_KEY_EXCHANGE_FAILED, no fallback. The same disconnect applies to a failed intersection on any other required name-list, and to a missing[email protected]in the client's initial KEXINIT.Two points that need your eye as reviewer
hmac. ADR-0021 decides to omithmacfrom the Phase 1Cargo.toml: with an AEAD-only cipher list, MAC selection is structurally skipped (per the [email protected] and OpenSSH AES-GCM specs), so HMAC code never runs. This is an operational refinement of the RFC, not a contradiction. The nominal MAC name stays aligned with RFC-0003 ([email protected]), so no algorithm choice is re-opened.hmacreturns only if a non-AEAD cipher is ever added (an RFC-gated change).SSH_MSG_EXT_INFOscope. Phase 1 honours it minimally and gated on the client: oneSSH_MSG_EXT_INFOwithserver-sig-algs = ssh-ed25519, sent only when the client's initial KEXINIT offersext-info-c(RFC 8308). The server does not advertiseext-info-s— that marker would oblige it to accept client extensions Phase 1 makes no use of, and it is not what enables the server's send. Justified by the ADR-0020 interop gate depending on a clean OpenSSH handshake.Review changes (
32851ab)The first review pass (15 inline threads) was addressed in
32851ab: selection rule corrected to RFC 4253 §7.1 (client's list wins),ext-info-sdropped and the EXT_INFO send gated onext-info-c, marker pseudo-algorithms excluded from selection and the failure predicate,kex-strict-cscoped to the initial KEXINIT with per-NEWKEYS sequence resets and the unexpected-packet rule, the strict-kex rejection bound to reason code 3, the nominal MAC aligned with RFC-0003 (512), MAC-under-AEAD stated as skip-and-ignore, the threat-model §5.2 invariants carried as binding decisions, and the future-artefact references tightened.Type of change
Checklist
git commit -s).Security considerations
This ADR is the cryptographic-posture-on-the-wire decision. It encodes: hybrid PQ KEX only, no downgrade (
SSH_DISCONNECT_KEY_EXCHANGE_FAILED), strict-kex required (Terrapin / CVE-2023-48795 defence) including the unexpected-packet termination rule, AEAD-only ciphers, no compression, no legacy, abort on either hybrid half failing, and KEXINIT payloads bound into the exchange hash. Aligned with threat model §5.2 and §6.1.Notes for reviewers
Status is
Proposed; it advances toAcceptedwhen the first Phase 1 crate lands, matching ADR-0016–0020. Numbering assumes 0021 is free —main's CLAUDE.md already links this exact path, so the number is effectively reserved.Related issues
kexmodule hard-codes, with the ADR-0020 interop assertions pointing at it.