feat: hide _makeNewSenderKey and expose a new preShareKey function

also bumps version
This commit is contained in:
td 2024-05-22 19:06:33 +05:30
parent 69c12b1220
commit 48043ec753
No known key found for this signature in database
GPG Key ID: 62A30523D4D6CE28
3 changed files with 14 additions and 6 deletions

View File

@ -1,3 +1,6 @@
## [0.29.6] 22nd May 2024
- feat: hide _makeNewSenderKey and expose a new preShareKey function (td)
## [0.29.5] 22nd May 2024 ## [0.29.5] 22nd May 2024
- feat: make voip key generator public (td) - feat: make voip key generator public (td)

View File

@ -52,11 +52,16 @@ class LiveKitBackend extends CallBackend {
return newIndex; return newIndex;
} }
Future<void> preShareKey(GroupCallSession groupCall) async {
await groupCall.onMemberStateChanged();
await _makeNewSenderKey(groupCall, false);
}
/// makes a new e2ee key for local user and sets it with a delay if specified /// makes a new e2ee key for local user and sets it with a delay if specified
/// 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 +92,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 +191,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 +397,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 +414,7 @@ class LiveKitBackend extends CallBackend {
} }
_memberLeaveEncKeyRotateDebounceTimer = _memberLeaveEncKeyRotateDebounceTimer =
Timer(CallTimeouts.makeKeyDelay, () async { Timer(CallTimeouts.makeKeyDelay, () async {
await makeNewSenderKey(groupCall, true); await _makeNewSenderKey(groupCall, true);
}); });
} }

View File

@ -1,6 +1,6 @@
name: matrix name: matrix
description: Matrix Dart SDK description: Matrix Dart SDK
version: 0.29.5 version: 0.29.6
homepage: https://famedly.com homepage: https://famedly.com
repository: https://github.com/famedly/matrix-dart-sdk.git repository: https://github.com/famedly/matrix-dart-sdk.git
issue_tracker: https://github.com/famedly/matrix-dart-sdk/issues issue_tracker: https://github.com/famedly/matrix-dart-sdk/issues