Commit Graph

44 Commits (084f27a2e8c55f0a6f2b5587b96ca774e603fbfd)

Author SHA1 Message Date
Moxie Marlinspike 27b5bf54cc Remove 1 mod 8. 11 years ago
Moxie Marlinspike 819982af7b Rearrange decrypt API.
1) Change SessionBuilder to only establish sessions via
   KeyExchangeMessage and PreKeyBundles.

2) Change SessionCipher to decrypt either WhisperMessage
   or PreKeyWhisperMessage items, automatically building
   a session for the latter.

3) Change SessionCipher to tear down new sessions built
   with PreKeyWhisperMessages if the embedded WhsiperMessage
   fails to decrypt.
11 years ago
Moxie Marlinspike 0d532afd8e Rename 'device key' to 'signed prekey'. 11 years ago
Moxie Marlinspike 811479d168 Add first cut of protocol v3 support.
1) Use the new /v2/keys API for storing/retrieving prekey bundles.

2) For sessions built with PreKeyBundle and PreKeyWhisperMessage,
   use a v3 ratcheting session when available.
11 years ago
Moxie Marlinspike a601c56af1 Collapse SessionRecord, SessionState, and PreKeyRecord interfaces. 11 years ago
Moxie Marlinspike 72af8b11c2 Move session construction and KeyExchangeMessage into libaxolotl.
1) Add plain two-way key exchange support libaxolotl by moving
   all the KeyExchangeMessage code there.

2) Move the bulk of KeyExchangeProcessor code to libaxolotl
   for setting up sessions based on retrieved prekeys, received
   prekeybundles, or exchanged key exchange messages.
11 years ago
Moxie Marlinspike 14b8f97de2 Reorganize session store load/store operations. 11 years ago
Moxie Marlinspike d902c12941 Break core ratchet out into libaxolotol.
1) Break the core cryptography functions out into libaxolotol.

2) The objective for this code is a Java library that isn't
   dependent on any Android functions.  However, while the
   code has been separated from any Android functionality,
   it is still an 'android library project' because of the
   JNI.
11 years ago
Moxie Marlinspike 0574ec170a Display legacy message error when V1 message is received. 12 years ago
Moxie Marlinspike cebad39422 Collapse some v2 interfaces now that there's no v1. 12 years ago
Moxie Marlinspike 1d07ca3e6f Remove V1 code. 12 years ago
Moxie Marlinspike 5a3daf4846 Curve25519 keys to 1 mod 8 for ephemerals. 12 years ago
Moxie Marlinspike fd1a18d2d0 Don't display duplicate push messages. 12 years ago
Moxie Marlinspike ad5d6d5bb7 Add refresh path for PreKey queue. 12 years ago
Moxie Marlinspike 926d3c929f Handle simultaneous initiate protocol case.
1) Modify SessionRecord to store a list of "previous" sessions
   in addition to the current active session.  Previous sessions
   can be used for receiving messages, but not for sending
   messages.

2) When a possible "simultaneous initiate" is detected, push the
   current session onto the "previous session" stack instead of
   clearing it and starting over.

3) Additionally, mark the new session created on a received
   possible "simultaneous initiate" as stale for sending.  The
   next outgoing message would trigger a full prekey refresh.

4) Work to do: outgoing messages on the SMS transport should
   probably not use the existing session if it's marked stale
   for sending.  These messages need to fail and notify the user,
   similar to how we'll handle SMS fallback to push users before
   a prekey session is created.
12 years ago
Moxie Marlinspike 19dddd7adf Support for an 'end session' protocol message.
1) On the push side, this message is a flag in PushMessageContent.
   Any secure message with that flag will terminate the current
   sessin.

2) On the SMS side, there is an "end session" wire type and
   the convention that a message with this wire type must be
   secure and contain the string "TERMINATE."
12 years ago
Jake McGinty 649f037ed8 apply same fix used on DecryptingPartInputStream to AttachmentCipherInputStream // FREEBIE 12 years ago
Moxie Marlinspike 3999171377 Introduce registration-time ID for detecting stale sessions.
1) At registration time, a client generates a random ID and
   transmits to the the server.

2) The server provides that registration ID to any client
   that requests a prekey.

3) Clients include that registration ID in any
   PreKeyWhisperMessage.

4) Clients include that registration ID in their sendMessage
   API call to the server.

5) The server verifies that the registration ID included in
   an API call is the same as the current registration ID
   for the destination device.  Otherwise, it notifies the
   sender that their session is stale.
12 years ago
Moxie Marlinspike 0ace469d74 Support for multi-device.
1) In addition to the Recipient interface, there is now
   RecipientDevice.  A Recipient can have multiple corresponding
   RecipientDevices.  All addressing is done to a Recipient, but
   crypto sessions and transport delivery are done to
   RecipientDevice.

2) The Push transport handles the discovery and session setup
   of additional Recipient devices.

3) Some internal rejiggering of Groups.
12 years ago
Moxie Marlinspike 3c3028c8e3 Typo 12 years ago
Moxie Marlinspike ff0dff745c Let's order 3DHE by Alice/Bob roles. 12 years ago
Moxie Marlinspike d4188c4a1c SHA256 attachment MACs. 12 years ago
Moxie Marlinspike 327ee4ff62 Remove unnecessary classes, up prekey limit to 100 12 years ago
Moxie Marlinspike f7b71e5e28 Add info to MessageKey HKDF, change order of RootKey derivation. 12 years ago
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.
12 years ago
Moxie Marlinspike 07b7696937 Update 'DJB' type not to conlict with NIST type 0x04. 12 years ago
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.
12 years ago
Moxie Marlinspike a03fff8b24 Add HKDF support for new sessions. 12 years ago
Moxie Marlinspike dbc070cd65 Refactor the ciphertext message parsing and building. 12 years ago
Moxie Marlinspike fa5ccc3f8a Support for server federation. 12 years ago
Moxie Marlinspike 75cca3add1 Resign ourselves to a less sophisticated contact intersection method. 12 years ago
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.
12 years ago
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.
12 years ago
Moxie Marlinspike cddba2738f Make encoding/decoding more explicit. 12 years ago
Moxie Marlinspike 0cc5837d7f Support encrypted transport, properly handle multiple recipients.
1) Add encryption support for the transport layer.  This obscures
   metadata from the push messaging provider.

2) Better support the direction multiple destination messages is
   headed (one unique message per recipient).
12 years ago
Moxie Marlinspike 68ec0a3727 Add last resort key and signaling key. 12 years ago
Moxie Marlinspike 1bbcedabd4 Added SMS transport support for PreKeyBundle messages.
1) Added SMS transport support.

2) Keep track of whether a PreKeyBundle message has gotten
   a response, and send them as subsequent messages until
   one has been received.
12 years ago
Moxie Marlinspike 43492b66c4 Rename EncryptedMessage 12 years ago
Moxie Marlinspike 7f642666dd Basic support for prekeybundle message delivery and receipt. 12 years ago
Moxie Marlinspike 1cc2762656 Refactor relationship between SessionCipher and Message. 12 years ago
Moxie Marlinspike d1969412fb Move PreKey ids to be Mediums, generate in circular buffer. 12 years ago
Moxie Marlinspike edb89ee3e9 Encode prekey as full JSON rather than protobuf blobs.
1) Split prekey messages out into full JSON.

2) Add support for retrieving prekeys.
12 years ago
Moxie Marlinspike 499de2d2bf Move prekey jsonifcation into the push code, add identity key. 12 years ago
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.
12 years ago