diff options
author | hrxi <hrrrxi@gmail.com> | 2019-09-01 18:18:25 +0200 |
---|---|---|
committer | fiaxh <fiaxh@users.noreply.github.com> | 2019-09-10 19:36:11 +0200 |
commit | d5d305193ce527f1cc3022c406de35d9a85d4ccb (patch) | |
tree | d12efc741319a7d71c13f7bf6c2c7579d25fdabe /plugins/omemo/src/logic | |
parent | 9950742bf1903291c271619aea101b0e2f81d19c (diff) | |
download | dino-d5d305193ce527f1cc3022c406de35d9a85d4ccb.tar.gz dino-d5d305193ce527f1cc3022c406de35d9a85d4ccb.zip |
Fix some warnings
Instances of `RegexError` are just asserted as `assert_not_reached` as
they cannot really fail except for allocation failure if the given regex
is valid.
Diffstat (limited to 'plugins/omemo/src/logic')
-rw-r--r-- | plugins/omemo/src/logic/manager.vala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/omemo/src/logic/manager.vala b/plugins/omemo/src/logic/manager.vala index a71dfd9d..53e02e37 100644 --- a/plugins/omemo/src/logic/manager.vala +++ b/plugins/omemo/src/logic/manager.vala @@ -326,22 +326,22 @@ public class Manager : StreamInteractionModule, Object { store.identity_key_store.local_registration_id = Random.int_range(1, int32.MAX); Signal.ECKeyPair key_pair = Plugin.get_context().generate_key_pair(); - store.identity_key_store.identity_key_private = key_pair.private.serialize(); - store.identity_key_store.identity_key_public = key_pair.public.serialize(); + store.identity_key_store.identity_key_private = new Bytes(key_pair.private.serialize()); + store.identity_key_store.identity_key_public = new Bytes(key_pair.public.serialize()); identity_id = (int) db.identity.insert().or("REPLACE") .value(db.identity.account_id, account.id) .value(db.identity.device_id, (int) store.local_registration_id) - .value(db.identity.identity_key_private_base64, Base64.encode(store.identity_key_store.identity_key_private)) - .value(db.identity.identity_key_public_base64, Base64.encode(store.identity_key_store.identity_key_public)) + .value(db.identity.identity_key_private_base64, Base64.encode(store.identity_key_store.identity_key_private.get_data())) + .value(db.identity.identity_key_public_base64, Base64.encode(store.identity_key_store.identity_key_public.get_data())) .perform(); } catch (Error e) { // Ignore error } } else { store.identity_key_store.local_registration_id = ((!)row)[db.identity.device_id]; - store.identity_key_store.identity_key_private = Base64.decode(((!)row)[db.identity.identity_key_private_base64]); - store.identity_key_store.identity_key_public = Base64.decode(((!)row)[db.identity.identity_key_public_base64]); + store.identity_key_store.identity_key_private = new Bytes(Base64.decode(((!)row)[db.identity.identity_key_private_base64])); + store.identity_key_store.identity_key_public = new Bytes(Base64.decode(((!)row)[db.identity.identity_key_public_base64])); identity_id = ((!)row)[db.identity.id]; } |