Commit Graph

537 Commits (5caee59921bcca13e9a21fd0d85ae6334413cc8f)

Author SHA1 Message Date
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 a256f17e19 Cleanup attachment attributes
Convert attachment ids from longs to strings, and byte buffers to
arrays.

// FREEBIE
8 years ago
lilia dcfc4701c2 Tweak socket event logging 8 years ago
lilia 26d97e621b Update libsignal-protocol 8 years ago
lilia a72c2968f2 Handle unknown request types
// FREEBIE
8 years ago
lilia d1114edcd4 Update libsignal-protocol-javascript 1.1.10
// 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 f1a1a819ba Stop parsing attachment ids from attachment urls
See 2111294

Attachment ids are now available in string form from the server
response to `putAttachment`.

// FREEBIE
8 years ago
lilia 280f7a74b1 Fix key change errors while retrying key change errors 8 years ago
lilia e1662f8537 Drop unneeded binds
There are no references to `this` in these functions.

// FREEBIE
8 years ago
lilia 7cbaac5590 Provisioning socket events don't block AccountManager tasks
// FREEBIE
8 years ago
lilia 38a830c561 Fixup account manager task queue
Such that it still pumps tasks if one of them throws/rejects.

// FREEBIE
8 years ago
lilia 51131df23b Update libsignal-protocol-javascript 1.1.9
// FREEBIE
8 years ago
lilia 0fac2e1d68 Log when we see a 0 registrationId
Most likely an indicator that the device we're dealing with is a 3rd
party client.

// FREEBIE
8 years ago
lilia 4e21e783db Fix tests 8 years ago
lilia b92dd45a22 Add signed key rotation and deletion routines
// 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 37ad742ccf Support for server endpoint to set signed key 8 years ago
lilia dfc292ac70 Serialize prekey refreshes & other account mgmt
Fixes #1060

// FREEBIE
8 years ago
lilia f0f6bbb8c0 Update libsignal-protocol 1.1.8
// FREEBIE
8 years ago
lilia 819ba8ee74 Support for undefined preKey 8 years ago
haffenloher d2ddfc72e4 Throw UnregisteredUserErrors in getKeysForNumber() 8 years ago
lilia 053bf20185 Group updates never have body or attachments
Why would they? And group.added isn't used anywhere else.

// FREEBIE
8 years ago
haffenloher 04f0142b23 Ignore missing members in incoming group updates
Previously, updateNumbers would throw an Error, so the whole group
update was discarded.

Signal-Android handles this the same way in
GroupMessageProcessor.handleGroupUpdate().

Closes #1056
8 years ago
lilia 7e06e014c4 Add debug logging for #1030
// FREEBIE
8 years ago
lilia 73e69fe5eb Update libsignal-protocol 1.1.7 9 years ago
lilia 7c81e4ed2e Delete extra space 9 years ago
lilia 02ca0a09ac Remove dead code 9 years ago
lilia d52050d43f Fix group timer updates 9 years ago
lilia 1da44c847b Fix handling sent messages sans expirationStartTimestamp 9 years ago
lilia 86dbbc9f29 Allow null expireTimer in sendmessage 9 years ago
lilia 7eea88a545 Convert expirationStartTimestamp to number 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 448835e4d5 Bail early when processing timer updates
Also let expireTimer default to 0.
9 years ago
lilia 02ea4f2475 Use read receipt envelope to infer startExpirationTime
Avoids display of phantom messages that are only received and marked
read locally long after they have expired on another linked device.
9 years ago
lilia b3e932dce8 Add protocol support for disappearing messages 9 years ago
lilia 89cd40c1f5 Remove stale comment 9 years ago
lilia 0dd7ca2569 Fix tests 9 years ago
lilia fe209a2f41 Upgrade libsignal-protocol v1.1.6 9 years ago
lilia 7b3b01bdf6 Refactor registration event
Make AccountManager into an event target for better separation between
app and service-library handling of registration events.
9 years ago
lilia b1afb79a14 Set theme based on master device userAgent
// FREEBIE
9 years ago
lilia 2b210b3fcd Fix undefined websocket port
Fixes #889

