Skip to content

Commit

Permalink
fix: use separate S2 keys for ZWLR
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Jan 21, 2024
1 parent e207ba6 commit ec693ff
Show file tree
Hide file tree
Showing 11 changed files with 232 additions and 134 deletions.
14 changes: 11 additions & 3 deletions docs/api/driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -828,15 +828,23 @@ interface ZWaveOptions extends ZWaveHostOptions {
};
/**
* Specify the security keys to use for encryption. Each one must be a Buffer of exactly 16 bytes.
* Specify the security keys to use for encryption (Z-Wave Classic). Each one must be a Buffer of exactly 16 bytes.
*/
securityKeys?: {
S2_Unauthenticated?: Buffer;
S2_Authenticated?: Buffer;
S2_AccessControl?: Buffer;
S2_Authenticated?: Buffer;
S2_Unauthenticated?: Buffer;
S0_Legacy?: Buffer;
};
/**
* Specify the security keys to use for encryption (Z-Wave Long Range). Each one must be a Buffer of exactly 16 bytes.
*/
securityKeysLongRange?: {
S2_AccessControl?: Buffer;
S2_Authenticated?: Buffer;
};
/**
* Defines the callbacks that are necessary to trigger user interaction during S2 inclusion.
* If not given, nodes won't be included using S2, unless matching provisioning entries exists.
Expand Down
7 changes: 4 additions & 3 deletions docs/getting-started/long-range.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Z-Wave Long Range (ZWLR) is an addition to Z-Wave, that allows for a massively i
There are a few things applications need to be aware of to support Long Range using Z-Wave JS.

1. ZWLR node IDs start at 256. This can be used to distinguish between ZWLR and classic Z-Wave nodes.
2. ZWLR inclusion works exclusively through [Smart Start](getting-started/security-s2#smartstart).
1. ZWLR has only two security classes, S2 Access Control and S2 Authenticated. Both must use a different security key than their Z-Wave Classic counterparts. To configure them, use the `securityKeysLongRange` property of the [`ZWaveOptions`](../api/driver#zwaveoptions)
1. ZWLR inclusion works exclusively through [Smart Start](../getting-started/security-s2#smartstart).
\
ZWLR nodes advertise support for Long Range in the `supportedProtocols` field of the `QRProvisioningInformation` object (see [here](api/utils#other-qr-codes)). When this field is present, the user **MUST** have the choice between the advertised protocols. Currently this means deciding between including the node via Z-Wave Classic (mesh) or Z-Wave Long Range (no mesh).\
To include a node via ZWLR, set the `protocol` field of the `PlannedProvisioningEntry` to `Protocols.ZWaveLongRange` when [provisioning the node](api/controller#provisionsmartstartnode).
ZWLR nodes advertise support for Long Range in the `supportedProtocols` field of the `QRProvisioningInformation` object (see [here](../api/utils#other-qr-codes)). When this field is present, the user **MUST** have the choice between the advertised protocols. Currently this means deciding between including the node via Z-Wave Classic (mesh) or Z-Wave Long Range (no mesh).\
To include a node via ZWLR, set the `protocol` field of the `PlannedProvisioningEntry` to `Protocols.ZWaveLongRange` when [provisioning the node](../api/controller#provisionsmartstartnode).
Loading

0 comments on commit ec693ff

Please sign in to comment.