Skip to content

Track B · PR 4a/7 — Rust: tls/ module (parsers, no networking) #32

@bradh11

Description

@bradh11

Parent: #28 · Track B (wire-side) · No dependencies · Blocks PR 4b

Scope

Foundational Rust submodule for TLS 1.3 handshake parsing. No networking, no PyO3 export — purely deterministic byte parsing.

New files

```
rust_certinfo/src/tls/
├── mod.rs
├── groups.rs ← IANA Supported Groups table (contributor-facing data file)
├── records.rs ← TLS record framing (read + write)
└── handshake.rs ← ClientHello builder + ServerHello / HelloRetryRequest parser
```

In scope

  • GroupKind enum (ClassicalEcdh, ClassicalFfdh, HybridPq, PurePq, Unknown)
  • GroupInfo { id, name, kind } static slice
  • Lookup function
  • TLS record framing: read TLS records up to a bounded length, recognize content types
  • ClientHello byte builder with realistic extension set (SNI, supported_versions, signature_algorithms, supported_groups, key_share, ALPN)
  • ServerHello / HelloRetryRequest parser that extracts negotiated/selected group ID
  • Re-use DerReader patterns where they fit; create a small TlsHandshakeReader if needed

Out of scope

  • TCP sockets
  • PyO3 exports
  • TLS 1.2 ServerKeyExchange (Future / PR 7)

Tests

  • Parse captured ServerHello bytes (capture beforehand via openssl s_client -msg against Cloudflare for TLS 1.3 + hybrid PQ, a stock nginx, a TLS-1.2-only host)
  • Check fixtures in under rust_certinfo/tests/fixtures/
  • ClientHello build → parse round-trip
  • Malformed input: oversized length fields, truncated records, unknown extensions all handled without panic

Definition of Done

  • make ci clean
  • Coverage ≥ 95%
  • CHANGELOG entry added ("foundation for upcoming PQ KEX validator")
  • PR opened against develop from feat/tls-handshake-parsers
  • No PyO3 export yet — not visible from Python
  • tls/groups.rs has a clear "add new groups here" comment for contributors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions