1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-07 23:02:56 +03:00
Commit Graph

1443 Commits

Author SHA1 Message Date
Hubert Chathi
07c2e34d87 Merge branch 'develop' into dbkr/cross_signing 2019-06-14 22:57:02 -04:00
Bruno Windels
811a98ad19 whitespace, newlines 2019-06-13 12:28:02 +02:00
Bruno Windels
b005b75331 comment typo
Co-Authored-By: J. Ryan Stinnett <jryans@gmail.com>
2019-06-13 12:26:38 +02:00
Bruno Windels
a9f9e2cf35 comment typo
Co-Authored-By: J. Ryan Stinnett <jryans@gmail.com>
2019-06-13 12:26:38 +02:00
Bruno Windels
7d2f7fae45 fix tests 2019-06-13 12:26:38 +02:00
Hubert Chathi
4c6fa89053 various cross-signing fixes and improvements 2019-06-12 11:47:12 -04:00
Hubert Chathi
6f6e7ea921 verify cross-signing key with SAS 2019-06-05 15:27:31 -04:00
Hubert Chathi
0c714ba4a1 some cleanups 2019-06-05 15:24:03 -04:00
Hubert Chathi
6a77df7b41 Merge branch 'develop' into dbkr/cross_signing 2019-06-05 12:48:17 -04:00
Travis Ralston
26c1c6db3b Fix tests and populate the right IS validation object 2019-06-04 23:51:41 -06:00
Hubert Chathi
4a9a1b40e9 initial implementation of secret storage and sharing 2019-06-04 15:04:45 -04:00
J. Ryan Stinnett
842ce30190 Fix lint error in login.spec.js 2019-05-31 09:54:47 +01:00
Travis Ralston
a0456dc430 Merge pull request #924 from jkasun/loglevel-extend
Extend loglevel logging for the whole project
2019-05-30 11:20:49 -06:00
Hubert Chathi
95131c7658 add test for syncing trust on another user 2019-05-29 17:01:25 -04:00
Hubert Chathi
936eef194a minor fixes to tests 2019-05-29 17:01:13 -04:00
Hubert Chathi
53804cac5c save cross-signing keys from sync and verify new keys for user 2019-05-28 22:28:54 -04:00
Sergii Stotskyi
4ef970b4da fix(login): saves access_token and user_id after login for all login types
Signed-off-by: Sergii Stotskyi <sergiy.stotskiy@gmail.com>

Fixes #876
2019-05-28 17:47:49 +03:00
Hubert Chathi
193ad9e09d use 3 keys for cross-signing 2019-05-23 18:18:21 -04:00
Janith Kasun
de8063a43a Merge branch 'develop' into loglevel-extend 2019-05-19 09:40:38 +05:30
jkasun
a73dabcb67 Console logging to loglevel 2019-05-19 09:29:40 +05:30
J. Ryan Stinnett
761806c678 Add support for class properties
This enables compiler and linting features to allow class properties like we do
in the React SDK.
2019-05-13 13:52:37 +01:00
Hubert Chathi
405451d783 complete some more unit tests 2019-05-03 23:23:08 -04:00
Hubert Chathi
b0275afac2 remove some debugging lines 2019-05-03 23:22:51 -04:00
Hubert Chathi
ae71f41138 add missing files 2019-05-03 18:12:17 -04:00
Travis Ralston
af93401385 Use more appropriate errors for some situations 2019-04-16 11:13:36 -06:00
Travis Ralston
0f2f041d8b Use constants for autodiscovery errors
To ease usage
2019-04-15 22:04:24 -06:00
Travis Ralston
fe47435fc7 Fix tests for autodiscovery 2019-04-15 21:12:17 -06:00
Hubert Chathi
0a82c84006 Merge pull request #882 from uhoreg/fix_mac
support both the incorrect and correct MAC methods
2019-04-05 16:45:45 -04:00
Hubert Chathi
01af303d63 fix the selection of the verification methods, and test more things 2019-04-04 14:08:30 -04:00
J. Ryan Stinnett
6ba7e85e24 Ensure we have crypto before accessing it in Room model
If crypto startup has failed, we shouldn't try to access any of its methods.
This fixes a variant of this in the `Room` model.
2019-04-04 12:06:41 +01:00
Hubert Chathi
d1e64d0cfb support both the incorrect and correct MAC methods
also do some refactoring to make it easier to support choices in the other
methods in the future
2019-04-02 23:36:49 -04:00
J. Ryan Stinnett
5a26503da7 Remove sessionStore to cryptoStore migration path
The code to migrate from the `sessionStore` to `cryptoStore` originally appeared
in https://github.com/matrix-org/matrix-js-sdk/pull/584 (2017-12-06). At this
point, it seems safe to assume most sessions that need migrating have already
done so. Removing this code simplifies store handling and removes the
`sessionStore` from most places in JS SDK.
2019-03-20 16:56:47 +00:00
Hubert Chathi
79ca235e7c only create one session at a time per device 2019-03-12 16:04:26 -04:00
Hubert Chathi
81946294d8 use lolex to fake the timer 2019-03-06 14:42:52 -05:00
Hubert Chathi
9e29289dcc use a different transaction ID when re-sending a key request 2019-03-06 12:02:48 -05:00
Hubert Chathi
5480e8e1d5 refactor key sharing requests
use sendRoomKeyRequest with a new resend flag, instead of cancelRoomKeyRequest,
when requesting keys, so that we make sure that we send a new request if there
is no previous request

