Commit Graph

830 Commits

Author SHA1 Message Date
Andreas Straub 4cc4e81b8e Trust all IdentityKeys
The trust-on-first-use policy leads to problems when receiving messages
from two different devices of a contact before sending a message to them
(as their IdentityKeys will not have been added yet). Since session
trust will be managed externally anyway, this change is not a security
problem, and will allow us to decrypt messages from yet-untrusted
sessions.
2015-07-05 22:10:43 +02:00
Andreas Straub 72619de889 Refresh PEP on session establish
We now track preKeys used to establish incoming sessions with us. On
each new established session, we remove the used prekey from PEP. We
have to do this because libaxolotl-java internally clears the used
preKey from its storage, so we will not be able to establish any future
sessions using that key.
2015-07-05 17:27:29 +02:00
Andreas Straub 12fc24dd42 Fix asynchronous axolotl message sending
XmppConnectionService.sendMessage() now dispatches messages to the
AxolotlService, where they only are prepared for sending and cached.
AxolotlService now triggers a XmppConnectionService.resendMessage(),
which then handles sending the cached message packet.

This transparently fixes, e.g., handling of messages sent while we are
offline.
2015-07-05 17:27:29 +02:00
Andreas Straub c5596b34bc Properly track message sender
Previously, the sender was assumed to be the conversation counterpart.
This broke carboned own-device messages. We now track the sender
properly, and also set the status (sent by one of the own devices vs
received from the counterpart) accordingly.
2015-07-05 17:27:29 +02:00
Andreas Straub 9206a49b79 Rework PEP content verification
Now checks which part(s) are out of sync w/ local storage, and updates
only those, rather than assuming the entire node corrupt and
overwriting it all (especially relevant for preKey list)
2015-07-05 17:27:29 +02:00
Andreas Straub 7680a24180 Formatting fixes 2015-07-05 17:27:29 +02:00
Andreas Straub c1116b6066 When receiving, add mock session if none exists
We need a session object in order to build a session from a
PreKeyWhisperMessage, so add an empty one when none exists on receiving
a message.

Warning: this will break right now if the session can not be constructed
from the received message.There will be an invalid session which will
break if we try to send using it.
2015-07-05 17:27:29 +02:00
Andreas Straub ab2f85d2e8 Tag messages with originating session
This can be used later in order to display trust status of messages, as
well as for potential resending of messages in case of preKey conflicts.
2015-07-05 17:27:29 +02:00
Andreas Straub a58d5e8ce3 Fetch bundles on-demand, encrypt in background
Bundles are now fetched on demand when a session needs to be
established. This should lessen the chance of changes to the bundles
occuring before they're used, as well as lessen the load of fetching
bundles.

