Skip to content

types: represent DTLS wire-code identifiers as compact newtypes#137

Open
zRedShift wants to merge 18 commits into
algesten:mainfrom
zRedShift:work/hash-algorithm-newtype-retain-case
Open

types: represent DTLS wire-code identifiers as compact newtypes#137
zRedShift wants to merge 18 commits into
algesten:mainfrom
zRedShift:work/hash-algorithm-newtype-retain-case

Conversation

@zRedShift
Copy link
Copy Markdown
Contributor

Follow-up to #134. This is a breaking API cleanup.

This converts DTLS/TLS wire-code identifier types from enums with Unknown(...) variants into compact transparent integer newtypes. Known values remain exposed as associated constants, with the previous enum-style casing preserved to keep call-site churn down.

Scope:

  • public/provider-facing wire-code types such as HashAlgorithm, SignatureAlgorithm, CompressionMethod, ContentType, NamedGroup, SignatureScheme, Dtls13CipherSuite, and ProtocolVersion
  • DTLS 1.2/1.3 internal message, extension, cipher-suite, curve, and certificate-type code types

The intent is to keep unknown wire values representable while avoiding enum padding/discriminants in parser and error payload paths. This does not intentionally change parser policy, replay behavior, queue behavior, or handshake semantics.

Validation:

  • git diff --check upstream/main..HEAD
  • cargo fmt --check
  • check-snowflake-local.pl upstream/main
  • cargo test --all-targets --features rcgen
  • cargo clippy --all-targets --features rcgen -- -D warnings
  • cargo test --no-default-features --features rust-crypto
  • cargo clippy --no-default-features --features rust-crypto -- -D warnings
  • cargo test --doc --features rcgen

@zRedShift zRedShift force-pushed the work/hash-algorithm-newtype-retain-case branch from 7ba9b7e to e8bec36 Compare May 29, 2026 19:45
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