WebThingsIO / zwave-adapter

Z-Wave adapter add-on for WebThings Gateway
Mozilla Public License 2.0
15 stars 20 forks source link

ZWave Adapter Network Key is case sensitive #74

Open personalnadir opened 5 years ago

personalnadir commented 5 years ago

Configuring the z-wave adapter with the network key generated using the command fails: cat /dev/urandom | tr -dc '0-9A-F' | fold -w 32 | head -n 1 | sed -e 's/\(..\)/0x\1, /g'

0x2F,0xD6,0x8E,0x86,0x45,0x4A,0x4C,0x23,0x05,0x44,0x25,0x78,0x86,0x07,0x14,0x4E

Log output: ERROR : zwave: Found NetworkKey, but invalid format. Ignoring

However lowercasing the key to 0x2f,0xd6,0x8e,0x86,0x45,0x4a,0x4c,0x23,0x05,0x44,0x25,0x78,0x86,0x07,0x14,0x4e INFO : zwave: Found NetworkKey, initializing with support for Security Devices

Adding whitespace after each of the commas also causes the network key to be rejected.

I think the networkKey should not be case sensitive and should also tolerate whitespace. I also think that the UI should indicate that a networkKey is in an invalid format.