alladdin / node-lox-ws-api

Node JS WebSocket Loxone™ API
MIT License
32 stars 23 forks source link

Connection closes after "n"-encrypted messages #9

Closed codmpm closed 7 years ago

codmpm commented 7 years ago

Over at the loxforum we've discovered a bug (maybe?).

If you use AES command enryption and send four to five commands in a row over the websocket, the connection get's closed. This won't happen if you do not use command encryption or send a webservice command oder the websocket.

Is this a bug in node-lox-ws-api or some kind of throttling from the miniserver side?

To reproduce simple send "Pulse" to a switch module in short intervals.

alladdin commented 7 years ago

It's fixed in version 0.2.8

codmpm commented 7 years ago

I will test as soon as I can and will get back to you.

codmpm commented 7 years ago

On a short test after updating to 0.2.8 I still have the problem.

alladdin commented 7 years ago

The problem may be in miniserver version. I have latest 8.3.3.21

The main problem is with salt in encryption. There is difference between Loxone 8.0 communication spec and 8.1

8.0:

  1. Generate a random base64 salt -> {salt}

8.1:

  1. Generate a random salt, hex string (length may vary, e.g. 2 bytes) -> {salt}
codmpm commented 7 years ago

I've tested it also with 8.3.x...

codmpm commented 7 years ago

Seems to work with node-lox-ws-api 0.3.1 👍