aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-07-21Remove unused importAndreas Straub1-1/+0
2015-07-21Switch payload encryption to AES-GCMAndreas Straub1-6/+22
This also ensures that the IV is generated with proper randomness.
2015-07-20Also decrypt messages from UNTRUSTED sessionsAndreas Straub1-1/+1
2015-07-20Refactor axolotl send processing/caching flowAndreas Straub1-9/+8
2015-07-20Start TrustKeysActivity if no keys are TRUSTEDAndreas Straub1-6/+6
If there are no UNDECIDED keys, but none of the contact's keys are trusted, redirect the user to the TrustKeysActivity
2015-07-20Add purge axolotl key optionAndreas Straub1-28/+56
Can now long-press a key to permanently purge it.
2015-07-20attempt to fix the delay problemDaniel Gultsch1-5/+5
2015-07-20Lock TrustKeys if no trusted keys are availableAndreas Straub1-0/+8
2015-07-20Optimize importsAndreas Straub1-2/+0
2015-07-19Ask for key trust when sending messagesAndreas Straub1-37/+88
If the contact (or the own account) has keys that have UNDECIDED trust, we now drop the user into the new TrustKeysActivity, where they have to decide for each new key whether it should be TRUSTED or UNTRUSTED.
2015-07-19Send correct body for HTTP filesAndreas Straub1-1/+7
When using HTTP upload to send files, take care to transmit only the URL rather than the entire body, which contains metadata.
2015-07-19Fix trust status for outgoing messagesAndreas Straub1-8/+8
Tag sent messages with own fingerprint, set own fingerprint as always trusted, include own fingerprint in database trust search, explicitly reset trust colorfilter
2015-07-19Ensure that available sessions are always usedAndreas Straub1-9/+30
Any time a new session is established, call syncRosterToDisk() to ensure that on subsequent restoreFromDatabase() calls, the roster is actually available. This is important so that initAccountServices() can properly initialize the SessionMap. This prevents a race condition where after adding a new account and initiating sessions with it, if the app is killed (e.g. by reinstall) before triggering a syncRosterToDisk(), subsequent restores will not have the roster available, leading to missing XmppAxolotlSessions in the SessionMap cache. As a result of this, a new session was initiated when sending a new message, and received messages could not be tagged with the originating session's fingerprint. As an added sanity check, go to the database to confirm no records are present before creating fresh XmppAxolotlSession objects (both in the sending and receiving case).
2015-07-19Fix and expand key regeneration functionAndreas Straub1-9/+18
Wipe session cache to prevent stale sessions being used. Wipe fetch status cache to enable recreation of sessions. Regenerate deviceId, so that foreign devices will talk to us again.
2015-07-19Overhauled Message taggingAndreas Straub1-40/+60
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-19Use full int range for device IDsAndreas Straub1-1/+1
2015-07-19Clean up unused constantAndreas Straub1-1/+0
2015-07-19Make some fields finalAndreas Straub1-3/+3
2015-07-19Clean up loggingAndreas Straub1-54/+61
Add a fixed prefix to axolotl-related log messages, set log levels sensibly.
2015-07-19Add basic PEP managemend UI to EditAccountActivityAndreas Straub1-0/+33
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-19Fix devicelist update handlingAndreas Straub1-0/+5
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-19Only cache session if successfully establishedAndreas Straub1-1/+6
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-19Return empty set on invalid PEP devicelistAndreas Straub1-1/+2
2015-07-19Trust all IdentityKeysAndreas Straub1-2/+3
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-19Refresh PEP on session establishAndreas Straub1-0/+18
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-19Fix asynchronous axolotl message sendingAndreas Straub1-6/+23
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-19Properly track message senderAndreas Straub1-4/+4
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-19Rework PEP content verificationAndreas Straub1-47/+61
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-19Formatting fixesAndreas Straub1-2/+2
2015-07-19When receiving, add mock session if none existsAndreas Straub1-1/+1
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-19Fetch bundles on-demand, encrypt in backgroundAndreas Straub1-42/+91
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-19Use bareJid for own session retrievalAndreas Straub1-1/+1
2015-07-19Migrate to new PEP layoutAndreas Straub1-118/+134
Merge prekeys into bundle node
2015-07-19Formatting fixesAndreas Straub1-22/+22
2015-07-19Save IdentityKeys in databaseAndreas Straub1-47/+23
2015-07-19Reformat code to use tabsAndreas Straub1-825/+825
This really sucks to do it like this. Sorry. :(
2015-07-19Added PEP and message protocol layersAndreas Straub1-0/+208
Can now fetch/retrieve from PEP, as well as encode/decode messages
2015-07-19Reworked axolotl protocol layerAndreas Straub1-38/+272
Numerous fixes
2015-07-19CryptoNext persistance layer mockupAndreas Straub1-0/+440
Initial sketch of the peripheral storage infrastructure for the new axolotl-based encryption scheme.