From 34b15e45fc94f416549476a69501ad0a9b995ab5 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Sat, 13 Feb 2021 15:00:57 +0100 Subject: [PATCH] fix: Better logic when to auto-trigger self-sign --- lib/encryption/ssss.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/encryption/ssss.dart b/lib/encryption/ssss.dart index 248f233c..98c27a03 100644 --- a/lib/encryption/ssss.dart +++ b/lib/encryption/ssss.dart @@ -692,7 +692,11 @@ class OpenSSSS { // first try to cache all secrets that aren't cached yet await maybeCacheAll(); // now try to self-sign - if (ssss.encryption.crossSigning.enabled && ssss.client.isUnknownSession) { + if (ssss.encryption.crossSigning.enabled && + ssss.client.userDeviceKeys[ssss.client.userID]?.masterKey != null && + (ssss.client.isUnknownSession || + !ssss.client.userDeviceKeys[ssss.client.userID].masterKey + .directVerified)) { try { await ssss.encryption.crossSigning.selfSign(openSsss: this); } catch (e, s) {