livekit-client 2.11.3 → 2.11.4

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.
@@ -482,8 +482,7 @@ const KEY_PROVIDER_DEFAULTS = {
482
482
  ratchetSalt: SALT,
483
483
  ratchetWindowSize: 8,
484
484
  failureTolerance: DECRYPTION_FAILURE_TOLERANCE,
485
- keyringSize: 16,
486
- allowKeyExtraction: false
485
+ keyringSize: 16
487
486
  };
488
487
  const MAX_SIF_COUNT = 100;
489
488
  const MAX_SIF_DURATION = 2000;
@@ -963,10 +962,9 @@ function importKey(keyBytes_1) {
963
962
  name: ENCRYPTION_ALGORITHM
964
963
  };
965
964
  let usage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'encrypt';
966
- let extractable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
967
965
  return function* () {
968
966
  // https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey
969
- return crypto.subtle.importKey('raw', keyBytes, algorithm, extractable, usage === 'derive' ? ['deriveBits', 'deriveKey'] : ['encrypt', 'decrypt']);
967
+ return crypto.subtle.importKey('raw', keyBytes, algorithm, false, usage === 'derive' ? ['deriveBits', 'deriveKey'] : ['encrypt', 'decrypt']);
970
968
  }();
971
969
  });
972
970
  }
@@ -1720,12 +1718,10 @@ class ParticipantKeyHandler extends eventsExports.EventEmitter {
1720
1718
  * returns the ratcheted material
1721
1719
  * if `setKey` is true (default), it will also set the ratcheted key directly on the crypto key ring
1722
1720
  * @param keyIndex
1723
- * @param setKey set the new key. Will emit KeyHandlerEvent.KeyRatcheted after key generation (default: true)
1724
- * @param extractable allow key extraction (get the key in plaintext) on the ratcheted new key (default: false)
1721
+ * @param setKey
1725
1722
  */
1726
1723
  ratchetKey(keyIndex) {
1727
1724
  let setKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1728
- let extractable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1729
1725
  const currentKeyIndex = keyIndex !== null && keyIndex !== void 0 ? keyIndex : this.getCurrentKeyIndex();
1730
1726
  const existingPromise = this.ratchetPromiseMap.get(currentKeyIndex);
1731
1727
  if (typeof existingPromise !== 'undefined') {
@@ -1738,7 +1734,7 @@ class ParticipantKeyHandler extends eventsExports.EventEmitter {
1738
1734
  throw new TypeError("Cannot ratchet key without a valid keyset of participant ".concat(this.participantIdentity));
1739
1735
  }
1740
1736
  const currentMaterial = keySet.material;
1741
- const newMaterial = yield importKey(yield ratchet(currentMaterial, this.keyProviderOptions.ratchetSalt), currentMaterial.algorithm.name, 'derive', extractable);
1737
+ const newMaterial = yield importKey(yield ratchet(currentMaterial, this.keyProviderOptions.ratchetSalt), currentMaterial.algorithm.name, 'derive');
1742
1738
  if (setKey) {
1743
1739
  yield this.setKeyFromMaterial(newMaterial, currentKeyIndex, true);
1744
1740
  this.emit(KeyHandlerEvent.KeyRatcheted, newMaterial, this.participantIdentity, currentKeyIndex);
@@ -1901,11 +1897,11 @@ function handleRatchetRequest(data) {
1901
1897
  return __awaiter(this, void 0, void 0, function* () {
1902
1898
  if (useSharedKey) {
1903
1899
  const keyHandler = getSharedKeyHandler();
1904
- yield keyHandler.ratchetKey(data.keyIndex, true, data.extractable);
1900
+ yield keyHandler.ratchetKey(data.keyIndex);
1905
1901
  keyHandler.resetKeyStatus();
1906
1902
  } else if (data.participantIdentity) {
1907
1903
  const keyHandler = getParticipantKeyHandler(data.participantIdentity);
1908
- yield keyHandler.ratchetKey(data.keyIndex, true, data.extractable);
1904
+ yield keyHandler.ratchetKey(data.keyIndex);
1909
1905
  keyHandler.resetKeyStatus();
1910
1906
  } else {
1911
1907
  workerLogger.error('no participant Id was provided for ratchet request and shared key usage is disabled');