Skip to content

feat: add DTLS 1.2 ChaCha20 and X25519 support#77

Open
HMBSbige wants to merge 5 commits intoalgesten:mainfrom
HMBSbige:dtls12
Open

feat: add DTLS 1.2 ChaCha20 and X25519 support#77
HMBSbige wants to merge 5 commits intoalgesten:mainfrom
HMBSbige:dtls12

Conversation

@HMBSbige
Copy link
Contributor

@HMBSbige HMBSbige commented Mar 5, 2026

Closes #71

Add TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (0xCCA9) cipher suite and X25519 key exchange support for DTLS 1.2.

Simplify dependency version specs — Cargo.lock pins exact versions, so Cargo.toml only needs to declare the semver-compatible range.

This PR depends on the other open PRs (#73, #75, #76). Please merge those first before reviewing this one. Thanks!

@HMBSbige HMBSbige marked this pull request as ready for review March 5, 2026 16:01
@HMBSbige HMBSbige marked this pull request as draft March 5, 2026 16:16
@HMBSbige HMBSbige force-pushed the dtls12 branch 4 times, most recently from 992c94b to 51543d3 Compare March 5, 2026 17:47
@HMBSbige HMBSbige marked this pull request as ready for review March 5, 2026 18:15
@algesten
Copy link
Owner

algesten commented Mar 5, 2026

Hey, I think this needs changing right?

  • Iv::as_12_bytes() uses debug_assert_eq for a crypto invariant
  pub(crate) fn as_12_bytes(&self) -> &[u8; 12] {
      debug_assert_eq!(self.len(), 12, ...);
      &self.bytes
  }

If this is accidentally called on a 4-byte AES-GCM IV in release builds, the remaining 8 bytes are zeros — potential
nonce reuse. Should be a regular assert_eq!.


@HMBSbige
Copy link
Contributor Author

HMBSbige commented Mar 6, 2026

Fixed!

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.

feat: Support X25519 key exchange and ChaCha20-Poly1305 cipher suite for DTLS 1.2

2 participants