// FREEBIE
9 years ago
lilia 384598fbcc Log websocket urls
// FREEBIE
9 years ago
lilia 0487fa3cd1 Add server fallback port 8443
// FREEBIE
9 years ago
lilia f610233ef6 Add support for syncing blocked numbers
// FREEBIE
9 years ago
lilia 254b6621c2 Update libsignal-protocol v1.1.5
// FREEBIE
9 years ago
lilia d11f9fd538 Update libsignal-protocol v1.1.4
// FREEBIE
9 years ago
lilia 4c0ed76909 Update libsignal-protocol v1.1.3
// FREEBIE
9 years ago
lilia 2cea499736 Reduce log noise from prekey messages
// FREEBIE
9 years ago
lilia c39d6687e5 Reduce log noise from delivery receipts
Stop logging envelope messages on receipts since we log the same info as
a receipt in background.js.

// FREEBIE
9 years ago
lilia 005444d09a Update libsignal-protocol v1.1.2
// FREEBIE
9 years ago
lilia 5059fd237a Disable keepalive logging
// FREEBIE
9 years ago
lilia 80c6a2802f Handle sync request where no groups are sent
If a user has no groups, no group sync message is sent. This is a normal
result that should result in a success event rather than a timeout.

// FREEBIE
9 years ago
lilia 5fcf2ea66f Update libsignal-protocol v1.1.1
// FREEBIE
9 years ago
lilia 167f19153c Update libsignal-protocol v1.1.0
Moves padding operations to the service library.

// FREEBIE
9 years ago
lilia b8fddfbbdd Update libsignal-protocol v1.0.0
// FREEBIE
9 years ago
lilia d89c3e8e86 Remove devices with no keys
// FREEBIE
9 years ago
lilia 89d3b772d5 Define UnregisteredUserError class
// FREEBIE
9 years ago
lilia 81dfdd959f Don't allow retry on unregistered user errors
// FREEBIE
9 years ago
lilia 331ca46d75 Fix websocket event name
Fixes #798

// FREEBIE
9 years ago
lilia 15e964de81 Update libsignal-protocol v0.13.0
* libsignal.Curve is now a synchronous interface.
* libsignal.Curve.async is now the asynchronous interface.
* Fixes bugs in session management.

// FREEBIE
9 years ago
lilia f216262298 Update libsignal-protocol v0.12.0
Moves version byte check to protocol lib.

// FREEBIE
9 years ago
lilia 055c0c323e Remove unneeded property from device object
// FREEBIE
9 years ago
lilia f8e176fd40 Dedupe methods
Define textsecure.crypto in terms of libsignal.crypto.

// FREEBIE
9 years ago
lilia 58452066aa Move device storage methods to outgoing message
This is the only place they are called.

// FREEBIE
9 years ago
lilia daae664965 Remove unused function
// 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 95935f70ee Remove relay check from sendmessage
We don't currently store any relay information about devices,
and

// FREEBIE
9 years ago
lilia f16803018c Update libsignal-protocol v0.11.0
* Changes return type from decryption functions
* Update components

// FREEBIE
9 years ago
lilia 148bd32671 Update libsignal-protocol v0.10.0
* Changes policy for old session deletion
* Renames putIdentityKey to saveIdentity
* Remove device messages

// FREEBIE
9 years ago
lilia ffa702c934 Update libsignal-protocol v0.9.0
* Exposes crypto APIs.
* Move worker methods to libsigna.worker.
* Move ProvisioningCipher to libtextsecure.
9 years ago
lilia cd2218ada7 Move hard-coded worker url out of libtextsecure
// FREEBIE
9 years ago
lilia d5f4665fa4 MessageReceiver uses SessionCipher to retry conflicts
// FREEBIE
9 years ago
lilia 9ecfe6acb0 Use SignalProtocolAddress in MessageReceiver constructor
// FREEBIE
9 years ago
lilia 213b44935d Update libsignal-protocol v0.8.0
Reorder identity key check
9 years ago
lilia eee93987f8 Update libsignal-protocol v0.7.0
Remove unused methods.