Also, the message encryption is now done in a background thread, as this
can be somewhat costly if many sessions are present. This is probably
not going to be an issue in real use, but it's good practice anyway.
2015-07-05 17:27:22 +02:00
Andreas Straub ae75c571df Use bareJid for own session retrieval 2015-07-05 17:26:29 +02:00
Andreas Straub ba9520729f Migrate to new PEP layout
Merge prekeys into bundle node
2015-07-05 17:26:29 +02:00
Andreas Straub 287ce131d8 Formatting fixes 2015-07-05 17:26:29 +02:00
Andreas Straub 046a2d6045 Save IdentityKeys in database 2015-07-05 17:26:29 +02:00
Andreas Straub 71c0a75ec9 DatabaseBackend bugfixes
Don't leak cursors, initially create tables
2015-07-05 17:26:29 +02:00
Andreas Straub 0423852cb8 Reformat code to use tabs
This really sucks to do it like this. Sorry. :(
2015-07-05 17:26:29 +02:00
Andreas Straub e8e126f2ce Added axolotl activation code to UI 2015-07-05 17:26:19 +02:00
Andreas Straub 61f18d4dfc Added PEP and message protocol layers
Can now fetch/retrieve from PEP, as well as encode/decode messages
2015-07-05 17:14:46 +02:00
Andreas Straub 6805abbef0 Reworked axolotl protocol layer
Numerous fixes
2015-07-05 17:09:35 +02:00
Andreas Straub 0917a75705 CryptoNext Menu entries added 2015-07-05 17:09:34 +02:00
Andreas Straub f16b77d382 CryptoNext persistance layer mockup
Initial sketch of the peripheral storage infrastructure for the new
axolotl-based encryption scheme.
2015-07-05 17:09:34 +02:00
Daniel Gultsch bef731a3c8 refactored sendMessage and merged with resendMessage 2015-07-05 11:59:38 +02:00
Daniel Gultsch 2fbeb0bbb2 make sure unread count is initialized as 0. fixes #1270 2015-07-03 22:08:23 +02:00
Daniel Gultsch d30fb6f0a1 avoid very rare npe 2015-07-03 21:32:46 +02:00
Daniel Gultsch 1c86098f3b Merge branch 'master' into development 2015-07-03 13:09:05 +02:00
Daniel Gultsch fc47969741 added fallback for non-srv dns queries 2015-07-03 13:07:48 +02:00
Daniel Gultsch c745fbb562 fixed share with activity to account for http file upload 2015-07-02 23:51:59 +02:00
Daniel Gultsch e4d1bd415d also offer http download for some 'well known extensions' 2015-07-02 23:19:50 +02:00
Daniel Gultsch f5ba9d4223 refactored message context menu 2015-07-02 23:13:00 +02:00
Daniel Gultsch a2525346f4 moved null check for to and from in message parser 2015-07-02 18:02:32 +02:00
Daniel Gultsch c20a088ea8 changed mime type handling 2015-07-01 16:01:18 +02:00
Daniel Gultsch c36238141d disable automatic aes encryption for the time being 2015-06-30 20:19:18 +02:00
Daniel Gultsch 9190e03076 changed namespace of the http upload feature 2015-06-30 20:11:50 +02:00
Daniel Gultsch aca9d8036c made httpconnection (download) ready all kind of files 2015-06-30 17:15:02 +02:00
Daniel Gultsch 6af97c724c made storage path decision entirely based upon file extension 2015-06-30 14:04:39 +02:00
Daniel Gultsch d7de311379 refactored bodyContainsDownloadable to be more flexible 2015-06-30 13:52:53 +02:00
Daniel Gultsch 5b42b392a1 always show copy original url in context menu when url is available 2015-06-30 13:01:04 +02:00
Daniel Gultsch 0030bbf472 untested pgp support for http upload 2015-06-29 15:38:16 +02:00
Daniel Gultsch fdd46f1c91 added trigger to Config.java to always enable aes encryption for uploaded files 2015-06-29 15:21:41 +02:00
Daniel Gultsch 82714dedfe make quick actions available in conferences when file attachment is available 2015-06-29 15:21:41 +02:00
Daniel Gultsch 7e11570f2c show attach button in conferences when http upload is available 2015-06-29 15:21:41 +02:00
Daniel Gultsch 9eb9a52205 initial http upload support
be careful: little error handling and no encryption
2015-06-29 15:21:41 +02:00
Daniel Gultsch 0d01e51da5 don't parse body from muc status messages 2015-06-28 22:14:40 +02:00
Daniel Gultsch 46595b6d43 fixed parsing of muc status messages in new message parser 2015-06-28 20:11:28 +02:00
Daniel Gultsch 3578263686 pulled new translations from transifex 2015-06-23 12:19:33 +02:00
Daniel Gultsch 5a48afdd4d don't perform dns lookups on domain parts that obviously look like ip addresses 2015-06-19 16:25:08 +02:00
Daniel Gultsch 58201b4408 changed paragraph divider 2015-06-10 03:30:17 +02:00
Daniel Gultsch 0ea83832cd pulled new translations from transifex 2015-06-10 03:29:52 +02:00
Daniel Gultsch 9d1e8205a2 made i/o and memory intensive operations execute in serial order 2015-06-05 08:46:06 +02:00
Daniel Gultsch a4e9f0c9c0 fixed obvious bug in dns helper 2015-06-04 16:26:51 +02:00
Daniel Gultsch 8f07e4c441 streamlined dns helper by ignoring weight 2015-06-04 02:48:07 +02:00