fixes https://github.com/vector-im/riot-web/issues/6838
2019-03-04 17:09:56 -05:00
Hubert Chathi
98fdcabc00 stop client after each test 2019-03-04 16:59:54 -05:00
Hubert Chathi
86ef262799 fix c+p comment 2019-03-01 12:15:59 -05:00
Hubert Chathi
a1be24307a lint 2019-02-28 22:54:46 -05:00
Hubert Chathi
4b5623691b handle partially-shared sessions better
- don't cancel key requests if we can't decrypt everything in the session
- overwrite the session key if we get a better version
2019-02-28 16:01:29 -05:00
Hubert Chathi
999ed1b5b3 Merge pull request #837 from uhoreg/emoji_sas
change hex SAS verification to decimal and emoji
2019-02-08 11:44:53 -05:00
Hubert Chathi
fb673b0304 change hex SAS verification to decimal and emoji 2019-02-08 00:56:30 -05:00
David Baker
1a425af3f2 Pass backup info here too 2019-02-07 15:51:51 +00:00
David Baker
9bafed2c26 OK fine, we'll use the session store 2019-02-07 15:33:49 +00:00
Hubert Chathi
244e1b84f7 Initial implementation of key verification 2019-01-23 13:34:25 -05:00
Travis Ralston
fb756208d8 Merge pull request #814 from trashhalo/rebase-tip
Contributing: Note that rebase lets you mass signoff commits

replace find loop + slice with a single filter. More readable

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

keep public APIs consistent with previous behaviour now that its fuzzy

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

make tests not fail, because of order of occurrence

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

do falsey displayname check regardless of whether we have roomstate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

add tests for the fuzzy disambiguation between members in a room

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

remove duplicated call
2018-12-30 00:18:05 +00:00
J. Ryan Stinnett
5e3f42ec5a Use olm-loader in all crypto tests
Standardize on importing `olm-loader` rather than pasting the same boilerplate
in different tests.  Importantly, `spec/unit/crypto.spec.js` did not include any
loading approach, so it would only find Olm if some other test loaded it first.

Signed-off-by: J. Ryan Stinnett <jryans@gmail.com>
2018-12-13 08:59:57 +00:00
J. Ryan Stinnett
6cf9563441 Avoid checking key backup status if guest
Fixes vector-im/riot-web#7839.

Signed-off-by: J. Ryan Stinnett <jryans@gmail.com>
2018-12-12 22:26:01 +00:00
Travis Ralston
c4452909e7 Support .well-known autodiscovery in the js-sdk (#799)
* Support .well-known autodiscovery in the js-sdk

It's much more useful here than in the react-sdk as it can be reused by more applications. This is also required to make the react-sdk a little easier to manage .well-known lookups as soon it'll be doing it in several places. 

Automatic discovery is an abstract concept in the spec and could include more than .well-known in the future, so this is made to be generic enough to support future mechanisms and other resources to discover. There's also a ton of comments (more than normally needed) as people may wish to use this as a reference in their own implementation and it doesn't hurt to explain what everything is doing.

Many of the functions are air lifted from the react-sdk and modified to work within the confines of the js-sdk.

* Swap out uglify-js for uglify-es

So we can start using ES6 dependencies without figuring out how to update babel. 

`uglify-es` is compatible with `uglify-js@3` (we were using `@2`) , which is why the same command is used. This commit includes changes to the command line to make the thing run the same as before too.

* Appease the linter

* Appease the linter some more

* Appease the linter: the tiebreaker

* Appease the linter yet again

* Switch to using the already available URL libraries

* Remove excess logging
2018-12-12 08:38:05 -07:00
Hubert Chathi
f8ea019f02 fix some assertions in e2e backup unit test 2018-11-29 11:52:19 -05:00