Commit graph

72 commits

Author SHA1 Message Date
Moxie Marlinspike
44092a3eff Support for Axolotl protocol.
1) Split code into v1 and v2 message paths.

2) Do the Axolotl protocol for v2.

3) Switch all v2 entities to protobuf.
2014-01-06 14:37:52 -08:00
Moxie Marlinspike
4380b46a35 Correctly update MMS security status. 2014-01-06 14:37:51 -08:00
Moxie Marlinspike
fde8d32848 Subtle rebase conflicts... 2014-01-06 14:37:51 -08:00
Moxie Marlinspike
dadabdfaa8 Make UI responsive to UniversalTransport upgrades. 2014-01-06 14:36:23 -08:00
Moxie Marlinspike
c38a8aa699 Migrate to Curve25519.
1) Generate a Curve25519 identity key.

2) Use Curve25519 ephemerals and identities for v2 3DHE agreements.

3) Initiate v2 key exchange messages.

4) Accept v1 key exchange messages.

5) TOFU Curve25519 identities.
2014-01-06 14:36:22 -08:00
Moxie Marlinspike
073b1f69e3 Rollbacks, v2 sms-transport key exchanges, push identity conflicts.
1) Stop protocol rollbacks.

2) Handle v2 version key exchange messages.

3) Handle identity key conflicts on prekeybundle messages.
2014-01-06 14:35:53 -08:00
Moxie Marlinspike
5e6d39beea Move classes into library 2014-01-06 14:35:53 -08:00
Moxie Marlinspike
8f6590b738 Handle notifications and receiving push when locked. 2014-01-06 14:35:53 -08:00
Moxie Marlinspike
0dd36c64a4 Basic support for encrypted push-based attachments.
1) Move the attachment structures into the encrypted message body.

2) Encrypt attachments with symmetric keys transmitted in the
   encryptd attachment pointer structure.

3) Correctly handle asynchronous decryption and categorization of
   encrypted push messages.

TODO: Correct notification process and network/interruption
      retries.
2014-01-06 14:35:53 -08:00
Moxie Marlinspike
7f642666dd Basic support for prekeybundle message delivery and receipt. 2014-01-06 14:35:52 -08:00
Moxie Marlinspike
b8f663b69c Move common crypto classes into TextSecureLibrary.
1) Move all the crypto classes from securesms.crypto.

2) Move all the crypto storage from securesms.database.keys

3) Replace the old imported BC code with spongycastle.
2014-01-06 14:35:51 -08:00
Moxie Marlinspike
2042ca6cb7 Generate "prekeys" at push registration time.
This generates a large number of key exchange messages and
registers them with the server during signup.
2014-01-06 14:34:47 -08:00
Moxie Marlinspike
9287d413ac Support for incoming attachments.
1) Refactored MMS layer to use abstracted types.

2) Added support for retrieving attachment IDs.
2014-01-06 14:33:52 -08:00
Moxie Marlinspike
fd045f2354 Refactor MMS send/download to be synchronous.
1) Make the radio change a synchronous action with a timeout.

2) Move the send logic into an MmsTransport, in preparation for
   UniversalTransport composition.

3) Move the download logic into a synchronous receiver.
2014-01-06 14:33:52 -08:00
Moxie Marlinspike
1ac06312a0 Move directory and push service socket into library. 2014-01-06 14:21:50 -08:00
Moxie Marlinspike
a200d29514 Move most of Util into library 2014-01-06 14:21:50 -08:00
Moxie Marlinspike
21eee19380 Split into library project and add shared preferences layer of indirection. 2014-01-06 14:20:59 -08:00
Moxie Marlinspike
7489f3463a Change the way notifications work for non-default KitKat.
Messages that are not "secure" (encrypted or key exchange) are
automatically marked as read if TextSecure isn't the default
KitKat SMS app.

