willardf / Hazel-Networking

Hazel Networking is a low level networking library for C# providing connection-oriented, message-based communication via RUDP.
MIT License
385 stars 60 forks source link

DTLS Support #10

Closed mendsley closed 3 years ago

mendsley commented 3 years ago

This series of changes adds DTLS support to Hazel. Specifically for the single cipher suite TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256.

The history is organized in a way that hopefully allows one to follow along the various phases of feature development:

  1. Add the core AES_GCM and x25519 primitives in Hazel.Crypto - these are the low level blocks
  2. Add the x25519 version of ECDHE_RSA_256 key agreement algorithm
  3. Add the pseudo random function key expansion function
  4. Add the AES_GCM record protection implementation
  5. Some changes to the underlying ConnectionListener to support overriding send/recv behavior
  6. Connections are identified by a numeric identifier rather than an IP+Port (this is needed to distinguish different DTLS sessions from the same client)
  7. Add the server side handshake protocol/connection listener
  8. Add the client side handshake protocol/connection