Commit Graph

194 Commits (44f817d16ce03aa522887ed652a8cc90b477d002)

Author SHA1 Message Date
lilia 1d370857fc Remove unused callback arguments
Unused since d0fd3e94 afaict.

// FREEBIE
10 years ago
lilia f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
10 years ago
lilia 4f1ce4c493 Assume unknown recipients are single-device
Start by requesting keys for only the master device, then handle 410 as
needed. Single-device users are the more common case and this strategy
lets us avoid requesting/expending one of our own device keys when
establishing a session with sibling devices.

// FREEBIE
10 years ago
lilia c05be725b3 Move makeAttachmentPointer
Clean up unnecessary pre-declaration of `var makeAttachmentPointer`.
10 years ago
lilia 67f25214d3 Refactor outgoing identity key conflict handling
saveKeysToDeviceObject is the detector of outgoing identity key errors.
Catch these key errors closer to the source by pulling the
getKeysForNumber into the context of sendMessageToDevices, which lets
it access registerError and the message protobuf.

Previously identity key errors would be uncaught if all existing
sessions with a recipient were closed/deleted, since we would
preemptively fetch the new identity key. The old error handling only
kicked in after a 409/410 response from the server when posting a
message encrypted for a stale session.

// FREEBIE
10 years ago
lilia 4e88d4a5cf Add missing semicolons 10 years ago
lilia c28b5408ab Plumb keys into outgoing conflicts 10 years ago
lilia a3ae3cab79 Use Promise.reject for simplicity
The following are equivalent, except that the first is longer and
invokes an extra function call.

```
return new Promise(function(resolve, reject) {
  reject(new Error("Unknown Group"));
});

return Promise.reject(new Error("Unknown Group"));
```
10 years ago
lilia 3711e0a6cd Convert throwHumanError to custom error type
Now with 200% more helpful stack traces.

// FREEBIE
10 years ago
lilia 8745424d3a Fix outgoing identity key conflict handling
// FREEBIE
10 years ago
lilia 5925c2fe84 Support for group sync
Protocol and handling is all analogous to contact sync: Multiple
GroupDetails structs are packed into a single attachment blob and parsed
on our end. We don't display the synced groups in the conversation list
until a new message is sent to one of them.

// FREEBIE
10 years ago
lilia 2f935dfd5e Add contact sync request protocol 10 years ago
lilia 228ffe901d Update json formatting for legacy message requests
Legacy DataMessages are sent using the `body` field, new Content
messages are sent using the `content` field.

// FREEBIE
10 years ago
lilia a833d62a71 Implement sync protocol changes
Update protobuf definitions and refactor message receive and decrypt
codepath to support new protocol, including various flavors of sync
messages (sent messages, contacts, and groups).

Also cleans up background.js and lets libtextsecure internalize
textsecure.processDecrypted and ensure that it is called before handing
DataMessages off to the application.

The Envelope structure now has a generic content field and a
legacyMessage field for backwards compatibility. We'll send outgoing
messages as legacy messages, and sync messages as "content" while
continuing to support both legacy and non-legacy messages on the receive
side until old clients have a chance to transition.
10 years ago
lilia a9549e2e0f Fix 410 handling
We need to close the existing session with an old registrationId.
10 years ago
lilia 7d08e1132d Fix close session 10 years ago
lilia 090cc84452 Do not include destination on group sync messages 10 years ago
lilia 748f32022a Fix up refreshGroup 10 years ago
lilia f774047935 Make libtextsecure group storage asynchronous 10 years ago
lilia 9de1572ba6 Convert all storage.devices methods to be asynchronous 10 years ago
lilia 666f6baaca Async getSessionsForNumber 10 years ago
lilia 9e7d8c0a08 Rename textsecure.api and make it internal-only 10 years ago
lilia 96eafc7750 Integrate libaxolotl async storage changes
* Session records are now opaque strings, so treat them that way:
  - no more cross checking identity key and session records
  - Move hasOpenSession to axolotl wrapper
  - Remote registration ids must be fetched async'ly via protocol wrapper
* Implement async AxolotlStore using textsecure.storage
* Add some db stores and move prekeys and signed keys to indexeddb
* Add storage tests
* Rename identityKey storage key from libaxolotl25519KeyidentityKey to
  simply identityKey, since it's no longer hardcoded in libaxolotl
* Rework registration and key-generation, keeping logic in libtextsecure
  and rendering in options.js.
* Remove key_worker since workers are handled at the libaxolotl level
  now
10 years ago
Matt Corallo e33c6fddda Do not rely on deviceObject.sessions anywhere in sendmessage 10 years ago
Matt Corallo 454b4726bd Replace load/decode/index around our own number with helpers 10 years ago
lilia 857eee5003 Divorce identity wipe from tryAgain functions
We'd like to live in a world where we can retry all the pending
conflicts in a conversation as a batch, which means we don't want to
wipe the identity key before processing each message. Thus, remove that
step from these handlers and encapsulate in a method on the conversation
model.
10 years ago
lilia c642854ddf Extract app-level logic from libtextsecure
Ensure that both tryAgain functions return promises, allowing the
application to take appropriate action in the result of success or
failure. This lets us remove all dependency from libtextsecure on
app-level constructs like message objects/ids and the `extenion.trigger`
function.

Corresponding frontend changes to follow in another commit.
10 years ago
Matt Corallo d3c158f4cf Move libaxolotl out-of-tree 10 years ago
lilia 676ad04958 Add device storage method to wipe an identity 10 years ago
Matt Corallo 9c3f8a1868 Dont send group-update right before we quit the group
Fixes #166
10 years ago
lilia 40351fcc54 Sync outgoing messages
When sending an constrct a copy of the PushMessageContent protobuf, add
a SyncMessageContext, and send it to ourselves. Do this for all kinds of
group messages, and individual text/media messages, but not closeSession
messages as the latter are device-specific.

Do not sync messages if we are the primary device, which should only be
supported in development. Normal web clients must be paired with a
android or ios master device, and even in dev, a primary/standalone web
client does not support linking additional devices.
10 years ago
lilia 0e8a5806a8 Fix textsecure.closeSession
sendIndividualProto requires a timestamp.
10 years ago
Matt Corallo 1e318a8293 Add missing TODO 10 years ago
Matt Corallo b356403061 De-duplicate registrationId in deviceObject 10 years ago
Matt Corallo 1806210b26 Rewrite most of the device storage stuff 10 years ago
Matt Corallo 7d2d2d92fc Copy getRandomBytes from libaxolotl to libtextsecure 10 years ago
Matt Corallo 12844590f5 Move prekey sigcheck to libaxolotl 10 years ago
Matt Corallo bb32a51d66 s/textsecure.protocol/axolotl.protocol/ 10 years ago
Matt Corallo 403ae4376d Move attachment/websocket [en|de]cryption to libtextsecure 10 years ago
Matt Corallo 66cf5b08db Naively move textsecure.crypto into axolotl.crypto 10 years ago
Matt Corallo c112c59ce6 Fix group send (fixes #129) 10 years ago
lilia 44007ca58f Add rudimentary ui for sending a group update 10 years ago
Matt Corallo 07899557dc Give libtextsecure its own components (with way fewer deps) 10 years ago
Matt Corallo 8ad1a38b5b Move js files around for libtextsecure split 10 years ago