Commit Graph

67 Commits

Author SHA1 Message Date
JC Brand
3e7c8655ad Add a <store> hint to OMEMO messages.
updates #497
2018-08-27 16:44:19 +02:00
JC Brand
15a4bcd11e Add method to generate missing prekeys
When receiving a PreKeySignalMessage, then a prekey has been chosen and
should now be removed from the list of available prekeys in the bundle,
so that a different device doesn't choose it as well.

AFAICT, libsignal removes the prekey, so it's then up to us to
regenerate it and republish our bundle.

updates #497
2018-08-27 16:43:58 +02:00
JC Brand
ea5144c7e5 Refactor the OMEMOStore to not duplicate prekeys
Before these changes, prekeys were stored in two places, one place that
converse-omemo accessed and one that libsignal accessed and when
libsignal deleted a prekey the other store wasn't updated.

Now we let the methods called by libsignal store/remove prekeys (and the
signed_prekey) in the same place as used by the code in converse-omemo.
2018-08-25 23:22:18 +02:00
JC Brand
7959855891 Move publishBundle to OMEMOStore
updates #497
2018-08-24 16:32:40 +02:00
JC Brand
d784e4a73a Show an icon to indicate that a message is encrypted
updates #497
2018-08-24 16:26:54 +02:00
JC Brand
3eb5e93f81 Finally able to send a message and decrypt it on the other side
Updates #497
2018-08-24 14:40:48 +02:00
JC Brand
2dd5976f65 Fix bugs in the OMEMO store and in the decrypt method.
Updates #497
2018-08-24 13:17:32 +02:00
JC Brand
9e56858aae Remove unnecessary promise wrapper 2018-08-24 10:51:59 +02:00
JC Brand
7bb7f8f4dc Can now successfully send an encrypted stanza
updates #497
2018-08-23 14:03:16 +02:00
JC Brand
c1123fd6a0 Used wrong registration id and identity key when building a session
updates #497
2018-08-23 14:03:12 +02:00
JC Brand
058905134e Serialize all array buffers to base64 before storing
Array Buffers can't be JSON serialized as is.

updates #497
2018-08-23 14:03:09 +02:00
JC Brand
d4ccf20e7f Update modals when devices get added
updates #497
2018-08-23 14:03:06 +02:00
JC Brand
b17579501f Provide error output to user when encrypted message can't be sent
updates #497
2018-08-23 14:03:00 +02:00
JC Brand
7692a46e17 Nonsencical to wrap a promise in try/catch 2018-08-23 14:02:53 +02:00
JC Brand
069d4a9fae Remove unnecessary promise wrapper
updates #497
2018-08-23 14:02:50 +02:00
JC Brand
fd639e2da6 Remove the active flag for devices.
Instead of setting `active` to `false`, we remove the device entirely
(unless its the current device).

Doing it this way means more fetching of bundles for devices that
disappear and then reappear from a user's devicelist.

However, there might be caching invalidation concerns with just reusing
a cached bundle for a device id that disappeared and then reappears.

Additionally this change simplifies the showing of a contact's device
fingerprints in the modal, since we don't have to take active/inactive
into consideration.

