Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaks on Node 17.x #8

Open
belveder79 opened this issue Nov 8, 2022 · 5 comments
Open

breaks on Node 17.x #8

belveder79 opened this issue Nov 8, 2022 · 5 comments

Comments

@belveder79
Copy link
Contributor

belveder79 commented Nov 8, 2022

After moving forward with the Armbian installation, the flow is broken on a newer Node version. The crypto modules seems to require a different setup and I don't really know how to fix it.

In the init node, this line gives an error (round line 585 or so):
ccm.sdh = crypto.createDiffieHellman(ccm.primehex, 'hex', 5);

"Error: error:0280007E:Diffie-Hellman routines::modulus too small"

This seems to be related to a comment I found about new requirement from openssl regarding key length:

https://www.mail-archive.com/[email protected]/msg1822399.html

Since I don't exactly know what this prime stuff is, I was not able to fix it. Any ideas?

@belveder79
Copy link
Contributor Author

just as a note on the side, I tried to use a different library following this link but I greatly failed...

@btsimonh
Copy link
Owner

does it work on, e.g. node 12?
Or is it the underlying libraries, installed with the OS?

@belveder79
Copy link
Contributor Author

I suspect it works even with node 14, but I'm reluctant to try without breaking the system-wide distributor-driven installation. As far as I understand it has to do with the underlying crypto library linked into node, which has undergone some adaptions to comply with openssl 3.0.

I'm not a crypto-guy whatsoever, but this is what I understand:
The major requirement with respect to the Handshake to these camera APIs is that you need to use Diffie-Hellman with 120-bit primes (that's why you have the leading zeros 00 to make them 128-bit in the code). It seems that they finally dropped support for this and that for DH you now need at least 248-bit primes. That's why DH-related codes fail and - again to my limited understanding - it would be required to change the DH-computation to a different library, as simply increasing the keys with leading zeros does not work with the current and future crypto libs...

@belveder79
Copy link
Contributor Author

btw, using something like passing --openssl-legacy-provider as argument to node when starting does not work for me...

@btsimonh
Copy link
Owner

maybe try using https://github.com/brix/crypto-js - as long it's not going to just pass through ALL the native functions, it may just solve it.

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

No branches or pull requests

2 participants