// FREEBIE
9 years ago
lilia 6266050a67 Remove unused jobqueue
// FREEBIE
9 years ago
lilia 050ea87aaf Get device ids instead of objects
// FREEBIE
9 years ago
lilia 7939b6ae98 Remove hasOpenSession from protocol_wrapper
// FREEBIE
9 years ago
lilia 0483fa2f97 Remove closeOpenSessionForDevice from protocol_wrapper
// FREEBIE
9 years ago
lilia 0d5ec60a7a Remove handlePreKeyWhisperMessage from protocol_wrapper
// FREEBIE
9 years ago
lilia 8010a09045 Remove decryptWhisperMessage from protocol_wrapper
// FREEBIE
9 years ago
lilia 891ddacd35 Remove processPreKey from protocol_wrapper
Use SessionBuilder directly instead of protocol_wrapper

// FREEBIE
9 years ago
lilia 843036f0ce Remove getRegistrationId and encryptMessageFor from protocol_wrapper
We can now use protocol classes like SessionCipher directly because it
supports per-device read/write serialization internally.

// FREEBIE
9 years ago
lilia 284cf5be3a Update libsignal-protocol v0.6.0
Adds session accessors on SessionCipher and an internal session lock to
replace the same implemented in protocol_wrapper.js

// FREEBIE
9 years ago
lilia 92293f9da9 Update libsignal-protocol v0.5.0
Renames libsignal.util to libsignal.KeyHelper.

// FREEBIE
9 years ago
lilia e68031019b Integrate libsignal.SessionCipher
Bypass the old protocolInstance wrapper methods and use the shiny new
SessionCipher class directly.

// FREEBIE
9 years ago
lilia 9e6ad27fc5 Update libsignal-protocol v0.4.0
// FREEBIE
9 years ago
lilia 418adff2a8 Rename device_storage_test.js
// FREEBIE
9 years ago
lilia 56238136ca Remove trivial wrapper method
// FREEBIE
9 years ago
lilia 78cdc0cb52 Remove tempKeys
Now that we simply establish and save a session via SessionBuilder
rather than saving the keys to pass in during encrypt, we can stop
caching them in memory in between the identity key check and the
encryption step.

// FREEBIE
9 years ago
lilia 519d3ec31b Update libsignal-protocol
// FREEBIE
9 years ago
lilia 9f871db48a Update libsignal-protocol / Update prekey format
Integrates change in prekey object formatting, which now matches more
conveniently with the representation rendered by the server.

// FREEBIE
9 years ago
lilia f173104c82 Tests for isTrustedIdentity
// FREEBIE
9 years ago
lilia b385b6e48e Update libsignal-protocol
SessionBuilder / SessionRecord refactor.

// FREEBIE
9 years ago
lilia e659104cbf Add isTrustedIdentity to SignalProtocolStore
Adds a new required storage method for the protocol library.

// FREEBIE
9 years ago
lilia 7dcaf721ca Add keepalive logging
// FREEBIE
9 years ago
lilia 91bdd37019 Fix tests
// FREEBIE
9 years ago
lilia b160556d6e Change filename
// FREEBIE
9 years ago
lilia 9a1a3bdf64 Rename axolotl to libsignal
// FREEBIE
9 years ago
lilia 6bffd50009 Fix comment
// FREEBIE
9 years ago
lilia 1d60dc38fb Rename axolotl storage
// FREEBIE
9 years ago
lilia ee3bc11e3c Rename axolotlInstance
// FREEBIE
9 years ago
lilia 0fe3497d0e Update libsignal-protocol
Remove remaining refs to axolotl from lsp.

