Commit Graph

104 Commits (9db0a58260d3395dd4f9bf68d3df5ff6672102fe)

Author SHA1 Message Date
Scott Nonnenberg 9db0a58260 Whenever adding something to a queue, include a timeout
No more wedged queues!

FREEBIE
8 years ago
lilia 9f4fcc5afa Send null messages to mask verified syncs
First construct a null message of random size and contents and send it to the
destination. Then include that same padding in the verification sync.

Note that the sync message is additionally randomly padded like all other sync
messages.

This lets Verified sync messages appear the same as normal sync message traffic.

// FREEBIE
8 years ago
lilia 1e93b12b90 Update protos with support for null messages
// FREEBIE
8 years ago
lilia 6e758fc1ea Randomly pad all sync messages
WhisperSystems/libsignal-service-java@c46cdc0aa5

// FREEBIE
8 years ago
Scott Nonnenberg 20f4d48991 Protos: Move to latest iteration of verification protos
FREEBIE
8 years ago
Scott Nonnenberg 4a1dc46ab3 Fixes to get local verification and sync messages working
FREEBIE
8 years ago
lilia 52481d1d13 Support for sending and receiving verification sync messages
This adds a new method to message sender for sending verification sync messages
and a new event to message receiver representing incoming verification sync
messages. Currently the event handler just logs the message.

// FREEBIE
8 years ago
lilia f095a1583e Fetch profiles whenever conversations are opened
For a group, fetch everyone's profile.

// FREEBIE
8 years ago
lilia 22e907a8d4 Add getProfile to MessageSender
// FREEBIE
8 years ago
lilia 4842ef6153 Sync end session messages
// FREEBIE
8 years ago
lilia 6c53605dfd Flag voice note attachment protos as such
// FREEBIE
8 years ago
lilia 27a1c9f18a Populate attachment file size
// FREEBIE
8 years ago
lilia fc514aa96f Add support for attachment file names
Send, receive, and save attachment filenames. Use them as suggested
names when saving files.

// FREEBIE
8 years ago
lilia 611bbaef35 Don't hardcode the attachment server url
There may come a day when we may need to change this url from the server
side. On that day, clients should continue to operate normally. The
service should be able to change attachment server locations without
requiring a client update.

// FREEBIE
8 years ago
lilia 43de0cc2ec Add attachment digests
// FREEBIE
8 years ago
lilia cd0fe7037b Add replayable error for signed key failure
Disable message sending if signed key updates fail too many times, but
allow the user to retry sending.

// FREEBIE
8 years ago
lilia 86dbbc9f29 Allow null expireTimer in sendmessage 9 years ago
lilia ad2174e279 Sync expirationStartTimestamp on outgoing messages
Linked devices need to know when to start the clock.
9 years ago
lilia 6074a29046 Send timer update messages when changing the timer 9 years ago
lilia 824b7417e9 Apply expireTimer to outgoing messages 9 years ago
lilia 0487fa3cd1 Add server fallback port 8443
// FREEBIE
9 years ago
lilia f8e176fd40 Dedupe methods
Define textsecure.crypto in terms of libsignal.crypto.

// FREEBIE
9 years ago
lilia d32a352d8a Use deviceIds/addresses instead of encodedNumbers
The getDeviceObjectsForNumber method returns device objects that contain
nothing but the encodedNumber property. Instead, just deal in deviceIds
until a SignalProtocolAddress is constructed to manage both the number
and deviceId.

// FREEBIE
9 years ago
lilia 0483fa2f97 Remove closeOpenSessionForDevice from protocol_wrapper
// FREEBIE
9 years ago
lilia 3e0bce2b21 Move, rename, and simplify toArrayBuffer helper
This function is only ever used to convert groupIds from strings to
array buffers in sendmessage.

// FREEBIE
9 years ago
lilia 2b7cbef8b1 Rename a function
Avoid confusing this operation with actual receipts, which are something
else.

// FREEBIE
9 years ago
lilia c3bbdb393f Refactor media uploading step
Move this to its own function which encapsulates the error handling for
it.

// FREEBIE
9 years ago
lilia 44b1a6451d Add validation to Message class
// FREEBIE
9 years ago
lilia 781ada64ca Add libtextsecure support for syncing read messages
Plumbing for sending and receiving a new sync protobuf for marking
messages read on/from my other devices.

