refactor: Added type casts for refactored dart_openapi_codegen

This commit is contained in:
Malin Errenst 2023-06-07 17:38:29 +02:00
parent ec84af679e
commit 17df38b874
No known key found for this signature in database
2 changed files with 34 additions and 30 deletions

View File

@ -640,8 +640,10 @@ class KeyManager {
final sessionData = session.sessionData;
Map<String, dynamic>? decrypted;
try {
decrypted = json.decode(decryption.decrypt(sessionData['ephemeral'],
sessionData['mac'], sessionData['ciphertext']));
decrypted = json.decode(decryption.decrypt(
sessionData['ephemeral'] as String,
sessionData['mac'] as String,
sessionData['ciphertext'] as String));
} catch (e, s) {
Logs().e('[LibOlm] Error decrypting room key', e, s);
}

View File

@ -597,11 +597,12 @@ class OlmManager {
client.userDeviceKeys[userId]!.deviceKeys[deviceId]!.ed25519Key;
final identityKey =
client.userDeviceKeys[userId]!.deviceKeys[deviceId]!.curve25519Key;
for (final Map<String, dynamic> deviceKey
in deviceKeysEntry.value.values) {
for (final deviceKey in deviceKeysEntry.value.values) {
if (deviceKey is Map<String, Object?>) {
if (fingerprintKey == null ||
identityKey == null ||
!deviceKey.checkJsonSignature(fingerprintKey, userId, deviceId)) {
!deviceKey.checkJsonSignature(
fingerprintKey, userId, deviceId)) {
Logs().w(
'Skipping invalid device key from $userId:$deviceId',
deviceKey,
@ -612,7 +613,7 @@ class OlmManager {
final session = olm.Session();
try {
session.create_outbound(
_olmAccount!, identityKey, deviceKey['key']);
_olmAccount!, identityKey, deviceKey['key'] as String);
await storeOlmSession(OlmSession(
key: client.userID!,
identityKey: identityKey,
@ -623,8 +624,9 @@ class OlmManager {
));
} catch (e, s) {
session.free();
Logs()
.e('[LibOlm] Could not create new outbound olm session', e, s);
Logs().e(
'[LibOlm] Could not create new outbound olm session', e, s);
}
}
}
}