Merge branch 'soru/cache-self-signature' into 'main'
fix: Cache the result of the self-signature check See merge request famedly/famedlysdk!582
This commit is contained in:
commit
27dd05e1dd
|
|
@ -369,15 +369,19 @@ class DeviceKeys extends SignableKey {
|
||||||
String get deviceDisplayName =>
|
String get deviceDisplayName =>
|
||||||
unsigned != null ? unsigned['device_display_name'] : null;
|
unsigned != null ? unsigned['device_display_name'] : null;
|
||||||
|
|
||||||
bool get selfSigned => signatures
|
bool _validSelfSignature;
|
||||||
|
bool get selfSigned =>
|
||||||
|
_validSelfSignature ??
|
||||||
|
(_validSelfSignature = (signatures
|
||||||
?.tryGet<Map<String, dynamic>>(userId)
|
?.tryGet<Map<String, dynamic>>(userId)
|
||||||
?.tryGet<String>('ed25519:$deviceId') ==
|
?.tryGet<String>('ed25519:$deviceId') ==
|
||||||
null
|
null
|
||||||
? false
|
? false
|
||||||
// without libolm we still want to be able to add devices. In that case we ofc just can't
|
// without libolm we still want to be able to add devices. In that case we ofc just can't
|
||||||
// verify the signature
|
// verify the signature
|
||||||
: _verifySignature(ed25519Key, signatures[userId]['ed25519:$deviceId'],
|
: _verifySignature(
|
||||||
isSignatureWithoutLibolmValid: true);
|
ed25519Key, signatures[userId]['ed25519:$deviceId'],
|
||||||
|
isSignatureWithoutLibolmValid: true)));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool get blocked => super.blocked || !selfSigned;
|
bool get blocked => super.blocked || !selfSigned;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue