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

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt #13

Closed
aivus opened this issue Jul 25, 2020 · 1 comment

Comments

@aivus
Copy link
Contributor

aivus commented Jul 25, 2020

Hey Igor 👋

I've found that some users are getting Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt error in

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
  File "crypto.js", line 183, col 26, in Decipheriv.final
  File "/node_modules/gree-hvac-client/lib/encryption-service.js", line 43, col 42, in EncryptionService.decrypt
    return JSON.parse(str + decipher.final('utf8'))
  File "/node_modules/gree-hvac-client/lib/client.js", line 291, col 46, in Client._handleResponse
    const pack = this._encryptionService.decrypt(message);
  File "/node_modules/gree-hvac-client/lib/client.js", line 113, col 52, in Socket._socket.on.message
    this._socket.on('message', message => this._handleResponse(message));
  File "events.js", line 126, col 13, in emitTwo
  File "events.js", line 214, col 7, in Socket.emit
  File "dgram.js", line 659, col 8, in UDP.onMessage [as onmessage]

I'm not sure why it happens as I don't have any additional data (wrong encryption key? broken data?), but can we somehow handle this? I mean allow developers who uses this library handle such cases somehow. Because it's happening inside the library now.

inwaar added a commit that referenced this issue Feb 27, 2023
Allows the library users handling async errors by promises and subscribing to `error` events.

BREAKING CHANGE: The applications have to subscribe to the `error` event, otherwise the process is terminated in case of an error. Also all calls that return Promise have to be chained with `catch` or await/try/catch.

Closes Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt #13
@inwaar inwaar closed this as completed Mar 31, 2023
@inwaar
Copy link
Owner

inwaar commented Mar 31, 2023

Hi @aivus, the library API returns promises now, there are quite some error classes can be used to handle errors https://github.com/inwaar/gree-hvac-client#classes

Feel free to give feedback on this :-)

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