Merge pull request #1821 from famedly/td/makeKeyPublic
feat: make voip key generator public
This commit is contained in:
commit
8c33ce3a12
|
|
@ -56,7 +56,7 @@ class LiveKitBackend extends CallBackend {
|
||||||
/// used on first join and when someone leaves
|
/// used on first join and when someone leaves
|
||||||
///
|
///
|
||||||
/// also does the sending for you
|
/// also does the sending for you
|
||||||
Future<void> _makeNewSenderKey(
|
Future<void> makeNewSenderKey(
|
||||||
GroupCallSession groupCall, bool delayBeforeUsingKeyOurself) async {
|
GroupCallSession groupCall, bool delayBeforeUsingKeyOurself) async {
|
||||||
final key = secureRandomBytes(32);
|
final key = secureRandomBytes(32);
|
||||||
final keyIndex = _getNewEncryptionKeyIndex();
|
final keyIndex = _getNewEncryptionKeyIndex();
|
||||||
|
|
@ -87,7 +87,7 @@ class LiveKitBackend extends CallBackend {
|
||||||
final myKeys = _encryptionKeysMap[groupCall.localParticipant];
|
final myKeys = _encryptionKeysMap[groupCall.localParticipant];
|
||||||
|
|
||||||
if (myKeys == null || myKeys.isEmpty) {
|
if (myKeys == null || myKeys.isEmpty) {
|
||||||
await _makeNewSenderKey(groupCall, false);
|
await makeNewSenderKey(groupCall, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -186,7 +186,7 @@ class LiveKitBackend extends CallBackend {
|
||||||
if (myKeys == null || myLatestKey == null) {
|
if (myKeys == null || myLatestKey == null) {
|
||||||
Logs().w(
|
Logs().w(
|
||||||
'[VOIP E2EE] _sendEncryptionKeysEvent Tried to send encryption keys event but no keys found!');
|
'[VOIP E2EE] _sendEncryptionKeysEvent Tried to send encryption keys event but no keys found!');
|
||||||
await _makeNewSenderKey(groupCall, false);
|
await makeNewSenderKey(groupCall, false);
|
||||||
await _sendEncryptionKeysEvent(
|
await _sendEncryptionKeysEvent(
|
||||||
groupCall,
|
groupCall,
|
||||||
keyIndex,
|
keyIndex,
|
||||||
|
|
@ -392,7 +392,7 @@ class LiveKitBackend extends CallBackend {
|
||||||
if (groupCall.voip.enableSFUE2EEKeyRatcheting) {
|
if (groupCall.voip.enableSFUE2EEKeyRatcheting) {
|
||||||
await _ratchetLocalParticipantKey(groupCall, anyJoined);
|
await _ratchetLocalParticipantKey(groupCall, anyJoined);
|
||||||
} else {
|
} else {
|
||||||
await _makeNewSenderKey(groupCall, true);
|
await makeNewSenderKey(groupCall, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -409,7 +409,7 @@ class LiveKitBackend extends CallBackend {
|
||||||
}
|
}
|
||||||
_memberLeaveEncKeyRotateDebounceTimer =
|
_memberLeaveEncKeyRotateDebounceTimer =
|
||||||
Timer(CallTimeouts.makeKeyDelay, () async {
|
Timer(CallTimeouts.makeKeyDelay, () async {
|
||||||
await _makeNewSenderKey(groupCall, true);
|
await makeNewSenderKey(groupCall, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -199,12 +199,6 @@ class GroupCallSession {
|
||||||
|
|
||||||
/// compltetely rebuilds the local _participants list
|
/// compltetely rebuilds the local _participants list
|
||||||
Future<void> onMemberStateChanged() async {
|
Future<void> onMemberStateChanged() async {
|
||||||
if (state != GroupCallState.entered) {
|
|
||||||
Logs().d(
|
|
||||||
'[VOIP] early return onMemberStateChanged, group call state is not Entered. Actual state: ${state.toString()} ');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The member events may be received for another room, which we will ignore.
|
// The member events may be received for another room, which we will ignore.
|
||||||
final mems =
|
final mems =
|
||||||
room.getCallMembershipsFromRoom().values.expand((element) => element);
|
room.getCallMembershipsFromRoom().values.expand((element) => element);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue