@project-chip/matter.js 0.15.0-alpha.0-20250613-a55f991d4 → 0.15.0-alpha.0-20250616-4b3754906

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.
@@ -258,6 +258,7 @@ export class PairedNode {
258
258
  #options: CommissioningControllerNodeOptions;
259
259
  readonly #reconnectFunc: (discoveryType?: NodeDiscoveryType, noForcedConnection?: boolean) => Promise<void>;
260
260
  #currentSubscriptionIntervalS?: number;
261
+ #crypto: Crypto;
261
262
 
262
263
  readonly events = {
263
264
  /**
@@ -303,6 +304,7 @@ export class PairedNode {
303
304
  reconnectFunc: (discoveryType?: NodeDiscoveryType, noForcedConnection?: boolean) => Promise<void>,
304
305
  assignDisconnectedHandler: (handler: () => Promise<void>) => void,
305
306
  sessions: BasicSet<NodeSession>,
307
+ crypto: Crypto,
306
308
  storedAttributeData?: DecodedAttributeReportValue<any>[],
307
309
  ): Promise<PairedNode> {
308
310
  const node = new PairedNode(
@@ -314,6 +316,7 @@ export class PairedNode {
314
316
  reconnectFunc,
315
317
  assignDisconnectedHandler,
316
318
  sessions,
319
+ crypto,
317
320
  storedAttributeData,
318
321
  );
319
322
  await node.construction;
@@ -329,6 +332,7 @@ export class PairedNode {
329
332
  reconnectFunc: (discoveryType?: NodeDiscoveryType, noForcedConnection?: boolean) => Promise<void>,
330
333
  assignDisconnectedHandler: (handler: () => Promise<void>) => void,
331
334
  sessions: BasicSet<NodeSession, NodeSession>,
335
+ crypto: Crypto,
332
336
  storedAttributeData?: DecodedAttributeReportValue<any>[],
333
337
  ) {
334
338
  assignDisconnectedHandler(async () => {
@@ -345,6 +349,7 @@ export class PairedNode {
345
349
  this.#commissioningController = commissioningController;
346
350
  this.#options = options;
347
351
  this.#reconnectFunc = reconnectFunc;
352
+ this.#crypto = crypto;
348
353
 
349
354
  this.#interactionClient = interactionClient;
350
355
  if (this.#interactionClient.isReconnectable) {
@@ -1283,11 +1288,11 @@ export class PairedNode {
1283
1288
  const vendorId = await basicInformationCluster.getVendorIdAttribute();
1284
1289
  const productId = await basicInformationCluster.getProductIdAttribute();
1285
1290
 
1286
- const discriminator = PaseClient.generateRandomDiscriminator();
1287
- const passcode = PaseClient.generateRandomPasscode();
1288
- const salt = Crypto.getRandomData(32);
1291
+ const discriminator = PaseClient.generateRandomDiscriminator(this.#crypto);
1292
+ const passcode = PaseClient.generateRandomPasscode(this.#crypto);
1293
+ const salt = this.#crypto.randomBytes(32);
1289
1294
  const iterations = 1_000; // Minimum 1_000, Maximum 100_000
1290
- const pakePasscodeVerifier = await PaseClient.generatePakePasscodeVerifier(passcode, {
1295
+ const pakePasscodeVerifier = await PaseClient.generatePakePasscodeVerifier(this.#crypto, passcode, {
1291
1296
  iterations,
1292
1297
  salt,
1293
1298
  });