livekit-client 2.0.8 → 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/livekit-client.e2ee.worker.js +1 -1
- package/dist/livekit-client.e2ee.worker.js.map +1 -1
- package/dist/livekit-client.e2ee.worker.mjs +6 -6
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +7 -5
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/e2ee/constants.d.ts +0 -1
- package/dist/src/e2ee/constants.d.ts.map +1 -1
- package/dist/src/e2ee/types.d.ts +1 -0
- package/dist/src/e2ee/types.d.ts.map +1 -1
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/ts4.2/src/e2ee/constants.d.ts +0 -1
- package/dist/ts4.2/src/e2ee/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/e2ee/constants.ts +1 -5
- package/src/e2ee/types.ts +1 -0
- package/src/e2ee/worker/ParticipantKeyHandler.ts +4 -2
- package/src/room/RTCEngine.ts +4 -3
@@ -327,10 +327,6 @@ livekitLogger.setDefaultLevel(LogLevel.info);
|
|
327
327
|
const workerLogger = loglevelExports.getLogger('lk-e2ee');
|
328
328
|
|
329
329
|
const ENCRYPTION_ALGORITHM = 'AES-GCM';
|
330
|
-
// We use a ringbuffer of keys so we can change them and still decode packets that were
|
331
|
-
// encrypted with an old key. We use a size of 16 which corresponds to the four bits
|
332
|
-
// in the frame trailer.
|
333
|
-
const KEYRING_SIZE = 16;
|
334
330
|
// How many consecutive frames can fail decrypting before a particular key gets marked as invalid
|
335
331
|
const DECRYPTION_FAILURE_TOLERANCE = 10;
|
336
332
|
// We copy the first bytes of the VP8 payload unencrypted.
|
@@ -358,7 +354,8 @@ const KEY_PROVIDER_DEFAULTS = {
|
|
358
354
|
sharedKey: false,
|
359
355
|
ratchetSalt: SALT,
|
360
356
|
ratchetWindowSize: 8,
|
361
|
-
failureTolerance: DECRYPTION_FAILURE_TOLERANCE
|
357
|
+
failureTolerance: DECRYPTION_FAILURE_TOLERANCE,
|
358
|
+
keyringSize: 16
|
362
359
|
};
|
363
360
|
const MAX_SIF_COUNT = 100;
|
364
361
|
const MAX_SIF_DURATION = 2000;
|
@@ -1503,7 +1500,10 @@ class ParticipantKeyHandler extends eventsExports.EventEmitter {
|
|
1503
1500
|
this.decryptionFailureCount = 0;
|
1504
1501
|
this._hasValidKey = true;
|
1505
1502
|
this.currentKeyIndex = 0;
|
1506
|
-
|
1503
|
+
if (keyProviderOptions.keyringSize < 1 || keyProviderOptions.keyringSize > 255) {
|
1504
|
+
throw new TypeError('Keyring size needs to be between 1 and 256');
|
1505
|
+
}
|
1506
|
+
this.cryptoKeyRing = new Array(keyProviderOptions.keyringSize).fill(undefined);
|
1507
1507
|
this.keyProviderOptions = keyProviderOptions;
|
1508
1508
|
this.ratchetPromiseMap = new Map();
|
1509
1509
|
this.participantIdentity = participantIdentity;
|