Repository navigation
Conversation
BoringSSL, which Electron uses for node's crypto module, does not provide the 'modp2' named group, so diffie-hellman-group1-sha1 failed with ERR_CRYPTO_UNKNOWN_DH_GROUP before any keys were exchanged. Construct the 1024-bit Oakley Group 2 from its RFC 2409 prime and generator instead, which works with both OpenSSL and BoringSSL.
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.
diffie-hellman-group1-sha1 uses
createDiffieHellmanGroup('modp2'), but not every node build has that group. Electron uses BoringSSL instead of OpenSSL, which doesn't have modp1/modp2, so the handshake fails right after KEXINIT:A user of our Electron app ran into this with an old Cisco switch (IOS 12.2,
Cisco-1.25) that needs group1. Group exchange isn't an option there either because ofBAD_DHGEX, so they couldn't connect at all.The fix builds the group from the RFC 2409 prime and generator 2 with
createDiffieHellman. It's the same prime OpenSSL uses for modp2, so nothing changes on regular node. modp14 and up are still available in BoringSSL, so I left those alone.The new test stubs out modp1/modp2 before loading the lib, so it fails without the change.
npm testandnpm run lintpass locally.Original report: FloSch62/muxus#247