Skip to content

Decrypt failed should disconnect the socket #30

Description

@neojski

Right now it seems to throw an exception that gets written to logs but otherwise does nothing.

This can be reproduced by sending the wrong key to the socket.

  @tuyapi/driver 192.168.0.34: Received: 000055aa00000000000000080000008b00000000332e31376138353563356665613333653334634567324a592b69715359576131715a79396b577a30517572465a532b73686e704d3361656f51636e36647262307866746b6a67456d37535751436a6b7267782f7a3343506c2b6459353568325a564b37373831616c764f6b4144396454726f3743363558457770416d586f3d4a844e420000aa55 +0ms
Error: Decrypt failed.
    at decrypt (/home/neo/repos/driver/dist/lib/crypto.js:25:15)
    at Object.decrypt (/home/neo/repos/driver/dist/lib/crypto.js:23:20)
    at Frame.decrypt (/home/neo/repos/driver/dist/lib/frame.js:32:37)
    at Messenger.decode (/home/neo/repos/driver/dist/lib/messenger.js:68:19)
    at /home/neo/repos/driver/dist/device.js:110:43
    at Array.forEach (<anonymous>)
    at Device._handleSocketData (/home/neo/repos/driver/dist/device.js:109:44)
    at Socket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions