Add per-session ephemeral X25519 key exchange#3
Merged
Conversation
Each connection now establishes a fresh ephemeral X25519 keypair, signed with the shared Ed25519 key and exchanged in the TCP handshake (new Security-Ephemeral-Key and Security-Ephemeral-Sig headers). The session key is derived from the ephemeral Diffie-Hellman output bound to a transcript of both ephemeral public keys and the shared identity, giving a unique key per session and forward secrecy, and proving each peer holds the private key rather than merely knowing the public one. Adds LSLSecurity::reset() so the process-global security singleton can be returned to a clean state between tests, and C++ unit tests covering keypair freshness, derivation symmetry, per-session key uniqueness, and ephemeral-key signature verification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Establishes a fresh ephemeral X25519 keypair for every connection, signed with the shared Ed25519 key and exchanged in the TCP handshake (new
Security-Ephemeral-Key/Security-Ephemeral-Sigheaders). The session key is derived from the ephemeral Diffie-Hellman output bound to a transcript of both ephemeral public keys and the shared identity.Benefits:
Also adds
LSLSecurity::reset()to return the process-global security singleton to a clean state for test isolation.Test plan
cmake -DLSL_SECURITY=ON -DLSL_UNITTESTS=ON -DLSL_SECURITY_TOOLS=ON;ctest.