updates #497
2018-08-23 14:02:43 +02:00
JC Brand
781ad3d643 Update to use _converse.config 2018-08-23 09:49:51 +02:00
JC Brand
76a2192afa Singleton models need an id attribute via its getter
Setting it on the model itself is not sufficient and then causes
changes which should be type `update` become type `create`, causing
multiple versions of the model... resulting in chaos.
2018-08-22 23:39:42 +02:00
JC Brand
f01b6c29c8 Collections shouldn't have id attributes
Otherwise the collection's items aren't fetched but it's own properties.
The way to persistently remove items from a collection is to destroy
them, NOT to call `remove`.
2018-08-22 19:26:38 +02:00
JC Brand
5ded22207b identity_key should be stored as base64, not array buffer 2018-08-22 18:32:31 +02:00
JC Brand
fa0e7aeff5 Updated so that own device is properly created and published
Based on live testing. Updated tests accordingly.
2018-08-22 18:16:36 +02:00
JC Brand
75bd24c19e Update device lists in modals if devices get removed 2018-08-22 14:33:09 +02:00
JC Brand
21a04d9de5 Avoid unnecessary promise-wrapping 2018-08-22 14:33:08 +02:00
JC Brand
de077ba9af Various small fixes while trying to get it to work 2018-08-22 14:33:08 +02:00
JC Brand
24d86c7edd Wrap in try/catch, otherwise handler gets removed upon error 2018-08-22 14:33:08 +02:00
JC Brand
235b24d1d4 Bugfixes.
- Use sizzle xmlns selector (which doesn't work with `querySelector`)
- PEP Subscription didn't have `+` before `notify`
2018-08-22 14:33:08 +02:00
JC Brand
3ec426e11d Don't render OMEMO stuff in profile modal if OMEMO's not enabled 2018-08-21 18:03:34 +02:00
JC Brand
a06d2c494a Implement own device removal via stanza 2018-08-21 17:35:17 +02:00
JC Brand
26e936583f Add devices section to own profile modal
Allow for devices to be removed.
2018-08-21 09:28:16 +02:00
JC Brand
8cc69ee5fb No need for a toJSON call, it's already an object 2018-08-20 11:17:26 +02:00
JC Brand
7d1db66056 Less explicit Promise declarations.
It's usually not necessary to wrap a promise inside another one, instead
the original promise can just be returned.
2018-08-20 11:16:06 +02:00
JC Brand
e7f211bacf Avoid an unnecessary promise and create message as soon as possible
under non-OMEMO circumstances. Otherwise, when messages are fetched in
bulk via MAM, then a message referring to a previous one (e.g.
a correction) may be processed before the message being referred to has
been created.
2018-08-19 10:32:43 +02:00
JC Brand
9a7f56db7d Fix format of stanza that queries for devices. 2018-08-19 10:09:43 +02:00
JC Brand
4ed43854bd Bugfix. Items need to go inside the list 2018-08-18 18:25:52 +02:00
JC Brand
c4ac73cc88 prekey id must be an int. 2018-08-18 18:24:29 +02:00
JC Brand
2884549bb3 Test decryption of incoming OMEMO message
updates #497
2018-08-04 23:49:01 +02:00
JC Brand
713f49453f Working example of AES-GCM encryption and decryption
with key import and export.

updates #497
2018-08-04 21:32:08 +02:00
JC Brand
f2c283c907 More work on decrypting messages 2018-08-04 19:41:06 +02:00
JC Brand
be0eaecff9 Parse incoming OMEMO encrypted messages 2018-08-04 09:26:23 +02:00
JC Brand
bb1fdd843a Use ternary operator to make more compact 2018-08-04 09:07:59 +02:00
JC Brand
e774e9d1af Test that own devices (from other clients) get included
when sending out encrypted messages.

updates #497
2018-07-28 16:36:56 +02:00
JC Brand
a3593dbc7d Implement and test sending of encrypted messages
updates #497
2018-07-28 15:37:36 +02:00
JC Brand
bcd6845756 Show fingerprints in the user details modal
updates #497
2018-07-25 11:33:16 +02:00
JC Brand
114e46dfab Fix broken test and refactor slightly. updates #497 2018-07-22 10:33:57 +02:00
JC Brand
b80a77a21c Include signedPreKeySignature in published bundle
updates #497
2018-07-21 21:53:31 +02:00
JC Brand
118a84f111 Bugfix. Make sure outgoing messages all have unique ids 2018-07-01 12:01:07 +02:00
JC Brand
648c0387dd Refactor message sending
so that we don't have to always wait for stanza creation.
We only need to wait when OMEMO is active, so we keep the waiting
contained to that usecase.
2018-07-01 11:45:58 +02:00
JC Brand
6785eff4a7 Merge branch 'master' into converse-omemo 2018-07-01 11:44:04 +02:00
JC Brand
d484320c09 Test that bundles can be updated via PEP
Fix bugs in the process

udpates #497
2018-05-23 12:51:01 +02:00
JC Brand
ddd0ef8e20 Test that device lists can get updated via PEP
Fix various bugs in the process.

updates #497
2018-05-23 12:51:01 +02:00