This change in functionality allows people who aren't using
TextSecure as a default SMS app on KitKat to still receive
notifications when they get incoming encrypted messages.
2013-12-07 11:03:25 -08:00
rhodey
2c2a03e5e2 Enhanced MMS configuration prompts and processing.
1) Added a new message status to MmsDatabase to
   signify a pending MMS download which requires
   APN settings.

2) Added a database method to query MMS messages
   based on status.

3) Added login to SendReceiveService for processing
   of MMS pending APN information.

4) Moved all APN/MMS settings into ApnPreferencesActivity
   and transformed PromptApnActivity into a simple
   informational activity.

5) Added logic to check for APN settings on send and
   receive of all MMS (media, group, email) and direct
   user to PromptApnActivity then ApnPreferencesActivity
   if necessary.

6) Vocab/grammar adjustments.
2013-10-20 16:56:34 -07:00
Ruben Pollan
04eafd5fab Allow to resend a failed message
Add an option to the context menu of the message to resend it if it has
failed.
2013-10-13 15:39:15 +02:00
Moxie Marlinspike
aa25f94291 Enhanced import/export support.
1) Allow imports from the stock SMS database at any time.

2) Provide plaintext export support, in a format compatible with
   the "SMS Backup And Restore" app.

3) Fix the DB weirdness on encrypted restore that previously
   required killing the app.
2013-06-24 21:02:30 -07:00
Moxie Marlinspike
0534f9d95a Fix for NPE on null FROM in MMS header. 2013-05-30 20:29:13 -07:00
Moxie Marlinspike
24fc93e9ae Switch to a more heavily TOFU model for identity keys.
1) There is no longer a concept of "verified" or "unverified."
   Only "what we saw last time" and "different from last time."

2) Let's eliminate "verify session," since we're all about
   identity keys now.

3) Mark manually processed key exchanges as processed.
2013-05-23 16:36:24 -07:00
Moxie Marlinspike
e080449383 Fix for NPE on import 2013-05-21 13:25:44 -07:00
Moxie Marlinspike
3df67a1643 Properly return unknown recipient from SMS db on empty. 2013-05-21 10:23:27 -07:00
Moxie Marlinspike
be34f30719 Lower maximum size of cursor window on DB upgrade.
On some systems, the DB upgrade was failing because there were
too many rows for the cursor window.  This moves some looping
operations into single update statements by using the substr()
command, and chunks the rest using a series of LIMITs.
2013-05-16 13:16:42 -07:00
Moxie Marlinspike
ad6760b62c Correctly handle deferred processing of key exchange message when locked. 2013-05-15 14:09:13 -07:00
Moxie Marlinspike
ef554ed265 Remove leaky logging. 2013-05-10 09:01:33 -07:00
Moxie Marlinspike
1aa84b145f Add 'mark all as read' option 2013-05-06 13:59:40 -07:00
Moxie Marlinspike
c35aa09806 Filter MMS weirdness 2013-05-06 12:33:42 -07:00
Moxie Marlinspike
50fae64330 Replace LinkedHashMap with a SoftReference LRUCache. Add Slide cache. 2013-05-06 12:22:03 -07:00
Moxie Marlinspike
0b172cebce Use DB sending type rather than in-memory hashtable. 2013-05-06 08:40:56 -07:00
Moxie Marlinspike
79c554fcc7 Fixed group in-thread notifications 2013-05-06 08:40:56 -07:00
Moxie Marlinspike
723fb4ffdd MMS and Group Messaging Improvements
1) Display the individual sender name in a group conversation.

2) Add an "address" column to MmsDatabase and keep FROM there.

3) Remove all blocking operations from MmsDatabase.Reader path.

4) Strip SMIL and other undisplayable parts from part count.

5) Fix places where messages weren't being correctly decrypted.
2013-05-06 08:40:55 -07:00
Moxie Marlinspike
2305a648fb Minor refactoring 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
e80882b83b Locally encrypted messages no longer show as ciphertext notifications. 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
7c47ea5cec Make MMS more asynchronous and consistent with new SMS types.
1) We now delay MMS notifications until a payload is received,
   or there's an error downloading the payload.  This makes
   group messages more consistent.

