secure: use HKDF for session key derivation, bind transcript to both peers#35
secure: use HKDF for session key derivation, bind transcript to both peers#35SonOfTroll wants to merge 7 commits into
Conversation
fix(node): add handshake timeout and connection limit to accept loop …
|
Thanks for taking this on. The HKDF direction is the right direction, but I am going to request changes before we merge this. Main blockers:
I am going to make a more detailed plan in the issues section and assign it to you so we can move this forward in smaller pieces. The change is valuable, but I want us to test and roll out the HKDF shift slowly and securely instead of merging it as one implicit protocol break. |
|
@ethical-buddy |
hey, i noticed the handshake was deriving the session key by just SHA256-ing the raw shared secret with the kind byte appended. it works, but SHA256 isn't really a proper KDF, and the resulting key isn't bound to the actual session participants, which leaves a small misbinding risk if someone is relaying the handshake in the middle
i switched it over to HKDF-SHA256 and included a transcript hash that binds both ephemeral keys and both node IDs
same overall behavior, but the key derivation is now tied to the session context
changes: