Commit graph

77 commits

Author SHA1 Message Date
sachaaaaa
847401e49a restore ciphertext padding 2018-11-15 12:35:46 +11:00
Beaudan
9731c9e086 Comment out some signal server based code causing errors. Return before trying to unpad message because they aren't being padded in the first place 2018-11-14 13:20:18 +11:00
sachaaaaa
ad1cf94526 ES2015 classes for LokiServer and FallBackSessionCipher 2018-11-13 15:03:06 +11:00
BeaudanBrown
9ceb3c8ac0
Merge branch 'development' into message-polling 2018-11-13 11:18:52 +11:00
Beaudan
c59b196487 Now reading messages and adding them to conversations. Some cleaning of unreachable code. Modified the message data to be encoded as base64 string before sending to server
Sending our public key in header of message

Now attaching our key to the source field when sending messages, allows messages to be decrypted with the fallback cypher

Now polling the server for messages every 5 seconds

Sending the source device with messages

Added mock respond function to request to leave it that same as the websocket stuff. RetrieveMessages now just returns the result

Polling now continues if the server responds with an error. Returning only the result from sendMessage and retrieveMessages

Revert commenting of unreachable code

Refactored http logic into own file

Revert a change to websocket-resources
2018-11-13 10:13:19 +11:00
Mikunj
2fabd93fd6 Fix message sending 2018-11-08 11:03:11 +11:00
Mikunj
77602e3dbb Moved contactPreKey and contactSignedPreKey to sql. 2018-11-08 09:48:49 +11:00
Mikunj
f589fdac5c Merge signal changes into branch. 2018-11-07 15:26:37 +11:00
sachaaaaa
dda71cbea1 always lock editor after sending friend request. unlock if error. 2018-11-01 17:07:07 +11:00
sachaaaaa
4b9fcb98d4 Linting and other housekeeping stuff 2018-11-01 11:10:30 +11:00
sachaaaaa
13858dfa66 yarn.lock and fix missing variable in transmission error handling 2018-10-26 10:12:26 +11:00
sachaaaaa
143b1e883d
Merge pull request #17 from sachaaaaa/lock_input_friend_request
Lock input after friend request is sent
2018-10-25 10:47:38 +11:00
sachaaaaa
1cf8710127
Merge pull request #16 from sachaaaaa/friend_response
Handle prekeys in incoming friend request
2018-10-24 16:57:20 +11:00
Beaudan
d9c89376cb Added logic to pass tll into transmitMessage function, with default value of 24 hours.
TODO: ensure that the target calculation for the PoW is adjusting appropriately for the different ttl values.
2018-10-23 15:54:44 +11:00
sachaaaaa
fb020f88ea call 'onFriendRequestSent' only after the message was successfully sent 2018-10-23 15:40:59 +11:00
sachaaaaa
93f1534512 Save prekeys upon reception of friend request. Add function to send an empty message as friend request acceptance 2018-10-19 11:00:32 +11:00
sachaaaaa
b9dbf11ebc Fix various things from previous commits 2018-10-18 16:44:50 +11:00
sachaaaaa
5602f4bfff Change placeholder in discussion 2018-10-18 15:09:02 +11:00
sachaaaaa
d4d0d05adf Lock text input while waiting for friend request reply 2018-10-18 13:42:06 +11:00
sachaaaaa
886f47b8e7
Prekeys sending: first pass (#12)
* add 'recipient' attribute in prekey database to allow binding a prekey to a recipient pub key

* Attach a PreKeyBundleMessage to the ContentMessage in fallback encryption mode

* Skip generating 100 prekeys upon registration

* Store the signed key signature in database
2018-10-18 12:12:44 +11:00
sachaaaaa
9677f8b648
Merge branch 'development' into send_as_bytes 2018-10-11 14:13:31 +11:00
sachaaaaa
be29ea725a revert libsignal-protocol and convert binary-encoded string to Uint8Array later down the line 2018-10-09 15:54:09 +11:00
sachaaaaa
6fe70b9b85 Send outgoing messages as raw bytes (Uint8Array) and moved recipient & ttl to header 2018-10-09 14:43:55 +11:00
sachaaaaa
9da4e94276 print outgoing messages as bytes, that can be injected in the mock socket server for debugging 2018-10-08 15:14:38 +11:00
sachaaaaa
04b45f6aa1 Decrypt friend-request messages (the ones using fallback encryption). Moved logic into a new file libloki-protocol.js and concat loki code into js/libloki.js 2018-10-08 15:04:14 +11:00
sachaaaaa
5e9f4177ff style nits 2018-10-08 15:03:32 +11:00
sachaaaaa
d6954aa91c Wrap outgoing message in a WebSocketMessage proto object to match incoming format 2018-10-08 12:08:29 +11:00
sachaaaaa
42e941531f Add fallback encryption (FallBackSessionCipher. simple DH) for when key bundle hasn't been received yet. Skip padding of bytes. 2018-10-05 13:15:49 +10:00
sachaaaaa
b7ca5562b2 remove debugging code that skips encryption 2018-08-23 15:31:10 +10:00
sachaaaaa
fbf13e1873 make transmitMessage call loki_message_api.sendMessage instead of webapi::sendMessage 2018-08-23 15:05:59 +10:00
sachaaaaa
0832806bd9 wip: added helper to create mock contacts, almost got a session working 2018-08-22 17:02:58 +10:00
sachaaaaa
b84ff76faf Fix error handling when sending message + clean up in loki_message_api 2018-08-22 12:12:31 +10:00
sachaaaaa
8ada6ce8ad serialize message as base64 2018-08-22 09:41:54 +10:00
sachaaaaa
1e14022e2f Add skeleton for Loki Message API. Wrap data in json (for now?) 2018-08-21 19:44:30 +10:00
Scott Nonnenberg
0774ba2903 Eslintify all of libtextsecure 2018-07-21 14:52:43 -07:00
Scott Nonnenberg
5933a34a18 Use window.log in browser context, turn on console eslint rule 2018-07-21 14:52:43 -07:00
Scott Nonnenberg
a0ed993b42 Now we've got everything prettified! 2018-05-02 13:40:57 -07:00
Daniel Gasienica
95321e5d3e Remove Vim mode lines 2018-04-30 16:53:34 -04:00
Lilia
52cc8355a6 Feature: Blue check marks for read messages if opted in (#1489)
* Refactor delivery receipt event handler

* Rename the delivery receipt event

For less ambiguity with read receipts.

* Rename synced read event

For less ambiguity with read receipts from other Signal users.

* Add support for incoming receipt messages

Handle ReceiptMessages, which may include encrypted delivery receipts or read
receipts from recipients of our sent messages.

// FREEBIE

* Rename ReadReceipts to ReadSyncs

* Render read messages with blue double checks

* Send read receipts to senders of incoming messages

// FREEBIE

* Move ReadSyncs to their own file

// FREEBIE

* Fixup old comments on read receipts (now read syncs)

And some variable renaming for extra clarity.

// FREEBIE

* Add global setting for read receipts

Don't send read receipt messages unless the setting is enabled.
Don't process read receipts if the setting is disabled.

// FREEBIE

* Sync read receipt setting from mobile

Toggling this setting on your mobile device should sync it to Desktop. When
linking, use the setting in the provisioning message.

// FREEBIE

* Send receipt messages silently

Avoid generating phantom messages on ios

// FREEBIE

* Save recipients on the outgoing message models

For accurate tracking and display of sent/delivered/read state, even if group
membership changes later.

// FREEBIE

* Fix conversation type in profile key update handling

// FREEBIE

* Set recipients on synced sent messages

* Render saved recipients in message detail if available

For older messages, where we did not save the intended set of recipients at the
time of sending, fall back to the current group membership.

// FREEBIE

* Record who has been successfully sent to

// FREEBIE

* Record who a message has been delivered to

* Invert the not-clickable class

* Fix readReceipt setting sync when linking

* Render per recipient sent/delivered/read status

In the message detail view for outgoing messages, render each recipient's
individual sent/delivered/read status with respect to this message, as long as
there are no errors associated with the recipient (ie, safety number changes,
user not registered, etc...) since the error icon is displayed in that case.

*Messages sent before this change may not have per-recipient status lists
and will simply show no status icon.

// FREEBIE

* Add configuration sync request

Send these requests in a one-off fashion when:
  1. We have just setup from a chrome app import
  2. We have just upgraded to read-receipt support

// FREEBIE

* Expose sendRequestConfigurationSyncMessage

// FREEBIE

* Fix handling of incoming delivery receipts - union with array

FREEBIE
2017-10-04 15:28:43 -07:00
Scott Nonnenberg
7e8f3ab5e7
Fix for "Can't find record for undefined.1"
Also, we didn't need to recalculate the number here anyway!

FREEBIE
2017-08-04 15:23:54 -07:00
Scott Nonnenberg
e223db56d9 Set messageKeysLimit to unlimited if communicating with our devices (#1348)
Set messageKeysLimit to unlimited if communicating with our devices

FREEBIE
2017-08-04 12:25:30 -07:00
Scott Nonnenberg
224140c911 OutgoingMessage: Provide proper timestamp for replayability
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
5d1150e5bc Fix call to reloadDevicesAndSend - it returns a function
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
4ee4ad80c3 Message.send - check for missing identityKey, also add logging
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
551aa24e9a OutgoingMessage: A few code style tweaks to make things readable
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
116e4d2eeb OutgoingMessage: Reduce the calls to registerError
In some cases, due to promise chaining and error propagation, we were
calling registerError more than once for a given error. This would then
cause the overall callback for the send operation to be called with a
partial set of errors, as well as duplicates.

Note: we do need to find a way to attach identityKey to the
OutgoingIdentityKeyError in the case where it comes directly from the
encrypt() instead of our pre-key operations.

FREEBIE
2017-08-04 12:03:25 -07:00
lilia
4232f5711c Handle identity key change errors on encrypt
We need to capture key change errors from the protocol library when we call
encrypt. Previously we would only see these on session init.

// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
3afe378063 Remove legacy property from OutgoingMessage 2017-07-05 18:05:56 -07:00
lilia
d47ced1199 Don't recompute outgoing message padding
We can use the same padded plaintext across multiple numbers or attempts rather
than re-creating it every time we encrypt to a particular number.

// FREEBIE
2017-07-05 18:05:56 -07:00
lilia
30201969be Inline some functions in OutgoingMessage
Since we no longer have legacy messages to send, we can simplify things a bit
here.

// FREEBIE
2017-07-05 18:05:56 -07:00