2) All "text" parts of an MMS are combined into a second text
   record, which is stored in the MMS row directly rather than
   as a distinct part.  This allows for immediate text loading,
   which means there's no chance a ConversationItem will resize.

   To do this, we need to include MMS in the big DB migration
   that's already staged for this application update.  It's also
   an "application-level" migration, because we need the MasterSecret
   to do it.

3) On conversation display, all image-based parts now have their
   thumbnails loaded asynchronously.  This allows for smooth-scrolling.
   The thumbnails are also scaled more accurately.
2013-05-06 08:40:55 -07:00
Moxie Marlinspike
dd0aecc811 First cut at group messaging refactor. 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
83e260436b Major storage layer refactoring to set the stage for clean GCM.
1) We now try to hand out cursors at a minimum.  There has always been
   a fairly clean insertion layer that handles encrypting message bodies,
   but the process of decrypting message bodies has always been less than
   ideal.  Here we introduce a "Reader" interface that will decrypt message
   bodies when appropriate and return objects that encapsulate record state.

   No more MessageDisplayHelper.  The MmsSmsDatabase interface is also more
   sane.

2) We finally rid ourselves of the technical debt associated with TextSecure's
   initial usage of the default SMS DB.  In that world, we weren't able to use
   anything other than the default "Inbox, Outbox, Sent" types to describe a
   message, and had to overload the message content itself with a set of
   local "prefixes" to describe what it was (encrypted, asymetric encrypted,
   remote encrypted, a key exchange, procssed key exchange), and so on.

   This includes a major schema update that transforms the "type" field into
   a bitmask that describes everything that used to be encoded in a prefix,
   and prefixes have been completely eliminated from the system.

   No more Prefix.java

3) Refactoring of the MultipartMessageHandler code.  It's less of a mess, and
   hopefully more clear as to what's going on.

The next step is to remove what we can from SmsTransportDetails and genericize
that interface for a GCM equivalent.
2013-05-06 08:40:55 -07:00
Moxie Marlinspike
303d1acd45 Initial client support for GCM message send/receive 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
2f39283da3 Initial GCM registration 2013-05-06 08:40:55 -07:00
Moxie Marlinspike
fb21c09dbe Catch NPE thrown by APN provider. 2013-03-17 11:19:36 -07:00
Moxie Marlinspike
2e55e9cdca Guard NPE 2013-03-03 18:49:55 -08:00
Moxie Marlinspike
6bd0f35787 Sometimes querying the APN DB throws this exception as well. 2013-02-26 22:55:23 -08:00
Moxie Marlinspike
34822557a6 Catch exception triggered by bug in telephony provider during import. 2013-02-24 11:59:43 -08:00
Moxie Marlinspike
5eb04328d3 Improve passphrase and onboarding UI. Abstract out routing.
1) Update the create, prompt, and change passphrase activities.
   They are no longer dialog themed, and should look a little
   less ugly.

2) Update the import DB activity to be less ugly and more robust.

3) Abstract all of the state handling stuff out of
   ConversationListActivity.  This is now handled by RoutingActivity,
   which all launch intents move through.
2013-02-17 15:09:01 -08:00
Moxie Marlinspike
471ef16a5b Support for robust delivery.
1) If a message fails to be delivered, post a notification in the
   status bar if that thread is not active and visible.

2) If a message fails to be delivered because there is no service,
   keep retrying every time service becomes available again.
2013-02-09 15:17:55 -08:00
Moxie Marlinspike
49ea135e37 Don't auto-set thread to read on send. 2013-02-06 16:40:09 -08:00
Moxie Marlinspike
dcf73cd009 Fix for 'group message' regression. 2013-02-04 11:03:19 -08:00
Moxie Marlinspike
bf92de394b Add support for resuming compose drafts. 2013-02-04 00:13:07 -08:00