Commit Graph

2449 Commits

Author SHA1 Message Date
Andreas Straub 2afb36d891 Display trust status in ContactDetailsActivity 2015-07-09 14:26:19 +02:00
Andreas Straub bdc9f9a44f Overhauled Message tagging
Messages are now tagged with the IdentityKey fingerprint of the
originating session. IdentityKeys have one of three trust states:
undecided (default), trusted, and untrusted/not yet trusted.
2015-07-09 14:23:17 +02:00
Andreas Straub b1e719bd8b Postpone initAccountService until roster loaded
The AxolotlService depends on the roster being loaded when it is
initialized so that it can fill its in-memory SessionMap.
2015-07-09 14:18:54 +02:00
Andreas Straub ce4b86e6d4 Fix getSubDeviceSessions SQL query 2015-07-09 14:15:59 +02:00
Andreas Straub 34f90f2eb7 Merge branch 'development' into CryptoNextAlpha
* development:
  show contacts name in non anonymous mucs. fixes #1213
2015-07-08 18:16:05 +02:00
Andreas Straub 2f487c7947 Display axolotl chat message hint 2015-07-08 18:14:28 +02:00
Andreas Straub 121919def1 Use full int range for device IDs 2015-07-08 18:13:49 +02:00
Andreas Straub 6b0d286518 Clean up unused constant 2015-07-08 17:46:03 +02:00
Andreas Straub 9e3419722b Make some fields final 2015-07-08 17:45:37 +02:00
Andreas Straub 4f6ca6fb63 Clean up logging
Add a fixed prefix to axolotl-related log messages, set log levels
sensibly.
2015-07-08 17:44:24 +02:00
Andreas Straub d5b3557157 Add basic PEP managemend UI to EditAccountActivity
EditAccountActivity now show own fingerprint, and gives an option to
regenerate local keying material (and wipe all sessions associated with
the old keys in the process).

It also now displays a list of other own devices, and gives an option to
remove all but the current device.
2015-07-07 19:36:22 +02:00
Andreas Straub 9d780a382a Fix devicelist update handling
No longer store own device ID (so that we don't encrypt messages for
ourselves), verify that own device ID is present in update list
(otherwise republish), reflect update in UI.
2015-07-07 19:32:52 +02:00
Andreas Straub 7cdf2a9946 Refactor axolotl database recreation 2015-07-07 19:30:08 +02:00
Andreas Straub 30403a70f2 Adapt prettifyFingerprint() to axolotl FP sizes 2015-07-07 19:28:35 +02:00
Andreas Straub 4b0279a6ef Fix displaying Contact IdentityKeys
Migrate ContactDetailsActivity to use new SQL IdentityKeys storage,
remove dead code from Contact class.
2015-07-07 19:27:12 +02:00
Andreas Straub 3b8dfafecd Only cache session if successfully established
When receiving a message, only remember the XmppAxolotlSession wrapper
if the prospective session was actually established. This prevents us
from erroneously adding empty sessions that are never established using
received PreKeyWhisperMessages, which would lead to errors if we try to
use them for sending.
2015-07-05 22:54:28 +02:00
Andreas Straub 835584ae3b Return empty set on invalid PEP devicelist 2015-07-05 22:53:34 +02:00
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
Daniel Gultsch ef1429c9a6 show contacts name in non anonymous mucs. fixes #1213 2015-07-05 18:10:18 +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 148955a713 version bump to 1.4.7 2015-07-04 00:05:28 +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 bfe1d2489a version bump to 1.4.6 2015-07-03 13:08:25 +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