// FREEBIE
9 years ago
lilia 7e82d1295c Handle attachment upload errors
Adds a new kind of replayable error that handles retry of pre-encryption
failures, e.g., attachment upload.

Fixes #485

// FREEBIE
9 years ago
lilia 910e37649a Let group messages use new Message class
// FREEBIE
9 years ago
lilia 3bffdd96f5 Add sendMessage to handle sending from Message class
// FREEBIE
9 years ago
lilia ecdfa09e97 Create a helper class for constructing messages
// FREEBIE
9 years ago
lilia 86132a38a8 Log envelopes and session end events
Help debug bad session errors by logging some envelope info about the
message we are about to decrypt. With this, if there is a decryption
error (e.g., bad mac or no session) it is clear from the logs what
number and device message sent the bad message.

Also log when we send and receive end session messages and when we close
sessions for certain devices.

// FREEBIE
9 years ago
lilia bc576e18d5 Fix no delivery receipts on close session messages
// FREEBIE
9 years ago
lilia e9949152bb Always return a promise from sendSyncMessage
// FREEBIE
10 years ago
lilia 07702c4ee5 Let the application layer send sync messages
Previously, libtextsecure would send a sync message automatically
when appropriate. This fails if any recipient has a key conflict
or if our network connection fails mid-send.

Instead, when appropriate, return a the DataMessage encoded as an array
buffer for later syncing. This lets the application choose when to send
it, which we now do after any successful send to a recipient, rather
than after all recipients are successfully sent to.

Eventually we should move the DataMessage protobuf construction and
group sending logic to the application layer entirely, in which case
we wouldn't need libtextsecure to construct the sync message either.

Fixes #408
10 years ago
lilia 5c37c3d6ce Change return type from sending messages
Pass the whole result from the outgoing message callback on to the
caller, and preserve the names of the members.

// FREEBIE
10 years ago
lilia 7b6820d2ac Refactor messageSender/OutgoingMessage
Move encrypt and transmit to OutgoingMessage
Restore per-number queueing to messageSender

// FREEBIE
10 years ago
lilia 4cc6b1ff9a Validate attachment urls
// FREEBIE
10 years ago
lilia 641a7dbc6d Update libaxolotl
encryptMessageFor now requires an array buffer instead of a protobuf.

By converting the message to an array buffer outside the Promise.all, we
avoid allocating a new copy for each device.

// FREEBIE
10 years ago
lilia a3d29a92bb Reject messages sent to groups with no members
If you're the last member of the group, it doesn't make sense to send
messages to it. Previously, we would wait forever for a callback,
causing a stuck pending state indicator.

// FREEBIE
10 years ago
lilia 12276e691b Refactor contents of sendMessageProto
This function dynamically declares a bunch of functions which bind to
its input arguments. Instead, use a new prototypal class to define
these functions within the context of a particular message.

// FREEBIE
10 years ago
lilia a2c7ac0df9 Serialize message sending per-recipient
Add a pendingMessages object to MessageSender. This object holds
one promise per recipient number. We init this promise with
Promise.resolve(), and chain on promises for message sending, replacing
the previous promise with the newly chained promise each time. If the
current promise resolves and finds that it is still the last promise
in the chain, it removes itself.
10 years ago
lilia 816a206892 Refactor sendMessageToDevices
Split into separate encrypt and transmit functions. Let the encryption
function also handle all wire formatting (ie, jsonification and base64
encoding), which simplifes TextSecureServer.sendMessages, removes a
TODO, and lets us save fewer params to make network errors replayable.

// FREEBIE
10 years ago
lilia a32f3ff1f6 More work on replayable errors
Expose a button that does that retries outgoing messages if possible.

// FREEBIE
10 years ago
lilia 5bf608598c Fix MessageSender prototype
// FREEBIE
10 years ago
lilia 978b3d1a98 DRY up tryMessageAgain
// FREEBIE
10 years ago
lilia fbb65d1988 Add replayable network errors
Support for manual message retry.

// FREEBIE
10 years ago
lilia bc03bdbfc4 Move tryMessageAgain to MessageReceiver
`tryMessageAgain` is the routine called when re-trying a message that
failed to decrypt due to an IncomingIdentityKeyError. This handling
needs to move to MessageReceiver because it depends on
`processDecrypted` to handle incoming message protos, which depends
on a server instance in order to download attachments.

// FREEBIE
10 years ago