fix: Correctly detect server injection frame for flutter web.
This commit is contained in:
@@ -9408,7 +9408,7 @@
|
||||
decodeFunction$body$FrameCryptor(frame, controller) {
|
||||
var $async$goto = 0,
|
||||
$async$completer = A._makeAsyncAwaitCompleter(type$.void),
|
||||
$async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, headerLength, metaData, frameTrailer, ivLength, keyIndex, iv, initialKeySet0, endDecLoop, currentkeySet, newMaterial, finalBuffer, e, t2, t3, t4, t5, t6, t7, endDecLoop0, t8, t9, t10, t11, t12, t13, exception, ratchetCount, t1, buffer, decrypted, initialKeySet, initialKeyIndex, $async$exception, $async$exception1;
|
||||
$async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, headerLength, metaData, frameTrailer, ivLength, keyIndex, iv, initialKeySet0, endDecLoop, currentkeySet, newMaterial, finalBuffer, e, t2, t3, t4, t5, t6, magicBytesBuffer, t7, endDecLoop0, t8, t9, t10, t11, t12, t13, exception, ratchetCount, t1, buffer, decrypted, initialKeySet, initialKeyIndex, $async$exception, $async$exception1;
|
||||
var $async$decodeFunction$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
|
||||
if ($async$errorCode === 1) {
|
||||
$async$currentError = $async$result;
|
||||
@@ -9436,8 +9436,18 @@
|
||||
t4 = J.get$length$asx(buffer);
|
||||
t5 = t3.length;
|
||||
t6 = t5 + 1;
|
||||
if (t4 >= t6)
|
||||
if (A.IterableBase_iterableToFullString(J.sublist$2$x(buffer, J.get$length$asx(buffer) - t6, t5), "[", "]") === A.IterableBase_iterableToFullString(t3, "[", "]")) {
|
||||
if (t4 > t6) {
|
||||
magicBytesBuffer = J.sublist$2$x(buffer, J.get$length$asx(buffer) - t5 - 1, J.get$length$asx(buffer) - 1);
|
||||
A.print("magicBytesBuffer " + A.S(magicBytesBuffer) + ", magicBytes " + A.S(t3) + ", ");
|
||||
if (A.IterableBase_iterableToFullString(magicBytesBuffer, "[", "]") === A.IterableBase_iterableToFullString(t3, "[", "]")) {
|
||||
t2 = J.sublist$1$x(buffer, J.get$length$asx(buffer) - 1);
|
||||
if (0 >= t2.length) {
|
||||
$async$returnValue = A.ioore(t2, 0);
|
||||
// goto return
|
||||
$async$goto = 1;
|
||||
break;
|
||||
}
|
||||
A.print("skip uncrypted frame, type " + t2[0]);
|
||||
t2 = $.$get$_CopyingBytesBuilder__emptyList();
|
||||
finalBuffer = new A._CopyingBytesBuilder(t2);
|
||||
finalBuffer.add$1(0, new Uint8Array(A._ensureNativeList(J.sublist$2$x(buffer, 0, J.get$length$asx(buffer) - t6))));
|
||||
@@ -9447,6 +9457,7 @@
|
||||
$async$goto = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$async$handler = 4;
|
||||
t3 = $async$self.__FrameCryptor_kind_A;
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/collection.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/algorithms.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/boollist.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/canonicalized_map.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/combined_wrappers/combined_iterable.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/combined_wrappers/combined_iterator.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/combined_wrappers/combined_list.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/combined_wrappers/combined_map.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/comparators.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/empty_unmodifiable_set.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/equality.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/equality_map.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/equality_set.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/functions.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/iterable_extensions.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/iterable_zip.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/list_extensions.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/priority_queue.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/queue_list.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/union_set.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/union_set_controller.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/unmodifiable_wrappers.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/utils.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/collection-1.17.0/lib/src/wrappers.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/js-0.6.5/lib/js.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/meta-1.8.0/lib/meta.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.flutter-io.cn/meta-1.8.0/lib/meta_meta.dart
|
||||
file:///Users/weiweiduan/Desktop/projects/flutter-webrtc/lib/src/web/rtc_transform_stream.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/collection.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/algorithms.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/boollist.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/canonicalized_map.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/combined_wrappers/combined_iterable.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/combined_wrappers/combined_iterator.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/combined_wrappers/combined_list.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/combined_wrappers/combined_map.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/comparators.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/empty_unmodifiable_set.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/equality.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/equality_map.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/equality_set.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/functions.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/iterable_extensions.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/iterable_zip.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/list_extensions.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/priority_queue.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/queue_list.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/union_set.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/union_set_controller.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/unmodifiable_wrappers.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/utils.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/wrappers.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/flutter_webrtc-0.9.27/lib/src/web/rtc_transform_stream.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/js-0.6.5/lib/js.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/meta-1.8.0/lib/meta.dart
|
||||
file:///Users/weiweiduan/.pub-cache/hosted/pub.dev/meta-1.8.0/lib/meta_meta.dart
|
||||
file:///Users/weiweiduan/Desktop/projects/livekit/client-sdk-flutter/.dart_tool/package_config.json
|
||||
file:///Users/weiweiduan/Desktop/projects/livekit/client-sdk-flutter/web/crypto.dart
|
||||
file:///Users/weiweiduan/Desktop/projects/livekit/client-sdk-flutter/web/e2ee.cryptor.dart
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -500,10 +500,13 @@ class FrameCryptor {
|
||||
|
||||
if (keyOptions.uncryptedMagicBytes != null) {
|
||||
var magicBytes = keyOptions.uncryptedMagicBytes!;
|
||||
if (buffer.length >= magicBytes.length + 1) {
|
||||
if (buffer.length > magicBytes.length + 1) {
|
||||
var magicBytesBuffer = buffer.sublist(
|
||||
buffer.length - (magicBytes.length + 1), magicBytes.length);
|
||||
buffer.length - magicBytes.length - 1, buffer.length - 1);
|
||||
//print('magicBytesBuffer $magicBytesBuffer, magicBytes $magicBytes, ');
|
||||
if (magicBytesBuffer.toString() == magicBytes.toString()) {
|
||||
var frameType = buffer.sublist(buffer.length - 1)[0];
|
||||
print('skip uncrypted frame, type $frameType');
|
||||
var finalBuffer = BytesBuilder();
|
||||
finalBuffer.add(Uint8List.fromList(
|
||||
buffer.sublist(0, buffer.length - (magicBytes.length + 1))));
|
||||
|
||||
Reference in New Issue
Block a user