Close review 001 §S-1: the default client-cert verifier never checked the client's CertificateVerify, so anyone holding a peer's *public* cert/SPKI bytes (public by design — peers publish them to be dialable) could complete a handshake as that peer, and the auth layer could not detect it. The consumer designs are known (X.509 and raw-key TCP/QUIC endpoints with identity-bearing clients), so implementing now — the zero-consumer moment — avoids the guaranteed breaking republish of flipping the default later. - VerifyPresentedCertVerifier (new): request, don't require, verify possession — permissive verify_client_cert (self-signed chains and bare SPKIs stay valid presentation) + CertificateVerify routing by presented cert kind (Ed25519 SPKI -> verify_tls13_signature_with_ raw_key both TLS versions; X.509 -> standard route), the same routing FingerprintPinVerifier implements. Nine-scheme list verbatim (shared fn, exact-list pin covers both). - Default on every TlsServerConfig path — X509 / RawKey / SelfSigned / ACME (the verifier install is crate-side rustls in new_acme, not rustls-acme's). - AcceptAnyCertVerifier stays public as the explicit no-pop escape hatch, no longer installed by any crate path. - tests/impersonation_posture.rs: four pins — default rejects the attacker (X.509: UnsupportedSignatureAlgorithmForPublicKeyContext; raw-key: BadSignature), escape hatch still accepts + extracts the victim's fingerprint (both cert types). - tests/handshake_behavior.rs: suites 4/4b — possession-checked legit clients (raw-key pin vs raw-key server; X.509 client vs X.509 server) complete and the server extracts the fingerprint; suite 3b doc updated. - Docs: ADR-008 written; OQ-TLS-09 -> resolved (option (b)); ADR-007 §Limits deferral retired to not-planned; server.md/client.md invariants/README/overview synced. Verification: cargo test 81 / --features tcp 95 / --all-features 104 green; clippy -D warnings clean (default + all-features); fmt clean; cargo doc warning-free.
3.6 KiB
status, last_updated
| status | last_updated |
|---|---|
| reviewed | 2026-09-10 |
alktls — Architecture
The authoritative architecture spec for the alktls crate (Phase 1 of the SDD process). The spec docs advanced Draft → Reviewed at the Phase 2 implementation review gate (see the lifecycle note at the end); statuses update here as docs advance.
All docs follow the SDD process conventions: specs reference ADRs and
OQs by number, ADRs explain WHY, open-questions.md tracks what is
unresolved.
Documents
| Doc | Status | Scope |
|---|---|---|
| overview.md | Reviewed | Purpose, transport picture, API surface, ADR/OQ index |
| server.md | Reviewed | TlsServerConfig, resolvers, ACME path, server invariants |
| client.md | Reviewed | TlsClientConfig, verifier selection, client auth, root-store fallback |
| open-questions.md | live | The authoritative OQ tracker (all Phase 0 OQs resolved at entry) |
ADRs
| ADR | Status | Decision |
|---|---|---|
| 001 | Accepted | Inherit the alknet TLS design as the baseline; deviations recorded as alktls ADRs |
| 002 | Accepted | TlsError: the ADR-088 six-variant shape from day one; config-construction scope boundary |
| 003 | Accepted | The QUIC feature is noq (iroh's extracted fork), not quinn; iroh stays key-not-config |
| 004 | Accepted | Complete accessors: for_tcp_tls() adopted; server borrows, client consumes |
| 005 | Accepted | Identity + credentials + fingerprint types move into alktls; auth layer stays out |
| 006 | Accepted | Eight-module layout; seed tests + integration invariant pins |
| 007 | Accepted | RFC 7250 cert-type negotiation: the offer follows the identity (deviation from alknet; resolves OQ-TLS-10) |
| 008 | Accepted | Server-path proof-of-possession: the verifying verifier is the default on every path (resolves OQ-TLS-09) |
Lifecycle
Docs move Draft → Reviewed when their open questions are resolved
and the architecture review reports zero critical issues; ADRs are
Accepted at write time and never revert (supersede instead).
open-questions.md is the authoritative tracker; the Phase 0 doc's
OQ statuses are the historical record.
API-freeze note (2026-09-10): the Phase 2 implementation review
gate (tasks/review-impl.md) passed with zero un-pinned divergences
(two ADR amendments recorded — 002's verifier-error path, 003's noq
provider feature). The public API surface — the lib.rs re-export
block per ADR-004/005/006 — is frozen as of that review; the alknet
rewrite compiles against it. Additive evolution only.
Phase status
- Phase 0 (complete, 2026-09-10):
docs/research/phase-0.md— extraction inventory, verified invariants, gaps, noq investigation, OQ-TLS-01..08. - Phase 1 (this directory): all Phase 0 OQs resolved at entry — six via ADR-001..006, two as documented behavior (OQ-TLS-02, OQ-TLS-06). Reviewed 2026-09-10 at the Phase 2 gate.
- Phase 2 (complete, 2026-09-10): decomposition into
tasks/+ execution — the eight-task port graph landed crate-init → port-identity/fingerprint/pem-signing → port-server/port-client → integration-suite → this review gate. The crate is ready for the rewrite to consume.