Skip to content

Commit b2353db

Browse files
authored
Duan/e2ee upgrade (#250)
* * Upgrade WebRTC-SDK to M114.5735.07 * expose failureTolerance for KeyProviderOptions. * set defaultFailureTolerance to -1. * upgrade WebRTC-SDK to 114.5735.08.
1 parent 509fc30 commit b2353db

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

LiveKitClient.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |spec|
1616

1717
spec.source_files = 'Sources/**/*'
1818

19-
spec.dependency 'WebRTC-SDK', '~> 114.5735.07'
19+
spec.dependency 'WebRTC-SDK', '~> 114.5735.08'
2020
spec.dependency 'SwiftProtobuf'
2121
spec.dependency 'PromisesSwift'
2222
spec.dependency 'Logging'

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
)
1818
],
1919
dependencies: [
20-
.package(name: "WebRTC", url: "https://github.com/webrtc-sdk/Specs.git", .exact("114.5735.07")),
20+
.package(name: "WebRTC", url: "https://github.com/webrtc-sdk/Specs.git", .exact("114.5735.08")),
2121
.package(name: "SwiftProtobuf", url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.21.0")),
2222
.package(name: "Promises", url: "https://github.com/google/promises.git", .upToNextMajor(from: "2.2.0")),
2323
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.5.2"))

Sources/LiveKit/E2EE/KeyProvider.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,27 @@ import WebRTC
1919

2020
public let defaultRatchetSalt: String = "LKFrameEncryptionKey"
2121
public let defaultMagicBytes: String = "LK-ROCKS"
22-
public let defaultRatchetWindowSize: Int32 = 16
22+
public let defaultRatchetWindowSize: Int32 = 0
23+
public let defaultFailureTolerance: Int32 = -1
2324

2425
public class KeyProviderOptions {
2526
let sharedKey: Bool
2627
let ratchetSalt: Data
2728
let ratchetWindowSize: Int32
2829
let uncryptedMagicBytes: Data
30+
let failureTolerance: Int32
2931

3032
public init(sharedKey: Bool = true,
3133
ratchetSalt: Data = defaultRatchetSalt.data(using: .utf8)!,
3234
ratchetWindowSize: Int32 = defaultRatchetWindowSize,
33-
uncryptedMagicBytes: Data = defaultMagicBytes.data(using: .utf8)!
35+
uncryptedMagicBytes: Data = defaultMagicBytes.data(using: .utf8)!,
36+
failureTolerance: Int32 = defaultFailureTolerance
3437
) {
3538
self.sharedKey = sharedKey
3639
self.ratchetSalt = ratchetSalt
3740
self.ratchetWindowSize = ratchetWindowSize
3841
self.uncryptedMagicBytes = uncryptedMagicBytes
42+
self.failureTolerance = defaultFailureTolerance
3943
}
4044
}
4145

@@ -47,7 +51,8 @@ public class BaseKeyProvider: Loggable {
4751
self.rtcKeyProvider = RTCFrameCryptorKeyProvider(ratchetSalt: options.ratchetSalt,
4852
ratchetWindowSize: options.ratchetWindowSize,
4953
sharedKeyMode: isSharedKey,
50-
uncryptedMagicBytes: options.uncryptedMagicBytes)
54+
uncryptedMagicBytes: options.uncryptedMagicBytes,
55+
failureTolerance: options.failureTolerance)
5156
if isSharedKey && sharedKey != nil {
5257
let keyData = sharedKey!.data(using: .utf8)!
5358
self.rtcKeyProvider?.setSharedKey(keyData, with: 0)

0 commit comments

Comments
 (0)