aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/native/simple_iks.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2026-10-04 14:42:16 +0200
committerMarvin W <git@larma.de>2026-10-23 16:59:59 +0200
commitdba577f39c489b9db29960f2bf5cc78ac4f29d7b (patch)
treea8354c9fc328c1442d5e8c5c2adec4b428c92f44 /plugins/omemo/src/native/simple_iks.vala
parent2413442905e31f34cb0f77c9167003b3725760fe (diff)
Move OMEMO, OpenPGP and RTP plugins into main/libdino
Diffstat (limited to 'plugins/omemo/src/native/simple_iks.vala')
-rw-r--r--plugins/omemo/src/native/simple_iks.vala40
1 files changed, 0 insertions, 40 deletions
diff --git a/plugins/omemo/src/native/simple_iks.vala b/plugins/omemo/src/native/simple_iks.vala
deleted file mode 100644
index 6f752d33..00000000
--- a/plugins/omemo/src/native/simple_iks.vala
+++ /dev/null
@@ -1,40 +0,0 @@
-using Gee;
-
-namespace Omemo {
-
-public class SimpleIdentityKeyStore : IdentityKeyStore {
- public override Bytes identity_key_private { get; set; }
- public override Bytes identity_key_public { get; set; }
- public override uint32 local_registration_id { get; set; }
- private Map<string, Map<int, IdentityKeyStore.TrustedIdentity>> trusted_identities = new HashMap<string, Map<int, IdentityKeyStore.TrustedIdentity>>();
-
- public override void save_identity(Address address, uint8[] key) throws Error {
- string name = address.name;
- if (trusted_identities.has_key(name)) {
- if (trusted_identities[name].has_key(address.device_id)) {
- trusted_identities[name][address.device_id].key = key;
- trusted_identity_updated(trusted_identities[name][address.device_id]);
- } else {
- trusted_identities[name][address.device_id] = new TrustedIdentity.by_address(address, key);
- trusted_identity_added(trusted_identities[name][address.device_id]);
- }
- } else {
- trusted_identities[name] = new HashMap<int, IdentityKeyStore.TrustedIdentity>();
- trusted_identities[name][address.device_id] = new TrustedIdentity.by_address(address, key);
- trusted_identity_added(trusted_identities[name][address.device_id]);
- }
- }
-
- public override bool is_trusted_identity(Address address, uint8[] key) throws Error {
- if (!trusted_identities.has_key(address.name)) return true;
- if (!trusted_identities[address.name].has_key(address.device_id)) return true;
- uint8[] other_key = trusted_identities[address.name][address.device_id].key;
- if (other_key.length != key.length) return false;
- for (int i = 0; i < key.length; i++) {
- if (other_key[i] != key[i]) return false;
- }
- return true;
- }
-}
-
-}