fix small stuffs

This commit is contained in:
Sorunome 2020-05-27 21:40:58 +02:00
parent dda0b17724
commit c779d39818
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
6 changed files with 19 additions and 21 deletions

View File

@ -50,7 +50,7 @@ class CrossSigning {
throw 'Master pubkey key doesn\'t match'; throw 'Master pubkey key doesn\'t match';
} }
// master key is valid, set it to verified // master key is valid, set it to verified
masterKey.setVerified(true, false); await masterKey.setVerified(true, false);
// and now sign bout our own key and our master key // and now sign bout our own key and our master key
await sign([ await sign([
masterKey, masterKey,

View File

@ -435,7 +435,7 @@ class OpenSSSS {
return await ssss.getStored(type, keyId, privateKey); return await ssss.getStored(type, keyId, privateKey);
} }
Future<String> store(String type, String secret) async { Future<void> store(String type, String secret) async {
await ssss.store(type, secret, keyId, privateKey); await ssss.store(type, secret, keyId, privateKey);
} }

View File

@ -261,7 +261,7 @@ abstract class SignedKey {
return false; return false;
} }
Future<void> setVerified(bool newVerified, [bool sign = true]) { void setVerified(bool newVerified, [bool sign = true]) {
_verified = newVerified; _verified = newVerified;
if (sign && client.crossSigning.signable([this])) { if (sign && client.crossSigning.signable([this])) {
// sign the key! // sign the key!
@ -269,7 +269,7 @@ abstract class SignedKey {
} }
} }
Future<void> setBlocked(bool newBlocked); void setBlocked(bool newBlocked);
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final data = Map<String, dynamic>.from(content); final data = Map<String, dynamic>.from(content);
@ -291,16 +291,16 @@ class CrossSigningKey extends SignedKey {
userId != null && publicKey != null && keys != null && ed25519Key != null; userId != null && publicKey != null && keys != null && ed25519Key != null;
@override @override
Future<void> setVerified(bool newVerified, [bool sign = true]) { void setVerified(bool newVerified, [bool sign = true]) {
super.setVerified(newVerified, sign); super.setVerified(newVerified, sign);
return client.database?.setVerifiedUserCrossSigningKey( client.database?.setVerifiedUserCrossSigningKey(
newVerified, client.id, userId, publicKey); newVerified, client.id, userId, publicKey);
} }
@override @override
Future<void> setBlocked(bool newBlocked) { void setBlocked(bool newBlocked) {
blocked = newBlocked; blocked = newBlocked;
return client.database?.setBlockedUserCrossSigningKey( client.database?.setBlockedUserCrossSigningKey(
newBlocked, client.id, userId, publicKey); newBlocked, client.id, userId, publicKey);
} }
@ -351,14 +351,14 @@ class DeviceKeys extends SignedKey {
ed25519Key != null; ed25519Key != null;
@override @override
Future<void> setVerified(bool newVerified, [bool sign = true]) { void setVerified(bool newVerified, [bool sign = true]) {
super.setVerified(newVerified, sign); super.setVerified(newVerified, sign);
return client.database client.database
?.setVerifiedUserDeviceKey(newVerified, client.id, userId, deviceId); ?.setVerifiedUserDeviceKey(newVerified, client.id, userId, deviceId);
} }
@override @override
Future<void> setBlocked(bool newBlocked) { void setBlocked(bool newBlocked) {
blocked = newBlocked; blocked = newBlocked;
for (var room in client.rooms) { for (var room in client.rooms) {
if (!room.encrypted) continue; if (!room.encrypted) continue;
@ -366,7 +366,7 @@ class DeviceKeys extends SignedKey {
room.clearOutboundGroupSession(); room.clearOutboundGroupSession();
} }
} }
return client.database client.database
?.setBlockedUserDeviceKey(newBlocked, client.id, userId, deviceId); ?.setBlockedUserDeviceKey(newBlocked, client.id, userId, deviceId);
} }

View File

@ -534,7 +534,7 @@ class _KeyVerificationMethodSas extends _KeyVerificationMethod {
: super(request: request); : super(request: request);
@override @override
String _type = 'm.sas.v1'; final _type = 'm.sas.v1';
String keyAgreementProtocol; String keyAgreementProtocol;
String hash; String hash;

View File

@ -333,11 +333,9 @@ packages:
matrix_file_e2ee: matrix_file_e2ee:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "/home/sorunome/repos/famedly/matrix_file_e2ee"
ref: "1.x.y" relative: false
resolved-ref: "32edeff765369a7a77a0822f4b19302ca24a017b" source: path
url: "https://gitlab.com/famedly/libraries/matrix_file_e2ee.git"
source: git
version: "1.0.3" version: "1.0.3"
meta: meta:
dependency: transitive dependency: transitive
@ -413,8 +411,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "1.x.y" ref: "0c612a525511652a7760126b058de8c924fe8900"
resolved-ref: f66975bd1b5cb1865eba5efe6e3a392aa5e396a5 resolved-ref: "0c612a525511652a7760126b058de8c924fe8900"
url: "https://gitlab.com/famedly/libraries/dart-olm.git" url: "https://gitlab.com/famedly/libraries/dart-olm.git"
source: git source: git
version: "1.1.1" version: "1.1.1"

View File

@ -24,7 +24,7 @@ dependencies:
olm: olm:
git: git:
url: https://gitlab.com/famedly/libraries/dart-olm.git url: https://gitlab.com/famedly/libraries/dart-olm.git
ref: a6cde466e707b54e39df8d035a0a79714621bc0b ref: 0c612a525511652a7760126b058de8c924fe8900
matrix_file_e2ee: matrix_file_e2ee:
path: /home/sorunome/repos/famedly/matrix_file_e2ee path: /home/sorunome/repos/famedly/matrix_file_e2ee