// FREEBIE
9 years ago
lilia 4169336776 Update libsignal protobuf package name
// FREEBIE
9 years ago
lilia c1e1dd97ba Change libsignal-protocol filenames
// FREEBIE
9 years ago
lilia b1d370755a Rename AxolotlStore
// FREEBIE
9 years ago
lilia 1fe5d63015 Update protocol libs
Rename storage functions

// FREEBIE
9 years ago
lilia 6a928e3377 Fix reference error in MessageReceiver from fe82e4
Fix a reference error when resolving a key conflict on an incoming end
session message. See Signal-Android/5438.

// FREEBIE
9 years ago
lilia 2d6d2a92b9 Update libaxolotl
// FREEBIE
9 years ago
lilia af392c077d Update libaxolotl
// FREEBIE
9 years ago
lilia 7e2c6fd6bc Remove unused argument
// FREEBIE
9 years ago
lilia ddcdc9e2ff Log on prekey messages
// FREEBIE
9 years ago
lilia 960519d296 Add debug logging
// FREEBIE
9 years ago
lilia 2128ee63aa Update libaxolotl
// FREEBIE
9 years ago
lilia 84235ef58e Use forEach instead of loop
// FREEBIE
9 years ago
lilia c02054d5da Pass ciphertext as ArrayBuffer instead of string
// FREEBIE
9 years ago
lilia 6053fe67ba Use built-in string conversion on protobuf
In lieu of a global helper.

// 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 c22a205d2e Remove unnecessary conversion from test
// FREEBIE
9 years ago
lilia 7dff9ac51b Update libaxolotl
// FREEBIE
9 years ago
lilia 57d64fe669 Fix session corruption due to database races
Prevent races between encrypt and decrypt calls, and other read/write
operations on the session store by serializing session io ops per
device.

Possible fix for #535

// FREEBIE
9 years ago
lilia 5f07c74f1a Add log statement when opening provisioning socket
Make it more obvious via logs which server someone is attempting to
register with (i.e., to disambiguate staging from prod).

// 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 8fdf58971c Add missing semicolons
// 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 010297f4c5 Track groups I've left
// 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 b73a3aea80 Fix syntax error
// FREEBIE
9 years ago
lilia cee2b3163a Add missing bind in messageReceiver
// FREEBIE
9 years ago
lilia 7dcad67410 Fix handleSentMessage
Missing a bind in 27fe7e3.

// FREEBIE
9 years ago
lilia d4760452d1 Add signal agent to server requests
// FREEBIE
9 years ago
lilia 27fe7e355e Process end session flags in sync messages
Because remote clients will delete all sessions in response to an end
session message, regardless of which device it came from, when our
linked device sends an end session message, we must also end all
sessions with the destination.

This change moves the end session flag processing to processDecrypted,
which is shared between handlers of sent messages, data messages, and
messages which are re-tried after resolving identity conflicts.

// FREEBIE
9 years ago
lilia fe82e469f2 Make end session consistent with android
Close all the sessions for a number when receiving an end session
message.

// 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 7c17c5fa54 Update chai
// FREEBIE
9 years ago
lilia 1ee6a2e43f Rebuild libtextsecure test components w/ new chai
// FREEBIE
9 years ago
lilia a9cba1471a Update our own key on re-install
Previously we would delete our own key from the trust store when
re-linking, in case it changed. We can also immediately take one step
further and store the new key. Typically this happens in the course of
requesting sync info from the master device, except in the case of
standalone clients.

Closes #596

// FREEBIE
9 years ago
lilia 30aa13079f Fix sync request argument check
Fixes #609

// FREEBIE
9 years ago
lilia d6da77b6f4 Throw exception on bad args to SyncRequest
// FREEBIE
9 years ago
lilia 1b68e652cc Fire group sync completion event despite errors
Sometimes an error is thrown while processing groups from a group sync
message. We still want to fire the groupsync event when we're done
handling all the data, even if some of it was bad.
9 years ago