zwave-js 14.2.0 → 14.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- export declare const PACKAGE_VERSION = "14.2.0";
1
+ export declare const PACKAGE_VERSION = "14.3.0";
2
2
  export declare const PACKAGE_NAME = "zwave-js";
3
3
  //# sourceMappingURL=_version.d.ts.map
@@ -22,7 +22,7 @@ __export(version_exports, {
22
22
  PACKAGE_VERSION: () => PACKAGE_VERSION
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- const PACKAGE_VERSION = "14.2.0";
25
+ const PACKAGE_VERSION = "14.3.0";
26
26
  const PACKAGE_NAME = "zwave-js";
27
27
  // Annotate the CommonJS export names for ESM import in node:
28
28
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/_version.ts"],
4
- "sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"14.2.0\";\nexport const PACKAGE_NAME = \"zwave-js\";\n"],
4
+ "sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"14.3.0\";\nexport const PACKAGE_NAME = \"zwave-js\";\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;;;;;;AACO,MAAM,kBAAkB;AACxB,MAAM,eAAe;",
6
6
  "names": []
7
7
  }
@@ -208,7 +208,7 @@ let ZWaveController = (() => {
208
208
  get dsk() {
209
209
  if (this._dsk == void 0) {
210
210
  const keyPair = this.driver.getLearnModeAuthenticatedKeyPair();
211
- const publicKey = (0, import_core.extractRawECDHPublicKey)(keyPair.publicKey);
211
+ const publicKey = (0, import_core.extractRawECDHPublicKeySync)(keyPair.publicKey);
212
212
  this._dsk = publicKey.subarray(0, 16);
213
213
  }
214
214
  return this._dsk;
@@ -1906,8 +1906,8 @@ let ZWaveController = (() => {
1906
1906
  }
1907
1907
  const nodePublicKey = import_shared.Bytes.from(pubKeyResponse.publicKey);
1908
1908
  const timerStartTAI2 = Date.now();
1909
- const keyPair = (0, import_core.generateECDHKeyPair)();
1910
- const publicKey = (0, import_core.extractRawECDHPublicKey)(keyPair.publicKey);
1909
+ const keyPair = (0, import_core.generateECDHKeyPairSync)();
1910
+ const publicKey = (0, import_core.extractRawECDHPublicKeySync)(keyPair.publicKey);
1911
1911
  await api.sendPublicKey(publicKey);
1912
1912
  if (grantedKeys.includes(import_core.SecurityClass.S2_AccessControl) || grantedKeys.includes(import_core.SecurityClass.S2_Authenticated)) {
1913
1913
  const dsk = (0, import_core.dskToString)(nodePublicKey.subarray(0, 16)).slice(5);
@@ -1931,10 +1931,10 @@ let ZWaveController = (() => {
1931
1931
  nodePublicKey.writeUInt16BE(parseInt(pinResult, 10), 0);
1932
1932
  }
1933
1933
  const sharedSecret = import_node_crypto.default.diffieHellman({
1934
- publicKey: (0, import_core.importRawECDHPublicKey)(nodePublicKey),
1934
+ publicKey: (0, import_core.importRawECDHPublicKeySync)(nodePublicKey),
1935
1935
  privateKey: keyPair.privateKey
1936
1936
  });
1937
- const tempKeys = (0, import_core.deriveTempKeys)((0, import_core.computePRK)(sharedSecret, publicKey, nodePublicKey));
1937
+ const tempKeys = await (0, import_core.deriveTempKeysAsync)(await (0, import_core.computePRKAsync)(sharedSecret, publicKey, nodePublicKey));
1938
1938
  securityManager.deleteNonce(node.id);
1939
1939
  securityManager.tempKeys.set(node.id, {
1940
1940
  keyCCM: tempKeys.tempKeyCCM,
@@ -4955,7 +4955,7 @@ let ZWaveController = (() => {
4955
4955
  * Is called when a RemoveNode request is received from the controller.
4956
4956
  * Handles and controls the exclusion process.
4957
4957
  */
4958
- handleLearnModeCallback(msg) {
4958
+ async handleLearnModeCallback(msg) {
4959
4959
  if (this._currentLearnMode == void 0)
4960
4960
  return false;
4961
4961
  const wasJoining = this._currentLearnMode === import_serialapi33.LearnModeIntent.Inclusion || this._currentLearnMode === import_serialapi33.LearnModeIntent.SmartStart || this._currentLearnMode === import_serialapi33.LearnModeIntent.LegacyNetworkWideInclusion || this._currentLearnMode === import_serialapi33.LearnModeIntent.LegacyInclusionExclusion && this.role === import_core.ControllerRole.Primary;
@@ -4977,8 +4977,8 @@ let ZWaveController = (() => {
4977
4977
  if (wasJoining) {
4978
4978
  this._currentLearnMode = void 0;
4979
4979
  this.driver["_securityManager"] = void 0;
4980
- this.driver["_securityManager2"] = new import_core.SecurityManager2();
4981
- this.driver["_securityManagerLR"] = new import_core.SecurityManager2();
4980
+ this.driver["_securityManager2"] = await import_core.SecurityManager2.create();
4981
+ this.driver["_securityManagerLR"] = await import_core.SecurityManager2.create();
4982
4982
  this._nodes.clear();
4983
4983
  process.nextTick(() => this.afterJoiningNetwork().catch(import_shared.noop));
4984
4984
  return true;
@@ -5174,8 +5174,8 @@ let ZWaveController = (() => {
5174
5174
  }
5175
5175
  const highestGranted = (0, import_core.getHighestSecurityClass)(matchingKeys);
5176
5176
  const requiresAuthentication = highestGranted === import_core.SecurityClass.S2_AccessControl || highestGranted === import_core.SecurityClass.S2_Authenticated;
5177
- const keyPair = requiresAuthentication ? this.driver.getLearnModeAuthenticatedKeyPair() : (0, import_core.generateECDHKeyPair)();
5178
- const publicKey = (0, import_core.extractRawECDHPublicKey)(keyPair.publicKey);
5177
+ const keyPair = requiresAuthentication ? this.driver.getLearnModeAuthenticatedKeyPair() : (0, import_core.generateECDHKeyPairSync)();
5178
+ const publicKey = (0, import_core.extractRawECDHPublicKeySync)(keyPair.publicKey);
5179
5179
  const transmittedPublicKey = import_shared.Bytes.from(publicKey);
5180
5180
  if (requiresAuthentication) {
5181
5181
  transmittedPublicKey.writeUInt16BE(0, 0);
@@ -5194,10 +5194,10 @@ let ZWaveController = (() => {
5194
5194
  }
5195
5195
  const includingNodePubKey = pubKeyReport.publicKey;
5196
5196
  const sharedSecret = import_node_crypto.default.diffieHellman({
5197
- publicKey: (0, import_core.importRawECDHPublicKey)(includingNodePubKey),
5197
+ publicKey: (0, import_core.importRawECDHPublicKeySync)(includingNodePubKey),
5198
5198
  privateKey: keyPair.privateKey
5199
5199
  });
5200
- const tempKeys = (0, import_core.deriveTempKeys)((0, import_core.computePRK)(sharedSecret, includingNodePubKey, publicKey));
5200
+ const tempKeys = await (0, import_core.deriveTempKeysAsync)(await (0, import_core.computePRKAsync)(sharedSecret, includingNodePubKey, publicKey));
5201
5201
  securityManager.deleteNonce(bootstrappingNode.id);
5202
5202
  securityManager.tempKeys.set(bootstrappingNode.id, {
5203
5203
  keyCCM: tempKeys.tempKeyCCM,
@@ -5305,7 +5305,7 @@ let ZWaveController = (() => {
5305
5305
  return import_Inclusion.SecurityBootstrapFailure.ParameterMismatch;
5306
5306
  }
5307
5307
  receivedKeys.set(securityClass, keyReport.networkKey);
5308
- securityManager.setKey(securityClass, keyReport.networkKey);
5308
+ await securityManager.setKeyAsync(securityClass, keyReport.networkKey);
5309
5309
  if (securityClass === import_core.SecurityClass.S0_Legacy) {
5310
5310
  this.driver["_securityManager"] = new import_core.SecurityManager({
5311
5311
  ownNodeId: this._ownNodeId,